Salome HOME
EDF 2281: Added the possibility to choose the orientation of the divided disk
[modules/geom.git] / src / GEOMImpl / GEOMImpl_DividedDiskDriver.hxx
1 //  Copyright (C) 2007-2008  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 #ifndef _GEOMImpl_DividedDiskDriver_HXX
23 #define _GEOMImpl_DividedDiskDriver_HXX
24
25 #include <TFunction_Driver.hxx>
26
27 class Handle_Standard_Type;
28 class GEOMImpl_DividedDiskDriver;
29 class TopoDS_Shape;
30
31 Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMImpl_DividedDiskDriver);
32
33 class Handle(GEOMImpl_DividedDiskDriver) : public Handle(TFunction_Driver) {
34 public:
35   inline void* operator new(size_t,void* anAddress) 
36   {
37     return anAddress;
38   }
39   inline void* operator new(size_t size) 
40   { 
41     return Standard::Allocate(size); 
42   }
43   inline void  operator delete(void *anAddress) 
44   { 
45     if (anAddress) Standard::Free((Standard_Address&)anAddress); 
46   }
47   
48   Handle(GEOMImpl_DividedDiskDriver)():Handle(TFunction_Driver)() {} 
49   Handle(GEOMImpl_DividedDiskDriver)(const Handle(GEOMImpl_DividedDiskDriver)& aHandle) : Handle(TFunction_Driver)(aHandle) 
50   {}
51
52   Handle(GEOMImpl_DividedDiskDriver)(const GEOMImpl_DividedDiskDriver* anItem) : Handle(TFunction_Driver)((TFunction_Driver *)anItem) 
53   {}
54
55   Handle(GEOMImpl_DividedDiskDriver)& operator=(const Handle(GEOMImpl_DividedDiskDriver)& aHandle)
56   {
57     Assign(aHandle.Access());
58     return *this;
59   }
60   
61   Handle(GEOMImpl_DividedDiskDriver)& operator=(const GEOMImpl_DividedDiskDriver* anItem)
62   {
63     Assign((Standard_Transient *)anItem);
64     return *this;
65   }
66   
67   GEOMImpl_DividedDiskDriver* operator->() 
68   {
69     return (GEOMImpl_DividedDiskDriver *)ControlAccess();
70   }
71   
72   GEOMImpl_DividedDiskDriver* operator->() const 
73   {
74     return (GEOMImpl_DividedDiskDriver *)ControlAccess();
75   }
76   
77   Standard_EXPORT ~Handle(GEOMImpl_DividedDiskDriver)() {};
78   
79   Standard_EXPORT static const Handle(GEOMImpl_DividedDiskDriver) DownCast(const Handle(Standard_Transient)& AnObject);
80 };
81
82 class GEOMImpl_DividedDiskDriver : public TFunction_Driver {
83 public:
84   inline void* operator new(size_t,void* anAddress) 
85   {
86     return anAddress;
87   }
88   inline void* operator new(size_t size) 
89   { 
90     return Standard::Allocate(size); 
91   }
92   inline void  operator delete(void *anAddress) 
93   { 
94     if (anAddress) Standard::Free((Standard_Address&)anAddress); 
95   }
96   
97   // Methods PUBLIC
98   // 
99   Standard_EXPORT GEOMImpl_DividedDiskDriver();
100   Standard_EXPORT virtual  Standard_Integer Execute(TFunction_Logbook& log) const; 
101   Standard_EXPORT virtual void Validate(TFunction_Logbook&) const {}
102   Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const
103   {
104     return Standard_True;
105   }
106   Standard_EXPORT static const Standard_GUID& GetID();
107   Standard_EXPORT ~GEOMImpl_DividedDiskDriver() {};
108   
109   // Type management
110   //
111   Standard_EXPORT friend Handle_Standard_Type& GEOMImpl_DividedDiskDriver_Type_();
112   Standard_EXPORT const Handle(Standard_Type)& DynamicType() const
113   {
114     return STANDARD_TYPE(GEOMImpl_DividedDiskDriver);
115   }
116   Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const
117   {
118     return (STANDARD_TYPE(GEOMImpl_DividedDiskDriver) == AType || TFunction_Driver::IsKind(AType));
119   } 
120   
121 private:
122   TopoDS_Shape TransformShape(TopoDS_Shape aShape, int theOrientation) const;
123 };
124
125 #endif // _GEOMImpl_DividedDiskDriver_HXX