0024023: Revamp the OCCT Handle -- general
[occt.git] / src / STEPEdit / STEPEdit.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #include <STEPEdit.ixx>
15
16 #include <StepAP214.hxx>
17 #include <StepAP214_Protocol.hxx>
18
19 #include <APIHeaderSection_MakeHeader.hxx>
20
21 #include <StepSelect_StepType.hxx>
22 #include <IFSelect_SelectSignature.hxx>
23 #include <IFSelect_SelectModelEntities.hxx>
24 #include <IFSelect_SelectModelRoots.hxx>
25
26
27 Handle(Interface_Protocol)  STEPEdit::Protocol ()
28 {
29 /*
30   static Handle(StepData_FileProtocol) proto;
31   if (!proto.IsNull()) return proto;
32   proto =  new StepData_FileProtocol;
33   proto->Add (StepAP214::Protocol());
34   proto->Add (HeaderSection::Protocol());
35   return proto;
36 */
37   return StepAP214::Protocol();
38 }
39
40 Handle(StepData_StepModel)  STEPEdit::NewModel ()
41 {
42   APIHeaderSection_MakeHeader head;
43   return head.NewModel(STEPEdit::Protocol());
44 }
45
46 Handle(IFSelect_Signature)  STEPEdit::SignType ()
47 {
48   static Handle(StepSelect_StepType) sty;
49   if (!sty.IsNull()) return sty;
50   sty = new StepSelect_StepType;
51   sty->SetProtocol (STEPEdit::Protocol());
52   return sty;
53 }
54
55 Handle(IFSelect_SelectSignature)  STEPEdit::NewSelectSDR ()
56 {
57   Handle(IFSelect_SelectSignature) sel = new IFSelect_SelectSignature
58     (STEPEdit::SignType(),"SHAPE_DEFINITION_REPRESENTATION");
59   sel->SetInput (new IFSelect_SelectModelRoots);
60   return sel;
61 }
62
63 Handle(IFSelect_SelectSignature)  STEPEdit::NewSelectPlacedItem ()
64 {
65   Handle(IFSelect_SelectSignature) sel = new IFSelect_SelectSignature
66     (STEPEdit::SignType(),"MAPPED_ITEM|CONTEXT_DEPENDENT_SHAPE_REPRESENTATION",Standard_False);
67   sel->SetInput (new IFSelect_SelectModelEntities);
68   return sel;
69 }
70
71 Handle(IFSelect_SelectSignature)  STEPEdit::NewSelectShapeRepr ()
72 {
73   Handle(IFSelect_SelectSignature) sel = new IFSelect_SelectSignature
74     (STEPEdit::SignType(),"SHAPE_REPRESENTATION",Standard_False);
75 // REPRESENTATION_RELATIONSHIP passe par CONTEXT_DEPENDENT_SHAPE_REPRESENTATION
76   sel->SetInput (new IFSelect_SelectModelEntities);
77   return sel;
78 }