Salome HOME
INT PAL 0052642: Notebook variables are not dumped to script with Fillet1D, Fillet2D...
[modules/geom.git] / idl / GEOM_Gen.idl
1 // Copyright (C) 2007-2015  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, or (at your option) any later version.
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    *  \brief Topological types of shapes (like Open Cascade types)
39    */
40   enum shape_type 
41   { 
42     /*! A collection of arbitrary shapes */
43     COMPOUND,
44     /*! A collection of solids */ 
45     COMPSOLID, 
46     /*! A part of 3D space bound by a shell */
47     SOLID, 
48     /*! A collection of faces connected by some edges of their wire boundaries */
49     SHELL,
50     /*! Part of a plane (in 2D geometry) or a surface (in 3D geometry) bounded by a closed wire */
51     FACE, 
52     /*! A sequence of edges connected by their vertices */
53     WIRE, 
54     /*! Edge, a shape corresponding to a curve, and bound by a vertex at each extremity */
55     EDGE, 
56     /*! A zero-dimensional shape corresponding to a point in geometry */
57     VERTEX,
58     /*! Arbitrary shape in a Compound (used for processing of Compounds in some operations) */ 
59     SHAPE,
60     /*! Flat (top-level) contents of a Compound (used for processing of Compounds in some operations) */
61     FLAT
62     };
63
64   /*!
65    * \brief Marker type
66    */
67   enum marker_type { MT_NONE, MT_POINT, MT_PLUS, MT_STAR, MT_X, MT_O, MT_O_POINT, MT_O_PLUS,
68                      MT_O_STAR, MT_O_X, MT_RING1, MT_RING2, MT_RING3, MT_BALL, MT_USER };
69
70   /*!
71    * /brief Marker size
72    */
73   enum marker_size { MS_NONE, MS_10, MS_15, MS_20, MS_25, MS_30, MS_35,
74                      MS_40, MS_45, MS_50, MS_55, MS_60, MS_65, MS_70 };
75
76   /*!
77    *  \brief State of shape relatively geometrical surface like plane, sphere or cylinder.
78    *
79    *  Is used in functions GEOM_IShapesOperations.GetShapesOn<xxx>()
80    */
81   enum shape_state
82   {
83     /*! Shape is on surface */
84     ST_ON,
85
86     /*!
87      *  Shape is in the direction defined by the normal and not on surface.
88      *  For plane it means above the plane,
89      *  For sphere and cylinder it means outside of volume, bounded by the surface.
90      */
91     ST_OUT,
92     
93     /*!
94      *  Shape is in the direction defined by the normal and on surface.
95      *  ONOUT = ON || OUT
96      */
97     ST_ONOUT,
98
99     /*!
100      *  Complementary to ONOUT.
101      *  For plane it means below the plane,
102      *  For sphere and cylinder it means inside the volume, bounded by the surface
103      *  (beyond axis and surface for cylinder and beyond cented and surface for sphere).
104      */
105     ST_IN,
106
107     /*!
108      *  Complementary to OUT.
109      *  ONIN = ON || IN
110      */
111     ST_ONIN
112   };
113
114   /*!
115    *  \brief Kind of method to find inside one main shape some sub-shapes,
116    *  corresponding to other given shape (its argument)
117    *
118    *  Is used in functions GEOM_Gen.RestoreSubShapesO(), GEOM_Gen.RestoreSubShapesSO(),
119    *  TransferNames()
120    */
121   enum find_shape_method
122   {
123     /*! Use GetInPlace functionality. Suits all cases, except transformations */
124     FSM_GetInPlace,
125
126     /*! To be used only for transformation result, to find sub-shapes of argument.
127      *  Only this method can be used after transformation.
128      */
129     FSM_Transformed,
130
131     /*! To find only shared sub-shapes, not modified by the operation */
132     FSM_GetSame,
133
134     /*! Use GetShapesOnShape method (can work only on solids) */
135     FSM_GetShapesOnShape,
136
137     /*! Use GetInPlaceByHistory method (can work only after Partition) */
138     FSM_GetInPlaceByHistory,
139
140     /*! To be used only for multi-transformation result.
141      *  Only this method can be used after multi-transformation.
142      */
143     FSM_MultiTransformed,
144
145     /*! Use old GetInPlace functionality. */
146     FSM_GetInPlace_Old
147   };
148
149   /*!
150    *  \brief Kind of method to perform filling operation
151    *
152    *  Is used in functions GEOM_I3DPrimOperations.MakeFilling()
153    */
154   enum filling_oper_method
155   {
156     /*! Default (standard behaviour) */
157     FOM_Default,
158
159     /*! Use edges orientation  - orientation of edges is used: if the edge is 
160      * reversed, the curve from this edge is reversed before using it in 
161      *  the filling algorithm.
162      */
163     FOM_UseOri,
164
165     /*! Auto-correct edges orientation - changes the orientation of the curves 
166      *  using minimization of sum of distances between the end points of the edges.
167      */
168     FOM_AutoCorrect
169   };
170
171   /*!
172    * \brief Kind of the curves.
173    *
174    * Used in the functions GEOM_ICurvesOperations.MakeCurveParametric(), GEOM_ICurvesOperations.MakeCurveParametricNew(),
175    * GEOM_ICurvesOperations.MakePolyline2D, GEOM_ICurvesOperations.MakePolyline2DOnPlane.
176    */
177   enum curve_type {
178     /*! Polyline curve */
179     Polyline,
180     
181     /*! Bezier curve */
182     Bezier,
183
184     /*! Interpolation, curve */
185     Interpolation
186   };
187
188  /*!
189    * \brief Type of field data
190    */
191   enum field_data_type {
192     FDT_Bool,
193     FDT_Int,
194     FDT_Double,
195     FDT_String
196   };
197
198   /**
199    * This enumeration represents the level of checking shape on
200    * self-interference. It defines which interferferences will be checked.
201    */
202   enum si_check_level
203   {
204     SI_V_V,     // only V/V interferences
205     SI_V_E,     // V/V and V/E interferences
206     SI_E_E,     // V/V, V/E and E/E interferences
207     SI_V_F,     // V/V, V/E, E/E and V/F interferences
208     SI_E_F,     // V/V, V/E, E/E, V/F and E/F interferences
209     SI_ALL      // all interferences
210   };
211
212  /*!
213    * \brief Object creation parameters
214    *
215    * Is returned by GEOM_Object::GetCreationInformation()
216    */
217   struct Parameter
218   {
219     string name;
220     string value;
221   };
222   typedef sequence<Parameter> Parameters;
223
224   struct CreationInformation
225   {
226     string     operationName;
227     Parameters params;
228   };
229
230   /*!
231    * \brief Reporting on shape healing
232    */
233   struct ModifInfo
234   {
235     string name;  // what changed
236     long   count; // how many times
237   };
238   typedef sequence<ModifInfo> ModifStatistics;
239
240
241   typedef sequence<string>       string_array;
242   typedef sequence<short>        short_array;
243   typedef sequence<boolean>      ListOfBool;
244   typedef sequence<long>         ListOfLong;
245   typedef sequence<double>       ListOfDouble;
246   typedef sequence<ListOfDouble> ListOfListOfDouble;
247
248   interface GEOM_Object;
249   interface GEOM_BaseObject;
250   interface GEOM_Field;
251   interface GEOM_FieldStep;
252
253   typedef sequence<GEOM_Object>       ListOfGO;
254   typedef sequence<GEOM_BaseObject>   ListOfGBO;
255   typedef sequence<GEOM_Field>        ListOfFields;
256   typedef sequence<SALOMEDS::SObject> object_list;
257
258   //# GEOM_BaseObject
259   /*!
260    *  \brief A common root of objects in GEOM module
261    */
262   interface GEOM_BaseObject : SALOME::GenericObj
263   {
264     /*!
265      *  \brief Set name of the object.
266      *
267      *  \param theName is a name which will be associated with this object.
268      */
269     void SetName (in string theName);
270
271     /*!
272     *  \brief Get name of the object associated with this object.
273      */
274     string GetName();
275
276     /*!
277      *  \brief Get internal (unique) entry of the object in the GEOM component's data tree.
278      *  \note This is not an entry of the data object in SALOME study. 
279      *  This is internal function of GEOM component, though it can be used outside it for 
280         appropriate reason (e.g. for unique identification of geometry object).
281      */
282     string GetEntry();
283
284     /*!
285      *  \brief Get ID of study, where the object is created.
286      */
287     long GetStudyID();
288
289     /*!
290      *  \brief Get internal type of the object (POINT, BOX, CYLINDER, EXTRUSION...).
291      */
292     long GetType();
293
294     /*!
295      *  \brief Get value of a modification counter of the object
296      */
297     long GetTick();
298
299     /*!
300      *  \brief Set a Study entry where this object was published.
301      */
302     void SetStudyEntry (in string theEntry);
303
304     /*!
305      *  \brief Get a Study entry where this object was published.
306      */
307     string GetStudyEntry();
308
309     /*!
310      *  \brief Get a list of all GEOM_Object on which were the arguments
311      *  when this object was constructed and modified.
312      *  \note This method is supposed to be used by GUI only.
313      */
314     ListOfGBO GetDependency();
315
316     /*!
317      *  \brief Get a list of GEOM_Object on which the last function that created or modified the object depends.
318      *  \note This method is supposed to be used by GUI only.
319      */
320     ListOfGBO GetLastDependency();
321
322     /*
323      *  \brief Return true if geom object representes a shape.
324      *
325      *  For example, method return false for GEOM_MARKER
326      */
327      boolean IsShape();
328
329     /*
330      *  \brief Return true if passed object is identical to this object
331      *
332      *  \param other object being compared with this one
333      */
334     boolean IsSame(in GEOM_BaseObject other);
335
336      /*!
337      *  Set list of parameters
338      *  \param theParameters is a string containing the notebook variables separated by ":" symbol,
339      *         used for object creation
340      */
341     void SetParameters (in string theParameters);
342
343     /*!
344      *  \brief Return list of notebook variables used for object creation separated by ":" symbol
345      */
346     string GetParameters();
347
348     /*!
349      * \brief Return name of operation and values of parameters used for object creation
350      */
351     CreationInformation GetCreationInformation();
352   };
353
354   //# GEOM_Object
355   /*!
356    *  \brief Interface of geometric object
357    */
358   interface GEOM_Object : GEOM_BaseObject
359   {
360     /*!
361      *  \brief Get a <VAR>shape_type</VAR> of the object value.
362      */
363     shape_type GetShapeType();
364
365     /*!
366      *  \brief Get the topology type of the object value.
367      *
368      *  In contrast to the shape type, this function returns type of the most
369      *  top-level sub-shape of the COMPOUND or COMPSOLID, if there is only one
370      *  sub-shape there.
371      *  \sa GetShapeType()
372      */
373     shape_type GetTopologyType();
374
375     /*!
376      *  \brief Get a minimal type of the top-level shapes contained in the object.
377      *
378      *  This function is useful for the compounds only; for simple shapes it
379      *  exactly the same value as GetShapeType().
380      *  Note, that compounds are procesed recursively.
381      *
382      *  \sa GetShapeType(), GetTopologyType(), GetMaxShapeType()
383      */
384     shape_type GetMinShapeType();
385
386     /*!
387      *  \brief Get a maximal type of the top-level shapes contained in the object.
388      *
389      *  This function is useful for the compounds only; for simple shapes it
390      *  exactly the same value as GetShapeType().
391      *  Note, that compounds are procesed recursively.
392      *
393      *  \sa GetShapeType(), GetTopologyType(), GetMinShapeType()
394      */
395     shape_type GetMaxShapeType();
396
397     /*!
398      *  \brief Returns a name of a sub-shape if the sub-shape is published in the study
399      *  \param subID - sub-shape ID
400      *  \return string - the found name or an empty string if the sub-shape does not
401      *          exits or is not published in the study
402      *
403      * \note Only sub-shapes directly retrieved (using e.g. ExtractSubShapes() or
404      *       via group creation) can be found. Also, as sub-shape can be published in the study
405      *       many times, only the first found name is returned.
406      */
407     string GetSubShapeName(in long subID);
408
409     /*!
410      *  \brief Set color of the object.
411      *
412      *  \param theColor is a color of the object.
413      */
414     void SetColor(in SALOMEDS::Color theColor);
415
416     /*!
417      *  Get color of the object.
418      */
419     SALOMEDS::Color GetColor();
420
421     /*!
422      *  Toggle auto color mode on the object.
423      *  \param theAutoColor is a flag which toggles auto color mode.
424      */
425     void SetAutoColor(in boolean theAutoColor);
426
427     /*!
428      *  \brief Get flag of object's auto color mode.
429      */
430     boolean GetAutoColor();
431
432     /*!
433      * \brief Set standard point marker for the object
434      * \param theType standard marker type
435      * \param theSize marker relative size
436      */
437     void SetMarkerStd(in marker_type theType, in marker_size theSize );
438
439     /*!
440      * \brief Set custom point marker for the object. 
441      *
442      * The texture can be added by LoadTexture() or AddTexture() functions.
443      * \param theTextureId texture ID
444      */
445     void SetMarkerTexture(in long theTextureId);
446
447     /*!
448      * \brief Get type of the point marker assigned to the object
449      * \return current marker type (MT_NONE if no marker is set)
450      */
451     marker_type GetMarkerType();
452
453     /*!
454      * \brief Get size of the point marker assigned to the object
455      * \return current marker relative size (MS_NONE if no marker is set)
456      */
457     marker_size GetMarkerSize();
458
459     /*!
460      * \brief Get texture idenifier of the point marker assigned to the object
461      * \return marker texture ID (0 if no marker set)
462      */
463     long GetMarkerTexture();
464
465     /*!
466      *  \brief Get the TopoDS_Shape, for colocated case only.
467      */
468     long long getShape();
469
470  //   ######################################################################
471  //   # Internal methods (For sub-shape identification)
472  //   ######################################################################
473     /*!
474      *  \brief Get geometric shape of the object as a byte stream in BRep format
475      *  \note GEOM_IInsertOperations::RestoreShape() method can be used to restore shape from a BRep stream.
476      */
477     SALOMEDS::TMPFile GetShapeStream();
478
479     /*
480      *  \brief Returns True if this object is not a sub-shape of another object.
481      */
482     boolean IsMainShape();
483
484     /*
485      *  \brief Get a list of ID's of sub-shapes in the main shape.
486      *  \note Internal method, suppopsed to be used only by GEOM_Client
487      */
488     ListOfLong GetSubShapeIndices();
489
490     /*
491      *  \brief Get a main shape object to which this object is a sub-shape
492      *  \note Internal method, suppopsed to be used only by GEOM_Client
493      */
494     GEOM_Object GetMainShape();
495
496   };
497
498   //# GEOM_Field
499   /*!
500    *  \brief Interface of the field
501    */
502   interface GEOM_Field : GEOM_BaseObject
503   {
504     /*!
505      *  \brief Returns the shape the field lies on
506      */
507     GEOM_Object GetShape();
508
509     /*!
510      *  \brief Returns type of field data
511      */
512     field_data_type GetDataType();
513
514     /*!
515      *  \brief Returns dimension of the shape the field lies on
516      *  0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
517      */
518     short GetDimension();
519
520     /*!
521      *  \brief Returns names of components
522      */
523     string_array GetComponents();
524
525     /*!
526      *  \brief Removes a component. Component number counts from one.
527      */
528     //void RemoveComponent(in long number);
529
530     /*!
531      *  \brief Adds a time step to the field
532      */
533     GEOM_FieldStep AddStep(in long stepID, in long stamp);
534
535     /*!
536      *  \brief Remove a time step from the field
537      */
538     void RemoveStep(in long stepID);
539
540     /*!
541      *  \brief Returns number of time steps in the field
542      */
543     long CountSteps();
544
545     /*!
546      *  \brief Returns a list of time step IDs in the field
547      */
548     ListOfLong GetSteps();
549
550     /*!
551      *  \brief Returns a time step by its ID
552      */
553     GEOM_FieldStep GetStep(in long stepID);
554
555     /*!
556      *  \brief Returns a size of data array that is to be passed to
557      *         GEOM_FieldStep.SetValues( dataArray ). This size depends on the
558      *         number of sub-shapes of field dimension and the number of components
559      */
560     long GetArraySize();
561   };
562
563   // # GEOM_FieldStep:
564   /*!
565    *  \brief Interface of the field time step
566    */
567   interface GEOM_FieldStep : GEOM_BaseObject
568   {
569     /*!
570      *  \brief Changes the time of the field step
571      */
572     void SetStamp(in long stamp);
573
574     /*!
575      *  \brief Returns the time of the field step
576      */
577     long GetStamp();
578
579     /*!
580      *  \brief Returns the number of the field step
581      */
582     long GetID();
583
584     /*!
585      *  \brief Returns the field the step belongs to
586      */
587     GEOM_Field GetField();
588   };
589
590   // # GEOM_BoolFieldStep:
591   /*!
592    *  \brief Interface of the boolean field time step
593    */
594   interface GEOM_BoolFieldStep : GEOM_FieldStep
595   {
596     /*!
597      *  \brief Changes values of the field step. Returns false if number of values is wrong
598      */
599     boolean SetValues(in short_array boolValues);
600
601     /*!
602      *  \brief Returns values of the field step
603      */
604     short_array GetValues();
605   };
606
607   // # GEOM_IntFieldStep:
608   /*!
609    *  \brief Interface of the integer field time step
610    */
611   interface GEOM_IntFieldStep : GEOM_FieldStep
612   {
613     /*!
614      *  \brief Changes values of the field step. Returns false if number of values is wrong
615      */
616     boolean SetValues(in ListOfLong intValues);
617
618     /*!
619      *  \brief Returns values of the field step
620      */
621     ListOfLong GetValues();
622   };
623
624   // # GEOM_DoubleFieldStep:
625   /*!
626    *  \brief Interface of the double field time step
627    */
628   interface GEOM_DoubleFieldStep : GEOM_FieldStep
629   {
630     /*!
631      *  \brief Changes values of the field step. Returns false if number of values is wrong
632      */
633     boolean SetValues(in ListOfDouble doubleValues);
634
635     /*!
636      *  \brief Returns values of the field step
637      */
638     ListOfDouble GetValues();
639   };
640
641   // # GEOM_StringFieldStep:
642   /*!
643    *  \brief Interface of the string field time step
644    */
645   interface GEOM_StringFieldStep : GEOM_FieldStep
646   {
647     /*!
648      *  \brief Changes values of the field step. Returns false if number of values is wrong
649      */
650     boolean SetValues(in string_array strValues);
651
652     /*!
653      *  \brief Returns values of the field step
654      */
655     string_array GetValues();
656   };
657
658   // # GEOM_IOperations:
659   /*!
660    *  \brief Basic methods of all geometric operations
661    */
662   interface GEOM_IOperations : SALOME::GenericObj
663   {
664     /*!
665      *  \brief To know, if the operation was successfully performed
666      */
667     boolean IsDone();
668
669     /*!
670      *  \brief Set the operation error code
671      *  \param theErrorID is a string describing the error occured
672      *  \note This method is supposed to be used only by interfaces inheriting from IOperations.
673      */
674     void SetErrorCode (in string theErrorID);
675
676     /*!
677      *  \brief Get the operation error code
678      */
679     string GetErrorCode();
680
681     /*!
682      *  \brief Get ID of study, where the operation is defined
683      */
684     long GetStudyID();
685
686     /*!
687      *  \brief Opens a new transaction
688      */
689     void StartOperation();
690
691     /*!
692      *  \brief Closes the previously opened trasaction
693      */
694     void FinishOperation();
695
696     /*!
697      *  \brief Aborts the previously opened transaction
698      */
699     void AbortOperation();
700   };
701   //# GEOM_IBasicOperations:
702   /*!
703    *  \brief Interface for basic geometry creation
704    *
705    *  (Point, Vector, Plane, Marker)
706    */
707   interface GEOM_IBasicOperations : GEOM_IOperations
708   {
709     /*!
710      *  \brief Create point by three coordinates.
711      *  \param theX The X coordinate of the point.
712      *  \param theY The Y coordinate of the point.
713      *  \param theZ The Z coordinate of the point.
714      *  \return New GEOM_Object, containing the created point.
715      */
716     GEOM_Object MakePointXYZ (in double theX, in double theY, in double theZ);
717
718     /*!
719      *  \brief Create a point, distant from the referenced point
720      *  on the given distances along the coordinate axes.
721      *  \param theReference The referenced point.
722      *  \param theX Displacement from the referenced point along OX axis.
723      *  \param theY Displacement from the referenced point along OY axis.
724      *  \param theZ Displacement from the referenced point along OZ axis.
725      *  \return New GEOM_Object, containing the created point.
726      */
727     GEOM_Object MakePointWithReference (in GEOM_Object theReference,
728                                         in double theX, in double theY, in double theZ);
729
730     /*!
731      *  Create a point, corresponding to the given parameter on the given curve.
732      *  \param theRefCurve The referenced curve.
733      *  \param theParameter Value of parameter on the referenced curve.
734      *  \return New GEOM_Object, containing the created point.
735      */
736     GEOM_Object MakePointOnCurve (in GEOM_Object theRefCurve,
737                                   in double theParameter);
738
739     /*!
740      *  \brief Create a point, corresponding to the given length on the given curve.
741      *  \param theRefCurve The referenced curve.
742      *  \param theLength Length on the referenced curve. It can be negative.
743      *  \param theStartPoint Any vertex close to one of edge's
744      *                       ends to select start point among them.
745      *                       If NULL, fist vertex is used.
746      *  \return New GEOM_Object, containing the created point.
747      */
748     GEOM_Object MakePointOnCurveByLength (in GEOM_Object theRefCurve,
749                                           in double      theLength,
750                                           in GEOM_Object theStartPoint);
751
752     /*!
753      *  \brief Create a point on the given curve, projecting given point
754      *  \param theRefCurve The referenced curve.
755      *  \param theXParameter X co-ordinate of point to project on curve
756      *  \param theYParameter Y co-ordinate of point to project on curve
757      *  \param theZParameter Z co-ordinate of point to project on curve
758      *  \return New GEOM_Object, containing the created point.
759      */
760     GEOM_Object MakePointOnCurveByCoord (in GEOM_Object theRefCurve,
761                                          in double theXParameter,
762                                          in double theYParameter,
763                                          in double theZParameter);
764
765     /*!
766      *  \brief Create a point, corresponding to the given parameters on the
767      *    given surface.
768      *  \param theRefSurf The referenced surface.
769      *  \param theUParameter Value of U-parameter on the referenced surface.
770      *  \param theVParameter Value of V-parameter on the referenced surface.
771      *  \return New GEOM_Object, containing the created point.
772      */
773     GEOM_Object MakePointOnSurface (in GEOM_Object theRefSurf,
774                                     in double theUParameter,
775                                     in double theVParameter);
776
777     /*!
778      *  \brief Create a point on the given surface, projecting given point
779      *  \param theRefSurf The referenced surface.
780      *  \param theXParameter X co-ordinate of point to project on curve
781      *  \param theYParameter Y co-ordinate of point to project on curve
782      *  \param theZParameter Z co-ordinate of point to project on curve
783      *  \return New GEOM_Object, containing the created point.
784      */
785     GEOM_Object MakePointOnSurfaceByCoord (in GEOM_Object theRefSurf,
786                                            in double theXParameter,
787                                            in double theYParameter,
788                                            in double theZParameter);
789
790     /*!
791      *  \brief Create a point, which lays on the given face.
792      *         The point will lay in arbitrary place of the face.
793      *         The only condition on it is a non-zero distance to the face boundary.
794      *         Such point can be used to uniquely identify the face inside any
795      *         shape in case, when the shape does not contain overlapped faces.
796      *  \param theFace The referenced face.
797      *  \return New GEOM_Object, containing the created point.
798      */
799     GEOM_Object MakePointOnFace (in GEOM_Object theFace);
800
801     /*!
802      *  \brief Create a point, on two lines intersection.
803      *  \param theRefLine1, theRefLine2 The referenced lines.
804      *  \return New GEOM_Object, containing the created point.
805      */
806     GEOM_Object MakePointOnLinesIntersection (in GEOM_Object theRefLine1,
807                                               in GEOM_Object theRefLine2);
808
809      /*!
810      *  \brief Create a vector, corresponding to tangent to the given parameter on the given curve.
811      *  \param theRefCurve The referenced curve.
812      *  \param theParameter Value of parameter on the referenced curve.This value should be have value
813      *                      between 0. and 1.. Value of 0. corresponds first parameter of curve; value
814      *                      1. corresponds last parameter of curve.
815      *  \return New GEOM_Object, containing the created point.
816      */
817      GEOM_Object MakeTangentOnCurve (in GEOM_Object theRefCurve,
818                                      in double theParameter);
819
820     /*!
821      *  \brief Create a vector with the given components.
822      *  \param theDX X component of the vector.
823      *  \param theDY Y component of the vector.
824      *  \param theDZ Z component of the vector.
825      *  \return New GEOM_Object, containing the created vector.
826      */
827     GEOM_Object MakeVectorDXDYDZ (in double theDX,
828                                   in double theDY,
829                                   in double theDZ);
830
831     /*!
832      *  \brief Create a vector between two points.
833      *  \param thePnt1 Start point for the vector.
834      *  \param thePnt2 End point for the vector.
835      *  \return New GEOM_Object, containing the created vector.
836      */
837     GEOM_Object MakeVectorTwoPnt (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
838
839     /*!
840      *  C\brief reate a line, passing through the given point
841      *  and parrallel to the given direction
842      *  \param thePnt Point. The resulting line will pass through it.
843      *  \param theDir Direction. The resulting line will be parallel to it.
844      *  \return New GEOM_Object, containing the created line.
845      */
846     GEOM_Object MakeLine (in GEOM_Object thePnt, in GEOM_Object theDir);
847
848     /*!
849      *  \brief Create a line, passing through the given points
850      *  \param thePnt1 First of two points, defining the line.
851      *  \param thePnt2 Second of two points, defining the line.
852      *  \return New GEOM_Object, containing the created line.
853      */
854     GEOM_Object MakeLineTwoPnt (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
855
856     /*!
857      *  \brief Create a line, given by two faces intersection.
858      *  \param theFace1 First of two faces, defining the line.
859      *  \param theFace2 Second of two faces, defining the line.
860      *  \return New GEOM_Object, containing the created line.
861      */
862     GEOM_Object MakeLineTwoFaces (in GEOM_Object theFace1, in GEOM_Object theFace2);
863
864     /*!
865      *  \brief Create a plane, passing through the three given points
866      *  \param thePnt1 First of three points, defining the plane.
867      *  \param thePnt2 Second of three points, defining the plane.
868      *  \param thePnt3 Fird of three points, defining the plane.
869      *  \param theTrimSize Half size of a side of quadrangle face, representing the plane.
870      *  \return New GEOM_Object, containing the created plane.
871      */
872     GEOM_Object MakePlaneThreePnt (in GEOM_Object thePnt1,
873                                    in GEOM_Object thePnt2,
874                                    in GEOM_Object thePnt3,
875                                    in double theTrimSize);
876
877     /*!
878      *  \brief Create a plane, passing through the given point
879      *  and normal to the given vector.
880      *  \param thePnt Point, the plane has to pass through.
881      *  \param theVec Vector, defining the plane normal direction.
882      *  \param theTrimSize Half size of a side of quadrangle face, representing the plane.
883      *  \return New GEOM_Object, containing the created plane.
884      */
885     GEOM_Object MakePlanePntVec (in GEOM_Object thePnt,
886                                  in GEOM_Object theVec,
887                                  in double theTrimSize);
888
889     /*!
890      *  \brief Create a plane, similar to the existing one, but with another size of representing face.
891      *  \param theFace Referenced plane or LCS(Marker).
892      *  \param theTrimSize New half size of a side of quadrangle face, representing the plane.
893      *  \return New GEOM_Object, containing the created plane.
894      */
895     GEOM_Object MakePlaneFace (in GEOM_Object theFace,
896                                in double theTrimSize);
897
898     /*!
899      *  \brief Create a plane, by two vectors.
900      *  \param theVec1 Vector1, the plane has to pass through first point of this vector.
901      *  \param theVec2 Vector2, defining the plane normal direction.
902      *  \param theTrimSize Half size of a side of quadrangle face, representing the plane.
903      *  \return New GEOM_Object, containing the created plane.
904      */
905     GEOM_Object MakePlane2Vec (in GEOM_Object theVec1,
906                                in GEOM_Object theVec2,
907                                in double theTrimSize);
908
909     /*!
910      *  \brief Create a plane, defined by local coordinate system.
911      *  \param theLCS Referenced LCS(Marker).
912      *  \param theTrimSize Half size of a side of quadrangle face, representing the plane.
913      *  \param theOrientation OXY, OYZ or OZX orientation = (1, 2 or 3).
914      *  \return New GEOM_Object, containing the created plane.
915      */
916     GEOM_Object MakePlaneLCS (in GEOM_Object theLCS,
917                               in double theTrimSize,
918                               in double theOrientation);
919
920     /*!
921      *  \brief Create a local coordinate system.
922      *  \param theOX,theOY,theOZ Three coordinates of coordinate system origin.
923      *  \param theXDX,theXDY,theXDZ Three components of OX direction
924      *  \param theYDX,theYDY,theYDZ Three components of OY direction
925      *  \return New GEOM_Object, containing the created coordinate system.
926      */
927     GEOM_Object MakeMarker (in double theOX , in double theOY , in double theOZ,
928                             in double theXDX, in double theXDY, in double theXDZ,
929                             in double theYDX, in double theYDY, in double theYDZ);
930
931     /*!
932      *  \brief Create a local coordinate system from shape.
933      *  \param theShape The initial shape to detect the coordinate system.
934      *  \return New GEOM_Object, containing the created coordinate system.
935      */
936     GEOM_Object MakeMarkerFromShape (in GEOM_Object theShape);
937
938     /*!
939      *  \brief Create a local coordinate system from point and two vectors (DX, DY).
940      *  \param theOrigin Point of coordinate system origin.
941      *  \param theXVec Vector of X direction.
942      *  \param theYVec Vector of Y direction.
943      *  \return New GEOM_Object, containing the created coordinate system.
944      */
945     GEOM_Object MakeMarkerPntTwoVec (in GEOM_Object theOrigin,
946                                      in GEOM_Object theXVec, in GEOM_Object theYVec);
947
948     /*!
949      *  \brief Create a tangent plane to specified face in the point with specified parameters.
950      *
951      *  Values of parameters should be between 0. and 1.0
952      *  \param theFace - face for which tangent plane shuold be built.
953      *  \param theParameterU - value of parameter by U
954      *  \param theParameterV - value of parameter Vthe
955      *  \param theTrimSize - defines sizes of created face
956      *  \return New GEOM_Object, containing the face built on tangent plane.
957      */
958     GEOM_Object MakeTangentPlaneOnFace(in GEOM_Object theFace,
959                                        in double theParameterU,
960                                        in double theParameterV,
961                                        in double theTrimSize);
962   };
963
964   /*!
965    *  \brief Interface for shapes transforming.
966    *
967    *  Translation, rotation, scaling, mirroring, offset, projection, recomputing.
968    */
969   interface GEOM_ITransformOperations : GEOM_IOperations
970   {
971     /*!
972      *  \brief Translate the given object along the vector, specified by its end points.
973      *  \param theObject The object to be translated.
974      *  \param thePoint1 Start point of translation vector.
975      *  \param thePoint2 End point of translation vector.
976      *  \return theObject.
977      */
978     GEOM_Object TranslateTwoPoints (in GEOM_Object theObject,
979                                     in GEOM_Object thePoint1,
980                                     in GEOM_Object thePoint2);
981
982     /*!
983      *  \brief Translate the given object along the vector, specified
984      *  by its end points, creating its copy before the translation.
985      *  \param theObject The object to be translated.
986      *  \param thePoint1 Start point of translation vector.
987      *  \param thePoint2 End point of translation vector.
988      *  \return New GEOM_Object, containing the translated object.
989      */
990     GEOM_Object TranslateTwoPointsCopy (in GEOM_Object theObject,
991                                         in GEOM_Object thePoint1,
992                                         in GEOM_Object thePoint2);
993
994     /*!
995      *  \brief Translate the given object along the vector, specified by its components.
996      *  \param theObject The object to be translated.
997      *  \param theDX,theDY,theDZ Components of translation vector.
998      *  \return theObject.
999      */
1000     GEOM_Object TranslateDXDYDZ (in GEOM_Object theObject,
1001                                  in double theDX, in double theDY, in double theDZ);
1002
1003     /*!
1004      *  \brief Translate the given object along the vector, specified
1005      *  by its components, creating its copy before the translation.
1006      *  \param theObject The object to be translated.
1007      *  \param theDX,theDY,theDZ Components of translation vector.
1008      *  \return New GEOM_Object, containing the translated object.
1009      */
1010     GEOM_Object TranslateDXDYDZCopy (in GEOM_Object theObject,
1011                                      in double theDX, in double theDY, in double theDZ);
1012
1013
1014     /*!
1015      *  \brief Translate the given object along the given vector.
1016      *  \param theObject The object to be translated.
1017      *  \param theVector Translation vector, giving both direction and distance.
1018      *  \return theObject.
1019      */
1020     GEOM_Object TranslateVector (in GEOM_Object theObject,
1021                                  in GEOM_Object theVector);
1022
1023     /*!
1024      *  \brief Translate the given object along the given vector,
1025      *  creating its copy before the translation.
1026      *  \param theObject The object to be translated.
1027      *  \param theVector Translation vector, giving both direction and distance.
1028      *  \return New GEOM_Object, containing the translated object.
1029      */
1030     GEOM_Object TranslateVectorCopy (in GEOM_Object theObject,
1031                                      in GEOM_Object theVector);
1032
1033     /*!
1034      *  \brief Translate the given object along the given vector on given distance,
1035      *  creating its copy before the translation.
1036      *  \param theObject The object to be translated.
1037      *  \param theVector Translation vector, giving a direction.
1038      *  \param theDistance Translation distance, giving a distance.
1039      *  \param theCopy Translation copy, creating its copy if true.
1040      *  \return New GEOM_Object, containing the translated object.
1041      */
1042     GEOM_Object TranslateVectorDistance (in GEOM_Object theObject,
1043                                          in GEOM_Object theVector,
1044                                          in double      theDistance,
1045                                          in boolean     theCopy);
1046
1047     /*!
1048      *  \brief Translate the given object along the given vector a given number times
1049      *  \param theObject The object to be translated.
1050      *  \param theVector Direction of the translation. DX if None.
1051      *  \param theStep Distance to translate on.
1052      *  \param theNbTimes Quantity of translations to be done.
1053      *  \return New GEOM_Object, containing compound of all
1054      *          the shapes, obtained after each translation.
1055      */
1056     GEOM_Object MultiTranslate1D (in GEOM_Object theObject,
1057                                   in GEOM_Object theVector,
1058                                   in double theStep,
1059                                   in long theNbTimes);
1060
1061     /*!
1062      *  \brief Conseqently apply two specified translations to theObject specified number of times.
1063      *  \param theObject The object to be translated.
1064      *  \param theVector1 Direction of the first translation. DX if None.
1065      *  \param theStep1 Step of the first translation.
1066      *  \param theNbTimes1 Quantity of translations to be done along theVector1.
1067      *  \param theVector2 Direction of the second translation. DY if None.
1068      *  \param theStep2 Step of the second translation.
1069      *  \param theNbTimes2 Quantity of translations to be done along theVector2.
1070      *  \return New GEOM_Object, containing compound of all
1071      *          the shapes, obtained after each translation.
1072      */
1073     GEOM_Object MultiTranslate2D (in GEOM_Object theObject,
1074                                   in GEOM_Object theVector1,
1075                                   in double theStep1,
1076                                   in long theNbTimes1,
1077                                   in GEOM_Object theVector2,
1078                                   in double theStep2,
1079                                   in long theNbTimes2);
1080
1081     /*!
1082      *  \brief Rotate given object around vector perpendicular to plane containing three points.
1083      *  \param theObject The object to be rotated.
1084      *  \param theCentPoint central point - the axis is the vector perpendicular to the plane
1085      *                      containing the three points.
1086      *  \param thePoint1,thePoint2 - in a perpendicular plan of the axis.
1087      *  \return theObject.
1088      */
1089     GEOM_Object RotateThreePoints (in GEOM_Object theObject,
1090                                    in GEOM_Object theCentPoint,
1091                                    in GEOM_Object thePoint1,
1092                                    in GEOM_Object thePoint2);
1093
1094
1095     /*!
1096      *  \brief Rotate given object around vector perpendicular to plane containing three points.
1097      *
1098      *  Creating its copy before the rotatation.
1099      *  \param theObject The object to be rotated.
1100      *  \param theCentPoint central point - the axis is the vector perpendicular to the plane
1101      *  containing the three points.
1102      *  \param thePoint1,thePoint2 - in a perpendicular plan of the axis.
1103      *  \return New GEOM_Object, containing the rotated object.
1104      */
1105     GEOM_Object RotateThreePointsCopy (in GEOM_Object theObject,
1106                                        in GEOM_Object theCentPoint,
1107                                        in GEOM_Object thePoint1,
1108                                        in GEOM_Object thePoint2);
1109
1110     /*!
1111      *  \brief Rotate the given object around the given axis on the given angle.
1112      *  \param theObject The object to be rotated.
1113      *  \param theAxis Rotation axis.
1114      *  \param theAngle Rotation angle in radians.
1115      *  \return theObject.
1116      */
1117     GEOM_Object Rotate (in GEOM_Object theObject,
1118                         in GEOM_Object theAxis,
1119                         in double theAngle);
1120
1121
1122     /*!
1123      *  Rotate the given object around the given axis
1124      *  on the given angle, creating its copy before the rotatation.
1125      *  \param theObject The object to be rotated.
1126      *  \param theAxis Rotation axis.
1127      *  \param theAngle Rotation angle in radians.
1128      *  \return New GEOM_Object, containing the rotated object.
1129      */
1130     GEOM_Object RotateCopy (in GEOM_Object theObject,
1131                             in GEOM_Object theAxis,
1132                             in double theAngle);
1133
1134     /*!
1135      *  \brief Rotate the given object around the given axis a given number times.
1136      *
1137      *  Rotation angle will be 2*PI/theNbObjects.
1138      *  \param theObject The object to be rotated.
1139      *  \param theAxis The rotation axis. DZ if None.
1140      *  \param theNbObjects Quantity of rotations to be done.
1141      *  \return New GEOM_Object, containing compound of all the
1142      *          shapes, obtained after each rotation.
1143      */
1144     GEOM_Object MultiRotate1D (in GEOM_Object theObject,
1145                                in GEOM_Object theAxis,
1146                                in long theNbObjects);
1147
1148     /*!
1149      *  \brief Rotate the given object around the given axis
1150      *         a given number times on the given angle.
1151      *
1152      *  \param theObject The object to be rotated.
1153      *  \param theAxis The rotation axis. DZ if None.
1154      *  \param theAngleStep Rotation angle in radians.
1155      *  \param theNbSteps Quantity of rotations to be done.
1156      *  \return New GEOM_Object, containing compound of all the
1157      *          shapes, obtained after each rotation.
1158      */
1159     GEOM_Object MultiRotate1DByStep (in GEOM_Object theObject,
1160                                      in GEOM_Object theAxis,
1161                                      in double theAngleStep,
1162                                      in long theNbSteps);
1163
1164     /*!
1165      *  \brief Rotate the given object around the given axis
1166      *  a given number times and multi-translate each rotation result.
1167      *
1168      *  Rotation angle will be 2*PI/theNbObjects.
1169      *  Translation direction passes through center of gravity
1170      *  of rotated shape and its projection on the rotation axis.
1171      *  \param theObject The object to be rotated.
1172      *  \param theAxis Rotation axis. DZ if None.
1173      *  \param theNbObjects Quantity of rotations to be done.
1174      *  \param theRadialStep Translation distance.
1175      *  \param theNbSteps Quantity of translations to be done.
1176      *  \return New GEOM_Object, containing compound of all the
1177      *          shapes, obtained after each transformation.
1178      */
1179     GEOM_Object MultiRotate2DNbTimes (in GEOM_Object theObject,
1180                                       in GEOM_Object theAxis,
1181                                       in long theNbObjects,
1182                                       in double theRadialStep,
1183                                       in long theNbSteps);
1184
1185     /*!
1186      *  \brief Rotate the given object around the
1187      *  given axis on the given angle a given number
1188      *  times and multi-translate each rotation result.
1189      *
1190      *  Translation direction passes through center of gravity
1191      *  of rotated shape and its projection on the rotation axis.
1192      *  \param theObject The object to be rotated.
1193      *  \param theAxis Rotation axis. DZ if None.
1194      *  \param theAngleStep Rotation angle in radians.
1195      *  \param theNbSteps1 Quantity of rotations to be done.
1196      *  \param theRadialStep Translation distance.
1197      *  \param theNbSteps2 Quantity of translations to be done.
1198      *  \return New GEOM_Object, containing compound of all the
1199      *          shapes, obtained after each transformation.
1200      */
1201     GEOM_Object MultiRotate2DByStep (in GEOM_Object theObject,
1202                                      in GEOM_Object theAxis,
1203                                      in double theAngleStep,
1204                                      in long theNbSteps1,
1205                                      in double theRadialStep,
1206                                      in long theNbSteps2);
1207
1208     /*!
1209      *  \brief Rotate the given object around the
1210      *  given axis on the given angle a given number
1211      *  times and multi-translate each rotation result.
1212      *
1213      *  Translation direction passes through center of gravity
1214      *  of rotated shape and its projection on the rotation axis.
1215      *  \param theObject The object to be rotated.
1216      *  \param theAxis Rotation axis. DZ if None.
1217      *  \param theAngleStep Rotation angle in degrees.
1218      *  \param theNbSteps1 Quantity of rotations to be done.
1219      *  \param theRadialStep Translation distance.
1220      *  \param theNbSteps2 Quantity of translations to be done.
1221      *  \return New GEOM_Object, containing compound of all the
1222      *          shapes, obtained after each transformation.
1223      */
1224     GEOM_Object MultiRotate2D (in GEOM_Object theObject,
1225                                in GEOM_Object theAxis,
1226                                in double theAngleStep,
1227                                in long theNbSteps1,
1228                                in double theRadialStep,
1229                                in long theNbSteps2);
1230
1231     /*!
1232      *  \brief Replace the given object by an object,
1233      *  symmetrical to it relatively the given plane.
1234      *  \param theObject The object to be mirrored.
1235      *  \param thePlane Plane of symmetry.
1236      */
1237     GEOM_Object MirrorPlane (in GEOM_Object theObject, in GEOM_Object thePlane);
1238
1239     /*!
1240      *  \brief Create an object, symmetrical
1241      *  to the given one relatively the given plane.
1242      *  \param theObject The object to be mirrored.
1243      *  \param thePlane Plane of symmetry.
1244      *  \return New GEOM_Object, containing the mirrored shape.
1245      */
1246     GEOM_Object MirrorPlaneCopy (in GEOM_Object theObject, in GEOM_Object thePlane);
1247
1248     /*!
1249      *  \brief Replace the given object by an object,
1250      *  symmetrical to it relatively the given axis.
1251      *  \param theObject The object to be mirrored.
1252      *  \param theAxis Axis of symmetry.
1253      *  \return theObject.
1254      */
1255     GEOM_Object MirrorAxis (in GEOM_Object theObject, in GEOM_Object theAxis);
1256
1257     /*!
1258      *  \brief Create an object, symmetrical
1259      *  to the given one relatively the given axis.
1260      *  \param theObject The object to be mirrored.
1261      *  \param theAxis Axis of symmetry.
1262      *  \return New GEOM_Object, containing the mirrored object.
1263      */
1264     GEOM_Object MirrorAxisCopy (in GEOM_Object theObject, in GEOM_Object theAxis);
1265
1266     /*!
1267      *  \brief Replace the given object by an object, symmetrical to it relatively the given point.
1268      *  \param theObject The object to be mirrored.
1269      *  \param thePoint Point of symmetry.
1270      *  \return theObject.
1271      */
1272     GEOM_Object MirrorPoint (in GEOM_Object theObject, in GEOM_Object thePoint);
1273
1274     /*!
1275      *  \brief Create an object, symmetrical to the given one relatively the given point.
1276      *  \param theObject The object to be mirrored.
1277      *  \param thePoint Point of symmetry.
1278      *  \return New GEOM_Object, containing the mirrored object.
1279      */
1280     GEOM_Object MirrorPointCopy (in GEOM_Object theObject, in GEOM_Object thePoint);
1281
1282     /*!
1283      *  \brief Replace the given object by its offset.
1284      *  \param theObject The base object for the offset.
1285      *  \param theOffset Offset value.
1286      *  \return theObject.
1287      */
1288     GEOM_Object OffsetShape (in GEOM_Object theObject, in double theOffset);
1289
1290     /*!
1291      *  \brief Create new object as offset of the given one.
1292      *  \param theObject The base object for the offset.
1293      *  \param theOffset Offset value.
1294      *  \return New GEOM_Object, containing the offset object.
1295      */
1296     GEOM_Object OffsetShapeCopy (in GEOM_Object theObject, in double theOffset);
1297
1298     /*!
1299      *  \brief Create new object as projection of the given one on a 2D surface.
1300      *  \param theSource The source object for the projection. It can be a point, edge or wire.
1301      *  \param theTarget The target object. It can be planar or cylindrical face.
1302      *  \return New GEOM_Object, containing the projection.
1303      */
1304     GEOM_Object ProjectShapeCopy (in GEOM_Object theSource, in GEOM_Object theTarget);
1305
1306     /*!
1307      *  \brief Create a projection projection of the given point on a wire or
1308      *  an edge.
1309      *
1310      *  If there are no solutions or there are 2 or more solutions It throws an
1311      *  exception.
1312      *  \param thePoint the point to be projected.
1313      *  \param theWire the wire. The edge is accepted as well.
1314      *  \param thePointOnEdge the projection point.
1315      *  \param theEdgeInWireIndex the index of an edge in a wire.
1316      *  \return the parameter of projection point on edge.
1317      */
1318     double ProjectPointOnWire (in  GEOM_Object thePoint,
1319                                in  GEOM_Object theWire,
1320                                out GEOM_Object thePointOnEdge,
1321                                out long        theEdgeInWireIndex);
1322
1323     /*!
1324      *  \brief Scale the given object by the factor.
1325      *  \param theObject The object to be scaled.
1326      *  \param thePoint Center point for scaling.
1327      *  \param theFactor Scaling factor value.
1328      *  \return theObject.
1329      */
1330     GEOM_Object ScaleShape (in GEOM_Object theObject, in GEOM_Object thePoint,
1331                             in double theFactor);
1332
1333     /*!
1334      *  \brief Scale the given object by the factor, creating its copy before the scaling.
1335      *  \param theObject The object to be scaled.
1336      *  \param thePoint Center point for scaling.
1337      *  \param theFactor Scaling factor value.
1338      *  \return New GEOM_Object, containing the scaled shape.
1339      */
1340     GEOM_Object ScaleShapeCopy (in GEOM_Object theObject, in GEOM_Object thePoint,
1341                                 in double theFactor);
1342
1343     /*!
1344      *  \brief Scale the given object by different factors along coordinate axes.
1345      *  \param theObject The object to be scaled.
1346      *  \param thePoint Center point for scaling.
1347      *  \param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
1348      *  \return theObject.
1349      */
1350     GEOM_Object ScaleShapeAlongAxes (in GEOM_Object theObject,
1351                                      in GEOM_Object thePoint,
1352                                      in double theFactorX,
1353                                      in double theFactorY,
1354                                      in double theFactorZ);
1355
1356     /*!
1357      *  \brief Scale the given object by different factors along coordinate axes,
1358      *  creating its copy before the scaling.
1359      *  \param theObject The object to be scaled.
1360      *  \param thePoint Center point for scaling.
1361      *  \param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
1362      *  \return New GEOM_Object, containing the scaled shape.
1363      */
1364     GEOM_Object ScaleShapeAlongAxesCopy (in GEOM_Object theObject,
1365                                          in GEOM_Object thePoint,
1366                                          in double theFactorX,
1367                                          in double theFactorY,
1368                                          in double theFactorZ);
1369
1370     /*!
1371      *  \brief Modify the Location of the given object by LCS.
1372      *  \param theObject The object to be displaced.
1373      *  \param theStartLCS Coordinate system to perform displacement from it.
1374      *                     If \a theStartLCS is NULL, displacement
1375      *                     will be performed from global CS.
1376      *                     If \a theObject itself is used as \a theStartLCS,
1377      *                     its location will be changed to \a theEndLCS.
1378      *  \param theEndLCS Coordinate system to perform displacement to it.
1379      *  \return theObject.
1380      */
1381     GEOM_Object PositionShape (in GEOM_Object theObject,
1382                                in GEOM_Object theStartLCS,
1383                                in GEOM_Object theEndLCS);
1384
1385     /*!
1386      *  \brief Modify the Location of the given object by LCS,
1387      *  creating its copy before the setting.
1388      *  \param theObject The object to be displaced.
1389      *  \param theStartLCS Coordinate system to perform displacement from it.
1390      *                     If \a theStartLCS is NULL, displacement
1391      *                     will be performed from global CS.
1392      *                     If \a theObject itself is used as \a theStartLCS,
1393      *                     its location will be changed to \a theEndLCS.
1394      *  \param theEndLCS Coordinate system to perform displacement to it.
1395      *  \return New GEOM_Object, containing the displaced shape.
1396      */
1397     GEOM_Object PositionShapeCopy (in GEOM_Object theObject,
1398                                    in GEOM_Object theStartLCS,
1399                                    in GEOM_Object theEndLCS);
1400
1401     /*!
1402      *  \brief Modify the Location of the given object by Path,
1403      *  \param  theObject The object to be displaced.
1404      *  \param  thePath Wire or Edge along that the object will be translated.
1405      *  \param  theDistance progress of Path (0 = actual location, 1 = end of path location).
1406      *  \param  theCopy is a true or false parameter. true is to create a copy, false to move the object.
1407      *  \param  theReverse is a true or false parameter. True is to reverse
1408      *                     direction, false is to move normal direction.
1409      *  \return New GEOM_Object, containing the displaced shape.
1410      */
1411     GEOM_Object PositionAlongPath (in GEOM_Object theObject,
1412                                    in GEOM_Object thePath,
1413                                    in double theDistance,
1414                                    in boolean theCopy,
1415                                    in boolean theReverse);
1416
1417     /*!
1418      *  \brief Recompute the shape from its arguments.
1419      *  \param theObject The object to be recomputed.
1420      *  \return theObject.
1421      */
1422     GEOM_Object RecomputeObject (in GEOM_Object theObject);
1423
1424     /*!
1425      *  \brief Compute the projection of a wire or a face on a cylinder.
1426      *
1427      *  This method computes a wire or a face or a compound of faces
1428      *  that represents a projection of the source shape onto cylinder.
1429      *  The cylinder's coordinate system is the same as the global coordinate
1430      *  system.
1431      *
1432      *  \param theObject The object to be projected. It can be either
1433      *         a planar wire or a face.
1434      *  \param theRadius The radius of the cylinder.
1435      *  \param theStartAngle The starting angle from the cylinder's X axis
1436      *         around Z axis. The angle from which the projection is started.
1437      *  \param theAngleLength The projection length angle. The angle in which
1438      *         to project the total length of the wire. If it is negative the
1439      *         projection is not scaled and natural wire length is kept for
1440      *         the projection.
1441      *  \return A wire or a face or a compound of faces that represents a
1442      *         projection of the source shape onto a cylinder.
1443      */
1444     GEOM_Object MakeProjectionOnCylinder (in GEOM_Object theObject,
1445                                           in double      theRadius,
1446                                           in double      theStartAngle,
1447                                           in double      theAngleLength);
1448   };
1449   
1450   /*!
1451    *  \brief Interface for 3D primitives creation
1452    *
1453    *  Box, Cylinder, Cone, Sphere, Prism (extrusion),
1454    *  Pipe (extrusion along contour), Revolution, Solid (from shell).
1455    */
1456   interface GEOM_I3DPrimOperations : GEOM_IOperations
1457   {
1458     /*!
1459      *  \brief Create a box with specified dimensions along the coordinate axes
1460      *  and with edges, parallel to the coordinate axes.
1461      *
1462      *  Center of the box will be at point (DX/2, DY/2, DZ/2).
1463      *  \param theDX Length of Box edges, parallel to OX axis.
1464      *  \param theDY Length of Box edges, parallel to OY axis.
1465      *  \param theDZ Length of Box edges, parallel to OZ axis.
1466      *  \return New GEOM_Object, containing the created box.
1467      */
1468     GEOM_Object MakeBoxDXDYDZ (in double theDX, in double theDY, in double theDZ);
1469
1470     /*!
1471      *  \brief Create a box with two specified opposite vertices,
1472      *  and with edges, parallel to the coordinate axes
1473      *  \param thePnt1 First of two opposite vertices.
1474      *  \param thePnt2 Second of two opposite vertices.
1475      *  \return New GEOM_Object, containing the created box.
1476      */
1477     GEOM_Object MakeBoxTwoPnt (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
1478
1479     /*!
1480      *  \brief Create a face specified dimensions along OX-OY coordinate axes,
1481      *  with edges parallel to the coordinate axes.
1482      *
1483      *  Center of the face will be at point (0, 0, 0).
1484      *  \param theH Height of the Face.
1485      *  \param theW Width of the Face.
1486      *  \param theOrientation Orientation belong axis OXY OYZ OZX
1487      *  \return New GEOM_Object, containing the created face.
1488      */
1489     GEOM_Object MakeFaceHW (in double theH, in double theW, in short theOrientation);
1490     /*!
1491      *  \brief Create a face by normale vector or edge and two specified sizes,
1492      *  vertical (H) and horisontal (W).
1493      *  \param theObj defines plane.
1494      *  \param theH vertical size (height).
1495      *  \param theW horisontal size (width).
1496      *  \return New GEOM_Object, containing the created face.
1497      */
1498     GEOM_Object MakeFaceObjHW (in GEOM_Object theObj, in double theH, in double theW);
1499     /*!
1500      *  \brief Create a Disk (circular face) with given center, normal vector and radius.
1501      *  \param thePnt disk center.
1502      *  \param theVec Vector, normal to the plane of the disk.
1503      *  \param theR Disk radius.
1504      *  \return New GEOM_Object, containing the created disk.
1505      */
1506     GEOM_Object MakeDiskPntVecR (in GEOM_Object thePnt,
1507                                  in GEOM_Object theVec,
1508                                  in double theR);
1509     /*!
1510      *  \brief Create a disk (circular face), passing through three given points
1511      *  \param thePnt1, thePnt2, thePnt3 Points, defining the disk.
1512      *  \return New GEOM_Object, containing the created disk.
1513      */
1514     GEOM_Object MakeDiskThreePnt (in GEOM_Object thePnt1,
1515                                   in GEOM_Object thePnt2,
1516                                   in GEOM_Object thePnt3);
1517
1518     /*!
1519      *  \brief Create a disk specified dimensions along OX-OY coordinate axes.
1520      *
1521      *  Center of the disk at point (0, 0, 0).
1522      *  \param theR of the Disk.
1523      *  \param theOrientation Orientation belong axis OXY OYZ OZX
1524      *  \return New GEOM_Object, containing the created disk.
1525      */
1526     GEOM_Object MakeDiskR (in double theR, in short theOrientation);
1527
1528     /*!
1529      *  \brief Create a cylinder with given radius and height at
1530      *  the origin of coordinate system.
1531      *
1532      *  Axis of the cylinder will be collinear to the OZ axis of the coordinate system.
1533      *  \param theR Cylinder radius.
1534      *  \param theH Cylinder height.
1535      *  \return New GEOM_Object, containing the created cylinder.
1536      */
1537     GEOM_Object MakeCylinderRH (in double theR, in double theH);
1538
1539     /*!
1540      *  \brief Create a portion of cylinder with given radius, height and angle at
1541      *  the origin of coordinate system.
1542      *
1543      *  Axis of the cylinder will be collinear to the OZ axis of the coordinate system.
1544      *  \param theR Cylinder radius.
1545      *  \param theH Cylinder height.
1546      *  \param theA Cylinder angle.
1547      *  \return New GEOM_Object, containing the created cylinder.
1548      */
1549     GEOM_Object MakeCylinderRHA (in double theR, in double theH, in double theA);
1550
1551     /*!
1552      *  \brief Create a cylinder with given base point, axis, radius and height.
1553      *  \param thePnt Central point of cylinder base.
1554      *  \param theAxis Cylinder axis.
1555      *  \param theR Cylinder radius.
1556      *  \param theH Cylinder height.
1557      *  \return New GEOM_Object, containing the created cylinder.
1558      */
1559     GEOM_Object MakeCylinderPntVecRH (in GEOM_Object thePnt,
1560                                       in GEOM_Object theAxis,
1561                                       in double      theR,
1562                                       in double      theH);
1563     /*!
1564      *  \brief Create a portion of cylinder with given base point, axis, radius, height and angle.
1565      *  \param thePnt Central point of cylinder base.
1566      *  \param theAxis Cylinder axis.
1567      *  \param theR Cylinder radius.
1568      *  \param theH Cylinder height.
1569      *  \param theA Cylinder angle.
1570      *  \return New GEOM_Object, containing the created cylinder.
1571      */
1572     GEOM_Object MakeCylinderPntVecRHA (in GEOM_Object thePnt,
1573                                       in GEOM_Object theAxis,
1574                                       in double      theR,
1575                                       in double      theH,
1576                                       in double      theA);
1577
1578     /*!
1579      *  \brief Create a cone with given height and radiuses at
1580      *  the origin of coordinate system. 
1581      *
1582      *  Axis of the cone will be collinear to the OZ axis of the coordinate system.
1583      *  \param theR1 Radius of the first cone base.
1584      *  \param theR2 Radius of the second cone base.
1585      *    \note If both radiuses are non-zero, the cone will be truncated.
1586      *    \note If the radiuses are equal, a cylinder will be created instead.
1587      *  \param theH Cone height.
1588      *  \return New GEOM_Object, containing the created cone.
1589      */
1590     GEOM_Object MakeConeR1R2H (in double theR1, in double theR2, in double theH);
1591
1592     /*!
1593      *  \brief Create a cone with given base point, axis, height and radiuses.
1594      *  \param thePnt Central point of the first cone base.
1595      *  \param theAxis Cone axis.
1596      *  \param theR1 Radius of the first cone base.
1597      *  \param theR2 Radius of the second cone base.
1598      *    \note If both radiuses are non-zero, the cone will be truncated.
1599      *    \note If the radiuses are equal, a cylinder will be created instead.
1600      *  \param theH Cone height.
1601      *  \return New GEOM_Object, containing the created cone.
1602      */
1603     GEOM_Object MakeConePntVecR1R2H (in GEOM_Object thePnt,
1604                                      in GEOM_Object theAxis,
1605                                      in double      theR1,
1606                                      in double      theR2,
1607                                      in double      theH);
1608
1609     /*!
1610      *  \brief Create a torus with given radiuses at the origin of coordinate system.
1611      *  \param theRMajor Torus major radius.
1612      *  \param theRMinor Torus minor radius.
1613      *  \return New GEOM_Object, containing the created torus.
1614      */
1615     GEOM_Object MakeTorusRR (in double theRMajor,
1616                              in double theRMinor);
1617
1618     /*!
1619      *  \brief Create a torus with given center, normal vector and radiuses.
1620      *  \param thePnt Torus central point.
1621      *  \param theVec Torus axis of symmetry.
1622      *  \param theRMajor Torus major radius.
1623      *  \param theRMinor Torus minor radius.
1624      *  \return New GEOM_Object, containing the created torus.
1625      */
1626     GEOM_Object MakeTorusPntVecRR (in GEOM_Object thePnt,
1627                                    in GEOM_Object theVec,
1628                                    in double theRMajor,
1629                                    in double theRMinor);
1630
1631     /*!
1632      *  \brief Create a sphere with given radius at the origin of coordinate system.
1633      *  \param theR Sphere radius.
1634      *  \return New GEOM_Object, containing the created sphere.
1635      */
1636     GEOM_Object MakeSphereR (in double theR);
1637
1638     /*!
1639      *  \brief Create a sphere with given center and radius.
1640      *  \param thePnt Sphere center.
1641      *  \param theR Sphere radius.
1642      *  \return New GEOM_Object, containing the created .
1643      */
1644     GEOM_Object MakeSpherePntR (in GEOM_Object thePnt, in double theR);
1645
1646     /*!
1647      *  \brief Create a shape by extrusion of the base shape along the vector
1648      *
1649      *  All the space, transfixed by the base shape during its translation
1650      *  along the vector on the given distance.
1651      *  \param theBase Base shape to be extruded.
1652      *  \param theVec Direction of extrusion.
1653      *  \param theH Prism dimension along theVec.
1654      *  \return New GEOM_Object, containing the created prism.
1655      */
1656     GEOM_Object MakePrismVecH (in GEOM_Object theBase,
1657                                in GEOM_Object theVec,
1658                                in double      theH);
1659     /*  \brief The Same Prism but in 2 directions (forward&backward) */
1660     GEOM_Object MakePrismVecH2Ways (in GEOM_Object theBase,
1661                                     in GEOM_Object theVec,
1662                                     in double      theH);
1663     /*  \brief The Same as MakePrismVecH but with scaling */
1664     GEOM_Object MakePrismVecHWithScaling (in GEOM_Object theBase,
1665                                           in GEOM_Object theVec,
1666                                           in double      theH,
1667                                           in double      theScaleFactor);
1668
1669     /*!
1670      *  \brief Create a shape by extrusion of the base shape along a vector, defined by two points.
1671      *  \param theBase Base shape to be extruded.
1672      *  \param thePoint1 First end of extrusion vector.
1673      *  \param thePoint2 Second end of extrusion vector.
1674      *  \return New GEOM_Object, containing the created prism.
1675      */
1676     GEOM_Object MakePrismTwoPnt (in GEOM_Object theBase,
1677                                  in GEOM_Object thePoint1,
1678                                  in GEOM_Object thePoint2);
1679     /*  \brief The same prism but in two directions forward&backward */
1680     GEOM_Object MakePrismTwoPnt2Ways (in GEOM_Object theBase,
1681                                       in GEOM_Object thePoint1,
1682                                       in GEOM_Object thePoint2);
1683     /*  \brief The Same as MakePrismTwoPnt but with scaling */
1684     GEOM_Object MakePrismTwoPntWithScaling (in GEOM_Object theBase,
1685                                             in GEOM_Object thePoint1,
1686                                             in GEOM_Object thePoint2,
1687                                             in double      theScaleFactor);
1688
1689     /*!
1690      *  \brief Create a shape by extrusion of the base shape along a vector, defined by DX DY DZ.
1691      *  \param theBase Base shape to be extruded.
1692      *  \param theDX, theDY, theDZ end of extrusion vector.
1693      *  \return New GEOM_Object, containing the created prism.
1694      */
1695     GEOM_Object MakePrismDXDYDZ (in GEOM_Object theBase,
1696                                    in double theDX, in double theDY, in double theDZ);
1697     /*  \brief The same prism but in two directions forward&backward */
1698     GEOM_Object MakePrismDXDYDZ2Ways (in GEOM_Object theBase,
1699                                       in double theDX, in double theDY, in double theDZ);
1700     /*  \brief The Same as MakePrismDXDYDZ but with scaling */
1701     GEOM_Object MakePrismDXDYDZWithScaling (in GEOM_Object theBase,
1702                                             in double theDX, in double theDY, in double theDZ,
1703                                             in double theScaleFactor);
1704
1705
1706     /*!
1707      *  \brief Add / Remove material to / from  a solid by extrusion of the base shape on the given distance.
1708      *  \param theInitShape Initial shape on which to perform the feature.It has to be a solid or 
1709      *   a compound made of a single solid
1710      *  \param theBase Edge or wire defining the base shape to be extruded. 
1711      *  \param theHeight Prism dimension along the normal of the face.
1712      *  \param theAngle Draft angel in degrees
1713      *  \param theFuse If true material is added else material is removed
1714      *  \param theInvert If true material changes the direction 
1715      *  \return New GEOM_Object, containing the modified shape
1716      */
1717     GEOM_Object MakeDraftPrism (in GEOM_Object theInitShape,
1718                                 in GEOM_Object theBase,
1719                                 in double theHeight, 
1720                                 in double theAngle,
1721                                 in boolean theFuse,
1722                                 in boolean theInvert);
1723
1724     /*!
1725      *  \brief Create a shape by extrusion of the base shape along
1726      *  the path shape. The path shape can be a wire or an edge.
1727      *  \param theBase Base shape to be extruded.
1728      *  \param thePath Path shape to extrude the base shape along it.
1729      *  \return New GEOM_Object, containing the created pipe.
1730      */
1731     GEOM_Object MakePipe (in GEOM_Object theBase, in GEOM_Object thePath);
1732
1733     /*!
1734      *  \brief Create a shape by revolution of the base shape around the axis
1735      *  on the given angle. 
1736      *
1737      *  All the space, transfixed by the base
1738      *  shape during its rotation around the axis on the given angle.
1739      *  \param theBase Base shape to be rotated.
1740      *  \param theAxis Rotation axis.
1741      *  \param theAngle Rotation angle in radians.
1742      *  \return New GEOM_Object, containing the created revolution.
1743      */
1744     GEOM_Object MakeRevolutionAxisAngle (in GEOM_Object theBase,
1745                                          in GEOM_Object theAxis,
1746                                          in double theAngle);
1747     /*  The Same Revolution but in both ways forward&backward */
1748     GEOM_Object MakeRevolutionAxisAngle2Ways (in GEOM_Object theBase,
1749                                               in GEOM_Object theAxis,
1750                                               in double theAngle);
1751
1752     /*!
1753      *  \brief Create a face from a given set of contours.
1754      *  \param theContours either a list or a compound of edges/wires.
1755      *  \param theMinDeg a minimal degree of BSpline surface to create.
1756      *  \param theMaxDeg a maximal degree of BSpline surface to create.
1757      *  \param theTol2D a 2d tolerance to be reached.
1758      *  \param theTol3D a 3d tolerance to be reached.
1759      *  \param theNbIter a number of iteration of approximation algorithm.
1760      *  \param theMethod Kind of method to perform filling operation.
1761      *  \param theApprox Boolean indicating if result should be approximated.
1762      *  \return New GEOM_Object (face), containing the created filling surface.
1763      */
1764     GEOM_Object MakeFilling (in ListOfGO theContours,
1765                              in long theMinDeg, in long theMaxDeg,
1766                              in double theTol2D, in double theTol3D,
1767                              in long theNbIter,
1768                              in filling_oper_method theMethod,
1769                              in boolean theApprox);
1770
1771     /*!
1772      *  \brief Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1773      *  \param theSeqSections - set of specified sections.
1774      *  \param theModeSolid - mode defining building solid or shell
1775      *  \param thePreci - precision 3D used for smoothing by default 1.e-6
1776      *  \param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1777      *  \return New GEOM_Object, containing the created shell or solid.
1778      */
1779     GEOM_Object MakeThruSections(in ListOfGO theSeqSections,
1780                                  in boolean theModeSolid,
1781                                  in double thePreci,
1782                                  in boolean theRuled);
1783
1784      /*!
1785      *  \brief Create a shape by extrusion of the profile shape along
1786      *  the path shape. 
1787      *
1788      *  The path shape can be a wire or an edge.
1789      *  the several profiles can be specified in the several locations of path.
1790      *  \param theSeqBases - list of  Bases shape to be extruded.
1791      *  \param theLocations - list of locations on the path corresponding
1792      *                        specified list of the Bases shapes. Number of locations
1793      *                        should be equal to number of bases or list of locations can be empty.
1794      *  \param thePath - Path shape to extrude the base shape along it.
1795      *  \param theWithContact - the mode defining that the section is translated to be in
1796      *                          contact with the spine.
1797      *  \param theWithCorrection - defining that the section is rotated to be
1798      *                                 orthogonal to the spine tangent in the correspondent point
1799      *  \return New GEOM_Object, containing the created pipe.
1800      */
1801     GEOM_Object MakePipeWithDifferentSections (in ListOfGO theSeqBases,
1802                                                in ListOfGO theLocations,
1803                                                in GEOM_Object thePath,
1804                                                in boolean theWithContact ,
1805                                                in boolean theWithCorrection );
1806
1807     /*!
1808      *  \brief Create a shape by extrusion of the profile shape along
1809      *  the path shape. 
1810      *
1811      *  The path shape can be a shell or a face.
1812      *  the several profiles can be specified in the several locations of path.
1813      *  \param theSeqBases - list of  Bases shape to be extruded.
1814      *  \param theSeqSubBases - list of corresponding sub-shapes of section shapes.
1815      *  \param theLocations - list of locations on the path corresponding
1816      *                        specified list of the Bases shapes. Number of locations
1817      *                        should be equal to number of bases.
1818      *  \param thePath - Path shape to extrude the base shape along it.
1819      *  \param theWithContact - the mode defining that the section is translated to be in
1820      *                          contact with the spine.
1821      *  \param theWithCorrection - defining that the section is rotated to be
1822      *                                 orthogonal to the spine tangent in the correspondent point
1823      *  \return New GEOM_Object, containing the created pipe.
1824      */
1825     GEOM_Object MakePipeWithShellSections (in ListOfGO theSeqBases,
1826                                            in ListOfGO theSeqSubBases,
1827                                            in ListOfGO theLocations,
1828                                            in GEOM_Object thePath,
1829                                            in boolean theWithContact ,
1830                                            in boolean theWithCorrection );
1831
1832     /*!
1833      *  \brief Create solids between given sections
1834      *  \param theSeqBases - list of sections (shell or face).
1835      *  \param theLocations - list of corresponding vertexes
1836      *  \return New GEOM_Object, containing the created solids.
1837      */
1838     GEOM_Object MakePipeShellsWithoutPath (in ListOfGO theSeqBases,
1839                                            in ListOfGO theLocations);
1840
1841     /*!
1842      *  \brief Create a shape by extrusion of the base shape along
1843      *  the path shape with constant bi-normal direction along the given vector.
1844      *
1845      *  The path shape can be a wire or an edge.
1846      *  \param theBase Base shape to be extruded.
1847      *  \param thePath Path shape to extrude the base shape along it.
1848      *  \param theVec Vector defines a constant binormal direction to keep the
1849      *                same angle beetween the Direction and the sections
1850      *                along the sweep surface.
1851      *  \return New GEOM_Object, containing the created pipe.
1852      */
1853     GEOM_Object MakePipeBiNormalAlongVector (in GEOM_Object theBase,
1854                                              in GEOM_Object thePath,
1855                                              in GEOM_Object theVec);
1856
1857
1858      /*!
1859      *  \brief Make a thick solid from a shape.
1860      *
1861      *  If the input is a surface shape (face or shell) the result is
1862      *  a thick solid. If an input shape is a solid the result is a hollowed
1863      *  solid with removed faces.
1864      *  \param theObject face or shell to get thick solid or solid to get
1865      *         hollowed solid.
1866      *  \param theFacesIDs the list of face IDs to be removed from the result.
1867      *          It can be empty.
1868      *  \param theThickness Value of the thickness
1869      *  \param isCopy To make a copy of \a theObject or to modify \a theObject
1870      *  \param isInside If true the thickness is applied towards inside
1871      *  \return New GEOM_Object, containing the created pipe if isCopy = true
1872      *          or the modified object if isCopy = false
1873      */
1874     GEOM_Object MakeThickening (in GEOM_Object theObject,
1875                                 in ListOfLong  theFacesIDs,
1876                                 in double      theThickness,
1877                                 in boolean     isCopy,
1878                                 in boolean     isInside);
1879
1880     
1881     /*!
1882      *  \brief Build a middle path of a pipe-like shape.
1883      *
1884      *  The path shape can be a wire or an edge.
1885      *  \param theShape It can be closed or unclosed pipe-like shell
1886      *                  or a pipe-like solid.
1887      *  \param theBase1, theBase2 Two bases of the supposed pipe. This
1888      *                            should be wires or faces of \a theShape.
1889      *  \note It is not assumed that exact or approximate copy of \a theShape
1890      *        can be obtained by applying existing Pipe operation on the
1891      *        resulting "Path" wire taking \a theBase1 as the base - it is not
1892      *        always possible; though in some particular cases it might work
1893      *        it is not guaranteed. Thus, RestorePath function should not be
1894      *        considered as an exact reverse operation of the Pipe.
1895      *  \return New GEOM_Object, containing an edge or wire that represent
1896      *                           source pipe's "path".
1897      */
1898     GEOM_Object RestorePath (in GEOM_Object theShape,
1899                              in GEOM_Object theBase1,
1900                              in GEOM_Object theBase2);
1901
1902     /*!
1903      *  \brief Build a middle path of a pipe-like shape.
1904      *
1905      *  The path shape can be a wire or an edge.
1906      *  \param theShape It can be closed or unclosed pipe-like shell
1907      *                  or a pipe-like solid.
1908      *  \param theBase1, theBase2 Two bases of the supposed pipe. This
1909      *                            should be lists of edges of \a theShape.
1910      *  \note It is not assumed that exact or approximate copy of \a theShape
1911      *        can be obtained by applying existing Pipe operation on the
1912      *        resulting "Path" wire taking \a theBase1 as the base - it is not
1913      *        always possible; though in some particular cases it might work
1914      *        it is not guaranteed. Thus, RestorePath function should not be
1915      *        considered as an exact reverse operation of the Pipe.
1916      *  \return New GEOM_Object, containing an edge or wire that represent
1917      *                           source pipe's "path".
1918      */
1919     GEOM_Object RestorePathEdges (in GEOM_Object theShape,
1920                                   in ListOfGO theBase1,
1921                                   in ListOfGO theBase2);
1922   };
1923
1924   /*!
1925    *  \brief Interface for Shapes creation:
1926    *
1927    *  Edge from two points, Wire from edges, Face from wire,
1928    *  Shell from faces, Solid from shells, Compound from shapes
1929    */
1930   interface GEOM_IShapesOperations : GEOM_IOperations
1931   {
1932     /*!
1933      *  \brief Create a linear edge with specified ends.
1934      *  \param thePnt1 Point for the first end of edge.
1935      *  \param thePnt2 Point for the second end of edge.
1936      *  \return New GEOM_Object, containing the created edge.
1937      */
1938     GEOM_Object MakeEdge (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
1939
1940     /*!
1941      *  \brief Create an edge on another edge, corresponding to the given length on the given edge.
1942      *  \param theRefCurve The referenced edge.
1943      *  \param theLength Length on the referenced edge. It can be
1944      *                   negative for extrapolation on base curve.
1945      *  \param theStartPoint Any vertex close to one of edge's
1946      *                       ends to select start point among them.
1947      *                       If NULL, fist vertex is used.
1948      *  \return New GEOM_Object, containing the created edge.
1949      */
1950     GEOM_Object MakeEdgeOnCurveByLength (in GEOM_Object theRefCurve,
1951                                          in double      theLength,
1952                                          in GEOM_Object theStartPoint);
1953
1954     /*!
1955      *  \brief Create an edge from specified wire.
1956      *  \param theWire source Wire.
1957      *  \param theLinearTolerance linear tolerance value
1958      *  \param theAngularTolerance angular tolerance value
1959      *  \return New GEOM_Object, containing the created edge.
1960      */
1961     GEOM_Object MakeEdgeWire (in GEOM_Object theWire,
1962                               in double theLinearTolerance,
1963                               in double theAngularTolerance);
1964
1965     /*!
1966      *  \brief Create a wire from the set of edges and wires.
1967      *  \param theEdgesAndWires List of edge and/or wires.
1968      *  \param theTolerance Maximum distance between vertices, that will be merged.
1969      *                      Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1970      *  \return New GEOM_Object, containing the created wire.
1971      */
1972     GEOM_Object MakeWire (in ListOfGO theEdgesAndWires,
1973                           in double   theTolerance);
1974
1975     /*!
1976      *  \brief Create a face on the given wire.
1977      *  \param theWire closed Wire or Edge to build the face on.
1978      *  \param isPlanarWanted If TRUE, only planar face will be built.
1979      *                        If impossible, NULL object will be returned.
1980      *  \return New GEOM_Object, containing the created face.
1981      */
1982     GEOM_Object MakeFace (in GEOM_Object theWire, in boolean isPlanarWanted);
1983
1984     /*!
1985      *  \brief Create a face on the given wires set.
1986      *  \param theWires List of closed wires or edges to build the face on.
1987      *  \param isPlanarWanted If TRUE, only planar face will be built.
1988      *                        If impossible, NULL object will be returned.
1989      *  \return New GEOM_Object, containing the created face.
1990      */
1991     GEOM_Object MakeFaceWires (in ListOfGO theWires, in boolean isPlanarWanted);
1992
1993     /**
1994      *  \brief Create a face based on surface of theFace limited by theWire.
1995      *  \param theFace the face whose surface is used to create a new face.
1996      *  \param theWire closed Wire build the face.
1997      *  \return New GEOM_Object, containing the created face.
1998      */
1999     GEOM_Object MakeFaceFromSurface(in GEOM_Object theFace,
2000                                     in GEOM_Object theWire);
2001
2002     /*!
2003      *  \brief Create a face from a set of edges with the given constraints.
2004      *  \param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
2005      *         - edges should form a closed wire;
2006      *         - for each edge, constraint face is optional: if a constraint face is missing
2007      *           for some edge, this means that there no constraint associated with this edge.
2008      *  \return New GEOM_Object, containing the created face.
2009      */
2010     GEOM_Object MakeFaceWithConstraints(in ListOfGO theConstraints);
2011
2012     /*!
2013      *  \brief Create a shell from the set of faces and shells.
2014      *  \param theFacesAndShells List of faces and/or shells.
2015      *  \return New GEOM_Object, containing the created shell.
2016      */
2017     GEOM_Object MakeShell (in ListOfGO theFacesAndShells);
2018
2019     /*!
2020      *  \brief Create a solid, bounded by the given shell.
2021      *  \param theShell Bounding shell.
2022      *  \return New GEOM_Object, containing the created solid.
2023      */
2024     GEOM_Object MakeSolidShell (in GEOM_Object theShell);
2025
2026     /*!
2027      *  \brief Create a solid, bounded by the given shells.
2028      *  \param theShells Bounding shells.
2029      *  \return New GEOM_Object, containing the created solid.
2030      */
2031     GEOM_Object MakeSolidShells (in ListOfGO theShells);
2032
2033     /*!
2034      *  \brief Create a compound of the given shapes.
2035      *  \param theShapes List of shapes to put in compound.
2036      *  \return New GEOM_Object, containing the created compound.
2037      */
2038     GEOM_Object MakeCompound (in ListOfGO theShapes);
2039
2040     /*!
2041      *  \brief Make a solid (or solids) from connected set of faces and/or shells.
2042      *  \param theFacesOrShells List of faces and/or shells.
2043      *  \param isIntersect If TRUE, forces performing intersections between arguments.
2044      *
2045      *  \return New GEOM_Object, containing the created solid (or compound of solids).
2046      */
2047     GEOM_Object MakeSolidFromConnectedFaces (in ListOfGO theFacesOrShells, in boolean isIntersect);
2048     
2049     /*!
2050      *  \brief Replace coincident faces in \a theShapes by one face.
2051      *  \param theShapes Initial shapes.
2052      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
2053      *  \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
2054      *  \return New GEOM_Object containing copies of theShapes without coincident faces.
2055      */
2056     GEOM_Object MakeGlueFaces (in ListOfGO theShapes, in double theTolerance, in boolean doKeepNonSolids);
2057
2058     /*!
2059      *  Find coincident faces in theShapes for possible gluing.
2060      *  \param theShapes Initial shapes.
2061      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
2062      *  \return ListOfGO
2063      */
2064     ListOfGO GetGlueFaces (in ListOfGO theShapes, in double theTolerance);
2065
2066     /*!
2067      *  \brief Replace coincident faces in \a theShapes by one face
2068      *         in compliance with given list of faces
2069      *  \param theShapes Initial shapes.
2070      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
2071      *  \param theFaces List of faces for gluing.
2072      *  \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
2073      *  \param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
2074      *                        will be glued, otherwise only the edges,
2075      *                        belonging to <VAR>theFaces</VAR>.
2076      *  \return New GEOM_Object containing copies of theShapes without coincident faces.
2077      */
2078     GEOM_Object MakeGlueFacesByList (in ListOfGO theShapes, in double theTolerance,
2079                                      in ListOfGO theFaces,  in boolean doKeepNonSolids,
2080                                      in boolean doGlueAllEdges);
2081
2082     /*!
2083      *  \brief Replace coincident edges in \a theShapes by one edge.
2084      *  \param theShapes Initial shapes.
2085      *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
2086      *  \return New GEOM_Object containing copies of theShapes without coincident edges.
2087      */
2088     GEOM_Object MakeGlueEdges (in ListOfGO theShapes, in double theTolerance);
2089
2090     /*!
2091      *  Find coincident edges in \a theShapes for possible gluing.
2092      *  \param theShapes Initial shapes.
2093      *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
2094      *  \return ListOfGO
2095      */
2096     ListOfGO GetGlueEdges (in ListOfGO theShapes, in double theTolerance);
2097
2098     /*!
2099      *  \brief Replace coincident edges in \a theShapes by one edge
2100      *         in compliance with given list of edges
2101      *  \param theShapes Initial shapes.
2102      *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
2103      *  \param theEdges List of edges for gluing.
2104      *  \return New GEOM_Object containing copies of theShapes without some edges.
2105      */
2106     GEOM_Object MakeGlueEdgesByList (in ListOfGO theShapes,
2107                                      in double   theTolerance,
2108                                      in ListOfGO theEdges);
2109
2110     /*!
2111      *  \brief Get all sub-shapes and groups of \a theShape,
2112      *  that were created already by any other methods.
2113      *  \param theShape Any shape.
2114      *  \param theGroupsOnly If this parameter is TRUE, only groups will be
2115      *                       returned, else all found sub-shapes and groups.
2116      *  \return List of existing sub-objects of \a theShape.
2117      */
2118     ListOfGO GetExistingSubObjects (in GEOM_Object theShape,
2119                                     in boolean     theGroupsOnly);
2120
2121     /*!
2122      *  \brief Deprecated method. 
2123      *
2124      *  Use MakeAllSubShapes() instead.
2125      */
2126     ListOfGO MakeExplode (in GEOM_Object theShape,
2127                           in long        theShapeType,
2128                           in boolean     isSorted);
2129
2130     /*!
2131      *  \brief Explode a shape on sub-shapes of a given type. 
2132      *
2133      *  If the shape itself has the given type, it is also returned.
2134      *  \param theShape Shape to be exploded.
2135      *  \param theShapeType Type of sub-shapes to be retrieved.
2136      *  \param isSorted If this parameter is TRUE, sub-shapes will be
2137      *                  sorted by coordinates of their gravity centers.
2138      *  \return List of sub-shapes of type theShapeType, contained in theShape.
2139      */
2140     ListOfGO MakeAllSubShapes (in GEOM_Object theShape,
2141                                in long        theShapeType,
2142                                in boolean     isSorted);
2143
2144     /*!
2145      *  \brief Extract all sub-shapes of the given type from
2146      *  the given shape, excluding the shape itself.
2147      *  \param theShape Shape to be exploded.
2148      *  \param theShapeType Type of sub-shapes to be retrieved.
2149      *  \param isSorted If this parameter is TRUE, sub-shapes will be
2150      *                  sorted by coordinates of their gravity centers.
2151      *  \return List of sub-shapes of type theShapeType, contained in theShape.
2152      */
2153     ListOfGO ExtractSubShapes (in GEOM_Object theShape,
2154                                in long        theShapeType,
2155                                in boolean     isSorted);
2156
2157     /*!
2158      *  \brief Deprecated method. Use GetAllSubShapesIDs() instead.
2159      */
2160     ListOfLong SubShapeAllIDs (in GEOM_Object theShape,
2161                                in long        theShapeType,
2162                                in boolean     isSorted);
2163
2164     /*!
2165      *  \brief Explode a shape on sub-shapes of a given type.
2166      *
2167      *  Does the same, as MakeAllSubShapes, but returns IDs of
2168      *  sub-shapes, not GEOM_Object. It works faster.
2169      *  \param theShape Shape to be exploded.
2170      *  \param theShapeType Type of sub-shapes to be retrieved.
2171      *  \param isSorted If this parameter is TRUE, sub-shapes will be
2172      *                  sorted by coordinates of their gravity centers.
2173      *  \return List of IDs of sub-shapes of type theShapeType, contained in theShape.
2174      */
2175     ListOfLong GetAllSubShapesIDs (in GEOM_Object theShape,
2176                                    in long        theShapeType,
2177                                    in boolean     isSorted);
2178
2179     /*!
2180      *  \brief Get a sub-shape defined by its unique ID inside \a theMainShape
2181      *  \param theMainShape Main shape.
2182      *  \param theID Unique ID of sub-shape inside \a theMainShape.
2183      *  \return GEOM_Object, corresponding to found sub-shape.
2184      *  \note The sub-shape GEOM_Object can has ONLY ONE function.
2185      *        Don't try to apply modification operations (without copy) on them.
2186      */
2187     GEOM_Object GetSubShape (in GEOM_Object theMainShape,
2188                              in long        theID);
2189
2190     /*!
2191      *  \brief Get a set of sub-shapes defined by their unique IDs inside \a theMainShape
2192      *  \param theMainShape Main shape.
2193      *  \param theIndices List of unique IDs of sub-shapes inside \a theMainShape.
2194      *  \return List of GEOM_Object, corresponding to found sub-shapes.
2195      *  \note The sub-shape GEOM_Object can has ONLY ONE function.
2196      *        Don't try to apply modification operations (without copy) on them.
2197      */
2198     ListOfGO MakeSubShapes (in GEOM_Object theMainShape,
2199                             in ListOfLong  theIndices);
2200
2201     /*!
2202      *  Get global index of \a theSubShape in \a theMainShape.
2203      *  \param theMainShape Main shape.
2204      *  \param theSubShape Sub-shape of the main shape.
2205      *  \return global index of \a theSubShape in \a theMainShape.
2206      */
2207     long GetSubShapeIndex (in GEOM_Object theMainShape, in GEOM_Object theSubShape);
2208
2209     /*!
2210      *  Get global indices of \a theSubShapes in \a theMainShape.
2211      *  \param theMainShape Main shape.
2212      *  \param theSubShapes List of sub-shapes of the main shape.
2213      *  \return list of global indices of \a theSubShapes in \a theMainShape.
2214      */
2215     ListOfLong GetSubShapesIndices (in GEOM_Object theMainShape, in ListOfGO theSubShapes);
2216
2217     /*!
2218      *  \brief Get index of \a theSubShape in \a theMainShape, unique among sub-shapes of the same type.
2219      *
2220      *  Together with method <VAR>GetShapeTypeString()</VAR> it can be used
2221      *  to generate automatic names for sub-shapes, when publishing them in a study.
2222      *  \param theMainShape Main shape.
2223      *  \param theSubShape Sub-shape of the main shape.
2224      *  \return index of \a theSubShape in a list of all sub-shapes of \a theMainShape of the same type.
2225      */
2226     long GetTopologyIndex (in GEOM_Object theMainShape, in GEOM_Object theSubShape);
2227
2228     /*!
2229      *  \brief Get name of type of \a theShape.
2230      *
2231      *  Use wide type notation, taking into consideration both topology and geometry of the shape.
2232      *  Together with method <VAR>GetTopologyIndex()</VAR> it can be used
2233      *  to generate automatic names for sub-shapes, when publishing them in a study.
2234      *  \param theShape The shape to get a type of.
2235      *  \return String, containing a type name of \a theShape.
2236      */
2237     string GetShapeTypeString (in GEOM_Object theShape);
2238
2239     /*!
2240      *  \brief Check if the object is a sub-object of another GEOM object.
2241      *
2242      *  \param theSubObject Checked sub-object (or its parent object, in case if
2243      *                      \a theSubObjectIndex is non-zero).
2244      *  \param theSubObjectIndex When non-zero, specifies a sub-shape index that
2245      *                           identifies a sub-object within its parent specified via \a theSubObject.
2246      *  \param theObject An object that is checked for ownership (or its parent object,
2247      *                   in case if \a theObjectIndex is non-zero).
2248      *  \param theObjectIndex When non-zero, specifies a sub-shape index that
2249      *                        identifies an object within its parent specified via \a theObject.
2250      *  \return TRUE, if the given object contains sub-object.
2251      */
2252     boolean IsSubShapeBelongsTo( in GEOM_Object theSubObject,
2253                                  in long        theSubObjectIndex,
2254                                  in GEOM_Object theObject,
2255                                  in long        theObjectIndex);
2256     /*!
2257      *  \brief Count number of faces in the given shape.
2258      *  \param theShape Shape to count faces in.
2259      *  \return Number of faces in the given shape.
2260      */
2261     long NumberOfFaces (in GEOM_Object theShape);
2262
2263     /*!
2264      *  \brief Count number of edges in the given shape.
2265      *  \param theShape Shape to count edges in.
2266      *  \return Number of edges in theShape.
2267      */
2268     long NumberOfEdges (in GEOM_Object theShape);
2269
2270     /*!
2271      *  \brief Count number of sub-shapes of type \a theShapeType in the given shape.
2272      *  \param theShape Shape to count sub-shapes in.
2273      *  \param theShapeType The type of sub-shapes to count.
2274      *  \return Number of sub-shapes of type \a theShapeType in \a theShape.
2275      */
2276     long NumberOfSubShapes (in GEOM_Object theShape,
2277                             in long        theShapeType);
2278
2279     /*!
2280      *  Reverses an orientation the given shape.
2281      *  \param theShape Shape to be reversed.
2282      *  \return The reversed copy of theShape.
2283      */
2284     GEOM_Object ChangeOrientation (in GEOM_Object theShape);
2285
2286     /*!
2287      *  \brief Retrieve all free faces from the given shape.
2288      *
2289      *  Free face is a face, which is not shared between two shells of the shape.
2290      *  \param theShape Shape to find free faces in.
2291      *  \return List of IDs of all free faces, contained in theShape.
2292      */
2293     ListOfLong GetFreeFacesIDs (in GEOM_Object theShape);
2294
2295     /*!
2296      *  \brief Get all sub-shapes of theShape1 of the given type, shared with theShape2.
2297      *  \param theShape1 Shape to find sub-shapes in.
2298      *  \param theShape2 Shape to find shared sub-shapes with.
2299      *  \param theShapeType Type of sub-shapes to be retrieved.
2300      *  \return List of sub-shapes of theShape1, shared with theShape2.
2301      */
2302     ListOfGO GetSharedShapes (in GEOM_Object theShape1,
2303                               in GEOM_Object theShape2,
2304                               in long        theShapeType);
2305
2306     /*!
2307      *  \brief Get sub-shapes, shared by input shapes.
2308      *  \param theShapes Shapes to find common sub-shapes of.
2309      *  \param theShapeType Type of sub-shapes to be retrieved.
2310      *  \param theMultiShare Specifies what type of shares should be checked:
2311      *         - \c TRUE: search sub-shapes from 1st input shape shared with all other input shapes;
2312      *         - \c FALSE: causes to search sub-shapes shared between couples of input shapes.
2313      *  \note If \a theShapes contains single compound, the shares between all possible couples of 
2314      *        its top-level shapes are returned; otherwise, only shares between 1st input shape
2315      *        and all rest input shapes are returned.
2316      *              
2317      *  \return List of all found sub-shapes.
2318      */
2319     ListOfGO GetSharedShapesMulti (in ListOfGO theShapes,
2320                                    in long     theShapeType,
2321                                    in boolean  theMultiShare);
2322
2323     /*!
2324      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2325      *  the specified plane by the certain way, defined through \a theState parameter.
2326      *  \param theShape Shape to find sub-shapes of.
2327      *  \param theShapeType Type of sub-shapes to be retrieved.
2328      *  \param theAx1 Vector (or line, or linear edge), specifying normal
2329      *                direction and location of the plane to find shapes on.
2330      *  \param theState The state of the sub-shapes to find.
2331      *  \return List of all found sub-shapes.
2332      */
2333     ListOfGO GetShapesOnPlane (in GEOM_Object theShape,
2334                                in long        theShapeType,
2335                                in GEOM_Object theAx1,
2336                                in shape_state theState);
2337     /*!
2338      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2339      *  the specified plane by the certain way, defined through \a theState parameter.
2340      *  \param theShape Shape to find sub-shapes of.
2341      *  \param theShapeType Type of sub-shapes to be retrieved.
2342      *  \param theAx1 Vector (or line, or linear edge), specifying normal
2343      *                direction of the plane to find shapes on.
2344      *  \param thePnt Point specifying location of the plane to find shapes on.
2345      *  \param theState The state of the sub-shapes to find.
2346      *  \return List of all found sub-shapes.
2347      */
2348     ListOfGO GetShapesOnPlaneWithLocation (in GEOM_Object theShape,
2349                                            in long        theShapeType,
2350                                            in GEOM_Object theAx1,
2351                                            in GEOM_Object thePnt,
2352                                            in shape_state theState);
2353
2354
2355
2356     /*!
2357      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2358      *  the specified cylinder by the certain way, defined through \a theState parameter.
2359      *  \param theShape Shape to find sub-shapes of.
2360      *  \param theShapeType Type of sub-shapes to be retrieved.
2361      *  \param theAxis Vector (or line, or linear edge), specifying
2362      *                 axis of the cylinder to find shapes on.
2363      *  \param theRadius Radius of the cylinder to find shapes on.
2364      *  \param theState The state of the sub-shapes to find.
2365      *  \return List of all found sub-shapes.
2366      */
2367     ListOfGO GetShapesOnCylinder (in GEOM_Object theShape,
2368                                   in long        theShapeType,
2369                                   in GEOM_Object theAxis,
2370                                   in double      theRadius,
2371                                   in shape_state theState);
2372
2373     /*!
2374      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2375      *  the specified cylinder by the certain way, defined through \a theState parameter.
2376      *  \param theShape Shape to find sub-shapes of.
2377      *  \param theShapeType Type of sub-shapes to be retrieved.
2378      *  \param theAxis Vector (or line, or linear edge), specifying
2379      *                 axis of the cylinder to find shapes on.
2380      *  \param thePnt Point specifying location of the bottom of the cylinder.
2381      *  \param theRadius Radius of the cylinder to find shapes on.
2382      *  \param theState The state of the sub-shapes to find.
2383      *  \return List of all found sub-shapes.
2384      */
2385     ListOfGO GetShapesOnCylinderWithLocation (in GEOM_Object theShape,
2386                                               in long        theShapeType,
2387                                               in GEOM_Object theAxis,
2388                                               in GEOM_Object thePnt,
2389                                               in double      theRadius,
2390                                               in shape_state theState);
2391
2392     /*!
2393      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2394      *  the specified sphere by the certain way, defined through \a theState parameter.
2395      *  \param theShape Shape to find sub-shapes of.
2396      *  \param theShapeType Type of sub-shapes to be retrieved.
2397      *  \param theCenter Point, specifying center of the sphere to find shapes on.
2398      *  \param theRadius Radius of the sphere to find shapes on.
2399      *  \param theState The state of the sub-shapes to find.
2400      *  \return List of all found sub-shapes.
2401      */
2402     ListOfGO GetShapesOnSphere (in GEOM_Object theShape,
2403                                 in long        theShapeType,
2404                                 in GEOM_Object theCenter,
2405                                 in double      theRadius,
2406                                 in shape_state theState);
2407
2408     /*!
2409      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2410      *  the specified quadrangle by the certain way, defined through \a theState parameter.
2411      *  \param theShape Shape to find sub-shapes of.
2412      *  \param theShapeType Type of sub-shapes to be retrieved.
2413      *  \param theTopLeftPoint Top left quadrangle corner
2414      *  \param theTopRigthPoint Top right quadrangle corner
2415      *  \param theBottomLeftPoint Bottom left quadrangle corner
2416      *  \param theBottomRigthPoint Bottom right quadrangle corner
2417      *  \param theState The state of the sub-shapes to find.
2418      *  \return List of all found sub-shapes.
2419      */
2420     ListOfGO GetShapesOnQuadrangle (in GEOM_Object theShape,
2421                                     in long        theShapeType,
2422                                     in GEOM_Object theTopLeftPoint,
2423                                     in GEOM_Object theTopRigthPoint,
2424                                     in GEOM_Object theBottomLeftPoint,
2425                                     in GEOM_Object theBottomRigthPoint,
2426                                     in shape_state theState);
2427
2428     /*!
2429      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2430      *  the specified plane by the certain way, defined through \a theState parameter.
2431      *  \param theShape Shape to find sub-shapes of.
2432      *  \param theShapeType Type of sub-shapes to be retrieved.
2433      *  \param theAx1 Vector (or line, or linear edge), specifying normal
2434      *                direction and location of the plane to find shapes on.
2435      *  \param theState The state of the sub-shapes to find.
2436      *  \return List of IDs of all found sub-shapes.
2437      */
2438     ListOfLong GetShapesOnPlaneIDs (in GEOM_Object theShape,
2439                                     in long        theShapeType,
2440                                     in GEOM_Object theAx1,
2441                                     in shape_state theState);
2442
2443     /*!
2444      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2445      *  the specified plane by the certain way, defined through \a theState parameter.
2446      *  \param theShape Shape to find sub-shapes of.
2447      *  \param theShapeType Type of sub-shapes to be retrieved.
2448      *  \param theAx1 Vector (or line, or linear edge), specifying normal
2449      *                direction of the plane to find shapes on.
2450      *  \param thePnt Point specifying location of the plane to find shapes on.
2451      *  \param theState The state of the sub-shapes to find.
2452      *  \return List of IDs of all found sub-shapes.
2453      */
2454     ListOfLong GetShapesOnPlaneWithLocationIDs (in GEOM_Object theShape,
2455                                                 in long        theShapeType,
2456                                                 in GEOM_Object theAx1,
2457                                                 in GEOM_Object thePnt,
2458                                                 in shape_state theState);
2459
2460     /*!
2461      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2462      *  the specified cylinder by the certain way, defined through \a theState parameter.
2463      *  \param theShape Shape to find sub-shapes of.
2464      *  \param theShapeType Type of sub-shapes to be retrieved.
2465      *  \param theAxis Vector (or line, or linear edge), specifying
2466      *                 axis of the cylinder to find shapes on.
2467      *  \param theRadius Radius of the cylinder to find shapes on.
2468      *  \param theState The state of the sub-shapes to find.
2469      *  \return List of IDs of all found sub-shapes.
2470      */
2471     ListOfLong GetShapesOnCylinderIDs (in GEOM_Object theShape,
2472                                        in long        theShapeType,
2473                                        in GEOM_Object theAxis,
2474                                        in double      theRadius,
2475                                        in shape_state theState);
2476
2477     /*!
2478      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2479      *  the specified cylinder by the certain way, defined through \a theState parameter.
2480      *  \param theShape Shape to find sub-shapes of.
2481      *  \param theShapeType Type of sub-shapes to be retrieved.
2482      *  \param theAxis Vector (or line, or linear edge), specifying
2483      *                 axis of the cylinder to find shapes on.
2484      *  \param thePnt Point specifying location of the bottom of the cylinder.
2485      *  \param theRadius Radius of the cylinder to find shapes on.
2486      *  \param theState The state of the sub-shapes to find.
2487      *  \return List of IDs all found sub-shapes.
2488      */
2489     ListOfLong GetShapesOnCylinderWithLocationIDs (in GEOM_Object theShape,
2490                                                    in long        theShapeType,
2491                                                    in GEOM_Object theAxis,
2492                                                    in GEOM_Object thePnt,
2493                                                    in double      theRadius,
2494                                                    in shape_state theState);
2495
2496     /*!
2497      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2498      *  the specified sphere by the certain way, defined through \a theState parameter.
2499      *  \param theShape Shape to find sub-shapes of.
2500      *  \param theShapeType Type of sub-shapes to be retrieved.
2501      *  \param theCenter Point, specifying center of the sphere to find shapes on.
2502      *  \param theRadius Radius of the sphere to find shapes on.
2503      *  \param theState The state of the sub-shapes to find.
2504      *  \return List of IDs of all found sub-shapes.
2505      */
2506     ListOfLong GetShapesOnSphereIDs (in GEOM_Object theShape,
2507                                      in long        theShapeType,
2508                                      in GEOM_Object theCenter,
2509                                      in double      theRadius,
2510                                      in shape_state theState);
2511
2512     /*!
2513      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2514      *  the specified quadrangle by the certain way, defined through \a theState parameter.
2515      *  \param theShape Shape to find sub-shapes of.
2516      *  \param theShapeType Type of sub-shapes to be retrieved.
2517      *  \param theTopLeftPoint Top left quadrangle corner
2518      *  \param theTopRigthPoint Top right quadrangle corner
2519      *  \param theBottomLeftPoint Bottom left quadrangle corner
2520      *  \param theBottomRigthPoint Bottom right quadrangle corner
2521      *  \param theState The state of the sub-shapes to find.
2522      *  \return List of IDs of all found sub-shapes.
2523      */
2524     ListOfLong GetShapesOnQuadrangleIDs (in GEOM_Object theShape,
2525                                          in long        theShapeType,
2526                                          in GEOM_Object theTopLeftPoint,
2527                                          in GEOM_Object theTopRigthPoint,
2528                                          in GEOM_Object theBottomLeftPoint,
2529                                          in GEOM_Object theBottomRigthPoint,
2530                                          in shape_state theState);
2531
2532     /*!
2533      * \brief Find sub-shapes complying with given status
2534      * \param theBox - the box to check state of sub-shapes against
2535      * \param theShape - the shape to explore
2536      * \param theShapeType - type of sub-shape of theShape
2537      * \param theState - required state
2538      * \return List of IDs of all found sub-shapes.
2539      */
2540     ListOfLong GetShapesOnBoxIDs (in GEOM_Object theBox,
2541                                   in GEOM_Object theShape,
2542                                   in long        theShapeType,
2543                                   in shape_state theState);
2544
2545     /*!
2546      * \brief Find sub-shapes complying with given status
2547      * \param theBox - the box to check state of sub-shapes against
2548      * \param theShape - the shape to explore
2549      * \param theShapeType - type of sub-shape of theShape
2550      * \param theState - required state
2551      * \return List of all found sub-shapes.
2552      */
2553     ListOfGO GetShapesOnBox (in GEOM_Object theBox,
2554                              in GEOM_Object theShape,
2555                              in long        theShapeType,
2556                              in shape_state theState);
2557
2558     /*!
2559      * \brief Find sub-shapes complying with given status
2560      * \param theCheckShape - the shape to check state of sub-shapes against. It must be a solid.
2561      * \param theShape - the shape to explore
2562      * \param theShapeType - type of sub-shape of theShape
2563      * \param theState - required state
2564      * \return List of IDs of all found sub-shapes.
2565      */
2566     ListOfLong GetShapesOnShapeIDs (in GEOM_Object theCheckShape,
2567                                     in GEOM_Object theShape,
2568                                     in short       theShapeType,
2569                                     in shape_state theState);
2570
2571     /*!
2572      * \brief Find sub-shapes complying with given status
2573      * \param theCheckShape - the shape to check state of sub-shapes against. It must be a solid.
2574      * \param theShape - the shape to explore
2575      * \param theShapeType - type of sub-shape of theShape
2576      * \param theState - required state
2577      * \return List of all found sub-shapes.
2578      */
2579     ListOfGO GetShapesOnShape (in GEOM_Object theCheckShape,
2580                                in GEOM_Object theShape,
2581                                in short       theShapeType,
2582                                in shape_state theState);
2583
2584     /*!
2585      * \brief Find sub-shapes complying with given status
2586      * \param theCheckShape - the shape to check state of sub-shapes against. It must be a solid.
2587      * \param theShape - the shape to explore
2588      * \param theShapeType - type of sub-shape of theShape
2589      * \param theState - required state
2590      * \return compound includes all found sub-shapes.
2591      */
2592     GEOM_Object GetShapesOnShapeAsCompound (in GEOM_Object theCheckShape,
2593                                             in GEOM_Object theShape,
2594                                             in short       theShapeType,
2595                                             in shape_state theState);
2596
2597     /*!
2598      *  \brief Get sub-shape(s) of \a theShapeWhere, which are
2599      *  coincident with \a theShapeWhat or could be a part of it.
2600      *  \param theShapeWhere Shape to find sub-shapes of.
2601      *  \param theShapeWhat Shape, specifying what to find.
2602      *  \return Group of all found sub-shapes or a single found sub-shape.
2603      */
2604     GEOM_Object GetInPlace (in GEOM_Object theShapeWhere,
2605                             in GEOM_Object theShapeWhat);
2606
2607     /*!
2608      *  Old implementation of GetInPlace functionality, based on shape properties.
2609      */
2610     GEOM_Object GetInPlaceOld (in GEOM_Object theShapeWhere,
2611                                in GEOM_Object theShapeWhat);
2612
2613     /*!
2614      *  \brief Get sub-shape(s) of \a theShapeWhere, which are
2615      *  coincident with \a theShapeWhat or could be a part of it.
2616      *
2617      *  Implementation of this method is based on a saved history of an operation,
2618      *  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
2619      *  arguments (an argument shape or a sub-shape of an argument shape).
2620      *  The operation could be the Partition or one of boolean operations,
2621      *  performed on simple shapes (not on compounds).
2622      *
2623      *  \param theShapeWhere Shape to find sub-shapes of.
2624      *  \param theShapeWhat Shape, specifying what to find.
2625      *  \return Group of all found sub-shapes or a single found sub-shape.
2626      */
2627     GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere,
2628                                      in GEOM_Object theShapeWhat);
2629
2630     /*!
2631      *  \brief Get sub-shape of theShapeWhere, which are
2632      *  coincident with \a theShapeWhat that can either SOLID, FACE, EDGE or VERTEX.
2633      *  \param theShapeWhere Shape to find sub-shapes of.
2634      *  \param theShapeWhat Shape, specifying what to find.
2635      *  \return found sub-shape.
2636      */
2637     GEOM_Object GetSame (in GEOM_Object theShapeWhere,
2638                          in GEOM_Object theShapeWhat);
2639
2640     /*!
2641      *  \brief Get sub-shape Ids of theShapeWhere, which are
2642      *   coincident with \a theShapeWhat that can either SOLID, FACE, EDGE or VERTEX.
2643      *  \param theShapeWhere Shape to find sub-shapes of.
2644      *  \param theShapeWhat Shape, specifying what to find.
2645      *  \return found sub-shape Ids.
2646      */
2647     ListOfLong GetSameIDs (in GEOM_Object theShapeWhere,
2648                            in GEOM_Object theShapeWhat);
2649
2650     /*!
2651      *  \brief Resize the input edge with the new Min and Max parameters.
2652      *  The input edge parameters range is [0, 1]. If theMin parameter is
2653      *  negative, the input edge is extended, otherwise it is shrinked by
2654      *  theMin parameter. If theMax is greater than 1, the edge is extended,
2655      *  otherwise it is shrinked by theMax parameter.
2656      *  \param theEdge the input edge to be resized.
2657      *  \param theMin the minimal parameter value.
2658      *  \param theMax the maximal parameter value.
2659      *  \return a newly created edge.
2660      */
2661     GEOM_Object ExtendEdge(in GEOM_Object theEdge,
2662                            in double      theMin,
2663                            in double      theMax);
2664
2665     /*!
2666      *  \brief Resize the input face with the new UMin, UMax, VMin and VMax
2667      *  parameters. The input face U and V parameters range is [0, 1]. If
2668      *  theUMin parameter is negative, the input face is extended, otherwise
2669      *  it is shrinked along U direction by theUMin parameter. If theUMax is
2670      *  greater than 1, the face is extended, otherwise it is shrinked along
2671      *  U direction by theUMax parameter. So as for theVMin, theVMax and
2672      *  V direction of the input face.
2673      *  \param theFace the input face to be resized.
2674      *  \param theUMin the minimal U parameter value.
2675      *  \param theUMax the maximal U parameter value.
2676      *  \param theVMin the minimal V parameter value.
2677      *  \param theVMax the maximal V parameter value.
2678      *  \return a newly created face.
2679      */
2680     GEOM_Object ExtendFace(in GEOM_Object theFace,
2681                            in double      theUMin,
2682                            in double      theUMax,
2683                            in double      theVMin,
2684                            in double      theVMax);
2685
2686     /*!
2687      *  \brief Make a surface from a face. This function takes some face as
2688      *  input parameter and creates new GEOM_Object, i.e. topological shape
2689      *  by extracting underlying surface of the source face and limiting it
2690      *  by the Umin, Umax, Vmin, Vmax parameters of the source face (in the
2691      *  parametrical space).
2692      *  \param theFace the input face.
2693      *  \return a newly created face.
2694      */
2695     GEOM_Object MakeSurfaceFromFace(in GEOM_Object theFace);
2696
2697     /*!
2698      * \brief Explode a shape into edges sorted in a row from a starting point.
2699      * \param theShape - the shape to be exploded on edges.
2700      * \param theStartPoint - the starting point.
2701      * \return Ordered list of edges sorted in a row from a starting point.
2702      */
2703     ListOfGO GetSubShapeEdgeSorted (in GEOM_Object theShape,
2704                                     in GEOM_Object theStartPoint);
2705
2706   };
2707
2708  // # GEOM_IBlocksOperations: 
2709   /*!
2710    *  \brief Interface for Blocks construction
2711    *  Face from points or edges, Block from faces,
2712    *  Blocks multi-translation and multi-rotation
2713    */
2714   interface GEOM_IBlocksOperations : GEOM_IOperations
2715   {
2716    
2717   //  # Creation of blocks
2718
2719     /*!
2720      *  \brief Create a quadrangle face from four edges. Order of Edges is not
2721      *  important. It is  not necessary that edges share the same vertex.
2722      *  \param theEdge1,theEdge2,theEdge3,theEdge4 Edges for the face bound.
2723      *  \return New GEOM_Object, containing the created face.
2724      */
2725     GEOM_Object MakeQuad (in GEOM_Object theEdge1,
2726                           in GEOM_Object theEdge2,
2727                           in GEOM_Object theEdge3,
2728                           in GEOM_Object theEdge4);
2729
2730     /*!
2731      *  \brief Create a quadrangle face on two edges.
2732      *
2733      *  The missing edges will be built by creating the shortest ones.
2734      *  \param theEdge1,theEdge2 Two opposite edges for the face.
2735      *  \return New GEOM_Object, containing the created face.
2736      */
2737     GEOM_Object MakeQuad2Edges (in GEOM_Object theEdge1,
2738                                 in GEOM_Object theEdge2);
2739
2740     /*!
2741      *  \brief Create a quadrangle face with specified corners.
2742      *
2743      *  The missing edges will be built by creating the shortest ones.
2744      *  \param thePnt1,thePnt2,thePnt3,thePnt4 Corner vertices for the face.
2745      *  \return New GEOM_Object, containing the created face.
2746      */
2747     GEOM_Object MakeQuad4Vertices (in GEOM_Object thePnt1,
2748                                    in GEOM_Object thePnt2,
2749                                    in GEOM_Object thePnt3,
2750                                    in GEOM_Object thePnt4);
2751
2752     /*!
2753      *  \brief Create a hexahedral solid, bounded by the six given faces. Order of
2754      *  faces is not important. 
2755      *
2756      *  It is  not necessary that Faces share the same edge.
2757      *  \param theFace1,theFace2,theFace3,theFace4,theFace5,theFace6 Faces for the hexahedral solid.
2758      *  \return New GEOM_Object, containing the created solid.
2759      */
2760     GEOM_Object MakeHexa (in GEOM_Object theFace1,
2761                           in GEOM_Object theFace2,
2762                           in GEOM_Object theFace3,
2763                           in GEOM_Object theFace4,
2764                           in GEOM_Object theFace5,
2765                           in GEOM_Object theFace6);
2766
2767     /*!
2768      *  \brief Create a hexahedral solid between two given faces.
2769      *
2770      *  The missing faces will be built by creating the smallest ones.
2771      *  \param theFace1,theFace2 Two opposite faces for the hexahedral solid.
2772      *  \return New GEOM_Object, containing the created solid.
2773      */
2774     GEOM_Object MakeHexa2Faces (in GEOM_Object theFace1,
2775                                 in GEOM_Object theFace2);
2776
2777     
2778   //  # Extract elements of blocks and blocks compounds
2779      
2780
2781     /*!
2782      *  \brief Get a vertex, found in the given shape by its coordinates.
2783      *  \param theShape Block or a compound of blocks.
2784      *  \param theX,theY,theZ Coordinates of the sought vertex.
2785      *  \param theEpsilon Maximum allowed distance between the resulting
2786      *                    vertex and point with the given coordinates.
2787      *  \return New GEOM_Object, containing the found vertex.
2788      */
2789     GEOM_Object GetPoint (in GEOM_Object theShape,
2790                           in double      theX,
2791                           in double      theY,
2792                           in double      theZ,
2793                           in double      theEpsilon);
2794
2795     /*!
2796      *  \brief Find a vertex of the given shape, which has minimal distance to the given point.
2797      *  \param theShape Any shape.
2798      *  \param thePoint Point, close to the desired vertex.
2799      *  \return New GEOM_Object, containing the found vertex.
2800      */
2801     GEOM_Object GetVertexNearPoint (in GEOM_Object theShape,
2802                                     in GEOM_Object thePoint);
2803
2804     /*!
2805      *  \brief Get an edge, found in the given shape by two given vertices.
2806      *  \param theShape Block or a compound of blocks.
2807      *  \param thePoint1,thePoint2 Points, close to the ends of the desired edge.
2808      *  \return New GEOM_Object, containing the found edge.
2809      */
2810     GEOM_Object GetEdge (in GEOM_Object theShape,
2811                          in GEOM_Object thePoint1,
2812                          in GEOM_Object thePoint2);
2813
2814     /*!
2815      *  \brief Find an edge of the given shape, which has minimal distance to the given point.
2816      *  \param theShape Block or a compound of blocks.
2817      *  \param thePoint Point, close to the desired edge.
2818      *  \return New GEOM_Object, containing the found edge.
2819      */
2820     GEOM_Object GetEdgeNearPoint (in GEOM_Object theShape,
2821                                   in GEOM_Object thePoint);
2822
2823     /*!
2824      *  \brief Returns a face, found in the given shape by four given corner vertices.
2825      *  \param theShape Block or a compound of blocks.
2826      *  \param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
2827      *  \return New GEOM_Object, containing the found face.
2828      */
2829     GEOM_Object GetFaceByPoints (in GEOM_Object theShape,
2830                                  in GEOM_Object thePoint1,
2831                                  in GEOM_Object thePoint2,
2832                                  in GEOM_Object thePoint3,
2833                                  in GEOM_Object thePoint4);
2834
2835     /*!
2836      *  \brief Get a face of block, found in the given shape by two given edges.
2837      *  \param theShape Block or a compound of blocks.
2838      *  \param theEdge1,theEdge2 Edges, close to the edges of the desired face.
2839      *  \return New GEOM_Object, containing the found face.
2840      */
2841     GEOM_Object GetFaceByEdges (in GEOM_Object theShape,
2842                                 in GEOM_Object theEdge1,
2843                                 in GEOM_Object theEdge2);
2844
2845     /*!
2846      *  \brief Find a face, opposite to the given one in the given block.
2847      *  \param theBlock Must be a hexahedral solid.
2848      *  \param theFace Face of \a theBlock, opposite to the desired face.
2849      *  \return New GEOM_Object, containing the found face.
2850      */
2851     GEOM_Object GetOppositeFace (in GEOM_Object theBlock,
2852                                  in GEOM_Object theFace);
2853
2854     /*!
2855      *  \brief Find a face of the given shape, which has minimal distance to the given point.
2856      *  \param theShape Block or a compound of blocks.
2857      *  \param thePoint Point, close to the desired face.
2858      *  \return New GEOM_Object, containing the found face.
2859      */
2860     GEOM_Object GetFaceNearPoint (in GEOM_Object theShape,
2861                                   in GEOM_Object thePoint);
2862
2863     /*!
2864      *  \brief Find a face of block, whose outside normale has minimal angle with the given vector.
2865      *  \param theBlock Block or a compound of blocks.
2866      *  \param theVector Vector, close to the normale of the desired face.
2867      *  \return New GEOM_Object, containing the found face.
2868      */
2869     GEOM_Object GetFaceByNormale (in GEOM_Object theBlock,
2870                                   in GEOM_Object theVector);
2871
2872     /*!
2873      *  \brief Find all sub-shapes of type \a theShapeType of the given shape,
2874      *  which have minimal distance to the given point.
2875      *  \param theShape Any shape.
2876      *  \param thePoint Point, close to the desired shape.
2877      *  \param theShapeType Defines what kind of sub-shapes is searched.
2878      *  \param theTolerance The tolerance for distances comparison. All shapes
2879      *                      with distances to the given point in interval
2880      *                      [minimal_distance, minimal_distance + theTolerance] will be gathered.
2881      *  \return New GEOM_Object, containing a group of all found shapes.
2882      */
2883     GEOM_Object GetShapesNearPoint (in GEOM_Object theShape,
2884                                     in GEOM_Object thePoint,
2885                                     in long        theShapeType,
2886                                     in double      theTolerance);
2887
2888    //  #  Extract blocks from blocks compounds
2889      
2890
2891     /*!
2892      *  \brief Check, if the compound contains only specified blocks.
2893      *  \param theCompound The compound to check.
2894      *  \param theMinNbFaces If solid has lower number of faces, it is not a block.
2895      *  \param theMaxNbFaces If solid has higher number of faces, it is not a block.
2896      *    \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
2897      *  \param theNbBlocks Number of specified blocks in theCompound.
2898      *  \return TRUE, if the given compound contains only blocks.
2899      */
2900     boolean IsCompoundOfBlocks (in GEOM_Object theCompound,
2901                                 in long        theMinNbFaces,
2902                                 in long        theMaxNbFaces,
2903                                 out long       theNbBlocks);
2904
2905     /*!
2906      *  \brief Enumeration of Blocks Compound defects.
2907      */
2908     enum BCErrorType
2909     {
2910       /* Each element of the compound should be a Block */
2911       NOT_BLOCK,
2912
2913       /* An element is a potential block, but has degenerated and/or seam edge(s). */
2914       EXTRA_EDGE,
2915
2916       /* A connection between two Blocks should be an entire face or an entire edge */
2917       INVALID_CONNECTION,
2918
2919       /* The compound should be connexe */
2920       NOT_CONNECTED,
2921
2922       /* The glue between two quadrangle faces should be applied */
2923       NOT_GLUED
2924     };
2925
2926     /*!
2927      *  \brief Description of Blocks Compound defect: type and incriminated sub-shapes.
2928      */
2929     struct BCError
2930     {
2931       BCErrorType error;
2932       ListOfLong  incriminated;
2933     };
2934
2935     /*!
2936      *  \brief Sequence of all Blocks Compound defects.
2937      */
2938     typedef sequence<BCError> BCErrors;
2939
2940     /*!
2941      *  \brief Check, if the compound of blocks is given.
2942      *
2943      *  To be considered as a compound of blocks, the
2944      *  given shape must satisfy the following conditions:
2945      *  - Each element of the compound should be a Block (6 faces and 12 edges).
2946      *  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
2947      *  - The compound should be connexe.
2948      *  - The glue between two quadrangle faces should be applied.
2949      *    \note Single block is also accepted as a valid compound of blocks.
2950      *  \param theCompound The compound to check.
2951      *  \param theToleranceC1 the tolerance to check if two neighbor edges are
2952      *         collinear in the common vertex with this tolerance. Negative
2953      *         value means that C1 criterion is not used (old implementation).
2954      *  \param theErrors Structure, containing discovered errors and incriminated sub-shapes.
2955      *  \return TRUE, if the given shape is a compound of blocks.
2956      */
2957     boolean CheckCompoundOfBlocks (in GEOM_Object theCompound,
2958                                    in double      theToleranceC1,
2959                                    out BCErrors   theErrors);
2960
2961     /*!
2962      *  \brief Convert sequence of Blocks Compound errors, returned by
2963      *  <VAR>CheckCompoundOfBlocks()</VAR>, into string.
2964      *  \param theCompound The bad compound.
2965      *  \param theErrors The sequence of \a theCompound errors.
2966      *  \return String, describing all the errors in form, suitable for printing.
2967      */
2968     string PrintBCErrors (in GEOM_Object theCompound,
2969                           in BCErrors    theErrors);
2970
2971     /*!
2972      *  \brief Retrieve all non blocks solids and faces from a shape.
2973      *
2974      *  \param theShape The shape to explore.
2975      *  \param theToleranceC1 the tolerance to check if two neighbor edges are
2976      *         collinear in the common vertex with this tolerance. Negative
2977      *         value means that C1 criterion is not used (old implementation).
2978      *  \param theNonQuads Output parameter. Group of all non quadrangular faces.
2979      *
2980      *  \return Group of all non block solids (= not 6 faces, or with 6
2981      *          faces, but with the presence of non-quadrangular faces).
2982      */
2983     GEOM_Object GetNonBlocks (in GEOM_Object  theShape,
2984                               in double       theToleranceC1,
2985                               out GEOM_Object theNonQuads);
2986
2987     /*!
2988      *  \brief Remove all seam and degenerated edges from \a theShape.
2989      *
2990      *  Unite faces and edges, sharing one surface.
2991      *  \param theShape The compound or single solid to remove irregular edges from.
2992      *  \param theOptimumNbFaces If more than zero, unite faces only for those solids,
2993      *         that have more than theOptimumNbFaces faces. If zero, unite faces always,
2994      *         regardsless their quantity in the solid. If negative, do not unite faces at all.
2995      *         For blocks repairing recommended value is 6.
2996      *  \return Improved shape.
2997      */
2998     GEOM_Object RemoveExtraEdges (in GEOM_Object theShape,
2999                                   in long        theOptimumNbFaces);
3000
3001     /*!
3002      *  \brief Performs union faces of \a theShape.
3003      *
3004      *  Unite faces sharing one surface.
3005      *  \param theShape The compound or single solid that contains faces to perform union.
3006      *  \return Improved shape.
3007      */
3008     GEOM_Object UnionFaces (in GEOM_Object theShape);
3009
3010     /*!
3011      *  \brief Check, if the given shape is a blocks compound.
3012      *
3013      *  Fix all detected errors.
3014      *    \note Single block can be also fixed by this method.
3015      *  \param theCompound The compound to check and improve.
3016      *  \return Improved compound.
3017      */
3018     GEOM_Object CheckAndImprove (in GEOM_Object theCompound);
3019
3020     /*!
3021      *  \brief Get all the blocks, contained in the given compound.
3022      *
3023      *  \param theCompound The compound to explode.
3024      *  \param theMinNbFaces If solid has lower number of faces, it is not a block.
3025      *  \param theMaxNbFaces If solid has higher number of faces, it is not a block.
3026      *    \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3027      *  \return List of GEOM_Object, containing the retrieved blocks.
3028      */
3029     ListOfGO ExplodeCompoundOfBlocks (in GEOM_Object theCompound,
3030                                       in long        theMinNbFaces,
3031                                       in long        theMaxNbFaces);
3032
3033     /*!
3034      *  \brief Find block, containing the given point inside its volume or on boundary.
3035      *  \param theCompound Compound, to find block in.
3036      *  \param thePoint Point, close to the desired block. If the point lays on
3037      *         boundary between some blocks, we return block with nearest center.
3038      *  \return New GEOM_Object, containing the found block.
3039      */
3040     GEOM_Object GetBlockNearPoint (in GEOM_Object theCompound,
3041                                    in GEOM_Object thePoint);
3042
3043     /*!
3044      *  \brief Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3045      *  \param theCompound Compound, to find block in.
3046      *  \param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3047      *  \return New GEOM_Object, containing the found block.
3048      */
3049     GEOM_Object GetBlockByParts (in GEOM_Object theCompound,
3050                                  in ListOfGO    theParts);
3051
3052     /*!
3053      *  \brief Return all blocks, containing all the elements, passed as the parts.
3054      *  \param theCompound Compound, to find blocks in.
3055      *  \param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3056      *  \return List of GEOM_Object, containing the found blocks.
3057      */
3058     ListOfGO GetBlocksByParts (in GEOM_Object theCompound,
3059                                in ListOfGO    theParts);
3060
3061   // #  Operations on blocks with gluing of result
3062
3063     /*!
3064      *  \brief Multi-transformate block and glue the result.
3065      *
3066      *  Transformation is defined so, as to superpose theDirFace1 with theDirFace2.
3067      *  \param theBlock Hexahedral solid to be multi-transformed.
3068      *  \param theDirFace1 First direction face global index.
3069      *  \param theDirFace2 Second direction face global index.
3070      *  \param theNbTimes Quantity of transformations to be done.
3071      *    \note Global index of sub-shape can be obtained, using method
3072      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3073      *  \return New GEOM_Object, containing the result shape.
3074      */
3075     GEOM_Object MakeMultiTransformation1D (in GEOM_Object theBlock,
3076                                            in long        theDirFace1,
3077                                            in long        theDirFace2,
3078                                            in long        theNbTimes);
3079
3080     /*!
3081      *  \brief Multi-transformate block and glue the result.
3082      *  \param theBlock Hexahedral solid to be multi-transformed.
3083      *  \param theDirFace1U,theDirFace2U Direction faces for the first transformation.
3084      *  \param theDirFace1V,theDirFace2V Direction faces for the second transformation.
3085      *  \param theNbTimesU,theNbTimesV Quantity of transformations to be done.
3086      *  \return New GEOM_Object, containing the result shape.
3087      */
3088     GEOM_Object MakeMultiTransformation2D (in GEOM_Object theBlock,
3089                                            in long        theDirFace1U,
3090                                            in long        theDirFace2U,
3091                                            in long        theNbTimesU,
3092                                            in long        theDirFace1V,
3093                                            in long        theDirFace2V,
3094                                            in long        theNbTimesV);
3095
3096   // # Special operation - propagation
3097    
3098
3099     /*!
3100      *  \brief Build all possible propagation groups.
3101      *
3102      *  Propagation group is a set of all edges, opposite to one (main)
3103      *  edge of this group directly or through other opposite edges.
3104      *  Notion of Opposite Edge make sence only on quadrangle face.
3105      *  \param theShape Shape to build propagation groups on.
3106      *  \return List of GEOM_Object, each of them is a propagation group.
3107      */
3108     ListOfGO Propagate (in GEOM_Object theShape);
3109   };
3110
3111  // # GEOM_IBooleanOperations
3112   /*!
3113    *  \brief Interface for boolean operations (Cut, Fuse, Common)
3114    */
3115   interface GEOM_IBooleanOperations : GEOM_IOperations
3116   {
3117     /*!
3118      *  \brief Perform one of boolean operations on two given shapes.
3119      *  \param theShape1 First argument for boolean operation.
3120      *  \param theShape2 Second argument for boolean operation.
3121      *  \param theOperation Indicates the operation to be done:
3122      *                      1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
3123      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3124      *                         of arguments before an operation.
3125      *  \return New GEOM_Object, containing the result shape.
3126      */
3127     GEOM_Object MakeBoolean (in GEOM_Object theShape1,
3128                              in GEOM_Object theShape2,
3129                              in long        theOperation,
3130                              in boolean     IsCheckSelfInte);
3131     /*!
3132      *  \brief Perform fusion boolean operation on two given shapes.
3133      *  \param theShape1 First argument for fuse operation.
3134      *  \param theShape2 Second argument for fuse operation.
3135      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3136      *                         of arguments before an operation.
3137      *  \param IsRmExtraEdges If TRUE, perform removal of extra edges
3138      *                        during an operation.
3139      *  \return New GEOM_Object, containing the result shape.
3140      */
3141     GEOM_Object MakeFuse (in GEOM_Object theShape1,
3142                           in GEOM_Object theShape2,
3143                           in boolean     IsCheckSelfInte,
3144                           in boolean     IsRmExtraEdges);
3145
3146     /*!
3147      *  \brief Perform fusion boolean operation on list of objects.
3148      *  \param theShapes Shapes to be fused.
3149      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3150      *                         of arguments before an operation.
3151      *  \param IsRmExtraEdges If TRUE, perform removal of extra edges
3152      *                        during an operation.
3153      *  \return New GEOM_Object, containing the result shape.
3154      */
3155     GEOM_Object MakeFuseList (in ListOfGO theShapes,
3156                               in boolean  IsCheckSelfInte,
3157                               in boolean  IsRmExtraEdges);
3158
3159     /*!
3160      *  \brief Perform common boolean operation on list of objects.
3161      *  \param theShapes Shapes for common operation.
3162      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3163      *                         of arguments before an operation.
3164      *  \return New GEOM_Object, containing the result shape.
3165      */
3166     GEOM_Object MakeCommonList (in ListOfGO theShapes,
3167                                 in boolean  IsCheckSelfInte);
3168
3169     /*!
3170      *  \brief Perform cutting of list of objects from theMainShape.
3171      *  \param theMainShape the object for cut operation.
3172      *  \param theShapes Shapes to be cut from theMainShape (tools).
3173      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3174      *                         of arguments before an operation.
3175      *  \return New GEOM_Object, containing the result shape.
3176      */
3177     GEOM_Object MakeCutList (in GEOM_Object theMainShape,
3178                              in ListOfGO theShapes,
3179                              in boolean  IsCheckSelfInte);
3180
3181     /*!
3182      *  \brief Perform partition operation.
3183      *
3184      *  \param theShapes Shapes to be intersected.
3185      *  \param theTools Shapes to intersect theShapes.
3186      *  \note  Each compound from ListShapes and ListTools will be exploded in order
3187      *         to avoid possible intersection between shapes from this compound.
3188      *  \param theLimit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
3189      *  \param theKeepNonlimitShapes: if this parameter == 0, then only shapes of
3190      *                             target type (equal to Limit) are kept in the result,
3191      *                             else standalone shapes of lower dimension
3192      *                             are kept also (if they exist).
3193      *
3194      *  After implementation new version of PartitionAlgo (October 2006)
3195      *  other parameters are ignored by current functionality. They are kept
3196      *  in this function only for supporting old versions.
3197      *  Ignored parameters:
3198      *  \param theKeepInside Shapes, outside which the results will be deleted.
3199      *         Each shape from theKeepInside must belong to theShapes also.
3200      *  \param theRemoveInside Shapes, inside which the results will be deleted.
3201      *         Each shape from theRemoveInside must belong to theShapes also.
3202      *  \param theRemoveWebs If TRUE, perform Glue 3D algorithm.
3203      *  \param theMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
3204      *
3205      *  \return New GEOM_Object, containing the result shapes.
3206      */
3207     GEOM_Object MakePartition (in ListOfGO   theShapes,
3208                                in ListOfGO   theTools,
3209                                in ListOfGO   theKeepInside,
3210                                in ListOfGO   theRemoveInside,
3211                                in short      theLimit,
3212                                in boolean    theRemoveWebs,
3213                                in ListOfLong theMaterials,
3214                                in short      theKeepNonlimitShapes);
3215
3216     /*!
3217      *  \brief Perform partition operation.
3218      *
3219      *  This method may be usefull if it is needed to make a partition for
3220      *  a compound containing nonintersected shapes. Performance will be better
3221      *  since intersection between shapes from compound is not performed.
3222      *
3223      *  Description of all parameters as in previous method MakePartition().
3224      *  One additional parameter is provided:
3225      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3226      *                         of arguments before an operation.
3227      *
3228      *  \note Passed compounds (via ListShapes or via ListTools)
3229      *        have to consist of nonintersecting shapes.
3230      *
3231      *  \return New GEOM_Object, containing the result shapes.
3232      */
3233     GEOM_Object MakePartitionNonSelfIntersectedShape (in ListOfGO   theShapes,
3234                                                       in ListOfGO   theTools,
3235                                                       in ListOfGO   theKeepInside,
3236                                                       in ListOfGO   theRemoveInside,
3237                                                       in short      theLimit,
3238                                                       in boolean    theRemoveWebs,
3239                                                       in ListOfLong theMaterials,
3240                                                       in short      theKeepNonlimitShapes,
3241                                                       in boolean    IsCheckSelfInte);
3242
3243     /*!
3244      *  \brief Perform partition of the Shape with the Plane
3245      *  \param theShape Shape to be intersected.
3246      *  \param thePlane Tool shape, to intersect theShape.
3247      *  \return New GEOM_Object, containing the result shape.
3248      * 
3249      *  \note This operation is a shortcut to the more general \ref MakePartition
3250      *  operation, where \a theShape specifies single "object" (shape being partitioned)
3251      *  and \a thePlane specifies single "tool" (intersector shape). Other parameters of
3252      *  \ref MakePartition operation have default values:
3253      *  - \a theLimit: GEOM::SHAPE (shape limit corresponds to the type of \a theShape)
3254      *  - \a theKeepNonlimitShapes: 0
3255      *  - \a theKeepInside, \a theRemoveInside, \a theRemoveWebs,
3256      *    \a theMaterials (obsolete parameters): empty
3257      *
3258      * \sa MakePartition, MakePartitionNonSelfIntersectedShape
3259      */
3260     GEOM_Object MakeHalfPartition (in GEOM_Object theShape,
3261                                    in GEOM_Object thePlane);
3262   };
3263
3264  // # GEOM_ICurvesOperations:
3265   /*!
3266    *  \brief Interface for curves creation.
3267    *
3268    *  Polyline, Circle, Spline (Bezier and Interpolation)
3269    */
3270   interface GEOM_ICurvesOperations : GEOM_IOperations
3271   {
3272     /*!
3273      *  \brief Create a circle with given center, normal vector and radius.
3274      *  \param thePnt Circle center.
3275      *  \param theVec Vector, normal to the plane of the circle.
3276      *  \param theR Circle radius.
3277      *  \return New GEOM_Object, containing the created circle.
3278      */
3279     GEOM_Object MakeCirclePntVecR (in GEOM_Object thePnt,
3280                                    in GEOM_Object theVec,
3281                                    in double theR);
3282     /*!
3283      *  \brief Create a circle, passing through three given points
3284      *  \param thePnt1,thePnt2,thePnt3 Points, defining the circle.
3285      *  \return New GEOM_Object, containing the created circle.
3286      */
3287     GEOM_Object MakeCircleThreePnt (in GEOM_Object thePnt1,
3288                                     in GEOM_Object thePnt2,
3289                                     in GEOM_Object thePnt3);
3290     /*!
3291      *  \brief Create a circle with given center, with a radius equals the distance from center to Point1
3292      *  and on a plane defined by all of three points.
3293      *  \param thePnt1,thePnt2,thePnt3 Points, defining the circle.
3294      *  \return New GEOM_Object, containing the created circle.
3295      */
3296     GEOM_Object MakeCircleCenter2Pnt (in GEOM_Object thePnt1,
3297                                       in GEOM_Object thePnt2,
3298                                       in GEOM_Object thePnt3);
3299     /*!
3300      *  \brief Create an ellipse with given center, normal vector and radiuses.
3301      *  \param thePnt Ellipse center.
3302      *  \param theVec Vector, normal to the plane of the ellipse.
3303      *  \param theRMajor Major ellipse radius.
3304      *  \param theRMinor Minor ellipse radius.
3305      *  \return New GEOM_Object, containing the created ellipse.
3306      */
3307     GEOM_Object MakeEllipse (in GEOM_Object thePnt,
3308                              in GEOM_Object theVec,
3309                              in double theRMajor,
3310                              in double theRMinor);
3311
3312     /*!
3313      *  \brief Create an ellipse with given center, normal vector, main axis vector and radiuses.
3314      *  \param thePnt Ellipse center.
3315      *  \param theVec Vector, normal to the plane of the ellipse.
3316      *  \param theRMajor Major ellipse radius.
3317      *  \param theRMinor Minor ellipse radius.
3318      *  \param theVecMaj Vector, direction of the ellipse's main axis.
3319      *  \return New GEOM_Object, containing the created ellipse.
3320      */
3321     GEOM_Object MakeEllipseVec (in GEOM_Object thePnt,
3322                                 in GEOM_Object theVec,
3323                                 in double theRMajor,
3324                                 in double theRMinor,
3325                                 in GEOM_Object theVecMaj);
3326
3327     /*!
3328      *  \brief Create an arc of circle, passing through three given points.
3329      *  \param thePnt1 Start point of the arc.
3330      *  \param thePnt2 Middle point of the arc.
3331      *  \param thePnt3 End point of the arc.
3332      *  \return New GEOM_Object, containing the created arc.
3333      */
3334     GEOM_Object MakeArc (in GEOM_Object thePnt1,
3335                          in GEOM_Object thePnt2,
3336                          in GEOM_Object thePnt3);
3337
3338     /*!
3339      *  \brief Create an arc of circle of center C from one point to another
3340      *  \param theCenter Center point of the arc.
3341      *  \param thePnt1 Start point of the arc.
3342      *  \param thePnt2 End point of the arc.
3343      *  \param theSense Orientation of the arc
3344      *  \return New GEOM_Object, containing the created arc.
3345      */
3346     GEOM_Object MakeArcCenter (in GEOM_Object theCenter,
3347                                in GEOM_Object thePnt1,
3348                                in GEOM_Object thePnt2,
3349                                in boolean theSense);
3350
3351     /*!
3352      *  \brief Create an arc of ellipse of center C and two points P1 P2.
3353      *  \param theCenter Center point of the arc.
3354      *  \param thePnt1 Major radius is distance from center to Pnt1.
3355      *  \param thePnt2 define a plane and Minor radius as a shortest
3356      *                 distance from Pnt2 to vector Center->Pnt1.
3357      *  \return New GEOM_Object, containing the created arc.
3358      */
3359     GEOM_Object MakeArcOfEllipse (in GEOM_Object theCenter,
3360                                   in GEOM_Object thePnt1,
3361                                   in GEOM_Object thePnt2);
3362
3363
3364     /*!
3365      *  \brief Create a polyline on the set of points.
3366      *  \param thePoints Sequence of points for the polyline.
3367      *  \param theIsClosed If TRUE, build a closed wire.
3368      *  \return New GEOM_Object, containing the created polyline.
3369      */
3370     GEOM_Object MakePolyline (in ListOfGO thePoints,
3371                               in boolean  theIsClosed);
3372
3373     /*!
3374      *  \brief Create bezier curve on the set of points.
3375      *  \param thePoints Sequence of points for the bezier curve.
3376      *  \param theIsClosed If TRUE, build a closed curve.
3377      *  \return New GEOM_Object, containing the created bezier curve.
3378      */
3379     GEOM_Object MakeSplineBezier (in ListOfGO thePoints,
3380                                   in boolean  theIsClosed);
3381
3382     /*!
3383      *  \brief Create B-Spline curve on the set of points.
3384      *  \param thePoints Sequence of points for the B-Spline curve.
3385      *  \param theIsClosed If TRUE, build a closed curve.
3386      *  \param theDoReordering If TRUE, the algo does not follow the order of
3387      *                         \a thePoints but searches for the closest vertex.
3388      *  \return New GEOM_Object, containing the created B-Spline curve.
3389      */
3390     GEOM_Object MakeSplineInterpolation (in ListOfGO thePoints,
3391                                          in boolean  theIsClosed,
3392                                          in boolean  theDoReordering);
3393
3394     /*!
3395      *  \brief Create B-Spline curve on the set of points.
3396      *  \param thePoints Sequence of points for the B-Spline curve.
3397      *  \param theFirstVec Vector object, defining the curve direction at its first point.
3398      *  \param theLastVec Vector object, defining the curve direction at its last point.
3399      *  \return New GEOM_Object, containing the created B-Spline curve.
3400      */
3401     GEOM_Object MakeSplineInterpolWithTangents (in ListOfGO    thePoints,
3402                                                 in GEOM_Object theFirstVec,
3403                                                 in GEOM_Object theLastVec);
3404
3405     /*!
3406      *  \brief Creates a curve using the parametric definition of the basic points.
3407      *  \param thexExpr parametric equation of the coordinates X.
3408      *  \param theyExpr parametric equation of the coordinates Y.
3409      *  \param thezExpr parametric equation of the coordinates Z.
3410      *  \param theParamMin the minimal value of the parameter.
3411      *  \param theParamMax the maximum value of the parameter.
3412      *  \param theParamStep the step of the parameter.
3413      *  \param theCurveType the type of the curve.
3414      *  \return New GEOM_Object, containing the created curve.
3415      */    
3416     GEOM_Object MakeCurveParametric(in string thexExpr,
3417                                     in string theyExpr,
3418                                     in string thezExpr,
3419                                     in double theParamMin,
3420                                     in double theParamMax,
3421                                     in double theParamStep,
3422                                     in curve_type theCurveType);
3423
3424      /*!
3425      *  \brief Creates a curve using the parametric definition of the basic points.
3426      *  \param thexExpr parametric equation of the coordinates X.
3427      *  \param theyExpr parametric equation of the coordinates Y.
3428      *  \param thezExpr parametric equation of the coordinates Z.
3429      *  \param theParamMin the minimal value of the parameter.
3430      *  \param theParamMax the maximum value of the parameter.
3431      *  \param theParamNbStep the number of steps of the parameter discretization.
3432      *  \param theCurveType the type of the curve.
3433      *  \return New GEOM_Object, containing the created curve.
3434      */    
3435     GEOM_Object MakeCurveParametricNew(in string thexExpr,
3436                     in string theyExpr,
3437                     in string thezExpr,
3438                     in double theParamMin,
3439                     in double theParamMax,
3440                     in long   theParamNbStep,
3441                     in curve_type theCurveType);
3442
3443      /*!
3444      *  \brief Creates an isoline curve on a face.
3445      *  \param theFace the face for which an isoline is created.
3446      *  \param IsUIsoline True for U-isoline creation; False for V-isoline
3447      *         creation.
3448      *  \param theParameter the U parameter for U-isoline or V parameter
3449      *         for V-isoline.
3450      *  \return New GEOM_Object, containing the created isoline edge or a
3451      *          compound of edges.
3452      */
3453     GEOM_Object MakeIsoline(in GEOM_Object theFace,
3454                             in boolean     IsUIsoline,
3455                             in double      theParameter);
3456
3457     /*!
3458      *  \brief Create a sketcher (wire or face), following the textual description,
3459      *         passed through \a theCommand argument.
3460      *
3461      *  Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
3462      *  Format of the description string has to be the following:
3463      *
3464      *  "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
3465      *
3466      *  Where:
3467      *  - x1, y1 are coordinates of the first sketcher point (zero by default),
3468      *  - CMD is one of
3469      *     - "R angle" : Set the direction by angle
3470      *     - "D dx dy" : Set the direction by DX & DY
3471      *     .
3472      *       \n
3473      *     - "TT x y" : Create segment by point at X & Y
3474      *     - "T dx dy" : Create segment by point with DX & DY
3475      *     - "L length" : Create segment by direction & Length
3476      *     - "IX x" : Create segment by direction & Intersect. X
3477      *     - "IY y" : Create segment by direction & Intersect. Y
3478      *     .
3479      *       \n
3480      *     - "C radius length" : Create arc by direction, radius and length(in degree)
3481      *     .
3482      *       \n
3483      *     - "WW" : Close Wire (to finish)
3484      *     - "WF" : Close Wire and build face (to finish)
3485      *
3486      *  \param theCommand String, defining the sketcher in local
3487      *                    coordinates of the working plane.
3488      *  \param theWorkingPlane Nine double values, defining origin,
3489      *                         OZ and OX directions of the working plane.
3490      *  \return New GEOM_Object, containing the created wire or face.
3491      */
3492     GEOM_Object MakeSketcher (in string theCommand, in ListOfDouble theWorkingPlane);
3493
3494     /*!
3495      *  \brief Create a sketcher (wire or face), following the textual description,
3496      *         passed through \a theCommand argument. 
3497      *
3498      *  For format of the description string see the previous method.\n
3499      *
3500      *  \param theCommand String, defining the sketcher in local
3501      *                    coordinates of the working plane.
3502      *  \param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
3503      *  \return New GEOM_Object, containing the created wire or face.
3504      */
3505     GEOM_Object MakeSketcherOnPlane (in string theCommand, in GEOM_Object theWorkingPlane);
3506
3507     /*!
3508      *  \brief Create a 3D sketcher, following the textual description,
3509      *         passed through \a theCommand argument. 
3510      *
3511      *  Format of the description string has to be the following:
3512      *
3513      *  "3DSketcher:CMD[:CMD[:CMD...]]"
3514      *
3515      *  Where CMD is one of
3516      *     - "TT x y z" : Create segment by point at X & Y or set the first point
3517      *     - "T dx dy dz" : Create segment by point with DX & DY
3518      *     .
3519      *       \n
3520      *     - "OXY angleX angle2 length" : Create segment by two angles and length
3521      *     - "OYZ angleY angle2 length" : Create segment by two angles and length
3522      *     - "OXZ angleX angle2 length" : Create segment by two angles and length
3523      *     .
3524      *       \n
3525      *     - "WW" : Close Wire (to finish)
3526      *
3527      *  \param theCommand String, defining the sketcher in local
3528      *                    coordinates of the working plane.
3529      *  \return New GEOM_Object, containing the created wire.
3530      */
3531     GEOM_Object Make3DSketcherCommand (in string theCommand);
3532
3533     /*!
3534      *  \brief Create a 3D sketcher, made of a straight segments, joining points
3535      *         with coordinates passed through \a theCoordinates argument. 
3536      *
3537      *  Order of coordinates has to be the following:
3538      *  x1, y1, z1, x2, y2, z2, ..., xN, yN, zN
3539      *
3540      *  \param theCoordinates List of double values.
3541      *  \return New GEOM_Object, containing the created wire.
3542      */
3543     GEOM_Object Make3DSketcher (in ListOfDouble theCoordinates);
3544
3545     /*!
3546      *  \brief Create a 2D polyline (wire or a compound of wires).
3547      *
3548      *  The polyline can have several sections. Each section represents a set
3549      *  of points in the form of list of coordinates of the following order:
3550      *  x1, y1, x2, y2, ..., xN, yN
3551      *  Each section has its own name, type of curve (can be either
3552      *  GEOM::Polyline or GEOM::Interpolation) and Closed flag.
3553      *  For each section a wire is created. It represents either a polyline or
3554      *  interpolation BSpline either closed or not depending on the Closed flag.
3555      *  The result represents a wire if there is only one section is defined.
3556      *  Otherwise a compound of wires is returned.
3557      *
3558      *  \param theCoordsList the list of coordinates list. theCoordsList[0]
3559      *         is the coordinates list of the first section. theCoordsList[1]
3560      *         is for the second section etc.
3561      *  \param theNamesList the list of names. The order corresponds to
3562      *         theCoordsList.
3563      *  \param theTypesList the list of curve types. The order corresponds to
3564      *         theCoordsList.
3565      *  \param theClosedList the list of Closed flags. The order corresponds to
3566      *         theCoordsList.
3567      *  \param theWorkingPlane 9 double values, defining origin,
3568      *         OZ and OX directions of the working plane.
3569      *  \return New GEOM_Object, containing the created wire or a compound
3570      *          of wires.
3571      */
3572     GEOM_Object MakePolyline2D (in ListOfListOfDouble theCoordsList,
3573                                 in string_array       theNamesList,
3574                                 in short_array        theTypesList,
3575                                 in ListOfBool         theClosedList,
3576                                 in ListOfDouble       theWorkingPlane);
3577
3578     /*!
3579      *  \brief Create a 2D polyline (wire or a compound of wires).
3580      *
3581      *  The polyline can have several sections. Each section represents a set
3582      *  of points in the form of list of coordinates of the following order:
3583      *  x1, y1, x2, y2, ..., xN, yN
3584      *  Each section has its own name, type of curve (can be either
3585      *  GEOM::Polyline or GEOM::Interpolation) and Closed flag.
3586      *  For each section a wire is created. It represents either a polyline or
3587      *  interpolation BSpline either closed or not depending on the Closed flag.
3588      *  The result represents a wire if there is only one section is defined.
3589      *  Otherwise a compound of wires is returned.
3590      *
3591      *  \param theCoordsList the list of coordinates list. theCoordsList[0]
3592      *         is the coordinates list of the first section. theCoordsList[1]
3593      *         is for the second section etc.
3594      *  \param theNamesList the list of names. The order corresponds to
3595      *         theCoordsList.
3596      *  \param theTypesList the list of curve types. The order corresponds to
3597      *         theCoordsList.
3598      *  \param theClosedList the list of Closed flags. The order corresponds to
3599      *         theCoordsList.
3600      *  \param theWorkingPlane planar Face or LCS(Marker) of the working plane.
3601      *  \return New GEOM_Object, containing the created wire or a compound
3602      *          of wires.
3603      */
3604     GEOM_Object MakePolyline2DOnPlane (in ListOfListOfDouble theCoordsList,
3605                                        in string_array       theNamesList,
3606                                        in short_array        theTypesList,
3607                                        in ListOfBool         theClosedList,
3608                                        in GEOM_Object        theWorkingPlane);
3609
3610   };
3611
3612  // # GEOM_ILocalOperations:
3613   /*!
3614    *  \brief Interface for fillet and chamfer creation.
3615    */
3616   interface GEOM_ILocalOperations : GEOM_IOperations
3617   {
3618     /*!
3619      *  \brief Perform a fillet on all edges of the given shape.
3620      *  \param theShape Shape, to perform fillet on.
3621      *  \param theR Fillet radius.
3622      *  \return New GEOM_Object, containing the result shape.
3623      */
3624     GEOM_Object MakeFilletAll (in GEOM_Object theShape,
3625                                in double      theR);
3626
3627     /*!
3628      *  \brief Perform a fillet on the specified edges of the given shape
3629      *  \param theShape Shape, to perform fillet on.
3630      *  \param theR Fillet radius.
3631      *  \param theEdges Global indices of edges to perform fillet on.
3632      *    \note Global index of sub-shape can be obtained, using method
3633      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3634      *  \return New GEOM_Object, containing the result shape.
3635      */
3636     GEOM_Object MakeFilletEdges (in GEOM_Object theShape,
3637                                  in double      theR,
3638                                  in ListOfLong  theEdges);
3639     GEOM_Object MakeFilletEdgesR1R2 (in GEOM_Object theShape,
3640                                      in double      theR1,
3641                                      in double      theR2,
3642                                      in ListOfLong  theEdges);
3643
3644     /*!
3645      *  \brief Perform a fillet on all edges of the specified faces of the given shape.
3646      *  \param theShape Shape, to perform fillet on.
3647      *  \param theR Fillet radius.
3648      *  \param theFaces Global indices of faces to perform fillet on.
3649      *    \note Global index of sub-shape can be obtained, using method
3650      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3651      *  \return New GEOM_Object, containing the result shape.
3652      */
3653     GEOM_Object MakeFilletFaces (in GEOM_Object theShape,
3654                                  in double      theR,
3655                                  in ListOfLong  theFaces);
3656
3657     GEOM_Object MakeFilletFacesR1R2 (in GEOM_Object theShape,
3658                                      in double      theR1,
3659                                      in double      theR2,
3660                                      in ListOfLong  theFaces);
3661
3662     /*!
3663      *  \brief Perform a fillet on a face or a shell at the specified vertexes.
3664      *  \param theShape Shape, to perform fillet on.
3665      *  \param theR Fillet radius.
3666      *  \param theVertexes Global indices of vertexes to perform fillet on.
3667      *    \note Global index of sub-shape can be obtained, using method
3668      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3669      *  \return New GEOM_Object, containing the result shape.
3670      */
3671     GEOM_Object MakeFillet2D (in GEOM_Object theShape,
3672                               in double      theR,
3673                               in ListOfLong  theVertexes);
3674
3675     /*!
3676      *  \brief Perform a fillet on edges of the specified vertexes of the given wire.
3677      *  \param theShape Shape, to perform fillet on.
3678      *  \param theR Fillet radius.
3679      *  \param theVertexes Global indices of vertexes to perform fillet on.
3680      *    \note Global index of sub-shape can be obtained, using method
3681      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3682      *    \note The list of vertices coudl be empty, in this case fillet fill be done
3683      *          at all vertices in given wire
3684      *  \param doIgnoreSecantVertices If FALSE, fillet radius is always limited
3685      *         by the length of the edges, nearest to the fillet vertex.
3686      *         But sometimes the next edge is C1 continuous with the one, nearest to
3687      *         the fillet point, and such two (or more) edges can be united to allow
3688      *         bigger radius. Set this flag to TRUE to allow collinear edges union,
3689      *         thus ignoring the secant vertex (vertices).
3690      *  \return New GEOM_Object, containing the result shape.
3691      */
3692     GEOM_Object MakeFillet1D (in GEOM_Object theShape,
3693                               in double      theR,
3694                               in ListOfLong  theVertexes,
3695                               in boolean     doIgnoreSecantVertices);
3696
3697     /*!
3698      *  \brief Perform a symmetric chamfer on all edges of the given shape.
3699      *  \param theShape Shape, to perform chamfer on.
3700      *  \param theD Chamfer size along each face.
3701      *  \return New GEOM_Object, containing the result shape.
3702      */
3703     GEOM_Object MakeChamferAll (in GEOM_Object theShape,
3704                                 in double      theD);
3705
3706     /*!
3707      *  \brief Perform a chamfer on edges, common to the specified faces.
3708      *  with distance D1 on the Face1
3709      *  \param theShape Shape, to perform chamfer on.
3710      *  \param theD1 Chamfer size along \a theFace1.
3711      *  \param theD2 Chamfer size along \a theFace2.
3712      *  \param theFace1,theFace2 Global indices of two faces of \a theShape.
3713      *    \note Global index of sub-shape can be obtained, using method
3714      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3715      *  \return New GEOM_Object, containing the result shape.
3716      */
3717     GEOM_Object MakeChamferEdge (in GEOM_Object theShape,
3718                                  in double theD1, in double theD2,
3719                                  in long theFace1, in long theFace2);
3720     /*!
3721      *  \brief The Same but with params theD = Chamfer Lenght
3722      *  and theAngle = Chamfer Angle (Angle in radians)
3723      */
3724     GEOM_Object MakeChamferEdgeAD (in GEOM_Object theShape,
3725                                    in double theD, in double theAngle,
3726                                    in long theFace1, in long theFace2);
3727
3728     /*!
3729      *  \brief Perform a chamfer on all edges of the specified faces.
3730      *  with distance D1 on the first specified face (if several for one edge)
3731      *  \param theShape Shape, to perform chamfer on.
3732      *  \param theD1 Chamfer size along face from \a theFaces. If both faces,
3733      *               connected to the edge, are in \a theFaces, \a theD1
3734      *               will be get along face, which is nearer to \a theFaces beginning.
3735      *  \param theD2 Chamfer size along another of two faces, connected to the edge.
3736      *  \param theFaces Sequence of global indices of faces of \a theShape.
3737      *    \note Global index of sub-shape can be obtained, using method
3738      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3739      *  \return New GEOM_Object, containing the result shape.
3740      */
3741     GEOM_Object MakeChamferFaces (in GEOM_Object theShape,
3742                                   in double theD1, in double theD2,
3743                                   in ListOfLong theFaces);
3744     /*!
3745      *  The Same but with params theD = Chamfer Lenght
3746      *  and theAngle = Chamfer Angle (Angle in radians)
3747      */
3748     GEOM_Object MakeChamferFacesAD (in GEOM_Object theShape,
3749                                     in double theD, in double theAngle,
3750                                     in ListOfLong theFaces);
3751
3752    /*!
3753     *  \brief Perform a chamfer on edges,
3754     *  with distance D1 on the first specified face (if several for one edge)
3755     *  \param theShape Shape, to perform chamfer on.
3756     *  \param theD1,theD2 Chamfer size
3757     *  \param theEdges Sequence of edges of \a theShape.
3758     *  \return New GEOM_Object, containing the result shape.
3759     */
3760     GEOM_Object MakeChamferEdges (in GEOM_Object theShape,
3761                                   in double theD1, in double theD2,
3762                                   in ListOfLong theEdges);
3763     /*!
3764      *  The Same but with params theD = Chamfer Lenght
3765      *  and theAngle = Chamfer Angle (Angle in radians)
3766      */
3767     GEOM_Object MakeChamferEdgesAD (in GEOM_Object theShape,
3768                                     in double theD, in double theAngle,
3769                                     in ListOfLong theEdges);
3770
3771     /*!
3772      *  \brief Perform an Archimde operation on the given shape with given parameters.
3773      *                    The object presenting the resulting face is returned
3774      *  \param theShape Shape to be put in water.
3775      *  \param theWeight Weight og the shape.
3776      *  \param theWaterDensity Density of the water.
3777      *  \param theMeshDeflection Deflection od the mesh, using to compute the section.
3778      *  \return New GEOM_Object, containing a section of \a theShape
3779      *          by a plane, corresponding to water level.
3780      */
3781     GEOM_Object MakeArchimede (in GEOM_Object theShape,
3782                                in double theWeight,
3783                                in double theWaterDensity,
3784                                in double theMeshDeflection);
3785
3786     /*!
3787      *  \brief Duplicates <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3788      *
3789      *  Present here only for compatibility.
3790      */
3791     long GetSubShapeIndex (in GEOM_Object theShape, in GEOM_Object theSubShape);
3792   };
3793
3794  // #  GEOM_IHealingOperations: 
3795   /*!
3796    *  \brief Interface for shape healing operations
3797    *
3798    *  Shape Processing, SuppressFaces, etc.
3799    */
3800   interface GEOM_IHealingOperations : GEOM_IOperations
3801   {
3802     /*!
3803      *  \brief Apply a sequence of Shape Healing operators to the given object.
3804      *  \param theShapes Shape to be processed.
3805      *  \param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
3806      *  \param theParameters List of names of parameters
3807      *                    ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
3808      *  \param theValues List of values of parameters, in the same order
3809      *                    as parameters are listed in \a theParameters list.
3810      *  \return New GEOM_Object, containing processed shape.
3811      */
3812     GEOM_Object ProcessShape (in GEOM_Object theShapes,
3813                               in string_array theOperators,
3814                               in string_array theParameters,
3815                               in string_array theValues);
3816
3817     /*!
3818      *  \brief Get default sequence of operators, their parameters and parameters' values
3819      *  of Shape Process operation. 
3820      *
3821      *  In the current implementation the defaults are
3822      *  read from the file pointed by CSF_ShHealingDefaults environmental variable.
3823      *  \param theOperators Output. Default list of names of operators.
3824      *  \param theParameters Output. Default list of names of parameters.
3825      *  \param theValues Output. List of default values of parameters, in the same order
3826      *                           as parameters are listed in \a theParameters list.
3827      */
3828     void GetShapeProcessParameters (out string_array theOperators,
3829                                     out string_array theParameters,
3830                                     out string_array theValues);
3831     /*!
3832      *  \brief Get parameters and parameters' values for the given Shape Process operation.
3833      *
3834      *  In the current implementation the defaults are
3835      *  read from the file pointed by CSF_ShHealingDefaults environmental variable.
3836      *  \param theOperator Input. The operator's name.
3837      *  \param theParameters Output. Default list of names of parameters.
3838      *  \param theValues Output. List of default values of parameters, in the same order
3839      *                           as parameters are listed in \a theParameters list.
3840      */
3841     void GetOperatorParameters (in string theOperator,
3842                                 out string_array theParameters,
3843                                 out string_array theValues);
3844
3845     /*!
3846      *  \brief Remove faces from the given object (shape).
3847      *  \param theObject Shape to be processed.
3848      *  \param theFaces Indices of faces to be removed, if EMPTY then the method
3849      *                  removes ALL faces of the given object.
3850      *  \return New GEOM_Object, containing processed shape.
3851      */
3852     GEOM_Object SuppressFaces (in GEOM_Object theObject, in short_array theFaces);
3853
3854     /*!
3855      *  \brief Close an open wire.
3856      *  \param theObject Shape to be processed.
3857      *  \param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
3858      *                  if -1, then theObject itself is a wire.
3859      *  \param isCommonVertex If TRUE : closure by creation of a common vertex,
3860      *                        If FALS : closure by creation of an edge between ends.
3861      *  \return New GEOM_Object, containing processed shape.
3862      */
3863     GEOM_Object CloseContour (in GEOM_Object theObject, in short_array theWires,
3864                               in boolean isCommonVertex);
3865
3866     /*!
3867      *  \brief Remove internal wires and edges from the given object (face).
3868      *  \param theObject Shape to be processed.
3869      *  \param theWires Indices of wires to be removed, if EMPTY then the method
3870      *                  removes ALL internal wires of the given object.
3871      *  \return New GEOM_Object, containing processed shape.
3872      */
3873     GEOM_Object RemoveIntWires (in GEOM_Object theObject, in short_array theWires);
3874
3875     /*!
3876      *  \brief Remove internal closed contours (holes) from the given object.
3877      *  \param theObject Shape to be processed.
3878      *  \param theWires Indices of wires to be removed, if EMPTY then the method
3879      *                  removes ALL internal holes of the given object
3880      *  \return New GEOM_Object, containing processed shape.
3881      */
3882     GEOM_Object FillHoles (in GEOM_Object theObject, in short_array theWires);
3883
3884     /*!
3885      *  Sewing of the given object.
3886      *  \param theObjects Shapes to be processed.
3887      *  \param theTolerance Required tolerance value.
3888      *  \return New GEOM_Object, containing processed shape.
3889      */
3890     GEOM_Object Sew (in ListOfGO theObjects, in double theTolerance);
3891
3892     /*!
3893      *  Sewing of the given object. Allows non-manifold sewing.
3894      *  \param theObjects Shapes to be processed.
3895      *  \param theTolerance Required tolerance value.
3896      *  \return New GEOM_Object, containing processed shape.
3897      */
3898     GEOM_Object SewAllowNonManifold(in ListOfGO theObjects, in double theTolerance);
3899
3900     /*!
3901      *  Rebuild the topology of theSolids by removing
3902      *  the faces that are shared by several solids.
3903      *  \param theSolids A list of shapes containing solids to be processed.
3904      *  \return New GEOM_Object, containing processed shape.
3905      */
3906     GEOM_Object RemoveInternalFaces (in ListOfGO theSolids);
3907
3908     /*!
3909      *  \brief Addition of a point to a given edge of \a theObject.
3910      *  \param theObject Shape to be processed.
3911      *  \param theEdgeIndex Index of edge to be divided within theObject's shape,
3912      *                      if -1, then theObject itself is the edge.
3913      *  \param theValue Value of parameter on edge or length parameter,
3914      *                  depending on \a isByParameter.
3915      *  \param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
3916      *                       if FALSE : \a theValue is treated as a length parameter [0..1]
3917      *  \return New GEOM_Object, containing the processed shape.
3918      */
3919     GEOM_Object DivideEdge (in GEOM_Object theObject, in short theEdgeIndex,
3920                             in double theValue, in boolean isByParameter);
3921
3922     /*!
3923      *  \brief Addition of points to a given edge of \a theObject by projecting
3924      *         other points to the given edge.
3925      *  \param theObject Shape to be processed.
3926      *  \param theEdgeIndex Index of edge to be divided within theObject's shape,
3927      *                      if -1, then theObject itself is the edge.
3928      *  \param thePoints Points to project to theEdgeIndex-th edge.
3929      *  \return New GEOM_Object, containing the processed shape.
3930      */
3931     GEOM_Object DivideEdgeByPoint (in GEOM_Object theObject,
3932                                    in short       theEdgeIndex,
3933                                    in ListOfGO    thePoints);
3934
3935     /*!
3936      *  \brief Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
3937      *  \param theWire Wire to minimize the number of C1 continuous edges in.
3938      *  \param theVertices A list of vertices to suppress. If the list
3939      *                     is empty, all vertices in a wire will be assumed.
3940      *  \return New GEOM_Object with modified wire.
3941      */
3942     GEOM_Object FuseCollinearEdgesWithinWire (in GEOM_Object theWire,
3943                                               in ListOfGO theVertices);
3944
3945     /*!
3946      *  \brief Get a list of wires (wrapped in GEOM_Object-s),
3947      *  that constitute a free boundary of the given shapes.
3948      *  \param theObjects Shapes to get free boundary of.
3949      *  \param theClosedWires Output. Closed wires on the free boundary of the given shape.
3950      *  \param theOpenWires Output. Open wires on the free boundary of the given shape.
3951      *  \return FALSE, if an error(s) occured during the method execution.
3952      */
3953     boolean GetFreeBoundary (in  ListOfGO theObjects,
3954                              out ListOfGO theClosedWires,
3955                              out ListOfGO theOpenWires);
3956
3957     /*!
3958      *  \brief Change orientation of the given object.
3959      *  \param theObject Shape to be processed.
3960      *  \return New GEOM_Object, containing processed shape.
3961      */
3962     GEOM_Object ChangeOrientation (in GEOM_Object theObject);
3963     GEOM_Object ChangeOrientationCopy (in GEOM_Object theObject);
3964
3965     /*!
3966      *  \brief Try to limit tolerance of the given object by value \a theTolerance.
3967      *  \param theObject Shape to be processed.
3968      *  \param theTolerance Required tolerance value.
3969      *  \return New GEOM_Object, containing processed shape.
3970      */
3971     GEOM_Object LimitTolerance (in GEOM_Object theObject, in double theTolerance);
3972
3973
3974     /*!
3975      *  \brief Return information on what has been done by the last called healing method.
3976      *  \return ModifStatistics, information container.
3977      */
3978     ModifStatistics GetStatistics();
3979   };
3980
3981  // # GEOM_IInsertOperations:
3982   /*!
3983    *  \brief Interface for shape insert operations (like copy, import).
3984    *
3985    */
3986   interface GEOM_IInsertOperations : GEOM_IOperations
3987   {
3988     /*!
3989      *  \brief Create a copy of the given object
3990      */
3991     GEOM_Object MakeCopy (in GEOM_Object theOriginal);
3992
3993     /*!
3994      *  \brief Deprecated method. Use Export\<FormatName\> (from the
3995      *  corresponding plugin) instead; here \<FormatName\> is a name of format.
3996      *
3997      *  \brief Export the given shape into a file with given name.
3998      *  \param theObject Shape to be stored in the file.
3999      *  \param theFileName Name of the file to store the given shape in.
4000      *  \param theFormatName Specify format for the shape storage.
4001      */
4002     void Export (in GEOM_Object theObject, in string theFileName, in string theFormatName);
4003
4004     /*!
4005      *  \brief Deprecated method. Use Import\<FormatName\> (from the
4006      *  corresponding plugin) instead; here \<FormatName\> is a name of format.
4007      *
4008      *  \brief Import a shape from the STL, BREP, IGES or STEP file
4009      *  (depends on given format) with given name.
4010      *  \param theFileName The file, containing the shape.
4011      *  \param theFormatName Specify format for the file reading.
4012      *         If format 'IGES_SCALE' is used instead of 'IGES' or
4013      *            format 'STEP_SCALE' is used instead of 'STEP',
4014      *            file length unit will be ignored (set to 'meter') and result model will be scaled.
4015      *  \return List of GEOM_Object, containing the created shape and groups of materials.
4016      */
4017     ListOfGBO ImportFile (in string theFileName, in string theFormatName);
4018
4019     /*!
4020      *  \brief Deprecated method. Use ReadValue (from the corresponding plugin) instead.
4021      *
4022      *  \brief Read a value of parameter from a file, containing a shape.
4023      *  \param theFileName The file, containing the shape.
4024      *  \param theFormatName Specify format for the file reading.
4025      *  \param theParameterName Specify the parameter. For example, pass "LEN_UNITS"
4026      *                          to obtain length units, in which the file is written.
4027      *  \return Value of requested parameter in form of text string.
4028      */
4029     string ReadValue (in string theFileName, in string theFormatName, in string theParameterName);
4030
4031     /*!
4032      *  \brief Read a shape from the binary stream, containing its bounding representation (BRep).
4033      *  \note GEOM_Object::GetShapeStream() method can be used to obtain the shape's BRep stream.
4034      *  \param theStream The BRep binary stream.
4035      *  \return New GEOM_Object, containing the shape, read from theStream.
4036      */
4037     GEOM_Object RestoreShape (in SALOMEDS::TMPFile theStream);
4038
4039     /*!
4040      * \brief Load texture from file
4041      * \param theTextureFile texture file name
4042      * \return unique texture identifier
4043      */
4044     long LoadTexture(in string theTextureFile);
4045
4046     /*!
4047      * \brief Add texture to the study
4048      * \param theWidth texture width in pixels
4049      * \param theHeight texture height in pixels
4050      * \param theTexture texture byte array
4051      * \return unique texture identifier
4052      */
4053     long AddTexture(in long theWidth, in long theHeight, in SALOMEDS::TMPFile theTexture);
4054
4055     /*!
4056      * \brief Get previously loaded texture data
4057      * \param theID texture identifier
4058      * \param theWidth texture width in pixels
4059      * \param theHeight texture height in pixels
4060      * \return texture byte array
4061      */
4062     SALOMEDS::TMPFile GetTexture(in long theID, out long theWidth, out long theHeight);
4063
4064     /*!
4065      * \brief Get list of all avaiable texture IDs
4066      * \return list of all texture IDs avaiable for the current study
4067      */
4068     ListOfLong GetAllTextures();
4069
4070     /*!
4071      *  \brief Non-topological information transfer datum.
4072      */
4073     struct TransferDatum
4074     {
4075       string myName;
4076       long   myNumber;
4077       long   myMaxNumber;
4078     };
4079
4080     /*!
4081      *  \brief Sequence of non-topological information tranfer data.
4082      */
4083     typedef sequence<TransferDatum> ListOfTransferDatum;
4084
4085     /*!
4086      *  \brief Transfer non-topological data from one object to another
4087      *  \param theObjectFrom the source object of non-topological data
4088      *  \param theObjectTo the destination object of non-topological data
4089      *  \param theFindMethod method to search sub-shapes of theObjectFrom
4090      *         in shape theObjectTo. Possible values are: GEOM::FSM_GetInPlace,
4091      *         GEOM::FSM_GetInPlaceByHistory and GEOM::FSM_GetInPlace_Old.
4092      *         Other values of GEOM::find_shape_method are not supported.
4093      *  \param theResult statistics of the operation. Output parameter. It
4094      *         represents a sequence of Transfer Datum. A datum has the type
4095      *         (string code), the total number of items of this type and
4096      *         the number of transfered items.
4097      *  \return true in case of success; otherwise false.
4098      */
4099     boolean TransferData(in  GEOM_Object         theObjectFrom,
4100                          in  GEOM_Object         theObjectTo,
4101                          in  find_shape_method   theFindMethod,
4102                          out ListOfTransferDatum theResult);
4103
4104   };
4105
4106  // # GEOM_IKindOfShape:
4107   /*!
4108    *  \brief Interface for shape_kind enumeration.
4109    */
4110   interface GEOM_IKindOfShape
4111   {
4112     enum shape_kind {
4113       NO_SHAPE,
4114       //COMPOSITEs
4115       COMPOUND,
4116       COMPSOLID,
4117       SHELL,
4118       WIRE,
4119       // SOLIDs
4120       /*! full sphere */
4121       SPHERE,
4122       /*! cylinder */
4123       CYLINDER,
4124       /*! box with faces, parallel to global coordinate planes */
4125       BOX,
4126       /*! other box */
4127       ROTATED_BOX, 
4128       /*! full torus */
4129       TORUS,   
4130       /*! cone */  
4131       CONE,   
4132       /*! solid, bounded by polygons */
4133       POLYHEDRON,  
4134       /*! other solid */
4135       SOLID,       
4136       // FACEs
4137       /*! spherical face (closed) */
4138       SPHERE2D,    
4139       /*! cylindrical face with defined height */
4140       CYLINDER2D,
4141       /*! toroidal face (closed) */
4142       TORUS2D,     
4143       /*! conical face with defined height */
4144       CONE2D,
4145       /*! planar, bounded by circle */
4146       DISK_CIRCLE,
4147       /*! planar, bounded by ellipse */
4148       DISK_ELLIPSE,
4149       /*! planar, bounded by segments */
4150       POLYGON,     
4151       /*! infinite planar */
4152       PLANE,        
4153        /*! other planar */
4154       PLANAR,      
4155       /*! other face */
4156       FACE,      
4157       // EDGEs
4158       /*! full circle */
4159       CIRCLE,      
4160       /*! arc of circle */
4161       ARC_CIRCLE, 
4162       /*! full ellipse */
4163       ELLIPSE,    
4164       /*! arc of ellipse */
4165       ARC_ELLIPSE,  
4166       /*! infinite segment */
4167       LINE,         
4168       /*! segment */
4169       SEGMENT,      
4170       /*! other edge */
4171       EDGE,       
4172       // VERTEX
4173       VERTEX,
4174       // ADVANCED shapes
4175       /*! all advanced shapes (temporary implementation) */
4176       ADVANCED    
4177     };
4178   };
4179
4180  // # GEOM_IMeasureOperations:
4181   /*!
4182    *  \brief Interface for measurement (distance, whatis) and
4183    *  properties calculation (like Centre of Mass, Inertia, etc.).
4184    *
4185    */
4186   interface GEOM_IMeasureOperations : GEOM_IOperations
4187   {
4188     /*!
4189      *  \brief Get kind of theShape.
4190      *  \param theShape Shape to get a kind of.
4191      *  \param theIntegers Output. Integer and enumerated shape's parameters
4192      *                     (kind of surface, closed/unclosed, number of edges, etc.)
4193      *  \param theDoubles  Output. Double shape's parameters (coordinates, dimensions, etc.)
4194      *  \note  Concrete meaning of each value, returned via \a theIntegers
4195      *         or \a theDoubles list depends on the kind of the shape.
4196      *  \return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration.
4197      */
4198     //short KindOfShape (in GEOM_Object   theShape,
4199     GEOM_IKindOfShape::shape_kind KindOfShape (in  GEOM_Object  theShape,
4200                                                out ListOfLong   theIntegers,
4201                                                out ListOfDouble theDoubles);
4202
4203     /*!
4204      *  \brief Get position (LCS) of theShape.
4205      *  \param theShape Shape to calculate position of.
4206      *  \param Ox,Oy,Oz Output. Coordinates of shape's location origin.
4207      *                  Origin of the LCS is situated at the shape's center of mass.
4208      *  \param Zx,Zy,Zz Output. Coordinates of shape's location normal(main) direction.
4209      *  \param Xx,Xy,Xz Output. Coordinates of shape's location X direction.
4210      *                  Axes of the LCS are obtained from shape's location or,
4211      *                  if the shape is a planar face, from position of its plane.
4212      *  \return Returns position of the shape through the last nine arguments.
4213      */
4214     void GetPosition (in GEOM_Object theShape,
4215                       out double Ox, out double Oy, out double Oz,
4216                       out double Zx, out double Zy, out double Zz,
4217                       out double Xx, out double Xy, out double Xz);
4218
4219     /*!
4220      *  \brief Get summarized length of all wires,
4221      *  area of surface and volume of the given shape.
4222      *  \param theShape Shape to define properties of.
4223      *  \param theLength Output. Summarized length of all wires of the given shape.
4224      *  \param theSurfArea Output. Area of surface of the given shape.
4225      *  \param theVolume Output. Volume of the given shape.
4226      *  \return Returns shape properties through the last three arguments.
4227      */
4228     void GetBasicProperties (in GEOM_Object theShape,
4229                              out double theLength,
4230                              out double theSurfArea,
4231                              out double theVolume);
4232
4233     /*!
4234      *  \brief Get a point, situated at the centre of mass of theShape.
4235      *  \param theShape Shape to define centre of mass of.
4236      *  \return New GEOM_Object, containing the created point.
4237      */
4238     GEOM_Object GetCentreOfMass (in GEOM_Object theShape);
4239
4240     /*
4241      *  Get the vertex by index for 1D objects depends the edge/wire orientation
4242      *  \param theShape Shape (wire or edge) to find the vertex on it
4243      *  \param theIndex Index of vertex sub-shape
4244      *  \return New GEOM_Object, vertex.
4245      */
4246     GEOM_Object GetVertexByIndex( in GEOM_Object theShape, in long index );
4247
4248     /*!
4249      *  \brief Get a vector, representing the normal of theFace.
4250      *  If the face is not planar, theOptionalPoint is obligatory.
4251      *  \param theFace Shape (face) to define the normal of.
4252      *  \param theOptionalPoint Shape (point) to define the normal at.
4253      *                          Can be NULL in case of planar face.
4254      *  \return New GEOM_Object, containing the created normal vector.
4255      */
4256     GEOM_Object GetNormal (in GEOM_Object theFace,
4257                            in GEOM_Object theOptionalPoint);
4258
4259     /*!
4260      *  \brief Get inertia matrix and moments of inertia of theShape.
4261      *  \param theShape Shape to calculate inertia of.
4262      *  \param I11,I12,I13,I21,I22,I23,I31,I32,I33 Output. Components of the inertia matrix of the given shape.
4263      *  \param Ix,Iy,Iz Output. Moments of inertia of the given shape.
4264      *  \return Returns inertia through the last twelve arguments.
4265      */
4266     void GetInertia (in GEOM_Object theShape,
4267                      out double I11, out double I12, out double I13,
4268                      out double I21, out double I22, out double I23,
4269                      out double I31, out double I32, out double I33,
4270                      out double Ix , out double Iy , out double Iz);
4271
4272     /*!
4273      *  \brief Get parameters of bounding box of the given shape
4274      *  \param theShape Shape to obtain bounding box of.
4275      *  \param precise TRUE for precise computation; FALSE for fast one.
4276      *  \param Xmin,Xmax Output. Limits of shape along OX axis.
4277      *  \param Ymin,Ymax Output. Limits of shape along OY axis.
4278      *  \param Zmin,Zmax Output. Limits of shape along OZ axis.
4279      *  \return Returns parameters of bounding box through the last six arguments.
4280      */
4281     void GetBoundingBox (in GEOM_Object theShape,
4282                          in boolean precise,
4283                          out double Xmin, out double Xmax,
4284                          out double Ymin, out double Ymax,
4285                          out double Zmin, out double Zmax);
4286
4287     /*!
4288      *  \brief Get bounding box of the given shape
4289      *  \param theShape Shape to obtain bounding box of.
4290      *  \param precise TRUE for precise computation; FALSE for fast one.
4291      *  \return New GEOM_Object, containing the created bounding box.
4292      */
4293     GEOM_Object MakeBoundingBox (in GEOM_Object theShape,
4294                                  in boolean precise);
4295
4296     /*!
4297      *  \brief Get min and max tolerances of sub-shapes of theShape
4298      *  \param theShape Shape, to get tolerances of.
4299      *  \param FaceMin,FaceMax Output. Min and max tolerances of the faces.
4300      *  \param EdgeMin,EdgeMax Output. Min and max tolerances of the edges.
4301      *  \param VertMin,VertMax Output. Min and max tolerances of the vertices.
4302      *  \return Returns shape tolerances through the last six arguments.
4303      */
4304     void GetTolerance (in GEOM_Object theShape,
4305                        out double FaceMin, out double FaceMax,
4306                        out double EdgeMin, out double EdgeMax,
4307                        out double VertMin, out double VertMax);
4308
4309     /*!
4310      *  \brief Enumeration of Shape defects coming from CheckShape algorithms.
4311      */
4312     enum ShapeErrorType
4313     {
4314       /* for vertices */
4315       InvalidPointOnCurve,
4316       InvalidPointOnCurveOnSurface,
4317       InvalidPointOnSurface,
4318
4319       /* for edges */
4320       No3DCurve,
4321       Multiple3DCurve,
4322       Invalid3DCurve,
4323       NoCurveOnSurface,
4324       InvalidCurveOnSurface,
4325       InvalidCurveOnClosedSurface,
4326       InvalidSameRangeFlag,
4327       InvalidSameParameterFlag,
4328       InvalidDegeneratedFlag,
4329
4330       FreeEdge,
4331       InvalidMultiConnexity,
4332       InvalidRange,
4333
4334       /* for wires */
4335       EmptyWire,
4336       RedundantEdge,
4337       SelfIntersectingWire, /* on a face */
4338
4339       /* for faces */
4340       NoSurface,
4341       InvalidWire,
4342       RedundantWire,
4343       IntersectingWires,
4344       InvalidImbricationOfWires,
4345
4346       /* for shells */
4347       EmptyShell,
4348       RedundantFace,
4349
4350       /* for shapes */
4351       UnorientableShape,
4352       NotClosed,
4353       NotConnected,
4354
4355       SubshapeNotInShape,
4356
4357       BadOrientation,
4358       BadOrientationOfSubshape,
4359
4360       InvalidToleranceValue,
4361
4362       /* for exception */
4363       CheckFail
4364     };
4365
4366     /*!
4367      *  \brief Description of a shape defect: type and incriminated sub-shapes.
4368      */
4369     struct ShapeError
4370     {
4371       ShapeErrorType error;
4372       ListOfLong     incriminated;
4373     };
4374
4375     /*!
4376      *  \brief Sequence of all shape defects.
4377      */
4378     typedef sequence<ShapeError> ShapeErrors;
4379
4380     /*!
4381      *  \brief Check a topology of the given shape.
4382      *  \param theShape Shape to check validity of.
4383      *  \param theErrors Structure, containing discovered errors and incriminated sub-shapes.
4384      *  \return TRUE, if the shape "seems to be valid" from the topological point of view.
4385      */
4386     boolean CheckShape (in GEOM_Object  theShape,
4387                         out ShapeErrors theErrors);
4388
4389     /*!
4390      *  \brief Check a topology and a geometry of the given shape.
4391      *  \param theShape Shape to check validity of.
4392      *  \param theErrors Structure, containing discovered errors and incriminated sub-shapes.
4393      *  \return TRUE, if the shape "seems to be valid".
4394      */
4395     boolean CheckShapeWithGeometry (in GEOM_Object  theShape,
4396                                     out ShapeErrors theErrors);
4397
4398     /*!
4399      *  \brief Convert sequence of shape errors, returned by
4400      *  <VAR>CheckShape()</VAR> or <VAR>CheckShapeWithGeometry()</VAR>, into string.
4401      *  \param theShape the invalid shape.
4402      *  \param theErrors The sequence of \a theShape errors.
4403      *  \return String, describing all the errors in form, suitable for printing.
4404      */
4405     string PrintShapeErrors (in GEOM_Object theShape,
4406                              in ShapeErrors theErrors);
4407
4408     /*!
4409      *  \brief Check a topology of the given shape on self-intersections presence.
4410      *  \param theShape Shape to check validity of.
4411      *  \param theCheckLevel the level of self-interference check.
4412      *  \param theIntersections Output. List of intersected sub-shapes IDs, it contains pairs of IDs.
4413      *  \return TRUE, if the shape does not have any self-intersections.
4414      */
4415     boolean CheckSelfIntersections (in GEOM_Object theShape,
4416                                     in long        theCheckLevel,
4417                                     out ListOfLong theIntersections);
4418
4419     /*!
4420      *  \brief Detect intersections of the given shapes with algorithm based on mesh intersections.
4421      *  \param theShape1 First source object
4422      *  \param theShape2 Second source object
4423      *  \param theTolerance Specifies a distance between shapes used for detecting gaps:
4424      *                       - if \a theTolerance <= 0, algorithm detects intersections
4425      *                       - if \a theTolerance > 0, algorithm detects gaps
4426      *  \param theDeflection Linear deflection coefficient that specifies quality of tesselation:
4427      *                       - if \a theDeflection <= 0, default deflection 0.001 is used
4428      *  \param theIntersections1 Output: contains list of sub-shapes IDs from 1st shape that localize intersection
4429      *  \param theIntersections2 Output: contains list of sub-shapes IDs from 2nd shape that localize intersection
4430      *  \return TRUE, if the are intersections (gaps) between source shapes
4431      */
4432     boolean FastIntersect (in GEOM_Object theShape1,
4433                            in GEOM_Object theShape2,
4434                            in double      theTolerance,
4435                            in float       theDeflection,
4436                            out ListOfLong theIntersections1,
4437                            out ListOfLong theIntersections2);
4438
4439     /*!
4440      *  \brief Check if the given shape can be an argument for MakeSolid operation
4441      *  \param theShape Shape to be described.
4442      *  \return Empty string if a solid can be made on this shape, error code otherwise.
4443      */
4444     string IsGoodForSolid (in GEOM_Object theShape);
4445
4446     /*!
4447      *  O\brief btain description of the given shape
4448      *  \param theShape Shape to be described.
4449      *  \return Description of the given shape.
4450      */
4451     string WhatIs (in GEOM_Object theShape);
4452
4453     /*!
4454      *  \brief Check if points defined by coords = [x1, y1, z1, x2, y2, z2, ...] are inside or on
4455      *  the shape theShape.
4456      *  \param theShape Shape to check.
4457      *  \param coords list of coordinates.
4458      *  \param tolerance tolerance.
4459      *  \return list of boolean.
4460      */
4461     ListOfBool AreCoordsInside(in GEOM_Object theShape, in ListOfDouble coords, in double tolerance);
4462
4463     /*!
4464      *  \brief Get minimal distance between the given shapes.
4465      *  \param theShape1,theShape2 Shapes to find minimal distance between.
4466      *  \param X1,Y1,Z1 Output. Coordinates of point on theShape1, nearest to theShape2.
4467      *  \param X2,Y2,Z2 Output. Coordinates of point on theShape2, nearest to theShape1.
4468      *  \return Value of the minimal distance between the given shapes.
4469      */
4470     double GetMinDistance (in GEOM_Object theShape1, in GEOM_Object theShape2,
4471                            out double X1, out double Y1, out double Z1,
4472                            out double X2, out double Y2, out double Z2);
4473
4474     /*!
4475      *  \brief Get closest points of the given shapes.
4476      *  \param theShape1,theShape2 Shapes to find closest points of.
4477      *  \param theCoords Output. List of (X, Y, Z) coordinates for all couples of points.
4478      *  \return The number of found solutions (-1 in case of infinite number of solutions).
4479      */
4480     long ClosestPoints (in GEOM_Object theShape1,
4481                         in GEOM_Object theShape2,
4482                         out ListOfDouble theCoords);
4483
4484     /*!
4485      *  \brief Get angle between the given lines or linear edges.
4486      *  \param theShape1,theShape2 Shapes to find angle between. Lines or linear edges.
4487      *  \return Value of the angle between the given shapes.
4488      */
4489     double GetAngle (in GEOM_Object theShape1, in GEOM_Object theShape2);
4490
4491     /*!
4492      *  \brief Get angle between the given vectors.
4493      *  \param theShape1,theShape2 Vectors to find angle between.
4494      *  \return Value of the angle between the given vectors.
4495      */
4496     double GetAngleBtwVectors (in GEOM_Object theShape1, in GEOM_Object theShape2);
4497
4498     /*!
4499      *  \brief Get point coordinates
4500      */
4501     void PointCoordinates (in GEOM_Object theShape, out double X, out double Y, out double Z);
4502
4503     /*!
4504      *  \brief Get radius of curvature of curve in the point determinated by param
4505      *  \param theShape - curve.
4506      *  \param theParam - parameter on curve
4507      *  \return Value of curvature.
4508      */
4509     double CurveCurvatureByParam (in GEOM_Object theShape, in double theParam);
4510
4511     /*!
4512      *  \brief Get radius of curvature of curve in the given point
4513      *  \param theShape - curve.
4514      *  \param thePoint - point
4515      *  \return Value of curvature.
4516      */
4517     double CurveCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
4518
4519     /*!
4520      *  \brief Get max radius of curvature of surface in the point determinated by params
4521      *  \param theShape - surface.
4522      *  \param theUParam - U-parameter on surface
4523      *  \param theVParam - V-parameter on surface
4524      *  \return Value of curvature.
4525      */
4526     double MaxSurfaceCurvatureByParam (in GEOM_Object theShape, in double theUParam,
4527                                        in double theVParam);
4528
4529     /*!
4530      *  \brief Get max radius of curvature of surface in the given point
4531      *  \param theShape - surface.
4532      *  \param thePoint - point
4533      *  \return Value of curvature.
4534      */
4535     double MaxSurfaceCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
4536
4537     /*!
4538      *  \brief Get min radius of curvature of surface in the point determinated by params
4539      *  \param theShape - surface.
4540      *  \param theUParam - U-parameter on surface
4541      *  \param theVParam - V-parameter on surface
4542      *  \return Value of curvature.
4543      */
4544     double MinSurfaceCurvatureByParam (in GEOM_Object theShape, in double theUParam,
4545                                        in double theVParam);
4546
4547     /*!
4548      *  \brief Get min radius of curvature of surface in the given point
4549      *  \param theShape - surface.
4550      *  \param thePoint - point
4551      *  \return Value of curvature.
4552      */
4553     double MinSurfaceCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
4554
4555   };
4556
4557  // # GEOM_IGroupOperations:
4558   /*!
4559    *  \brief Interface for groups creation.
4560    */
4561   interface GEOM_IGroupOperations : GEOM_IOperations
4562   {
4563     /*!
4564      *  \brief Creates a new group which will store  sub-shapes of theMainShape
4565      *  \param theMainShape is a GEOM_Object on which the group is selected
4566      *  \param theShapeType defines a shape type of the group
4567      *  \return a newly created GEOM group
4568      */
4569     GEOM_Object CreateGroup (in GEOM_Object theMainShape, in long theShapeType);
4570
4571     /*!
4572      *  \brief Adds a sub-object with ID theSubShapeId to the group
4573      *  \param theGroup is a GEOM group to which the new sub-shape is added
4574      *  \param theSubShapeId is a sub-shape ID in the main object.
4575      *  \note Use method <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR> to get an ID by the sub-shape
4576      */
4577     void AddObject (in GEOM_Object theGroup, in long theSubShapeId);
4578
4579     /*!
4580      *  \brief Removes a sub-object with ID \a theSubShapeId from the group
4581      *  \param theGroup is a GEOM group from which the sub-shape is removed.
4582      *  \param theSubShapeId is a sub-shape ID in the main object.
4583      *  \note Use method <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR> to get an ID by the sub-shape
4584      */
4585     void RemoveObject (in GEOM_Object theGroup, in long theSubShapeId);
4586
4587     /*!
4588      *  \brief Adds to the group all the given shapes. No errors, if some shapes are alredy included.
4589      *  \param theGroup is a GEOM group to which the new sub-shapes are added.
4590      *  \param theSubShapes is a list of sub-shapes to be added.
4591      */
4592     void UnionList (in GEOM_Object theGroup, in ListOfGO theSubShapes);
4593
4594     /*!
4595      *  \brief Removes from the group all the given shapes. No errors, if some shapes are not included.
4596      *  \param theGroup is a GEOM group from which the sub-shapes are removed.
4597      *  \param theSubShapes is a list of sub-shapes to be removed.
4598      */
4599     void DifferenceList (in GEOM_Object theGroup, in ListOfGO theSubShapes);
4600
4601     /*!
4602      *  \brief Adds to the group all the given shapes. No errors, if some shapes are alredy included.
4603      *  \param theGroup is a GEOM group to which the new sub-shapes are added.
4604      *  \param theSubShapes is a list of IDs of sub-shapes to be added.
4605      */
4606     void UnionIDs (in GEOM_Object theGroup, in ListOfLong theSubShapes);
4607
4608     /*!
4609      *  \brief Removes from the group all the given shapes. No errors, if some shapes are not included.
4610      *  \param theGroup is a GEOM group from which the sub-shapes are removed.
4611      *  \param theSubShapes is a list of IDs of sub-shapes to be removed.
4612      */
4613     void DifferenceIDs (in GEOM_Object theGroup, in ListOfLong theSubShapes);
4614
4615     /*!
4616      *  \brief Union of two groups.
4617      *  New group is created. It will contain all entities
4618      *  which are present in groups theGroup1 and theGroup2.
4619      *  \param theGroup1, theGroup2 are the initial GEOM groups
4620      *                              to create the united group from.
4621      *  \return a newly created GEOM group.
4622      */
4623     GEOM_Object UnionGroups (in GEOM_Object theGroup1, in GEOM_Object theGroup2);
4624
4625     /*!
4626      *  \brief Intersection of two groups.
4627      *  New group is created. It will contain only those entities
4628      *  which are present in both groups theGroup1 and theGroup2.
4629      *  \param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
4630      *  \return a newly created GEOM group.
4631      */
4632     GEOM_Object IntersectGroups (in GEOM_Object theGroup1, in GEOM_Object theGroup2);
4633
4634     /*!
4635      *  \brief Cut of two groups.
4636      *  New group is created. It will contain entities which are
4637      *  present in group theGroup1 but are not present in group theGroup2.
4638      *  \param theGroup1 is a GEOM group to include elements of.
4639      *  \param theGroup2 is a GEOM group to exclude elements of.
4640      *  \return a newly created GEOM group.
4641      */
4642     GEOM_Object CutGroups (in GEOM_Object theGroup1, in GEOM_Object theGroup2);
4643
4644     /*!
4645      *  \brief Union of list of groups.
4646      *  New group is created. It will contain all entities that are
4647      *  present in groups listed in theGList.
4648      *  \param theGList is a list of GEOM groups to create the united group from.
4649      *  \return a newly created GEOM group.
4650      */
4651     GEOM_Object UnionListOfGroups (in ListOfGO theGList);
4652
4653     /*!
4654      *  \brief Intersection of list of groups.
4655      *  New group is created. It will contain only entities
4656      *  which are simultaneously present in the groups listed in theGList.
4657      *  \param theGList is a list of GEOM groups to get common part of.
4658      *  \return a newly created GEOM group.
4659      */
4660     GEOM_Object IntersectListOfGroups (in ListOfGO theGList);
4661
4662     /*!
4663      *  \brief Cut of lists of groups.
4664      *  New group is created. It will contain only entities
4665      *  which are present in groups listed in theGList1 but 
4666      *  are not present in groups from theGList2.
4667      *  \param theGList1 is a list of GEOM groups to include elements of.
4668      *  \param theGList2 is a list of GEOM groups to exclude elements of.
4669      *  \return a newly created GEOM group.
4670      */
4671     GEOM_Object CutListOfGroups (in ListOfGO theGList1,
4672                                  in ListOfGO theGList2);
4673
4674     /*!
4675      *  \brief Returns a type of sub-objects stored in the group
4676      *  \param theGroup is a GEOM group which type is returned.
4677      */
4678     long GetType (in GEOM_Object theGroup);
4679
4680     /*!
4681      *  \brief Returns a main shape associated with the group
4682      *  \param theGroup is a GEOM group for which a main shape object is requested
4683      *  \return a GEOM_Object which is a main shape for theGroup
4684      */
4685     GEOM_Object GetMainShape (in GEOM_Object theGroup);
4686
4687     /*!
4688      *  \brief Returns a list of sub-objects ID stored in the group
4689      *  \param theGroup is a GEOM group for which a list of IDs is requested
4690      */
4691     ListOfLong GetObjects (in GEOM_Object theGroup);
4692   };
4693
4694   // # GEOM_IFieldOperations:
4695   /*!
4696    *  \brief Interface for field operation.
4697    */
4698   interface GEOM_IFieldOperations : GEOM_IOperations
4699   {
4700     /*!
4701      *  \brief Creates a field
4702      */
4703     GEOM_Field CreateField(in GEOM_Object     shape, 
4704                            in string          name,
4705                            in field_data_type type,
4706                            in short           dimension,
4707                            in string_array    componentNames);
4708     /*!
4709      *  \brief Returns number of fields on a shape
4710      */
4711     long CountFields(in GEOM_Object shape);
4712
4713     /*!
4714      *  \brief Returns all fields on a shape
4715      */
4716     ListOfFields GetFields(in GEOM_Object shape);
4717
4718     /*!
4719      *  \brief Returns a field on a shape by its name
4720      */
4721     GEOM_Field GetField(in GEOM_Object shape, in string name);
4722
4723     /*!
4724      *  \brief Returns number of sub-shapes of given dimension
4725      */
4726     long GetNbSubShapes(in GEOM_Object shape, in short fieldDim);
4727   };
4728
4729  // # GEOM_Gen:
4730   /*!
4731    *  \brief Interface to access other GEOM interfaces.
4732    *
4733    *  Also contains some methods to access and manage GEOM_Object.
4734    */
4735   interface GEOM_Gen : Engines::EngineComponent,SALOMEDS::Driver
4736   {
4737     /*!
4738      *  \brief Undo/Redo Management
4739      */
4740
4741     void Undo (in long theStudyID);
4742
4743     void Redo (in long theStudyID);
4744
4745     /*!
4746      * \brief Publishing management
4747      *
4748      * Adds in theStudy a object theObject under with a name theName,
4749      * if theFather is not NULL the object is placed under thFather's SObject.
4750      * Returns a SObject where theObject is placed
4751      */
4752     SALOMEDS::SObject AddInStudy (in SALOMEDS::Study theStudy,
4753                                   in GEOM_BaseObject theObject,
4754                                   in string          theName,
4755                                   in GEOM_BaseObject theFather);
4756
4757     /*!
4758      *  \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments
4759      *
4760      *  To be used from python scripts out of geompy.addToStudy (non-default usage)
4761      *  \param theStudy  the study, in which theObject is published already,
4762      *                   and in which the arguments will be published
4763      *  \param theObject published GEOM_Object, arguments of which will be published
4764      *  \param theArgs   list of GEOM_Object, operation arguments to be published.
4765      *                   If this list is empty, all operation arguments will be published
4766      *  \param theFindMethod method to search sub-shapes, corresponding to arguments and
4767      *                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
4768      *  \param theInheritFirstArg set properties of the first argument for \a theObject.
4769      *                            Do not publish sub-shapes in place of arguments, but only
4770      *                            in place of sub-shapes of the first argument,
4771      *                            because the whole shape corresponds to the first argument.
4772      *                            Mainly to be used after transformations, but it also can be
4773      *                            usefull after partition with one object shape, and some other
4774      *                            operations, where only the first argument has to be considered.
4775      *                            If theObject has only one argument shape, this flag is automatically
4776      *                            considered as True, not regarding really passed value.
4777      *  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
4778      *                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
4779      *  \return list of published sub-shapes
4780      */
4781     ListOfGO RestoreSubShapesO (in SALOMEDS::Study   theStudy,
4782                                 in GEOM_Object       theObject,
4783                                 in ListOfGO          theArgs,
4784                                 in find_shape_method theFindMethod,
4785                                 in boolean           theInheritFirstArg,
4786                                 in boolean           theAddPrefix);
4787
4788     /*!
4789      *  \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments
4790      *
4791      *  To be used from python scripts out of geompy.addToStudy (non-default usage)
4792      *  \param theStudy  the study, in which theObject is published already,
4793      *                   and in which the arguments will be published
4794      *  \param theObject published GEOM_Object, arguments of which will be published
4795      *  \param theArgs   list of GEOM_Object, operation arguments to be published.
4796      *                   If this list is empty, all operation arguments will be published
4797      *  \param theFindMethod method to search sub-shapes, corresponding to arguments and
4798      *                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
4799      *  \param theInheritFirstArg set properties of the first argument for \a theObject.
4800      *                            Do not publish sub-shapes in place of arguments, but only
4801      *                            in place of sub-shapes of the first argument,
4802      *                            because the whole shape corresponds to the first argument.
4803      *                            Mainly to be used after transformations, but it also can be
4804      *                            usefull after partition with one object shape, and some other
4805      *                            operations, where only the first argument has to be considered.
4806      *                            If theObject has only one argument shape, this flag is automatically
4807      *                            considered as True, not regarding really passed value.
4808      *  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
4809      *                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
4810      *  \return list of published sub-shapes
4811      */
4812     ListOfGO RestoreGivenSubShapesO (in SALOMEDS::Study   theStudy,
4813                                      in GEOM_Object       theObject,
4814                                      in ListOfGO          theArgs,
4815                                      in find_shape_method theFindMethod,
4816                                      in boolean           theInheritFirstArg,
4817                                      in boolean           theAddPrefix);
4818
4819     /*!
4820      *  \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments
4821      *
4822      *  To be used from GUI and from geompy.addToStudy.
4823      *  Work like the above method, but accepts study object theSObject instead of GEOM_Object.
4824      *  \param theStudy  the study, in which theObject is published already,
4825      *                   and in which the arguments will be published
4826      *  \param theSObject study object, referencing GEOM_Object, arguments of which will be published
4827      *  \param theArgs   list of GEOM_Object, operation arguments to be published.
4828      *                   If this list is empty, all operation arguments will be published
4829      *  \param theFindMethod method to search sub-shapes, corresponding to arguments and
4830      *                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
4831      *  \param theInheritFirstArg set properties of the first argument for \a theObject.
4832      *                            Do not publish sub-shapes in place of arguments, but only
4833      *                            in place of sub-shapes of the first argument,
4834      *                            because the whole shape corresponds to the first argument.
4835      *                            Mainly to be used after transformations, but it also can be
4836      *                            usefull after partition with one object shape, and some other
4837      *                            operations, where only the first argument has to be considered.
4838      *                            If theObject has only one argument shape, this flag is automatically
4839      *                            considered as True, not regarding really passed value.
4840      *  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
4841      *                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
4842      */
4843     ListOfGO RestoreSubShapesSO (in SALOMEDS::Study   theStudy,
4844                                  in SALOMEDS::SObject theSObject,
4845                                  in ListOfGO          theArgs,
4846                                  in find_shape_method theFindMethod,
4847                                  in boolean           theInheritFirstArg,
4848                                  in boolean           theAddPrefix);
4849
4850     // #  Methods to access interfaces for objects creation and transformation
4851
4852     GEOM_IBasicOperations     GetIBasicOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
4853     GEOM_ITransformOperations GetITransformOperations(in long theStudyID) raises (SALOME::SALOME_Exception);
4854     GEOM_I3DPrimOperations    GetI3DPrimOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4855     GEOM_IShapesOperations    GetIShapesOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4856     GEOM_IBooleanOperations   GetIBooleanOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
4857     GEOM_ICurvesOperations    GetICurvesOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4858     GEOM_ILocalOperations     GetILocalOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
4859     GEOM_IHealingOperations   GetIHealingOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
4860     GEOM_IInsertOperations    GetIInsertOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4861     GEOM_IMeasureOperations   GetIMeasureOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
4862     GEOM_IBlocksOperations    GetIBlocksOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4863     GEOM_IGroupOperations     GetIGroupOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
4864     GEOM_IFieldOperations     GetIFieldOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
4865
4866     GEOM_IOperations GetPluginOperations (in long   theStudyID,
4867                                           in string theLibName) raises (SALOME::SALOME_Exception);
4868
4869     // # Objects Management
4870
4871
4872     /*!
4873      *  \brief Removes the object from the GEOM component
4874      *  \param theObject is a GEOM_Object to be removed
4875      */
4876     void RemoveObject (in GEOM_BaseObject theObject);
4877
4878     /*!
4879      *  \brief Returns an object defined by the study and its entry in the GEOM component
4880      *  \param theStudyID is a SALOMEDS Study ID
4881      *  \param theEntry is an entry of the requested GEOM_Object in the GEOM component
4882      *  \note if the object has not previously been created a NULL GEOM_Object is returned
4883      */
4884     GEOM_BaseObject GetObject (in long theStudyID, in string theEntry);
4885
4886     /*!
4887      *  \brief Add a sub-shape defined by indices in \a theIndices
4888      *  (contains unique IDs of sub-shapes inside \a theMainShape)
4889      *  \note The sub-shape GEOM_Object can has ONLY ONE function.
4890      *        Don't try to apply modification operations on them.
4891      *  \note Internal method
4892      */
4893     GEOM_Object AddSubShape (in GEOM_Object theMainShape, in ListOfLong theIndices);
4894
4895  // #  GEOM_Objects IOR Management
4896     
4897     /*!
4898      *  \brief Returns a GEOM_Object defined by its IOR
4899      *  \param theIOR a string containg an IOR of the requested GEOM_Object
4900      */
4901     GEOM_Object GetIORFromString (in string theIOR);
4902
4903     /*!
4904      *  \brief Returns a string which contains an IOR of the GEOM_Object
4905      *  \param theObject is a GEOM_Object which IOR is requested
4906      */
4907     string GetStringFromIOR (in GEOM_Object theObject);
4908
4909     /*!
4910      *  \brief Returns a name with which a GEOM_Object was dumped into python script
4911      *  \param theStudyEntry is an entry of the GEOM_Object in the study
4912      */
4913     string GetDumpName (in string theStudyEntry);
4914
4915     /*!
4916      *  \brief Returns all names with which a GEOM_Object was dumped
4917      *  into python script to avoid the same names in SMESH script
4918      */
4919     string_array GetAllDumpNames();
4920
4921     /*!
4922      *  \brief Publishes the named sub-shapes of given object in the study.
4923      *  \param theStudy    The study in which the object is published
4924      *  \param theObject   The object which named sub-shapes are published
4925      */
4926     ListOfGO PublishNamedShapesInStudy(in SALOMEDS::Study theStudy,
4927                                        //in SObject theSObject,
4928                                        in Object theObject);
4929
4930     /*!
4931      * \brief Creates a new folder
4932      *
4933      * Creates a new container (folder) for any GEOM objects.
4934      * Folder will have name theName.
4935      * If theFather is not NULL, the folder is placed under theFather object.
4936      * Otherwise, the folder takes place under root 'Geometry' object.
4937      * 
4938      * \param theName name of the folder
4939      * \param theFather parent object
4940      * \return SObject represented the created folder.
4941      */
4942     SALOMEDS::SObject CreateFolder (in string theName,
4943                                     in SALOMEDS::SObject theFather);
4944
4945     /*!
4946      * \brief Moves object to the specified folder
4947      *
4948      * The moved object should be first published in the study.
4949      * \param theObject GEOM object to move
4950      * \param theFolder target folder
4951      */
4952     void MoveToFolder (in GEOM_Object theObject,
4953                        in SALOMEDS::SObject theFolder);
4954
4955     /*!
4956      * \brief Moves list of objects to the specified folder
4957      *
4958      * The moved objects should be first published in the study.
4959      * \param theListOfGO list of GEOM objects to move
4960      * \param theFolder target folder
4961      */
4962     void MoveListToFolder (in ListOfGO theListOfGO,
4963                            in SALOMEDS::SObject theFolder);
4964
4965     /*!
4966      * \brief Moves objects to the specified position
4967      *
4968      * This function is used in the drag-n-drop functionality.
4969      *
4970      * \param what objects being moved
4971      * \param where parent object where objects are moved to
4972      * \param row position in the parent object's children list at which objects are moved
4973      */
4974     void Move( in object_list what, 
4975                in SALOMEDS::SObject where, 
4976                in long row );
4977
4978     /*!
4979      * \brief Collects dependencies of the given objects from other ones
4980      * \param theStudy The study in which the object is published
4981      * \param theListOfEntries List of GEOM object entries in OCAF tree (not in study)
4982      * \return Struct of dependent entries and its links as a byte array
4983      * \note This method is supposed to be used by GUI only.
4984      */
4985     SALOMEDS::TMPFile GetDependencyTree(in SALOMEDS::Study theStudy,
4986                                         in string_array theListOfEntries);
4987
4988     /*!
4989      * \brief Fills 3 lists that is used to reduce study of redundant objects:
4990      *  - dependencies of the given objects from other ones;
4991      *  - children of the given objects;
4992      *  - all other objects in study.
4993      * \param theStudy The study in which the object was published
4994      * \param theSelectedEntries List of GEOM object entries in OCAF tree
4995      * \param theParentEntries List of GEOM object entries on which the given objects depend
4996      * \param theSubEntries Children entries list of the given objects
4997      * \param theOtherEntries List of GEOM object entries which are in the study, but not in parents and children lists
4998      * \note This method is supposed to be used by GUI only.
4999      */
5000     void GetEntriesToReduceStudy(in SALOMEDS::Study theStudy,
5001                                  inout string_array theSelectedEntries,
5002                                  inout string_array theParentEntries,
5003                                  inout string_array theSubEntries,
5004                                  inout string_array theOtherEntries);
5005
5006   };
5007 };
5008
5009 #endif