]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMImpl/GEOMImpl_BooleanDriver.hxx
Salome HOME
0021684: EDF 2221 : Display the arguments and the name of the operations
[modules/geom.git] / src / GEOMImpl / GEOMImpl_BooleanDriver.hxx
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  File   : GEOMImpl_BooleanDriver.ixx
24 //  Module : GEOMImpl
25 //
26 #ifndef _GEOMImpl_BooleanDriver_HeaderFile
27 #define _GEOMImpl_BooleanDriver_HeaderFile
28
29 #ifndef _TColStd_SequenceOfExtendedString_HeaderFile
30 #include <TColStd_SequenceOfExtendedString.hxx>
31 #endif
32 #ifndef _Standard_TypeMismatch_HeaderFile
33 #include <Standard_TypeMismatch.hxx>
34 #endif
35
36 #ifndef _Standard_HeaderFile
37 #include <Standard.hxx>
38 #endif
39
40 #ifndef _Standard_Macro_HeaderFile
41 #include <Standard_Macro.hxx>
42 #endif
43 #ifndef _Standard_HeaderFile
44 #include <Standard.hxx>
45 #endif
46 #ifndef _Standard_GUID_HeaderFile
47 #include <Standard_GUID.hxx>
48 #endif 
49
50 #ifndef _Handle_TFunction_Driver_HeaderFile
51 #include <Handle_TFunction_Driver.hxx>
52 #endif
53
54 #ifndef _TopoDS_Shape_HeaderFile
55 #include <TopoDS_Shape.hxx>
56 #endif
57
58
59 class Standard_Transient;
60 class Handle_Standard_Type;
61 class Handle(TFunction_Driver);
62 class GEOMImpl_BooleanDriver;
63
64 Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMImpl_BooleanDriver);
65
66 class Handle(GEOMImpl_BooleanDriver) : public Handle(TFunction_Driver) {
67   public:
68     inline void* operator new(size_t,void* anAddress) 
69       {
70         return anAddress;
71       }
72     inline void* operator new(size_t size) 
73       { 
74         return Standard::Allocate(size); 
75       }
76     inline void  operator delete(void *anAddress) 
77       { 
78         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
79       }
80
81     Handle(GEOMImpl_BooleanDriver)():Handle(TFunction_Driver)() {} 
82     Handle(GEOMImpl_BooleanDriver)(const Handle(GEOMImpl_BooleanDriver)& aHandle) : Handle(TFunction_Driver)(aHandle) 
83      {
84      }
85
86     Handle(GEOMImpl_BooleanDriver)(const GEOMImpl_BooleanDriver* anItem) : Handle(TFunction_Driver)((TFunction_Driver *)anItem) 
87      {
88      }
89
90     Handle(GEOMImpl_BooleanDriver)& operator=(const Handle(GEOMImpl_BooleanDriver)& aHandle)
91      {
92       Assign(aHandle.Access());
93       return *this;
94      }
95
96     Handle(GEOMImpl_BooleanDriver)& operator=(const GEOMImpl_BooleanDriver* anItem)
97      {
98       Assign((Standard_Transient *)anItem);
99       return *this;
100      }
101
102     GEOMImpl_BooleanDriver* operator->() 
103      {
104       return (GEOMImpl_BooleanDriver *)ControlAccess();
105      }
106
107     GEOMImpl_BooleanDriver* operator->() const 
108      {
109       return (GEOMImpl_BooleanDriver *)ControlAccess();
110      }
111
112    Standard_EXPORT ~Handle(GEOMImpl_BooleanDriver)() {};
113  
114    Standard_EXPORT static const Handle(GEOMImpl_BooleanDriver) DownCast(const Handle(Standard_Transient)& AnObject);
115 };
116
117 #ifndef _TFunction_Driver_HeaderFile
118 #include <TFunction_Driver.hxx>
119 #endif
120 #ifndef _TFunction_Logbook_HeaderFile
121 #include <TFunction_Logbook.hxx>
122 #endif
123 #ifndef _Standard_CString_HeaderFile
124 #include <Standard_CString.hxx>
125 #endif
126
127 class TColStd_SequenceOfExtendedString;
128
129
130 class GEOMImpl_BooleanDriver : public TFunction_Driver {
131
132 public:
133
134     inline void* operator new(size_t,void* anAddress) 
135       {
136         return anAddress;
137       }
138     inline void* operator new(size_t size) 
139       { 
140         return Standard::Allocate(size); 
141       }
142     inline void  operator delete(void *anAddress) 
143       { 
144         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
145       }
146
147  // Methods PUBLIC
148  // 
149 Standard_EXPORT GEOMImpl_BooleanDriver();
150 Standard_EXPORT virtual  Standard_Integer Execute(TFunction_Logbook& log) const; 
151 Standard_EXPORT virtual void Validate(TFunction_Logbook&) const {}
152 Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const { return Standard_True; }
153 Standard_EXPORT static const Standard_GUID& GetID();
154 Standard_EXPORT ~GEOMImpl_BooleanDriver() {};
155
156
157  // Type management
158  //
159 Standard_EXPORT friend Handle_Standard_Type& GEOMImpl_BooleanDriver_Type_();
160 Standard_EXPORT const Handle(Standard_Type)& DynamicType() const  { return STANDARD_TYPE(GEOMImpl_BooleanDriver) ; }
161 Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const { return (STANDARD_TYPE(GEOMImpl_BooleanDriver) == AType || TFunction_Driver::IsKind(AType)); } 
162
163
164 private:
165
166   TopoDS_Shape performOperation(const TopoDS_Shape theShape1,
167                                 const TopoDS_Shape theShape2,
168                                 const Standard_Integer theType) const;
169
170 };
171
172 #endif