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