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