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