Salome HOME
Merge with version on tag OCC-V2_1_0d
[modules/geom.git] / src / GEOMImpl / GEOMImpl_GlueDriver.hxx
1 //  File   : GEOMImpl_GlueDriver.ixx
2 //  Module : GEOMImpl
3
4 #ifndef _GEOMImpl_GlueDriver_HeaderFile
5 #define _GEOMImpl_GlueDriver_HeaderFile
6
7 #ifndef _TColStd_SequenceOfExtendedString_HeaderFile
8 #include <TColStd_SequenceOfExtendedString.hxx>
9 #endif
10 #ifndef _Standard_TypeMismatch_HeaderFile
11 #include <Standard_TypeMismatch.hxx>
12 #endif
13
14 #ifndef _Standard_HeaderFile
15 #include <Standard.hxx>
16 #endif
17
18 #ifndef _Standard_Macro_HeaderFile
19 #include <Standard_Macro.hxx>
20 #endif
21 #ifndef _Standard_HeaderFile
22 #include <Standard.hxx>
23 #endif
24 #ifndef _Standard_GUID_HeaderFile
25 #include <Standard_GUID.hxx>
26 #endif 
27
28 #ifndef _Handle_TFunction_Driver_HeaderFile
29 #include <Handle_TFunction_Driver.hxx>
30 #endif
31
32 class Standard_Transient;
33 class Handle_Standard_Type;
34 class Handle(TFunction_Driver);
35 class GEOMImpl_GlueDriver;
36
37 Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMImpl_GlueDriver);
38
39 class Handle(GEOMImpl_GlueDriver) : public Handle(TFunction_Driver) {
40   public:
41     inline void* operator new(size_t,void* anAddress) 
42       {
43         return anAddress;
44       }
45     inline void* operator new(size_t size) 
46       { 
47         return Standard::Allocate(size); 
48       }
49     inline void  operator delete(void *anAddress) 
50       { 
51         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
52       }
53
54     Handle(GEOMImpl_GlueDriver)():Handle(TFunction_Driver)() {} 
55     Handle(GEOMImpl_GlueDriver)(const Handle(GEOMImpl_GlueDriver)& aHandle) : Handle(TFunction_Driver)(aHandle) 
56      {
57      }
58
59     Handle(GEOMImpl_GlueDriver)(const GEOMImpl_GlueDriver* anItem) : Handle(TFunction_Driver)((TFunction_Driver *)anItem) 
60      {
61      }
62
63     Handle(GEOMImpl_GlueDriver)& operator=(const Handle(GEOMImpl_GlueDriver)& aHandle)
64      {
65       Assign(aHandle.Access());
66       return *this;
67      }
68
69     Handle(GEOMImpl_GlueDriver)& operator=(const GEOMImpl_GlueDriver* anItem)
70      {
71       Assign((Standard_Transient *)anItem);
72       return *this;
73      }
74
75     GEOMImpl_GlueDriver* operator->() 
76      {
77       return (GEOMImpl_GlueDriver *)ControlAccess();
78      }
79
80     GEOMImpl_GlueDriver* operator->() const 
81      {
82       return (GEOMImpl_GlueDriver *)ControlAccess();
83      }
84
85    Standard_EXPORT ~Handle(GEOMImpl_GlueDriver)() {};
86  
87    Standard_EXPORT static const Handle(GEOMImpl_GlueDriver) DownCast(const Handle(Standard_Transient)& AnObject);
88 };
89
90 #ifndef _TFunction_Driver_HeaderFile
91 #include <TFunction_Driver.hxx>
92 #endif
93 #ifndef _TFunction_Logbook_HeaderFile
94 #include <TFunction_Logbook.hxx>
95 #endif
96 #ifndef _Standard_CString_HeaderFile
97 #include <Standard_CString.hxx>
98 #endif
99 #include <TopoDS_Shape.hxx>
100
101 class TColStd_SequenceOfExtendedString;
102
103
104 class GEOMImpl_GlueDriver : public TFunction_Driver {
105
106 public:
107
108     inline void* operator new(size_t,void* anAddress) 
109       {
110         return anAddress;
111       }
112     inline void* operator new(size_t size) 
113       { 
114         return Standard::Allocate(size); 
115       }
116     inline void  operator delete(void *anAddress) 
117       { 
118         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
119       }
120
121  // Methods PUBLIC
122  // 
123 Standard_EXPORT GEOMImpl_GlueDriver();
124 Standard_EXPORT virtual  Standard_Integer Execute(TFunction_Logbook& log) const; 
125 Standard_EXPORT virtual void Validate(TFunction_Logbook&) const {}
126 Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const { return Standard_True; }
127 Standard_EXPORT static const Standard_GUID& GetID();
128 Standard_EXPORT ~GEOMImpl_GlueDriver() {};
129
130 Standard_EXPORT static TopoDS_Shape GlueFaces (const TopoDS_Shape& theShape,
131                                                const Standard_Real theTolerance);
132
133  // Type management
134  //
135 Standard_EXPORT friend Handle_Standard_Type& GEOMImpl_GlueDriver_Type_();
136 Standard_EXPORT const Handle(Standard_Type)& DynamicType() const  { return STANDARD_TYPE(GEOMImpl_GlueDriver) ; }
137 Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const { return (STANDARD_TYPE(GEOMImpl_GlueDriver) == AType || TFunction_Driver::IsKind(AType)); } 
138
139
140 };
141
142 #endif