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