]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMImpl/GEOMImpl_IShapesOperations.hxx
Salome HOME
XAO test fixed to work in salome test
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IShapesOperations.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 //=============================================================================
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
50 class GEOMImpl_IShapesOperations : public GEOM_IOperations
51 {
52  public:
53
54   enum SubShapeType {
55     None      = 0x00,
56     Groups    = 0x01,
57     Fields    = 0x02,
58     SubShapes = 0x04,
59     All       = Groups | Fields | SubShapes,
60   };
61
62   /**
63    * This enumeration represents an extraction statistics type.
64    */
65   enum ExtractionStatType
66   {
67     EST_Removed,  ///< Removed sub-shapes
68     EST_Modified, ///< Modified sub-shapes
69     EST_Added     ///< Newly created sub-shapes
70   };
71
72   /*!
73    * This structure defines a format of extraction statistics.
74    */
75   struct ExtractionStat
76   {
77     ExtractionStatType          type;    ///< Type of extraction statistics.
78     std::list<Standard_Integer> indices; ///< Shape indices touched by this type of modification.
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 {
145     EXPLODE_OLD_INCLUDE_MAIN,
146     EXPLODE_NEW_INCLUDE_MAIN,
147     EXPLODE_NEW_EXCLUDE_MAIN
148   };
149
150   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakeExplode
151     (Handle(GEOM_Object)    theShape,
152      const Standard_Integer theShapeType,
153      const Standard_Boolean isSorted,
154      const ExplodeType      theExplodeType = EXPLODE_NEW_INCLUDE_MAIN);
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,
173                                                                           std::list<Handle(GEOM_Object)> theSubShapes);
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,
206                       const GEOMAlgo_State       theState);
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
273   /*!
274    * \brief Find sub-shapes complying with given status about quadrangle
275     * \param theShape - the shape to explore
276     * \param theShapeType - type of sub-shape of theShape
277     * \param theTopLeftPoint - top left quadrangle corner
278     * \param theTopRigthPoint - top right quadrangle corner
279     * \param theBottomLeftPoint - bottom left quadrangle corner
280     * \param theBottomRigthPoint - bottom right quadrangle corner
281     * \param theState - required state
282     * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
283    */
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
293   /*!
294    * \brief Find IDs of sub-shapes complying with given status about quadrangle
295     * \param theShape - the shape to explore
296     * \param theShapeType - type of sub-shape of theShape
297     * \param theTopLeftPoint - top left quadrangle corner
298     * \param theTopRigthPoint - top right quadrangle corner
299     * \param theBottomLeftPoint - bottom left quadrangle corner
300     * \param theBottomRigthPoint - bottom right quadrangle corner
301     * \param theState - required state
302     * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
303    */
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
332   /*!
333    * \brief Searches a shape equal to theWhat in the context of theWhere
334    * \param theShapeWhere - a context shap
335    * \param theShapeWhat - a sample shape
336    * \retval Handle(GEOM_Object) - found shape
337    */
338   Standard_EXPORT Handle(GEOM_Object) GetSame(const Handle(GEOM_Object)& theShapeWhere,
339                                               const Handle(GEOM_Object)& theShapeWhat);
340
341   /*!
342    * \brief Searches a shape equal to theWhat in the context of theWhere
343    * \param theShapeWhere - a context shap
344    * \param theShapeWhat - a sample shape
345    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
346    */
347   Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetSameIDs(const Handle(GEOM_Object)& theShapeWhere,
348                                                                  const Handle(GEOM_Object)& theShapeWhat);
349
350   /*!
351    * \brief Find IDs of sub-shapes complying with given status about surface
352     * \param theBox - the box to check state of sub-shapes against
353     * \param theShape - the shape to explore
354     * \param theShapeType - type of sub-shape of theShape
355     * \param theState - required state
356     * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
357    */
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
364   /*!
365    * \brief Find sub-shapes complying with given status about surface
366    * \param theBox - the box to check state of sub-shapes against
367    * \param theShape - the shape to explore
368    * \param theShapeType - type of sub-shape of theShape
369    * \param theState - required state
370    * \retval Handle(TColStd_HSequenceOfTransient) - found shape objects
371    */
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
378   /*!
379    * \brief Find IDs of sub-shapes complying with given status about surface
380    * \param theCheckShape - the shape to check state of sub-shapes against
381    * \param theShape - the shape to explore
382    * \param theShapeType - type of sub-shape of theShape
383    * \param theState - required state
384    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
385    */
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
392   /*!
393    * \brief Find sub-shapes complying with given status about surface
394    * \param theCheckShape - the shape to check state of sub-shapes against
395    * \param theShape - the shape to explore
396    * \param theShapeType - type of sub-shape of theShape
397    * \param theState - required state
398    * \retval Handle(TColStd_HSequenceOfTransient) - found shape objects
399    */
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
411   /*!
412    * \brief Resize the input edge with the new Min and Max parameters.
413    * The input edge parameters range is [0, 1]. If theMin parameter is
414    * negative, the input edge is extended, otherwise it is shrinked by
415    * theMin parameter. If theMax is greater than 1, the edge is extended,
416    * otherwise it is shrinked by theMax parameter
417    * \param theEdge the input edge to be resized
418    * \param theMin the minimal parameter value
419    * \param theMax the maximal parameter value
420    * \retval Handle(GEOM_Object) - newly created edge
421    */
422   Standard_EXPORT Handle(GEOM_Object)
423                             ExtendEdge(const Handle(GEOM_Object)& theEdge,
424                                        const Standard_Real        theMin,
425                                        const Standard_Real        theMax);
426
427   /*!
428    * \brief Resize the input face with the new UMin, UMax, VMin and VMax
429    * parameters. The input face U and V parameters range is [0, 1]. If
430    * theUMin parameter is negative, the input face is extended, otherwise
431    * it is shrinked along U direction by theUMin parameter. If theUMax is
432    * greater than 1, the face is extended, otherwise it is shrinked along
433    * U direction by theUMax parameter. So as for theVMin, theVMax and
434    * V direction of the input face.
435    * \param theFace the input face to be resized
436    * \param theUMin the minimal U parameter value
437    * \param theUMax the maximal U parameter value
438    * \param theVMin the minimal V parameter value
439    * \param theVMax the maximal V parameter value
440    * \retval Handle(GEOM_Object) - newly created face
441    */
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   
449   /*!
450    * \brief Make a surface from a face. This function takes some face as
451    * input parameter and creates new GEOM_Object, i.e. topological shape
452    * by extracting underlying surface of the source face and limiting it
453    * by the Umin, Umax, Vmin, Vmax parameters of the source face (in the
454    * parametrical space).
455    * \param theFace the input face
456    * \retval Handle(GEOM_Object) - newly created face
457    */
458   Standard_EXPORT Handle(GEOM_Object)
459                    MakeSurfaceFromFace(const Handle(GEOM_Object) &theFace);
460
461   /*!
462    * \brief Explode a shape into edges sorted in a row from a starting point.
463    * \param theShape - the shape to be exploded on edges.
464    * \param theStartPoint - the starting point.
465    * \return Ordered list of edges sorted in a row from a starting point.
466    */
467   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
468     GetSubShapeEdgeSorted (const Handle(GEOM_Object) &theShape,
469                            const Handle(GEOM_Object) &theStartPoint);
470
471   /*!
472    * \brief Return the list of subshapes that satisfies a certain tolerance
473    * criterion. The user defines the type of shapes to be returned, the
474    * condition and the tolerance value. The operation is defined for
475    * faces, edges and vertices only. E.g. for theShapeType FACE, theCondition
476    * CC_GT and theTolerance 1.e-7 this method returns all faces of theShape
477    * that have tolerances greater then 1.e7.
478    *
479    * \param theShape the shape to be exploded
480    * \param theShapeType the type of shapes to be returned. Can have the
481    *        values FACE, EDGE and VERTEX only.
482    * \param theCondition the condition type.
483    * \param theTolerance the tolerance filter.
484    * \return the list of shapes that satisfy the conditions.
485    */
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
492   /*!
493    * \brief Return the shape that is constructed from theShape without
494    * extracted sub-shapes from the input list.
495    *
496    * \param theShape the original shape.
497    * \param theSubShapeIDs the list of sub-shape IDs to be extracted from
498    *        the original shape.
499    * \param theStats the operation statistics. Output parameter.
500    * \return the shape without extracted sub-shapes.
501    */
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
517   /*!
518    * \brief Checks if theShapeType parameter of GetShapesOnXXX() is OK
519    * \param theShapeType - the shape type to check
520    * \retval bool  - result of the check
521    */
522   bool checkTypeShapesOn(const Standard_Integer theShapeType);
523
524   /*!
525    * \brief Creates Geom_Plane
526    * \param theAx1 - edge defining plane normal
527    * \retval Handle(Geom_Surface) - resulting surface
528    */
529   Handle(Geom_Surface) makePlane(const TopoDS_Shape& theAx1);
530
531   /*!
532    * \brief Creates Geom_CylindricalSurface
533    * \param theAx1 - edge defining cylinder axis
534    * \param theRadius - cylinder radius
535    * \retval Handle(Geom_Surface) - resulting surface
536    */
537   Handle(Geom_Surface) makeCylinder(const TopoDS_Shape& theAx1,
538                                     const Standard_Real theRadius);
539
540   /*!
541    * \brief Find IDs of sub-shapes complying with given status about surface
542    * \param theSurface - the surface to check state of sub-shapes against
543    * \param theShape - the shape to explore
544    * \param theShapeType - type of sub-shape of theShape
545    * \param theState - required state
546    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
547    */
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
554   /*!
555    * \brief Find sub-shapes complying with given status about surface
556    * \param theSurface - the surface to check state of sub-shapes against
557    * \param theShape - the shape to explore
558    * \param theShapeType - type of sub-shape of theShape
559    * \param theState - required state
560    * \param theShapeEntries - outgoing entries like "entry1, entry2, ..."
561    * \retval Handle(TColStd_HSequenceOfTransient) - found shape objects
562    */
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
570   /*!
571    * \brief Find IDs of sub-shapes complying with given status about quadrangle
572    * \param theShape - the shape to explore
573    * \param theShapeType - type of sub-shape of theShape
574    * \param theTopLeftPoint - top left quadrangle corner
575    * \param theTopRigthPoint - top right quadrangle corner
576    * \param theBottomLeftPoint - bottom left quadrangle corner
577    * \param theBottomRigthPoint - bottom right quadrangle corner
578    * \param theState - required state
579    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
580    */
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
590   /*!
591    * \brief Find IDs of sub-shapes complying with given status about surface
592    * \param theBox - the box to check state of sub-shapes against
593    * \param theShape - the shape to explore
594    * \param theShapeType - type of sub-shape of theShape
595    * \param theState - required state
596    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
597    */
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
603   /*!
604    * \brief Find IDs of sub-shapes complying with given status about surface
605    * \param theCheckShape - the shape to check state of sub-shapes against
606    * \param theShape - the shape to explore
607    * \param theShapeType - type of sub-shape of theShape
608    * \param theState - required state
609    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
610    */
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
617   /*!
618    * \brief Find shape objects and their entries by their ids
619    * \param theShape - the main shape
620    * \param theShapeIDs - theShapeIDs - incoming shape ids
621    * \param theShapeEntries - outgoing entries like "entry1, entry2, ..."
622    * \retval Handle(TColStd_HSequenceOfTransient) - found shape objects
623    */
624   Handle(TColStd_HSequenceOfTransient)
625     getObjectsShapesOn(const Handle(GEOM_Object)&                theShape,
626                        const Handle(TColStd_HSequenceOfInteger)& theShapeIDs,
627                        TCollection_AsciiString &                 theShapeEntries);
628
629   /*!
630    * \brief Explode a shape into edges sorted in a row from a starting point.
631    * \param theShape - the shape to be exploded on edges.
632    * \param theStartPoint - the starting point.
633    * \return Ordered list of edges sorted in a row from a starting point.
634    */
635   Handle(TColStd_HSequenceOfInteger) getSubShapeEdgeSortedIDs
636                                 (const Handle(GEOM_Object) &theShape,
637                                  const Handle(GEOM_Object) &theStartPoint);
638
639   /*!
640    * \brief Select the object created last
641    * \param theObj1 - Object 1
642    * \param theObj2 - Object 2
643    * \retval Handle(GEOM_Object) - selected object
644    */
645   static Handle(GEOM_Object) getCreatedLast(const Handle(GEOM_Object)& theObj1,
646                                             const Handle(GEOM_Object)& theObj2);
647 };
648
649 #endif