0022807: Loading of STEP entities in model during reading of STEP file requires redun...
[occt.git] / src / Interface / Interface_Protocol.cxx
1 #include <Interface_Protocol.ixx>
2
3 //  Gestion du Protocol actif : tres simple, une variable statique
4
5
6 static Handle(Interface_Protocol)& theactive()
7 {
8   static Handle(Interface_Protocol) theact;
9   return theact;
10 }
11
12
13 //=======================================================================
14 //function : Active
15 //purpose  : 
16 //=======================================================================
17
18 Handle(Interface_Protocol) Interface_Protocol::Active ()
19 {
20   return theactive();
21 }
22
23
24 //=======================================================================
25 //function : SetActive
26 //purpose  : 
27 //=======================================================================
28
29 void Interface_Protocol::SetActive(const Handle(Interface_Protocol)& aprotocol)
30 {
31   theactive() = aprotocol;
32 }
33
34
35 //=======================================================================
36 //function : ClearActive
37 //purpose  : 
38 //=======================================================================
39
40 void Interface_Protocol::ClearActive ()
41 {
42   theactive().Nullify();
43 }
44
45
46 //  ===   Typage (formules fournies par defaut)
47
48
49 //=======================================================================
50 //function : CaseNumber
51 //purpose  : 
52 //=======================================================================
53
54 Standard_Integer Interface_Protocol::CaseNumber
55   (const Handle(Standard_Transient)& obj) const
56 {
57   if (obj.IsNull()) return 0;
58   return TypeNumber(Type(obj));
59 }
60
61
62 //=======================================================================
63 //function : IsDynamicType
64 //purpose  : 
65 //=======================================================================
66
67 Standard_Boolean Interface_Protocol::IsDynamicType
68   (const Handle(Standard_Transient)& /*obj*/) const
69 {
70   return Standard_True;
71 }
72
73
74 //=======================================================================
75 //function : NbTypes
76 //purpose  : 
77 //=======================================================================
78
79 Standard_Integer Interface_Protocol::NbTypes
80   (const Handle(Standard_Transient)& /*obj*/) const
81 {
82   return 1;
83 }
84
85
86 //=======================================================================
87 //function : Type
88 //purpose  : 
89 //=======================================================================
90
91 Handle(Standard_Type) Interface_Protocol::Type
92        (const Handle(Standard_Transient)& obj,
93         const Standard_Integer /*nt*/) const
94 {
95   if (obj.IsNull()) return STANDARD_TYPE(Standard_Transient);
96   return obj->DynamicType();
97 }
98
99
100 //=======================================================================
101 //function : GlobalCheck
102 //purpose  : 
103 //=======================================================================
104
105 Standard_Boolean Interface_Protocol::GlobalCheck(const Interface_Graph& /*graph*/,
106                                                  Handle(Interface_Check)& /*ach*/) const
107 {
108   return Standard_True;
109 }