Salome HOME
NPAL18363: EDF635: We can now select any object in all window.
[modules/geom.git] / idl / GEOM_Gen.idl
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //  File   : GEOM_Gen.idl
21 //  Author : Sergey RUIN
22
23 #ifndef __GEOM_GEN__
24 #define __GEOM_GEN__
25
26 #include "SALOME_Exception.idl"
27 #include "SALOME_Component.idl"
28 #include "SALOMEDS.idl"
29
30 #include "SALOME_GenericObj.idl"
31
32 module GEOM
33 {
34   /*!
35    *  Topological types of shapes (like Open Cascade types)
36    */
37   enum shape_type { COMPOUND, COMPSOLID, SOLID, SHELL,
38                     FACE, WIRE, EDGE, VERTEX, SHAPE };
39
40
41   /*!
42    *  State of shape relatively geometrical surface like plane, sphere or cylinder.
43    *  Is used in functions GEOM_IShapesOperations.GetShapesOn<xxx>()
44    */
45   enum shape_state
46   {
47     /*! Shape is on surface */
48     ST_ON,
49
50     /*!
51      *  Shape is in the direction defined by the normal and not on surface.
52      *  For plane it means above the plane,
53      *  For sphere and cylinder it means outside of volume, bounded by the surface.
54      */
55     ST_OUT,
56
57     /*!
58      *  Shape is in the direction defined by the normal and on surface.
59      *  ONOUT = ON || OUT
60      */
61     ST_ONOUT,
62
63     /*!
64      *  Complementary to ONOUT.
65      *  For plane it means below the plane,
66      *  For sphere and cylinder it means inside the volume, bounded by the surface
67      *  (beyond axis and surface for cylinder and beyond cented and surface for sphere).
68      */
69     ST_IN,
70
71     /*!
72      *  Complementary to OUT.
73      *  ONIN = ON || IN
74      */
75     ST_ONIN
76   };
77
78   typedef sequence<string>      string_array;
79   typedef sequence<short>       short_array;
80   typedef sequence<long>        ListOfLong;
81   typedef sequence<double>      ListOfDouble;
82
83   interface GEOM_Object;
84
85   typedef sequence<GEOM_Object> ListOfGO;
86
87   /*!
88    *  GEOM_Object: interface of geometric object
89    */
90   interface GEOM_Object : SALOME::GenericObj
91   {
92
93     /*!
94      *  Get an entry of the object in GEOM component.
95      */
96     string GetEntry();
97
98     /*!
99      *  Get ID of study, where the object is created.
100      */
101     long GetStudyID();
102
103     /*!
104      *  Get internal type of the object (POINT, BOX, CYLINDER, EXTRUSION...).
105      */
106     long GetType();
107
108     /*!
109      *  Get a <VAR>shape_type</VAR> of the object value.
110      */
111     shape_type GetShapeType();
112
113     /*!
114      *  Set name of the object.
115      *  \param theName is a name which will be associated with this object.
116      */
117     void SetName (in string theName);
118
119     /*!
120      *  Get name of the object associated with this object.
121      */
122     string GetName();
123
124     /*!
125      *  Set a Study entry where this object was published.
126      */
127     void SetStudyEntry (in string theEntry);
128
129     /*!
130      *  Get a Study entry where this object was published.
131      */
132     string GetStudyEntry();
133
134     /*!
135      *  Get a list of all GEOM objects on which were the arguments
136      *  when this object was constructed and modified.
137      *  \note This method is supposed to be used by GUI only.
138      */
139     ListOfGO GetDependency();
140
141     /*!
142      *  Get a list of GEOM objects on which the last function that created or modified the object depends.
143      *  \note This method is supposed to be used by GUI only.
144      */
145     ListOfGO GetLastDependency();
146
147     /*!
148      *  Get the TopoDS_Shape, for colocated case only.
149      */
150     long long getShape();
151
152     /*!
153      ######################################################################
154      *  Internal methods (For sub shape identification)
155      ######################################################################
156      */
157
158     /*!
159      *  Get geometric shape of the object as a byte stream
160      */
161     SALOMEDS::TMPFile GetShapeStream();
162
163     /*
164      *  Returns True if this object is not a sub shape of another object.
165      */
166     boolean IsMainShape();
167
168     /*
169      *  Get a list of ID's of sub shapes in the main shape.
170      *  \note Internal method, suppopsed to be used only by GEOM_Client
171      */
172     ListOfLong GetSubShapeIndices();
173
174     /*
175      *  Get a main shape object to which this object is a sub shape
176      *  \note Internal method, suppopsed to be used only by GEOM_Client
177      */
178     GEOM_Object GetMainShape();
179
180     /*
181      *  Return true if geom object representes a shape.
182      *  For example, method return false for GEOM_MARKER
183      */
184      boolean IsShape();
185   };
186
187
188   /*!
189    *  GEOM_IOperations: basic methods of all geometric operations
190    */
191   interface GEOM_IOperations : SALOME::GenericObj
192   {
193     /*!
194      *  To know, if the operation was successfully performed
195      */
196     boolean IsDone();
197
198     /*!
199      *  Set the operation error code
200      *  \param theErrorID is a string describing the error occured
201      *  \note This method is supposed to be used only by interfaces inheriting from IOperations.
202      */
203     void SetErrorCode (in string theErrorID);
204
205     /*!
206      *  Get the operation error code
207      */
208     string GetErrorCode();
209
210     /*!
211      *  Get ID of study, where the operation is defined
212      */
213     long GetStudyID();
214
215     /*!
216      *  Opens a new transaction
217      */
218     void StartOperation();
219
220     /*!
221      *  Closes the previously opened trasaction
222      */
223     void FinishOperation();
224
225     /*!
226      *  Aborts the previously opened transaction
227      */
228     void AbortOperation();
229   };
230
231   /*!
232    *  GEOM_IBasicOperations: interface for basic geometry creation
233    *  (Point, Vector, Plane, Marker)
234    */
235   interface GEOM_IBasicOperations : GEOM_IOperations
236   {
237     /*!
238      *  Create point by three coordinates.
239      *  \param theX The X coordinate of the point.
240      *  \param theY The Y coordinate of the point.
241      *  \param theZ The Z coordinate of the point.
242      *  \return New GEOM_Object, containing the created point.
243      */
244     GEOM_Object MakePointXYZ (in double theX, in double theY, in double theZ);
245
246     /*!
247      *  Create a point, distant from the referenced point
248      *  on the given distances along the coordinate axes.
249      *  \param theReference The referenced point.
250      *  \param theX Displacement from the referenced point along OX axis.
251      *  \param theY Displacement from the referenced point along OY axis.
252      *  \param theZ Displacement from the referenced point along OZ axis.
253      *  \return New GEOM_Object, containing the created point.
254      */
255     GEOM_Object MakePointWithReference (in GEOM_Object theReference,
256                                         in double theX, in double theY, in double theZ);
257
258     /*!
259      *  Create a point, corresponding to the given parameter on the given curve.
260      *  \param theRefCurve The referenced curve.
261      *  \param theParameter Value of parameter on the referenced curve.
262      *  \return New GEOM_Object, containing the created point.
263      */
264     GEOM_Object MakePointOnCurve (in GEOM_Object theRefCurve,
265                                   in double theParameter);
266
267     /*!
268      *  Create a point, on two lines intersection.
269      *  \param theRefLine1, theRefLine2 The referenced lines.
270      *  \return New GEOM_Object, containing the created point.
271      */
272     GEOM_Object MakePointOnLinesIntersection (in GEOM_Object theRefLine1,
273                                               in GEOM_Object theRefLine2);
274     
275      /*!
276      *  Create a vector, corresponding to tangent to the given parameter on the given curve.
277      *  \param theRefCurve The referenced curve.
278      *  \param theParameter Value of parameter on the referenced curve.This value should be have value
279      *  \between 0. and 1.. Value of 0. corresponds first parameter of curve value 1. corresponds
280      *  \last parameter of curve. 
281      *  \return New GEOM_Object, containing the created point.
282      */
283      GEOM_Object MakeTangentOnCurve (in GEOM_Object theRefCurve,
284                                      in double theParameter);
285
286     /*!
287      *  Create a vector with the given components.
288      *  \param theDX X component of the vector.
289      *  \param theDY Y component of the vector.
290      *  \param theDZ Z component of the vector.
291      *  \return New GEOM_Object, containing the created vector.
292      */
293     GEOM_Object MakeVectorDXDYDZ (in double theDX,
294                                   in double theDY,
295                                   in double theDZ);
296
297     /*!
298      *  Create a vector between two points.
299      *  \param thePnt1 Start point for the vector.
300      *  \param thePnt2 End point for the vector.
301      *  \return New GEOM_Object, containing the created vector.
302      */
303     GEOM_Object MakeVectorTwoPnt (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
304
305     /*!
306      *  Create a line, passing through the given point
307      *  and parrallel to the given direction
308      *  \param thePnt Point. The resulting line will pass through it.
309      *  \param theDir Direction. The resulting line will be parallel to it.
310      *  \return New GEOM_Object, containing the created line.
311      */
312     GEOM_Object MakeLine (in GEOM_Object thePnt, in GEOM_Object theDir);
313
314     /*!
315      *  Create a line, passing through the given points
316      *  \param thePnt1 First of two points, defining the line.
317      *  \param thePnt2 Second of two points, defining the line.
318      *  \return New GEOM_Object, containing the created line.
319      */
320     GEOM_Object MakeLineTwoPnt (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
321
322     /*!
323      *  Create a line, given by two faces intersection.
324      *  \param theFace1 First of two faces, defining the line.
325      *  \param theFace2 Second of two faces, defining the line.
326      *  \return New GEOM_Object, containing the created line.
327      */
328     GEOM_Object MakeLineTwoFaces (in GEOM_Object theFace1, in GEOM_Object theFace2);
329
330     /*!
331      *  Create a plane, passing through the three given points
332      *  \param thePnt1 First of three points, defining the plane.
333      *  \param thePnt2 Second of three points, defining the plane.
334      *  \param thePnt3 Fird of three points, defining the plane.
335      *  \param theTrimSize Half size of a side of quadrangle face, representing the plane.
336      *  \return New GEOM_Object, containing the created plane.
337      */
338     GEOM_Object MakePlaneThreePnt (in GEOM_Object thePnt1,
339                                    in GEOM_Object thePnt2,
340                                    in GEOM_Object thePnt3,
341                                    in double theTrimSize);
342
343     /*!
344      *  Create a plane, passing through the given point
345      *  and normal to the given vector.
346      *  \param thePnt Point, the plane has to pass through.
347      *  \param theVec Vector, defining the plane normal direction.
348      *  \param theTrimSize Half size of a side of quadrangle face, representing the plane.
349      *  \return New GEOM_Object, containing the created plane.
350      */
351     GEOM_Object MakePlanePntVec (in GEOM_Object thePnt,
352                                  in GEOM_Object theVec,
353                                  in double theTrimSize);
354
355     /*!
356      *  Create a plane, similar to the existing one, but with another size of representing face.
357      *  \param theFace Referenced plane or LCS(Marker).
358      *  \param theTrimSize New half size of a side of quadrangle face, representing the plane.
359      *  \return New GEOM_Object, containing the created plane.
360      */
361     GEOM_Object MakePlaneFace (in GEOM_Object theFace,
362                                in double theTrimSize);
363
364     /*!
365      *  Create a local coordinate system.
366      *  \param theOX,theOY,theOZ Three coordinates of coordinate system origin.
367      *  \param theXDX,theXDY,theXDZ Three components of OX direction
368      *  \param theYDX,theYDY,theYDZ Three components of OY direction
369      *  \return New GEOM_Object, containing the created coordinate system.
370      */
371     GEOM_Object MakeMarker (in double theOX , in double theOY , in double theOZ,
372                             in double theXDX, in double theXDY, in double theXDZ,
373                             in double theYDX, in double theYDY, in double theYDZ);
374      
375     /*!
376      *  Create a tangent plane to specified face in the point with specified parameters.
377      *  Values of parameters should be between 0. and 1.0
378      *  \param theFace - face for which tangent plane shuold be built. 
379      *  \param theParameterU - value of parameter by U
380      *  \param theParameterV - value of parameter Vthe
381      *  \param theTrimSize - defines sizes of created face
382      *  \return New GEOM_Object, containing the face built on tangent plane.
383      */
384     GEOM_Object MakeTangentPlaneOnFace(in GEOM_Object theFace,
385                                        in double theParameterU,
386                                        in double theParameterV,
387                                        in double theTrimSize);
388   };
389
390   interface GEOM_ITransformOperations : GEOM_IOperations
391   {
392     /*!
393      *  Translate the given object along the vector, specified by its end points.
394      *  \param theObject The object to be translated.
395      *  \param thePoint1 Start point of translation vector.
396      *  \param thePoint2 End point of translation vector.
397      *  \return theObject.
398      */
399     GEOM_Object TranslateTwoPoints (in GEOM_Object theObject,
400                                     in GEOM_Object thePoint1,
401                                     in GEOM_Object thePoint2);
402
403     /*!
404      *  Translate the given object along the vector, specified
405      *  by its end points, creating its copy before the translation.
406      *  \param theObject The object to be translated.
407      *  \param thePoint1 Start point of translation vector.
408      *  \param thePoint2 End point of translation vector.
409      *  \return New GEOM_Object, containing the translated object.
410      */
411     GEOM_Object TranslateTwoPointsCopy (in GEOM_Object theObject,
412                                         in GEOM_Object thePoint1,
413                                         in GEOM_Object thePoint2);
414
415     /*!
416      *  Translate the given object along the vector, specified by its components.
417      *  \param theObject The object to be translated.
418      *  \param theDX,theDY,theDZ Components of translation vector.
419      *  \return theObject.
420      */
421     GEOM_Object TranslateDXDYDZ (in GEOM_Object theObject,
422                                  in double theDX, in double theDY, in double theDZ);
423
424     /*!
425      *  Translate the given object along the vector, specified
426      *  by its components, creating its copy before the translation.
427      *  \param theObject The object to be translated.
428      *  \param theDX,theDY,theDZ Components of translation vector.
429      *  \return New GEOM_Object, containing the translated object.
430      */
431     GEOM_Object TranslateDXDYDZCopy (in GEOM_Object theObject,
432                                      in double theDX, in double theDY, in double theDZ);
433
434
435     /*!
436      *  Translate the given object along the given vector.
437      *  \param theObject The object to be translated.
438      *  \param theVector Translation vector, giving both direction and distance.
439      *  \return theObject.
440      */
441     GEOM_Object TranslateVector (in GEOM_Object theObject,
442                                  in GEOM_Object theVector);
443
444     /*!
445      *  Translate the given object along the given vector,
446      *  creating its copy before the translation.
447      *  \param theObject The object to be translated.
448      *  \param theVector Translation vector, giving both direction and distance.
449      *  \return New GEOM_Object, containing the translated object.
450      */
451     GEOM_Object TranslateVectorCopy (in GEOM_Object theObject,
452                                      in GEOM_Object theVector);
453
454     /*!
455      *  Translate the given object along the given vector a given number times
456      *  \param theObject The object to be translated.
457      *  \param theVector Direction of the translation.
458      *  \param theStep Distance to translate on.
459      *  \param theNbTimes Quantity of translations to be done.
460      *  \return New GEOM_Object, containing compound of all
461      *          the shapes, obtained after each translation.
462      */
463     GEOM_Object MultiTranslate1D (in GEOM_Object theObject,
464                                   in GEOM_Object theVector,
465                                   in double theStep,
466                                   in long theNbTimes);
467
468     /*!
469      *  Conseqently apply two specified translations to theObject specified number of times.
470      *  \param theObject The object to be translated.
471      *  \param theVector1 Direction of the first translation.
472      *  \param theStep1 Step of the first translation.
473      *  \param theNbTimes1 Quantity of translations to be done along theVector1.
474      *  \param theVector2 Direction of the second translation.
475      *  \param theStep2 Step of the second translation.
476      *  \param theNbTimes2 Quantity of translations to be done along theVector2.
477      *  \return New GEOM_Object, containing compound of all
478      *          the shapes, obtained after each translation.
479      */
480     GEOM_Object MultiTranslate2D (in GEOM_Object theObject,
481                                   in GEOM_Object theVector1,
482                                   in double theStep1,
483                                   in long theNbTimes1,
484                                   in GEOM_Object theVector2,
485                                   in double theStep2,
486                                   in long theNbTimes2);
487
488     /*!
489      *  Rotate given object around vector perpendicular to plane containing three points.
490      *  \param theObject The object to be rotated.
491      *  \param theCentPoint central point - the axis is the vector perpendicular to the plane
492      *  containing the three points.
493      *  \param thePoint1 and thePoint2 - in a perpendicular plan of the axis.
494      *  \return theObject.
495      */
496     GEOM_Object RotateThreePoints (in GEOM_Object theObject,
497                                    in GEOM_Object theCentPoint,
498                                    in GEOM_Object thePoint1,
499                                    in GEOM_Object thePoint2);
500
501
502     /*!
503      *  Rotate given object around vector perpendicular to plane containing three points.
504      *  Creating its copy before the rotatation.
505      *  \param theObject The object to be rotated.
506      *  \param theCentPoint central point - the axis is the vector perpendicular to the plane
507      *  containing the three points.
508      *  \param thePoint1 and thePoint2 - in a perpendicular plan of the axis.
509      *  \return New GEOM_Object, containing the rotated object.
510      */
511     GEOM_Object RotateThreePointsCopy (in GEOM_Object theObject,
512                                        in GEOM_Object theCentPoint,
513                                        in GEOM_Object thePoint1,
514                                        in GEOM_Object thePoint2);
515
516     /*!
517      *  Rotate the given object around the given axis on the given angle.
518      *  \param theObject The object to be rotated.
519      *  \param theAxis Rotation axis.
520      *  \param theAngle Rotation angle in radians.
521      *  \return theObject.
522      */
523     GEOM_Object Rotate (in GEOM_Object theObject,
524                         in GEOM_Object theAxis,
525                         in double theAngle);
526
527
528     /*!
529      *  Rotate the given object around the given axis
530      *  on the given angle, creating its copy before the rotatation.
531      *  \param theObject The object to be rotated.
532      *  \param theAxis Rotation axis.
533      *  \param theAngle Rotation angle in radians.
534      *  \return New GEOM_Object, containing the rotated object.
535      */
536     GEOM_Object RotateCopy (in GEOM_Object theObject,
537                             in GEOM_Object theAxis,
538                             in double theAngle);
539
540
541     /*!
542      *  Rotate the given object around the given axis a given number times.
543      *  Rotation angle will be 2*PI/theNbTimes.
544      *  \param theObject The object to be rotated.
545      *  \param theAxis The rotation axis.
546      *  \param theNbTimes Quantity of rotations to be done.
547      *  \return New GEOM_Object, containing compound of all the
548      *          shapes, obtained after each rotation.
549      */
550     GEOM_Object MultiRotate1D (in GEOM_Object theObject,
551                                in GEOM_Object theAxis,
552                                in long theNbTimes);
553
554     /*!
555      *  Rotate the given object around the
556      *  given axis on the given angle a given number
557      *  times and multi-translate each rotation result.
558      *  Translation direction passes through center of gravity
559      *  of rotated shape and its projection on the rotation axis.
560      *  \param theObject The object to be rotated.
561      *  \param theAxis Rotation axis.
562      *  \param theAngle Rotation angle in graduces.
563      *  \param theNbTimes1 Quantity of rotations to be done.
564      *  \param theStep Translation distance.
565      *  \param theNbTimes2 Quantity of translations to be done.
566      *  \return New GEOM_Object, containing compound of all the
567      *          shapes, obtained after each transformation.
568      */
569     GEOM_Object MultiRotate2D (in GEOM_Object theObject,
570                                in GEOM_Object theAxis,
571                                in double theAngle,
572                                in long theNbTimes1,
573                                in double theStep,
574                                in long theNbTimes2);
575
576     /*!
577      *  Replace the given object by an object,
578      *  symmetrical to it relatively the given plane.
579      *  \param theObject The object to be mirrored.
580      *  \param thePlane Plane of symmetry.
581      */
582     GEOM_Object MirrorPlane (in GEOM_Object theObject, in GEOM_Object thePlane);
583
584     /*!
585      *  Create an object, symmetrical
586      *  to the given one relatively the given plane.
587      *  \param theObject The object to be mirrored.
588      *  \param thePlane Plane of symmetry.
589      *  \return New GEOM_Object, containing the mirrored shape.
590      */
591     GEOM_Object MirrorPlaneCopy (in GEOM_Object theObject, in GEOM_Object thePlane);
592
593     /*!
594      *  Replace the given object by an object,
595      *  symmetrical to it relatively the given axis.
596      *  \param theObject The object to be mirrored.
597      *  \param theAxis Axis of symmetry.
598      *  \return theObject.
599      */
600     GEOM_Object MirrorAxis (in GEOM_Object theObject, in GEOM_Object theAxis);
601
602     /*!
603      *  Create an object, symmetrical
604      *  to the given one relatively the given axis.
605      *  \param theObject The object to be mirrored.
606      *  \param theAxis Axis of symmetry.
607      *  \return New GEOM_Object, containing the mirrored object.
608      */
609     GEOM_Object MirrorAxisCopy (in GEOM_Object theObject, in GEOM_Object theAxis);
610
611     /*!
612      *  Replace the given object by an object, symmetrical to it relatively the given point.
613      *  \param theObject The object to be mirrored.
614      *  \param thePoint Point of symmetry.
615      *  \return theObject.
616      */
617     GEOM_Object MirrorPoint (in GEOM_Object theObject, in GEOM_Object thePoint);
618
619     /*!
620      *  Create an object, symmetrical to the given one relatively the given point.
621      *  \param theObject The object to be mirrored.
622      *  \param thePoint Point of symmetry.
623      *  \return New GEOM_Object, containing the mirrored object.
624      */
625     GEOM_Object MirrorPointCopy (in GEOM_Object theObject, in GEOM_Object thePoint);
626
627     /*!
628      *  Replace the given object by its offset.
629      *  \param theObject The base object for the offset.
630      *  \param theOffset Offset value.
631      *  \return theObject.
632      */
633     GEOM_Object OffsetShape (in GEOM_Object theObject, in double theOffset);
634
635     /*!
636      *  Create new object as offset of the given one.
637      *  \param theObject The base object for the offset.
638      *  \param theOffset Offset value.
639      *  \return New GEOM_Object, containing the offset object.
640      */
641     GEOM_Object OffsetShapeCopy (in GEOM_Object theObject, in double theOffset);
642
643     /*!
644      *  Scale the given object by the factor.
645      *  \param theObject The object to be scaled.
646      *  \param thePoint Center point for scaling.
647      *  \param theFactor Scaling factor value.
648      *  \return theObject.
649      */
650     GEOM_Object ScaleShape (in GEOM_Object theObject, in GEOM_Object thePoint,
651                             in double theFactor);
652
653     /*!
654      *  Scale the given object by the factor, creating its copy before the scaling.
655      *  \param theObject The object to be scaled.
656      *  \param thePoint Center point for scaling.
657      *  \param theFactor Scaling factor value.
658      *  \return New GEOM_Object, containing the scaled shape.
659      */
660     GEOM_Object ScaleShapeCopy (in GEOM_Object theObject, in GEOM_Object thePoint,
661                                 in double theFactor);
662
663     /*!
664      *  Modify the Location of the given object by LCS.
665      *  \param theObject The object to be displaced.
666      *  \param theStartLCS Coordinate system to perform displacement from it.
667      *                     If \a theStartLCS is NULL, displacement
668      *                     will be performed from global CS.
669      *                     If \a theObject itself is used as \a theStartLCS,
670      *                     its location will be changed to \a theEndLCS.
671      *  \param theEndLCS Coordinate system to perform displacement to it.
672      *  \return theObject.
673      */
674     GEOM_Object PositionShape (in GEOM_Object theObject,
675                                in GEOM_Object theStartLCS,
676                                in GEOM_Object theEndLCS);
677
678     /*!
679      *  Modify the Location of the given object by LCS,
680      *  creating its copy before the setting.
681      *  \param theObject The object to be displaced.
682      *  \param theStartLCS Coordinate system to perform displacement from it.
683      *                     If \a theStartLCS is NULL, displacement
684      *                     will be performed from global CS.
685      *                     If \a theObject itself is used as \a theStartLCS,
686      *                     its location will be changed to \a theEndLCS.
687      *  \param theEndLCS Coordinate system to perform displacement to it.
688      *  \return New GEOM_Object, containing the displaced shape.
689      */
690     GEOM_Object PositionShapeCopy (in GEOM_Object theObject,
691                                    in GEOM_Object theStartLCS,
692                                    in GEOM_Object theEndLCS);
693   };
694
695   /*!
696    *  GEOM_I3DPrimOperations: Interface for 3D primitives creation
697    *  Box, Cylinder, Cone, Sphere, Prism (extrusion),
698    *  Pipe (extrusion along contour), Revolution, Solid (from shell).
699    */
700   interface GEOM_I3DPrimOperations : GEOM_IOperations
701   {
702     /*!
703      *  Create a box with specified dimensions along the coordinate axes
704      *  and with edges, parallel to the coordinate axes.
705      *  Center of the box will be at point (DX/2, DY/2, DZ/2).
706      *  \param theDX Length of Box edges, parallel to OX axis.
707      *  \param theDY Length of Box edges, parallel to OY axis.
708      *  \param theDZ Length of Box edges, parallel to OZ axis.
709      *  \return New GEOM_Object, containing the created box.
710      */
711     GEOM_Object MakeBoxDXDYDZ (in double theDX, in double theDY, in double theDZ);
712
713     /*!
714      *  Create a box with two specified opposite vertices,
715      *  and with edges, parallel to the coordinate axes
716      *  \param thePnt1 First of two opposite vertices.
717      *  \param thePnt2 Second of two opposite vertices.
718      *  \return New GEOM_Object, containing the created box.
719      */
720     GEOM_Object MakeBoxTwoPnt (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
721
722     /*!
723      *  Create a cylinder with given radius and height at
724      *  the origin of coordinate system. Axis of the cylinder
725      *  will be collinear to the OZ axis of the coordinate system.
726      *  \param theR Cylinder radius.
727      *  \param theH Cylinder height.
728      *  \return New GEOM_Object, containing the created cylinder.
729      */
730     GEOM_Object MakeCylinderRH (in double theR, in double theH);
731
732     /*!
733      *  Create a cylinder with given base point, axis, radius and height.
734      *  \param thePnt Central point of cylinder base.
735      *  \param theAxis Cylinder axis.
736      *  \param theR Cylinder radius.
737      *  \param theH Cylinder height.
738      *  \return New GEOM_Object, containing the created cylinder.
739      */
740     GEOM_Object MakeCylinderPntVecRH (in GEOM_Object thePnt,
741                                       in GEOM_Object theAxis,
742                                       in double      theR,
743                                       in double      theH);
744
745     /*!
746      *  Create a cone with given height and radiuses at
747      *  the origin of coordinate system. Axis of the cone will
748      *  be collinear to the OZ axis of the coordinate system.
749      *  \param theR1 Radius of the first cone base.
750      *  \param theR2 Radius of the second cone base.
751      *    \note If both radiuses are non-zero, the cone will be truncated.
752      *    \note If the radiuses are equal, a cylinder will be created instead.
753      *  \param theH Cone height.
754      *  \return New GEOM_Object, containing the created cone.
755      */
756     GEOM_Object MakeConeR1R2H (in double theR1, in double theR2, in double theH);
757
758     /*!
759      *  Create a cone with given base point, axis, height and radiuses.
760      *  \param thePnt Central point of the first cone base.
761      *  \param theAxis Cone axis.
762      *  \param theR1 Radius of the first cone base.
763      *  \param theR2 Radius of the second cone base.
764      *    \note If both radiuses are non-zero, the cone will be truncated.
765      *    \note If the radiuses are equal, a cylinder will be created instead.
766      *  \param theH Cone height.
767      *  \return New GEOM_Object, containing the created cone.
768      */
769     GEOM_Object MakeConePntVecR1R2H (in GEOM_Object thePnt,
770                                      in GEOM_Object theAxis,
771                                      in double      theR1,
772                                      in double      theR2,
773                                      in double      theH);
774
775     /*!
776      *  Create a torus with given radiuses at the origin of coordinate system.
777      *  \param theRMajor Torus major radius.
778      *  \param theRMinor Torus minor radius.
779      *  \return New GEOM_Object, containing the created torus.
780      */
781     GEOM_Object MakeTorusRR (in double theRMajor,
782                              in double theRMinor);
783
784     /*!
785      *  Create a torus with given center, normal vector and radiuses.
786      *  \param thePnt Torus central point.
787      *  \param theVec Torus axis of symmetry.
788      *  \param theRMajor Torus major radius.
789      *  \param theRMinor Torus minor radius.
790      *  \return New GEOM_Object, containing the created torus.
791      */
792     GEOM_Object MakeTorusPntVecRR (in GEOM_Object thePnt,
793                                    in GEOM_Object theVec,
794                                    in double theRMajor,
795                                    in double theRMinor);
796
797     /*!
798      *  Create a sphere with given radius at the origin of coordinate system.
799      *  \param theR Sphere radius.
800      *  \return New GEOM_Object, containing the created sphere.
801      */
802     GEOM_Object MakeSphereR (in double theR);
803
804     /*!
805      *  Create a sphere with given center and radius.
806      *  \param thePnt Sphere center.
807      *  \param theR Sphere radius.
808      *  \return New GEOM_Object, containing the created .
809      */
810     GEOM_Object MakeSpherePntR (in GEOM_Object thePnt, in double theR);
811
812     /*!
813      *  Create a shape by extrusion of the base shape along the vector,
814      *  i.e. all the space, transfixed by the base shape during its translation
815      *  along the vector on the given distance.
816      *  \param theBase Base shape to be extruded.
817      *  \param theVec Direction of extrusion.
818      *  \param theH Prism dimension along theVec.
819      *  \return New GEOM_Object, containing the created prism.
820      */
821     GEOM_Object MakePrismVecH (in GEOM_Object theBase,
822                                in GEOM_Object theVec,
823                                in double      theH);
824     /*  The Same Prism but in 2 directions (forward&backward) */
825     GEOM_Object MakePrismVecH2Ways (in GEOM_Object theBase,
826                                     in GEOM_Object theVec,
827                                     in double      theH);
828
829     /*!
830      *  Create a shape by extrusion of the base shape along a vector, defined by two points.
831      *  \param theBase Base shape to be extruded.
832      *  \param thePoint1 First end of extrusion vector.
833      *  \param thePoint2 Second end of extrusion vector.
834      *  \return New GEOM_Object, containing the created prism.
835      */
836     GEOM_Object MakePrismTwoPnt (in GEOM_Object theBase,
837                                  in GEOM_Object thePoint1,
838                                  in GEOM_Object thePoint2);
839     /*  The same prism but in two directions forward&backward */
840     GEOM_Object MakePrismTwoPnt2Ways (in GEOM_Object theBase,
841                                       in GEOM_Object thePoint1,
842                                       in GEOM_Object thePoint2);
843
844     /*!
845      *  Create a shape by extrusion of the base shape along
846      *  the path shape. The path shape can be a wire or an edge.
847      *  \param theBase Base shape to be extruded.
848      *  \param thePath Path shape to extrude the base shape along it.
849      *  \return New GEOM_Object, containing the created pipe.
850      */
851     GEOM_Object MakePipe (in GEOM_Object theBase, in GEOM_Object thePath);
852
853     /*!
854      *  Create a shape by revolution of the base shape around the axis
855      *  on the given angle, i.e. all the space, transfixed by the base
856      *  shape during its rotation around the axis on the given angle.
857      *  \param theBase Base shape to be rotated.
858      *  \param theAxis Rotation axis.
859      *  \param theAngle Rotation angle in radians.
860      *  \return New GEOM_Object, containing the created revolution.
861      */
862     GEOM_Object MakeRevolutionAxisAngle (in GEOM_Object theBase,
863                                          in GEOM_Object theAxis,
864                                          in double theAngle);
865     /*  The Same Revolution but in both ways forward&backward */
866     GEOM_Object MakeRevolutionAxisAngle2Ways (in GEOM_Object theBase,
867                                               in GEOM_Object theAxis,
868                                               in double theAngle);
869
870     /*!
871      *  Create a filling from the given compound of contours.
872      *  \param theMinDeg a minimal degree
873      *  \param theMaxDeg a maximal degree
874      *  \param theTol2D a 2d tolerance
875      *  \param theTol3D a 3d tolerance
876      *  \param theNbIter a number of iteration
877      *  \return New GEOM_Object, containing the created filling surface.
878      */
879     GEOM_Object MakeFilling (in GEOM_Object theShape,
880                              in long theMinDeg, in long theMaxDeg,
881                              in double theTol2D, in double theTol3D,
882                              in long theNbIter);
883
884     /*!
885      *  Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
886      *  \param theSeqSections - set of specified sections.
887      *  \param theModeSolid - mode defining building solid or shell
888      *  \param thePreci - precision 3D used for smoothing by default 1.e-6
889      *  \param theRuled - mode defining type of the result surfaces (ruled or smoothed).
890      *  \return New GEOM_Object, containing the created shell or solid.
891      */
892     GEOM_Object MakeThruSections(in ListOfGO theSeqSections,
893                                  in boolean theModeSolid,
894                                  in double thePreci,
895                                  in boolean theRuled);
896
897       /*!
898      *  Create a shape by extrusion of the profile shape along
899      *  the path shape. The path shape can be a wire or an edge.
900      *  the several profiles can be specified in the several locations of path. 
901      *  \param theSeqBases - list of  Bases shape to be extruded.
902      *  \param theLocations - list of locations on the path corresponding
903      *                        specified list of the Bases shapes. Number of locations
904      *                        should be equal to number of bases or list of locations can be empty.
905      *  \param thePath - Path shape to extrude the base shape along it.
906      *  \param theWithContact - the mode defining that the section is translated to be in
907      *                          contact with the spine.
908      *  \param - WithCorrection - defining that the section is rotated to be
909      *                           orthogonal to the spine tangent in the correspondent point
910      *  \return New GEOM_Object, containing the created pipe.
911      */
912     GEOM_Object MakePipeWithDifferentSections (in ListOfGO theSeqBases,
913                                                in ListOfGO theLocations,
914                                                in GEOM_Object thePath,
915                                                in boolean theWithContact ,
916                                                in boolean theWithCorrection );
917     
918     /*!
919      *  Create a shape by extrusion of the profile shape along
920      *  the path shape. The path shape can be a shell or a face.
921      *  the several profiles can be specified in the several locations of path. 
922      *  \param theSeqBases - list of  Bases shape to be extruded.
923      *  \param theSeqSubBases - list of corresponding subshapes of section shapes.
924      *  \param theLocations - list of locations on the path corresponding
925      *                        specified list of the Bases shapes. Number of locations
926      *                        should be equal to number of bases.
927      *  \param thePath - Path shape to extrude the base shape along it.
928      *  \param theWithContact - the mode defining that the section is translated to be in
929      *                          contact with the spine.
930      *  \param - WithCorrection - defining that the section is rotated to be
931      *                           orthogonal to the spine tangent in the correspondent point
932      *  \return New GEOM_Object, containing the created pipe.
933      */
934     GEOM_Object MakePipeWithShellSections (in ListOfGO theSeqBases,
935                                            in ListOfGO theSeqSubBases,
936                                            in ListOfGO theLocations,
937                                            in GEOM_Object thePath,
938                                            in boolean theWithContact ,
939                                            in boolean theWithCorrection );
940
941     /*!
942      * Create solids between given sections
943      *  \param theSeqBases - list of sections (shell or face).
944      *  \param theLocations - list of corresponding vertexes
945      *  \return New GEOM_Object, containing the created solids.
946      */
947     GEOM_Object MakePipeShellsWithoutPath (in ListOfGO theSeqBases,
948                                            in ListOfGO theLocations);
949   };
950
951   /*!
952    *  GEOM_IShapesOperations: Interface for Shapes creation:
953    *  Edge from two points, Wire from edges, Face from wire,
954    *  Shell from faces, Solid from shells, Compound from shapes
955    */
956   interface GEOM_IShapesOperations : GEOM_IOperations
957   {
958     /*!
959      *  Create a linear edge with specified ends.
960      *  \param thePnt1 Point for the first end of edge.
961      *  \param thePnt2 Point for the second end of edge.
962      *  \return New GEOM_Object, containing the created edge.
963      */
964     GEOM_Object MakeEdge (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
965
966     /*!
967      *  Create a wire from the set of edges and wires.
968      *  \param theEdgesAndWires List of edge and/or wires.
969      *  \return New GEOM_Object, containing the created wire.
970      */
971     GEOM_Object MakeWire (in ListOfGO theEdgesAndWires);
972
973     /*!
974      *  Create a face on the given wire.
975      *  \param theWire closed Wire or Edge to build the face on.
976      *  \param isPlanarWanted If TRUE, only planar face will be built.
977      *                        If impossible, NULL object will be returned.
978      *  \return New GEOM_Object, containing the created face.
979      */
980     GEOM_Object MakeFace (in GEOM_Object theWire, in boolean isPlanarWanted);
981
982     /*!
983      *  Create a face on the given wires set.
984      *  \param theWires List of closed wires or edges to build the face on.
985      *  \param isPlanarWanted If TRUE, only planar face will be built.
986      *                        If impossible, NULL object will be returned.
987      *  \return New GEOM_Object, containing the created face.
988      */
989     GEOM_Object MakeFaceWires (in ListOfGO theWires, in boolean isPlanarWanted);
990
991     /*!
992      *  Create a shell from the set of faces and shells.
993      *  \param theFacesAndShells List of faces and/or shells.
994      *  \return New GEOM_Object, containing the created shell.
995      */
996     GEOM_Object MakeShell (in ListOfGO theFacesAndShells);
997
998     /*!
999      *  Create a solid, bounded by the given shell.
1000      *  \param theShell Bounding shell.
1001      *  \return New GEOM_Object, containing the created solid.
1002      */
1003     GEOM_Object MakeSolidShell (in GEOM_Object theShell);
1004
1005     /*!
1006      *  Create a solid, bounded by the given shells.
1007      *  \param theShells Bounding shells.
1008      *  \return New GEOM_Object, containing the created solid.
1009      */
1010     GEOM_Object MakeSolidShells (in ListOfGO theShells);
1011
1012     /*!
1013      *  Create a compound of the given shapes.
1014      *  \param theShapes List of shapes to put in compound.
1015      *  \return New GEOM_Object, containing the created compound.
1016      */
1017     GEOM_Object MakeCompound (in ListOfGO theShapes);
1018
1019     /*!
1020      *  Replace coincident faces in theShape by one face.
1021      *  \param theShape Initial shape.
1022      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
1023      *  \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
1024      *  \return New GEOM_Object, containing a copy of theShape without coincident faces.
1025      */
1026     GEOM_Object MakeGlueFaces (in GEOM_Object theShape, in double theTolerance, in boolean doKeepNonSolids);
1027
1028     /*!
1029      *  Find coincident faces in theShape for possible gluing.
1030      *  \param theShape Initial shape.
1031      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
1032      *  \return ListOfGO
1033      */
1034     ListOfGO GetGlueFaces (in GEOM_Object theShape, in double theTolerance);
1035
1036     /*!
1037      *  Replace coincident faces in theShape by one face
1038      *  in compliance with given list of faces
1039      *  \param theShape Initial shape.
1040      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
1041      *  \param theFaces List of faces for gluing.
1042      *  \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
1043      *  \return New GEOM_Object, containing a copy of theShape without some faces.
1044      */
1045     GEOM_Object MakeGlueFacesByList (in GEOM_Object theShape, in double theTolerance,
1046                                      in ListOfGO theFaces, in boolean doKeepNonSolids);
1047
1048     /*!
1049      *  Explode a shape on subshapes of a given type.
1050      *  \param theShape Shape to be exploded.
1051      *  \param theShapeType Type of sub-shapes to be retrieved.
1052      *  \param isSorted If this parameter is TRUE, sub-shapes will be
1053      *                  sorted by coordinates of their gravity centers.
1054      *  \return List of sub-shapes of type theShapeType, contained in theShape.
1055      */
1056     ListOfGO MakeExplode (in GEOM_Object theShape,
1057                           in long        theShapeType,
1058                           in boolean     isSorted);
1059
1060     /*!
1061      *  Explode a shape on subshapes of a given type.
1062      *  Does the same, as the above method, but returns IDs of sub-shapes,
1063      *  not GEOM_Objects. It works faster.
1064      *  \param theShape Shape to be exploded.
1065      *  \param theShapeType Type of sub-shapes to be retrieved.
1066      *  \param isSorted If this parameter is TRUE, sub-shapes will be
1067      *                  sorted by coordinates of their gravity centers.
1068      *  \return List of IDs of sub-shapes of type theShapeType, contained in theShape.
1069      */
1070     ListOfLong SubShapeAllIDs (in GEOM_Object theShape,
1071                                in long        theShapeType,
1072                                in boolean     isSorted);
1073
1074     /*!
1075      *  Get a sub shape defined by its unique ID inside \a theMainShape
1076      *  \note The sub shape GEOM_Objects can has ONLY ONE function.
1077      *        Don't try to apply modification operations on them.
1078      */
1079     GEOM_Object GetSubShape (in GEOM_Object theMainShape,
1080                              in long        theID);
1081
1082     /*!
1083      *  Get global index of \a theSubShape in \a theMainShape.
1084      *  \param theMainShape Main shape.
1085      *  \param theSubShape Sub-shape of the main shape.
1086      *  \return global index of \a theSubShape in \a theMainShape.
1087      */
1088     long GetSubShapeIndex (in GEOM_Object theMainShape, in GEOM_Object theSubShape);
1089
1090     /*!
1091      *  Get index of \a theSubShape in \a theMainShape, unique among sub-shapes of the same type.
1092      *  Together with method <VAR>GetShapeTypeString()</VAR> it can be used
1093      *  to generate automatic names for sub-shapes, when publishing them in a study.
1094      *  \param theMainShape Main shape.
1095      *  \param theSubShape Sub-shape of the main shape.
1096      *  \return index of \a theSubShape in a list of all sub-shapes of \a theMainShape of the same type.
1097      */
1098     long GetTopologyIndex (in GEOM_Object theMainShape, in GEOM_Object theSubShape);
1099
1100     /*!
1101      *  \brief Get name of type of \a theShape.
1102      *
1103      *  Use wide type notation, taking into consideration both topology and geometry of the shape.
1104      *  Together with method <VAR>GetTopologyIndex()</VAR> it can be used
1105      *  to generate automatic names for sub-shapes, when publishing them in a study.
1106      *  \param theShape The shape to get a type of.
1107      *  \return String, containing a type name of \a theShape.
1108      */
1109     string GetShapeTypeString (in GEOM_Object theShape);
1110
1111     /*!
1112      *  Count number of faces in the given shape.
1113      *  \param theShape Shape to count faces in.
1114      *  \return Number of faces in the given shape.
1115      */
1116     long NumberOfFaces (in GEOM_Object theShape);
1117
1118     /*!
1119      *  Count number of edges in the given shape.
1120      *  \param theShape Shape to count edges in.
1121      *  \return Number of edges in theShape.
1122      */
1123     long NumberOfEdges (in GEOM_Object theShape);
1124
1125     /*!
1126      *  Reverses an orientation the given shape.
1127      *  \param theShape Shape to be reversed.
1128      *  \return The reversed copy of theShape.
1129      */
1130     GEOM_Object ChangeOrientation (in GEOM_Object theShape);
1131
1132     /*!
1133      *  Retrieve all free faces from the given shape.
1134      *  Free face is a face, which is not shared between two shells of the shape.
1135      *  \param theShape Shape to find free faces in.
1136      *  \return List of IDs of all free faces, contained in theShape.
1137      */
1138     ListOfLong GetFreeFacesIDs (in GEOM_Object theShape);
1139
1140     /*!
1141      *  Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1142      *  \param theShape1 Shape to find sub-shapes in.
1143      *  \param theShape2 Shape to find shared sub-shapes with.
1144      *  \param theShapeType Type of sub-shapes to be retrieved.
1145      *  \return List of sub-shapes of theShape1, shared with theShape2.
1146      */
1147     ListOfGO GetSharedShapes (in GEOM_Object theShape1,
1148                               in GEOM_Object theShape2,
1149                               in long        theShapeType);
1150
1151     /*!
1152      *  Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1153      *  the specified plane by the certain way, defined through \a theState parameter.
1154      *  \param theShape Shape to find sub-shapes of.
1155      *  \param theShapeType Type of sub-shapes to be retrieved.
1156      *  \param theAx1 Vector (or line, or linear edge), specifying normal
1157      *                direction and location of the plane to find shapes on.
1158      *  \param theState The state of the subshapes to find.
1159      *  \return List of all found sub-shapes.
1160      */
1161     ListOfGO GetShapesOnPlane (in GEOM_Object theShape,
1162                                in long        theShapeType,
1163                                in GEOM_Object theAx1,
1164                                in shape_state theState);
1165     /*!
1166      *  Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1167      *  the specified plane by the certain way, defined through \a theState parameter.
1168      *  \param theShape Shape to find sub-shapes of.
1169      *  \param theShapeType Type of sub-shapes to be retrieved.
1170      *  \param theAx1 Vector (or line, or linear edge), specifying normal
1171      *                direction of the plane to find shapes on.
1172      *  \param thePnt Point specifying location of the plane to find shapes on.
1173      *  \param theState The state of the subshapes to find.
1174      *  \return List of all found sub-shapes.
1175      */
1176     ListOfGO GetShapesOnPlaneWithLocation (in GEOM_Object theShape,
1177                                            in long        theShapeType,
1178                                            in GEOM_Object theAx1,
1179                                            in GEOM_Object thePnt,
1180                                            in shape_state theState);
1181
1182
1183
1184     /*!
1185      *  Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1186      *  the specified cylinder by the certain way, defined through \a theState parameter.
1187      *  \param theShape Shape to find sub-shapes of.
1188      *  \param theShapeType Type of sub-shapes to be retrieved.
1189      *  \param theAxis Vector (or line, or linear edge), specifying
1190      *                 axis of the cylinder to find shapes on.
1191      *  \param theRadius Radius of the cylinder to find shapes on.
1192      *  \param theState The state of the subshapes to find.
1193      *  \return List of all found sub-shapes.
1194      */
1195     ListOfGO GetShapesOnCylinder (in GEOM_Object theShape,
1196                                   in long        theShapeType,
1197                                   in GEOM_Object theAxis,
1198                                   in double      theRadius,
1199                                   in shape_state theState);
1200
1201     /*!
1202      *  Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1203      *  the specified sphere by the certain way, defined through \a theState parameter.
1204      *  \param theShape Shape to find sub-shapes of.
1205      *  \param theShapeType Type of sub-shapes to be retrieved.
1206      *  \param theCenter Point, specifying center of the sphere to find shapes on.
1207      *  \param theRadius Radius of the sphere to find shapes on.
1208      *  \param theState The state of the subshapes to find.
1209      *  \return List of all found sub-shapes.
1210      */
1211     ListOfGO GetShapesOnSphere (in GEOM_Object theShape,
1212                                 in long        theShapeType,
1213                                 in GEOM_Object theCenter,
1214                                 in double      theRadius,
1215                                 in shape_state theState);
1216
1217     /*!
1218      *  Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1219      *  the specified quadrangle by the certain way, defined through \a theState parameter.
1220      *  \param theShape Shape to find sub-shapes of.
1221      *  \param theShapeType Type of sub-shapes to be retrieved.
1222      *  \param theTopLeftPoint Top left quadrangle corner
1223      *  \param theTopRigthPoint Top right quadrangle corner
1224      *  \param theBottomLeftPoint Bottom left quadrangle corner
1225      *  \param theBottomRigthPoint Bottom right quadrangle corner
1226      *  \param theState The state of the subshapes to find.
1227      *  \return List of all found sub-shapes.
1228      */
1229     ListOfGO GetShapesOnQuadrangle (in GEOM_Object theShape,
1230                                     in long        theShapeType,
1231                                     in GEOM_Object theTopLeftPoint,
1232                                     in GEOM_Object theTopRigthPoint,
1233                                     in GEOM_Object theBottomLeftPoint,
1234                                     in GEOM_Object theBottomRigthPoint,
1235                                     in shape_state theState);
1236
1237     /*!
1238      *  Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1239      *  the specified plane by the certain way, defined through \a theState parameter.
1240      *  \param theShape Shape to find sub-shapes of.
1241      *  \param theShapeType Type of sub-shapes to be retrieved.
1242      *  \param theAx1 Vector (or line, or linear edge), specifying normal
1243      *                direction and location of the plane to find shapes on.
1244      *  \param theState The state of the subshapes to find.
1245      *  \return List of IDs of all found sub-shapes.
1246      */
1247     ListOfLong GetShapesOnPlaneIDs (in GEOM_Object theShape,
1248                                     in long        theShapeType,
1249                                     in GEOM_Object theAx1,
1250                                     in shape_state theState);
1251                                     
1252     /*!
1253      *  Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1254      *  the specified plane by the certain way, defined through \a theState parameter.
1255      *  \param theShape Shape to find sub-shapes of.
1256      *  \param theShapeType Type of sub-shapes to be retrieved.
1257      *  \param theAx1 Vector (or line, or linear edge), specifying normal
1258      *                direction of the plane to find shapes on.
1259      *  \param thePnt Point specifying location of the plane to find shapes on.     
1260      *  \param theState The state of the subshapes to find.
1261      *  \return List of IDs of all found sub-shapes.
1262      */
1263     ListOfLong GetShapesOnPlaneWithLocationIDs (in GEOM_Object theShape,
1264                                                 in long        theShapeType,
1265                                                 in GEOM_Object theAx1,
1266                                                 in GEOM_Object thePnt,
1267                                                 in shape_state theState);
1268
1269     /*!
1270      *  Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1271      *  the specified cylinder by the certain way, defined through \a theState parameter.
1272      *  \param theShape Shape to find sub-shapes of.
1273      *  \param theShapeType Type of sub-shapes to be retrieved.
1274      *  \param theAxis Vector (or line, or linear edge), specifying
1275      *                 axis of the cylinder to find shapes on.
1276      *  \param theRadius Radius of the cylinder to find shapes on.
1277      *  \param theState The state of the subshapes to find.
1278      *  \return List of IDs of all found sub-shapes.
1279      */
1280     ListOfLong GetShapesOnCylinderIDs (in GEOM_Object theShape,
1281                                        in long        theShapeType,
1282                                        in GEOM_Object theAxis,
1283                                        in double      theRadius,
1284                                        in shape_state theState);
1285
1286     /*!
1287      *  Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1288      *  the specified sphere by the certain way, defined through \a theState parameter.
1289      *  \param theShape Shape to find sub-shapes of.
1290      *  \param theShapeType Type of sub-shapes to be retrieved.
1291      *  \param theCenter Point, specifying center of the sphere to find shapes on.
1292      *  \param theRadius Radius of the sphere to find shapes on.
1293      *  \param theState The state of the subshapes to find.
1294      *  \return List of IDs of all found sub-shapes.
1295      */
1296     ListOfLong GetShapesOnSphereIDs (in GEOM_Object theShape,
1297                                      in long        theShapeType,
1298                                      in GEOM_Object theCenter,
1299                                      in double      theRadius,
1300                                      in shape_state theState);
1301
1302     /*!
1303      *  Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1304      *  the specified quadrangle by the certain way, defined through \a theState parameter.
1305      *  \param theShape Shape to find sub-shapes of.
1306      *  \param theShapeType Type of sub-shapes to be retrieved.
1307      *  \param theTopLeftPoint Top left quadrangle corner
1308      *  \param theTopRigthPoint Top right quadrangle corner
1309      *  \param theBottomLeftPoint Bottom left quadrangle corner
1310      *  \param theBottomRigthPoint Bottom right quadrangle corner
1311      *  \param theState The state of the subshapes to find.
1312      *  \return List of IDs of all found sub-shapes.
1313      */
1314     ListOfLong GetShapesOnQuadrangleIDs (in GEOM_Object theShape,
1315                                          in long        theShapeType,
1316                                          in GEOM_Object theTopLeftPoint,
1317                                          in GEOM_Object theTopRigthPoint,
1318                                          in GEOM_Object theBottomLeftPoint,
1319                                          in GEOM_Object theBottomRigthPoint,
1320                                          in shape_state theState);
1321
1322     /*!
1323      * \brief Find subshapes complying with given status
1324      * \param theBox - the box to check state of subshapes against
1325      * \param theShape - the shape to explore
1326      * \param theShapeType - type of subshape of theShape
1327      * \param theState - required state
1328      * \return List of IDs of all found sub-shapes.
1329      */
1330     ListOfLong GetShapesOnBoxIDs (in GEOM_Object theBox,
1331                                   in GEOM_Object theShape,
1332                                   in long        theShapeType,
1333                                   in shape_state theState);
1334
1335     /*!
1336      * \brief Find subshapes complying with given status
1337      * \param theBox - the box to check state of subshapes against
1338      * \param theShape - the shape to explore
1339      * \param theShapeType - type of subshape of theShape
1340      * \param theState - required state
1341      * \return List of all found sub-shapes.
1342      */
1343     ListOfGO GetShapesOnBox (in GEOM_Object theBox,
1344                              in GEOM_Object theShape,
1345                              in long        theShapeType,
1346                              in shape_state theState);
1347
1348     /*!
1349      *  Get sub-shape(s) of \a theShapeWhere, which are
1350      *  coincident with \a theShapeWhat or could be a part of it.
1351      *  \param theShapeWhere Shape to find sub-shapes of.
1352      *  \param theShapeWhat Shape, specifying what to find.
1353      *  \return Group of all found sub-shapes or a single found sub-shape.
1354      */
1355     GEOM_Object GetInPlace (in GEOM_Object theShapeWhere,
1356                             in GEOM_Object theShapeWhat);
1357
1358     /*!
1359      *  Get sub-shape(s) of \a theShapeWhere, which are
1360      *  coincident with \a theShapeWhat or could be a part of it.
1361      *
1362      *  Implementation of this method is based on a saved history of an operation,
1363      *  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1364      *  arguments (an argument shape or a sub-shape of an argument shape).
1365      *  The operation could be the Partition or one of boolean operations,
1366      *  performed on simple shapes (not on compounds).
1367      *
1368      *  \param theShapeWhere Shape to find sub-shapes of.
1369      *  \param theShapeWhat Shape, specifying what to find.
1370      *  \return Group of all found sub-shapes or a single found sub-shape.
1371      */
1372     GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere,
1373                                      in GEOM_Object theShapeWhat);
1374
1375     /*!
1376      *  Get sub-shape of theShapeWhere, which are
1377      *  coincident with \a theShapeWhat that can either SOLID, FACE, EDGE or VERTEX.
1378      *  \param theShapeWhere Shape to find sub-shapes of.
1379      *  \param theShapeWhat Shape, specifying what to find.
1380      *  \return found sub-shape.
1381      */
1382     GEOM_Object GetSame (in GEOM_Object theShapeWhere,
1383                          in GEOM_Object theShapeWhat);
1384   };
1385
1386   /*!
1387    *  GEOM_IBlocksOperations: Interface for Blocks construction
1388    *  Face from points or edges, Block from faces,
1389    *  Blocks multi-translation and multi-rotation
1390    */
1391   interface GEOM_IBlocksOperations : GEOM_IOperations
1392   {
1393     /*!
1394      *  Creation of blocks
1395      */
1396
1397     /*!
1398      *  Create a quadrangle face from four edges. Order of Edges is not
1399      *  important. It is  not necessary that edges share the same vertex.
1400      *  \param theEdge1,theEdge2,theEdge3,theEdge4 Edges for the face bound.
1401      *  \return New GEOM_Object, containing the created face.
1402      */
1403     GEOM_Object MakeQuad (in GEOM_Object theEdge1,
1404                           in GEOM_Object theEdge2,
1405                           in GEOM_Object theEdge3,
1406                           in GEOM_Object theEdge4);
1407
1408     /*!
1409      *  Create a quadrangle face on two edges.
1410      *  The missing edges will be built by creating the shortest ones.
1411      *  \param theEdge1,theEdge2 Two opposite edges for the face.
1412      *  \return New GEOM_Object, containing the created face.
1413      */
1414     GEOM_Object MakeQuad2Edges (in GEOM_Object theEdge1,
1415                                 in GEOM_Object theEdge2);
1416
1417     /*!
1418      *  Create a quadrangle face with specified corners.
1419      *  The missing edges will be built by creating the shortest ones.
1420      *  \param thePnt1,thePnt2,thePnt3,thePnt4 Corner vertices for the face.
1421      *  \return New GEOM_Object, containing the created face.
1422      */
1423     GEOM_Object MakeQuad4Vertices (in GEOM_Object thePnt1,
1424                                    in GEOM_Object thePnt2,
1425                                    in GEOM_Object thePnt3,
1426                                    in GEOM_Object thePnt4);
1427
1428     /*!
1429      *  Create a hexahedral solid, bounded by the six given faces. Order of
1430      *  faces is not important. It is  not necessary that Faces share the same edge.
1431      *  \param theFace1-theFace6 Faces for the hexahedral solid.
1432      *  \return New GEOM_Object, containing the created solid.
1433      */
1434     GEOM_Object MakeHexa (in GEOM_Object theFace1,
1435                           in GEOM_Object theFace2,
1436                           in GEOM_Object theFace3,
1437                           in GEOM_Object theFace4,
1438                           in GEOM_Object theFace5,
1439                           in GEOM_Object theFace6);
1440
1441     /*!
1442      *  Create a hexahedral solid between two given faces.
1443      *  The missing faces will be built by creating the smallest ones.
1444      *  \param theFace1,theFace2 Two opposite faces for the hexahedral solid.
1445      *  \return New GEOM_Object, containing the created solid.
1446      */
1447     GEOM_Object MakeHexa2Faces (in GEOM_Object theFace1,
1448                                 in GEOM_Object theFace2);
1449
1450     /*!
1451      *  Extract elements of blocks and blocks compounds
1452      */
1453
1454     /*!
1455      *  Get a vertex, found in the given shape by its coordinates.
1456      *  \param theShape Block or a compound of blocks.
1457      *  \param theX,theY,theZ Coordinates of the sought vertex.
1458      *  \param theEpsilon Maximum allowed distance between the resulting
1459      *                    vertex and point with the given coordinates.
1460      *  \return New GEOM_Object, containing the found vertex.
1461      */
1462     GEOM_Object GetPoint (in GEOM_Object theShape,
1463                           in double      theX,
1464                           in double      theY,
1465                           in double      theZ,
1466                           in double      theEpsilon);
1467
1468     /*!
1469      *  Get an edge, found in the given shape by two given vertices.
1470      *  \param theShape Block or a compound of blocks.
1471      *  \param thePoint1,thePoint2 Points, close to the ends of the desired edge.
1472      *  \return New GEOM_Object, containing the found edge.
1473      */
1474     GEOM_Object GetEdge (in GEOM_Object theShape,
1475                          in GEOM_Object thePoint1,
1476                          in GEOM_Object thePoint2);
1477
1478     /*!
1479      *  Find an edge of the given shape, which has minimal distance to the given point.
1480      *  \param theShape Block or a compound of blocks.
1481      *  \param thePoint Point, close to the desired edge.
1482      *  \return New GEOM_Object, containing the found edge.
1483      */
1484     GEOM_Object GetEdgeNearPoint (in GEOM_Object theShape,
1485                                   in GEOM_Object thePoint);
1486
1487     /*!
1488      *  Returns a face, found in the given shape by four given corner vertices.
1489      *  \param theShape Block or a compound of blocks.
1490      *  \param thePoint1-thePoint4 Points, close to the corners of the desired face.
1491      *  \return New GEOM_Object, containing the found face.
1492      */
1493     GEOM_Object GetFaceByPoints (in GEOM_Object theShape,
1494                                  in GEOM_Object thePoint1,
1495                                  in GEOM_Object thePoint2,
1496                                  in GEOM_Object thePoint3,
1497                                  in GEOM_Object thePoint4);
1498
1499     /*!
1500      *  Get a face of block, found in the given shape by two given edges.
1501      *  \param theShape Block or a compound of blocks.
1502      *  \param theEdge1,theEdge2 Edges, close to the edges of the desired face.
1503      *  \return New GEOM_Object, containing the found face.
1504      */
1505     GEOM_Object GetFaceByEdges (in GEOM_Object theShape,
1506                                 in GEOM_Object theEdge1,
1507                                 in GEOM_Object theEdge2);
1508
1509     /*!
1510      *  Find a face, opposite to the given one in the given block.
1511      *  \param theBlock Must be a hexahedral solid.
1512      *  \param theFace Face of \a theBlock, opposite to the desired face.
1513      *  \return New GEOM_Object, containing the found face.
1514      */
1515     GEOM_Object GetOppositeFace (in GEOM_Object theBlock,
1516                                  in GEOM_Object theFace);
1517
1518     /*!
1519      *  Find a face of the given shape, which has minimal distance to the given point.
1520      *  \param theShape Block or a compound of blocks.
1521      *  \param thePoint Point, close to the desired face.
1522      *  \return New GEOM_Object, containing the found face.
1523      */
1524     GEOM_Object GetFaceNearPoint (in GEOM_Object theShape,
1525                                   in GEOM_Object thePoint);
1526
1527     /*!
1528      *  Find a face of block, whose outside normale has minimal angle with the given vector.
1529      *  \param theShape Block or a compound of blocks.
1530      *  \param theVector Vector, close to the normale of the desired face.
1531      *  \return New GEOM_Object, containing the found face.
1532      */
1533     GEOM_Object GetFaceByNormale (in GEOM_Object theBlock,
1534                                   in GEOM_Object theVector);
1535
1536     /*!
1537      *  Extract blocks from blocks compounds
1538      */
1539
1540     /*!
1541      *  Check, if the compound contains only specified blocks.
1542      *  \param theCompound The compound to check.
1543      *  \param theMinNbFaces If solid has lower number of faces, it is not a block.
1544      *  \param theMaxNbFaces If solid has higher number of faces, it is not a block.
1545      *    \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
1546      *  \return TRUE, if the given compound contains only blocks.
1547      *  \return theNbBlocks Number of specified blocks in theCompound.
1548      */
1549     boolean IsCompoundOfBlocks (in GEOM_Object theCompound,
1550                                 in long        theMinNbFaces,
1551                                 in long        theMaxNbFaces,
1552                                 out long       theNbBlocks);
1553
1554     /*!
1555      *  Enumeration of Blocks Compound defects.
1556      */
1557     enum BCErrorType
1558     {
1559       /* Each element of the compound should be a Block */
1560       NOT_BLOCK,
1561
1562       /* An element is a potential block, but has degenerated and/or seam edge(s). */
1563       EXTRA_EDGE,
1564
1565       /* A connection between two Blocks should be an entire face or an entire edge */
1566       INVALID_CONNECTION,
1567
1568       /* The compound should be connexe */
1569       NOT_CONNECTED,
1570
1571       /* The glue between two quadrangle faces should be applied */
1572       NOT_GLUED
1573     };
1574
1575     /*!
1576      *  Description of Blocks Compound defect: type and incriminated sub-shapes.
1577      */
1578     struct BCError
1579     {
1580       BCErrorType error;
1581       ListOfLong  incriminated;
1582     };
1583
1584     /*!
1585      *  Sequence of all Blocks Compound defects.
1586      */
1587     typedef sequence<BCError> BCErrors;
1588
1589     /*!
1590      *  Check, if the compound of blocks is given.
1591      *  To be considered as a compound of blocks, the
1592      *  given shape must satisfy the following conditions:
1593      *  - Each element of the compound should be a Block (6 faces and 12 edges).
1594      *  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
1595      *  - The compound should be connexe.
1596      *  - The glue between two quadrangle faces should be applied.
1597      *    \note Single block is also accepted as a valid compound of blocks.
1598      *  \param theCompound The compound to check.
1599      *  \return TRUE, if the given shape is a compound of blocks.
1600      *  \return theErrors Structure, containing discovered errors and incriminated sub-shapes.
1601      */
1602     boolean CheckCompoundOfBlocks (in GEOM_Object theCompound,
1603                                    out BCErrors   theErrors);
1604
1605     /*!
1606      *  Convert sequence of Blocks Compound errors, returned by
1607      *  <VAR>CheckCompoundOfBlocks()</VAR>, into string.
1608      *  \param theCompound The bad compound.
1609      *  \param theErrors The sequence of \a theCompound errors.
1610      *  \return String, describing all the errors in form, suitable for printing.
1611      */
1612     string PrintBCErrors (in GEOM_Object theCompound,
1613                           in BCErrors    theErrors);
1614
1615     /*!
1616      *  Remove all seam and degenerated edges from \a theShape.
1617      *  Unite faces and edges, sharing one surface.
1618      *  \param theShape The compound or single solid to remove irregular edges from.
1619      *  \return Improved shape.
1620      */
1621     GEOM_Object RemoveExtraEdges (in GEOM_Object theShape);
1622
1623     /*!
1624      *  Check, if the given shape is a blocks compound.
1625      *  Fix all detected errors.
1626      *    \note Single block can be also fixed by this method.
1627      *  \param theCompound The compound to check and improve.
1628      *  \return Improved compound.
1629      */
1630     GEOM_Object CheckAndImprove (in GEOM_Object theCompound);
1631
1632     /*!
1633      *  Get all the blocks, contained in the given compound.
1634      *  \param theCompound The compound to explode.
1635      *  \param theMinNbFaces If solid has lower number of faces, it is not a block.
1636      *  \param theMaxNbFaces If solid has higher number of faces, it is not a block.
1637      *    \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
1638      *  \return List of GEOM_Objects, containing the retrieved blocks.
1639      */
1640     ListOfGO ExplodeCompoundOfBlocks (in GEOM_Object theCompound,
1641                                       in long        theMinNbFaces,
1642                                       in long        theMaxNbFaces);
1643
1644     /*!
1645      *  Find block, containing the given point inside its volume or on boundary.
1646      *  \param theCompound Compound, to find block in.
1647      *  \param thePoint Point, close to the desired block. If the point lays on
1648      *         boundary between some blocks, we return block with nearest center.
1649      *  \return New GEOM_Object, containing the found block.
1650      */
1651     GEOM_Object GetBlockNearPoint (in GEOM_Object theCompound,
1652                                    in GEOM_Object thePoint);
1653
1654     /*!
1655      *  Find block, containing all the elements, passed as the parts, or maximum quantity of them.
1656      *  \param theCompound Compound, to find block in.
1657      *  \param theParts List of faces and/or edges and/or vertices to be parts of the found block.
1658      *  \return New GEOM_Object, containing the found block.
1659      */
1660     GEOM_Object GetBlockByParts (in GEOM_Object theCompound,
1661                                  in ListOfGO    theParts);
1662
1663     /*!
1664      *  Return all blocks, containing all the elements, passed as the parts.
1665      *  \param theCompound Compound, to find blocks in.
1666      *  \param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
1667      *  \return List of GEOM_Objects, containing the found blocks.
1668      */
1669     ListOfGO GetBlocksByParts (in GEOM_Object theCompound,
1670                                in ListOfGO    theParts);
1671
1672     /*!
1673      *  Operations on blocks with gluing of result
1674      */
1675
1676     /*!
1677      *  Multi-transformate block and glue the result.
1678      *  Transformation is defined so, as to superpose theDirFace1 with theDirFace2.
1679      *  \param theBlock Hexahedral solid to be multi-transformed.
1680      *  \param theDirFace1 First direction face global index.
1681      *  \param theDirFace2 Second direction face global index.
1682      *  \param theNbTimes Quantity of transformations to be done.
1683      *    \note Global index of sub-shape can be obtained, using method
1684      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
1685      *  \return New GEOM_Object, containing the result shape.
1686      */
1687     GEOM_Object MakeMultiTransformation1D (in GEOM_Object theBlock,
1688                                            in long        theDirFace1,
1689                                            in long        theDirFace2,
1690                                            in long        theNbTimes);
1691
1692     /*!
1693      *  Multi-transformate block and glue the result.
1694      *  \param theBlock Hexahedral solid to be multi-transformed.
1695      *  \param theDirFace1U,theDirFace2U Direction faces for the first transformation.
1696      *  \param theDirFace1V,theDirFace2V Direction faces for the second transformation.
1697      *  \param theNbTimesU,theNbTimesV Quantity of transformations to be done.
1698      *  \return New GEOM_Object, containing the result shape.
1699      */
1700     GEOM_Object MakeMultiTransformation2D (in GEOM_Object theBlock,
1701                                            in long        theDirFace1U,
1702                                            in long        theDirFace2U,
1703                                            in long        theNbTimesU,
1704                                            in long        theDirFace1V,
1705                                            in long        theDirFace2V,
1706                                            in long        theNbTimesV);
1707
1708     /*!
1709      *  Special operation - propagation
1710      */
1711
1712     /*!
1713      *  Build all possible propagation groups.
1714      *  Propagation group is a set of all edges, opposite to one (main)
1715      *  edge of this group directly or through other opposite edges.
1716      *  Notion of Opposite Edge make sence only on quadrangle face.
1717      *  \param theShape Shape to build propagation groups on.
1718      *  \return List of GEOM_Objects, each of them is a propagation group.
1719      */
1720     ListOfGO Propagate (in GEOM_Object theShape);
1721   };
1722
1723   /*!
1724    *  GEOM_IBooleanOperations: Interface for boolean operations (Cut, Fuse, Common)
1725    */
1726   interface GEOM_IBooleanOperations : GEOM_IOperations
1727   {
1728     /*!
1729      *  Perform one of boolean operations on two given shapes.
1730      *  \param theShape1 First argument for boolean operation.
1731      *  \param theShape2 Second argument for boolean operation.
1732      *  \param theOperation Indicates the operation to be done:
1733      *                      1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
1734      *  \return New GEOM_Object, containing the result shape.
1735      */
1736     GEOM_Object MakeBoolean (in GEOM_Object theShape1,
1737                              in GEOM_Object theShape2,
1738                              in long theOperation);
1739
1740     /*!
1741      *  Perform partition operation.
1742      *  \param theShapes Shapes to be intersected.
1743      *  \param theTools Shapes to intersect theShapes.
1744      *  \note  Each compound from ListShapes and ListTools will be exploded in order
1745      *         to avoid possible intersection between shapes from this compound.
1746      *  \param theLimit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
1747      #  \param KeepNonlimitShapes: if this parameter == 0 - only shapes with
1748      #                             type <= Limit are kept in the result,
1749      #                             else - shapes with type > Limit are kept
1750      #                             also (if they exist)
1751      *
1752      *  After implementation new version of PartitionAlgo (October 2006)
1753      *  other parameters are ignored by current functionality. They are kept
1754      *  in this function only for supporting old versions.
1755      *  Ignored parameters:
1756      *  \param theKeepInside Shapes, outside which the results will be deleted.
1757      *         Each shape from theKeepInside must belong to theShapes also.
1758      *  \param theRemoveInside Shapes, inside which the results will be deleted.
1759      *         Each shape from theRemoveInside must belong to theShapes also.
1760      *  \param theRemoveWebs If TRUE, perform Glue 3D algorithm.
1761      *  \param theMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
1762      *
1763      *  \return New GEOM_Object, containing the result shapes.
1764      */
1765     GEOM_Object MakePartition (in ListOfGO   theShapes,
1766                                in ListOfGO   theTools,
1767                                in ListOfGO   theKeepInside,
1768                                in ListOfGO   theRemoveInside,
1769                                in short      theLimit,
1770                                in boolean    theRemoveWebs,
1771                                in ListOfLong theMaterials,
1772                                in short      theKeepNonlimitShapes);
1773
1774     /*!
1775      *  Perform partition operation.
1776      *  This method may be usefull if it is needed to make a partition for
1777      *  a compound containing nonintersected shapes. Performance will be better
1778      *  since intersection between shapes from compound is not performed.
1779      *
1780      *  Description of all parameters as in previous method MakePartition()
1781      *
1782      *  \note Passed compounds (via ListShapes or via ListTools)
1783      *        have to consist of nonintersecting shapes.
1784      *
1785      *  \return New GEOM_Object, containing the result shapes.
1786      */
1787     GEOM_Object MakePartitionNonSelfIntersectedShape (in ListOfGO   theShapes,
1788                                                       in ListOfGO   theTools,
1789                                                       in ListOfGO   theKeepInside,
1790                                                       in ListOfGO   theRemoveInside,
1791                                                       in short      theLimit,
1792                                                       in boolean    theRemoveWebs,
1793                                                       in ListOfLong theMaterials,
1794                                                       in short      theKeepNonlimitShapes);
1795
1796     /*!
1797      *  Perform partition of the Shape with the Plane
1798      *  \param theShape Shape to be intersected.
1799      *  \param thePlane Tool shape, to intersect theShape.
1800      *  \return New GEOM_Object, containing the result shape.
1801      */
1802     GEOM_Object MakeHalfPartition (in GEOM_Object theShape,
1803                                    in GEOM_Object thePlane);
1804   };
1805
1806   /*!
1807    *  GEOM_ICurvesOperations: Interface for curves creation.
1808    *  Polyline, Circle, Spline (Bezier and Interpolation)
1809    */
1810   interface GEOM_ICurvesOperations : GEOM_IOperations
1811   {
1812     /*!
1813      *  Create a circle with given center, normal vector and radius.
1814      *  \param thePnt Circle center.
1815      *  \param theVec Vector, normal to the plane of the circle.
1816      *  \param theR Circle radius.
1817      *  \return New GEOM_Object, containing the created circle.
1818      */
1819     GEOM_Object MakeCirclePntVecR (in GEOM_Object thePnt,
1820                                    in GEOM_Object theVec,
1821                                    in double theR);
1822     /*!
1823      *  Create a circle, passing through three given points
1824      *  \param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1825      *  \return New GEOM_Object, containing the created circle.
1826      */
1827     GEOM_Object MakeCircleThreePnt (in GEOM_Object thePnt1,
1828                                     in GEOM_Object thePnt2,
1829                                     in GEOM_Object thePnt3);
1830     /*!
1831      *  Create a circle with given center, with a radius equals the distance from center to Point1
1832      *  and on a plane defined by all of three points.
1833      *  \param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1834      *  \return New GEOM_Object, containing the created circle.
1835      */
1836     GEOM_Object MakeCircleCenter2Pnt (in GEOM_Object thePnt1,
1837                                       in GEOM_Object thePnt2,
1838                                       in GEOM_Object thePnt3);
1839     /*!
1840      *  Create an ellipse with given center, normal vector and radiuses.
1841      *  \param thePnt Ellipse center.
1842      *  \param theVec Vector, normal to the plane of the ellipse.
1843      *  \param theRMajor Major ellipse radius.
1844      *  \param theRMinor Minor ellipse radius.
1845      *  \return New GEOM_Object, containing the created ellipse.
1846      */
1847     GEOM_Object MakeEllipse (in GEOM_Object thePnt,
1848                              in GEOM_Object theVec,
1849                              in double theRMajor,
1850                              in double theRMinor);
1851
1852     /*!
1853      *  Create an arc of circle, passing through three given points.
1854      *  \param thePnt1 Start point of the arc.
1855      *  \param thePnt2 Middle point of the arc.
1856      *  \param thePnt3 End point of the arc.
1857      *  \return New GEOM_Object, containing the created arc.
1858      */
1859     GEOM_Object MakeArc (in GEOM_Object thePnt1,
1860                          in GEOM_Object thePnt2,
1861                          in GEOM_Object thePnt3);
1862
1863     /*!
1864      *  Create an arc of circle of center C from one point to another
1865      *  \param theCenter Center point of the arc.
1866      *  \param thePnt1 Start point of the arc.
1867      *  \param thePnt2 End point of the arc.
1868      *  \param theSense Orientation of the arc
1869      *  \return New GEOM_Object, containing the created arc.
1870      */
1871     GEOM_Object MakeArcCenter (in GEOM_Object theCenter,
1872                                in GEOM_Object thePnt1,
1873                                in GEOM_Object thePnt2,
1874                                in boolean theSense);
1875
1876
1877     /*!
1878      *  Create a polyline on the set of points.
1879      *  \param thePoints Sequence of points for the polyline.
1880      *  \return New GEOM_Object, containing the created polyline.
1881      */
1882     GEOM_Object MakePolyline (in ListOfGO thePoints);
1883
1884     /*!
1885      *  Create bezier curve on the set of points.
1886      *  \param thePoints Sequence of points for the bezier curve.
1887      *  \return New GEOM_Object, containing the created bezier curve.
1888      */
1889     GEOM_Object MakeSplineBezier (in ListOfGO thePoints);
1890
1891     /*!
1892      *  Create B-Spline curve on the set of points.
1893      *  \param thePoints Sequence of points for the B-Spline curve.
1894      *  \return New GEOM_Object, containing the created B-Spline curve.
1895      */
1896     GEOM_Object MakeSplineInterpolation (in ListOfGO thePoints);
1897
1898     /*!
1899      *  Create a sketcher (wire or face), following the textual description,
1900      *  passed through \a theCommand argument. \n
1901      *  Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
1902      *  Format of the description string have to be the following:
1903      *
1904      *  "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1905      *
1906      *  Where:
1907      *  - x1, y1 are coordinates of the first sketcher point (zero by default),
1908      *  - CMD is one of
1909      *     - "R angle" : Set the direction by angle
1910      *     - "D dx dy" : Set the direction by DX & DY
1911      *     .
1912      *       \n
1913      *     - "TT x y" : Create segment by point at X & Y
1914      *     - "T dx dy" : Create segment by point with DX & DY
1915      *     - "L length" : Create segment by direction & Length
1916      *     - "IX x" : Create segment by direction & Intersect. X
1917      *     - "IY y" : Create segment by direction & Intersect. Y
1918      *     .
1919      *       \n
1920      *     - "C radius length" : Create arc by direction, radius and length(in degree)
1921      *     .
1922      *       \n
1923      *     - "WW" : Close Wire (to finish)
1924      *     - "WF" : Close Wire and build face (to finish)
1925      *
1926      *  \param theCommand String, defining the sketcher in local
1927      *                    coordinates of the working plane.
1928      *  \param theWorkingPlane Nine double values, defining origin,
1929      *                         OZ and OX directions of the working plane.
1930      *  \return New GEOM_Object, containing the created wire.
1931      */
1932     GEOM_Object MakeSketcher (in string theCommand, in ListOfDouble theWorkingPlane);
1933
1934       /*!
1935      *  Create a sketcher (wire or face), following the textual description,
1936      *  passed through \a theCommand argument. \n
1937      *  For format of the description string see the previous method.\n
1938      *  \param theCommand String, defining the sketcher in local
1939      *                    coordinates of the working plane.
1940      *  \param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1941      *  \return New GEOM_Object, containing the created wire.
1942      */
1943     GEOM_Object MakeSketcherOnPlane (in string theCommand, in GEOM_Object theWorkingPlane);
1944   };
1945
1946   /*!
1947    *  GEOM_ILocalOperations: Interface for fillet and chamfer creation.
1948    */
1949   interface GEOM_ILocalOperations : GEOM_IOperations
1950   {
1951     /*!
1952      *  Perform a fillet on all edges of the given shape.
1953      *  \param theShape Shape, to perform fillet on.
1954      *  \param theR Fillet radius.
1955      *  \return New GEOM_Object, containing the result shape.
1956      */
1957     GEOM_Object MakeFilletAll (in GEOM_Object theShape,
1958                                in double      theR);
1959
1960     /*!
1961      *  Perform a fillet on the specified edges of the given shape
1962      *  \param theShape Shape, to perform fillet on.
1963      *  \param theR Fillet radius.
1964      *  \param theEdges Global indices of edges to perform fillet on.
1965      *    \note Global index of sub-shape can be obtained, using method
1966      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
1967      *  \return New GEOM_Object, containing the result shape.
1968      */
1969     GEOM_Object MakeFilletEdges (in GEOM_Object theShape,
1970                                  in double      theR,
1971                                  in ListOfLong  theEdges);
1972     GEOM_Object MakeFilletEdgesR1R2 (in GEOM_Object theShape,
1973                                      in double      theR1,
1974                                      in double      theR2,
1975                                      in ListOfLong  theEdges);
1976
1977     /*!
1978      *  Perform a fillet on all edges of the specified faces of the given shape.
1979      *  \param theShape Shape, to perform fillet on.
1980      *  \param theR Fillet radius.
1981      *  \param theFaces Global indices of faces to perform fillet on.
1982      *    \note Global index of sub-shape can be obtained, using method
1983      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
1984      *  \return New GEOM_Object, containing the result shape.
1985      */
1986     GEOM_Object MakeFilletFaces (in GEOM_Object theShape,
1987                                  in double      theR,
1988                                  in ListOfLong  theFaces);
1989     GEOM_Object MakeFilletFacesR1R2 (in GEOM_Object theShape,
1990                                      in double      theR1,
1991                                      in double      theR2,
1992                                      in ListOfLong  theFaces);
1993
1994     /*!
1995      *  Perform a symmetric chamfer on all edges of the given shape.
1996      *  \param theShape Shape, to perform chamfer on.
1997      *  \param theD Chamfer size along each face.
1998      *  \return New GEOM_Object, containing the result shape.
1999      */
2000     GEOM_Object MakeChamferAll (in GEOM_Object theShape,
2001                                 in double      theD);
2002
2003     /*!
2004      *  Perform a chamfer on edges, common to the specified faces.
2005      *  with distance D1 on the Face1
2006      *  \param theShape Shape, to perform chamfer on.
2007      *  \param theD1 Chamfer size along \a theFace1.
2008      *  \param theD2 Chamfer size along \a theFace2.
2009      *  \param theFace1,theFace2 Global indices of two faces of \a theShape.
2010      *    \note Global index of sub-shape can be obtained, using method
2011      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
2012      *  \return New GEOM_Object, containing the result shape.
2013      */
2014     GEOM_Object MakeChamferEdge (in GEOM_Object theShape,
2015                                  in double theD1, in double theD2,
2016                                  in long theFace1, in long theFace2);
2017     /*! 
2018      *  The Same but with params theD = Chamfer Lenght
2019      *  and theAngle = Chamfer Angle (Angle in radians)
2020      */
2021     GEOM_Object MakeChamferEdgeAD (in GEOM_Object theShape,
2022                                    in double theD, in double theAngle,
2023                                    in long theFace1, in long theFace2);
2024
2025     /*!
2026      *  Perform a chamfer on all edges of the specified faces.
2027      *  with distance D1 on the first specified face (if several for one edge)
2028      *  \param theShape Shape, to perform chamfer on.
2029      *  \param theD1 Chamfer size along face from \a theFaces. If both faces,
2030      *               connected to the edge, are in \a theFaces, \a theD1
2031      *               will be get along face, which is nearer to \a theFaces beginning.
2032      *  \param theD2 Chamfer size along another of two faces, connected to the edge.
2033      *  \param theFaces Sequence of global indices of faces of \a theShape.
2034      *    \note Global index of sub-shape can be obtained, using method
2035      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
2036      *  \return New GEOM_Object, containing the result shape.
2037      */
2038     GEOM_Object MakeChamferFaces (in GEOM_Object theShape,
2039                                   in double theD1, in double theD2,
2040                                   in ListOfLong theFaces);
2041     /*! 
2042      *  The Same but with params theD = Chamfer Lenght
2043      *  and theAngle = Chamfer Angle (Angle in radians)
2044      */
2045     GEOM_Object MakeChamferFacesAD (in GEOM_Object theShape,
2046                                     in double theD, in double theAngle,
2047                                     in ListOfLong theFaces);
2048
2049    /*!
2050     *  Perform a chamfer on edges,
2051     *  with distance D1 on the first specified face (if several for one edge)
2052     *  \param theShape Shape, to perform chamfer on.
2053     *  \param theD1 theD2 Chamfer size
2054     *  \param theEdges Sequence of edges of \a theShape.
2055     *  \return New GEOM_Object, containing the result shape.
2056     */
2057     GEOM_Object MakeChamferEdges (in GEOM_Object theShape,
2058                                   in double theD1, in double theD2,
2059                                   in ListOfLong theEdges);
2060     /*! 
2061      *  The Same but with params theD = Chamfer Lenght
2062      *  and theAngle = Chamfer Angle (Angle in radians)
2063      */
2064     GEOM_Object MakeChamferEdgesAD (in GEOM_Object theShape,
2065                                     in double theD, in double theAngle,
2066                                     in ListOfLong theEdges);
2067
2068     /*!
2069      *  Perform an Archimde operation on the given shape with given parameters.
2070      *                    The object presenting the resulting face is returned
2071      *  \param theShape Shape to be put in water.
2072      *  \param theWeight Weight og the shape.
2073      *  \param theWaterDensity Density of the water.
2074      *  \param theMeshDeflection Deflection od the mesh, using to compute the section.
2075      *  \return New GEOM_Object, containing a section of \a theShape
2076      *          by a plane, corresponding to water level.
2077      */
2078     GEOM_Object MakeArchimede (in GEOM_Object theShape,
2079                                in double theWeight,
2080                                in double theWaterDensity,
2081                                in double theMeshDeflection);
2082
2083     /*!
2084      *  Duplicates <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
2085      *  Present here only for compatibility.
2086      */
2087     long GetSubShapeIndex (in GEOM_Object theShape, in GEOM_Object theSubShape);
2088   };
2089
2090   /*!
2091    *  GEOM_IHealingOperations: Interface for shape healing operations.
2092    *  Shape Processing, SuppressFaces, etc.
2093    */
2094   interface GEOM_IHealingOperations : GEOM_IOperations
2095   {
2096     /*!
2097      *  Apply a sequence of Shape Healing operators to the given object.
2098      *  \param theShapes Shape to be processed.
2099      *  \param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2100      *  \param theParameters List of names of parameters
2101      *                    ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2102      *  \param theValues List of values of parameters, in the same order
2103      *                    as parameters are listed in \a theParameters list.
2104      *  \return New GEOM_Object, containing processed shape.
2105      */
2106     GEOM_Object ProcessShape (in GEOM_Object theShapes,
2107                               in string_array theOperators,
2108                               in string_array theParameters,
2109                               in string_array theValues);
2110
2111     /*!
2112      *  Get default sequence of operators, their parameters and parameters' values
2113      *  of Shape Process operation. In the current implementation the defaults are
2114      *  read from the file pointed by CSF_ShHealingDefaults environmental variable.
2115      *  \param theOperators Output. Default list of names of operators.
2116      *  \param theParameters Output. Default list of names of parameters.
2117      *  \param theValues Output. List of default values of parameters, in the same order
2118      *                           as parameters are listed in \a theParameters list.
2119      */
2120     void GetShapeProcessParameters (out string_array theOperators,
2121                                     out string_array theParameters,
2122                                     out string_array theValues);
2123     /*!
2124      *  Get parameters and parameters' values for the given Shape Process operation.
2125      *  In the current implementation the defaults are
2126      *  read from the file pointed by CSF_ShHealingDefaults environmental variable.
2127      *  \param theOperator Input. The operator's name.
2128      *  \param theParameters Output. Default list of names of parameters.
2129      *  \param theValues Output. List of default values of parameters, in the same order
2130      *                           as parameters are listed in \a theParameters list.
2131      */
2132     void GetOperatorParameters (in string theOperator,
2133                                 out string_array theParameters,
2134                                 out string_array theValues);
2135
2136     /*!
2137      *  Remove faces from the given object (shape).
2138      *  \param theObject Shape to be processed.
2139      *  \param theFaces Indices of faces to be removed, if EMPTY then the method
2140      *                  removes ALL faces of the given object.
2141      *  \return New GEOM_Object, containing processed shape.
2142      */
2143     GEOM_Object SuppressFaces (in GEOM_Object theObject, in short_array theFaces);
2144
2145     /*!
2146      *  Close an open wire.
2147      *  \param theObject Shape to be processed.
2148      *  \param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2149      *                  if -1, then theObject itself is a wire.
2150      *  \param isCommonVertex If TRUE : closure by creation of a common vertex,
2151      *                        If FALS : closure by creation of an edge between ends.
2152      *  \return New GEOM_Object, containing processed shape.
2153      */
2154     GEOM_Object CloseContour (in GEOM_Object theObject, in short_array theWires,
2155                               in boolean isCommonVertex);
2156
2157     /*!
2158      *  Remove internal wires and edges from the given object (face).
2159      *  \param theObject Shape to be processed.
2160      *  \param theWires Indices of wires to be removed, if EMPTY then the method
2161      *                  removes ALL internal wires of the given object.
2162      *  \return New GEOM_Object, containing processed shape.
2163      */
2164     GEOM_Object RemoveIntWires (in GEOM_Object theObject, in short_array theWires);
2165
2166     /*!
2167      *  Remove internal closed contours (holes) from the given object.
2168      *  \param theObject Shape to be processed.
2169      *  \param theWires Indices of wires to be removed, if EMPTY then the method
2170      *                  removes ALL internal holes of the given object
2171      *  \return New GEOM_Object, containing processed shape.
2172      */
2173     GEOM_Object FillHoles (in GEOM_Object theObject, in short_array theWires);
2174
2175     /*!
2176      *  Sewing of the given object.
2177      *  \param theObject Shape to be processed.
2178      *  \param theTolerance Required tolerance value.
2179      *  \return New GEOM_Object, containing processed shape.
2180      */
2181     GEOM_Object Sew (in GEOM_Object theObject, in double theTolerance);
2182
2183     /*!
2184      *  Addition of a point to a given edge object.
2185      *  \param theObject Shape to be processed.
2186      *  \param theEdgeIndex Index of edge to be divided within theObject's shape,
2187      *                      if -1, then theObject itself is the edge.
2188      *  \param theValue Value of parameter on edge or length parameter,
2189      *                  depending on \a isByParameter.
2190      *  \param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2191      *                       if FALSE : \a theValue is treated as a length parameter [0..1]
2192      *  \return New GEOM_Object, containing processed shape.
2193      */
2194     GEOM_Object DivideEdge (in GEOM_Object theObject, in short theEdgeIndex,
2195                             in double theValue, in boolean isByParameter);
2196
2197     /*!
2198      *  Get a list of wires (wrapped in GEOM_Object-s),
2199      *  that constitute a free boundary of the given shape.
2200      *  \param theObject Shape to get free boundary of.
2201      *  \param theClosedWires Output. Closed wires on the free boundary of the given shape.
2202      *  \param theOpenWires Output. Open wires on the free boundary of the given shape.
2203      *  \return FALSE, if an error(s) occured during the method execution.
2204      */
2205     boolean GetFreeBoundary (in GEOM_Object theObject,
2206                              out ListOfGO theClosedWires,
2207                              out ListOfGO theOpenWires);
2208
2209     /*!
2210      *  Change orientation of the given object.
2211      *  \param theObject Shape to be processed.
2212      *  \return New GEOM_Object, containing processed shape.
2213      */
2214     GEOM_Object ChangeOrientation (in GEOM_Object theObject);
2215     GEOM_Object ChangeOrientationCopy (in GEOM_Object theObject);
2216
2217   };
2218
2219   /*!
2220    *  GEOM_IInsertOperations: Interface for shape insert operations (like copy, import).
2221    *
2222    */
2223   interface GEOM_IInsertOperations : GEOM_IOperations
2224   {
2225     /*!
2226      *  Create a copy of the given object
2227      */
2228     GEOM_Object MakeCopy (in GEOM_Object theOriginal);
2229
2230     /*!
2231      *  Export the given shape into a file with given name.
2232      *  \param theObject Shape to be stored in the file.
2233      *  \param theFileName Name of the file to store the given shape in.
2234      *  \param theFormatName Specify format for the shape storage.
2235      *         Available formats can be obtained with <VAR>ImportTranslators()</VAR> method.
2236      */
2237     void Export (in GEOM_Object theObject, in string theFileName, in string theFormatName);
2238
2239     /*!
2240      *  Import a shape from the BRep or IGES or STEP file
2241      *  (depends on given format) with given name.
2242      *  \param theFileName The file, containing the shape.
2243      *  \param theFormatName Specify format for the file reading.
2244      *         Available formats can be obtained with <VAR>ImportTranslators()</VAR> method.
2245      *  \return New GEOM_Object, containing the imported shape.
2246      */
2247     GEOM_Object Import (in string theFileName, in string theFormatName);
2248
2249     /*!
2250      *  Get the supported import formats and corresponding patterns for File dialog.
2251      *  \param theFormats Output. List of formats, available for import.
2252      *  \param thePatterns Output. List of file patterns, corresponding to available formats.
2253      *  \return Returns available formats and patterns through the arguments.
2254      */
2255     void ImportTranslators (out string_array theFormats,
2256                             out string_array thePatterns);
2257
2258     /*!
2259      *  Get the supported export formats and corresponding patterns for File dialog.
2260      *  \param theFormats Output. List of formats, available for export.
2261      *  \param thePatterns Output. List of file patterns, corresponding to available formats.
2262      *  \return Returns available formats and patterns through the arguments.
2263      */
2264     void ExportTranslators (out string_array theFormats,
2265                             out string_array thePatterns);
2266   };
2267
2268   /*!
2269    *  GEOM_IKindOfShape: namespace for shape_kind enumeration.
2270    */
2271   interface GEOM_IKindOfShape
2272   {
2273     enum shape_kind {
2274       NO_SHAPE,
2275       // COMPOSITEs
2276       COMPOUND,
2277       COMPSOLID,
2278       SHELL,
2279       WIRE,
2280       // SOLIDs
2281       SPHERE,       // full sphere
2282       CYLINDER,     // cylinder
2283       BOX,          // box with faces, parallel to global coordinate planes
2284       ROTATED_BOX,  // other box
2285       TORUS,        // full torus
2286       CONE,         // cone
2287       POLYHEDRON,   // solid, bounded by polygons
2288       SOLID,        // other solid
2289       // FACEs
2290       SPHERE2D,     // spherical face (closed)
2291       CYLINDER2D,   // cylindrical face with defined height
2292       TORUS2D,      // toroidal face (closed)
2293       CONE2D,       // conical face with defined height
2294       DISK_CIRCLE,  // planar, bounded by circle
2295       DISK_ELLIPSE, // planar, bounded by ellipse
2296       POLYGON,      // planar, bounded by segments
2297       PLANE,        // infinite planar
2298       PLANAR,       // other planar
2299       FACE,         // other face
2300       // EDGEs
2301       CIRCLE,       // full circle
2302       ARC_CIRCLE,   // arc of circle
2303       ELLIPSE,      // full ellipse
2304       ARC_ELLIPSE,  // arc of ellipse
2305       LINE,         // infinite segment
2306       SEGMENT,      // segment
2307       EDGE,         // other edge
2308       // VERTEX
2309       VERTEX
2310     };
2311   };
2312
2313
2314   /*!
2315    *  GEOM_IMeasureOperations: Interface for measurement (distance, whatis) and
2316    *  properties calculation (like Centre of Mass, Inertia, etc.).
2317    *
2318    */
2319   interface GEOM_IMeasureOperations : GEOM_IOperations
2320   {
2321     /*!
2322      *  Get kind of theShape.
2323      *  \param theShape Shape to get a kind of.
2324      *  \param theIntegers Output. Integer and enumerated shape's parameters
2325      *                     (kind of surface, closed/unclosed, number of edges, etc.)
2326      *  \param theDoubles  Output. Double shape's parameters (coordinates, dimensions, etc.)
2327      *  \note  Concrete meaning of each value, returned via \a theIntegers
2328      *         or \a theDoubles list depends on the kind of the shape.
2329      *  \return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration.
2330      */
2331     //short KindOfShape (in GEOM_Object   theShape,
2332     GEOM_IKindOfShape::shape_kind KindOfShape (in  GEOM_Object  theShape,
2333                                                out ListOfLong   theIntegers,
2334                                                out ListOfDouble theDoubles);
2335
2336     /*!
2337      *  Get position (LCS) of theShape.
2338      *  \param theShape Shape to calculate position of.
2339      *  \param Ox,Oy,Oz Output. Coordinates of shape's location origin.
2340      *                  Origin of the LCS is situated at the shape's center of mass.
2341      *  \param Zx,Zy,Zz Output. Coordinates of shape's location normal(main) direction.
2342      *  \param Xx,Xy,Xz Output. Coordinates of shape's location X direction.
2343      *                  Axes of the LCS are obtained from shape's location or,
2344      *                  if the shape is a planar face, from position of its plane.
2345      *  \return Returns position of the shape through the last nine arguments.
2346      */
2347     void GetPosition (in GEOM_Object theShape,
2348                       out double Ox, out double Oy, out double Oz,
2349                       out double Zx, out double Zy, out double Zz,
2350                       out double Xx, out double Xy, out double Xz);
2351
2352     /*!
2353      *  Get summarized length of all wires,
2354      *  area of surface and volume of the given shape.
2355      *  \param theShape Shape to define properties of.
2356      *  \param theLength Output. Summarized length of all wires of the given shape.
2357      *  \param theSurfArea Output. Area of surface of the given shape.
2358      *  \param theVolume Output. Volume of the given shape.
2359      *  \return Returns shape properties through the last three arguments.
2360      */
2361     void GetBasicProperties (in GEOM_Object theShape,
2362                              out double theLength,
2363                              out double theSurfArea,
2364                              out double theVolume);
2365
2366     /*!
2367      *  Get a point, situated at the centre of mass of theShape.
2368      *  \param theShape Shape to define centre of mass of.
2369      *  \return New GEOM_Object, containing the created point.
2370      */
2371     GEOM_Object GetCentreOfMass (in GEOM_Object theShape);
2372
2373     /*!
2374      *  Get a vector, representing the normal of theFace.
2375      *  If the face is not planar, theOptionalPoint is obligatory.
2376      *  \param theFace Shape (face) to define the normal of.
2377      *  \param theOptionalPoint Shape (point) to define the normal at.
2378      *                          Can be NULL in case of planar face.
2379      *  \return New GEOM_Object, containing the created normal vector.
2380      */
2381     GEOM_Object GetNormal (in GEOM_Object theFace,
2382                            in GEOM_Object theOptionalPoint);
2383
2384     /*!
2385      *  Get inertia matrix and moments of inertia of theShape.
2386      *  \param theShape Shape to calculate inertia of.
2387      *  \param I(1-3)(1-3) Output. Components of the inertia matrix of the given shape.
2388      *  \param Ix,Iy,Iz Output. Moments of inertia of the given shape.
2389      *  \return Returns inertia through the last twelve arguments.
2390      */
2391     void GetInertia (in GEOM_Object theShape,
2392                      out double I11, out double I12, out double I13,
2393                      out double I21, out double I22, out double I23,
2394                      out double I31, out double I32, out double I33,
2395                      out double Ix , out double Iy , out double Iz);
2396
2397     /*!
2398      *  Get parameters of bounding box of the given shape
2399      *  \param theShape Shape to obtain bounding box of.
2400      *  \param Xmin,Xmax Output. Limits of shape along OX axis.
2401      *  \param Ymin,Ymax Output. Limits of shape along OY axis.
2402      *  \param Zmin,Zmax Output. Limits of shape along OZ axis.
2403      *  \return Returns parameters of bounding box through the last six arguments.
2404      */
2405     void GetBoundingBox (in GEOM_Object theShape,
2406                          out double Xmin, out double Xmax,
2407                          out double Ymin, out double Ymax,
2408                          out double Zmin, out double Zmax);
2409
2410     /*!
2411      *  Get min and max tolerances of sub-shapes of theShape
2412      *  \param theShape Shape, to get tolerances of.
2413      *  \param FaceMin,FaceMax Output. Min and max tolerances of the faces.
2414      *  \param EdgeMin,EdgeMax Output. Min and max tolerances of the edges.
2415      *  \param VertMin,VertMax Output. Min and max tolerances of the vertices.
2416      *  \return Returns shape tolerances through the last six arguments.
2417      */
2418     void GetTolerance (in GEOM_Object theShape,
2419                        out double FaceMin, out double FaceMax,
2420                        out double EdgeMin, out double EdgeMax,
2421                        out double VertMin, out double VertMax);
2422
2423     /*!
2424      *  Check a topology of the given shape.
2425      *  \param theShape Shape to check validity of.
2426      *  \param theDescription Output. Description of problems in the shape, if they are.
2427      *  \return TRUE, if the shape "seems to be valid" from the topological point of view.
2428      */
2429     boolean CheckShape (in GEOM_Object theShape,
2430                         out string     theDescription);
2431
2432     /*!
2433      *  Check a topology and a geometry of the given shape.
2434      *  \param theShape Shape to check validity of.
2435      *  \param theDescription Output. Description of problems in the shape, if they are.
2436      *  \return TRUE, if the shape "seems to be valid".
2437      */
2438     boolean CheckShapeWithGeometry (in GEOM_Object theShape,
2439                                     out string     theDescription);
2440
2441     /*!
2442      *  Obtain description of the given shape
2443      *  \param theShape Shape to be described.
2444      *  \return Description of the given shape.
2445      */
2446     string WhatIs (in GEOM_Object theShape);
2447
2448     /*!
2449      *  Get minimal distance between the given shapes.
2450      *  \param theShape1,theShape2 Shapes to find minimal distance between.
2451      *  \param X1,Y1,Z1 Output. Coordinates of point on theShape1, nearest to theShape2.
2452      *  \param X2,Y2,Z2 Output. Coordinates of point on theShape2, nearest to theShape1.
2453      *  \return Value of the minimal distance between the given shapes.
2454      */
2455     double GetMinDistance (in GEOM_Object theShape1, in GEOM_Object theShape2,
2456                            out double X1, out double Y1, out double Z1,
2457                            out double X2, out double Y2, out double Z2);
2458
2459     /*!
2460      *  Get angle between the given lines or linear edges.
2461      *  \param theShape1,theShape2 Shapes to find angle between. Lines or linear edges.
2462      *  \return Value of the angle between the given shapes.
2463      */
2464     double GetAngle (in GEOM_Object theShape1, in GEOM_Object theShape2);
2465
2466     /*!
2467      *  Get point coordinates
2468      */
2469     void PointCoordinates (in GEOM_Object theShape, out double X, out double Y, out double Z);
2470   };
2471
2472
2473   /*!
2474    *  GEOM_IGroupOperations: Interface for groups creation.
2475    */
2476   interface GEOM_IGroupOperations : GEOM_IOperations
2477   {
2478     /*!
2479      *  Creates a new group which will store  sub shapes of theMainShape
2480      *  \param theMainShape is a GEOM object on which the group is selected
2481      *  \param theShapeType defines a shape type of the group
2482      *  \return a newly created GEOM group
2483      */
2484     GEOM_Object CreateGroup (in GEOM_Object theMainShape, in long theShapeType);
2485
2486     /*!
2487      *  Adds a sub object with ID theSubShapeId to the group
2488      *  \param theGroup is a GEOM group to which the new sub shape is added
2489      *  \param theSubShapeId is a sub shape ID in the main object.
2490      *  \note Use method <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR> to get an ID by the sub shape
2491      */
2492     void AddObject (in GEOM_Object theGroup, in long theSubShapeId);
2493
2494     /*!
2495      *  Removes a sub object with ID \a theSubShapeId from the group
2496      *  \param theGroup is a GEOM group from which the sub shape is removed.
2497      *  \param theSubShapeId is a sub shape ID in the main object.
2498      *  \note Use method <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR> to get an ID by the sub shape
2499      */
2500     void RemoveObject (in GEOM_Object theGroup, in long theSubShapeId);
2501
2502     /*!
2503      *  Adds to the group all the given shapes. No errors, if some shapes are alredy included.
2504      *  \param theGroup is a GEOM group to which the new sub shapes are added.
2505      *  \param theSubShapes is a list of sub shapes to be added.
2506      */
2507     void UnionList (in GEOM_Object theGroup, in ListOfGO theSubShapes);
2508
2509     /*!
2510      *  Removes from the group all the given shapes. No errors, if some shapes are not included.
2511      *  \param theGroup is a GEOM group from which the sub-shapes are removed.
2512      *  \param theSubShapes is a list of sub-shapes to be removed.
2513      */
2514     void DifferenceList (in GEOM_Object theGroup, in ListOfGO theSubShapes);
2515
2516     /*!
2517      *  Adds to the group all the given shapes. No errors, if some shapes are alredy included.
2518      *  \param theGroup is a GEOM group to which the new sub shapes are added.
2519      *  \param theSubShapes is a list of IDs of sub shapes to be added.
2520      */
2521     void UnionIDs (in GEOM_Object theGroup, in ListOfLong theSubShapes);
2522
2523     /*!
2524      *  Removes from the group all the given shapes. No errors, if some shapes are not included.
2525      *  \param theGroup is a GEOM group from which the sub-shapes are removed.
2526      *  \param theSubShapes is a list of IDs of sub-shapes to be removed.
2527      */
2528     void DifferenceIDs (in GEOM_Object theGroup, in ListOfLong theSubShapes);
2529
2530     /*!
2531      *  Returns a type of sub objects stored in the group
2532      *  \param theGroup is a GEOM group which type is returned.
2533      */
2534     long GetType (in GEOM_Object theGroup);
2535
2536     /*!
2537      *  Returns a main shape associated with the group
2538      *  \param theGroup is a GEOM group for which a main shape object is requested
2539      *  \return a GEOM object which is a main shape for theGroup
2540      */
2541     GEOM_Object GetMainShape (in GEOM_Object theGroup);
2542
2543     /*!
2544      *  Returns a list of sub objects ID stored in the group
2545      *  \param theGroup is a GEOM group for which a list of IDs is requested
2546      */
2547     ListOfLong GetObjects (in GEOM_Object theGroup);
2548   };
2549
2550
2551   /*!
2552    *  GEOM_Gen: Interface to access other GEOM interfaces.
2553    *  Also contains some methods to access and manage GEOM objects.
2554    */
2555   interface GEOM_Gen : Engines::Component,SALOMEDS::Driver
2556   {
2557     /*!
2558      *  Undo/Redo Management
2559      */
2560
2561     void Undo (in long theStudyID);
2562
2563     void Redo (in long theStudyID);
2564
2565     /*!
2566      * Publishing manangement
2567      * Adds in theStudy a object theObject under with a name theName,
2568      * if theFather is not NULL the object is placed under thFather's SObject.
2569      * Returns a SObject where theObject is placed
2570      */
2571     SALOMEDS::SObject AddInStudy (in SALOMEDS::Study theStudy,
2572                                   in GEOM_Object theObject,
2573                                   in string theName,
2574                                   in GEOM_Object theFather);
2575
2576     /*!
2577      *  Methods to access interfaces for objects creation and transformation
2578      */
2579     GEOM_IBasicOperations     GetIBasicOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
2580     GEOM_ITransformOperations GetITransformOperations(in long theStudyID) raises (SALOME::SALOME_Exception);
2581     GEOM_I3DPrimOperations    GetI3DPrimOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
2582     GEOM_IShapesOperations    GetIShapesOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
2583     GEOM_IBooleanOperations   GetIBooleanOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
2584     GEOM_ICurvesOperations    GetICurvesOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
2585     GEOM_ILocalOperations     GetILocalOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
2586     GEOM_IHealingOperations   GetIHealingOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
2587     GEOM_IInsertOperations    GetIInsertOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
2588     GEOM_IMeasureOperations   GetIMeasureOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
2589     GEOM_IBlocksOperations    GetIBlocksOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
2590     GEOM_IGroupOperations     GetIGroupOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
2591
2592     /*!
2593      *  Objects Management
2594      */
2595
2596     /*!
2597      *  Removes the object from the GEOM component
2598      *  \param theObject is a GEOM object to be removed
2599      */
2600     void RemoveObject (in GEOM_Object theObject);
2601
2602     /*!
2603      *  Returns an object defined by the study and its entry in the GEOM component
2604      *  \param theStudyID is a SALOMEDS Study ID
2605      *  \param theEntry is an entry of the requested GEOM object in the GEOM component
2606      *  \note if the object has not previously been created a NULL GEOM object is returned
2607      */
2608     GEOM_Object GetObject (in long theStudyID, in string theEntry);
2609
2610     /*!
2611      *  Add a sub shape defined by indices in \a theIndices
2612      *  (contains unique IDs of sub shapes inside theMainShape)
2613      *  \note The sub shape GEOM_Objects can has ONLY ONE function.
2614      *        Don't try to apply modification operations on them.
2615      *  \note Internal method
2616      */
2617     GEOM_Object AddSubShape (in GEOM_Object theMainShape, in ListOfLong theIndices);
2618
2619     /*!
2620      *  GEOM object's IOR Management
2621      */
2622
2623     /*!
2624      *  Returns a GEOM Object defined by its IOR
2625      *  \param theIOR a string containg an IOR of the requested GEOM object
2626      */
2627     GEOM_Object GetIORFromString (in string theIOR);
2628
2629     /*!
2630      *  Returns a string which contains an IOR of the GEOM object
2631      *  \param theObject is a GEOM object which IOR is requested
2632      */
2633     string GetStringFromIOR (in GEOM_Object theObject);
2634
2635     /*!
2636      *  Returns a name with which a GEOM object was dumped into python script
2637      *  \param theStudyEntry is an entry of the GEOM object in the study
2638      */
2639     string GetDumpName (in string theStudyEntry);
2640
2641     /*!
2642      *  Returns all names with which a GEOM objects was dumped
2643      *  into python script to avoid the same names in SMESH script
2644      */
2645     string_array GetAllDumpNames();
2646   };
2647 };
2648
2649 #endif