Salome HOME
71ca26dc5b3f6ce01a49930aee90cde3f14bace8
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IShapesOperations.hxx
1 // Copyright (C) 2007-2023  CEA, EDF, 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 #include <vector>
46
47 class GEOM_Engine;
48 class GEOM_Object;
49 class TopoDS_Shape;
50
51 class GEOMImpl_IShapesOperations : public GEOM_IOperations
52 {
53  public:
54
55   enum SubShapeType {
56     None      = 0x00,
57     Groups    = 0x01,
58     Fields    = 0x02,
59     SubShapes = 0x04,
60     All       = Groups | Fields | SubShapes,
61   };
62
63   /**
64    * This enumeration represents an extraction statistics type.
65    */
66   enum ExtractionStatType
67   {
68     EST_Removed,  ///< Removed sub-shapes
69     EST_Modified, ///< Modified sub-shapes
70     EST_Added     ///< Newly created sub-shapes
71   };
72
73   /*!
74    * This structure defines a format of extraction statistics.
75    */
76   struct ExtractionStat
77   {
78     ExtractionStatType          type;    ///< Type of extraction statistics.
79     std::list<Standard_Integer> indices; ///< Shape indices touched by this type of modification.
80   };
81
82   Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine);
83   Standard_EXPORT ~GEOMImpl_IShapesOperations();
84
85   Standard_EXPORT Handle(GEOM_Object) MakeEdge (Handle(GEOM_Object) thePoint1,
86                                                 Handle(GEOM_Object) thePoint2);
87
88   Standard_EXPORT Handle(GEOM_Object) MakeEdgeOnCurveByLength (Handle(GEOM_Object) theCurve,
89                                                                const Standard_Real theLength,
90                                                                Handle(GEOM_Object) theStartPoint);
91
92   Standard_EXPORT Handle(GEOM_Object) MakeEdgeWire (Handle(GEOM_Object) theWire,
93                                                     const Standard_Real theLinearTolerance,
94                                                     const Standard_Real theAngularTolerance);
95
96   Standard_EXPORT Handle(GEOM_Object) MakeWire (std::list<Handle(GEOM_Object)> theEdgesAndWires,
97                                                 const Standard_Real            theTolerance);
98
99   Standard_EXPORT Handle(GEOM_Object) MakeFace (Handle(GEOM_Object) theWire, const bool isPlanarWanted);
100
101   Standard_EXPORT Handle(GEOM_Object) MakeFaceWires (std::list<Handle(GEOM_Object)> theWires,
102                                                      const bool isPlanarWanted);
103
104   Standard_EXPORT Handle(GEOM_Object) MakeFaceFromSurface
105                                               (Handle(GEOM_Object) theFace,
106                                                Handle(GEOM_Object) theWire);
107                                                
108   Standard_EXPORT Handle(GEOM_Object) MakeFaceWithConstraints (std::list<Handle(GEOM_Object)> theConstraints);
109
110   Standard_EXPORT Handle(GEOM_Object) MakeShell (std::list<Handle(GEOM_Object)> theShapes);
111
112   Standard_EXPORT Handle(GEOM_Object) MakeSolidShells (std::list<Handle(GEOM_Object)> theShells);
113
114   Standard_EXPORT Handle(GEOM_Object) MakeCompound (std::list<Handle(GEOM_Object)> theShapes);
115
116   Standard_EXPORT Handle(GEOM_Object) MakeSolidFromConnectedFaces (std::list<Handle(GEOM_Object)> theFacesOrShells,
117                                                                    const Standard_Boolean isIntersect);
118
119   Standard_EXPORT Handle(GEOM_Object) MakeGlueFaces (std::list< Handle(GEOM_Object) >& theShapes,
120                                                      const Standard_Real theTolerance,
121                                                      const Standard_Boolean doKeepNonSolids);
122
123   Standard_EXPORT Handle(GEOM_Object) MakeGlueFacesByList (std::list< Handle(GEOM_Object) >& theShapes,
124                                                            const Standard_Real theTolerance,
125                                                            std::list<Handle(GEOM_Object)>& theFaces,
126                                                            const Standard_Boolean doKeepNonSolids,
127                                                            const Standard_Boolean doGlueAllEdges);
128
129   Standard_EXPORT Handle(GEOM_Object) MakeGlueEdges (std::list< Handle(GEOM_Object) >& theShapes,
130                                                      const Standard_Real theTolerance);
131
132   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetGlueShapes (std::list< Handle(GEOM_Object) >& theShapes,
133                                                                       const Standard_Real theTolerance,
134                                                                       const TopAbs_ShapeEnum theType);
135
136   Standard_EXPORT Handle(GEOM_Object) MakeGlueEdgesByList (std::list< Handle(GEOM_Object) >& theShapes,
137                                                            const Standard_Real theTolerance,
138                                                            std::list<Handle(GEOM_Object)> & theEdges);
139
140   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetExistingSubObjects(Handle(GEOM_Object)    theShape,
141                                                                              const Standard_Boolean theGroupsOnly);
142   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetExistingSubObjects(Handle(GEOM_Object)    theShape,
143                                                                              const Standard_Integer theTypes = All);
144   
145   enum ExplodeType {
146     EXPLODE_OLD_INCLUDE_MAIN,
147     EXPLODE_NEW_INCLUDE_MAIN,
148     EXPLODE_NEW_EXCLUDE_MAIN
149   };
150
151   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakeExplode
152     (Handle(GEOM_Object)    theShape,
153      const Standard_Integer theShapeType,
154      const Standard_Boolean isSorted,
155      const ExplodeType      theExplodeType = EXPLODE_NEW_INCLUDE_MAIN);
156
157   Standard_EXPORT Handle(TColStd_HSequenceOfInteger) SubShapeAllIDs
158     (Handle(GEOM_Object)    theShape,
159      const Standard_Integer theShapeType,
160      const Standard_Boolean isSorted,
161      const ExplodeType      theExplodeType = EXPLODE_NEW_INCLUDE_MAIN);
162
163   Standard_EXPORT Handle(GEOM_Object) GetSubShape (Handle(GEOM_Object)    theMainShape,
164                                                    const Standard_Integer theID);
165
166   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakeSubShapes
167     (Handle(GEOM_Object)              theMainShape,
168      Handle(TColStd_HArray1OfInteger) theIndices);
169
170   Standard_EXPORT Standard_Integer GetSubShapeIndex (Handle(GEOM_Object) theMainShape,
171                                                      Handle(GEOM_Object) theSubShape);
172   
173   Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetSubShapesIndices (Handle(GEOM_Object) theMainShape,
174                                                                           std::list<Handle(GEOM_Object)> theSubShapes);
175
176   Standard_EXPORT Standard_Integer GetTopologyIndex (Handle(GEOM_Object) theMainShape,
177                                                      Handle(GEOM_Object) theSubShape);
178
179   Standard_EXPORT TCollection_AsciiString GetShapeTypeString (Handle(GEOM_Object) theShape);
180
181   Standard_EXPORT Standard_Boolean IsSubShapeBelongsTo(Handle(GEOM_Object) theSubObject,
182                                                        const Standard_Integer theSubObjectIndex,
183                                                        Handle(GEOM_Object) theObject,
184                                                        const Standard_Integer theObjectIndex);
185
186   Standard_EXPORT Standard_Integer NumberOfSubShapes (Handle(GEOM_Object)    theShape,
187                                                       const Standard_Integer theShapeType);
188
189   Standard_EXPORT Handle(GEOM_Object) ReverseShape(Handle(GEOM_Object) theShapes);
190
191   Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetFreeFacesIDs (Handle(GEOM_Object) theShape);
192
193   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
194     GetSharedShapes (Handle(GEOM_Object)    theShape1,
195                      Handle(GEOM_Object)    theShape2,
196                      const Standard_Integer theShapeType);
197
198   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
199     GetSharedShapes (std::list<Handle(GEOM_Object)>& theShapes,
200                      const Standard_Integer          theShapeType,
201                      const bool                      theMultiShare = true);
202
203   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
204     GetShapesOnPlane (const Handle(GEOM_Object)& theShape,
205                       const Standard_Integer     theShapeType,
206                       const Handle(GEOM_Object)& theAx1,
207                       const GEOMAlgo_State       theState);
208
209   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
210     GetShapesOnPlaneWithLocation (const Handle(GEOM_Object)& theShape,
211                                   const Standard_Integer     theShapeType,
212                                   const Handle(GEOM_Object)& theAx1,
213                                   const Handle(GEOM_Object)& thePnt,
214                                   const GEOMAlgo_State       theState);
215
216
217   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
218     GetShapesOnCylinder (const Handle(GEOM_Object)& theShape,
219                          const Standard_Integer     theShapeType,
220                          const Handle(GEOM_Object)& theAxis,
221                          const Standard_Real        theRadius,
222                          const GEOMAlgo_State       theState);
223
224   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
225     GetShapesOnCylinderWithLocation (const Handle(GEOM_Object)& theShape,
226                                      const Standard_Integer     theShapeType,
227                                      const Handle(GEOM_Object)& theAxis,
228                                      const Handle(GEOM_Object)& thePnt,
229                                      const Standard_Real        theRadius,
230                                      const GEOMAlgo_State       theState);
231
232   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
233     GetShapesOnSphere (const Handle(GEOM_Object)& theShape,
234                        const Standard_Integer     theShapeType,
235                        const Handle(GEOM_Object)& theCenter,
236                        const Standard_Real        theRadius,
237                        const GEOMAlgo_State       theState);
238
239   Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
240     GetShapesOnPlaneIDs (const Handle(GEOM_Object)& theShape,
241                          const Standard_Integer     theShapeType,
242                          const Handle(GEOM_Object)& theAx1,
243                          const GEOMAlgo_State       theState);
244
245   Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
246     GetShapesOnPlaneWithLocationIDs (const Handle(GEOM_Object)& theShape,
247                                      const Standard_Integer     theShapeType,
248                                      const Handle(GEOM_Object)& theAx1,
249                                      const Handle(GEOM_Object)& thePnt,
250                                      const GEOMAlgo_State       theState);
251
252   Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
253     GetShapesOnCylinderIDs (const Handle(GEOM_Object)& theShape,
254                             const Standard_Integer     theShapeType,
255                             const Handle(GEOM_Object)& theAxis,
256                             const Standard_Real        theRadius,
257                             const GEOMAlgo_State       theState);
258
259   Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
260     GetShapesOnCylinderWithLocationIDs (const Handle(GEOM_Object)& theShape,
261                                         const Standard_Integer     theShapeType,
262                                         const Handle(GEOM_Object)& theAxis,
263                                         const Handle(GEOM_Object)& thePnt,
264                                         const Standard_Real        theRadius,
265                                         const GEOMAlgo_State       theState);
266
267   Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
268     GetShapesOnSphereIDs (const Handle(GEOM_Object)& theShape,
269                           const Standard_Integer     theShapeType,
270                           const Handle(GEOM_Object)& theCenter,
271                           const Standard_Real        theRadius,
272                           const GEOMAlgo_State       theState);
273
274   /*!
275    * \brief Find sub-shapes complying with given status about quadrangle
276     * \param theShape - the shape to explore
277     * \param theShapeType - type of sub-shape of theShape
278     * \param theTopLeftPoint - top left quadrangle corner
279     * \param theTopRightPoint - top right quadrangle corner
280     * \param theBottomLeftPoint - bottom left quadrangle corner
281     * \param theBottomRightPoint - bottom right quadrangle corner
282     * \param theState - required state
283     * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
284    */
285   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
286     GetShapesOnQuadrangle (const Handle(GEOM_Object)& theShape,
287                            const Standard_Integer     theShapeType,
288                            const Handle(GEOM_Object)& theTopLeftPoint,
289                            const Handle(GEOM_Object)& theTopRightPoint,
290                            const Handle(GEOM_Object)& theBottomLeftPoint,
291                            const Handle(GEOM_Object)& theBottomRightPoint,
292                            const GEOMAlgo_State       theState);
293
294   /*!
295    * \brief Find IDs of sub-shapes complying with given status about quadrangle
296     * \param theShape - the shape to explore
297     * \param theShapeType - type of sub-shape of theShape
298     * \param theTopLeftPoint - top left quadrangle corner
299     * \param theTopRightPoint - top right quadrangle corner
300     * \param theBottomLeftPoint - bottom left quadrangle corner
301     * \param theBottomRightPoint - bottom right quadrangle corner
302     * \param theState - required state
303     * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
304    */
305   Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
306     GetShapesOnQuadrangleIDs (const Handle(GEOM_Object)& theShape,
307                               const Standard_Integer     theShapeType,
308                               const Handle(GEOM_Object)& theTopLeftPoint,
309                               const Handle(GEOM_Object)& theTopRightPoint,
310                               const Handle(GEOM_Object)& theBottomLeftPoint,
311                               const Handle(GEOM_Object)& theBottomRightPoint,
312                               const GEOMAlgo_State       theState);
313
314   Standard_EXPORT Handle(GEOM_Object) GetShapesOnCylinderOld (Handle(GEOM_Object)    theShape,
315                                                               const Standard_Integer theShapeType,
316                                                               Handle(GEOM_Object)    theAxis,
317                                                               const Standard_Real    theRadius);
318
319   Standard_EXPORT Handle(GEOM_Object) GetShapesOnSphereOld (Handle(GEOM_Object)    theShape,
320                                                             const Standard_Integer theShapeType,
321                                                             Handle(GEOM_Object)    theCenter,
322                                                             const Standard_Real    theRadius);
323
324   Standard_EXPORT Handle(GEOM_Object) GetInPlace (Handle(GEOM_Object) theShapeWhere,
325                                                   Handle(GEOM_Object) theShapeWhat);
326
327   Standard_EXPORT Handle(GEOM_Object) GetInPlaceOld (Handle(GEOM_Object) theShapeWhere,
328                                                      Handle(GEOM_Object) theShapeWhat);
329
330   Standard_EXPORT Handle(GEOM_Object) GetInPlaceByHistory (Handle(GEOM_Object) theShapeWhere,
331                                                            Handle(GEOM_Object) theShapeWhat);
332
333   Standard_EXPORT void GetInPlaceMap (Handle(GEOM_Object)                 theShapeWhere,
334                                       Handle(GEOM_Object)                 theShapeWhat,
335                                       std::vector< std::vector< int > > & theResVec);
336
337   /*!
338    * \brief Searches a shape equal to theWhat in the context of theWhere
339    * \param theShapeWhere - a context shap
340    * \param theShapeWhat - a sample shape
341    * \retval Handle(GEOM_Object) - found shape
342    */
343   Standard_EXPORT Handle(GEOM_Object) GetSame(const Handle(GEOM_Object)& theShapeWhere,
344                                               const Handle(GEOM_Object)& theShapeWhat);
345
346   /*!
347    * \brief Searches a shape equal to theWhat in the context of theWhere
348    * \param theShapeWhere - a context shap
349    * \param theShapeWhat - a sample shape
350    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
351    */
352   Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetSameIDs(const Handle(GEOM_Object)& theShapeWhere,
353                                                                  const Handle(GEOM_Object)& theShapeWhat);
354
355   /*!
356    * \brief Find IDs of sub-shapes complying with given status about surface
357     * \param theBox - the box to check state of sub-shapes against
358     * \param theShape - the shape to explore
359     * \param theShapeType - type of sub-shape of theShape
360     * \param theState - required state
361     * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
362    */
363   Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
364                               GetShapesOnBoxIDs(const Handle(GEOM_Object)& theBox,
365                                                 const Handle(GEOM_Object)& theShape,
366                                                 const Standard_Integer theShapeType,
367                                                 GEOMAlgo_State theState);
368
369   /*!
370    * \brief Find sub-shapes complying with given status about surface
371    * \param theBox - the box to check state of sub-shapes against
372    * \param theShape - the shape to explore
373    * \param theShapeType - type of sub-shape of theShape
374    * \param theState - required state
375    * \retval Handle(TColStd_HSequenceOfTransient) - found shape objects
376    */
377   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
378                              GetShapesOnBox(const Handle(GEOM_Object)& theBox,
379                                             const Handle(GEOM_Object)& theShape,
380                                             const Standard_Integer theShapeType,
381                                             GEOMAlgo_State theState);
382
383   /*!
384    * \brief Find IDs of sub-shapes complying with given status about surface
385    * \param theCheckShape - the shape to check state of sub-shapes against
386    * \param theShape - the shape to explore
387    * \param theShapeType - type of sub-shape of theShape
388    * \param theState - required state
389    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
390    */
391   Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
392                    GetShapesOnShapeIDs(const Handle(GEOM_Object)& theCheckShape,
393                                        const Handle(GEOM_Object)& theShape,
394                                        const Standard_Integer theShapeType,
395                                        GEOMAlgo_State theState);
396
397   /*!
398    * \brief Find sub-shapes complying with given status about surface
399    * \param theCheckShape - the shape to check state of sub-shapes against
400    * \param theShape - the shape to explore
401    * \param theShapeType - type of sub-shape of theShape
402    * \param theState - required state
403    * \retval Handle(TColStd_HSequenceOfTransient) - found shape objects
404    */
405   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
406                       GetShapesOnShape(const Handle(GEOM_Object)& theCheckShape,
407                                        const Handle(GEOM_Object)& theShape,
408                                        const Standard_Integer theShapeType,
409                                        GEOMAlgo_State theState);
410   Standard_EXPORT Handle(GEOM_Object)
411             GetShapesOnShapeAsCompound(const Handle(GEOM_Object)& theCheckShape,
412                                        const Handle(GEOM_Object)& theShape,
413                                        const Standard_Integer theShapeType,
414                                        GEOMAlgo_State theState);
415
416   /*!
417    * \brief Resize the input edge with the new Min and Max parameters.
418    * The input edge parameters range is [0, 1]. If theMin parameter is
419    * negative, the input edge is extended, otherwise it is shrinked by
420    * theMin parameter. If theMax is greater than 1, the edge is extended,
421    * otherwise it is shrinked by theMax parameter
422    * \param theEdge the input edge to be resized
423    * \param theMin the minimal parameter value
424    * \param theMax the maximal parameter value
425    * \retval Handle(GEOM_Object) - newly created edge
426    */
427   Standard_EXPORT Handle(GEOM_Object)
428                             ExtendEdge(const Handle(GEOM_Object)& theEdge,
429                                        const Standard_Real        theMin,
430                                        const Standard_Real        theMax);
431
432   /*!
433    * \brief Resize the input face with the new UMin, UMax, VMin and VMax
434    * parameters. The input face U and V parameters range is [0, 1]. If
435    * theUMin parameter is negative, the input face is extended, otherwise
436    * it is shrinked along U direction by theUMin parameter. If theUMax is
437    * greater than 1, the face is extended, otherwise it is shrinked along
438    * U direction by theUMax parameter. So as for theVMin, theVMax and
439    * V direction of the input face.
440    * \param theFace the input face to be resized
441    * \param theUMin the minimal U parameter value
442    * \param theUMax the maximal U parameter value
443    * \param theVMin the minimal V parameter value
444    * \param theVMax the maximal V parameter value
445    * \retval Handle(GEOM_Object) - newly created face
446    */
447   Standard_EXPORT Handle(GEOM_Object)
448                             ExtendFace(const Handle(GEOM_Object)& theFace,
449                                        const Standard_Real        theUMin,
450                                        const Standard_Real        theUMax,
451                                        const Standard_Real        theVMin,
452                                        const Standard_Real        theVMax);
453   
454   /*!
455    * \brief Make a surface from a face. This function takes some face as
456    * input parameter and creates new GEOM_Object, i.e. topological shape
457    * by extracting underlying surface of the source face and limiting it
458    * by the Umin, Umax, Vmin, Vmax parameters of the source face (in the
459    * parametrical space).
460    * \param theFace the input face
461    * \retval Handle(GEOM_Object) - newly created face
462    */
463   Standard_EXPORT Handle(GEOM_Object)
464                    MakeSurfaceFromFace(const Handle(GEOM_Object) &theFace);
465
466   /*!
467    * \brief Explode a shape into edges sorted in a row from a starting point.
468    * \param theShape - the shape to be exploded on edges.
469    * \param theStartPoint - the starting point.
470    * \return Ordered list of edges sorted in a row from a starting point.
471    */
472   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
473     GetSubShapeEdgeSorted (const Handle(GEOM_Object) &theShape,
474                            const Handle(GEOM_Object) &theStartPoint);
475
476   /*!
477    * \brief Return the list of subshapes that satisfies a certain tolerance
478    * criterion. The user defines the type of shapes to be returned, the
479    * condition and the tolerance value. The operation is defined for
480    * faces, edges and vertices only. E.g. for theShapeType FACE, theCondition
481    * CC_GT and theTolerance 1.e-7 this method returns all faces of theShape
482    * that have tolerances greater then 1.e7.
483    *
484    * \param theShape the shape to be exploded
485    * \param theShapeType the type of shapes to be returned. Can have the
486    *        values FACE, EDGE and VERTEX only.
487    * \param theCondition the condition type.
488    * \param theTolerance the tolerance filter.
489    * \return the list of shapes that satisfy the conditions.
490    */
491   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetSubShapesWithTolerance
492                      (const Handle(GEOM_Object)            &theShape,
493                       const Standard_Integer                theShapeType,
494                       const GEOMUtils::ComparisonCondition  theCondition,
495                       const Standard_Real                   theTolerance);
496
497   /*!
498    * \brief Return the shape that is constructed from theShape without
499    * extracted sub-shapes from the input list.
500    *
501    * \param theShape the original shape.
502    * \param theSubShapeIDs the list of sub-shape IDs to be extracted from
503    *        the original shape.
504    * \param theStats the operation statistics. Output parameter.
505    * \return the shape without extracted sub-shapes.
506    */
507   Standard_EXPORT Handle(GEOM_Object) MakeExtraction
508                      (const Handle(GEOM_Object)              &theShape,
509                       const Handle(TColStd_HArray1OfInteger) &theSubShapeIDs,
510                       std::list<ExtractionStat>              &theStats);
511
512  private:
513   Handle(GEOM_Object) MakeShape (std::list<Handle(GEOM_Object)>      theShapes,
514                                  const Standard_Integer         theObjectType,
515                                  const Standard_Integer         theFunctionType,
516                                  const TCollection_AsciiString& theMethodName);
517
518 // ----------------------------------------------------
519 // methods common for all GetShapesOnXXX() functions
520 // ----------------------------------------------------
521
522   /*!
523    * \brief Checks if theShapeType parameter of GetShapesOnXXX() is OK
524    * \param theShapeType - the shape type to check
525    * \retval bool  - result of the check
526    */
527   bool checkTypeShapesOn(const Standard_Integer theShapeType);
528
529   /*!
530    * \brief Creates Geom_Plane
531    * \param theAx1 - edge defining plane normal
532    * \retval Handle(Geom_Surface) - resulting surface
533    */
534   Handle(Geom_Surface) makePlane(const TopoDS_Shape& theAx1);
535
536   /*!
537    * \brief Creates Geom_CylindricalSurface
538    * \param theAx1 - edge defining cylinder axis
539    * \param theRadius - cylinder radius
540    * \retval Handle(Geom_Surface) - resulting surface
541    */
542   Handle(Geom_Surface) makeCylinder(const TopoDS_Shape& theAx1,
543                                     const Standard_Real theRadius);
544
545   /*!
546    * \brief Find IDs of sub-shapes complying with given status about surface
547    * \param theSurface - the surface to check state of sub-shapes against
548    * \param theShape - the shape to explore
549    * \param theShapeType - type of sub-shape of theShape
550    * \param theState - required state
551    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
552    */
553   Handle(TColStd_HSequenceOfInteger)
554     getShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
555                           const TopoDS_Shape&         theShape,
556                           TopAbs_ShapeEnum            theShapeType,
557                           GEOMAlgo_State              theState);
558
559   /*!
560    * \brief Find sub-shapes complying with given status about surface
561    * \param theSurface - the surface to check state of sub-shapes against
562    * \param theShape - the shape to explore
563    * \param theShapeType - type of sub-shape of theShape
564    * \param theState - required state
565    * \param theShapeEntries - outgoing entries like "entry1, entry2, ..."
566    * \retval Handle(TColStd_HSequenceOfTransient) - found shape objects
567    */
568   Handle(TColStd_HSequenceOfTransient)
569     getShapesOnSurface(const Handle(Geom_Surface)& theSurface,
570                        const Handle(GEOM_Object)&  theShape,
571                        TopAbs_ShapeEnum            theShapeType,
572                        GEOMAlgo_State              theState,
573                        TCollection_AsciiString &   theShapeEntries);
574
575   /*!
576    * \brief Find IDs of sub-shapes complying with given status about quadrangle
577    * \param theShape - the shape to explore
578    * \param theShapeType - type of sub-shape of theShape
579    * \param theTopLeftPoint - top left quadrangle corner
580    * \param theTopRightPoint - top right quadrangle corner
581    * \param theBottomLeftPoint - bottom left quadrangle corner
582    * \param theBottomRightPoint - bottom right quadrangle corner
583    * \param theState - required state
584    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
585    */
586   Handle(TColStd_HSequenceOfInteger)
587     getShapesOnQuadrangleIDs (const Handle(GEOM_Object)& theShape,
588                               const Standard_Integer     theShapeType,
589                               const Handle(GEOM_Object)& theTopLeftPoint,
590                               const Handle(GEOM_Object)& theTopRightPoint,
591                               const Handle(GEOM_Object)& theBottomLeftPoint,
592                               const Handle(GEOM_Object)& theBottomRightPoint,
593                               const GEOMAlgo_State       theState);
594
595   /*!
596    * \brief Find IDs of sub-shapes complying with given status about surface
597    * \param theBox - the box to check state of sub-shapes against
598    * \param theShape - the shape to explore
599    * \param theShapeType - type of sub-shape of theShape
600    * \param theState - required state
601    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
602    */
603   Handle(TColStd_HSequenceOfInteger) getShapesOnBoxIDs(const Handle(GEOM_Object)& theBox,
604                                                        const Handle(GEOM_Object)& theShape,
605                                                        const Standard_Integer theShapeType,
606                                                        GEOMAlgo_State theState);
607
608   /*!
609    * \brief Find IDs of sub-shapes complying with given status about surface
610    * \param theCheckShape - the shape to check state of sub-shapes against
611    * \param theShape - the shape to explore
612    * \param theShapeType - type of sub-shape of theShape
613    * \param theState - required state
614    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
615    */
616   Handle(TColStd_HSequenceOfInteger) getShapesOnShapeIDs
617                                       (const Handle(GEOM_Object)& theCheckShape,
618                                        const Handle(GEOM_Object)& theShape,
619                                        const Standard_Integer theShapeType,
620                                        GEOMAlgo_State theState);
621
622   /*!
623    * \brief Find shape objects and their entries by their ids
624    * \param theShape - the main shape
625    * \param theShapeIDs - theShapeIDs - incoming shape ids
626    * \param theShapeEntries - outgoing entries like "entry1, entry2, ..."
627    * \retval Handle(TColStd_HSequenceOfTransient) - found shape objects
628    */
629   Handle(TColStd_HSequenceOfTransient)
630     getObjectsShapesOn(const Handle(GEOM_Object)&                theShape,
631                        const Handle(TColStd_HSequenceOfInteger)& theShapeIDs,
632                        TCollection_AsciiString &                 theShapeEntries);
633
634   /*!
635    * \brief Explode a shape into edges sorted in a row from a starting point.
636    * \param theShape - the shape to be exploded on edges.
637    * \param theStartPoint - the starting point.
638    * \return Ordered list of edges sorted in a row from a starting point.
639    */
640   Handle(TColStd_HSequenceOfInteger) getSubShapeEdgeSortedIDs
641                                 (const Handle(GEOM_Object) &theShape,
642                                  const Handle(GEOM_Object) &theStartPoint);
643
644   /*!
645    * \brief Select the object created last
646    * \param theObj1 - Object 1
647    * \param theObj2 - Object 2
648    * \retval Handle(GEOM_Object) - selected object
649    */
650   static Handle(GEOM_Object) getCreatedLast(const Handle(GEOM_Object)& theObj1,
651                                             const Handle(GEOM_Object)& theObj2);
652 };
653
654 #endif