Salome HOME
Update copyright: 2016
[modules/geom.git] / src / GEOMImpl / GEOMImpl_I3DPrimOperations.hxx
1 // Copyright (C) 2007-2016  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, or (at your option) any later version.
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 #ifndef _GEOMImpl_I3DPrimOperations_HXX_
24 #define _GEOMImpl_I3DPrimOperations_HXX_
25
26 #include "Utils_SALOME_Exception.hxx"
27 #include "GEOM_IOperations.hxx"
28 #include "GEOM_Engine.hxx"
29 #include "GEOM_Object.hxx"
30 #include <TDocStd_Document.hxx>
31 #include <TColStd_HSequenceOfTransient.hxx>
32
33 class GEOMImpl_IGroupOperations;
34 class GEOMImpl_IPipe;
35 class TopTools_IndexedMapOfShape;
36
37
38 class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
39  public:
40   Standard_EXPORT GEOMImpl_I3DPrimOperations(GEOM_Engine* theEngine, int theDocID);
41   Standard_EXPORT ~GEOMImpl_I3DPrimOperations();
42
43   Standard_EXPORT Handle(GEOM_Object) MakeBoxDXDYDZ (double theDX, double theDY, double theDZ);
44   Standard_EXPORT Handle(GEOM_Object) MakeBoxTwoPnt (Handle(GEOM_Object) thePnt1,
45                                                      Handle(GEOM_Object) thePnt2);
46   Standard_EXPORT Handle(GEOM_Object) MakeFaceHW (double theH, double theW, int theOrientation);
47   Standard_EXPORT Handle(GEOM_Object) MakeFaceObjHW (Handle(GEOM_Object) theObj,
48                                                      double theH, double theW);
49   Standard_EXPORT Handle(GEOM_Object) MakeDiskThreePnt (Handle(GEOM_Object) thePnt1,
50                                                         Handle(GEOM_Object) thePnt2,
51                                                         Handle(GEOM_Object) thePnt3);
52   Standard_EXPORT Handle(GEOM_Object) MakeDiskPntVecR (Handle(GEOM_Object) thePnt1,
53                                                        Handle(GEOM_Object) theVec,
54                                                        double theR);
55   Standard_EXPORT Handle(GEOM_Object) MakeDiskR (double theR, int theOrientation);
56   Standard_EXPORT Handle(GEOM_Object) MakeCylinderRH       (double theR, double theH);
57   Standard_EXPORT Handle(GEOM_Object) MakeCylinderPntVecRH (Handle(GEOM_Object) thePnt,
58                                                             Handle(GEOM_Object) theVec,
59                                                             double theR, double theH);
60   Standard_EXPORT Handle(GEOM_Object) MakeCylinderRHA       (double theR, double theH, double theA);
61   Standard_EXPORT Handle(GEOM_Object) MakeCylinderPntVecRHA (Handle(GEOM_Object) thePnt,
62                                                              Handle(GEOM_Object) theVec,
63                                                              double theR, double theH, double theA);                                        
64
65   Standard_EXPORT Handle(GEOM_Object) MakeConeR1R2H       (double theR1, double theR2, double theH);
66   Standard_EXPORT Handle(GEOM_Object) MakeConePntVecR1R2H (Handle(GEOM_Object) thePnt,
67                                                            Handle(GEOM_Object) theVec,
68                                                            double theR1, double theR2, double theH);
69
70   Standard_EXPORT Handle(GEOM_Object) MakeSphereR    (double theR);
71   Standard_EXPORT Handle(GEOM_Object) MakeSpherePntR (Handle(GEOM_Object) thePnt, double theR);
72
73   Standard_EXPORT Handle(GEOM_Object) MakeTorusRR (double theRMajor, double theRMinor);
74
75   Standard_EXPORT Handle(GEOM_Object) MakeTorusPntVecRR (Handle(GEOM_Object) thePnt,
76                                                          Handle(GEOM_Object) theVec,
77                                                          double theRMajor, double theRMinor);
78
79   Standard_EXPORT Handle(GEOM_Object) MakePrismVecH (Handle(GEOM_Object) theBase,
80                                                      Handle(GEOM_Object) theVec,
81                                                      double theH, 
82                                                      double theScaleFactor = -1.0);
83
84   Standard_EXPORT Handle(GEOM_Object) MakePrismVecH2Ways (Handle(GEOM_Object) theBase,
85                                                           Handle(GEOM_Object) theVec, double theH);
86
87   Standard_EXPORT Handle(GEOM_Object) MakePrismTwoPnt (Handle(GEOM_Object) theBase,
88                                                        Handle(GEOM_Object) thePoint1,
89                                                        Handle(GEOM_Object) thePoint2,
90                                                        double theScaleFactor = -1.0);
91
92   Standard_EXPORT Handle(GEOM_Object) MakePrismTwoPnt2Ways (Handle(GEOM_Object) theBase,
93                                                             Handle(GEOM_Object) thePoint1,
94                                                             Handle(GEOM_Object) thePoint2);
95
96   Standard_EXPORT Handle(GEOM_Object) MakePrismDXDYDZ (Handle(GEOM_Object) theBase,
97                                                        double theDX, double theDY, double theDZ,
98                                                        double theScaleFactor = -1.0);
99
100   Standard_EXPORT Handle(GEOM_Object) MakePrismDXDYDZ2Ways (Handle(GEOM_Object) theBase,
101                                                             double theDX, double theDY, double theDZ);
102   
103   Standard_EXPORT Handle(GEOM_Object) MakeDraftPrism  (Handle(GEOM_Object) theInitShape, Handle(GEOM_Object) theBase,
104                                                        double theHeight, double theAngle, bool theFuse, bool theInvert = false );
105   
106   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipe
107                             (const Handle(GEOM_Object) &theBase,
108                              const Handle(GEOM_Object) &thePath,
109                              const bool                 IsGenerateGroups);
110
111   Standard_EXPORT Handle(GEOM_Object) MakeRevolutionAxisAngle (Handle(GEOM_Object) theBase,
112                                                                Handle(GEOM_Object) theAxis,
113                                                                double theAngle);
114
115   Standard_EXPORT Handle(GEOM_Object) MakeRevolutionAxisAngle2Ways (Handle(GEOM_Object) theBase,
116                                                                     Handle(GEOM_Object) theAxis,
117                                                                     double theAngle);
118
119   Standard_EXPORT Handle(GEOM_Object) MakeFilling (std::list< Handle(GEOM_Object)> & theContours,
120                                                    int theMinDeg, int theMaxDeg,
121                                                    double theTol2D, double theTol3D,
122                                                    int theNbIter, int theMethod,
123                                                    bool isApprox);
124
125   Standard_EXPORT Handle(GEOM_Object) MakeThruSections
126                                       (const Handle(TColStd_HSequenceOfTransient)& theSeqSections,
127                                        bool theModeSolid,
128                                        double thePreci,
129                                        bool theRuled);
130
131   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
132       MakePipeWithDifferentSections
133               (const Handle(TColStd_HSequenceOfTransient) &theBases,
134                const Handle(TColStd_HSequenceOfTransient) &theLocations,
135                const Handle(GEOM_Object)                  &thePath,
136                const bool                                  theWithContact,
137                const bool                                  theWithCorrections,
138                const bool                                  IsBySteps,
139                const bool                                  IsGenerateGroups);
140
141   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeWithShellSections
142               (const Handle(TColStd_HSequenceOfTransient) &theBases,
143                const Handle(TColStd_HSequenceOfTransient) &theSubBases,
144                const Handle(TColStd_HSequenceOfTransient) &theLocations,
145                const Handle(GEOM_Object)                  &thePath,
146                const bool                                  theWithContact,
147                const bool                                  theWithCorrections,
148                const bool                                  IsGenerateGroups);
149
150   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeShellsWithoutPath
151               (const Handle(TColStd_HSequenceOfTransient) &theBases,
152                const Handle(TColStd_HSequenceOfTransient) &theLocations,
153                const bool                                  IsGenerateGroups);
154
155   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeBiNormalAlongVector
156                 (const Handle(GEOM_Object) &theBase,
157                  const Handle(GEOM_Object) &thePath,
158                  const Handle(GEOM_Object) &theVec,
159                  const bool                 IsGenerateGroups);
160   
161   Standard_EXPORT Handle(GEOM_Object) MakeThickening
162                 (Handle(GEOM_Object)                     theObject,
163                  const Handle(TColStd_HArray1OfInteger) &theFacesIDs,
164                  double                                  theOffset,
165                  bool                                    isCopy,
166                  bool                                    theInside = false);
167
168   Standard_EXPORT Handle(GEOM_Object) RestorePath (Handle(GEOM_Object) theShape,
169                                                    Handle(GEOM_Object) theBase1,
170                                                    Handle(GEOM_Object) theBase2);
171
172   Standard_EXPORT Handle(GEOM_Object) RestorePath (Handle(GEOM_Object) theShape,
173                                                    const Handle(TColStd_HSequenceOfTransient)& theBase1,
174                                                    const Handle(TColStd_HSequenceOfTransient)& theBase2);
175
176 private:
177
178   Handle(GEOM_Object) createGroup
179                   (const Handle(GEOM_Object)              &theBaseObject,
180                    const Handle(TColStd_HArray1OfInteger) &theGroupIDs,
181                    const TCollection_AsciiString          &theName,
182                    const TopTools_IndexedMapOfShape       &theIndices);
183
184   void createGroups(const Handle(GEOM_Object)                  &theBaseObject,
185                           GEOMImpl_IPipe                       *thePipe,
186                           Handle(TColStd_HSequenceOfTransient) &theSequence);
187
188 private:
189
190   GEOMImpl_IGroupOperations *myGroupOperations;
191
192 };
193
194 #endif