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