Salome HOME
8d78a468d07c47b38fa39341c12ddbb47bdc00d9
[modules/geom.git] / src / GEOMImpl / GEOMImpl_BlockDriver.hxx
1 //  File   : GEOMImpl_BlockDriver.ixx
2 //  Module : GEOMImpl
3
4 #ifndef _GEOMImpl_BlockDriver_HeaderFile
5 #define _GEOMImpl_BlockDriver_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_BlockDriver;
36
37 Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMImpl_BlockDriver);
38
39 class Handle(GEOMImpl_BlockDriver) : 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_BlockDriver)():Handle(TFunction_Driver)() {}
55     Handle(GEOMImpl_BlockDriver)(const Handle(GEOMImpl_BlockDriver)& aHandle) : Handle(TFunction_Driver)(aHandle)
56      {
57      }
58
59     Handle(GEOMImpl_BlockDriver)(const GEOMImpl_BlockDriver* anItem) : Handle(TFunction_Driver)((TFunction_Driver *)anItem)
60      {
61      }
62
63     Handle(GEOMImpl_BlockDriver)& operator=(const Handle(GEOMImpl_BlockDriver)& aHandle)
64      {
65       Assign(aHandle.Access());
66       return *this;
67      }
68
69     Handle(GEOMImpl_BlockDriver)& operator=(const GEOMImpl_BlockDriver* anItem)
70      {
71       Assign((Standard_Transient *)anItem);
72       return *this;
73      }
74
75     GEOMImpl_BlockDriver* operator->()
76      {
77       return (GEOMImpl_BlockDriver *)ControlAccess();
78      }
79
80     GEOMImpl_BlockDriver* operator->() const
81      {
82       return (GEOMImpl_BlockDriver *)ControlAccess();
83      }
84
85    Standard_EXPORT ~Handle(GEOMImpl_BlockDriver)() {};
86
87    Standard_EXPORT static const Handle(GEOMImpl_BlockDriver) 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_BlockDriver : 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_BlockDriver();
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_BlockDriver() {};
129
130
131  // Type management
132  //
133 Standard_EXPORT friend Handle_Standard_Type& GEOMImpl_BlockDriver_Type_();
134 Standard_EXPORT const Handle(Standard_Type)& DynamicType() const  { return STANDARD_TYPE(GEOMImpl_BlockDriver) ; }
135 Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const { return (STANDARD_TYPE(GEOMImpl_BlockDriver) == AType || TFunction_Driver::IsKind(AType)); }
136
137 private:
138     void MultiTransformate1D (const TopoDS_Shape&    theBlock,
139                               const TopoDS_Shape&    theFace1,
140                               const TopoDS_Shape&    theFace2,
141                               const Standard_Integer theNbIter,
142                               TopoDS_Shape&          theResult) const;
143
144     void MultiTransformate2D (const TopoDS_Shape&    theBlock,
145                               const TopoDS_Shape&    theFace1U,
146                               const TopoDS_Shape&    theFace2U,
147                               const Standard_Integer theNbIterU,
148                               const TopoDS_Shape&    theFace1V,
149                               const TopoDS_Shape&    theFace2V,
150                               const Standard_Integer theNbIterV,
151                               TopoDS_Shape&          theResult) const;
152
153 };
154
155 #endif