Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
GEOMImpl_IShapesOperations.hxx
Go to the documentation of this file.
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 //=============================================================================
24 // File : GEOMImpl_IShapesOperations.hxx
25 // Created :
26 // Author : modified by Lioka RAZAFINDRAZAKA (CEA) 22/06/2007
27 // Project : SALOME
28 //=============================================================================
29 
30 #ifndef _GEOMImpl_IShapesOperations_HXX_
31 #define _GEOMImpl_IShapesOperations_HXX_
32 
33 #include "GEOM_IOperations.hxx"
34 
35 #include "GEOMAlgo_State.hxx"
36 #include "GEOMUtils.hxx"
37 
38 #include <TColStd_HSequenceOfTransient.hxx>
39 #include <TColStd_HSequenceOfInteger.hxx>
40 #include <TColStd_HArray1OfInteger.hxx>
41 
42 #include <Geom_Surface.hxx>
43 
44 #include <list>
45 
46 class GEOM_Engine;
47 class GEOM_Object;
48 class TopoDS_Shape;
49 
51 {
52  public:
53 
54  enum SubShapeType {
55  None = 0x00,
56  Groups = 0x01,
57  Fields = 0x02,
58  SubShapes = 0x04,
60  };
61 
66  {
70  };
71 
76  {
78  std::list<Standard_Integer> indices;
79  };
80 
81  Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine, int theDocID);
82  Standard_EXPORT ~GEOMImpl_IShapesOperations();
83 
84  Standard_EXPORT Handle(GEOM_Object) MakeEdge (Handle(GEOM_Object) thePoint1,
85  Handle(GEOM_Object) thePoint2);
86 
87  Standard_EXPORT Handle(GEOM_Object) MakeEdgeOnCurveByLength (Handle(GEOM_Object) theCurve,
88  const Standard_Real theLength,
89  Handle(GEOM_Object) theStartPoint);
90 
91  Standard_EXPORT Handle(GEOM_Object) MakeEdgeWire (Handle(GEOM_Object) theWire,
92  const Standard_Real theLinearTolerance,
93  const Standard_Real theAngularTolerance);
94 
95  Standard_EXPORT Handle(GEOM_Object) MakeWire (std::list<Handle(GEOM_Object)> theEdgesAndWires,
96  const Standard_Real theTolerance);
97 
98  Standard_EXPORT Handle(GEOM_Object) MakeFace (Handle(GEOM_Object) theWire, const bool isPlanarWanted);
99 
100  Standard_EXPORT Handle(GEOM_Object) MakeFaceWires (std::list<Handle(GEOM_Object)> theWires,
101  const bool isPlanarWanted);
102 
103  Standard_EXPORT Handle(GEOM_Object) MakeFaceFromSurface
104  (Handle(GEOM_Object) theFace,
105  Handle(GEOM_Object) theWire);
106 
107  Standard_EXPORT Handle(GEOM_Object) MakeFaceWithConstraints (std::list<Handle(GEOM_Object)> theConstraints);
108 
109  Standard_EXPORT Handle(GEOM_Object) MakeShell (std::list<Handle(GEOM_Object)> theShapes);
110 
111  Standard_EXPORT Handle(GEOM_Object) MakeSolidShells (std::list<Handle(GEOM_Object)> theShells);
112 
113  Standard_EXPORT Handle(GEOM_Object) MakeCompound (std::list<Handle(GEOM_Object)> theShapes);
114 
115  Standard_EXPORT Handle(GEOM_Object) MakeSolidFromConnectedFaces (std::list<Handle(GEOM_Object)> theFacesOrShells,
116  const Standard_Boolean isIntersect);
117 
118  Standard_EXPORT Handle(GEOM_Object) MakeGlueFaces (std::list< Handle(GEOM_Object) >& theShapes,
119  const Standard_Real theTolerance,
120  const Standard_Boolean doKeepNonSolids);
121 
122  Standard_EXPORT Handle(GEOM_Object) MakeGlueFacesByList (std::list< Handle(GEOM_Object) >& theShapes,
123  const Standard_Real theTolerance,
124  std::list<Handle(GEOM_Object)>& theFaces,
125  const Standard_Boolean doKeepNonSolids,
126  const Standard_Boolean doGlueAllEdges);
127 
128  Standard_EXPORT Handle(GEOM_Object) MakeGlueEdges (std::list< Handle(GEOM_Object) >& theShapes,
129  const Standard_Real theTolerance);
130 
131  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetGlueShapes (std::list< Handle(GEOM_Object) >& theShapes,
132  const Standard_Real theTolerance,
133  const TopAbs_ShapeEnum theType);
134 
135  Standard_EXPORT Handle(GEOM_Object) MakeGlueEdgesByList (std::list< Handle(GEOM_Object) >& theShapes,
136  const Standard_Real theTolerance,
137  std::list<Handle(GEOM_Object)> & theEdges);
138 
139  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetExistingSubObjects(Handle(GEOM_Object) theShape,
140  const Standard_Boolean theGroupsOnly);
141  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetExistingSubObjects(Handle(GEOM_Object) theShape,
142  const Standard_Integer theTypes = All);
143 
144  enum ExplodeType {
148  };
149 
150  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakeExplode
152  const Standard_Integer theShapeType,
153  const Standard_Boolean isSorted,
155 
156  Standard_EXPORT Handle(TColStd_HSequenceOfInteger) SubShapeAllIDs
157  (Handle(GEOM_Object) theShape,
158  const Standard_Integer theShapeType,
159  const Standard_Boolean isSorted,
160  const ExplodeType theExplodeType = EXPLODE_NEW_INCLUDE_MAIN);
161 
162  Standard_EXPORT Handle(GEOM_Object) GetSubShape (Handle(GEOM_Object) theMainShape,
163  const Standard_Integer theID);
164 
165  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakeSubShapes
166  (Handle(GEOM_Object) theMainShape,
167  Handle(TColStd_HArray1OfInteger) theIndices);
168 
169  Standard_EXPORT Standard_Integer GetSubShapeIndex (Handle(GEOM_Object) theMainShape,
170  Handle(GEOM_Object) theSubShape);
171 
172  Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetSubShapesIndices (Handle(GEOM_Object) theMainShape,
174 
175  Standard_EXPORT Standard_Integer GetTopologyIndex (Handle(GEOM_Object) theMainShape,
176  Handle(GEOM_Object) theSubShape);
177 
178  Standard_EXPORT TCollection_AsciiString GetShapeTypeString (Handle(GEOM_Object) theShape);
179 
180  Standard_EXPORT Standard_Boolean IsSubShapeBelongsTo(Handle(GEOM_Object) theSubObject,
181  const Standard_Integer theSubObjectIndex,
182  Handle(GEOM_Object) theObject,
183  const Standard_Integer theObjectIndex);
184 
185  Standard_EXPORT Standard_Integer NumberOfSubShapes (Handle(GEOM_Object) theShape,
186  const Standard_Integer theShapeType);
187 
188  Standard_EXPORT Handle(GEOM_Object) ReverseShape(Handle(GEOM_Object) theShapes);
189 
190  Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetFreeFacesIDs (Handle(GEOM_Object) theShape);
191 
192  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
193  GetSharedShapes (Handle(GEOM_Object) theShape1,
194  Handle(GEOM_Object) theShape2,
195  const Standard_Integer theShapeType);
196 
197  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
198  GetSharedShapes (std::list<Handle(GEOM_Object)>& theShapes,
199  const Standard_Integer theShapeType,
200  const bool theMultiShare = true);
201 
202  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
203  GetShapesOnPlane (const Handle(GEOM_Object)& theShape,
204  const Standard_Integer theShapeType,
205  const Handle(GEOM_Object)& theAx1,
207 
208  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
209  GetShapesOnPlaneWithLocation (const Handle(GEOM_Object)& theShape,
210  const Standard_Integer theShapeType,
211  const Handle(GEOM_Object)& theAx1,
212  const Handle(GEOM_Object)& thePnt,
213  const GEOMAlgo_State theState);
214 
215 
216  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
217  GetShapesOnCylinder (const Handle(GEOM_Object)& theShape,
218  const Standard_Integer theShapeType,
219  const Handle(GEOM_Object)& theAxis,
220  const Standard_Real theRadius,
221  const GEOMAlgo_State theState);
222 
223  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
224  GetShapesOnCylinderWithLocation (const Handle(GEOM_Object)& theShape,
225  const Standard_Integer theShapeType,
226  const Handle(GEOM_Object)& theAxis,
227  const Handle(GEOM_Object)& thePnt,
228  const Standard_Real theRadius,
229  const GEOMAlgo_State theState);
230 
231  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
232  GetShapesOnSphere (const Handle(GEOM_Object)& theShape,
233  const Standard_Integer theShapeType,
234  const Handle(GEOM_Object)& theCenter,
235  const Standard_Real theRadius,
236  const GEOMAlgo_State theState);
237 
238  Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
239  GetShapesOnPlaneIDs (const Handle(GEOM_Object)& theShape,
240  const Standard_Integer theShapeType,
241  const Handle(GEOM_Object)& theAx1,
242  const GEOMAlgo_State theState);
243 
244  Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
245  GetShapesOnPlaneWithLocationIDs (const Handle(GEOM_Object)& theShape,
246  const Standard_Integer theShapeType,
247  const Handle(GEOM_Object)& theAx1,
248  const Handle(GEOM_Object)& thePnt,
249  const GEOMAlgo_State theState);
250 
251  Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
252  GetShapesOnCylinderIDs (const Handle(GEOM_Object)& theShape,
253  const Standard_Integer theShapeType,
254  const Handle(GEOM_Object)& theAxis,
255  const Standard_Real theRadius,
256  const GEOMAlgo_State theState);
257 
258  Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
259  GetShapesOnCylinderWithLocationIDs (const Handle(GEOM_Object)& theShape,
260  const Standard_Integer theShapeType,
261  const Handle(GEOM_Object)& theAxis,
262  const Handle(GEOM_Object)& thePnt,
263  const Standard_Real theRadius,
264  const GEOMAlgo_State theState);
265 
266  Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
267  GetShapesOnSphereIDs (const Handle(GEOM_Object)& theShape,
268  const Standard_Integer theShapeType,
269  const Handle(GEOM_Object)& theCenter,
270  const Standard_Real theRadius,
271  const GEOMAlgo_State theState);
272 
284  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
285  GetShapesOnQuadrangle (const Handle(GEOM_Object)& theShape,
286  const Standard_Integer theShapeType,
287  const Handle(GEOM_Object)& theTopLeftPoint,
288  const Handle(GEOM_Object)& theTopRigthPoint,
289  const Handle(GEOM_Object)& theBottomLeftPoint,
290  const Handle(GEOM_Object)& theBottomRigthPoint,
291  const GEOMAlgo_State theState);
292 
304  Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
305  GetShapesOnQuadrangleIDs (const Handle(GEOM_Object)& theShape,
306  const Standard_Integer theShapeType,
307  const Handle(GEOM_Object)& theTopLeftPoint,
308  const Handle(GEOM_Object)& theTopRigthPoint,
309  const Handle(GEOM_Object)& theBottomLeftPoint,
310  const Handle(GEOM_Object)& theBottomRigthPoint,
311  const GEOMAlgo_State theState);
312 
313  Standard_EXPORT Handle(GEOM_Object) GetShapesOnCylinderOld (Handle(GEOM_Object) theShape,
314  const Standard_Integer theShapeType,
315  Handle(GEOM_Object) theAxis,
316  const Standard_Real theRadius);
317 
318  Standard_EXPORT Handle(GEOM_Object) GetShapesOnSphereOld (Handle(GEOM_Object) theShape,
319  const Standard_Integer theShapeType,
320  Handle(GEOM_Object) theCenter,
321  const Standard_Real theRadius);
322 
323  Standard_EXPORT Handle(GEOM_Object) GetInPlace (Handle(GEOM_Object) theShapeWhere,
324  Handle(GEOM_Object) theShapeWhat);
325 
326  Standard_EXPORT Handle(GEOM_Object) GetInPlaceOld (Handle(GEOM_Object) theShapeWhere,
327  Handle(GEOM_Object) theShapeWhat);
328 
329  Standard_EXPORT Handle(GEOM_Object) GetInPlaceByHistory (Handle(GEOM_Object) theShapeWhere,
330  Handle(GEOM_Object) theShapeWhat);
331 
338  Standard_EXPORT Handle(GEOM_Object) GetSame(const Handle(GEOM_Object)& theShapeWhere,
339  const Handle(GEOM_Object)& theShapeWhat);
340 
347  Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetSameIDs(const Handle(GEOM_Object)& theShapeWhere,
348  const Handle(GEOM_Object)& theShapeWhat);
349 
358  Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
359  GetShapesOnBoxIDs(const Handle(GEOM_Object)& theBox,
360  const Handle(GEOM_Object)& theShape,
361  const Standard_Integer theShapeType,
362  GEOMAlgo_State theState);
363 
372  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
373  GetShapesOnBox(const Handle(GEOM_Object)& theBox,
374  const Handle(GEOM_Object)& theShape,
375  const Standard_Integer theShapeType,
376  GEOMAlgo_State theState);
377 
386  Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
387  GetShapesOnShapeIDs(const Handle(GEOM_Object)& theCheckShape,
388  const Handle(GEOM_Object)& theShape,
389  const Standard_Integer theShapeType,
390  GEOMAlgo_State theState);
391 
400  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
401  GetShapesOnShape(const Handle(GEOM_Object)& theCheckShape,
402  const Handle(GEOM_Object)& theShape,
403  const Standard_Integer theShapeType,
404  GEOMAlgo_State theState);
405  Standard_EXPORT Handle(GEOM_Object)
406  GetShapesOnShapeAsCompound(const Handle(GEOM_Object)& theCheckShape,
407  const Handle(GEOM_Object)& theShape,
408  const Standard_Integer theShapeType,
409  GEOMAlgo_State theState);
410 
422  Standard_EXPORT Handle(GEOM_Object)
423  ExtendEdge(const Handle(GEOM_Object)& theEdge,
424  const Standard_Real theMin,
425  const Standard_Real theMax);
426 
442  Standard_EXPORT Handle(GEOM_Object)
443  ExtendFace(const Handle(GEOM_Object)& theFace,
444  const Standard_Real theUMin,
445  const Standard_Real theUMax,
446  const Standard_Real theVMin,
447  const Standard_Real theVMax);
448 
458  Standard_EXPORT Handle(GEOM_Object)
459  MakeSurfaceFromFace(const Handle(GEOM_Object) &theFace);
460 
467  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
468  GetSubShapeEdgeSorted (const Handle(GEOM_Object) &theShape,
469  const Handle(GEOM_Object) &theStartPoint);
470 
486  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetSubShapesWithTolerance
487  (const Handle(GEOM_Object) &theShape,
488  const Standard_Integer theShapeType,
489  const GEOMUtils::ComparisonCondition theCondition,
490  const Standard_Real theTolerance);
491 
502  Standard_EXPORT Handle(GEOM_Object) MakeExtraction
503  (const Handle(GEOM_Object) &theShape,
504  const Handle(TColStd_HArray1OfInteger) &theSubShapeIDs,
505  std::list<ExtractionStat> &theStats);
506 
507  private:
508  Handle(GEOM_Object) MakeShape (std::list<Handle(GEOM_Object)> theShapes,
509  const Standard_Integer theObjectType,
510  const Standard_Integer theFunctionType,
511  const TCollection_AsciiString& theMethodName);
512 
513 // ----------------------------------------------------
514 // methods common for all GetShapesOnXXX() functions
515 // ----------------------------------------------------
516 
522  bool checkTypeShapesOn(const Standard_Integer theShapeType);
523 
529  Handle(Geom_Surface) makePlane(const TopoDS_Shape& theAx1);
530 
537  Handle(Geom_Surface) makeCylinder(const TopoDS_Shape& theAx1,
538  const Standard_Real theRadius);
539 
548  Handle(TColStd_HSequenceOfInteger)
549  getShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
550  const TopoDS_Shape& theShape,
551  TopAbs_ShapeEnum theShapeType,
552  GEOMAlgo_State theState);
553 
563  Handle(TColStd_HSequenceOfTransient)
564  getShapesOnSurface(const Handle(Geom_Surface)& theSurface,
565  const Handle(GEOM_Object)& theShape,
566  TopAbs_ShapeEnum theShapeType,
567  GEOMAlgo_State theState,
568  TCollection_AsciiString & theShapeEntries);
569 
581  Handle(TColStd_HSequenceOfInteger)
582  getShapesOnQuadrangleIDs (const Handle(GEOM_Object)& theShape,
583  const Standard_Integer theShapeType,
584  const Handle(GEOM_Object)& theTopLeftPoint,
585  const Handle(GEOM_Object)& theTopRigthPoint,
586  const Handle(GEOM_Object)& theBottomLeftPoint,
587  const Handle(GEOM_Object)& theBottomRigthPoint,
588  const GEOMAlgo_State theState);
589 
598  Handle(TColStd_HSequenceOfInteger) getShapesOnBoxIDs(const Handle(GEOM_Object)& theBox,
599  const Handle(GEOM_Object)& theShape,
600  const Standard_Integer theShapeType,
601  GEOMAlgo_State theState);
602 
611  Handle(TColStd_HSequenceOfInteger) getShapesOnShapeIDs
612  (const Handle(GEOM_Object)& theCheckShape,
613  const Handle(GEOM_Object)& theShape,
614  const Standard_Integer theShapeType,
615  GEOMAlgo_State theState);
616 
624  Handle(TColStd_HSequenceOfTransient)
625  getObjectsShapesOn(const Handle(GEOM_Object)& theShape,
626  const Handle(TColStd_HSequenceOfInteger)& theShapeIDs,
627  TCollection_AsciiString & theShapeEntries);
628 
635  Handle(TColStd_HSequenceOfInteger) getSubShapeEdgeSortedIDs
636  (const Handle(GEOM_Object) &theShape,
637  const Handle(GEOM_Object) &theStartPoint);
638 
645  static Handle(GEOM_Object) getCreatedLast(const Handle(GEOM_Object)& theObj1,
646  const Handle(GEOM_Object)& theObj2);
647 };
648 
649 #endif