Salome HOME
Added 2 new operations:
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IShapesOperations.hxx
1 // Copyright (C) 2007-2011  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.
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
37 #include <TopoDS_Shape.hxx>
38 #include <TopTools_ListOfShape.hxx>
39 #include <NCollection_DataMap.hxx>
40 #include <TColStd_HSequenceOfTransient.hxx>
41 #include <TColStd_HSequenceOfInteger.hxx>
42
43 #include <Handle_Geom_Surface.hxx>
44
45 #include <gp_Pnt.hxx>
46
47 #include <list>
48 #include <functional>
49
50 class GEOM_Engine;
51 class Handle(GEOM_Object);
52 class Handle(TColStd_HArray1OfInteger);
53
54 inline Standard_Boolean IsEqual (const TopoDS_Shape& S1, const TopoDS_Shape& S2)
55 {
56   return S1.IsSame(S2);
57 }
58
59 class GEOMImpl_IShapesOperations : public GEOM_IOperations
60 {
61  public:
62   Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine, int theDocID);
63   Standard_EXPORT ~GEOMImpl_IShapesOperations();
64
65   Standard_EXPORT Handle(GEOM_Object) MakeEdge (Handle(GEOM_Object) thePoint1,
66                                                 Handle(GEOM_Object) thePoint2);
67
68   Standard_EXPORT Handle(GEOM_Object) MakeEdgeOnCurveByLength (Handle(GEOM_Object) theCurve,
69                                                                const Standard_Real theLength,
70                                                                Handle(GEOM_Object) theStartPoint);
71
72   Standard_EXPORT Handle(GEOM_Object) MakeEdgeWire (Handle(GEOM_Object) theWire,
73                                                     const Standard_Real theLinearTolerance,
74                                                     const Standard_Real theAngularTolerance);
75
76   Standard_EXPORT Handle(GEOM_Object) MakeWire (std::list<Handle(GEOM_Object)> theEdgesAndWires,
77                                                 const Standard_Real            theTolerance);
78
79   Standard_EXPORT Handle(GEOM_Object) MakeFace (Handle(GEOM_Object) theWire, const bool isPlanarWanted);
80
81   Standard_EXPORT Handle(GEOM_Object) MakeFaceWires (std::list<Handle(GEOM_Object)> theWires,
82                                                      const bool isPlanarWanted);
83
84   Standard_EXPORT Handle(GEOM_Object) MakeShell (std::list<Handle(GEOM_Object)> theShapes);
85
86   Standard_EXPORT Handle(GEOM_Object) MakeSolidShells (std::list<Handle(GEOM_Object)> theShells);
87
88   Standard_EXPORT Handle(GEOM_Object) MakeCompound (std::list<Handle(GEOM_Object)> theShapes);
89
90   Standard_EXPORT Handle(GEOM_Object) MakeGlueFaces (Handle(GEOM_Object) theShape,
91                                                      const Standard_Real theTolerance,
92                                                      const Standard_Boolean doKeepNonSolids);
93
94   //Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetGlueFaces (Handle(GEOM_Object) theShape,
95   //                                                                   const Standard_Real theTolerance);
96
97   Standard_EXPORT Handle(GEOM_Object) MakeGlueFacesByList (Handle(GEOM_Object) theShape,
98                                                            const Standard_Real theTolerance,
99                                                            std::list<Handle(GEOM_Object)> theFaces,
100                                                            const Standard_Boolean doKeepNonSolids,
101                                                            const Standard_Boolean doGlueAllEdges);
102
103   Standard_EXPORT Handle(GEOM_Object) MakeGlueEdges (Handle(GEOM_Object) theShape,
104                                                      const Standard_Real theTolerance);
105
106   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetGlueShapes (Handle(GEOM_Object) theShape,
107                                                                       const Standard_Real theTolerance,
108                                                                       const TopAbs_ShapeEnum theType);
109
110   Standard_EXPORT Handle(GEOM_Object) MakeGlueEdgesByList (Handle(GEOM_Object) theShape,
111                                                            const Standard_Real theTolerance,
112                                                            std::list<Handle(GEOM_Object)> theEdges);
113
114   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetExistingSubObjects
115     (Handle(GEOM_Object)    theShape,
116      const Standard_Boolean theGroupsOnly);
117
118   enum ExplodeType {
119     EXPLODE_OLD_INCLUDE_MAIN,
120     EXPLODE_NEW_INCLUDE_MAIN,
121     EXPLODE_NEW_EXCLUDE_MAIN
122   };
123
124   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakeExplode
125     (Handle(GEOM_Object)    theShape,
126      const Standard_Integer theShapeType,
127      const Standard_Boolean isSorted,
128      const ExplodeType      theExplodeType = EXPLODE_NEW_INCLUDE_MAIN);
129
130   Standard_EXPORT Handle(TColStd_HSequenceOfInteger) SubShapeAllIDs
131     (Handle(GEOM_Object)    theShape,
132      const Standard_Integer theShapeType,
133      const Standard_Boolean isSorted,
134      const ExplodeType      theExplodeType = EXPLODE_NEW_INCLUDE_MAIN);
135
136   Standard_EXPORT Handle(GEOM_Object) GetSubShape (Handle(GEOM_Object)    theMainShape,
137                                                    const Standard_Integer theID);
138
139   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakeSubShapes
140     (Handle(GEOM_Object)              theMainShape,
141      Handle(TColStd_HArray1OfInteger) theIndices);
142
143   Standard_EXPORT Standard_Integer GetSubShapeIndex (Handle(GEOM_Object) theMainShape,
144                                                      Handle(GEOM_Object) theSubShape);
145
146   Standard_EXPORT Standard_Integer GetTopologyIndex (Handle(GEOM_Object) theMainShape,
147                                                      Handle(GEOM_Object) theSubShape);
148
149   Standard_EXPORT TCollection_AsciiString GetShapeTypeString (Handle(GEOM_Object) theShape);
150
151   Standard_EXPORT Standard_Integer NumberOfSubShapes (Handle(GEOM_Object)    theShape,
152                                                       const Standard_Integer theShapeType);
153
154   Standard_EXPORT Handle(GEOM_Object) ReverseShape(Handle(GEOM_Object) theShapes);
155
156   Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetFreeFacesIDs (Handle(GEOM_Object) theShape);
157
158   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
159     GetSharedShapes (Handle(GEOM_Object)    theShape1,
160                      Handle(GEOM_Object)    theShape2,
161                      const Standard_Integer theShapeType);
162
163   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
164     GetSharedShapes (std::list<Handle(GEOM_Object)> theShapes,
165                      const Standard_Integer         theShapeType);
166
167   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
168     GetShapesOnPlane (const Handle(GEOM_Object)& theShape,
169                       const Standard_Integer     theShapeType,
170                       const Handle(GEOM_Object)& theAx1,
171                       const GEOMAlgo_State       theState);
172
173   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
174     GetShapesOnPlaneWithLocation (const Handle(GEOM_Object)& theShape,
175                                   const Standard_Integer     theShapeType,
176                                   const Handle(GEOM_Object)& theAx1,
177                                   const Handle(GEOM_Object)& thePnt,
178                                   const GEOMAlgo_State       theState);
179
180
181   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
182     GetShapesOnCylinder (const Handle(GEOM_Object)& theShape,
183                          const Standard_Integer     theShapeType,
184                          const Handle(GEOM_Object)& theAxis,
185                          const Standard_Real        theRadius,
186                          const GEOMAlgo_State       theState);
187
188   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
189     GetShapesOnCylinderWithLocation (const Handle(GEOM_Object)& theShape,
190                                      const Standard_Integer     theShapeType,
191                                      const Handle(GEOM_Object)& theAxis,
192                                      const Handle(GEOM_Object)& thePnt,
193                                      const Standard_Real        theRadius,
194                                      const GEOMAlgo_State       theState);
195
196   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
197     GetShapesOnSphere (const Handle(GEOM_Object)& theShape,
198                        const Standard_Integer     theShapeType,
199                        const Handle(GEOM_Object)& theCenter,
200                        const Standard_Real        theRadius,
201                        const GEOMAlgo_State       theState);
202
203   Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
204     GetShapesOnPlaneIDs (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_HSequenceOfInteger)
210     GetShapesOnPlaneWithLocationIDs (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   Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
217     GetShapesOnCylinderIDs (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_HSequenceOfInteger)
224     GetShapesOnCylinderWithLocationIDs (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_HSequenceOfInteger)
232     GetShapesOnSphereIDs (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   /*!
239    * \brief Find sub-shapes complying with given status about quadrangle
240     * \param theShape - the shape to explore
241     * \param theShapeType - type of sub-shape of theShape
242     * \param theTopLeftPoint - top left quadrangle corner
243     * \param theTopRigthPoint - top right quadrangle corner
244     * \param theBottomLeftPoint - bottom left quadrangle corner
245     * \param theBottomRigthPoint - bottom right quadrangle corner
246     * \param theState - required state
247     * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
248    */
249   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
250     GetShapesOnQuadrangle (const Handle(GEOM_Object)& theShape,
251                            const Standard_Integer     theShapeType,
252                            const Handle(GEOM_Object)& theTopLeftPoint,
253                            const Handle(GEOM_Object)& theTopRigthPoint,
254                            const Handle(GEOM_Object)& theBottomLeftPoint,
255                            const Handle(GEOM_Object)& theBottomRigthPoint,
256                            const GEOMAlgo_State       theState);
257
258   /*!
259    * \brief Find IDs of sub-shapes complying with given status about quadrangle
260     * \param theShape - the shape to explore
261     * \param theShapeType - type of sub-shape of theShape
262     * \param theTopLeftPoint - top left quadrangle corner
263     * \param theTopRigthPoint - top right quadrangle corner
264     * \param theBottomLeftPoint - bottom left quadrangle corner
265     * \param theBottomRigthPoint - bottom right quadrangle corner
266     * \param theState - required state
267     * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
268    */
269   Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
270     GetShapesOnQuadrangleIDs (const Handle(GEOM_Object)& theShape,
271                               const Standard_Integer     theShapeType,
272                               const Handle(GEOM_Object)& theTopLeftPoint,
273                               const Handle(GEOM_Object)& theTopRigthPoint,
274                               const Handle(GEOM_Object)& theBottomLeftPoint,
275                               const Handle(GEOM_Object)& theBottomRigthPoint,
276                               const GEOMAlgo_State       theState);
277
278   Standard_EXPORT Handle(GEOM_Object) GetShapesOnCylinderOld (Handle(GEOM_Object)    theShape,
279                                                               const Standard_Integer theShapeType,
280                                                               Handle(GEOM_Object)    theAxis,
281                                                               const Standard_Real    theRadius);
282
283   Standard_EXPORT Handle(GEOM_Object) GetShapesOnSphereOld (Handle(GEOM_Object)    theShape,
284                                                             const Standard_Integer theShapeType,
285                                                             Handle(GEOM_Object)    theCenter,
286                                                             const Standard_Real    theRadius);
287
288   void GetShapeProperties(const TopoDS_Shape aShape, Standard_Real propertiesArray[], gp_Pnt & aPnt);
289
290   Standard_EXPORT Handle(GEOM_Object) GetInPlace (Handle(GEOM_Object) theShapeWhere,
291                                                   Handle(GEOM_Object) theShapeWhat);
292
293   Standard_EXPORT Handle(GEOM_Object) GetInPlaceOld (Handle(GEOM_Object) theShapeWhere,
294                                                      Handle(GEOM_Object) theShapeWhat);
295
296   Standard_EXPORT Handle(GEOM_Object) GetInPlaceByHistory (Handle(GEOM_Object) theShapeWhere,
297                                                            Handle(GEOM_Object) theShapeWhat);
298
299   /*!
300    * \brief Searches a shape equal to theWhat in the context of theWhere
301    * \param theShapeWhere - a context shap
302    * \param theShapeWhat - a sample shape
303    * \retval Handle(GEOM_Object) - found shape
304    */
305   Standard_EXPORT Handle(GEOM_Object) GetSame(const Handle(GEOM_Object)& theShapeWhere,
306                                               const Handle(GEOM_Object)& theShapeWhat);
307
308   /*!
309    * \brief Find IDs of sub-shapes complying with given status about surface
310     * \param theBox - the box to check state of sub-shapes against
311     * \param theShape - the shape to explore
312     * \param theShapeType - type of sub-shape of theShape
313     * \param theState - required state
314     * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
315    */
316   Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
317                               GetShapesOnBoxIDs(const Handle(GEOM_Object)& theBox,
318                                                 const Handle(GEOM_Object)& theShape,
319                                                 const Standard_Integer theShapeType,
320                                                 GEOMAlgo_State theState);
321
322   /*!
323    * \brief Find sub-shapes complying with given status about surface
324    * \param theBox - the box to check state of sub-shapes against
325    * \param theShape - the shape to explore
326    * \param theShapeType - type of sub-shape of theShape
327    * \param theState - required state
328    * \retval Handle(TColStd_HSequenceOfTransient) - found shape objects
329    */
330   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
331                              GetShapesOnBox(const Handle(GEOM_Object)& theBox,
332                                             const Handle(GEOM_Object)& theShape,
333                                             const Standard_Integer theShapeType,
334                                             GEOMAlgo_State theState);
335
336   /*!
337    * \brief Find IDs of sub-shapes complying with given status about surface
338    * \param theCheckShape - the shape to check state of sub-shapes against
339    * \param theShape - the shape to explore
340    * \param theShapeType - type of sub-shape of theShape
341    * \param theState - required state
342    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
343    */
344   Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
345                    GetShapesOnShapeIDs(const Handle(GEOM_Object)& theCheckShape,
346                                        const Handle(GEOM_Object)& theShape,
347                                        const Standard_Integer theShapeType,
348                                        GEOMAlgo_State theState);
349
350   /*!
351    * \brief Find sub-shapes complying with given status about surface
352    * \param theCheckShape - the shape 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_HSequenceOfTransient) - found shape objects
357    */
358   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
359                       GetShapesOnShape(const Handle(GEOM_Object)& theCheckShape,
360                                        const Handle(GEOM_Object)& theShape,
361                                        const Standard_Integer theShapeType,
362                                        GEOMAlgo_State theState);
363   Standard_EXPORT Handle(GEOM_Object)
364             GetShapesOnShapeAsCompound(const Handle(GEOM_Object)& theCheckShape,
365                                        const Handle(GEOM_Object)& theShape,
366                                        const Standard_Integer theShapeType,
367                                        GEOMAlgo_State theState);
368
369  public:
370   /*!
371    * \brief Sort shapes in the list by their coordinates.
372    * \param SL The list of shapes to sort.
373    */
374   struct CompareShapes : public std::binary_function<TopoDS_Shape, TopoDS_Shape, bool>
375   {
376     CompareShapes (bool isOldSorting)
377       : myIsOldSorting(isOldSorting) {}
378
379     bool operator()(const TopoDS_Shape& lhs, const TopoDS_Shape& rhs);
380
381     typedef NCollection_DataMap<TopoDS_Shape, std::pair<double, double> > NCollection_DataMapOfShapeDouble;
382     NCollection_DataMapOfShapeDouble myMap;
383     bool myIsOldSorting;
384   };
385
386   Standard_EXPORT static void SortShapes (TopTools_ListOfShape& SL,
387                                           const Standard_Boolean isOldSorting = Standard_True);
388
389   /*!
390    * \brief Convert TopoDS_COMPSOLID to TopoDS_COMPOUND.
391    *
392    * If the argument shape is not of type TopoDS_COMPSOLID, this method returns it as is.
393    *
394    * \param theCompsolid The compsolid to be converted.
395    * \retval TopoDS_Shape Returns the resulting compound.
396    */
397   Standard_EXPORT static TopoDS_Shape CompsolidToCompound (const TopoDS_Shape& theCompsolid);
398
399   /*!
400    * \brief Build a triangulation on \a theShape if it is absent.
401    * \param theShape The shape to check/build triangulation on.
402    * \retval bool Returns false if the shape has no faces, i.e. impossible to build triangulation.
403    */
404   Standard_EXPORT static bool CheckTriangulation (const TopoDS_Shape& theShape);
405
406   /*!
407    * \brief Return type of shape for explode. In case of compound it will be a type of its first sub shape.
408    * \param theShape The shape to get type of.
409    * \retval TopAbs_ShapeEnum Return type of shape for explode.
410    */
411   Standard_EXPORT static TopAbs_ShapeEnum GetTypeOfSimplePart (const TopoDS_Shape& theShape);
412
413  private:
414   Handle(GEOM_Object) MakeShape (std::list<Handle(GEOM_Object)>      theShapes,
415                                  const Standard_Integer         theObjectType,
416                                  const Standard_Integer         theFunctionType,
417                                  const TCollection_AsciiString& theMethodName);
418
419 // ----------------------------------------------------
420 // methods common for all GetShapesOnXXX() functions
421 // ----------------------------------------------------
422
423   /*!
424    * \brief Checks if theShapeType parameter of GetShapesOnXXX() is OK
425    * \param theShapeType - the shape type to check
426    * \retval bool  - result of the check
427    */
428   bool checkTypeShapesOn(const Standard_Integer theShapeType);
429
430   /*!
431    * \brief Creates Geom_Plane
432    * \param theAx1 - edge defining plane normal
433    * \retval Handle(Geom_Surface) - resulting surface
434    */
435   Handle(Geom_Surface) makePlane(const TopoDS_Shape& theAx1);
436
437   /*!
438    * \brief Creates Geom_CylindricalSurface
439    * \param theAx1 - edge defining cylinder axis
440    * \param theRadius - cylinder radius
441    * \retval Handle(Geom_Surface) - resulting surface
442    */
443   Handle(Geom_Surface) makeCylinder(const TopoDS_Shape& theAx1,
444                                     const Standard_Real theRadius);
445
446   /*!
447    * \brief Find IDs of sub-shapes complying with given status about surface
448    * \param theSurface - the surface to check state of sub-shapes against
449    * \param theShape - the shape to explore
450    * \param theShapeType - type of sub-shape of theShape
451    * \param theState - required state
452    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
453    */
454   Handle(TColStd_HSequenceOfInteger)
455     getShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
456                           const TopoDS_Shape&         theShape,
457                           TopAbs_ShapeEnum            theShapeType,
458                           GEOMAlgo_State              theState);
459
460   /*!
461    * \brief Find sub-shapes complying with given status about surface
462    * \param theSurface - the surface to check state of sub-shapes against
463    * \param theShape - the shape to explore
464    * \param theShapeType - type of sub-shape of theShape
465    * \param theState - required state
466    * \param theShapeEntries - outgoing entries like "entry1, entry2, ..."
467    * \retval Handle(TColStd_HSequenceOfTransient) - found shape objects
468    */
469   Handle(TColStd_HSequenceOfTransient)
470     getShapesOnSurface(const Handle(Geom_Surface)& theSurface,
471                        const Handle(GEOM_Object)&  theShape,
472                        TopAbs_ShapeEnum            theShapeType,
473                        GEOMAlgo_State              theState,
474                        TCollection_AsciiString &   theShapeEntries);
475
476   /*!
477    * \brief Find IDs of sub-shapes complying with given status about quadrangle
478    * \param theShape - the shape to explore
479    * \param theShapeType - type of sub-shape of theShape
480    * \param theTopLeftPoint - top left quadrangle corner
481    * \param theTopRigthPoint - top right quadrangle corner
482    * \param theBottomLeftPoint - bottom left quadrangle corner
483    * \param theBottomRigthPoint - bottom right quadrangle corner
484    * \param theState - required state
485    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
486    */
487   Handle(TColStd_HSequenceOfInteger)
488     getShapesOnQuadrangleIDs (const Handle(GEOM_Object)& theShape,
489                               const Standard_Integer     theShapeType,
490                               const Handle(GEOM_Object)& theTopLeftPoint,
491                               const Handle(GEOM_Object)& theTopRigthPoint,
492                               const Handle(GEOM_Object)& theBottomLeftPoint,
493                               const Handle(GEOM_Object)& theBottomRigthPoint,
494                               const GEOMAlgo_State       theState);
495
496   /*!
497    * \brief Find IDs of sub-shapes complying with given status about surface
498    * \param theBox - the box to check state of sub-shapes against
499    * \param theShape - the shape to explore
500    * \param theShapeType - type of sub-shape of theShape
501    * \param theState - required state
502    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
503    */
504   Handle(TColStd_HSequenceOfInteger) getShapesOnBoxIDs(const Handle(GEOM_Object)& theBox,
505                                                        const Handle(GEOM_Object)& theShape,
506                                                        const Standard_Integer theShapeType,
507                                                        GEOMAlgo_State theState);
508
509   /*!
510    * \brief Find IDs of sub-shapes complying with given status about surface
511    * \param theCheckShape - the shape to check state of sub-shapes against
512    * \param theShape - the shape to explore
513    * \param theShapeType - type of sub-shape of theShape
514    * \param theState - required state
515    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
516    */
517   Handle(TColStd_HSequenceOfInteger) getShapesOnShapeIDs
518                                       (const Handle(GEOM_Object)& theCheckShape,
519                                        const Handle(GEOM_Object)& theShape,
520                                        const Standard_Integer theShapeType,
521                                        GEOMAlgo_State theState);
522
523   /*!
524    * \brief Find shape objects and their entries by their ids
525    * \param theShape - the main shape
526    * \param theShapeIDs - theShapeIDs - incoming shape ids
527    * \param theShapeEntries - outgoing entries like "entry1, entry2, ..."
528    * \retval Handle(TColStd_HSequenceOfTransient) - found shape objects
529    */
530   Handle(TColStd_HSequenceOfTransient)
531     getObjectsShapesOn(const Handle(GEOM_Object)&                theShape,
532                        const Handle(TColStd_HSequenceOfInteger)& theShapeIDs,
533                        TCollection_AsciiString &                 theShapeEntries);
534
535   /*!
536    * \brief Select the object created last
537    * \param theObj1 - Object 1
538    * \param theObj2 - Object 2
539    * \retval Handle(GEOM_Object) - selected object
540    */
541   static Handle(GEOM_Object) getCreatedLast(const Handle(GEOM_Object)& theObj1,
542                                             const Handle(GEOM_Object)& theObj2);
543 };
544
545 #endif