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