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