0022807: Loading of STEP entities in model during reading of STEP file requires redun...
[occt.git] / src / StepData / StepData.cxx
1 //    abv 09.04.99 S4136: eliminate parameter step.readaccept.void
2 //    svv #2    23.02.00: porting on SIL
3 #include <StepData.ixx>
4 # include <StepData_Protocol.hxx>
5 # include <StepData_DefaultGeneral.hxx>
6 # include <StepData_FileProtocol.hxx>
7 #include <Interface_Static.hxx>
8
9 #include <Interface_Statics.hxx>
10 #include <Interface_Macros.hxx>
11
12
13
14 StaticHandle(StepData_Protocol,proto);
15 //svv #2: StaticHandle(StepData_DefaultGeneral,stmod);
16
17 StaticHandleA(StepData_Protocol,theheader);
18
19
20     void StepData::Init ()
21 {
22 //  InitHandleVoid(StepData_Protocol,proto);
23 //  InitHandleVoid(StepData_DefaultGeneral,stmod);
24 //:S4136  Interface_Static::Init("step","step.readaccept.void",'i',"1");
25 //  if (proto.IsNull()) proto = new StepData_Protocol;
26 //  if (stmod.IsNull()) stmod = new StepData_DefaultGeneral;
27 }
28
29     Handle(StepData_Protocol) StepData::Protocol ()
30 {
31   InitHandleVoid(StepData_Protocol,proto);// svv #2
32 //  UseHandle(StepData_Protocol,proto);
33   return proto;
34 }
35
36
37     void  StepData::AddHeaderProtocol (const Handle(StepData_Protocol)& header)
38 {
39   InitHandle(StepData_Protocol,theheader);
40   if (theheader.IsNull()) theheader = header;
41   else {
42     DeclareAndCast(StepData_FileProtocol,headmult,theheader);
43     if (headmult.IsNull()) {
44       headmult = new StepData_FileProtocol;
45       headmult->Add(theheader);
46     }
47     headmult->Add(header);
48     theheader = headmult;
49   }
50 }
51
52     Handle(StepData_Protocol) StepData::HeaderProtocol ()
53 {
54   UseHandle(StepData_Protocol,theheader);
55   return theheader;
56 }