Salome HOME
Update copyrights 2014.
[modules/geom.git] / src / AdvancedEngine / GEOMImpl_IAdvancedOperations.hxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 //  File   : GEOMImpl_IAdvancedOperations.hxx
20 //  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
21
22 #ifndef _GEOMImpl_IAdvancedOperations_HXX_
23 #define _GEOMImpl_IAdvancedOperations_HXX_
24
25 #include <Utils_SALOME_Exception.hxx>
26 #include "GEOM_IOperations.hxx"
27 #include "GEOM_Engine.hxx"
28 #include "GEOM_Object.hxx"
29
30 #include <list>
31 #include <gp_Ax2.hxx>
32
33 class GEOMImpl_IBasicOperations;
34 class GEOMImpl_IBooleanOperations;
35 class GEOMImpl_IShapesOperations;
36 class GEOMImpl_ITransformOperations;
37 class GEOMImpl_IBlocksOperations;
38 class GEOMImpl_I3DPrimOperations;
39 class GEOMImpl_ILocalOperations;
40 class GEOMImpl_IHealingOperations;
41 class GEOMImpl_IGroupOperations;
42 class Handle_Geom_Surface;
43 class TopTools_ListOfShape;
44
45 class GEOMImpl_IAdvancedOperations: public GEOM_IOperations {
46 private:
47   bool MakePipeTShapePartition(Handle(GEOM_Object) theShape,
48                                double theR1, double theW1, double theL1,
49                                double theR2, double theW2, double theL2,
50                                double theH = 0, double theW = 0,
51                                double theRF = 0, bool isNormal = true);
52
53   bool MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape,
54                                    double theR1, double theW1, double theL1,
55                                    double theR2, double theW2, double theL2);
56
57   bool MakePipeTShapeThicknessReduction (Handle(GEOM_Object) theShape,
58                                          double theR1, double theW1, double theL1,
59                                          double theR2, double theW2, double theL2,
60                                          double theRL, double theWL, double theLtransL, double theLthinL,
61                                          double theRR, double theWR, double theLtransR, double theLthinR,
62                                          double theRI, double theWI, double theLtransI, double theLthinI);
63
64   bool MakeGroups(Handle(GEOM_Object) theShape, int shapType,
65                   double theR1, double theW1, double theL1,
66                   double theR2, double theW2, double theL2,
67                   double theH, double theW, double theRF,
68                   Handle(TColStd_HSequenceOfTransient) theSeq,
69                   gp_Trsf aTrsf);
70
71   bool GetFacesOnSurf(const TopoDS_Shape &theShape,
72                       const Handle_Geom_Surface& theSurface,
73                       const Standard_Real theTolerance,
74                       TopTools_ListOfShape &theFaces);
75
76   TopoDS_Shape MakeConicalFace(const gp_Ax2 &theAxis,
77                                const double theRadius,
78                                const double theRadiusThin,
79                                const double theHeight,
80                                const gp_Trsf &theTrsf);
81
82   bool MakeInternalGroup(const Handle(GEOM_Object) &theShape,
83                          const double theR1, const double theLen1,
84                          const double theR2, const double theLen2,
85                          const double theRL, const double theTransLenL,
86                          const double theRR, const double theTransLenR,
87                          const double theRI, const double theTransLenI,
88                          const Handle(TColStd_HSequenceOfTransient) &theSeq,
89                          const gp_Trsf &theTrsf);
90
91   gp_Trsf GetPositionTrsf(double theL1, double theL2,
92                           Handle(GEOM_Object) P1 = 0,
93                           Handle(GEOM_Object) P2 = 0,
94                           Handle(GEOM_Object) P3 = 0);
95
96   bool CheckCompatiblePosition(double& theL1, double& theL2, 
97                                Handle(GEOM_Object) theP1, 
98                                Handle(GEOM_Object) theP2,
99                                Handle(GEOM_Object) theP3,
100                                double theTolerance);
101
102 private:
103   GEOMImpl_IBasicOperations*     myBasicOperations;
104   GEOMImpl_IBooleanOperations*   myBooleanOperations;
105   GEOMImpl_IShapesOperations*    myShapesOperations;
106   GEOMImpl_ITransformOperations* myTransformOperations;
107   GEOMImpl_IBlocksOperations*    myBlocksOperations;
108   GEOMImpl_I3DPrimOperations*    my3DPrimOperations;
109   GEOMImpl_ILocalOperations*     myLocalOperations;
110   GEOMImpl_IHealingOperations*   myHealingOperations;
111   GEOMImpl_IGroupOperations*     myGroupOperations;
112
113 public:
114
115   /*!
116    * \brief Add three thickness reductions at the open ends of the pipe T-Shape
117    *
118    * \param theShape - the pipe T-Shape
119    * \param r1 - the internal radius of main pipe
120    * \param w1 - the thickness of main pipe
121    * \param l1 - the half-length of main pipe
122    * \param r2 - the internal radius of incident pipe
123    * \param w2 - the thickness of incident pipe
124    * \param l2 - the half-length of main pipe
125    * \param r*, w*, ltrans* and lthin* - internal radius, thickness, length of transition part
126    *                                     and length of thin part of left(L), right(R) and
127    *                                     incident(I) thickness reduction correspondingly
128    * \param fuseReductions - boolean flag (use true to generate single solid,
129    *                         false to obtain parts, useful for hexameshing)
130    * \retval TopoDS_Shape - Resulting shape
131    */
132   Standard_EXPORT static TopoDS_Shape MakePipeTShapeThicknessReduction
133                                      (TopoDS_Shape theShape,
134                                       double r1, double w1, double l1,
135                                       double r2, double w2, double l2,
136                                       double rL, double wL, double ltransL, double lthinL,
137                                       double rR, double wR, double ltransR, double lthinR,
138                                       double rI, double wI, double ltransI, double lthinI,
139                                       bool fuseReductions);
140
141   /*!
142    * \brief Create one thickness reduction element
143    *
144    * This method is called three times from MakePipeTShapeThicknessReduction
145    * to create three thickness reductions (one per each open end of a pipe T-Shape)
146    *
147    * \param theAxes - the position
148    * \param R - the internal radius of main pipe
149    * \param W - the thickness of main pipe
150    * \param Rthin - the internal radius of thin part
151    * \param Wthin - the thickness of thin part
152    * \param Ltrans - the length of transition part
153    * \param Lthin - the length of thin part
154    * \param fuse - boolean flag (use true to generate single solid,
155    *               false to obtain parts, useful for hexameshing)
156    * \retval TopoDS_Shape - Resulting shape
157    */
158   Standard_EXPORT static TopoDS_Shape MakeThicknessReduction (gp_Ax2 theAxes,
159                                                               const double R, const double W,
160                                                               const double Rthin, const double Wthin,
161                                                               const double Ltrans, const double Lthin,
162                                                               bool fuse);
163
164 public:
165   Standard_EXPORT GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngine, int theDocID);
166   Standard_EXPORT ~GEOMImpl_IAdvancedOperations();
167
168   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) 
169                   MakePipeTShape(double theR1, double theW1, double theL1,
170                                  double theR2, double theW2, double theL2,
171                                  double theRL, double theWL, double theLtransL, double theLthinL,
172                                  double theRR, double theWR, double theLtransR, double theLthinR,
173                                  double theRI, double theWI, double theLtransI, double theLthinI,
174                                  bool theHexMesh = true);
175
176   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
177                   MakePipeTShapeWithPosition(double theR1, double theW1, double theL1,
178                                              double theR2, double theW2, double theL2,
179                                              double theRL, double theWL, double theLtransL, double theLthinL,
180                                              double theRR, double theWR, double theLtransR, double theLthinR,
181                                              double theRI, double theWI, double theLtransI, double theLthinI,
182                                              bool theHexMesh = true,
183                                              Handle(GEOM_Object) P1 = 0,
184                                              Handle(GEOM_Object) P2 = 0,
185                                              Handle(GEOM_Object) P3 = 0);
186
187   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
188                   MakePipeTShapeChamfer(double theR1, double theW1, double theL1,
189                                         double theR2, double theW2, double theL2,
190                                         double theRL, double theWL, double theLtransL, double theLthinL,
191                                         double theRR, double theWR, double theLtransR, double theLthinR,
192                                         double theRI, double theWI, double theLtransI, double theLthinI,
193                                         double theH,  double theW, 
194                                         bool theHexMesh = true);
195
196   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
197                   MakePipeTShapeChamferWithPosition(double theR1, double theW1, double theL1,
198                                                     double theR2, double theW2, double theL2,
199                                                     double theH, double theW,
200                                                     double theRL, double theWL, double theLtransL, double theLthinL,
201                                                     double theRR, double theWR, double theLtransR, double theLthinR,
202                                                     double theRI, double theWI, double theLtransI, double theLthinI,
203                                                     bool theHexMesh = true,
204                                                     Handle(GEOM_Object) P1 = 0,
205                                                     Handle(GEOM_Object) P2 = 0,
206                                                     Handle(GEOM_Object) P3 = 0);
207
208   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
209                   MakePipeTShapeFillet(double theR1, double theW1, double theL1,
210                                        double theR2, double theW2, double theL2,
211                                        double theRL, double theWL, double theLtransL, double theLthinL,
212                                        double theRR, double theWR, double theLtransR, double theLthinR,
213                                        double theRI, double theWI, double theLtransI, double theLthinI,
214                                        double theRF, bool theHexMesh = true);
215
216   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
217                   MakePipeTShapeFilletWithPosition(double theR1, double theW1, double theL1,
218                                                    double theR2, double theW2, double theL2,
219                                                    double theRL, double theWL, double theLtransL, double theLthinL,
220                                                    double theRR, double theWR, double theLtransR, double theLthinR,
221                                                    double theRI, double theWI, double theLtransI, double theLthinI,
222                                                    double theRF, bool theHexMesh = true,
223                                                    Handle(GEOM_Object) P1 = 0,
224                                                    Handle(GEOM_Object) P2 = 0,
225                                                    Handle(GEOM_Object) P3 = 0);
226                   
227   Standard_EXPORT Handle(GEOM_Object) MakeDividedDisk (double theR, double theRatio, 
228                                                        int theOrientation, int thePattern);
229   Standard_EXPORT Handle(GEOM_Object) MakeDividedDiskPntVecR (Handle(GEOM_Object) thePnt, 
230                                                               Handle(GEOM_Object) theVec, 
231                                                               double theR, 
232                                                               double theRatio,
233                                                               int    thePattern);
234   
235   Standard_EXPORT Handle(GEOM_Object) MakeDividedCylinder (double theR, 
236                                                            double theH,
237                                                            int thePattern);
238   
239   Standard_EXPORT Handle(GEOM_Object) MakeSmoothingSurface (std::list<Handle(GEOM_Object)> thelPoints);
240   /*@@ insert new functions before this line @@ do not remove this line @@*/
241 };
242 #endif