Salome HOME
c50451044c1d36428eb066e42afbc4ed7c700b88
[modules/geom.git] / idl / GEOM_Gen.idl
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 //  File   : GEOM_Gen.idl
23 //  Author : Sergey RUIN
24
25 #ifndef __GEOM_GEN__
26 #define __GEOM_GEN__
27
28 #include "SALOME_Exception.idl"
29 #include "SALOME_Component.idl"
30 #include "SALOMEDS.idl"
31 #include "SALOMEDS_Attributes.idl"
32
33 #include "SALOME_GenericObj.idl"
34
35 module GEOM
36 {
37   /*!
38    *  \brief Topological types of shapes (like Open Cascade types)
39    */
40   enum shape_type 
41   { 
42     /*!  */
43     COMPOUND,
44     /*! A collection of solids */ 
45     COMPSOLID, 
46     /*! A part of 3D space bound by a shell */
47     SOLID, 
48     /*! A collection of faces connected by some edges of their wire boundaries */
49     SHELL,
50     /*! Part of a plane (in 2D geometry) or a surface (in 3D geometry) bounded by a close wire */
51     FACE, 
52     /*!  A sequence of edges connected by their vertices */
53     WIRE, 
54     /*! Edge, a shape corresponding to a curve, and bound by a vertex at each extremity */
55     EDGE, 
56     /*! A zero-dimensional shape corresponding to a point in geometry */
57     VERTEX,
58     /*!  */ 
59     SHAPE };
60
61   /*!
62    * \brief Marker type
63    */
64   enum marker_type { MT_NONE, MT_POINT, MT_PLUS, MT_STAR, MT_O, MT_X, MT_O_POINT, MT_O_PLUS,
65                      MT_O_STAR, MT_O_X, MT_BALL, MT_RING1, MT_RING2, MT_RING3, MT_USER };
66
67   /*!
68    * /brief Marker size
69    */
70   enum marker_size { MS_NONE, MS_10, MS_15, MS_20, MS_25, MS_30, MS_35,
71                      MS_40, MS_45, MS_50, MS_55, MS_60, MS_65, MS_70 };
72
73   /*!
74    *  \brief State of shape relatively geometrical surface like plane, sphere or cylinder.
75    *
76    *  Is used in functions GEOM_IShapesOperations.GetShapesOn<xxx>()
77    */
78   enum shape_state
79   {
80     /*! Shape is on surface */
81     ST_ON,
82
83     /*!
84      *  Shape is in the direction defined by the normal and not on surface.
85      *  For plane it means above the plane,
86      *  For sphere and cylinder it means outside of volume, bounded by the surface.
87      */
88     ST_OUT,
89     
90     /*!
91      *  Shape is in the direction defined by the normal and on surface.
92      *  ONOUT = ON || OUT
93      */
94     ST_ONOUT,
95
96     /*!
97      *  Complementary to ONOUT.
98      *  For plane it means below the plane,
99      *  For sphere and cylinder it means inside the volume, bounded by the surface
100      *  (beyond axis and surface for cylinder and beyond cented and surface for sphere).
101      */
102     ST_IN,
103
104     /*!
105      *  Complementary to OUT.
106      *  ONIN = ON || IN
107      */
108     ST_ONIN
109   };
110
111   /*!
112    *  \brief Kind of method to find inside one main shape some sub-shapes,
113    *  corresponding to other given shape (its argument)
114    *
115    *  Is used in functions GEOM_Gen.RestoreSubShapesO(), GEOM_Gen.RestoreSubShapesSO()
116    */
117   enum find_shape_method
118   {
119     /*! Use GetInPlace functionality. Suits all cases, except transformations */
120     FSM_GetInPlace,
121
122     /*! To be used only for transformation result, to find sub-shapes of argument.
123      *  Only this method can be used after transformation.
124      */
125     FSM_Transformed,
126
127     /*! To find only shared sub-shapes, not modified by the operation */
128     FSM_GetSame,
129
130     /*! Use GetShapesOnShape method (can work only on solids) */
131     FSM_GetShapesOnShape,
132
133     /*! Use GetInPlaceByHistory method (can work only after Partition) */
134     FSM_GetInPlaceByHistory,
135
136     /*! To be used only for multi-transformation result.
137      *  Only this method can be used after multi-transformation.
138      */
139     FSM_MultiTransformed
140   };
141
142   /*!
143    *  \brief Kind of method to perform filling operation
144    *
145    *  Is used in functions GEOM_I3DPrimOperations.MakeFilling()
146    */
147   enum filling_oper_method
148   {
149     /*! Default (standard behaviour) */
150     FOM_Default,
151
152     /*! Use edges orientation  - orientation of edges is used: if the edge is 
153      * reversed, the curve from this edge is reversed before using it in 
154      *  the filling algorithm.
155      */
156     FOM_UseOri,
157
158     /*! Auto-correct edges orientation - changes the orientation of the curves 
159      *  using minimization of sum of distances between the end points of the edges.
160      */
161     FOM_AutoCorrect
162   };
163
164   /*!
165    * \brief Kind of the curves.
166    *
167    * Used in the functions GEOM_ICurvesOperations.MakeCurveParametric(), GEOM_ICurvesOperations.MakeCurveParametricNew()
168    */
169   enum curve_type {
170     /*! Polyline curve */
171     Polyline,
172     
173     /*! Bezier curve */
174     Bezier,
175
176     /*! Interpolation, curve */
177     Interpolation
178   };
179
180
181   typedef sequence<string>      string_array;
182   typedef sequence<short>       short_array;
183   typedef sequence<boolean>     ListOfBool;
184   typedef sequence<long>        ListOfLong;
185   typedef sequence<double>      ListOfDouble;
186
187   interface GEOM_Object;
188
189   typedef sequence<GEOM_Object> ListOfGO;
190
191   # GEOM_Object
192   /*!
193    *  \brief Interface of geometric object
194    */
195   interface GEOM_Object : SALOME::GenericObj
196   {
197
198     /*!
199      *  \brief Get an entry of the object in GEOM component.
200      */
201     string GetEntry();
202
203     /*!
204      *  \brief Get ID of study, where the object is created.
205      */
206     long GetStudyID();
207
208     /*!
209      *  \brief Get internal type of the object (POINT, BOX, CYLINDER, EXTRUSION...).
210      */
211     long GetType();
212
213     /*!
214      *  \brief Get a <VAR>shape_type</VAR> of the object value.
215      */
216     shape_type GetShapeType();
217
218     /*!
219      *  \brief Get the topology type of the object value.
220      *
221      *  In contrast to the shape type, this function returns type of the most
222      *  top-level sub-shape of the COMPOUND or COMPSOLID, if there is only one
223      *  sub-shape there.
224      *  \sa GetShapeType()
225      */
226     shape_type GetTopologyType();
227
228     /*!
229      *  \brief Get a minimal type of the top-level shapes contained in the object.
230      *
231      *  This function is useful for the compounds only; for simple shapes it
232      *  exactly the same value as GetShapeType().
233      *  Note, that compounds are procesed recursively.
234      *
235      *  \sa GetShapeType(), GetTopologyType(), GetMaxShapeType()
236      */
237     shape_type GetMinShapeType();
238
239     /*!
240      *  \brief Get a maximal type of the top-level shapes contained in the object.
241      *
242      *  This function is useful for the compounds only; for simple shapes it
243      *  exactly the same value as GetShapeType().
244      *  Note, that compounds are procesed recursively.
245      *
246      *  \sa GetShapeType(), GetTopologyType(), GetMinShapeType()
247      */
248     shape_type GetMaxShapeType();
249
250     /*!
251      *  \brief Set name of the object.
252      *
253      *  \param theName is a name which will be associated with this object.
254      */
255     void SetName (in string theName);
256
257     /*!
258      *  \brief Get name of the object associated with this object.
259      */
260     string GetName();
261
262     /*!
263      *  \brief Set color of the object.
264      *
265      *  \param theColor is a color of the object.
266      */
267     void SetColor(in SALOMEDS::Color theColor);
268
269     /*!
270      *  Get color of the object.
271      */
272     SALOMEDS::Color GetColor();
273
274     /*!
275      *  Toggle auto color mode on the object.
276      *  \param theAtoColor is a flag which toggles auto color mode.
277      */
278     void SetAutoColor(in boolean theAutoColor);
279
280     /*!
281      *  \brief Get flag of object's auto color mode.
282      */
283     boolean GetAutoColor();
284
285     /*!
286      * \brief Set standard point marker for the object
287      * \param theType standard marker type
288      * \param theSize marker relative size
289      */
290     void SetMarkerStd(in marker_type theType, in marker_size theSize );
291
292     /*!
293      * \brief Set custom point marker for the object. 
294      *
295      * The texture can be added by LoadTexture() or AddTexture() functions.
296      * \param theTextureId texture ID
297      */
298     void SetMarkerTexture(in long theTextureId);
299
300     /*!
301      * \brief Get type of the point marker assigned to the object
302      * \return current marker type (MT_NONE if no marker is set)
303      */
304     marker_type GetMarkerType();
305
306     /*!
307      * \brief Get size of the point marker assigned to the object
308      * \return current marker relative size (MS_NONE if no marker is set)
309      */
310     marker_size GetMarkerSize();
311
312     /*!
313      * \brief Get texture idenifier of the point marker assigned to the object
314      * \return marker texture ID (0 if no marker set)
315      */
316     long GetMarkerTexture();
317
318     /*!
319      *  \brief Set a Study entry where this object was published.
320      */
321     void SetStudyEntry (in string theEntry);
322
323     /*!
324      *  \brief Get a Study entry where this object was published.
325      */
326     string GetStudyEntry();
327
328     /*!
329      *  \brief Get a list of all GEOM_Object on which were the arguments
330      *  when this object was constructed and modified.
331      *  \note This method is supposed to be used by GUI only.
332      */
333     ListOfGO GetDependency();
334
335     /*!
336      *  \brief Get a list of GEOM_Object on which the last function that created or modified the object depends.
337      *  \note This method is supposed to be used by GUI only.
338      */
339     ListOfGO GetLastDependency();
340
341     /*!
342      *  \brief Get the TopoDS_Shape, for colocated case only.
343      */
344     long long getShape();
345
346     ######################################################################
347     # Internal methods (For sub-shape identification)
348     ######################################################################
349     /*!
350      *  \brief Get geometric shape of the object as a byte stream
351      */
352     SALOMEDS::TMPFile GetShapeStream();
353
354     /*
355      *  \brief Returns True if this object is not a sub-shape of another object.
356      */
357     boolean IsMainShape();
358
359     /*
360      *  \brief Get a list of ID's of sub-shapes in the main shape.
361      *  \note Internal method, suppopsed to be used only by GEOM_Client
362      */
363     ListOfLong GetSubShapeIndices();
364
365     /*
366      *  \brief Get a main shape object to which this object is a sub-shape
367      *  \note Internal method, suppopsed to be used only by GEOM_Client
368      */
369     GEOM_Object GetMainShape();
370
371     /*
372      *  \brief Return true if geom object representes a shape.
373      *
374      *  For example, method return false for GEOM_MARKER
375      */
376      boolean IsShape();
377
378     /*
379      *  \brief Return true if passed object is identical to this object
380      *
381      *  \param other object being compared with this one
382      */
383     boolean IsSame(in GEOM_Object other);
384
385      /*!
386      *  Set list of parameters
387      *  \param theParameters is a string containing the notebook variables separated by ":" symbol,
388      *         used for object creation
389      */
390     void SetParameters (in string theParameters);
391
392     /*!
393      *  \brief Return list of notebook variables used for object creation separated by ":" symbol
394      */
395     string GetParameters();
396   };
397
398   # GEOM_IOperations:
399   /*!
400    *  \brief Basic methods of all geometric operations
401    */
402   interface GEOM_IOperations : SALOME::GenericObj
403   {
404     /*!
405      *  \brief To know, if the operation was successfully performed
406      */
407     boolean IsDone();
408
409     /*!
410      *  \brief Set the operation error code
411      *  \param theErrorID is a string describing the error occured
412      *  \note This method is supposed to be used only by interfaces inheriting from IOperations.
413      */
414     void SetErrorCode (in string theErrorID);
415
416     /*!
417      *  \brief Get the operation error code
418      */
419     string GetErrorCode();
420
421     /*!
422      *  \brief Get ID of study, where the operation is defined
423      */
424     long GetStudyID();
425
426     /*!
427      *  \brief Opens a new transaction
428      */
429     void StartOperation();
430
431     /*!
432      *  \brief Closes the previously opened trasaction
433      */
434     void FinishOperation();
435
436     /*!
437      *  \brief Aborts the previously opened transaction
438      */
439     void AbortOperation();
440   };
441   # GEOM_IBasicOperations:
442   /*!
443    *  \brief Interface for basic geometry creation
444    *
445    *  (Point, Vector, Plane, Marker)
446    */
447   interface GEOM_IBasicOperations : GEOM_IOperations
448   {
449     /*!
450      *  \brief Create point by three coordinates.
451      *  \param theX The X coordinate of the point.
452      *  \param theY The Y coordinate of the point.
453      *  \param theZ The Z coordinate of the point.
454      *  \return New GEOM_Object, containing the created point.
455      */
456     GEOM_Object MakePointXYZ (in double theX, in double theY, in double theZ);
457
458     /*!
459      *  \brief Create a point, distant from the referenced point
460      *  on the given distances along the coordinate axes.
461      *  \param theReference The referenced point.
462      *  \param theX Displacement from the referenced point along OX axis.
463      *  \param theY Displacement from the referenced point along OY axis.
464      *  \param theZ Displacement from the referenced point along OZ axis.
465      *  \return New GEOM_Object, containing the created point.
466      */
467     GEOM_Object MakePointWithReference (in GEOM_Object theReference,
468                                         in double theX, in double theY, in double theZ);
469
470     /*!
471      *  Create a point, corresponding to the given parameter on the given curve.
472      *  \param theRefCurve The referenced curve.
473      *  \param theParameter Value of parameter on the referenced curve.
474      *  \return New GEOM_Object, containing the created point.
475      */
476     GEOM_Object MakePointOnCurve (in GEOM_Object theRefCurve,
477                                   in double theParameter);
478
479     /*!
480      *  \brief Create a point, corresponding to the given length on the given curve.
481      *  \param theRefCurve The referenced curve.
482      *  \param theLength Length on the referenced curve. It can be negative.
483      *  \param theStartPoint Any vertex close to one of edge's
484      *                       ends to select start point among them.
485      *                       If NULL, fist vertex is used.
486      *  \return New GEOM_Object, containing the created point.
487      */
488     GEOM_Object MakePointOnCurveByLength (in GEOM_Object theRefCurve,
489                                           in double      theLength,
490                                           in GEOM_Object theStartPoint);
491
492     /*!
493      *  \brief Create a point on the given curve, projecting given point
494      *  \param theRefCurve The referenced curve.
495      *  \param theXParameter X co-ordinate of point to project on curve
496      *  \param theYParameter Y co-ordinate of point to project on curve
497      *  \param theZParameter Z co-ordinate of point to project on curve
498      *  \return New GEOM_Object, containing the created point.
499      */
500     GEOM_Object MakePointOnCurveByCoord (in GEOM_Object theRefCurve,
501                                          in double theXParameter,
502                                          in double theYarameter,
503                                          in double theZPameter);
504
505     /*!
506      *  \brief Create a point, corresponding to the given parameters on the
507      *    given surface.
508      *  \param theRefSurf The referenced surface.
509      *  \param theUParameter Value of U-parameter on the referenced surface.
510      *  \param theVParameter Value of V-parameter on the referenced surface.
511      *  \return New GEOM_Object, containing the created point.
512      */
513     GEOM_Object MakePointOnSurface (in GEOM_Object theRefSurf,
514                                     in double theUParameter,
515                                     in double theVParameter);
516
517     /*!
518      *  \brief Create a point on the given surface, projecting given point
519      *  \param theRefSurf The referenced surface.
520      *  \param theXParameter X co-ordinate of point to project on curve
521      *  \param theYParameter Y co-ordinate of point to project on curve
522      *  \param theZParameter Z co-ordinate of point to project on curve
523      *  \return New GEOM_Object, containing the created point.
524      */
525     GEOM_Object MakePointOnSurfaceByCoord (in GEOM_Object theRefSurf,
526                                            in double theXParameter,
527                                            in double theYarameter,
528                                            in double theZPameter);
529
530
531     /*!
532      *  \brief Create a point, on two lines intersection.
533      *  \param theRefLine1, theRefLine2 The referenced lines.
534      *  \return New GEOM_Object, containing the created point.
535      */
536     GEOM_Object MakePointOnLinesIntersection (in GEOM_Object theRefLine1,
537                                               in GEOM_Object theRefLine2);
538
539      /*!
540      *  \brief Create a vector, corresponding to tangent to the given parameter on the given curve.
541      *  \param theRefCurve The referenced curve.
542      *  \param theParameter Value of parameter on the referenced curve.This value should be have value
543      *  \between 0. and 1.. Value of 0. corresponds first parameter of curve value 1. corresponds
544      *  \last parameter of curve.
545      *  \return New GEOM_Object, containing the created point.
546      */
547      GEOM_Object MakeTangentOnCurve (in GEOM_Object theRefCurve,
548                                      in double theParameter);
549
550     /*!
551      *  \brief Create a vector with the given components.
552      *  \param theDX X component of the vector.
553      *  \param theDY Y component of the vector.
554      *  \param theDZ Z component of the vector.
555      *  \return New GEOM_Object, containing the created vector.
556      */
557     GEOM_Object MakeVectorDXDYDZ (in double theDX,
558                                   in double theDY,
559                                   in double theDZ);
560
561     /*!
562      *  \brief Create a vector between two points.
563      *  \param thePnt1 Start point for the vector.
564      *  \param thePnt2 End point for the vector.
565      *  \return New GEOM_Object, containing the created vector.
566      */
567     GEOM_Object MakeVectorTwoPnt (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
568
569     /*!
570      *  C\brief reate a line, passing through the given point
571      *  and parrallel to the given direction
572      *  \param thePnt Point. The resulting line will pass through it.
573      *  \param theDir Direction. The resulting line will be parallel to it.
574      *  \return New GEOM_Object, containing the created line.
575      */
576     GEOM_Object MakeLine (in GEOM_Object thePnt, in GEOM_Object theDir);
577
578     /*!
579      *  \brief Create a line, passing through the given points
580      *  \param thePnt1 First of two points, defining the line.
581      *  \param thePnt2 Second of two points, defining the line.
582      *  \return New GEOM_Object, containing the created line.
583      */
584     GEOM_Object MakeLineTwoPnt (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
585
586     /*!
587      *  \brief Create a line, given by two faces intersection.
588      *  \param theFace1 First of two faces, defining the line.
589      *  \param theFace2 Second of two faces, defining the line.
590      *  \return New GEOM_Object, containing the created line.
591      */
592     GEOM_Object MakeLineTwoFaces (in GEOM_Object theFace1, in GEOM_Object theFace2);
593
594     /*!
595      *  \brief Create a plane, passing through the three given points
596      *  \param thePnt1 First of three points, defining the plane.
597      *  \param thePnt2 Second of three points, defining the plane.
598      *  \param thePnt3 Fird of three points, defining the plane.
599      *  \param theTrimSize Half size of a side of quadrangle face, representing the plane.
600      *  \return New GEOM_Object, containing the created plane.
601      */
602     GEOM_Object MakePlaneThreePnt (in GEOM_Object thePnt1,
603                                    in GEOM_Object thePnt2,
604                                    in GEOM_Object thePnt3,
605                                    in double theTrimSize);
606
607     /*!
608      *  \brief Create a plane, passing through the given point
609      *  and normal to the given vector.
610      *  \param thePnt Point, the plane has to pass through.
611      *  \param theVec Vector, defining the plane normal direction.
612      *  \param theTrimSize Half size of a side of quadrangle face, representing the plane.
613      *  \return New GEOM_Object, containing the created plane.
614      */
615     GEOM_Object MakePlanePntVec (in GEOM_Object thePnt,
616                                  in GEOM_Object theVec,
617                                  in double theTrimSize);
618
619     /*!
620      *  \brief Create a plane, similar to the existing one, but with another size of representing face.
621      *  \param theFace Referenced plane or LCS(Marker).
622      *  \param theTrimSize New half size of a side of quadrangle face, representing the plane.
623      *  \return New GEOM_Object, containing the created plane.
624      */
625     GEOM_Object MakePlaneFace (in GEOM_Object theFace,
626                                in double theTrimSize);
627
628     /*!
629      *  \brief Create a plane, by two vectors.
630      *  \param theVec1 Vector1, the plane has to pass through first point of this vector.
631      *  \param theVec Vector2, defining the plane normal direction.
632      *  \param theTrimSize Half size of a side of quadrangle face, representing the plane.
633      *  \return New GEOM_Object, containing the created plane.
634      */
635     GEOM_Object MakePlane2Vec (in GEOM_Object theVec1,
636                                in GEOM_Object theVec2,
637                                in double theTrimSize);
638
639     /*!
640      *  \brief Create a plane, defined by local coordinate system.
641      *  \param theLCS Referenced LCS(Marker).
642      *  \param theTrimSize Half size of a side of quadrangle face, representing the plane.
643      *  \param theOrientation OXY, OYZ or OZX orientation = (1, 2 or 3).
644      *  \return New GEOM_Object, containing the created plane.
645      */
646     GEOM_Object MakePlaneLCS (in GEOM_Object theLCS,
647                               in double theTrimSize,
648                               in double theOrientation);
649
650     /*!
651      *  \brief Create a local coordinate system.
652      *  \param theOX,theOY,theOZ Three coordinates of coordinate system origin.
653      *  \param theXDX,theXDY,theXDZ Three components of OX direction
654      *  \param theYDX,theYDY,theYDZ Three components of OY direction
655      *  \return New GEOM_Object, containing the created coordinate system.
656      */
657     GEOM_Object MakeMarker (in double theOX , in double theOY , in double theOZ,
658                             in double theXDX, in double theXDY, in double theXDZ,
659                             in double theYDX, in double theYDY, in double theYDZ);
660
661     /*!
662      *  \brief Create a local coordinate system from shape.
663      *  \param theShape The initial shape to detect the coordinate system.
664      *  \return New GEOM_Object, containing the created coordinate system.
665      */
666     GEOM_Object MakeMarkerFromShape (in GEOM_Object theShape);
667
668     /*!
669      *  \brief Create a local coordinate system from point and two vectors (DX, DY).
670      *  \param theOrigin Point of coordinate system origin.
671      *  \param theXVec Vector of X direction.
672      *  \param theYVec Vector of Y direction.
673      *  \return New GEOM_Object, containing the created coordinate system.
674      */
675     GEOM_Object MakeMarkerPntTwoVec (in GEOM_Object theOrigin,
676                                      in GEOM_Object theXVec, in GEOM_Object theYVec);
677
678     /*!
679      *  \brief Create a tangent plane to specified face in the point with specified parameters.
680      *
681      *  Values of parameters should be between 0. and 1.0
682      *  \param theFace - face for which tangent plane shuold be built.
683      *  \param theParameterU - value of parameter by U
684      *  \param theParameterV - value of parameter Vthe
685      *  \param theTrimSize - defines sizes of created face
686      *  \return New GEOM_Object, containing the face built on tangent plane.
687      */
688     GEOM_Object MakeTangentPlaneOnFace(in GEOM_Object theFace,
689                                        in double theParameterU,
690                                        in double theParameterV,
691                                        in double theTrimSize);
692   };
693
694   interface GEOM_ITransformOperations : GEOM_IOperations
695   {
696     /*!
697      *  \brief Translate the given object along the vector, specified by its end points.
698      *  \param theObject The object to be translated.
699      *  \param thePoint1 Start point of translation vector.
700      *  \param thePoint2 End point of translation vector.
701      *  \return theObject.
702      */
703     GEOM_Object TranslateTwoPoints (in GEOM_Object theObject,
704                                     in GEOM_Object thePoint1,
705                                     in GEOM_Object thePoint2);
706
707     /*!
708      *  \brief Translate the given object along the vector, specified
709      *  by its end points, creating its copy before the translation.
710      *  \param theObject The object to be translated.
711      *  \param thePoint1 Start point of translation vector.
712      *  \param thePoint2 End point of translation vector.
713      *  \return New GEOM_Object, containing the translated object.
714      */
715     GEOM_Object TranslateTwoPointsCopy (in GEOM_Object theObject,
716                                         in GEOM_Object thePoint1,
717                                         in GEOM_Object thePoint2);
718
719     /*!
720      *  \brief Translate the given object along the vector, specified by its components.
721      *  \param theObject The object to be translated.
722      *  \param theDX,theDY,theDZ Components of translation vector.
723      *  \return theObject.
724      */
725     GEOM_Object TranslateDXDYDZ (in GEOM_Object theObject,
726                                  in double theDX, in double theDY, in double theDZ);
727
728     /*!
729      *  \brief Translate the given object along the vector, specified
730      *  by its components, creating its copy before the translation.
731      *  \param theObject The object to be translated.
732      *  \param theDX,theDY,theDZ Components of translation vector.
733      *  \return New GEOM_Object, containing the translated object.
734      */
735     GEOM_Object TranslateDXDYDZCopy (in GEOM_Object theObject,
736                                      in double theDX, in double theDY, in double theDZ);
737
738
739     /*!
740      *  \brief Translate the given object along the given vector.
741      *  \param theObject The object to be translated.
742      *  \param theVector Translation vector, giving both direction and distance.
743      *  \return theObject.
744      */
745     GEOM_Object TranslateVector (in GEOM_Object theObject,
746                                  in GEOM_Object theVector);
747
748     /*!
749      *  \brief Translate the given object along the given vector,
750      *  creating its copy before the translation.
751      *  \param theObject The object to be translated.
752      *  \param theVector Translation vector, giving both direction and distance.
753      *  \return New GEOM_Object, containing the translated object.
754      */
755     GEOM_Object TranslateVectorCopy (in GEOM_Object theObject,
756                                      in GEOM_Object theVector);
757
758     /*!
759      *  \brief Translate the given object along the given vector on given distance,
760      *  creating its copy before the translation.
761      *  \param theObject The object to be translated.
762      *  \param theVector Translation vector, giving a direction.
763      *  \param theDistance Translation distance, giving a distance.
764      *  \param theCope Translation copy, creating its copy if true.
765      *  \return New GEOM_Object, containing the translated object.
766      */
767     GEOM_Object TranslateVectorDistance (in GEOM_Object theObject,
768                                          in GEOM_Object theVector,
769                                          in double      theDistance,
770                                          in boolean     theCopy);
771
772     /*!
773      *  \brief Translate the given object along the given vector a given number times
774      *  \param theObject The object to be translated.
775      *  \param theVector Direction of the translation.
776      *  \param theStep Distance to translate on.
777      *  \param theNbTimes Quantity of translations to be done.
778      *  \return New GEOM_Object, containing compound of all
779      *          the shapes, obtained after each translation.
780      */
781     GEOM_Object MultiTranslate1D (in GEOM_Object theObject,
782                                   in GEOM_Object theVector,
783                                   in double theStep,
784                                   in long theNbTimes);
785
786     /*!
787      *  \brief Conseqently apply two specified translations to theObject specified number of times.
788      *  \param theObject The object to be translated.
789      *  \param theVector1 Direction of the first translation.
790      *  \param theStep1 Step of the first translation.
791      *  \param theNbTimes1 Quantity of translations to be done along theVector1.
792      *  \param theVector2 Direction of the second translation.
793      *  \param theStep2 Step of the second translation.
794      *  \param theNbTimes2 Quantity of translations to be done along theVector2.
795      *  \return New GEOM_Object, containing compound of all
796      *          the shapes, obtained after each translation.
797      */
798     GEOM_Object MultiTranslate2D (in GEOM_Object theObject,
799                                   in GEOM_Object theVector1,
800                                   in double theStep1,
801                                   in long theNbTimes1,
802                                   in GEOM_Object theVector2,
803                                   in double theStep2,
804                                   in long theNbTimes2);
805
806     /*!
807      *  \brief Rotate given object around vector perpendicular to plane containing three points.
808      *  \param theObject The object to be rotated.
809      *  \param theCentPoint central point - the axis is the vector perpendicular to the plane
810      *  containing the three points.
811      *  \param thePoint1 and thePoint2 - in a perpendicular plan of the axis.
812      *  \return theObject.
813      */
814     GEOM_Object RotateThreePoints (in GEOM_Object theObject,
815                                    in GEOM_Object theCentPoint,
816                                    in GEOM_Object thePoint1,
817                                    in GEOM_Object thePoint2);
818
819
820     /*!
821      *  \brief Rotate given object around vector perpendicular to plane containing three points.
822      *
823      *  Creating its copy before the rotatation.
824      *  \param theObject The object to be rotated.
825      *  \param theCentPoint central point - the axis is the vector perpendicular to the plane
826      *  containing the three points.
827      *  \param thePoint1 and thePoint2 - in a perpendicular plan of the axis.
828      *  \return New GEOM_Object, containing the rotated object.
829      */
830     GEOM_Object RotateThreePointsCopy (in GEOM_Object theObject,
831                                        in GEOM_Object theCentPoint,
832                                        in GEOM_Object thePoint1,
833                                        in GEOM_Object thePoint2);
834
835     /*!
836      *  \brief Rotate the given object around the given axis on the given angle.
837      *  \param theObject The object to be rotated.
838      *  \param theAxis Rotation axis.
839      *  \param theAngle Rotation angle in radians.
840      *  \return theObject.
841      */
842     GEOM_Object Rotate (in GEOM_Object theObject,
843                         in GEOM_Object theAxis,
844                         in double theAngle);
845
846
847     /*!
848      *  Rotate the given object around the given axis
849      *  on the given angle, creating its copy before the rotatation.
850      *  \param theObject The object to be rotated.
851      *  \param theAxis Rotation axis.
852      *  \param theAngle Rotation angle in radians.
853      *  \return New GEOM_Object, containing the rotated object.
854      */
855     GEOM_Object RotateCopy (in GEOM_Object theObject,
856                             in GEOM_Object theAxis,
857                             in double theAngle);
858
859
860     /*!
861      *  \brief Rotate the given object around the given axis a given number times.
862      *
863      *  Rotation angle will be 2*PI/theNbTimes.
864      *  \param theObject The object to be rotated.
865      *  \param theAxis The rotation axis.
866      *  \param theNbTimes Quantity of rotations to be done.
867      *  \return New GEOM_Object, containing compound of all the
868      *          shapes, obtained after each rotation.
869      */
870     GEOM_Object MultiRotate1D (in GEOM_Object theObject,
871                                in GEOM_Object theAxis,
872                                in long theNbTimes);
873
874     /*!
875      *  \brief Rotate the given object around the
876      *  given axis on the given angle a given number
877      *  times and multi-translate each rotation result.
878      *
879      *  Translation direction passes through center of gravity
880      *  of rotated shape and its projection on the rotation axis.
881      *  \param theObject The object to be rotated.
882      *  \param theAxis Rotation axis.
883      *  \param theAngle Rotation angle in graduces.
884      *  \param theNbTimes1 Quantity of rotations to be done.
885      *  \param theStep Translation distance.
886      *  \param theNbTimes2 Quantity of translations to be done.
887      *  \return New GEOM_Object, containing compound of all the
888      *          shapes, obtained after each transformation.
889      */
890     GEOM_Object MultiRotate2D (in GEOM_Object theObject,
891                                in GEOM_Object theAxis,
892                                in double theAngle,
893                                in long theNbTimes1,
894                                in double theStep,
895                                in long theNbTimes2);
896
897     /*!
898      *  \brief Replace the given object by an object,
899      *  symmetrical to it relatively the given plane.
900      *  \param theObject The object to be mirrored.
901      *  \param thePlane Plane of symmetry.
902      */
903     GEOM_Object MirrorPlane (in GEOM_Object theObject, in GEOM_Object thePlane);
904
905     /*!
906      *  \brief Create an object, symmetrical
907      *  to the given one relatively the given plane.
908      *  \param theObject The object to be mirrored.
909      *  \param thePlane Plane of symmetry.
910      *  \return New GEOM_Object, containing the mirrored shape.
911      */
912     GEOM_Object MirrorPlaneCopy (in GEOM_Object theObject, in GEOM_Object thePlane);
913
914     /*!
915      *  \brief Replace the given object by an object,
916      *  symmetrical to it relatively the given axis.
917      *  \param theObject The object to be mirrored.
918      *  \param theAxis Axis of symmetry.
919      *  \return theObject.
920      */
921     GEOM_Object MirrorAxis (in GEOM_Object theObject, in GEOM_Object theAxis);
922
923     /*!
924      *  \brief Create an object, symmetrical
925      *  to the given one relatively the given axis.
926      *  \param theObject The object to be mirrored.
927      *  \param theAxis Axis of symmetry.
928      *  \return New GEOM_Object, containing the mirrored object.
929      */
930     GEOM_Object MirrorAxisCopy (in GEOM_Object theObject, in GEOM_Object theAxis);
931
932     /*!
933      *  \brief Replace the given object by an object, symmetrical to it relatively the given point.
934      *  \param theObject The object to be mirrored.
935      *  \param thePoint Point of symmetry.
936      *  \return theObject.
937      */
938     GEOM_Object MirrorPoint (in GEOM_Object theObject, in GEOM_Object thePoint);
939
940     /*!
941      *  \brief Create an object, symmetrical to the given one relatively the given point.
942      *  \param theObject The object to be mirrored.
943      *  \param thePoint Point of symmetry.
944      *  \return New GEOM_Object, containing the mirrored object.
945      */
946     GEOM_Object MirrorPointCopy (in GEOM_Object theObject, in GEOM_Object thePoint);
947
948     /*!
949      *  \brief Replace the given object by its offset.
950      *  \param theObject The base object for the offset.
951      *  \param theOffset Offset value.
952      *  \return theObject.
953      */
954     GEOM_Object OffsetShape (in GEOM_Object theObject, in double theOffset);
955
956     /*!
957      *  \brief Create new object as offset of the given one.
958      *  \param theObject The base object for the offset.
959      *  \param theOffset Offset value.
960      *  \return New GEOM_Object, containing the offset object.
961      */
962     GEOM_Object OffsetShapeCopy (in GEOM_Object theObject, in double theOffset);
963
964     /*!
965      *  \brief Create new object as projection of the given one on a 2D surface.
966      *  \param theSource The source object for the projection. It can be a point, edge or wire.
967      *  \param theTarget The target object. It can be planar or cylindrical face.
968      *  \return New GEOM_Object, containing the projection.
969      */
970     GEOM_Object ProjectShapeCopy (in GEOM_Object theSource, in GEOM_Object theTarget);
971
972     /*!
973      *  \brief Scale the given object by the factor.
974      *  \param theObject The object to be scaled.
975      *  \param thePoint Center point for scaling.
976      *  \param theFactor Scaling factor value.
977      *  \return theObject.
978      */
979     GEOM_Object ScaleShape (in GEOM_Object theObject, in GEOM_Object thePoint,
980                             in double theFactor);
981
982     /*!
983      *  \brief Scale the given object by the factor, creating its copy before the scaling.
984      *  \param theObject The object to be scaled.
985      *  \param thePoint Center point for scaling.
986      *  \param theFactor Scaling factor value.
987      *  \return New GEOM_Object, containing the scaled shape.
988      */
989     GEOM_Object ScaleShapeCopy (in GEOM_Object theObject, in GEOM_Object thePoint,
990                                 in double theFactor);
991
992     /*!
993      *  \brief Scale the given object by different factors along coordinate axes.
994      *  \param theObject The object to be scaled.
995      *  \param thePoint Center point for scaling.
996      *  \param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
997      *  \return theObject.
998      */
999     GEOM_Object ScaleShapeAlongAxes (in GEOM_Object theObject,
1000                                      in GEOM_Object thePoint,
1001                                      in double theFactorX,
1002                                      in double theFactorY,
1003                                      in double theFactorZ);
1004
1005     /*!
1006      *  \brief Scale the given object by different factors along coordinate axes,
1007      *  creating its copy before the scaling.
1008      *  \param theObject The object to be scaled.
1009      *  \param thePoint Center point for scaling.
1010      *  \param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
1011      *  \return New GEOM_Object, containing the scaled shape.
1012      */
1013     GEOM_Object ScaleShapeAlongAxesCopy (in GEOM_Object theObject,
1014                                          in GEOM_Object thePoint,
1015                                          in double theFactorX,
1016                                          in double theFactorY,
1017                                          in double theFactorZ);
1018
1019     /*!
1020      *  \brief Modify the Location of the given object by LCS.
1021      *  \param theObject The object to be displaced.
1022      *  \param theStartLCS Coordinate system to perform displacement from it.
1023      *                     If \a theStartLCS is NULL, displacement
1024      *                     will be performed from global CS.
1025      *                     If \a theObject itself is used as \a theStartLCS,
1026      *                     its location will be changed to \a theEndLCS.
1027      *  \param theEndLCS Coordinate system to perform displacement to it.
1028      *  \return theObject.
1029      */
1030     GEOM_Object PositionShape (in GEOM_Object theObject,
1031                                in GEOM_Object theStartLCS,
1032                                in GEOM_Object theEndLCS);
1033
1034     /*!
1035      *  \brief Modify the Location of the given object by LCS,
1036      *  creating its copy before the setting.
1037      *  \param theObject The object to be displaced.
1038      *  \param theStartLCS Coordinate system to perform displacement from it.
1039      *                     If \a theStartLCS is NULL, displacement
1040      *                     will be performed from global CS.
1041      *                     If \a theObject itself is used as \a theStartLCS,
1042      *                     its location will be changed to \a theEndLCS.
1043      *  \param theEndLCS Coordinate system to perform displacement to it.
1044      *  \return New GEOM_Object, containing the displaced shape.
1045      */
1046     GEOM_Object PositionShapeCopy (in GEOM_Object theObject,
1047                                    in GEOM_Object theStartLCS,
1048                                    in GEOM_Object theEndLCS);
1049
1050     /*!
1051      *  \brief Modify the Location of the given object by Path,
1052      *  \param  theObject The object to be displaced.
1053      *  \param  thePath Wire or Edge along that the object will be translated.
1054      *  \param  theDistance progress of Path (0 = actual location, 1 = end of path location).
1055      *  \param  theCopy is a true or false parameter. true is to create a copy, false to move the object.
1056      *  \param  theCopy is a true or false parameter. true is to reverse direction, false is to move normal direction.
1057      *  \return New GEOM_Object, containing the displaced shape.
1058      */
1059     GEOM_Object PositionAlongPath (in GEOM_Object theObject,
1060                                    in GEOM_Object thePath,
1061                                    in double theDistance,
1062                                    in boolean theCopy,
1063                                    in boolean theReverse);
1064
1065     /*!
1066      *  \brief Transform the shape in the same way what was used for the sample shape creation.
1067      *  \param theObject The object to be transformed.
1068      *  \param theSample The object containing information about required transformation.
1069      *  \note Implementation of this method is limited by multi-transformations now.
1070      *  \note Internal method.
1071      *  \return New GEOM_Object, containing the transformed shape.
1072      */
1073     GEOM_Object TransformLikeOtherCopy (in GEOM_Object theObject,
1074                                         in GEOM_Object theSample);
1075
1076     /*!
1077      *  \brief Recompute the shape from its arguments.
1078      *  \param theObject The object to be recomputed.
1079      *  \return theObject.
1080      */
1081     GEOM_Object RecomputeObject (in GEOM_Object theObject);
1082   };
1083   
1084   # GEOM_I3DPrimOperations:
1085   /*!
1086    *  \brief Interface for 3D primitives creation
1087    *
1088    *  Box, Cylinder, Cone, Sphere, Prism (extrusion),
1089    *  Pipe (extrusion along contour), Revolution, Solid (from shell).
1090    */
1091   interface GEOM_I3DPrimOperations : GEOM_IOperations
1092   {
1093     /*!
1094      *  \brief Create a box with specified dimensions along the coordinate axes
1095      *  and with edges, parallel to the coordinate axes.
1096      *
1097      *  Center of the box will be at point (DX/2, DY/2, DZ/2).
1098      *  \param theDX Length of Box edges, parallel to OX axis.
1099      *  \param theDY Length of Box edges, parallel to OY axis.
1100      *  \param theDZ Length of Box edges, parallel to OZ axis.
1101      *  \return New GEOM_Object, containing the created box.
1102      */
1103     GEOM_Object MakeBoxDXDYDZ (in double theDX, in double theDY, in double theDZ);
1104
1105     /*!
1106      *  \brief Create a box with two specified opposite vertices,
1107      *  and with edges, parallel to the coordinate axes
1108      *  \param thePnt1 First of two opposite vertices.
1109      *  \param thePnt2 Second of two opposite vertices.
1110      *  \return New GEOM_Object, containing the created box.
1111      */
1112     GEOM_Object MakeBoxTwoPnt (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
1113
1114     /*!
1115      *  \brief Create a face specified dimensions along OX-OY coordinate axes,
1116      *  with edges parallel to the coordinate axes.
1117      *
1118      *  Center of the face will be at point (0, 0, 0).
1119      *  \param theH Height of the Face.
1120      *  \param theW Width of the Face.
1121      *  \param theOrientation Orientation belong axis OXY OYZ OZX
1122      *  \return New GEOM_Object, containing the created face.
1123      */
1124     GEOM_Object MakeFaceHW (in double theH, in double theW, in short theOrientation);
1125     /*!
1126      *  \brief Create a face by normale vector or edge and two specified sizes,
1127      *  vertical (H) and horisontal (W).
1128      *  \param theVec defines plane.
1129      *  \param theH vertical size (height).
1130      *  \param theW horisontal size (width).
1131      *  \return New GEOM_Object, containing the created face.
1132      */
1133     GEOM_Object MakeFaceObjHW (in GEOM_Object theObj, in double theH, in double theW);
1134     /*!
1135      *  \brief Create a Disk (circular face) with given center, normal vector and radius.
1136      *  \param thePnt disk center.
1137      *  \param theVec Vector, normal to the plane of the disk.
1138      *  \param theR Disk radius.
1139      *  \return New GEOM_Object, containing the created disk.
1140      */
1141     GEOM_Object MakeDiskPntVecR (in GEOM_Object thePnt,
1142                                  in GEOM_Object theVec,
1143                                  in double theR);
1144     /*!
1145      *  \brief Create a disk (circular face), passing through three given points
1146      *  \param thePnt1, thePnt2, thePnt3 Points, defining the disk.
1147      *  \return New GEOM_Object, containing the created disk.
1148      */
1149     GEOM_Object MakeDiskThreePnt (in GEOM_Object thePnt1,
1150                                   in GEOM_Object thePnt2,
1151                                   in GEOM_Object thePnt3);
1152
1153     /*!
1154      *  \brief Create a disk specified dimensions along OX-OY coordinate axes.
1155      *
1156      *  Center of the disk at point (0, 0, 0).
1157      *  \param theR of the Disk.
1158      *  \param theOrientation Orientation belong axis OXY OYZ OZX
1159      *  \return New GEOM_Object, containing the created disk.
1160      */
1161     GEOM_Object MakeDiskR (in double theR, in short theOrientation);
1162
1163     /*!
1164      *  \brief Create a cylinder with given radius and height at
1165      *  the origin of coordinate system.
1166      *
1167      *  Axis of the cylinder will be collinear to the OZ axis of the coordinate system.
1168      *  \param theR Cylinder radius.
1169      *  \param theH Cylinder height.
1170      *  \return New GEOM_Object, containing the created cylinder.
1171      */
1172     GEOM_Object MakeCylinderRH (in double theR, in double theH);
1173
1174     /*!
1175      *  \brief Create a cylinder with given base point, axis, radius and height.
1176      *  \param thePnt Central point of cylinder base.
1177      *  \param theAxis Cylinder axis.
1178      *  \param theR Cylinder radius.
1179      *  \param theH Cylinder height.
1180      *  \return New GEOM_Object, containing the created cylinder.
1181      */
1182     GEOM_Object MakeCylinderPntVecRH (in GEOM_Object thePnt,
1183                                       in GEOM_Object theAxis,
1184                                       in double      theR,
1185                                       in double      theH);
1186
1187     /*!
1188      *  \brief Create a cone with given height and radiuses at
1189      *  the origin of coordinate system. 
1190      *
1191      *  Axis of the cone will be collinear to the OZ axis of the coordinate system.
1192      *  \param theR1 Radius of the first cone base.
1193      *  \param theR2 Radius of the second cone base.
1194      *    \note If both radiuses are non-zero, the cone will be truncated.
1195      *    \note If the radiuses are equal, a cylinder will be created instead.
1196      *  \param theH Cone height.
1197      *  \return New GEOM_Object, containing the created cone.
1198      */
1199     GEOM_Object MakeConeR1R2H (in double theR1, in double theR2, in double theH);
1200
1201     /*!
1202      *  \brief Create a cone with given base point, axis, height and radiuses.
1203      *  \param thePnt Central point of the first cone base.
1204      *  \param theAxis Cone axis.
1205      *  \param theR1 Radius of the first cone base.
1206      *  \param theR2 Radius of the second cone base.
1207      *    \note If both radiuses are non-zero, the cone will be truncated.
1208      *    \note If the radiuses are equal, a cylinder will be created instead.
1209      *  \param theH Cone height.
1210      *  \return New GEOM_Object, containing the created cone.
1211      */
1212     GEOM_Object MakeConePntVecR1R2H (in GEOM_Object thePnt,
1213                                      in GEOM_Object theAxis,
1214                                      in double      theR1,
1215                                      in double      theR2,
1216                                      in double      theH);
1217
1218     /*!
1219      *  \brief Create a torus with given radiuses at the origin of coordinate system.
1220      *  \param theRMajor Torus major radius.
1221      *  \param theRMinor Torus minor radius.
1222      *  \return New GEOM_Object, containing the created torus.
1223      */
1224     GEOM_Object MakeTorusRR (in double theRMajor,
1225                              in double theRMinor);
1226
1227     /*!
1228      *  \brief Create a torus with given center, normal vector and radiuses.
1229      *  \param thePnt Torus central point.
1230      *  \param theVec Torus axis of symmetry.
1231      *  \param theRMajor Torus major radius.
1232      *  \param theRMinor Torus minor radius.
1233      *  \return New GEOM_Object, containing the created torus.
1234      */
1235     GEOM_Object MakeTorusPntVecRR (in GEOM_Object thePnt,
1236                                    in GEOM_Object theVec,
1237                                    in double theRMajor,
1238                                    in double theRMinor);
1239
1240     /*!
1241      *  \brief Create a sphere with given radius at the origin of coordinate system.
1242      *  \param theR Sphere radius.
1243      *  \return New GEOM_Object, containing the created sphere.
1244      */
1245     GEOM_Object MakeSphereR (in double theR);
1246
1247     /*!
1248      *  \brief Create a sphere with given center and radius.
1249      *  \param thePnt Sphere center.
1250      *  \param theR Sphere radius.
1251      *  \return New GEOM_Object, containing the created .
1252      */
1253     GEOM_Object MakeSpherePntR (in GEOM_Object thePnt, in double theR);
1254
1255     /*!
1256      *  \brief Create a shape by extrusion of the base shape along the vector
1257      *
1258      *  All the space, transfixed by the base shape during its translation
1259      *  along the vector on the given distance.
1260      *  \param theBase Base shape to be extruded.
1261      *  \param theVec Direction of extrusion.
1262      *  \param theH Prism dimension along theVec.
1263      *  \return New GEOM_Object, containing the created prism.
1264      */
1265     GEOM_Object MakePrismVecH (in GEOM_Object theBase,
1266                                in GEOM_Object theVec,
1267                                in double      theH);
1268     /*  \brief The Same Prism but in 2 directions (forward&backward) */
1269     GEOM_Object MakePrismVecH2Ways (in GEOM_Object theBase,
1270                                     in GEOM_Object theVec,
1271                                     in double      theH);
1272     /*  \brief The Same as MakePrismVecH but with scaling */
1273     GEOM_Object MakePrismVecHWithScaling (in GEOM_Object theBase,
1274                                           in GEOM_Object theVec,
1275                                           in double      theH,
1276                                           in double      theScaleFactor);
1277
1278     /*!
1279      *  \brief Create a shape by extrusion of the base shape along a vector, defined by two points.
1280      *  \param theBase Base shape to be extruded.
1281      *  \param thePoint1 First end of extrusion vector.
1282      *  \param thePoint2 Second end of extrusion vector.
1283      *  \return New GEOM_Object, containing the created prism.
1284      */
1285     GEOM_Object MakePrismTwoPnt (in GEOM_Object theBase,
1286                                  in GEOM_Object thePoint1,
1287                                  in GEOM_Object thePoint2);
1288     /*  \brief The same prism but in two directions forward&backward */
1289     GEOM_Object MakePrismTwoPnt2Ways (in GEOM_Object theBase,
1290                                       in GEOM_Object thePoint1,
1291                                       in GEOM_Object thePoint2);
1292     /*  \brief The Same as MakePrismTwoPnt but with scaling */
1293     GEOM_Object MakePrismTwoPntWithScaling (in GEOM_Object theBase,
1294                                             in GEOM_Object thePoint1,
1295                                             in GEOM_Object thePoint2,
1296                                             in double      theScaleFactor);
1297
1298     /*!
1299      *  \brief Create a shape by extrusion of the base shape along a vector, defined by DX DY DZ.
1300      *  \param theBase Base shape to be extruded.
1301      *  \param DX, DY, DZ end of extrusion vector.
1302      *  \return New GEOM_Object, containing the created prism.
1303      */
1304     GEOM_Object MakePrismDXDYDZ (in GEOM_Object theBase,
1305                                    in double theDX, in double theDY, in double theDZ);
1306     /*  \brief The same prism but in two directions forward&backward */
1307     GEOM_Object MakePrismDXDYDZ2Ways (in GEOM_Object theBase,
1308                                       in double theDX, in double theDY, in double theDZ);
1309     /*  \brief The Same as MakePrismDXDYDZ but with scaling */
1310     GEOM_Object MakePrismDXDYDZWithScaling (in GEOM_Object theBase,
1311                                             in double theDX, in double theDY, in double theDZ,
1312                                             in double theScaleFactor);
1313
1314     /*!
1315      *  \brief Create a shape by extrusion of the base shape along
1316      *  the path shape. The path shape can be a wire or an edge.
1317      *  \param theBase Base shape to be extruded.
1318      *  \param thePath Path shape to extrude the base shape along it.
1319      *  \return New GEOM_Object, containing the created pipe.
1320      */
1321     GEOM_Object MakePipe (in GEOM_Object theBase, in GEOM_Object thePath);
1322
1323     /*!
1324      *  \brief Create a shape by revolution of the base shape around the axis
1325      *  on the given angle. 
1326      *
1327      *  All the space, transfixed by the base
1328      *  shape during its rotation around the axis on the given angle.
1329      *  \param theBase Base shape to be rotated.
1330      *  \param theAxis Rotation axis.
1331      *  \param theAngle Rotation angle in radians.
1332      *  \return New GEOM_Object, containing the created revolution.
1333      */
1334     GEOM_Object MakeRevolutionAxisAngle (in GEOM_Object theBase,
1335                                          in GEOM_Object theAxis,
1336                                          in double theAngle);
1337     /*  The Same Revolution but in both ways forward&backward */
1338     GEOM_Object MakeRevolutionAxisAngle2Ways (in GEOM_Object theBase,
1339                                               in GEOM_Object theAxis,
1340                                               in double theAngle);
1341
1342     /*!
1343      *  \brief Create a filling from the given compound of contours.
1344      *  \param theMinDeg a minimal degree of BSpline surface to create
1345      *  \param theMaxDeg a maximal degree of BSpline surface to create
1346      *  \param theTol2D a 2d tolerance to be reached
1347      *  \param theTol3D a 3d tolerance to be reached
1348      *  \param theNbIter a number of iteration of approximation algorithm
1349      *  \param theMethod Kind of method to perform filling operation.
1350      *  \return New GEOM_Object, containing the created filling surface.
1351      */
1352     GEOM_Object MakeFilling (in GEOM_Object theShape,
1353                              in long theMinDeg, in long theMaxDeg,
1354                              in double theTol2D, in double theTol3D,
1355                              in long theNbIter,
1356                              in filling_oper_method theMethod,
1357                              in boolean theApprox);
1358
1359     /*!
1360      *  \brief Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1361      *  \param theSeqSections - set of specified sections.
1362      *  \param theModeSolid - mode defining building solid or shell
1363      *  \param thePreci - precision 3D used for smoothing by default 1.e-6
1364      *  \param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1365      *  \return New GEOM_Object, containing the created shell or solid.
1366      */
1367     GEOM_Object MakeThruSections(in ListOfGO theSeqSections,
1368                                  in boolean theModeSolid,
1369                                  in double thePreci,
1370                                  in boolean theRuled);
1371
1372      /*!
1373      *  \brief Create a shape by extrusion of the profile shape along
1374      *  the path shape. 
1375      *
1376      *  The path shape can be a wire or an edge.
1377      *  the several profiles can be specified in the several locations of path.
1378      *  \param theSeqBases - list of  Bases shape to be extruded.
1379      *  \param theLocations - list of locations on the path corresponding
1380      *                        specified list of the Bases shapes. Number of locations
1381      *                        should be equal to number of bases or list of locations can be empty.
1382      *  \param thePath - Path shape to extrude the base shape along it.
1383      *  \param theWithContact - the mode defining that the section is translated to be in
1384      *                          contact with the spine.
1385      *  \param - WithCorrection - defining that the section is rotated to be
1386      *                                 orthogonal to the spine tangent in the correspondent point
1387      *  \return New GEOM_Object, containing the created pipe.
1388      */
1389     GEOM_Object MakePipeWithDifferentSections (in ListOfGO theSeqBases,
1390                                                in ListOfGO theLocations,
1391                                                in GEOM_Object thePath,
1392                                                in boolean theWithContact ,
1393                                                in boolean theWithCorrection );
1394
1395     /*!
1396      *  \brief Create a shape by extrusion of the profile shape along
1397      *  the path shape. 
1398      *
1399      *  The path shape can be a shell or a face.
1400      *  the several profiles can be specified in the several locations of path.
1401      *  \param theSeqBases - list of  Bases shape to be extruded.
1402      *  \param theSeqSubBases - list of corresponding sub-shapes of section shapes.
1403      *  \param theLocations - list of locations on the path corresponding
1404      *                        specified list of the Bases shapes. Number of locations
1405      *                        should be equal to number of bases.
1406      *  \param thePath - Path shape to extrude the base shape along it.
1407      *  \param theWithContact - the mode defining that the section is translated to be in
1408      *                          contact with the spine.
1409      *  \param - WithCorrection - defining that the section is rotated to be
1410      *                                 orthogonal to the spine tangent in the correspondent point
1411      *  \return New GEOM_Object, containing the created pipe.
1412      */
1413     GEOM_Object MakePipeWithShellSections (in ListOfGO theSeqBases,
1414                                            in ListOfGO theSeqSubBases,
1415                                            in ListOfGO theLocations,
1416                                            in GEOM_Object thePath,
1417                                            in boolean theWithContact ,
1418                                            in boolean theWithCorrection );
1419
1420     /*!
1421      *  \brief Create solids between given sections
1422      *  \param theSeqBases - list of sections (shell or face).
1423      *  \param theLocations - list of corresponding vertexes
1424      *  \return New GEOM_Object, containing the created solids.
1425      */
1426     GEOM_Object MakePipeShellsWithoutPath (in ListOfGO theSeqBases,
1427                                            in ListOfGO theLocations);
1428
1429     /*!
1430      *  \brief Create a shape by extrusion of the base shape along
1431      *  the path shape with constant bi-normal direction along the given vector.
1432      *
1433      *  The path shape can be a wire or an edge.
1434      *  \param theBase Base shape to be extruded.
1435      *  \param thePath Path shape to extrude the base shape along it.
1436      *  \param theVec Vector defines a constant binormal direction to keep the
1437      *                same angle beetween the Direction and the sections
1438      *                along the sweep surface.
1439      *  \return New GEOM_Object, containing the created pipe.
1440      */
1441     GEOM_Object MakePipeBiNormalAlongVector (in GEOM_Object theBase,
1442                                              in GEOM_Object thePath,
1443                                              in GEOM_Object theVec);
1444
1445   };
1446
1447   # GEOM_IShapesOperations
1448   /*!
1449    *  \brief Interface for Shapes creation:
1450    *
1451    *  Edge from two points, Wire from edges, Face from wire,
1452    *  Shell from faces, Solid from shells, Compound from shapes
1453    */
1454   interface GEOM_IShapesOperations : GEOM_IOperations
1455   {
1456     /*!
1457      *  \brief Create a linear edge with specified ends.
1458      *  \param thePnt1 Point for the first end of edge.
1459      *  \param thePnt2 Point for the second end of edge.
1460      *  \return New GEOM_Object, containing the created edge.
1461      */
1462     GEOM_Object MakeEdge (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
1463
1464     /*!
1465      *  \brief Create an edge on another edge, corresponding to the given length on the given edge.
1466      *  \param theRefCurve The referenced edge.
1467      *  \param theLength Length on the referenced edge. It can be
1468      *                   negative for extrapolation on base curve.
1469      *  \param theStartPoint Any vertex close to one of edge's
1470      *                       ends to select start point among them.
1471      *                       If NULL, fist vertex is used.
1472      *  \return New GEOM_Object, containing the created edge.
1473      */
1474     GEOM_Object MakeEdgeOnCurveByLength (in GEOM_Object theRefCurve,
1475                                          in double      theLength,
1476                                          in GEOM_Object theStartPoint);
1477
1478     /*!
1479      *  \brief Create an edge from specified wire.
1480      *  \param theWire source Wire.
1481      *  \param theLinearTolerance linear tolerance value
1482      *  \param theAngularTolerance angular tolerance value
1483      *  \return New GEOM_Object, containing the created edge.
1484      */
1485     GEOM_Object MakeEdgeWire (in GEOM_Object theWire,
1486                               in double theLinearTolerance,
1487                               in double theAngularTolerance);
1488
1489     /*!
1490      *  \brief Create a wire from the set of edges and wires.
1491      *  \param theEdgesAndWires List of edge and/or wires.
1492      *  \param theTolerance Maximum distance between vertices, that will be merged.
1493      *                      Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1494      *  \return New GEOM_Object, containing the created wire.
1495      */
1496     GEOM_Object MakeWire (in ListOfGO theEdgesAndWires,
1497                           in double   theTolerance);
1498
1499     /*!
1500      *  \brief Create a face on the given wire.
1501      *  \param theWire closed Wire or Edge to build the face on.
1502      *  \param isPlanarWanted If TRUE, only planar face will be built.
1503      *                        If impossible, NULL object will be returned.
1504      *  \return New GEOM_Object, containing the created face.
1505      */
1506     GEOM_Object MakeFace (in GEOM_Object theWire, in boolean isPlanarWanted);
1507
1508     /*!
1509      *  \brief Create a face on the given wires set.
1510      *  \param theWires List of closed wires or edges to build the face on.
1511      *  \param isPlanarWanted If TRUE, only planar face will be built.
1512      *                        If impossible, NULL object will be returned.
1513      *  \return New GEOM_Object, containing the created face.
1514      */
1515     GEOM_Object MakeFaceWires (in ListOfGO theWires, in boolean isPlanarWanted);
1516
1517     /*!
1518      *  \brief Create a shell from the set of faces and shells.
1519      *  \param theFacesAndShells List of faces and/or shells.
1520      *  \return New GEOM_Object, containing the created shell.
1521      */
1522     GEOM_Object MakeShell (in ListOfGO theFacesAndShells);
1523
1524     /*!
1525      *  \brief Create a solid, bounded by the given shell.
1526      *  \param theShell Bounding shell.
1527      *  \return New GEOM_Object, containing the created solid.
1528      */
1529     GEOM_Object MakeSolidShell (in GEOM_Object theShell);
1530
1531     /*!
1532      *  \brief Create a solid, bounded by the given shells.
1533      *  \param theShells Bounding shells.
1534      *  \return New GEOM_Object, containing the created solid.
1535      */
1536     GEOM_Object MakeSolidShells (in ListOfGO theShells);
1537
1538     /*!
1539      *  \brief Create a compound of the given shapes.
1540      *  \param theShapes List of shapes to put in compound.
1541      *  \return New GEOM_Object, containing the created compound.
1542      */
1543     GEOM_Object MakeCompound (in ListOfGO theShapes);
1544
1545     /*!
1546      *  \brief Replace coincident faces in theShape by one face.
1547      *  \param theShape Initial shape.
1548      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
1549      *  \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
1550      *  \return New GEOM_Object, containing a copy of theShape without coincident faces.
1551      */
1552     GEOM_Object MakeGlueFaces (in GEOM_Object theShape, in double theTolerance, in boolean doKeepNonSolids);
1553
1554     /*!
1555      *  Find coincident faces in theShape for possible gluing.
1556      *  \param theShape Initial shape.
1557      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
1558      *  \return ListOfGO
1559      */
1560     ListOfGO GetGlueFaces (in GEOM_Object theShape, in double theTolerance);
1561
1562     /*!
1563      *  \brief Replace coincident faces in theShape by one face
1564      *  in compliance with given list of faces
1565      *  \param theShape Initial shape.
1566      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
1567      *  \param theFaces List of faces for gluing.
1568      *  \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
1569      *  \param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
1570      *                        will be glued, otherwise only the edges,
1571      *                        belonging to <VAR>theFaces</VAR>.
1572      *  \return New GEOM_Object, containing a copy of theShape without some faces.
1573      */
1574     GEOM_Object MakeGlueFacesByList (in GEOM_Object theShape, in double theTolerance,
1575                                      in ListOfGO theFaces, in boolean doKeepNonSolids,
1576                                      in boolean doGlueAllEdges);
1577
1578     /*!
1579      *  \brief Replace coincident edges in theShape by one edge.
1580      *  \param theShape Initial shape.
1581      *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
1582      *  \return New GEOM_Object, containing a copy of theShape without coincident edges.
1583      */
1584     GEOM_Object MakeGlueEdges (in GEOM_Object theShape, in double theTolerance);
1585
1586     /*!
1587      *  Find coincident edges in theShape for possible gluing.
1588      *  \param theShape Initial shape.
1589      *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
1590      *  \return ListOfGO
1591      */
1592     ListOfGO GetGlueEdges (in GEOM_Object theShape, in double theTolerance);
1593
1594     /*!
1595      *  \brief Replace coincident edges in theShape by one edge
1596      *  in compliance with given list of edges
1597      *  \param theShape Initial shape.
1598      *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
1599      *  \param theFaces List of edges for gluing.
1600      *  \return New GEOM_Object, containing a copy of theShape without some edges.
1601      */
1602     GEOM_Object MakeGlueEdgesByList (in GEOM_Object theShape,
1603                                      in double theTolerance,
1604                                      in ListOfGO theEdges);
1605
1606     /*!
1607      *  \brief Get all sub-shapes and groups of \a theShape,
1608      *  that were created already by any other methods.
1609      *  \param theShape Any shape.
1610      *  \param theGroupsOnly If this parameter is TRUE, only groups will be
1611      *                       returned, else all found sub-shapes and groups.
1612      *  \return List of existing sub-objects of \a theShape.
1613      */
1614     ListOfGO GetExistingSubObjects (in GEOM_Object theShape,
1615                                     in boolean     theGroupsOnly);
1616
1617     /*!
1618      *  \brief Deprecated method. 
1619      *
1620      *  Use MakeAllSubShapes() instead.
1621      */
1622     ListOfGO MakeExplode (in GEOM_Object theShape,
1623                           in long        theShapeType,
1624                           in boolean     isSorted);
1625
1626     /*!
1627      *  \brief Explode a shape on sub-shapes of a given type. 
1628      *
1629      *  If the shape itself has the given type, it is also returned.
1630      *  \param theShape Shape to be exploded.
1631      *  \param theShapeType Type of sub-shapes to be retrieved.
1632      *  \param isSorted If this parameter is TRUE, sub-shapes will be
1633      *                  sorted by coordinates of their gravity centers.
1634      *  \return List of sub-shapes of type theShapeType, contained in theShape.
1635      */
1636     ListOfGO MakeAllSubShapes (in GEOM_Object theShape,
1637                                in long        theShapeType,
1638                                in boolean     isSorted);
1639
1640     /*!
1641      *  \brief Extract all sub-shapes of the given type from
1642      *  the given shape, excluding the shape itself.
1643      *  \param theShape Shape to be exploded.
1644      *  \param theShapeType Type of sub-shapes to be retrieved.
1645      *  \param isSorted If this parameter is TRUE, sub-shapes will be
1646      *                  sorted by coordinates of their gravity centers.
1647      *  \return List of sub-shapes of type theShapeType, contained in theShape.
1648      */
1649     ListOfGO ExtractSubShapes (in GEOM_Object theShape,
1650                                in long        theShapeType,
1651                                in boolean     isSorted);
1652
1653     /*!
1654      *  \brief Deprecated method. Use GetAllSubShapesIDs() instead.
1655      */
1656     ListOfLong SubShapeAllIDs (in GEOM_Object theShape,
1657                                in long        theShapeType,
1658                                in boolean     isSorted);
1659
1660     /*!
1661      *  \brief Explode a shape on sub-shapes of a given type.
1662      *
1663      *  Does the same, as MakeAllSubShapes, but returns IDs of
1664      *  sub-shapes, not GEOM_Object. It works faster.
1665      *  \param theShape Shape to be exploded.
1666      *  \param theShapeType Type of sub-shapes to be retrieved.
1667      *  \param isSorted If this parameter is TRUE, sub-shapes will be
1668      *                  sorted by coordinates of their gravity centers.
1669      *  \return List of IDs of sub-shapes of type theShapeType, contained in theShape.
1670      */
1671     ListOfLong GetAllSubShapesIDs (in GEOM_Object theShape,
1672                                    in long        theShapeType,
1673                                    in boolean     isSorted);
1674
1675     /*!
1676      *  \brief Get a sub-shape defined by its unique ID inside \a theMainShape
1677      *  \param theMainShape Main shape.
1678      *  \param theID Unique ID of sub-shape inside \a theMainShape.
1679      *  \return GEOM_Object, corresponding to found sub-shape.
1680      *  \note The sub-shape GEOM_Object can has ONLY ONE function.
1681      *        Don't try to apply modification operations (without copy) on them.
1682      */
1683     GEOM_Object GetSubShape (in GEOM_Object theMainShape,
1684                              in long        theID);
1685
1686     /*!
1687      *  \brief Get a set of sub-shapes defined by their unique IDs inside \a theMainShape
1688      *  \param theMainShape Main shape.
1689      *  \param theIndices List of unique IDs of sub-shapes inside \a theMainShape.
1690      *  \return List of GEOM_Object, corresponding to found sub-shapes.
1691      *  \note The sub-shape GEOM_Object can has ONLY ONE function.
1692      *        Don't try to apply modification operations (without copy) on them.
1693      */
1694     ListOfGO MakeSubShapes (in GEOM_Object theMainShape,
1695                             in ListOfLong  theIndices);
1696
1697     /*!
1698      *  Get global index of \a theSubShape in \a theMainShape.
1699      *  \param theMainShape Main shape.
1700      *  \param theSubShape Sub-shape of the main shape.
1701      *  \return global index of \a theSubShape in \a theMainShape.
1702      */
1703     long GetSubShapeIndex (in GEOM_Object theMainShape, in GEOM_Object theSubShape);
1704
1705     /*!
1706      *  \brief Get index of \a theSubShape in \a theMainShape, unique among sub-shapes of the same type.
1707      *
1708      *  Together with method <VAR>GetShapeTypeString()</VAR> it can be used
1709      *  to generate automatic names for sub-shapes, when publishing them in a study.
1710      *  \param theMainShape Main shape.
1711      *  \param theSubShape Sub-shape of the main shape.
1712      *  \return index of \a theSubShape in a list of all sub-shapes of \a theMainShape of the same type.
1713      */
1714     long GetTopologyIndex (in GEOM_Object theMainShape, in GEOM_Object theSubShape);
1715
1716     /*!
1717      *  \brief Get name of type of \a theShape.
1718      *
1719      *  Use wide type notation, taking into consideration both topology and geometry of the shape.
1720      *  Together with method <VAR>GetTopologyIndex()</VAR> it can be used
1721      *  to generate automatic names for sub-shapes, when publishing them in a study.
1722      *  \param theShape The shape to get a type of.
1723      *  \return String, containing a type name of \a theShape.
1724      */
1725     string GetShapeTypeString (in GEOM_Object theShape);
1726
1727     /*!
1728      *  \brief Count number of faces in the given shape.
1729      *  \param theShape Shape to count faces in.
1730      *  \return Number of faces in the given shape.
1731      */
1732     long NumberOfFaces (in GEOM_Object theShape);
1733
1734     /*!
1735      *  \brief Count number of edges in the given shape.
1736      *  \param theShape Shape to count edges in.
1737      *  \return Number of edges in theShape.
1738      */
1739     long NumberOfEdges (in GEOM_Object theShape);
1740
1741     /*!
1742      *  \brief Count number of sub-shapes of type \a theShapeType in the given shape.
1743      *  \param theShape Shape to count sub-shapes in.
1744      *  \param theShapeType The type of sub-shapes to count.
1745      *  \return Number of sub-shapes of type \a theShapeType in \a theShape.
1746      */
1747     long NumberOfSubShapes (in GEOM_Object theShape,
1748                             in long        theShapeType);
1749
1750     /*!
1751      *  Reverses an orientation the given shape.
1752      *  \param theShape Shape to be reversed.
1753      *  \return The reversed copy of theShape.
1754      */
1755     GEOM_Object ChangeOrientation (in GEOM_Object theShape);
1756
1757     /*!
1758      *  \brief Retrieve all free faces from the given shape.
1759      *
1760      *  Free face is a face, which is not shared between two shells of the shape.
1761      *  \param theShape Shape to find free faces in.
1762      *  \return List of IDs of all free faces, contained in theShape.
1763      */
1764     ListOfLong GetFreeFacesIDs (in GEOM_Object theShape);
1765
1766     /*!
1767      *  \brief Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1768      *  \param theShape1 Shape to find sub-shapes in.
1769      *  \param theShape2 Shape to find shared sub-shapes with.
1770      *  \param theShapeType Type of sub-shapes to be retrieved.
1771      *  \return List of sub-shapes of theShape1, shared with theShape2.
1772      */
1773     ListOfGO GetSharedShapes (in GEOM_Object theShape1,
1774                               in GEOM_Object theShape2,
1775                               in long        theShapeType);
1776
1777     /*!
1778      *  \brief Get all sub-shapes, shared by all shapes in the list \a theShapes.
1779      *  \param theShapes Shapes to find common sub-shapes of.
1780      *  \param theShapeType Type of sub-shapes to be retrieved.
1781      *  \return List of objects, that are sub-shapes of all given shapes.
1782      */
1783     ListOfGO GetSharedShapesMulti (in ListOfGO theShapes,
1784                                    in long     theShapeType);
1785
1786     /*!
1787      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1788      *  the specified plane by the certain way, defined through \a theState parameter.
1789      *  \param theShape Shape to find sub-shapes of.
1790      *  \param theShapeType Type of sub-shapes to be retrieved.
1791      *  \param theAx1 Vector (or line, or linear edge), specifying normal
1792      *                direction and location of the plane to find shapes on.
1793      *  \param theState The state of the sub-shapes to find.
1794      *  \return List of all found sub-shapes.
1795      */
1796     ListOfGO GetShapesOnPlane (in GEOM_Object theShape,
1797                                in long        theShapeType,
1798                                in GEOM_Object theAx1,
1799                                in shape_state theState);
1800     /*!
1801      *  \briefFind in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1802      *  the specified plane by the certain way, defined through \a theState parameter.
1803      *  \param theShape Shape to find sub-shapes of.
1804      *  \param theShapeType Type of sub-shapes to be retrieved.
1805      *  \param theAx1 Vector (or line, or linear edge), specifying normal
1806      *                direction of the plane to find shapes on.
1807      *  \param thePnt Point specifying location of the plane to find shapes on.
1808      *  \param theState The state of the sub-shapes to find.
1809      *  \return List of all found sub-shapes.
1810      */
1811     ListOfGO GetShapesOnPlaneWithLocation (in GEOM_Object theShape,
1812                                            in long        theShapeType,
1813                                            in GEOM_Object theAx1,
1814                                            in GEOM_Object thePnt,
1815                                            in shape_state theState);
1816
1817
1818
1819     /*!
1820      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1821      *  the specified cylinder by the certain way, defined through \a theState parameter.
1822      *  \param theShape Shape to find sub-shapes of.
1823      *  \param theShapeType Type of sub-shapes to be retrieved.
1824      *  \param theAxis Vector (or line, or linear edge), specifying
1825      *                 axis of the cylinder to find shapes on.
1826      *  \param theRadius Radius of the cylinder to find shapes on.
1827      *  \param theState The state of the sub-shapes to find.
1828      *  \return List of all found sub-shapes.
1829      */
1830     ListOfGO GetShapesOnCylinder (in GEOM_Object theShape,
1831                                   in long        theShapeType,
1832                                   in GEOM_Object theAxis,
1833                                   in double      theRadius,
1834                                   in shape_state theState);
1835
1836     /*!
1837      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1838      *  the specified cylinder by the certain way, defined through \a theState parameter.
1839      *  \param theShape Shape to find sub-shapes of.
1840      *  \param theShapeType Type of sub-shapes to be retrieved.
1841      *  \param theAxis Vector (or line, or linear edge), specifying
1842      *                 axis of the cylinder to find shapes on.
1843      *  \param thePnt Point specifying location of the bottom of the cylinder.
1844      *  \param theRadius Radius of the cylinder to find shapes on.
1845      *  \param theState The state of the sub-shapes to find.
1846      *  \return List of all found sub-shapes.
1847      */
1848     ListOfGO GetShapesOnCylinderWithLocation (in GEOM_Object theShape,
1849                                               in long        theShapeType,
1850                                               in GEOM_Object theAxis,
1851                                               in GEOM_Object thePnt,
1852                                               in double      theRadius,
1853                                               in shape_state theState);
1854
1855     /*!
1856      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1857      *  the specified sphere by the certain way, defined through \a theState parameter.
1858      *  \param theShape Shape to find sub-shapes of.
1859      *  \param theShapeType Type of sub-shapes to be retrieved.
1860      *  \param theCenter Point, specifying center of the sphere to find shapes on.
1861      *  \param theRadius Radius of the sphere to find shapes on.
1862      *  \param theState The state of the sub-shapes to find.
1863      *  \return List of all found sub-shapes.
1864      */
1865     ListOfGO GetShapesOnSphere (in GEOM_Object theShape,
1866                                 in long        theShapeType,
1867                                 in GEOM_Object theCenter,
1868                                 in double      theRadius,
1869                                 in shape_state theState);
1870
1871     /*!
1872      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1873      *  the specified quadrangle by the certain way, defined through \a theState parameter.
1874      *  \param theShape Shape to find sub-shapes of.
1875      *  \param theShapeType Type of sub-shapes to be retrieved.
1876      *  \param theTopLeftPoint Top left quadrangle corner
1877      *  \param theTopRigthPoint Top right quadrangle corner
1878      *  \param theBottomLeftPoint Bottom left quadrangle corner
1879      *  \param theBottomRigthPoint Bottom right quadrangle corner
1880      *  \param theState The state of the sub-shapes to find.
1881      *  \return List of all found sub-shapes.
1882      */
1883     ListOfGO GetShapesOnQuadrangle (in GEOM_Object theShape,
1884                                     in long        theShapeType,
1885                                     in GEOM_Object theTopLeftPoint,
1886                                     in GEOM_Object theTopRigthPoint,
1887                                     in GEOM_Object theBottomLeftPoint,
1888                                     in GEOM_Object theBottomRigthPoint,
1889                                     in shape_state theState);
1890
1891     /*!
1892      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1893      *  the specified plane by the certain way, defined through \a theState parameter.
1894      *  \param theShape Shape to find sub-shapes of.
1895      *  \param theShapeType Type of sub-shapes to be retrieved.
1896      *  \param theAx1 Vector (or line, or linear edge), specifying normal
1897      *                direction and location of the plane to find shapes on.
1898      *  \param theState The state of the sub-shapes to find.
1899      *  \return List of IDs of all found sub-shapes.
1900      */
1901     ListOfLong GetShapesOnPlaneIDs (in GEOM_Object theShape,
1902                                     in long        theShapeType,
1903                                     in GEOM_Object theAx1,
1904                                     in shape_state theState);
1905
1906     /*!
1907      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1908      *  the specified plane by the certain way, defined through \a theState parameter.
1909      *  \param theShape Shape to find sub-shapes of.
1910      *  \param theShapeType Type of sub-shapes to be retrieved.
1911      *  \param theAx1 Vector (or line, or linear edge), specifying normal
1912      *                direction of the plane to find shapes on.
1913      *  \param thePnt Point specifying location of the plane to find shapes on.
1914      *  \param theState The state of the sub-shapes to find.
1915      *  \return List of IDs of all found sub-shapes.
1916      */
1917     ListOfLong GetShapesOnPlaneWithLocationIDs (in GEOM_Object theShape,
1918                                                 in long        theShapeType,
1919                                                 in GEOM_Object theAx1,
1920                                                 in GEOM_Object thePnt,
1921                                                 in shape_state theState);
1922
1923     /*!
1924      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1925      *  the specified cylinder by the certain way, defined through \a theState parameter.
1926      *  \param theShape Shape to find sub-shapes of.
1927      *  \param theShapeType Type of sub-shapes to be retrieved.
1928      *  \param theAxis Vector (or line, or linear edge), specifying
1929      *                 axis of the cylinder to find shapes on.
1930      *  \param theRadius Radius of the cylinder to find shapes on.
1931      *  \param theState The state of the sub-shapes to find.
1932      *  \return List of IDs of all found sub-shapes.
1933      */
1934     ListOfLong GetShapesOnCylinderIDs (in GEOM_Object theShape,
1935                                        in long        theShapeType,
1936                                        in GEOM_Object theAxis,
1937                                        in double      theRadius,
1938                                        in shape_state theState);
1939
1940     /*!
1941      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1942      *  the specified cylinder by the certain way, defined through \a theState parameter.
1943      *  \param theShape Shape to find sub-shapes of.
1944      *  \param theShapeType Type of sub-shapes to be retrieved.
1945      *  \param theAxis Vector (or line, or linear edge), specifying
1946      *                 axis of the cylinder to find shapes on.
1947      *  \param thePnt Point specifying location of the bottom of the cylinder.
1948      *  \param theRadius Radius of the cylinder to find shapes on.
1949      *  \param theState The state of the sub-shapes to find.
1950      *  \return List of IDs all found sub-shapes.
1951      */
1952     ListOfLong GetShapesOnCylinderWithLocationIDs (in GEOM_Object theShape,
1953                                                    in long        theShapeType,
1954                                                    in GEOM_Object theAxis,
1955                                                    in GEOM_Object thePnt,
1956                                                    in double      theRadius,
1957                                                    in shape_state theState);
1958
1959     /*!
1960      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1961      *  the specified sphere by the certain way, defined through \a theState parameter.
1962      *  \param theShape Shape to find sub-shapes of.
1963      *  \param theShapeType Type of sub-shapes to be retrieved.
1964      *  \param theCenter Point, specifying center of the sphere to find shapes on.
1965      *  \param theRadius Radius of the sphere to find shapes on.
1966      *  \param theState The state of the sub-shapes to find.
1967      *  \return List of IDs of all found sub-shapes.
1968      */
1969     ListOfLong GetShapesOnSphereIDs (in GEOM_Object theShape,
1970                                      in long        theShapeType,
1971                                      in GEOM_Object theCenter,
1972                                      in double      theRadius,
1973                                      in shape_state theState);
1974
1975     /*!
1976      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1977      *  the specified quadrangle by the certain way, defined through \a theState parameter.
1978      *  \param theShape Shape to find sub-shapes of.
1979      *  \param theShapeType Type of sub-shapes to be retrieved.
1980      *  \param theTopLeftPoint Top left quadrangle corner
1981      *  \param theTopRigthPoint Top right quadrangle corner
1982      *  \param theBottomLeftPoint Bottom left quadrangle corner
1983      *  \param theBottomRigthPoint Bottom right quadrangle corner
1984      *  \param theState The state of the sub-shapes to find.
1985      *  \return List of IDs of all found sub-shapes.
1986      */
1987     ListOfLong GetShapesOnQuadrangleIDs (in GEOM_Object theShape,
1988                                          in long        theShapeType,
1989                                          in GEOM_Object theTopLeftPoint,
1990                                          in GEOM_Object theTopRigthPoint,
1991                                          in GEOM_Object theBottomLeftPoint,
1992                                          in GEOM_Object theBottomRigthPoint,
1993                                          in shape_state theState);
1994
1995     /*!
1996      * \brief Find sub-shapes complying with given status
1997      * \param theBox - the box to check state of sub-shapes against
1998      * \param theShape - the shape to explore
1999      * \param theShapeType - type of sub-shape of theShape
2000      * \param theState - required state
2001      * \return List of IDs of all found sub-shapes.
2002      */
2003     ListOfLong GetShapesOnBoxIDs (in GEOM_Object theBox,
2004                                   in GEOM_Object theShape,
2005                                   in long        theShapeType,
2006                                   in shape_state theState);
2007
2008     /*!
2009      * \brief Find sub-shapes complying with given status
2010      * \param theBox - the box to check state of sub-shapes against
2011      * \param theShape - the shape to explore
2012      * \param theShapeType - type of sub-shape of theShape
2013      * \param theState - required state
2014      * \return List of all found sub-shapes.
2015      */
2016     ListOfGO GetShapesOnBox (in GEOM_Object theBox,
2017                              in GEOM_Object theShape,
2018                              in long        theShapeType,
2019                              in shape_state theState);
2020
2021     /*!
2022      * \brief Find sub-shapes complying with given status
2023      * \param theCheckShape - the shape to check state of sub-shapes against. It must be a solid.
2024      * \param theShape - the shape to explore
2025      * \param theShapeType - type of sub-shape of theShape
2026      * \param theState - required state
2027      * \return List of IDs of all found sub-shapes.
2028      */
2029     ListOfLong GetShapesOnShapeIDs (in GEOM_Object theCheckShape,
2030                                     in GEOM_Object theShape,
2031                                     in short       theShapeType,
2032                                     in shape_state theState);
2033
2034     /*!
2035      * \brief Find sub-shapes complying with given status
2036      * \param theCheckShape - the shape to check state of sub-shapes against. It must be a solid.
2037      * \param theShape - the shape to explore
2038      * \param theShapeType - type of sub-shape of theShape
2039      * \param theState - required state
2040      * \return List of all found sub-shapes.
2041      */
2042     ListOfGO GetShapesOnShape (in GEOM_Object theCheckShape,
2043                                in GEOM_Object theShape,
2044                                in short       theShapeType,
2045                                in shape_state theState);
2046
2047     /*!
2048      * \brief Find sub-shapes complying with given status
2049      * \param theCheckShape - the shape to check state of sub-shapes against. It must be a solid.
2050      * \param theShape - the shape to explore
2051      * \param theShapeType - type of sub-shape of theShape
2052      * \param theState - required state
2053      * \return compound includes all found sub-shapes.
2054      */
2055     GEOM_Object GetShapesOnShapeAsCompound (in GEOM_Object theCheckShape,
2056                                             in GEOM_Object theShape,
2057                                             in short       theShapeType,
2058                                             in shape_state theState);
2059
2060     /*!
2061      *  \brief Get sub-shape(s) of \a theShapeWhere, which are
2062      *  coincident with \a theShapeWhat or could be a part of it.
2063      *  \param theShapeWhere Shape to find sub-shapes of.
2064      *  \param theShapeWhat Shape, specifying what to find.
2065      *  \return Group of all found sub-shapes or a single found sub-shape.
2066      */
2067     GEOM_Object GetInPlace (in GEOM_Object theShapeWhere,
2068                             in GEOM_Object theShapeWhat);
2069
2070     /*!
2071      *  Old implementation of GetInPlace functionality, based on shape properties.
2072      */
2073     GEOM_Object GetInPlaceOld (in GEOM_Object theShapeWhere,
2074                                in GEOM_Object theShapeWhat);
2075
2076     /*!
2077      *  \brief Get sub-shape(s) of \a theShapeWhere, which are
2078      *  coincident with \a theShapeWhat or could be a part of it.
2079      *
2080      *  Implementation of this method is based on a saved history of an operation,
2081      *  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
2082      *  arguments (an argument shape or a sub-shape of an argument shape).
2083      *  The operation could be the Partition or one of boolean operations,
2084      *  performed on simple shapes (not on compounds).
2085      *
2086      *  \param theShapeWhere Shape to find sub-shapes of.
2087      *  \param theShapeWhat Shape, specifying what to find.
2088      *  \return Group of all found sub-shapes or a single found sub-shape.
2089      */
2090     GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere,
2091                                      in GEOM_Object theShapeWhat);
2092
2093     /*!
2094      *  \brief Get sub-shape of theShapeWhere, which are
2095      *  coincident with \a theShapeWhat that can either SOLID, FACE, EDGE or VERTEX.
2096      *  \param theShapeWhere Shape to find sub-shapes of.
2097      *  \param theShapeWhat Shape, specifying what to find.
2098      *  \return found sub-shape.
2099      */
2100     GEOM_Object GetSame (in GEOM_Object theShapeWhere,
2101                                 in GEOM_Object theShapeWhat);
2102   };
2103
2104   # GEOM_IBlocksOperations: 
2105   /*!
2106    *  \brief Interface for Blocks construction
2107    *  Face from points or edges, Block from faces,
2108    *  Blocks multi-translation and multi-rotation
2109    */
2110   interface GEOM_IBlocksOperations : GEOM_IOperations
2111   {
2112    
2113     # Creation of blocks
2114
2115     /*!
2116      *  \brief Create a quadrangle face from four edges. Order of Edges is not
2117      *  important. It is  not necessary that edges share the same vertex.
2118      *  \param theEdge1,theEdge2,theEdge3,theEdge4 Edges for the face bound.
2119      *  \return New GEOM_Object, containing the created face.
2120      */
2121     GEOM_Object MakeQuad (in GEOM_Object theEdge1,
2122                           in GEOM_Object theEdge2,
2123                           in GEOM_Object theEdge3,
2124                           in GEOM_Object theEdge4);
2125
2126     /*!
2127      *  \brief Create a quadrangle face on two edges.
2128      *
2129      *  The missing edges will be built by creating the shortest ones.
2130      *  \param theEdge1,theEdge2 Two opposite edges for the face.
2131      *  \return New GEOM_Object, containing the created face.
2132      */
2133     GEOM_Object MakeQuad2Edges (in GEOM_Object theEdge1,
2134                                 in GEOM_Object theEdge2);
2135
2136     /*!
2137      *  \brief Create a quadrangle face with specified corners.
2138      *
2139      *  The missing edges will be built by creating the shortest ones.
2140      *  \param thePnt1,thePnt2,thePnt3,thePnt4 Corner vertices for the face.
2141      *  \return New GEOM_Object, containing the created face.
2142      */
2143     GEOM_Object MakeQuad4Vertices (in GEOM_Object thePnt1,
2144                                    in GEOM_Object thePnt2,
2145                                    in GEOM_Object thePnt3,
2146                                    in GEOM_Object thePnt4);
2147
2148     /*!
2149      *  \brief Create a hexahedral solid, bounded by the six given faces. Order of
2150      *  faces is not important. 
2151      *
2152      *  It is  not necessary that Faces share the same edge.
2153      *  \param theFace1-theFace6 Faces for the hexahedral solid.
2154      *  \return New GEOM_Object, containing the created solid.
2155      */
2156     GEOM_Object MakeHexa (in GEOM_Object theFace1,
2157                           in GEOM_Object theFace2,
2158                           in GEOM_Object theFace3,
2159                           in GEOM_Object theFace4,
2160                           in GEOM_Object theFace5,
2161                           in GEOM_Object theFace6);
2162
2163     /*!
2164      *  \brief Create a hexahedral solid between two given faces.
2165      *
2166      *  The missing faces will be built by creating the smallest ones.
2167      *  \param theFace1,theFace2 Two opposite faces for the hexahedral solid.
2168      *  \return New GEOM_Object, containing the created solid.
2169      */
2170     GEOM_Object MakeHexa2Faces (in GEOM_Object theFace1,
2171                                 in GEOM_Object theFace2);
2172
2173     
2174     # Extract elements of blocks and blocks compounds
2175      
2176
2177     /*!
2178      *  \brief Get a vertex, found in the given shape by its coordinates.
2179      *  \param theShape Block or a compound of blocks.
2180      *  \param theX,theY,theZ Coordinates of the sought vertex.
2181      *  \param theEpsilon Maximum allowed distance between the resulting
2182      *                    vertex and point with the given coordinates.
2183      *  \return New GEOM_Object, containing the found vertex.
2184      */
2185     GEOM_Object GetPoint (in GEOM_Object theShape,
2186                           in double      theX,
2187                           in double      theY,
2188                           in double      theZ,
2189                           in double      theEpsilon);
2190
2191     /*!
2192      *  \brief Find a vertex of the given shape, which has minimal distance to the given point.
2193      *  \param theShape Any shape.
2194      *  \param thePoint Point, close to the desired vertex.
2195      *  \return New GEOM_Object, containing the found vertex.
2196      */
2197     GEOM_Object GetVertexNearPoint (in GEOM_Object theShape,
2198                                     in GEOM_Object thePoint);
2199
2200     /*!
2201      *  \brief Get an edge, found in the given shape by two given vertices.
2202      *  \param theShape Block or a compound of blocks.
2203      *  \param thePoint1,thePoint2 Points, close to the ends of the desired edge.
2204      *  \return New GEOM_Object, containing the found edge.
2205      */
2206     GEOM_Object GetEdge (in GEOM_Object theShape,
2207                          in GEOM_Object thePoint1,
2208                          in GEOM_Object thePoint2);
2209
2210     /*!
2211      *  \brief Find an edge of the given shape, which has minimal distance to the given point.
2212      *  \param theShape Block or a compound of blocks.
2213      *  \param thePoint Point, close to the desired edge.
2214      *  \return New GEOM_Object, containing the found edge.
2215      */
2216     GEOM_Object GetEdgeNearPoint (in GEOM_Object theShape,
2217                                   in GEOM_Object thePoint);
2218
2219     /*!
2220      *  \brief Returns a face, found in the given shape by four given corner vertices.
2221      *  \param theShape Block or a compound of blocks.
2222      *  \param thePoint1-thePoint4 Points, close to the corners of the desired face.
2223      *  \return New GEOM_Object, containing the found face.
2224      */
2225     GEOM_Object GetFaceByPoints (in GEOM_Object theShape,
2226                                  in GEOM_Object thePoint1,
2227                                  in GEOM_Object thePoint2,
2228                                  in GEOM_Object thePoint3,
2229                                  in GEOM_Object thePoint4);
2230
2231     /*!
2232      *  \brief Get a face of block, found in the given shape by two given edges.
2233      *  \param theShape Block or a compound of blocks.
2234      *  \param theEdge1,theEdge2 Edges, close to the edges of the desired face.
2235      *  \return New GEOM_Object, containing the found face.
2236      */
2237     GEOM_Object GetFaceByEdges (in GEOM_Object theShape,
2238                                 in GEOM_Object theEdge1,
2239                                 in GEOM_Object theEdge2);
2240
2241     /*!
2242      *  \brief Find a face, opposite to the given one in the given block.
2243      *  \param theBlock Must be a hexahedral solid.
2244      *  \param theFace Face of \a theBlock, opposite to the desired face.
2245      *  \return New GEOM_Object, containing the found face.
2246      */
2247     GEOM_Object GetOppositeFace (in GEOM_Object theBlock,
2248                                  in GEOM_Object theFace);
2249
2250     /*!
2251      *  \brief Find a face of the given shape, which has minimal distance to the given point.
2252      *  \param theShape Block or a compound of blocks.
2253      *  \param thePoint Point, close to the desired face.
2254      *  \return New GEOM_Object, containing the found face.
2255      */
2256     GEOM_Object GetFaceNearPoint (in GEOM_Object theShape,
2257                                   in GEOM_Object thePoint);
2258
2259     /*!
2260      *  \brief Find a face of block, whose outside normale has minimal angle with the given vector.
2261      *  \param theShape Block or a compound of blocks.
2262      *  \param theVector Vector, close to the normale of the desired face.
2263      *  \return New GEOM_Object, containing the found face.
2264      */
2265     GEOM_Object GetFaceByNormale (in GEOM_Object theBlock,
2266                                   in GEOM_Object theVector);
2267
2268     /*!
2269      *  \brief Find all sub-shapes of type \a theShapeType of the given shape,
2270      *  which have minimal distance to the given point.
2271      *  \param theShape Any shape.
2272      *  \param thePoint Point, close to the desired shape.
2273      *  \param theShapeType Defines what kind of sub-shapes is searched.
2274      *  \param theTolerance The tolerance for distances comparison. All shapes
2275      *                      with distances to the given point in interval
2276      *                      [minimal_distance, minimal_distance + theTolerance] will be gathered.
2277      *  \return New GEOM_Object, containing a group of all found shapes.
2278      */
2279     GEOM_Object GetShapesNearPoint (in GEOM_Object theShape,
2280                                     in GEOM_Object thePoint,
2281                                     in long        theShapeType,
2282                                     in double      theTolerance);
2283
2284      #  Extract blocks from blocks compounds
2285      
2286
2287     /*!
2288      *  \brief Check, if the compound contains only specified blocks.
2289      *  \param theCompound The compound to check.
2290      *  \param theMinNbFaces If solid has lower number of faces, it is not a block.
2291      *  \param theMaxNbFaces If solid has higher number of faces, it is not a block.
2292      *    \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
2293      *  \return TRUE, if the given compound contains only blocks.
2294      *  \return theNbBlocks Number of specified blocks in theCompound.
2295      */
2296     boolean IsCompoundOfBlocks (in GEOM_Object theCompound,
2297                                 in long        theMinNbFaces,
2298                                 in long        theMaxNbFaces,
2299                                 out long       theNbBlocks);
2300
2301     /*!
2302      *  \brief Enumeration of Blocks Compound defects.
2303      */
2304     enum BCErrorType
2305     {
2306       /* Each element of the compound should be a Block */
2307       NOT_BLOCK,
2308
2309       /* An element is a potential block, but has degenerated and/or seam edge(s). */
2310       EXTRA_EDGE,
2311
2312       /* A connection between two Blocks should be an entire face or an entire edge */
2313       INVALID_CONNECTION,
2314
2315       /* The compound should be connexe */
2316       NOT_CONNECTED,
2317
2318       /* The glue between two quadrangle faces should be applied */
2319       NOT_GLUED
2320     };
2321
2322     /*!
2323      *  \brief Description of Blocks Compound defect: type and incriminated sub-shapes.
2324      */
2325     struct BCError
2326     {
2327       BCErrorType error;
2328       ListOfLong  incriminated;
2329     };
2330
2331     /*!
2332      *  \brief Sequence of all Blocks Compound defects.
2333      */
2334     typedef sequence<BCError> BCErrors;
2335
2336     /*!
2337      *  \brief Check, if the compound of blocks is given.
2338      *
2339      *  To be considered as a compound of blocks, the
2340      *  given shape must satisfy the following conditions:
2341      *  - Each element of the compound should be a Block (6 faces and 12 edges).
2342      *  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
2343      *  - The compound should be connexe.
2344      *  - The glue between two quadrangle faces should be applied.
2345      *    \note Single block is also accepted as a valid compound of blocks.
2346      *  \param theCompound The compound to check.
2347      *  \return TRUE, if the given shape is a compound of blocks.
2348      *  \return theErrors Structure, containing discovered errors and incriminated sub-shapes.
2349      */
2350     boolean CheckCompoundOfBlocks (in GEOM_Object theCompound,
2351                                    out BCErrors   theErrors);
2352
2353     /*!
2354      *  \brief Convert sequence of Blocks Compound errors, returned by
2355      *  <VAR>CheckCompoundOfBlocks()</VAR>, into string.
2356      *  \param theCompound The bad compound.
2357      *  \param theErrors The sequence of \a theCompound errors.
2358      *  \return String, describing all the errors in form, suitable for printing.
2359      */
2360     string PrintBCErrors (in GEOM_Object theCompound,
2361                           in BCErrors    theErrors);
2362
2363     /*!
2364      *  \brief Remove all seam and degenerated edges from \a theShape.
2365      *
2366      *  Unite faces and edges, sharing one surface.
2367      *  \param theShape The compound or single solid to remove irregular edges from.
2368      *  \param theOptimumNbFaces If more than zero, unite faces only for those solids,
2369      *         that have more than theOptimumNbFaces faces. If zero, unite faces always,
2370      *         regardsless their quantity in the solid. If negative, do not unite faces at all.
2371      *         For blocks repairing recommended value is 6.
2372      *  \return Improved shape.
2373      */
2374     GEOM_Object RemoveExtraEdges (in GEOM_Object theShape,
2375                                   in long        theOptimumNbFaces);
2376
2377     /*!
2378      *  \brief Check, if the given shape is a blocks compound.
2379      *
2380      *  Fix all detected errors.
2381      *    \note Single block can be also fixed by this method.
2382      *  \param theCompound The compound to check and improve.
2383      *  \return Improved compound.
2384      */
2385     GEOM_Object CheckAndImprove (in GEOM_Object theCompound);
2386
2387     /*!
2388      *  \brief Get all the blocks, contained in the given compound.
2389      *
2390      *  \param theCompound The compound to explode.
2391      *  \param theMinNbFaces If solid has lower number of faces, it is not a block.
2392      *  \param theMaxNbFaces If solid has higher number of faces, it is not a block.
2393      *    \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
2394      *  \return List of GEOM_Object, containing the retrieved blocks.
2395      */
2396     ListOfGO ExplodeCompoundOfBlocks (in GEOM_Object theCompound,
2397                                       in long        theMinNbFaces,
2398                                       in long        theMaxNbFaces);
2399
2400     /*!
2401      *  \brief Find block, containing the given point inside its volume or on boundary.
2402      *  \param theCompound Compound, to find block in.
2403      *  \param thePoint Point, close to the desired block. If the point lays on
2404      *         boundary between some blocks, we return block with nearest center.
2405      *  \return New GEOM_Object, containing the found block.
2406      */
2407     GEOM_Object GetBlockNearPoint (in GEOM_Object theCompound,
2408                                    in GEOM_Object thePoint);
2409
2410     /*!
2411      *  \brief Find block, containing all the elements, passed as the parts, or maximum quantity of them.
2412      *  \param theCompound Compound, to find block in.
2413      *  \param theParts List of faces and/or edges and/or vertices to be parts of the found block.
2414      *  \return New GEOM_Object, containing the found block.
2415      */
2416     GEOM_Object GetBlockByParts (in GEOM_Object theCompound,
2417                                  in ListOfGO    theParts);
2418
2419     /*!
2420      *  \brief Return all blocks, containing all the elements, passed as the parts.
2421      *  \param theCompound Compound, to find blocks in.
2422      *  \param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
2423      *  \return List of GEOM_Object, containing the found blocks.
2424      */
2425     ListOfGO GetBlocksByParts (in GEOM_Object theCompound,
2426                                in ListOfGO    theParts);
2427
2428    #  Operations on blocks with gluing of result
2429
2430     /*!
2431      *  \brief Multi-transformate block and glue the result.
2432      *
2433      *  Transformation is defined so, as to superpose theDirFace1 with theDirFace2.
2434      *  \param theBlock Hexahedral solid to be multi-transformed.
2435      *  \param theDirFace1 First direction face global index.
2436      *  \param theDirFace2 Second direction face global index.
2437      *  \param theNbTimes Quantity of transformations to be done.
2438      *    \note Global index of sub-shape can be obtained, using method
2439      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
2440      *  \return New GEOM_Object, containing the result shape.
2441      */
2442     GEOM_Object MakeMultiTransformation1D (in GEOM_Object theBlock,
2443                                            in long        theDirFace1,
2444                                            in long        theDirFace2,
2445                                            in long        theNbTimes);
2446
2447     /*!
2448      *  \brief Multi-transformate block and glue the result.
2449      *  \param theBlock Hexahedral solid to be multi-transformed.
2450      *  \param theDirFace1U,theDirFace2U Direction faces for the first transformation.
2451      *  \param theDirFace1V,theDirFace2V Direction faces for the second transformation.
2452      *  \param theNbTimesU,theNbTimesV Quantity of transformations to be done.
2453      *  \return New GEOM_Object, containing the result shape.
2454      */
2455     GEOM_Object MakeMultiTransformation2D (in GEOM_Object theBlock,
2456                                            in long        theDirFace1U,
2457                                            in long        theDirFace2U,
2458                                            in long        theNbTimesU,
2459                                            in long        theDirFace1V,
2460                                            in long        theDirFace2V,
2461                                            in long        theNbTimesV);
2462
2463    # Special operation - propagation
2464    
2465
2466     /*!
2467      *  \brief Build all possible propagation groups.
2468      *
2469      *  Propagation group is a set of all edges, opposite to one (main)
2470      *  edge of this group directly or through other opposite edges.
2471      *  Notion of Opposite Edge make sence only on quadrangle face.
2472      *  \param theShape Shape to build propagation groups on.
2473      *  \return List of GEOM_Object, each of them is a propagation group.
2474      */
2475     ListOfGO Propagate (in GEOM_Object theShape);
2476   };
2477
2478   # GEOM_IBooleanOperations
2479   /*!
2480    *  \brief Interface for boolean operations (Cut, Fuse, Common)
2481    */
2482   interface GEOM_IBooleanOperations : GEOM_IOperations
2483   {
2484     /*!
2485      *  \brief Perform one of boolean operations on two given shapes.
2486      *  \param theShape1 First argument for boolean operation.
2487      *  \param theShape2 Second argument for boolean operation.
2488      *  \param theOperation Indicates the operation to be done:
2489      *                      1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2490      *  \return New GEOM_Object, containing the result shape.
2491      */
2492     GEOM_Object MakeBoolean (in GEOM_Object theShape1,
2493                              in GEOM_Object theShape2,
2494                              in long theOperation);
2495
2496     /*!
2497      *  \brief Perform partition operation.
2498      *
2499      *  \param theShapes Shapes to be intersected.
2500      *  \param theTools Shapes to intersect theShapes.
2501      *  \note  Each compound from ListShapes and ListTools will be exploded in order
2502      *         to avoid possible intersection between shapes from this compound.
2503      *  \param theLimit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2504      *  \param KeepNonlimitShapes: if this parameter == 0, then only shapes of
2505      *                             target type (equal to Limit) are kept in the result,
2506      *                             else standalone shapes of lower dimension
2507      *                             are kept also (if they exist).
2508      *
2509      *  After implementation new version of PartitionAlgo (October 2006)
2510      *  other parameters are ignored by current functionality. They are kept
2511      *  in this function only for supporting old versions.
2512      *  Ignored parameters:
2513      *  \param theKeepInside Shapes, outside which the results will be deleted.
2514      *         Each shape from theKeepInside must belong to theShapes also.
2515      *  \param theRemoveInside Shapes, inside which the results will be deleted.
2516      *         Each shape from theRemoveInside must belong to theShapes also.
2517      *  \param theRemoveWebs If TRUE, perform Glue 3D algorithm.
2518      *  \param theMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
2519      *
2520      *  \return New GEOM_Object, containing the result shapes.
2521      */
2522     GEOM_Object MakePartition (in ListOfGO   theShapes,
2523                                in ListOfGO   theTools,
2524                                in ListOfGO   theKeepInside,
2525                                in ListOfGO   theRemoveInside,
2526                                in short      theLimit,
2527                                in boolean    theRemoveWebs,
2528                                in ListOfLong theMaterials,
2529                                in short      theKeepNonlimitShapes);
2530
2531     /*!
2532      *  \brief Perform partition operation.
2533      *
2534      *  This method may be usefull if it is needed to make a partition for
2535      *  a compound containing nonintersected shapes. Performance will be better
2536      *  since intersection between shapes from compound is not performed.
2537      *
2538      *  Description of all parameters as in previous method MakePartition()
2539      *
2540      *  \note Passed compounds (via ListShapes or via ListTools)
2541      *        have to consist of nonintersecting shapes.
2542      *
2543      *  \return New GEOM_Object, containing the result shapes.
2544      */
2545     GEOM_Object MakePartitionNonSelfIntersectedShape (in ListOfGO   theShapes,
2546                                                       in ListOfGO   theTools,
2547                                                       in ListOfGO   theKeepInside,
2548                                                       in ListOfGO   theRemoveInside,
2549                                                       in short      theLimit,
2550                                                       in boolean    theRemoveWebs,
2551                                                       in ListOfLong theMaterials,
2552                                                       in short      theKeepNonlimitShapes);
2553
2554     /*!
2555      *  \brief Perform partition of the Shape with the Plane
2556      *  \param theShape Shape to be intersected.
2557      *  \param thePlane Tool shape, to intersect theShape.
2558      *  \return New GEOM_Object, containing the result shape.
2559      */
2560     GEOM_Object MakeHalfPartition (in GEOM_Object theShape,
2561                                    in GEOM_Object thePlane);
2562   };
2563
2564   # GEOM_ICurvesOperations:
2565   /*!
2566    *  \brief Interface for curves creation.
2567    *
2568    *  Polyline, Circle, Spline (Bezier and Interpolation)
2569    */
2570   interface GEOM_ICurvesOperations : GEOM_IOperations
2571   {
2572     /*!
2573      *  \brief Create a circle with given center, normal vector and radius.
2574      *  \param thePnt Circle center.
2575      *  \param theVec Vector, normal to the plane of the circle.
2576      *  \param theR Circle radius.
2577      *  \return New GEOM_Object, containing the created circle.
2578      */
2579     GEOM_Object MakeCirclePntVecR (in GEOM_Object thePnt,
2580                                    in GEOM_Object theVec,
2581                                    in double theR);
2582     /*!
2583      *  \brief Create a circle, passing through three given points
2584      *  \param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2585      *  \return New GEOM_Object, containing the created circle.
2586      */
2587     GEOM_Object MakeCircleThreePnt (in GEOM_Object thePnt1,
2588                                     in GEOM_Object thePnt2,
2589                                     in GEOM_Object thePnt3);
2590     /*!
2591      *  \brief Create a circle with given center, with a radius equals the distance from center to Point1
2592      *  and on a plane defined by all of three points.
2593      *  \param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2594      *  \return New GEOM_Object, containing the created circle.
2595      */
2596     GEOM_Object MakeCircleCenter2Pnt (in GEOM_Object thePnt1,
2597                                       in GEOM_Object thePnt2,
2598                                       in GEOM_Object thePnt3);
2599     /*!
2600      *  \brief Create an ellipse with given center, normal vector and radiuses.
2601      *  \param thePnt Ellipse center.
2602      *  \param theVec Vector, normal to the plane of the ellipse.
2603      *  \param theRMajor Major ellipse radius.
2604      *  \param theRMinor Minor ellipse radius.
2605      *  \return New GEOM_Object, containing the created ellipse.
2606      */
2607     GEOM_Object MakeEllipse (in GEOM_Object thePnt,
2608                              in GEOM_Object theVec,
2609                              in double theRMajor,
2610                              in double theRMinor);
2611
2612     /*!
2613      *  \brief Create an ellipse with given center, normal vector, main axis vector and radiuses.
2614      *  \param thePnt Ellipse center.
2615      *  \param theVec Vector, normal to the plane of the ellipse.
2616      *  \param theRMajor Major ellipse radius.
2617      *  \param theRMinor Minor ellipse radius.
2618      *  \param theVecMaj Vector, direction of the ellipse's main axis.
2619      *  \return New GEOM_Object, containing the created ellipse.
2620      */
2621     GEOM_Object MakeEllipseVec (in GEOM_Object thePnt,
2622                                 in GEOM_Object theVec,
2623                                 in double theRMajor,
2624                                 in double theRMinor,
2625                                 in GEOM_Object theVecMaj);
2626
2627     /*!
2628      *  \brief Create an arc of circle, passing through three given points.
2629      *  \param thePnt1 Start point of the arc.
2630      *  \param thePnt2 Middle point of the arc.
2631      *  \param thePnt3 End point of the arc.
2632      *  \return New GEOM_Object, containing the created arc.
2633      */
2634     GEOM_Object MakeArc (in GEOM_Object thePnt1,
2635                          in GEOM_Object thePnt2,
2636                          in GEOM_Object thePnt3);
2637
2638     /*!
2639      *  \brief Create an arc of circle of center C from one point to another
2640      *  \param theCenter Center point of the arc.
2641      *  \param thePnt1 Start point of the arc.
2642      *  \param thePnt2 End point of the arc.
2643      *  \param theSense Orientation of the arc
2644      *  \return New GEOM_Object, containing the created arc.
2645      */
2646     GEOM_Object MakeArcCenter (in GEOM_Object theCenter,
2647                                in GEOM_Object thePnt1,
2648                                in GEOM_Object thePnt2,
2649                                in boolean theSense);
2650
2651     /*!
2652      *  \brief Create an arc of ellipse of center C and two points P1 P2.
2653      *  \param theCenter Center point of the arc.
2654      *  \param thePnt1 Major radius is distance from center to Pnt1.
2655      *  \param thePnt2 define a plane and Minor radius as a shortest
2656      *                 distance from Pnt2 to vector Center->Pnt1.
2657      *  \return New GEOM_Object, containing the created arc.
2658      */
2659     GEOM_Object MakeArcOfEllipse (in GEOM_Object theCenter,
2660                                   in GEOM_Object thePnt1,
2661                                   in GEOM_Object thePnt2);
2662
2663
2664     /*!
2665      *  \brief Create a polyline on the set of points.
2666      *  \param thePoints Sequence of points for the polyline.
2667      *  \param theIsClosed If TRUE, build a closed wire.
2668      *  \return New GEOM_Object, containing the created polyline.
2669      */
2670     GEOM_Object MakePolyline (in ListOfGO thePoints,
2671                               in boolean  theIsClosed);
2672
2673     /*!
2674      *  \brief Create bezier curve on the set of points.
2675      *  \param thePoints Sequence of points for the bezier curve.
2676      *  \param theIsClosed If TRUE, build a closed curve.
2677      *  \return New GEOM_Object, containing the created bezier curve.
2678      */
2679     GEOM_Object MakeSplineBezier (in ListOfGO thePoints,
2680                                   in boolean  theIsClosed);
2681
2682     /*!
2683      *  \brief Create B-Spline curve on the set of points.
2684      *  \param thePoints Sequence of points for the B-Spline curve.
2685      *  \param theIsClosed If TRUE, build a closed curve.
2686      *  \param theDoReordering If TRUE, the algo does not follow the order of
2687      *                         \a thePoints but searches for the closest vertex.
2688      *  \return New GEOM_Object, containing the created B-Spline curve.
2689      */
2690     GEOM_Object MakeSplineInterpolation (in ListOfGO thePoints,
2691                                          in boolean  theIsClosed,
2692                                          in boolean  theDoReordering);
2693
2694     /*!
2695      *  \brief Creates a curve using the parametric definition of the basic points.
2696      *  \param thexExpr parametric equation of the coordinates X.
2697      *  \param theyExpr parametric equation of the coordinates Y.
2698      *  \param thezExpr parametric equation of the coordinates Z.
2699      *  \param theParamMin the minimal value of the parameter.
2700      *  \param theParamMax the maximum value of the parameter.
2701      *  \param theParamStep the step of the parameter.
2702      *  \param theCurveType the type of the curve.
2703      *  \return New GEOM_Object, containing the created curve.
2704      */    
2705     GEOM_Object MakeCurveParametric(in string thexExpr,
2706                                     in string theyExpr,
2707                                     in string thezExpr,
2708                                     in double theParamMin,
2709                                     in double theParamMax,
2710                                     in double theParamStep,
2711                                     in curve_type theCurveType);
2712
2713      /*!
2714      *  \brief Creates a curve using the parametric definition of the basic points.
2715      *  \param thexExpr parametric equation of the coordinates X.
2716      *  \param theyExpr parametric equation of the coordinates Y.
2717      *  \param thezExpr parametric equation of the coordinates Z.
2718      *  \param theParamMin the minimal value of the parameter.
2719      *  \param theParamMax the maximum value of the parameter.
2720      *  \param theParamStep the number of steps of the parameter discretization.
2721      *  \param theCurveType the type of the curve.
2722      *  \return New GEOM_Object, containing the created curve.
2723      */    
2724     GEOM_Object MakeCurveParametricNew(in string thexExpr,
2725                     in string theyExpr,
2726                     in string thezExpr,
2727                     in double theParamMin,
2728                     in double theParamMax,
2729                     in long   theParamNbStep,
2730                     in curve_type theCurveType);
2731
2732     /*!
2733      *  \brief Create a sketcher (wire or face), following the textual description,
2734      *  passed through \a theCommand argument.
2735      *
2736      *  Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2737      *  Format of the description string have to be the following:
2738      *
2739      *  "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2740      *
2741      *  Where:
2742      *  - x1, y1 are coordinates of the first sketcher point (zero by default),
2743      *  - CMD is one of
2744      *     - "R angle" : Set the direction by angle
2745      *     - "D dx dy" : Set the direction by DX & DY
2746      *     .
2747      *       \n
2748      *     - "TT x y" : Create segment by point at X & Y
2749      *     - "T dx dy" : Create segment by point with DX & DY
2750      *     - "L length" : Create segment by direction & Length
2751      *     - "IX x" : Create segment by direction & Intersect. X
2752      *     - "IY y" : Create segment by direction & Intersect. Y
2753      *     .
2754      *       \n
2755      *     - "C radius length" : Create arc by direction, radius and length(in degree)
2756      *     .
2757      *       \n
2758      *     - "WW" : Close Wire (to finish)
2759      *     - "WF" : Close Wire and build face (to finish)
2760      *
2761      *  \param theCommand String, defining the sketcher in local
2762      *                    coordinates of the working plane.
2763      *  \param theWorkingPlane Nine double values, defining origin,
2764      *                         OZ and OX directions of the working plane.
2765      *  \return New GEOM_Object, containing the created wire.
2766      */
2767     GEOM_Object MakeSketcher (in string theCommand, in ListOfDouble theWorkingPlane);
2768
2769     /*!
2770      *  \brief Create a 3D sketcher, following the numerical description,
2771      *  passed through points created by \a theCoordinates argument. 
2772      *
2773      *  Format of the description string have to be the following:
2774      *
2775      *  "Make3DSketcher[x1, y1, z1, x2, y2, z2, ..., xN, yN, zN]"
2776      */
2777
2778     GEOM_Object Make3DSketcher (in ListOfDouble theCoordinates);
2779
2780       /*!
2781      *  \brief Create a sketcher (wire or face), following the textual description,
2782      *  passed through \a theCommand argument. 
2783      *
2784      *  For format of the description string see the previous method.\n
2785      *  \param theCommand String, defining the sketcher in local
2786      *                    coordinates of the working plane.
2787      *  \param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2788      *  \return New GEOM_Object, containing the created wire.
2789      */
2790     GEOM_Object MakeSketcherOnPlane (in string theCommand, in GEOM_Object theWorkingPlane);
2791   };
2792
2793   # GEOM_ILocalOperations:
2794   /*!
2795    *  \brief Interface for fillet and chamfer creation.
2796    */
2797   interface GEOM_ILocalOperations : GEOM_IOperations
2798   {
2799     /*!
2800      *  \brief Perform a fillet on all edges of the given shape.
2801      *  \param theShape Shape, to perform fillet on.
2802      *  \param theR Fillet radius.
2803      *  \return New GEOM_Object, containing the result shape.
2804      */
2805     GEOM_Object MakeFilletAll (in GEOM_Object theShape,
2806                                in double      theR);
2807
2808     /*!
2809      *  \brief Perform a fillet on the specified edges of the given shape
2810      *  \param theShape Shape, to perform fillet on.
2811      *  \param theR Fillet radius.
2812      *  \param theEdges Global indices of edges to perform fillet on.
2813      *    \note Global index of sub-shape can be obtained, using method
2814      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
2815      *  \return New GEOM_Object, containing the result shape.
2816      */
2817     GEOM_Object MakeFilletEdges (in GEOM_Object theShape,
2818                                  in double      theR,
2819                                  in ListOfLong  theEdges);
2820     GEOM_Object MakeFilletEdgesR1R2 (in GEOM_Object theShape,
2821                                      in double      theR1,
2822                                      in double      theR2,
2823                                      in ListOfLong  theEdges);
2824
2825     /*!
2826      *  \brief Perform a fillet on all edges of the specified faces of the given shape.
2827      *  \param theShape Shape, to perform fillet on.
2828      *  \param theR Fillet radius.
2829      *  \param theFaces Global indices of faces to perform fillet on.
2830      *    \note Global index of sub-shape can be obtained, using method
2831      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
2832      *  \return New GEOM_Object, containing the result shape.
2833      */
2834     GEOM_Object MakeFilletFaces (in GEOM_Object theShape,
2835                                  in double      theR,
2836                                  in ListOfLong  theFaces);
2837
2838     GEOM_Object MakeFilletFacesR1R2 (in GEOM_Object theShape,
2839                                      in double      theR1,
2840                                      in double      theR2,
2841                                      in ListOfLong  theFaces);
2842
2843     /*!
2844      *  \brief Perform a fillet on a face or a shell at the specified vertexes.
2845      *  \param theShape Shape, to perform fillet on.
2846      *  \param theR Fillet radius.
2847      *  \param theVertexes Global indices of vertexes to perform fillet on.
2848      *    \note Global index of sub-shape can be obtained, using method
2849      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
2850      *  \return New GEOM_Object, containing the result shape.
2851      */
2852     GEOM_Object MakeFillet2D (in GEOM_Object theShape,
2853                               in double      theR,
2854                               in ListOfLong  theVertexes);
2855
2856     /*!
2857      *  \brief Perform a fillet on edges of the specified vertexes of the given wire.
2858      *  \param theShape Shape, to perform fillet on.
2859      *  \param theR Fillet radius.
2860      *  \param theVertexes Global indices of vertexes to perform fillet on.
2861      *    \note Global index of sub-shape can be obtained, using method
2862      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
2863      *    \note The list of vertices coudl be empty, in this case fillet fill be done
2864      *          at all vertices in given wire
2865      *  \return New GEOM_Object, containing the result shape.
2866      */
2867     GEOM_Object MakeFillet1D (in GEOM_Object theShape,
2868                               in double      theR,
2869                               in ListOfLong  theVertexes);
2870
2871     /*!
2872      *  \brief Perform a symmetric chamfer on all edges of the given shape.
2873      *  \param theShape Shape, to perform chamfer on.
2874      *  \param theD Chamfer size along each face.
2875      *  \return New GEOM_Object, containing the result shape.
2876      */
2877     GEOM_Object MakeChamferAll (in GEOM_Object theShape,
2878                                 in double      theD);
2879
2880     /*!
2881      *  \brief Perform a chamfer on edges, common to the specified faces.
2882      *  with distance D1 on the Face1
2883      *  \param theShape Shape, to perform chamfer on.
2884      *  \param theD1 Chamfer size along \a theFace1.
2885      *  \param theD2 Chamfer size along \a theFace2.
2886      *  \param theFace1,theFace2 Global indices of two faces of \a theShape.
2887      *    \note Global index of sub-shape can be obtained, using method
2888      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
2889      *  \return New GEOM_Object, containing the result shape.
2890      */
2891     GEOM_Object MakeChamferEdge (in GEOM_Object theShape,
2892                                  in double theD1, in double theD2,
2893                                  in long theFace1, in long theFace2);
2894     /*!
2895      *  \brief The Same but with params theD = Chamfer Lenght
2896      *  and theAngle = Chamfer Angle (Angle in radians)
2897      */
2898     GEOM_Object MakeChamferEdgeAD (in GEOM_Object theShape,
2899                                    in double theD, in double theAngle,
2900                                    in long theFace1, in long theFace2);
2901
2902     /*!
2903      *  \brief Perform a chamfer on all edges of the specified faces.
2904      *  with distance D1 on the first specified face (if several for one edge)
2905      *  \param theShape Shape, to perform chamfer on.
2906      *  \param theD1 Chamfer size along face from \a theFaces. If both faces,
2907      *               connected to the edge, are in \a theFaces, \a theD1
2908      *               will be get along face, which is nearer to \a theFaces beginning.
2909      *  \param theD2 Chamfer size along another of two faces, connected to the edge.
2910      *  \param theFaces Sequence of global indices of faces of \a theShape.
2911      *    \note Global index of sub-shape can be obtained, using method
2912      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
2913      *  \return New GEOM_Object, containing the result shape.
2914      */
2915     GEOM_Object MakeChamferFaces (in GEOM_Object theShape,
2916                                   in double theD1, in double theD2,
2917                                   in ListOfLong theFaces);
2918     /*!
2919      *  The Same but with params theD = Chamfer Lenght
2920      *  and theAngle = Chamfer Angle (Angle in radians)
2921      */
2922     GEOM_Object MakeChamferFacesAD (in GEOM_Object theShape,
2923                                     in double theD, in double theAngle,
2924                                     in ListOfLong theFaces);
2925
2926    /*!
2927     *  \brief Perform a chamfer on edges,
2928     *  with distance D1 on the first specified face (if several for one edge)
2929     *  \param theShape Shape, to perform chamfer on.
2930     *  \param theD1 theD2 Chamfer size
2931     *  \param theEdges Sequence of edges of \a theShape.
2932     *  \return New GEOM_Object, containing the result shape.
2933     */
2934     GEOM_Object MakeChamferEdges (in GEOM_Object theShape,
2935                                   in double theD1, in double theD2,
2936                                   in ListOfLong theEdges);
2937     /*!
2938      *  The Same but with params theD = Chamfer Lenght
2939      *  and theAngle = Chamfer Angle (Angle in radians)
2940      */
2941     GEOM_Object MakeChamferEdgesAD (in GEOM_Object theShape,
2942                                     in double theD, in double theAngle,
2943                                     in ListOfLong theEdges);
2944
2945     /*!
2946      *  \brief Perform an Archimde operation on the given shape with given parameters.
2947      *                    The object presenting the resulting face is returned
2948      *  \param theShape Shape to be put in water.
2949      *  \param theWeight Weight og the shape.
2950      *  \param theWaterDensity Density of the water.
2951      *  \param theMeshDeflection Deflection od the mesh, using to compute the section.
2952      *  \return New GEOM_Object, containing a section of \a theShape
2953      *          by a plane, corresponding to water level.
2954      */
2955     GEOM_Object MakeArchimede (in GEOM_Object theShape,
2956                                in double theWeight,
2957                                in double theWaterDensity,
2958                                in double theMeshDeflection);
2959
2960     /*!
2961      *  \brief Duplicates <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
2962      *
2963      *  Present here only for compatibility.
2964      */
2965     long GetSubShapeIndex (in GEOM_Object theShape, in GEOM_Object theSubShape);
2966   };
2967
2968   #  GEOM_IHealingOperations: 
2969   /*!
2970    *  \brief Interface for shape healing operations
2971    *
2972    *  Shape Processing, SuppressFaces, etc.
2973    */
2974   interface GEOM_IHealingOperations : GEOM_IOperations
2975   {
2976     /*!
2977      *  \brief Apply a sequence of Shape Healing operators to the given object.
2978      *  \param theShapes Shape to be processed.
2979      *  \param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2980      *  \param theParameters List of names of parameters
2981      *                    ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2982      *  \param theValues List of values of parameters, in the same order
2983      *                    as parameters are listed in \a theParameters list.
2984      *  \return New GEOM_Object, containing processed shape.
2985      */
2986     GEOM_Object ProcessShape (in GEOM_Object theShapes,
2987                               in string_array theOperators,
2988                               in string_array theParameters,
2989                               in string_array theValues);
2990
2991     /*!
2992      *  \brief Get default sequence of operators, their parameters and parameters' values
2993      *  of Shape Process operation. 
2994      *
2995      *  In the current implementation the defaults are
2996      *  read from the file pointed by CSF_ShHealingDefaults environmental variable.
2997      *  \param theOperators Output. Default list of names of operators.
2998      *  \param theParameters Output. Default list of names of parameters.
2999      *  \param theValues Output. List of default values of parameters, in the same order
3000      *                           as parameters are listed in \a theParameters list.
3001      */
3002     void GetShapeProcessParameters (out string_array theOperators,
3003                                     out string_array theParameters,
3004                                     out string_array theValues);
3005     /*!
3006      *  \brief Get parameters and parameters' values for the given Shape Process operation.
3007      *
3008      *  In the current implementation the defaults are
3009      *  read from the file pointed by CSF_ShHealingDefaults environmental variable.
3010      *  \param theOperator Input. The operator's name.
3011      *  \param theParameters Output. Default list of names of parameters.
3012      *  \param theValues Output. List of default values of parameters, in the same order
3013      *                           as parameters are listed in \a theParameters list.
3014      */
3015     void GetOperatorParameters (in string theOperator,
3016                                 out string_array theParameters,
3017                                 out string_array theValues);
3018
3019     /*!
3020      *  \brief Remove faces from the given object (shape).
3021      *  \param theObject Shape to be processed.
3022      *  \param theFaces Indices of faces to be removed, if EMPTY then the method
3023      *                  removes ALL faces of the given object.
3024      *  \return New GEOM_Object, containing processed shape.
3025      */
3026     GEOM_Object SuppressFaces (in GEOM_Object theObject, in short_array theFaces);
3027
3028     /*!
3029      *  \brief Close an open wire.
3030      *  \param theObject Shape to be processed.
3031      *  \param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
3032      *                  if -1, then theObject itself is a wire.
3033      *  \param isCommonVertex If TRUE : closure by creation of a common vertex,
3034      *                        If FALS : closure by creation of an edge between ends.
3035      *  \return New GEOM_Object, containing processed shape.
3036      */
3037     GEOM_Object CloseContour (in GEOM_Object theObject, in short_array theWires,
3038                               in boolean isCommonVertex);
3039
3040     /*!
3041      *  \brief Remove internal wires and edges from the given object (face).
3042      *  \param theObject Shape to be processed.
3043      *  \param theWires Indices of wires to be removed, if EMPTY then the method
3044      *                  removes ALL internal wires of the given object.
3045      *  \return New GEOM_Object, containing processed shape.
3046      */
3047     GEOM_Object RemoveIntWires (in GEOM_Object theObject, in short_array theWires);
3048
3049     /*!
3050      *  \brief Remove internal closed contours (holes) from the given object.
3051      *  \param theObject Shape to be processed.
3052      *  \param theWires Indices of wires to be removed, if EMPTY then the method
3053      *                  removes ALL internal holes of the given object
3054      *  \return New GEOM_Object, containing processed shape.
3055      */
3056     GEOM_Object FillHoles (in GEOM_Object theObject, in short_array theWires);
3057
3058     /*!
3059      *  Sewing of the given object.
3060      *  \param theObject Shape to be processed.
3061      *  \param theTolerance Required tolerance value.
3062      *  \return New GEOM_Object, containing processed shape.
3063      */
3064     GEOM_Object Sew (in GEOM_Object theObject, in double theTolerance);
3065
3066     /*!
3067      *  \brief Addition of a point to a given edge object.
3068      *  \param theObject Shape to be processed.
3069      *  \param theEdgeIndex Index of edge to be divided within theObject's shape,
3070      *                      if -1, then theObject itself is the edge.
3071      *  \param theValue Value of parameter on edge or length parameter,
3072      *                  depending on \a isByParameter.
3073      *  \param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
3074      *                       if FALSE : \a theValue is treated as a length parameter [0..1]
3075      *  \return New GEOM_Object, containing processed shape.
3076      */
3077     GEOM_Object DivideEdge (in GEOM_Object theObject, in short theEdgeIndex,
3078                             in double theValue, in boolean isByParameter);
3079
3080     /*!
3081      *  \brief Get a list of wires (wrapped in GEOM_Object-s),
3082      *  that constitute a free boundary of the given shape.
3083      *  \param theObject Shape to get free boundary of.
3084      *  \param theClosedWires Output. Closed wires on the free boundary of the given shape.
3085      *  \param theOpenWires Output. Open wires on the free boundary of the given shape.
3086      *  \return FALSE, if an error(s) occured during the method execution.
3087      */
3088     boolean GetFreeBoundary (in GEOM_Object theObject,
3089                              out ListOfGO theClosedWires,
3090                              out ListOfGO theOpenWires);
3091
3092     /*!
3093      *  \brief Change orientation of the given object.
3094      *  \param theObject Shape to be processed.
3095      *  \return New GEOM_Object, containing processed shape.
3096      */
3097     GEOM_Object ChangeOrientation (in GEOM_Object theObject);
3098     GEOM_Object ChangeOrientationCopy (in GEOM_Object theObject);
3099
3100     /*!
3101      *  \brief Try to limit tolerance of the given object by value \a theTolerance.
3102      *  \param theObject Shape to be processed.
3103      *  \param theTolerance Required tolerance value.
3104      *  \return New GEOM_Object, containing processed shape.
3105      */
3106     GEOM_Object LimitTolerance (in GEOM_Object theObject, in double theTolerance);
3107
3108   };
3109
3110   # GEOM_IInsertOperations:
3111   /*!
3112    *  \brief Interface for shape insert operations (like copy, import).
3113    *
3114    */
3115   interface GEOM_IInsertOperations : GEOM_IOperations
3116   {
3117     /*!
3118      *  \brief Create a copy of the given object
3119      */
3120     GEOM_Object MakeCopy (in GEOM_Object theOriginal);
3121
3122     /*!
3123      *  \brief Export the given shape into a file with given name.
3124      *  \param theObject Shape to be stored in the file.
3125      *  \param theFileName Name of the file to store the given shape in.
3126      *  \param theFormatName Specify format for the shape storage.
3127      *         Available formats can be obtained with <VAR>ImportTranslators()</VAR> method.
3128      */
3129     void Export (in GEOM_Object theObject, in string theFileName, in string theFormatName);
3130
3131     /*!
3132      *  \brief Import a shape from the BRep or IGES or STEP file
3133      *  (depends on given format) with given name.
3134      *  \param theFileName The file, containing the shape.
3135      *  \param theFormatName Specify format for the file reading.
3136      *         Available formats can be obtained with <VAR>ImportTranslators()</VAR> method.
3137      *         If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3138      *         set to 'meter' and result model will be scaled.
3139      *  \return New GEOM_Object, containing the imported shape.
3140      */
3141     GEOM_Object ImportFile (in string theFileName, in string theFormatName);
3142
3143     /*!
3144      *  \brief Get the supported import formats and corresponding patterns for File dialog.
3145      *  \param theFormats Output. List of formats, available for import.
3146      *  \param thePatterns Output. List of file patterns, corresponding to available formats.
3147      *  \return Returns available formats and patterns through the arguments.
3148      */
3149     void ImportTranslators (out string_array theFormats,
3150                             out string_array thePatterns);
3151
3152     /*!
3153      *  \brief Get the supported export formats and corresponding patterns for File dialog.
3154      *  \param theFormats Output. List of formats, available for export.
3155      *  \param thePatterns Output. List of file patterns, corresponding to available formats.
3156      *  \return Returns available formats and patterns through the arguments.
3157      */
3158     void ExportTranslators (out string_array theFormats,
3159                             out string_array thePatterns);
3160
3161     /*!
3162      * \brief Load texture from file
3163      * \param theTextureFile texture file name
3164      * \return unique texture identifier
3165      */
3166     long LoadTexture(in string theTextureFile);
3167
3168     /*!
3169      * \brief Add texture to the study
3170      * \param theWidth texture width in pixels
3171      * \param theHeight texture height in pixels
3172      * \param theTexture texture byte array
3173      * \return unique texture identifier
3174      */
3175     long AddTexture(in long theWidth, in long theHeight, in SALOMEDS::TMPFile theTexture);
3176
3177     /*!
3178      * \brief Get previously loaded texture data
3179      * \param theID texture identifier
3180      * \param theWidth texture width in pixels
3181      * \param theHeight texture height in pixels
3182      * \return texture byte array
3183      */
3184     SALOMEDS::TMPFile GetTexture(in long theID, out long theWidth, out long theHeight);
3185
3186     /*!
3187      * \brief Get list of all avaiable texture IDs
3188      * \return list of all texture IDs avaiable for the current study
3189      */
3190     ListOfLong GetAllTextures();
3191   };
3192
3193   # GEOM_IKindOfShape:
3194   /*!
3195    *  \brief Interface for shape_kind enumeration.
3196    */
3197   interface GEOM_IKindOfShape
3198   {
3199     enum shape_kind {
3200       NO_SHAPE,
3201       //COMPOSITEs
3202       COMPOUND,
3203       COMPSOLID,
3204       SHELL,
3205       WIRE,
3206       // SOLIDs
3207       /*! full sphere */
3208       SPHERE,
3209       /*! cylinder */
3210       CYLINDER,
3211       /*! box with faces, parallel to global coordinate planes */
3212       BOX,
3213       /*! other box */
3214       ROTATED_BOX, 
3215       /*! full torus */
3216       TORUS,   
3217       /*! cone */  
3218       CONE,   
3219       /*! solid, bounded by polygons */
3220       POLYHEDRON,  
3221       /*! other solid */
3222       SOLID,       
3223       // FACEs
3224       /*! spherical face (closed) */
3225       SPHERE2D,    
3226       /*! cylindrical face with defined height */
3227       CYLINDER2D,
3228       /*! toroidal face (closed) */
3229       TORUS2D,     
3230       /*! conical face with defined height */
3231       CONE2D,
3232       /*! planar, bounded by circle */
3233       DISK_CIRCLE,
3234       /*! planar, bounded by ellipse */
3235       DISK_ELLIPSE,
3236       /*! planar, bounded by segments */
3237       POLYGON,     
3238       /*! infinite planar */
3239       PLANE,        
3240        /*! other planar */
3241       PLANAR,      
3242       /*! other face */
3243       FACE,      
3244       // EDGEs
3245       /*! full circle */
3246       CIRCLE,      
3247       /*! arc of circle */
3248       ARC_CIRCLE, 
3249       /*! full ellipse */
3250       ELLIPSE,    
3251       /*! arc of ellipse */
3252       ARC_ELLIPSE,  
3253       /*! infinite segment */
3254       LINE,         
3255       /*! segment */
3256       SEGMENT,      
3257       /*! other edge */
3258       EDGE,       
3259       // VERTEX
3260       VERTEX,
3261       // ADVANCED shapes
3262       /*! all advanced shapes (temporary implementation) */
3263       ADVANCED    
3264     };
3265   };
3266
3267   # GEOM_IMeasureOperations:
3268   /*!
3269    *  \brief Interface for measurement (distance, whatis) and
3270    *  properties calculation (like Centre of Mass, Inertia, etc.).
3271    *
3272    */
3273   interface GEOM_IMeasureOperations : GEOM_IOperations
3274   {
3275     /*!
3276      *  \brief Get kind of theShape.
3277      *  \param theShape Shape to get a kind of.
3278      *  \param theIntegers Output. Integer and enumerated shape's parameters
3279      *                     (kind of surface, closed/unclosed, number of edges, etc.)
3280      *  \param theDoubles  Output. Double shape's parameters (coordinates, dimensions, etc.)
3281      *  \note  Concrete meaning of each value, returned via \a theIntegers
3282      *         or \a theDoubles list depends on the kind of the shape.
3283      *  \return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration.
3284      */
3285     //short KindOfShape (in GEOM_Object   theShape,
3286     GEOM_IKindOfShape::shape_kind KindOfShape (in  GEOM_Object  theShape,
3287                                                out ListOfLong   theIntegers,
3288                                                out ListOfDouble theDoubles);
3289
3290     /*!
3291      *  \brief Get position (LCS) of theShape.
3292      *  \param theShape Shape to calculate position of.
3293      *  \param Ox,Oy,Oz Output. Coordinates of shape's location origin.
3294      *                  Origin of the LCS is situated at the shape's center of mass.
3295      *  \param Zx,Zy,Zz Output. Coordinates of shape's location normal(main) direction.
3296      *  \param Xx,Xy,Xz Output. Coordinates of shape's location X direction.
3297      *                  Axes of the LCS are obtained from shape's location or,
3298      *                  if the shape is a planar face, from position of its plane.
3299      *  \return Returns position of the shape through the last nine arguments.
3300      */
3301     void GetPosition (in GEOM_Object theShape,
3302                       out double Ox, out double Oy, out double Oz,
3303                       out double Zx, out double Zy, out double Zz,
3304                       out double Xx, out double Xy, out double Xz);
3305
3306     /*!
3307      *  \brief Get summarized length of all wires,
3308      *  area of surface and volume of the given shape.
3309      *  \param theShape Shape to define properties of.
3310      *  \param theLength Output. Summarized length of all wires of the given shape.
3311      *  \param theSurfArea Output. Area of surface of the given shape.
3312      *  \param theVolume Output. Volume of the given shape.
3313      *  \return Returns shape properties through the last three arguments.
3314      */
3315     void GetBasicProperties (in GEOM_Object theShape,
3316                              out double theLength,
3317                              out double theSurfArea,
3318                              out double theVolume);
3319
3320     /*!
3321      *  \brief Get a point, situated at the centre of mass of theShape.
3322      *  \param theShape Shape to define centre of mass of.
3323      *  \return New GEOM_Object, containing the created point.
3324      */
3325     GEOM_Object GetCentreOfMass (in GEOM_Object theShape);
3326
3327     /*
3328      *  Get the vertex by index for 1D objects depends the edge/wire orientation
3329      *  \param theShape Shape (wire or edge) to find the vertex on it
3330      *  \param theIndex Index of vertex sub-shape
3331      *  \return New GEOM_Object, vertex.
3332      */
3333     GEOM_Object GetVertexByIndex( in GEOM_Object theShape, in long index );
3334
3335     /*!
3336      *  \brief Get a vector, representing the normal of theFace.
3337      *  If the face is not planar, theOptionalPoint is obligatory.
3338      *  \param theFace Shape (face) to define the normal of.
3339      *  \param theOptionalPoint Shape (point) to define the normal at.
3340      *                          Can be NULL in case of planar face.
3341      *  \return New GEOM_Object, containing the created normal vector.
3342      */
3343     GEOM_Object GetNormal (in GEOM_Object theFace,
3344                            in GEOM_Object theOptionalPoint);
3345
3346     /*!
3347      *  \brief Get inertia matrix and moments of inertia of theShape.
3348      *  \param theShape Shape to calculate inertia of.
3349      *  \param I(1-3)(1-3) Output. Components of the inertia matrix of the given shape.
3350      *  \param Ix,Iy,Iz Output. Moments of inertia of the given shape.
3351      *  \return Returns inertia through the last twelve arguments.
3352      */
3353     void GetInertia (in GEOM_Object theShape,
3354                      out double I11, out double I12, out double I13,
3355                      out double I21, out double I22, out double I23,
3356                      out double I31, out double I32, out double I33,
3357                      out double Ix , out double Iy , out double Iz);
3358
3359     /*!
3360      *  \brief Get parameters of bounding box of the given shape
3361      *  \param theShape Shape to obtain bounding box of.
3362      *  \param Xmin,Xmax Output. Limits of shape along OX axis.
3363      *  \param Ymin,Ymax Output. Limits of shape along OY axis.
3364      *  \param Zmin,Zmax Output. Limits of shape along OZ axis.
3365      *  \return Returns parameters of bounding box through the last six arguments.
3366      */
3367     void GetBoundingBox (in GEOM_Object theShape,
3368                          out double Xmin, out double Xmax,
3369                          out double Ymin, out double Ymax,
3370                          out double Zmin, out double Zmax);
3371
3372     /*!
3373      *  \brief Get min and max tolerances of sub-shapes of theShape
3374      *  \param theShape Shape, to get tolerances of.
3375      *  \param FaceMin,FaceMax Output. Min and max tolerances of the faces.
3376      *  \param EdgeMin,EdgeMax Output. Min and max tolerances of the edges.
3377      *  \param VertMin,VertMax Output. Min and max tolerances of the vertices.
3378      *  \return Returns shape tolerances through the last six arguments.
3379      */
3380     void GetTolerance (in GEOM_Object theShape,
3381                        out double FaceMin, out double FaceMax,
3382                        out double EdgeMin, out double EdgeMax,
3383                        out double VertMin, out double VertMax);
3384
3385     /*!
3386      *  \brief Check a topology of the given shape.
3387      *  \param theShape Shape to check validity of.
3388      *  \param theDescription Output. Description of problems in the shape, if they are.
3389      *  \return TRUE, if the shape "seems to be valid" from the topological point of view.
3390      */
3391     boolean CheckShape (in GEOM_Object theShape,
3392                         out string     theDescription);
3393
3394     /*!
3395      *  \brief Check a topology and a geometry of the given shape.
3396      *  \param theShape Shape to check validity of.
3397      *  \param theDescription Output. Description of problems in the shape, if they are.
3398      *  \return TRUE, if the shape "seems to be valid".
3399      */
3400     boolean CheckShapeWithGeometry (in GEOM_Object theShape,
3401                                     out string     theDescription);
3402
3403     /*!
3404      *  \brief Check a topology of the given shape on self-intersections presence.
3405      *  \param theShape Shape to check validity of.
3406      *  \param theIntersections Output. List of intersected sub-shapes IDs, it contains pairs of IDs.
3407      *  \return TRUE, if the shape does not have any self-intersections.
3408      */
3409     boolean CheckSelfIntersections (in GEOM_Object theShape,
3410                                     out ListOfLong theIntersections);
3411
3412     /*!
3413      *  \brief Check if the given shape can be an argument for MakeSolid operation
3414      *  \param theShape Shape to be described.
3415      *  \return Empty string if a solid can be made on this shape, error code otherwise.
3416      */
3417     string IsGoodForSolid (in GEOM_Object theShape);
3418
3419     /*!
3420      *  O\brief btain description of the given shape
3421      *  \param theShape Shape to be described.
3422      *  \return Description of the given shape.
3423      */
3424     string WhatIs (in GEOM_Object theShape);
3425
3426     /*!
3427      *  \brief Check if points defined by coords = [x1, y1, z1, x2, y2, z2, ...] are inside or on
3428      *  the shape theShape.
3429      *  \param theShape Shape to check.
3430      *  \param coords list of coordinates.
3431      *  \param tolerance tolerance.
3432      *  \return list of boolean.
3433      */
3434     ListOfBool AreCoordsInside(in GEOM_Object theShape, in ListOfDouble coords, in double tolerance);
3435
3436     /*!
3437      *  \brief Get minimal distance between the given shapes.
3438      *  \param theShape1,theShape2 Shapes to find minimal distance between.
3439      *  \param X1,Y1,Z1 Output. Coordinates of point on theShape1, nearest to theShape2.
3440      *  \param X2,Y2,Z2 Output. Coordinates of point on theShape2, nearest to theShape1.
3441      *  \return Value of the minimal distance between the given shapes.
3442      */
3443     double GetMinDistance (in GEOM_Object theShape1, in GEOM_Object theShape2,
3444                            out double X1, out double Y1, out double Z1,
3445                            out double X2, out double Y2, out double Z2);
3446
3447     /*!
3448      *  \brief Get angle between the given lines or linear edges.
3449      *  \param theShape1,theShape2 Shapes to find angle between. Lines or linear edges.
3450      *  \return Value of the angle between the given shapes.
3451      */
3452     double GetAngle (in GEOM_Object theShape1, in GEOM_Object theShape2);
3453
3454     /*!
3455      *  \brief Get angle between the given vectors.
3456      *  \param theShape1,theShape2 Vectors to find angle between.
3457      *  \return Value of the angle between the given vectors.
3458      */
3459     double GetAngleBtwVectors (in GEOM_Object theShape1, in GEOM_Object theShape2);
3460
3461     /*!
3462      *  \brief Get point coordinates
3463      */
3464     void PointCoordinates (in GEOM_Object theShape, out double X, out double Y, out double Z);
3465
3466     /*!
3467      *  \brief Get radius of curvature of curve in the point determinated by param
3468      *  \param theShape - curve.
3469      *  \param theParam - parameter on curve
3470      *  \return Value of curvature.
3471      */
3472     double CurveCurvatureByParam (in GEOM_Object theShape, in double theParam);
3473
3474     /*!
3475      *  \brief Get radius of curvature of curve in the given point
3476      *  \param theShape - curve.
3477      *  \param thePoint - point
3478      *  \return Value of curvature.
3479      */
3480     double CurveCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
3481
3482     /*!
3483      *  \brief Get max radius of curvature of surface in the point determinated by params
3484      *  \param theShape - surface.
3485      *  \param theUParam - U-parameter on surface
3486      *  \param theVParam - V-parameter on surface
3487      *  \return Value of curvature.
3488      */
3489     double MaxSurfaceCurvatureByParam (in GEOM_Object theShape, in double theUParam,
3490                                        in double theVParam);
3491
3492     /*!
3493      *  \brief Get max radius of curvature of surface in the given point
3494      *  \param theShape - surface.
3495      *  \param thePoint - point
3496      *  \return Value of curvature.
3497      */
3498     double MaxSurfaceCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
3499
3500     /*!
3501      *  \brief Get min radius of curvature of surface in the point determinated by params
3502      *  \param theShape - surface.
3503      *  \param theUParam - U-parameter on surface
3504      *  \param theVParam - V-parameter on surface
3505      *  \return Value of curvature.
3506      */
3507     double MinSurfaceCurvatureByParam (in GEOM_Object theShape, in double theUParam,
3508                                        in double theVParam);
3509
3510     /*!
3511      *  \brief Get min radius of curvature of surface in the given point
3512      *  \param theShape - surface.
3513      *  \param thePoint - point
3514      *  \return Value of curvature.
3515      */
3516     double MinSurfaceCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
3517
3518   };
3519
3520   # GEOM_IGroupOperations:
3521   /*!
3522    *  \brief Interface for groups creation.
3523    */
3524   interface GEOM_IGroupOperations : GEOM_IOperations
3525   {
3526     /*!
3527      *  \brief Creates a new group which will store  sub-shapes of theMainShape
3528      *  \param theMainShape is a GEOM_Object on which the group is selected
3529      *  \param theShapeType defines a shape type of the group
3530      *  \return a newly created GEOM group
3531      */
3532     GEOM_Object CreateGroup (in GEOM_Object theMainShape, in long theShapeType);
3533
3534     /*!
3535      *  \brief Adds a sub-object with ID theSubShapeId to the group
3536      *  \param theGroup is a GEOM group to which the new sub-shape is added
3537      *  \param theSubShapeId is a sub-shape ID in the main object.
3538      *  \note Use method <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR> to get an ID by the sub-shape
3539      */
3540     void AddObject (in GEOM_Object theGroup, in long theSubShapeId);
3541
3542     /*!
3543      *  \brief Removes a sub-object with ID \a theSubShapeId from the group
3544      *  \param theGroup is a GEOM group from which the sub-shape is removed.
3545      *  \param theSubShapeId is a sub-shape ID in the main object.
3546      *  \note Use method <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR> to get an ID by the sub-shape
3547      */
3548     void RemoveObject (in GEOM_Object theGroup, in long theSubShapeId);
3549
3550     /*!
3551      *  \brief Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3552      *  \param theGroup is a GEOM group to which the new sub-shapes are added.
3553      *  \param theSubShapes is a list of sub-shapes to be added.
3554      */
3555     void UnionList (in GEOM_Object theGroup, in ListOfGO theSubShapes);
3556
3557     /*!
3558      *  \brief Removes from the group all the given shapes. No errors, if some shapes are not included.
3559      *  \param theGroup is a GEOM group from which the sub-shapes are removed.
3560      *  \param theSubShapes is a list of sub-shapes to be removed.
3561      */
3562     void DifferenceList (in GEOM_Object theGroup, in ListOfGO theSubShapes);
3563
3564     /*!
3565      *  \brief Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3566      *  \param theGroup is a GEOM group to which the new sub-shapes are added.
3567      *  \param theSubShapes is a list of IDs of sub-shapes to be added.
3568      */
3569     void UnionIDs (in GEOM_Object theGroup, in ListOfLong theSubShapes);
3570
3571     /*!
3572      *  \brief Removes from the group all the given shapes. No errors, if some shapes are not included.
3573      *  \param theGroup is a GEOM group from which the sub-shapes are removed.
3574      *  \param theSubShapes is a list of IDs of sub-shapes to be removed.
3575      */
3576     void DifferenceIDs (in GEOM_Object theGroup, in ListOfLong theSubShapes);
3577
3578     /*!
3579      *  \brief Returns a type of sub-objects stored in the group
3580      *  \param theGroup is a GEOM group which type is returned.
3581      */
3582     long GetType (in GEOM_Object theGroup);
3583
3584     /*!
3585      *  \brief Returns a main shape associated with the group
3586      *  \param theGroup is a GEOM group for which a main shape object is requested
3587      *  \return a GEOM_Object which is a main shape for theGroup
3588      */
3589     GEOM_Object GetMainShape (in GEOM_Object theGroup);
3590
3591     /*!
3592      *  \brief Returns a list of sub-objects ID stored in the group
3593      *  \param theGroup is a GEOM group for which a list of IDs is requested
3594      */
3595     ListOfLong GetObjects (in GEOM_Object theGroup);
3596   };
3597
3598   # GEOM_IAdvancedOperations:
3599   /*!
3600    *  \brief Interface for advanced modeling functions.
3601    */
3602   interface GEOM_IAdvancedOperations : GEOM_IOperations
3603   {
3604     /*!
3605      *  \brief Create a T-shape object with specified caracteristics for the main and
3606      *  the incident pipes (radius, width, half-length).
3607      *
3608      *  Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
3609      *  \param theR1 Internal radius of main pipe
3610      *  \param theW1 Width of main pipe
3611      *  \param theL1 Half-length of main pipe
3612      *  \param theR2 Internal radius of incident pipe (R2 < R1)
3613      *  \param theW2 Width of incident pipe (R2+W2 < R1+W1)
3614      *  \param theL2 Half-length of incident pipe
3615      *  \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
3616      *  \return List of GEOM_Object, containing the created shape and propagation groups.
3617      */
3618     ListOfGO MakePipeTShape (in double theR1, in double theW1, in double theL1,
3619                              in double theR2, in double theW2, in double theL2,
3620                              in boolean theHexMesh);
3621     /*!
3622      *  \brief Create a T-shape object with specified caracteristics for the main and
3623      *  the incident pipes (radius, width, half-length).
3624      *
3625      *  The extremities of the main pipe are located on junctions points P1 and P2.
3626      *  The extremity of the incident pipe is located on junction point P3.
3627      *  \param theR1 Internal radius of main pipe
3628      *  \param theW1 Width of main pipe
3629      *  \param theL1 Half-length of main pipe
3630      *  \param theR2 Internal radius of incident pipe (R2 < R1)
3631      *  \param theW2 Width of incident pipe (R2+W2 < R1+W1)
3632      *  \param theL2 Half-length of incident pipe
3633      *  \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
3634      *  \param theP1 1st junction point of main pipe
3635      *  \param theP2 2nd junction point of main pipe
3636      *  \param theP3 Junction point of incident pipe
3637      *  \return List of GEOM_Object, containing the created shape and propagation groups.
3638      */
3639     ListOfGO MakePipeTShapeWithPosition (in double theR1, in double theW1, in double theL1,
3640                                          in double theR2, in double theW2, in double theL2,
3641                                          in boolean theHexMesh,
3642                                          in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
3643     /*!
3644      *  \brief Create a T-shape object with specified caracteristics for the main and
3645      *  the incident pipes (radius, width, half-length). A chamfer is created
3646      *  on the junction of the pipes.
3647      *  
3648      *  Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
3649      *  \param theR1 Internal radius of main pipe
3650      *  \param theW1 Width of main pipe
3651      *  \param theL1 Half-length of main pipe
3652      *  \param theR2 Internal radius of incident pipe (R2 < R1)
3653      *  \param theW2 Width of incident pipe (R2+W2 < R1+W1)
3654      *  \param theL2 Half-length of incident pipe
3655      *  \param theH Height of the chamfer.
3656      *  \param theW Width of the chamfer.
3657      *  \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
3658      *  \return List of GEOM_Object, containing the created shape and propagation groups.
3659      */
3660     ListOfGO MakePipeTShapeChamfer (in double theR1, in double theW1, in double theL1,
3661                                     in double theR2, in double theW2, in double theL2,
3662                                     in double theH, in double theW, in boolean theHexMesh);
3663     /*!
3664      *  \brief Create a T-shape object with specified caracteristics for the main and
3665      *  the incident pipes (radius, width, half-length). 
3666      * 
3667      *  A chamfer is created on the junction of the pipes.
3668      *  The extremities of the main pipe are located on junctions points P1 and P2.
3669      *  The extremity of the incident pipe is located on junction point P3.
3670      *  \param theR1 Internal radius of main pipe
3671      *  \param theW1 Width of main pipe
3672      *  \param theL1 Half-length of main pipe
3673      *  \param theR2 Internal radius of incident pipe (R2 < R1)
3674      *  \param theW2 Width of incident pipe (R2+W2 < R1+W1)
3675      *  \param theL2 Half-length of incident pipe
3676      *  \param theH Height of the chamfer.
3677      *  \param theW Width of the chamfer.
3678      *  \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
3679      *  \param theP1 1st junction point of main pipe
3680      *  \param theP2 2nd junction point of main pipe
3681      *  \param theP3 Junction point of incident pipe
3682      *  \return List of GEOM_Object, containing the created shape and propagation groups.
3683      */
3684     ListOfGO MakePipeTShapeChamferWithPosition (in double theR1, in double theW1, in double theL1,
3685                                                 in double theR2, in double theW2, in double theL2,
3686                                                 in double theH, in double theW, in boolean theHexMesh,
3687                                                 in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
3688     /*!
3689      *  \brief Create a T-shape object with specified caracteristics for the main and
3690      *  the incident pipes (radius, width, half-length). 
3691      *
3692      *  A fillet is created on the junction of the pipes.
3693      *  Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
3694      *  \param theR1 Internal radius of main pipe
3695      *  \param theW1 Width of main pipe
3696      *  \param theL1 Half-length of main pipe
3697      *  \param theR2 Internal radius of incident pipe (R2 < R1)
3698      *  \param theW2 Width of incident pipe (R2+W2 < R1+W1)
3699      *  \param theL2 Half-length of incident pipe
3700      *  \param theRF Radius of curvature of fillet.
3701      *  \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
3702      *  \return List of GEOM_Object, containing the created shape and propagation groups.
3703      */
3704     ListOfGO MakePipeTShapeFillet (in double theR1, in double theW1, in double theL1,
3705                                    in double theR2, in double theW2, in double theL2,
3706                                    in double theRF, in boolean theHexMesh);
3707     /*!
3708      *  \brief Create a T-shape object with specified caracteristics for the main and
3709      *  the incident pipes (radius, width, half-length).
3710      *
3711      *  A fillet is created on the junction of the pipes.
3712      *  The extremities of the main pipe are located on junctions points P1 and P2.
3713      *  The extremity of the incident pipe is located on junction point P3.
3714      *  \param theR1 Internal radius of main pipe
3715      *  \param theW1 Width of main pipe
3716      *  \param theL1 Half-length of main pipe
3717      *  \param theR2 Internal radius of incident pipe (R2 < R1)
3718      *  \param theW2 Width of incident pipe (R2+W2 < R1+W1)
3719      *  \param theL2 Half-length of incident pipe
3720      *  \param theRF Radius of curvature of fillet.
3721      *  \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
3722      *  \param theP1 1st junction point of main pipe
3723      *  \param theP2 2nd junction point of main pipe
3724      *  \param theP3 Junction point of incident pipe
3725      *  \return List of GEOM_Object, containing the created shape and propagation groups.
3726      */
3727     ListOfGO MakePipeTShapeFilletWithPosition (in double theR1, in double theW1, in double theL1,
3728                                                in double theR2, in double theW2, in double theL2,
3729                                                in double theRF, in boolean theHexMesh,
3730                                                in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
3731     /*@@ insert new functions before this line @@ do not remove this line @@*/
3732   };
3733
3734   # GEOM_Gen:
3735   /*!
3736    *  \brief Interface to access other GEOM interfaces.
3737    *
3738    *  Also contains some methods to access and manage GEOM_Object.
3739    */
3740   interface GEOM_Gen : Engines::EngineComponent,SALOMEDS::Driver
3741   {
3742     /*!
3743      *  \brief Undo/Redo Management
3744      */
3745
3746     void Undo (in long theStudyID);
3747
3748     void Redo (in long theStudyID);
3749
3750     /*!
3751      * \brief Publishing management
3752      *
3753      * Adds in theStudy a object theObject under with a name theName,
3754      * if theFather is not NULL the object is placed under thFather's SObject.
3755      * Returns a SObject where theObject is placed
3756      */
3757     SALOMEDS::SObject AddInStudy (in SALOMEDS::Study theStudy,
3758                                   in GEOM_Object theObject,
3759                                   in string theName,
3760                                   in GEOM_Object theFather);
3761
3762     /*!
3763      *  \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments
3764      *
3765      *  To be used from python scripts out of geompy.addToStudy (non-default usage)
3766      *  \param theStudy  the study, in which theObject is published already,
3767      *                   and in which the arguments will be published
3768      *  \param theObject published GEOM_Object, arguments of which will be published
3769      *  \param theArgs   list of GEOM_Object, operation arguments to be published.
3770      *                   If this list is empty, all operation arguments will be published
3771      *  \param theFindMethod method to search sub-shapes, corresponding to arguments and
3772      *                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
3773      *  \param theInheritFirstArg set properties of the first argument for \a theObject.
3774      *                            Do not publish sub-shapes in place of arguments, but only
3775      *                            in place of sub-shapes of the first argument,
3776      *                            because the whole shape corresponds to the first argument.
3777      *                            Mainly to be used after transformations, but it also can be
3778      *                            usefull after partition with one object shape, and some other
3779      *                            operations, where only the first argument has to be considered.
3780      *                            If theObject has only one argument shape, this flag is automatically
3781      *                            considered as True, not regarding really passed value.
3782      *  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
3783      *                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
3784      *  \return list of published sub-shapes
3785      */
3786     ListOfGO RestoreSubShapesO (in SALOMEDS::Study   theStudy,
3787                                 in GEOM_Object       theObject,
3788                                 in ListOfGO          theArgs,
3789                                 in find_shape_method theFindMethod,
3790                                 in boolean           theInheritFirstArg,
3791                                 in boolean           theAddPrefix);
3792
3793     /*!
3794      *  \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments
3795      *
3796      *  To be used from python scripts out of geompy.addToStudy (non-default usage)
3797      *  \param theStudy  the study, in which theObject is published already,
3798      *                   and in which the arguments will be published
3799      *  \param theObject published GEOM_Object, arguments of which will be published
3800      *  \param theArgs   list of GEOM_Object, operation arguments to be published.
3801      *                   If this list is empty, all operation arguments will be published
3802      *  \param theFindMethod method to search sub-shapes, corresponding to arguments and
3803      *                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
3804      *  \param theInheritFirstArg set properties of the first argument for \a theObject.
3805      *                            Do not publish sub-shapes in place of arguments, but only
3806      *                            in place of sub-shapes of the first argument,
3807      *                            because the whole shape corresponds to the first argument.
3808      *                            Mainly to be used after transformations, but it also can be
3809      *                            usefull after partition with one object shape, and some other
3810      *                            operations, where only the first argument has to be considered.
3811      *                            If theObject has only one argument shape, this flag is automatically
3812      *                            considered as True, not regarding really passed value.
3813      *  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
3814      *                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
3815      *  \return list of published sub-shapes
3816      */
3817     ListOfGO RestoreGivenSubShapesO (in SALOMEDS::Study   theStudy,
3818                                      in GEOM_Object       theObject,
3819                                      in ListOfGO          theArgs,
3820                                      in find_shape_method theFindMethod,
3821                                      in boolean           theInheritFirstArg,
3822                                      in boolean           theAddPrefix);
3823
3824     /*!
3825      *  \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments
3826      *
3827      *  To be used from GUI and from geompy.addToStudy.
3828      *  Work like the above method, but accepts study object theSObject instead of GEOM_Object.
3829      *  \param theSObject study object, referencing GEOM_Object, arguments of which will be published
3830      */
3831     ListOfGO RestoreSubShapesSO (in SALOMEDS::Study   theStudy,
3832                                  in SALOMEDS::SObject theSObject,
3833                                  in ListOfGO          theArgs,
3834                                  in find_shape_method theFindMethod,
3835                                  in boolean           theInheritFirstArg,
3836                                  in boolean           theAddPrefix);
3837
3838     #  Methods to access interfaces for objects creation and transformation
3839     
3840     GEOM_IBasicOperations     GetIBasicOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
3841     GEOM_ITransformOperations GetITransformOperations(in long theStudyID) raises (SALOME::SALOME_Exception);
3842     GEOM_I3DPrimOperations    GetI3DPrimOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
3843     GEOM_IShapesOperations    GetIShapesOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
3844     GEOM_IBooleanOperations   GetIBooleanOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
3845     GEOM_ICurvesOperations    GetICurvesOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
3846     GEOM_ILocalOperations     GetILocalOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
3847     GEOM_IHealingOperations   GetIHealingOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
3848     GEOM_IInsertOperations    GetIInsertOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
3849     GEOM_IMeasureOperations   GetIMeasureOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
3850     GEOM_IBlocksOperations    GetIBlocksOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
3851     GEOM_IGroupOperations     GetIGroupOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
3852     GEOM_IAdvancedOperations  GetIAdvancedOperations (in long theStudyID) raises (SALOME::SALOME_Exception);
3853
3854     # Objects Management
3855      
3856
3857     /*!
3858      *  \brief Removes the object from the GEOM component
3859      *  \param theObject is a GEOM_Object to be removed
3860      */
3861     void RemoveObject (in GEOM_Object theObject);
3862
3863     /*!
3864      *  \brief Returns an object defined by the study and its entry in the GEOM component
3865      *  \param theStudyID is a SALOMEDS Study ID
3866      *  \param theEntry is an entry of the requested GEOM_Object in the GEOM component
3867      *  \note if the object has not previously been created a NULL GEOM_Object is returned
3868      */
3869     GEOM_Object GetObject (in long theStudyID, in string theEntry);
3870
3871     /*!
3872      *  \brief Add a sub-shape defined by indices in \a theIndices
3873      *  (contains unique IDs of sub-shapes inside \a theMainShape)
3874      *  \note The sub-shape GEOM_Object can has ONLY ONE function.
3875      *        Don't try to apply modification operations on them.
3876      *  \note Internal method
3877      */
3878     GEOM_Object AddSubShape (in GEOM_Object theMainShape, in ListOfLong theIndices);
3879
3880   #  GEOM_Objects IOR Management
3881     
3882     /*!
3883      *  \brief Returns a GEOM_Object defined by its IOR
3884      *  \param theIOR a string containg an IOR of the requested GEOM_Object
3885      */
3886     GEOM_Object GetIORFromString (in string theIOR);
3887
3888     /*!
3889      *  \brief Returns a string which contains an IOR of the GEOM_Object
3890      *  \param theObject is a GEOM_Object which IOR is requested
3891      */
3892     string GetStringFromIOR (in GEOM_Object theObject);
3893
3894     /*!
3895      *  \brief Returns a name with which a GEOM_Object was dumped into python script
3896      *  \param theStudyEntry is an entry of the GEOM_Object in the study
3897      */
3898     string GetDumpName (in string theStudyEntry);
3899
3900     /*!
3901      *  \brief Returns all names with which a GEOM_Object was dumped
3902      *  into python script to avoid the same names in SMESH script
3903      */
3904     string_array GetAllDumpNames();
3905
3906     /*!
3907      *  \brief Publishes the named sub-shapes of given object in the study.
3908      *  \param theStudy    The study in which the object is published
3909      *  \param theObject   The object which named sub-shapes are published
3910      */
3911     ListOfGO PublishNamedShapesInStudy(in SALOMEDS::Study theStudy,
3912                                        //in SObject theSObject,
3913                                        in Object theObject);
3914   };
3915 };
3916
3917 #endif