Salome HOME
Merge branch occ/shape_reparation_2
[modules/geom.git] / idl / GEOM_Gen.idl
1 // Copyright (C) 2007-2014  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   /*!
1426    *  \brief Interface for 3D primitives creation
1427    *
1428    *  Box, Cylinder, Cone, Sphere, Prism (extrusion),
1429    *  Pipe (extrusion along contour), Revolution, Solid (from shell).
1430    */
1431   interface GEOM_I3DPrimOperations : GEOM_IOperations
1432   {
1433     /*!
1434      *  \brief Create a box with specified dimensions along the coordinate axes
1435      *  and with edges, parallel to the coordinate axes.
1436      *
1437      *  Center of the box will be at point (DX/2, DY/2, DZ/2).
1438      *  \param theDX Length of Box edges, parallel to OX axis.
1439      *  \param theDY Length of Box edges, parallel to OY axis.
1440      *  \param theDZ Length of Box edges, parallel to OZ axis.
1441      *  \return New GEOM_Object, containing the created box.
1442      */
1443     GEOM_Object MakeBoxDXDYDZ (in double theDX, in double theDY, in double theDZ);
1444
1445     /*!
1446      *  \brief Create a box with two specified opposite vertices,
1447      *  and with edges, parallel to the coordinate axes
1448      *  \param thePnt1 First of two opposite vertices.
1449      *  \param thePnt2 Second of two opposite vertices.
1450      *  \return New GEOM_Object, containing the created box.
1451      */
1452     GEOM_Object MakeBoxTwoPnt (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
1453
1454     /*!
1455      *  \brief Create a face specified dimensions along OX-OY coordinate axes,
1456      *  with edges parallel to the coordinate axes.
1457      *
1458      *  Center of the face will be at point (0, 0, 0).
1459      *  \param theH Height of the Face.
1460      *  \param theW Width of the Face.
1461      *  \param theOrientation Orientation belong axis OXY OYZ OZX
1462      *  \return New GEOM_Object, containing the created face.
1463      */
1464     GEOM_Object MakeFaceHW (in double theH, in double theW, in short theOrientation);
1465     /*!
1466      *  \brief Create a face by normale vector or edge and two specified sizes,
1467      *  vertical (H) and horisontal (W).
1468      *  \param theObj defines plane.
1469      *  \param theH vertical size (height).
1470      *  \param theW horisontal size (width).
1471      *  \return New GEOM_Object, containing the created face.
1472      */
1473     GEOM_Object MakeFaceObjHW (in GEOM_Object theObj, in double theH, in double theW);
1474     /*!
1475      *  \brief Create a Disk (circular face) with given center, normal vector and radius.
1476      *  \param thePnt disk center.
1477      *  \param theVec Vector, normal to the plane of the disk.
1478      *  \param theR Disk radius.
1479      *  \return New GEOM_Object, containing the created disk.
1480      */
1481     GEOM_Object MakeDiskPntVecR (in GEOM_Object thePnt,
1482                                  in GEOM_Object theVec,
1483                                  in double theR);
1484     /*!
1485      *  \brief Create a disk (circular face), passing through three given points
1486      *  \param thePnt1, thePnt2, thePnt3 Points, defining the disk.
1487      *  \return New GEOM_Object, containing the created disk.
1488      */
1489     GEOM_Object MakeDiskThreePnt (in GEOM_Object thePnt1,
1490                                   in GEOM_Object thePnt2,
1491                                   in GEOM_Object thePnt3);
1492
1493     /*!
1494      *  \brief Create a disk specified dimensions along OX-OY coordinate axes.
1495      *
1496      *  Center of the disk at point (0, 0, 0).
1497      *  \param theR of the Disk.
1498      *  \param theOrientation Orientation belong axis OXY OYZ OZX
1499      *  \return New GEOM_Object, containing the created disk.
1500      */
1501     GEOM_Object MakeDiskR (in double theR, in short theOrientation);
1502
1503     /*!
1504      *  \brief Create a cylinder with given radius and height at
1505      *  the origin of coordinate system.
1506      *
1507      *  Axis of the cylinder will be collinear to the OZ axis of the coordinate system.
1508      *  \param theR Cylinder radius.
1509      *  \param theH Cylinder height.
1510      *  \return New GEOM_Object, containing the created cylinder.
1511      */
1512     GEOM_Object MakeCylinderRH (in double theR, in double theH);
1513
1514     /*!
1515      *  \brief Create a portion of cylinder with given radius, height and angle at
1516      *  the origin of coordinate system.
1517      *
1518      *  Axis of the cylinder will be collinear to the OZ axis of the coordinate system.
1519      *  \param theR Cylinder radius.
1520      *  \param theH Cylinder height.
1521      *  \param theA Cylinder angle.
1522      *  \return New GEOM_Object, containing the created cylinder.
1523      */
1524     GEOM_Object MakeCylinderRHA (in double theR, in double theH, in double theA);
1525
1526     /*!
1527      *  \brief Create a cylinder with given base point, axis, radius and height.
1528      *  \param thePnt Central point of cylinder base.
1529      *  \param theAxis Cylinder axis.
1530      *  \param theR Cylinder radius.
1531      *  \param theH Cylinder height.
1532      *  \return New GEOM_Object, containing the created cylinder.
1533      */
1534     GEOM_Object MakeCylinderPntVecRH (in GEOM_Object thePnt,
1535                                       in GEOM_Object theAxis,
1536                                       in double      theR,
1537                                       in double      theH);
1538     /*!
1539      *  \brief Create a portion of cylinder with given base point, axis, radius, height and angle.
1540      *  \param thePnt Central point of cylinder base.
1541      *  \param theAxis Cylinder axis.
1542      *  \param theR Cylinder radius.
1543      *  \param theH Cylinder height.
1544      *  \param theA Cylinder angle.
1545      *  \return New GEOM_Object, containing the created cylinder.
1546      */
1547     GEOM_Object MakeCylinderPntVecRHA (in GEOM_Object thePnt,
1548                                       in GEOM_Object theAxis,
1549                                       in double      theR,
1550                                       in double      theH,
1551                                       in double      theA);
1552
1553     /*!
1554      *  \brief Create a cone with given height and radiuses at
1555      *  the origin of coordinate system. 
1556      *
1557      *  Axis of the cone will be collinear to the OZ axis of the coordinate system.
1558      *  \param theR1 Radius of the first cone base.
1559      *  \param theR2 Radius of the second cone base.
1560      *    \note If both radiuses are non-zero, the cone will be truncated.
1561      *    \note If the radiuses are equal, a cylinder will be created instead.
1562      *  \param theH Cone height.
1563      *  \return New GEOM_Object, containing the created cone.
1564      */
1565     GEOM_Object MakeConeR1R2H (in double theR1, in double theR2, in double theH);
1566
1567     /*!
1568      *  \brief Create a cone with given base point, axis, height and radiuses.
1569      *  \param thePnt Central point of the first cone base.
1570      *  \param theAxis Cone axis.
1571      *  \param theR1 Radius of the first cone base.
1572      *  \param theR2 Radius of the second cone base.
1573      *    \note If both radiuses are non-zero, the cone will be truncated.
1574      *    \note If the radiuses are equal, a cylinder will be created instead.
1575      *  \param theH Cone height.
1576      *  \return New GEOM_Object, containing the created cone.
1577      */
1578     GEOM_Object MakeConePntVecR1R2H (in GEOM_Object thePnt,
1579                                      in GEOM_Object theAxis,
1580                                      in double      theR1,
1581                                      in double      theR2,
1582                                      in double      theH);
1583
1584     /*!
1585      *  \brief Create a torus with given radiuses at the origin of coordinate system.
1586      *  \param theRMajor Torus major radius.
1587      *  \param theRMinor Torus minor radius.
1588      *  \return New GEOM_Object, containing the created torus.
1589      */
1590     GEOM_Object MakeTorusRR (in double theRMajor,
1591                              in double theRMinor);
1592
1593     /*!
1594      *  \brief Create a torus with given center, normal vector and radiuses.
1595      *  \param thePnt Torus central point.
1596      *  \param theVec Torus axis of symmetry.
1597      *  \param theRMajor Torus major radius.
1598      *  \param theRMinor Torus minor radius.
1599      *  \return New GEOM_Object, containing the created torus.
1600      */
1601     GEOM_Object MakeTorusPntVecRR (in GEOM_Object thePnt,
1602                                    in GEOM_Object theVec,
1603                                    in double theRMajor,
1604                                    in double theRMinor);
1605
1606     /*!
1607      *  \brief Create a sphere with given radius at the origin of coordinate system.
1608      *  \param theR Sphere radius.
1609      *  \return New GEOM_Object, containing the created sphere.
1610      */
1611     GEOM_Object MakeSphereR (in double theR);
1612
1613     /*!
1614      *  \brief Create a sphere with given center and radius.
1615      *  \param thePnt Sphere center.
1616      *  \param theR Sphere radius.
1617      *  \return New GEOM_Object, containing the created .
1618      */
1619     GEOM_Object MakeSpherePntR (in GEOM_Object thePnt, in double theR);
1620
1621     /*!
1622      *  \brief Create a shape by extrusion of the base shape along the vector
1623      *
1624      *  All the space, transfixed by the base shape during its translation
1625      *  along the vector on the given distance.
1626      *  \param theBase Base shape to be extruded.
1627      *  \param theVec Direction of extrusion.
1628      *  \param theH Prism dimension along theVec.
1629      *  \return New GEOM_Object, containing the created prism.
1630      */
1631     GEOM_Object MakePrismVecH (in GEOM_Object theBase,
1632                                in GEOM_Object theVec,
1633                                in double      theH);
1634     /*  \brief The Same Prism but in 2 directions (forward&backward) */
1635     GEOM_Object MakePrismVecH2Ways (in GEOM_Object theBase,
1636                                     in GEOM_Object theVec,
1637                                     in double      theH);
1638     /*  \brief The Same as MakePrismVecH but with scaling */
1639     GEOM_Object MakePrismVecHWithScaling (in GEOM_Object theBase,
1640                                           in GEOM_Object theVec,
1641                                           in double      theH,
1642                                           in double      theScaleFactor);
1643
1644     /*!
1645      *  \brief Create a shape by extrusion of the base shape along a vector, defined by two points.
1646      *  \param theBase Base shape to be extruded.
1647      *  \param thePoint1 First end of extrusion vector.
1648      *  \param thePoint2 Second end of extrusion vector.
1649      *  \return New GEOM_Object, containing the created prism.
1650      */
1651     GEOM_Object MakePrismTwoPnt (in GEOM_Object theBase,
1652                                  in GEOM_Object thePoint1,
1653                                  in GEOM_Object thePoint2);
1654     /*  \brief The same prism but in two directions forward&backward */
1655     GEOM_Object MakePrismTwoPnt2Ways (in GEOM_Object theBase,
1656                                       in GEOM_Object thePoint1,
1657                                       in GEOM_Object thePoint2);
1658     /*  \brief The Same as MakePrismTwoPnt but with scaling */
1659     GEOM_Object MakePrismTwoPntWithScaling (in GEOM_Object theBase,
1660                                             in GEOM_Object thePoint1,
1661                                             in GEOM_Object thePoint2,
1662                                             in double      theScaleFactor);
1663
1664     /*!
1665      *  \brief Create a shape by extrusion of the base shape along a vector, defined by DX DY DZ.
1666      *  \param theBase Base shape to be extruded.
1667      *  \param theDX, theDY, theDZ end of extrusion vector.
1668      *  \return New GEOM_Object, containing the created prism.
1669      */
1670     GEOM_Object MakePrismDXDYDZ (in GEOM_Object theBase,
1671                                    in double theDX, in double theDY, in double theDZ);
1672     /*  \brief The same prism but in two directions forward&backward */
1673     GEOM_Object MakePrismDXDYDZ2Ways (in GEOM_Object theBase,
1674                                       in double theDX, in double theDY, in double theDZ);
1675     /*  \brief The Same as MakePrismDXDYDZ but with scaling */
1676     GEOM_Object MakePrismDXDYDZWithScaling (in GEOM_Object theBase,
1677                                             in double theDX, in double theDY, in double theDZ,
1678                                             in double theScaleFactor);
1679
1680
1681     /*!
1682      *  \brief Add / Remove material to / from  a solid by extrusion of the base shape on the given distance.
1683      *  \param theInitShape Initial shape on which to perform the feature.It has to be a solid or 
1684      *   a compound made of a single solid
1685      *  \param theBase Edge or wire defining the base shape to be extruded. 
1686      *  \param theHeight Prism dimension along the normal of the face.
1687      *  \param theAngle Draft angel in degrees
1688      *  \param theFuse If true material is added else material is removed
1689      *  \return New GEOM_Object, containing the modified shape
1690      */
1691     GEOM_Object MakeDraftPrism (in GEOM_Object theInitShape,
1692                                 in GEOM_Object theBase,
1693                                 in double theHeight, 
1694                                 in double theAngle,
1695                                 in boolean theFuse);
1696
1697     /*!
1698      *  \brief Create a shape by extrusion of the base shape along
1699      *  the path shape. The path shape can be a wire or an edge.
1700      *  \param theBase Base shape to be extruded.
1701      *  \param thePath Path shape to extrude the base shape along it.
1702      *  \return New GEOM_Object, containing the created pipe.
1703      */
1704     GEOM_Object MakePipe (in GEOM_Object theBase, in GEOM_Object thePath);
1705
1706     /*!
1707      *  \brief Create a shape by revolution of the base shape around the axis
1708      *  on the given angle. 
1709      *
1710      *  All the space, transfixed by the base
1711      *  shape during its rotation around the axis on the given angle.
1712      *  \param theBase Base shape to be rotated.
1713      *  \param theAxis Rotation axis.
1714      *  \param theAngle Rotation angle in radians.
1715      *  \return New GEOM_Object, containing the created revolution.
1716      */
1717     GEOM_Object MakeRevolutionAxisAngle (in GEOM_Object theBase,
1718                                          in GEOM_Object theAxis,
1719                                          in double theAngle);
1720     /*  The Same Revolution but in both ways forward&backward */
1721     GEOM_Object MakeRevolutionAxisAngle2Ways (in GEOM_Object theBase,
1722                                               in GEOM_Object theAxis,
1723                                               in double theAngle);
1724
1725     /*!
1726      *  \brief Create a face from a given set of contours.
1727      *  \param theContours either a list or a compound of edges/wires.
1728      *  \param theMinDeg a minimal degree of BSpline surface to create.
1729      *  \param theMaxDeg a maximal degree of BSpline surface to create.
1730      *  \param theTol2D a 2d tolerance to be reached.
1731      *  \param theTol3D a 3d tolerance to be reached.
1732      *  \param theNbIter a number of iteration of approximation algorithm.
1733      *  \param theMethod Kind of method to perform filling operation.
1734      *  \param theApprox Boolean indicating if result should be approximated.
1735      *  \return New GEOM_Object (face), containing the created filling surface.
1736      */
1737     GEOM_Object MakeFilling (in ListOfGO theContours,
1738                              in long theMinDeg, in long theMaxDeg,
1739                              in double theTol2D, in double theTol3D,
1740                              in long theNbIter,
1741                              in filling_oper_method theMethod,
1742                              in boolean theApprox);
1743
1744     /*!
1745      *  \brief Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1746      *  \param theSeqSections - set of specified sections.
1747      *  \param theModeSolid - mode defining building solid or shell
1748      *  \param thePreci - precision 3D used for smoothing by default 1.e-6
1749      *  \param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1750      *  \return New GEOM_Object, containing the created shell or solid.
1751      */
1752     GEOM_Object MakeThruSections(in ListOfGO theSeqSections,
1753                                  in boolean theModeSolid,
1754                                  in double thePreci,
1755                                  in boolean theRuled);
1756
1757      /*!
1758      *  \brief Create a shape by extrusion of the profile shape along
1759      *  the path shape. 
1760      *
1761      *  The path shape can be a wire or an edge.
1762      *  the several profiles can be specified in the several locations of path.
1763      *  \param theSeqBases - list of  Bases shape to be extruded.
1764      *  \param theLocations - list of locations on the path corresponding
1765      *                        specified list of the Bases shapes. Number of locations
1766      *                        should be equal to number of bases or list of locations can be empty.
1767      *  \param thePath - Path shape to extrude the base shape along it.
1768      *  \param theWithContact - the mode defining that the section is translated to be in
1769      *                          contact with the spine.
1770      *  \param theWithCorrection - defining that the section is rotated to be
1771      *                                 orthogonal to the spine tangent in the correspondent point
1772      *  \return New GEOM_Object, containing the created pipe.
1773      */
1774     GEOM_Object MakePipeWithDifferentSections (in ListOfGO theSeqBases,
1775                                                in ListOfGO theLocations,
1776                                                in GEOM_Object thePath,
1777                                                in boolean theWithContact ,
1778                                                in boolean theWithCorrection );
1779
1780     /*!
1781      *  \brief Create a shape by extrusion of the profile shape along
1782      *  the path shape. 
1783      *
1784      *  The path shape can be a shell or a face.
1785      *  the several profiles can be specified in the several locations of path.
1786      *  \param theSeqBases - list of  Bases shape to be extruded.
1787      *  \param theSeqSubBases - list of corresponding sub-shapes of section shapes.
1788      *  \param theLocations - list of locations on the path corresponding
1789      *                        specified list of the Bases shapes. Number of locations
1790      *                        should be equal to number of bases.
1791      *  \param thePath - Path shape to extrude the base shape along it.
1792      *  \param theWithContact - the mode defining that the section is translated to be in
1793      *                          contact with the spine.
1794      *  \param theWithCorrection - defining that the section is rotated to be
1795      *                                 orthogonal to the spine tangent in the correspondent point
1796      *  \return New GEOM_Object, containing the created pipe.
1797      */
1798     GEOM_Object MakePipeWithShellSections (in ListOfGO theSeqBases,
1799                                            in ListOfGO theSeqSubBases,
1800                                            in ListOfGO theLocations,
1801                                            in GEOM_Object thePath,
1802                                            in boolean theWithContact ,
1803                                            in boolean theWithCorrection );
1804
1805     /*!
1806      *  \brief Create solids between given sections
1807      *  \param theSeqBases - list of sections (shell or face).
1808      *  \param theLocations - list of corresponding vertexes
1809      *  \return New GEOM_Object, containing the created solids.
1810      */
1811     GEOM_Object MakePipeShellsWithoutPath (in ListOfGO theSeqBases,
1812                                            in ListOfGO theLocations);
1813
1814     /*!
1815      *  \brief Create a shape by extrusion of the base shape along
1816      *  the path shape with constant bi-normal direction along the given vector.
1817      *
1818      *  The path shape can be a wire or an edge.
1819      *  \param theBase Base shape to be extruded.
1820      *  \param thePath Path shape to extrude the base shape along it.
1821      *  \param theVec Vector defines a constant binormal direction to keep the
1822      *                same angle beetween the Direction and the sections
1823      *                along the sweep surface.
1824      *  \return New GEOM_Object, containing the created pipe.
1825      */
1826     GEOM_Object MakePipeBiNormalAlongVector (in GEOM_Object theBase,
1827                                              in GEOM_Object thePath,
1828                                              in GEOM_Object theVec);
1829
1830
1831      /*!
1832      *  \brief Make a thick solid from a surface shape (face or shell)
1833      *  \param theObject Surface from which the thick solid is made
1834      *  \param theThickness Value of the thickness
1835      *  \param isCopy To make a copy of \a theObject ot to modify \a theObject.
1836      *  \return New GEOM_Object, containing the created pipe if isCopy = true
1837      *          or the modified object if isCopy = false
1838      */
1839     GEOM_Object MakeThickening (in GEOM_Object theObject,
1840                                 in double theThickness,
1841                                 in boolean isCopy);
1842
1843     
1844     /*!
1845      *  \brief Build a middle path of a pipe-like shape.
1846      *
1847      *  The path shape can be a wire or an edge.
1848      *  \param theShape It can be closed or unclosed pipe-like shell
1849      *                  or a pipe-like solid.
1850      *  \param theBase1, theBase2 Two bases of the supposed pipe. This
1851      *                            should be wires or faces of \a theShape.
1852      *  \note It is not assumed that exact or approximate copy of \a theShape
1853      *        can be obtained by applying existing Pipe operation on the
1854      *        resulting "Path" wire taking \a theBase1 as the base - it is not
1855      *        always possible; though in some particular cases it might work
1856      *        it is not guaranteed. Thus, RestorePath function should not be
1857      *        considered as an exact reverse operation of the Pipe.
1858      *  \return New GEOM_Object, containing an edge or wire that represent
1859      *                           source pipe's "path".
1860      */
1861     GEOM_Object RestorePath (in GEOM_Object theShape,
1862                              in GEOM_Object theBase1,
1863                              in GEOM_Object theBase2);
1864
1865     /*!
1866      *  \brief Build a middle path of a pipe-like shape.
1867      *
1868      *  The path shape can be a wire or an edge.
1869      *  \param theShape It can be closed or unclosed pipe-like shell
1870      *                  or a pipe-like solid.
1871      *  \param theBase1, theBase2 Two bases of the supposed pipe. This
1872      *                            should be lists of edges of \a theShape.
1873      *  \note It is not assumed that exact or approximate copy of \a theShape
1874      *        can be obtained by applying existing Pipe operation on the
1875      *        resulting "Path" wire taking \a theBase1 as the base - it is not
1876      *        always possible; though in some particular cases it might work
1877      *        it is not guaranteed. Thus, RestorePath function should not be
1878      *        considered as an exact reverse operation of the Pipe.
1879      *  \return New GEOM_Object, containing an edge or wire that represent
1880      *                           source pipe's "path".
1881      */
1882     GEOM_Object RestorePathEdges (in GEOM_Object theShape,
1883                                   in ListOfGO theBase1,
1884                                   in ListOfGO theBase2);
1885   };
1886
1887   /*!
1888    *  \brief Interface for Shapes creation:
1889    *
1890    *  Edge from two points, Wire from edges, Face from wire,
1891    *  Shell from faces, Solid from shells, Compound from shapes
1892    */
1893   interface GEOM_IShapesOperations : GEOM_IOperations
1894   {
1895     /*!
1896      *  \brief Create a linear edge with specified ends.
1897      *  \param thePnt1 Point for the first end of edge.
1898      *  \param thePnt2 Point for the second end of edge.
1899      *  \return New GEOM_Object, containing the created edge.
1900      */
1901     GEOM_Object MakeEdge (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
1902
1903     /*!
1904      *  \brief Create an edge on another edge, corresponding to the given length on the given edge.
1905      *  \param theRefCurve The referenced edge.
1906      *  \param theLength Length on the referenced edge. It can be
1907      *                   negative for extrapolation on base curve.
1908      *  \param theStartPoint Any vertex close to one of edge's
1909      *                       ends to select start point among them.
1910      *                       If NULL, fist vertex is used.
1911      *  \return New GEOM_Object, containing the created edge.
1912      */
1913     GEOM_Object MakeEdgeOnCurveByLength (in GEOM_Object theRefCurve,
1914                                          in double      theLength,
1915                                          in GEOM_Object theStartPoint);
1916
1917     /*!
1918      *  \brief Create an edge from specified wire.
1919      *  \param theWire source Wire.
1920      *  \param theLinearTolerance linear tolerance value
1921      *  \param theAngularTolerance angular tolerance value
1922      *  \return New GEOM_Object, containing the created edge.
1923      */
1924     GEOM_Object MakeEdgeWire (in GEOM_Object theWire,
1925                               in double theLinearTolerance,
1926                               in double theAngularTolerance);
1927
1928     /*!
1929      *  \brief Create a wire from the set of edges and wires.
1930      *  \param theEdgesAndWires List of edge and/or wires.
1931      *  \param theTolerance Maximum distance between vertices, that will be merged.
1932      *                      Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1933      *  \return New GEOM_Object, containing the created wire.
1934      */
1935     GEOM_Object MakeWire (in ListOfGO theEdgesAndWires,
1936                           in double   theTolerance);
1937
1938     /*!
1939      *  \brief Create a face on the given wire.
1940      *  \param theWire closed Wire or Edge to build the face on.
1941      *  \param isPlanarWanted If TRUE, only planar face will be built.
1942      *                        If impossible, NULL object will be returned.
1943      *  \return New GEOM_Object, containing the created face.
1944      */
1945     GEOM_Object MakeFace (in GEOM_Object theWire, in boolean isPlanarWanted);
1946
1947     /*!
1948      *  \brief Create a face on the given wires set.
1949      *  \param theWires List of closed wires or edges to build the face on.
1950      *  \param isPlanarWanted If TRUE, only planar face will be built.
1951      *                        If impossible, NULL object will be returned.
1952      *  \return New GEOM_Object, containing the created face.
1953      */
1954     GEOM_Object MakeFaceWires (in ListOfGO theWires, in boolean isPlanarWanted);
1955
1956     /**
1957      *  \brief Create a face based on surface of theFace limited by theWire.
1958      *  \param theFace the face whose surface is used to create a new face.
1959      *  \param theWire closed Wire build the face.
1960      *  \return New GEOM_Object, containing the created face.
1961      */
1962     GEOM_Object MakeFaceFromSurface(in GEOM_Object theFace,
1963                                     in GEOM_Object theWire);
1964
1965     /*!
1966      *  \brief Create a face from a set of edges with the given constraints.
1967      *  \param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
1968      *         - edges should form a closed wire;
1969      *         - for each edge, constraint face is optional: if a constraint face is missing
1970      *           for some edge, this means that there no constraint associated with this edge.
1971      *  \return New GEOM_Object, containing the created face.
1972      */
1973     GEOM_Object MakeFaceWithConstraints(in ListOfGO theConstraints);
1974
1975     /*!
1976      *  \brief Create a shell from the set of faces and shells.
1977      *  \param theFacesAndShells List of faces and/or shells.
1978      *  \return New GEOM_Object, containing the created shell.
1979      */
1980     GEOM_Object MakeShell (in ListOfGO theFacesAndShells);
1981
1982     /*!
1983      *  \brief Create a solid, bounded by the given shell.
1984      *  \param theShell Bounding shell.
1985      *  \return New GEOM_Object, containing the created solid.
1986      */
1987     GEOM_Object MakeSolidShell (in GEOM_Object theShell);
1988
1989     /*!
1990      *  \brief Create a solid, bounded by the given shells.
1991      *  \param theShells Bounding shells.
1992      *  \return New GEOM_Object, containing the created solid.
1993      */
1994     GEOM_Object MakeSolidShells (in ListOfGO theShells);
1995
1996     /*!
1997      *  \brief Create a compound of the given shapes.
1998      *  \param theShapes List of shapes to put in compound.
1999      *  \return New GEOM_Object, containing the created compound.
2000      */
2001     GEOM_Object MakeCompound (in ListOfGO theShapes);
2002
2003     /*!
2004      *  \brief Make a solid (or solids) from connected set of faces and/or shells.
2005      *  \param theFacesOrShells List of faces and/or shells.
2006      *  \param isIntersect If TRUE, forces performing intersections between arguments.
2007      *
2008      *  \return New GEOM_Object, containing the created solid (or compound of solids).
2009      */
2010     GEOM_Object MakeSolidFromConnectedFaces (in ListOfGO theFacesOrShells, in boolean isIntersect);
2011     
2012     /*!
2013      *  \brief Replace coincident faces in \a theShapes by one face.
2014      *  \param theShapes Initial shapes.
2015      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
2016      *  \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
2017      *  \return New GEOM_Object containing copies of theShapes without coincident faces.
2018      */
2019     GEOM_Object MakeGlueFaces (in ListOfGO theShapes, in double theTolerance, in boolean doKeepNonSolids);
2020
2021     /*!
2022      *  Find coincident faces in theShapes for possible gluing.
2023      *  \param theShapes Initial shapes.
2024      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
2025      *  \return ListOfGO
2026      */
2027     ListOfGO GetGlueFaces (in ListOfGO theShapes, in double theTolerance);
2028
2029     /*!
2030      *  \brief Replace coincident faces in \a theShapes by one face
2031      *         in compliance with given list of faces
2032      *  \param theShapes Initial shapes.
2033      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
2034      *  \param theFaces List of faces for gluing.
2035      *  \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
2036      *  \param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
2037      *                        will be glued, otherwise only the edges,
2038      *                        belonging to <VAR>theFaces</VAR>.
2039      *  \return New GEOM_Object containing copies of theShapes without coincident faces.
2040      */
2041     GEOM_Object MakeGlueFacesByList (in ListOfGO theShapes, in double theTolerance,
2042                                      in ListOfGO theFaces,  in boolean doKeepNonSolids,
2043                                      in boolean doGlueAllEdges);
2044
2045     /*!
2046      *  \brief Replace coincident edges in \a theShapes by one edge.
2047      *  \param theShapes Initial shapes.
2048      *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
2049      *  \return New GEOM_Object containing copies of theShapes without coincident edges.
2050      */
2051     GEOM_Object MakeGlueEdges (in ListOfGO theShapes, in double theTolerance);
2052
2053     /*!
2054      *  Find coincident edges in \a theShapes for possible gluing.
2055      *  \param theShapes Initial shapes.
2056      *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
2057      *  \return ListOfGO
2058      */
2059     ListOfGO GetGlueEdges (in ListOfGO theShapes, in double theTolerance);
2060
2061     /*!
2062      *  \brief Replace coincident edges in \a theShapes by one edge
2063      *         in compliance with given list of edges
2064      *  \param theShapes Initial shapes.
2065      *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
2066      *  \param theEdges List of edges for gluing.
2067      *  \return New GEOM_Object containing copies of theShapes without some edges.
2068      */
2069     GEOM_Object MakeGlueEdgesByList (in ListOfGO theShapes,
2070                                      in double   theTolerance,
2071                                      in ListOfGO theEdges);
2072
2073     /*!
2074      *  \brief Get all sub-shapes and groups of \a theShape,
2075      *  that were created already by any other methods.
2076      *  \param theShape Any shape.
2077      *  \param theGroupsOnly If this parameter is TRUE, only groups will be
2078      *                       returned, else all found sub-shapes and groups.
2079      *  \return List of existing sub-objects of \a theShape.
2080      */
2081     ListOfGO GetExistingSubObjects (in GEOM_Object theShape,
2082                                     in boolean     theGroupsOnly);
2083
2084     /*!
2085      *  \brief Deprecated method. 
2086      *
2087      *  Use MakeAllSubShapes() instead.
2088      */
2089     ListOfGO MakeExplode (in GEOM_Object theShape,
2090                           in long        theShapeType,
2091                           in boolean     isSorted);
2092
2093     /*!
2094      *  \brief Explode a shape on sub-shapes of a given type. 
2095      *
2096      *  If the shape itself has the given type, it is also returned.
2097      *  \param theShape Shape to be exploded.
2098      *  \param theShapeType Type of sub-shapes to be retrieved.
2099      *  \param isSorted If this parameter is TRUE, sub-shapes will be
2100      *                  sorted by coordinates of their gravity centers.
2101      *  \return List of sub-shapes of type theShapeType, contained in theShape.
2102      */
2103     ListOfGO MakeAllSubShapes (in GEOM_Object theShape,
2104                                in long        theShapeType,
2105                                in boolean     isSorted);
2106
2107     /*!
2108      *  \brief Extract all sub-shapes of the given type from
2109      *  the given shape, excluding the shape itself.
2110      *  \param theShape Shape to be exploded.
2111      *  \param theShapeType Type of sub-shapes to be retrieved.
2112      *  \param isSorted If this parameter is TRUE, sub-shapes will be
2113      *                  sorted by coordinates of their gravity centers.
2114      *  \return List of sub-shapes of type theShapeType, contained in theShape.
2115      */
2116     ListOfGO ExtractSubShapes (in GEOM_Object theShape,
2117                                in long        theShapeType,
2118                                in boolean     isSorted);
2119
2120     /*!
2121      *  \brief Deprecated method. Use GetAllSubShapesIDs() instead.
2122      */
2123     ListOfLong SubShapeAllIDs (in GEOM_Object theShape,
2124                                in long        theShapeType,
2125                                in boolean     isSorted);
2126
2127     /*!
2128      *  \brief Explode a shape on sub-shapes of a given type.
2129      *
2130      *  Does the same, as MakeAllSubShapes, but returns IDs of
2131      *  sub-shapes, not GEOM_Object. It works faster.
2132      *  \param theShape Shape to be exploded.
2133      *  \param theShapeType Type of sub-shapes to be retrieved.
2134      *  \param isSorted If this parameter is TRUE, sub-shapes will be
2135      *                  sorted by coordinates of their gravity centers.
2136      *  \return List of IDs of sub-shapes of type theShapeType, contained in theShape.
2137      */
2138     ListOfLong GetAllSubShapesIDs (in GEOM_Object theShape,
2139                                    in long        theShapeType,
2140                                    in boolean     isSorted);
2141
2142     /*!
2143      *  \brief Get a sub-shape defined by its unique ID inside \a theMainShape
2144      *  \param theMainShape Main shape.
2145      *  \param theID Unique ID of sub-shape inside \a theMainShape.
2146      *  \return GEOM_Object, corresponding to found sub-shape.
2147      *  \note The sub-shape GEOM_Object can has ONLY ONE function.
2148      *        Don't try to apply modification operations (without copy) on them.
2149      */
2150     GEOM_Object GetSubShape (in GEOM_Object theMainShape,
2151                              in long        theID);
2152
2153     /*!
2154      *  \brief Get a set of sub-shapes defined by their unique IDs inside \a theMainShape
2155      *  \param theMainShape Main shape.
2156      *  \param theIndices List of unique IDs of sub-shapes inside \a theMainShape.
2157      *  \return List of GEOM_Object, corresponding to found sub-shapes.
2158      *  \note The sub-shape GEOM_Object can has ONLY ONE function.
2159      *        Don't try to apply modification operations (without copy) on them.
2160      */
2161     ListOfGO MakeSubShapes (in GEOM_Object theMainShape,
2162                             in ListOfLong  theIndices);
2163
2164     /*!
2165      *  Get global index of \a theSubShape in \a theMainShape.
2166      *  \param theMainShape Main shape.
2167      *  \param theSubShape Sub-shape of the main shape.
2168      *  \return global index of \a theSubShape in \a theMainShape.
2169      */
2170     long GetSubShapeIndex (in GEOM_Object theMainShape, in GEOM_Object theSubShape);
2171
2172     /*!
2173      *  Get global indices of \a theSubShapes in \a theMainShape.
2174      *  \param theMainShape Main shape.
2175      *  \param theSubShapes List of sub-shapes of the main shape.
2176      *  \return list of global indices of \a theSubShapes in \a theMainShape.
2177      */
2178     ListOfLong GetSubShapesIndices (in GEOM_Object theMainShape, in ListOfGO theSubShapes);
2179
2180     /*!
2181      *  \brief Get index of \a theSubShape in \a theMainShape, unique among sub-shapes of the same type.
2182      *
2183      *  Together with method <VAR>GetShapeTypeString()</VAR> it can be used
2184      *  to generate automatic names for sub-shapes, when publishing them in a study.
2185      *  \param theMainShape Main shape.
2186      *  \param theSubShape Sub-shape of the main shape.
2187      *  \return index of \a theSubShape in a list of all sub-shapes of \a theMainShape of the same type.
2188      */
2189     long GetTopologyIndex (in GEOM_Object theMainShape, in GEOM_Object theSubShape);
2190
2191     /*!
2192      *  \brief Get name of type of \a theShape.
2193      *
2194      *  Use wide type notation, taking into consideration both topology and geometry of the shape.
2195      *  Together with method <VAR>GetTopologyIndex()</VAR> it can be used
2196      *  to generate automatic names for sub-shapes, when publishing them in a study.
2197      *  \param theShape The shape to get a type of.
2198      *  \return String, containing a type name of \a theShape.
2199      */
2200     string GetShapeTypeString (in GEOM_Object theShape);
2201
2202     /*!
2203      *  \brief Check if the object is a sub-object of another GEOM object.
2204      *
2205      *  \param theSubObject Checked sub-object (or its parent object, in case if
2206      *                      \a theSubObjectIndex is non-zero).
2207      *  \param theSubObjectIndex When non-zero, specifies a sub-shape index that
2208      *                           identifies a sub-object within its parent specified via \a theSubObject.
2209      *  \param theObject An object that is checked for ownership (or its parent object,
2210      *                   in case if \a theObjectIndex is non-zero).
2211      *  \param theObjectIndex When non-zero, specifies a sub-shape index that
2212      *                        identifies an object within its parent specified via \a theObject.
2213      *  \return TRUE, if the given object contains sub-object.
2214      */
2215     boolean IsSubShapeBelongsTo( in GEOM_Object theSubObject,
2216                                  in long        theSubObjectIndex,
2217                                  in GEOM_Object theObject,
2218                                  in long        theObjectIndex);
2219     /*!
2220      *  \brief Count number of faces in the given shape.
2221      *  \param theShape Shape to count faces in.
2222      *  \return Number of faces in the given shape.
2223      */
2224     long NumberOfFaces (in GEOM_Object theShape);
2225
2226     /*!
2227      *  \brief Count number of edges in the given shape.
2228      *  \param theShape Shape to count edges in.
2229      *  \return Number of edges in theShape.
2230      */
2231     long NumberOfEdges (in GEOM_Object theShape);
2232
2233     /*!
2234      *  \brief Count number of sub-shapes of type \a theShapeType in the given shape.
2235      *  \param theShape Shape to count sub-shapes in.
2236      *  \param theShapeType The type of sub-shapes to count.
2237      *  \return Number of sub-shapes of type \a theShapeType in \a theShape.
2238      */
2239     long NumberOfSubShapes (in GEOM_Object theShape,
2240                             in long        theShapeType);
2241
2242     /*!
2243      *  Reverses an orientation the given shape.
2244      *  \param theShape Shape to be reversed.
2245      *  \return The reversed copy of theShape.
2246      */
2247     GEOM_Object ChangeOrientation (in GEOM_Object theShape);
2248
2249     /*!
2250      *  \brief Retrieve all free faces from the given shape.
2251      *
2252      *  Free face is a face, which is not shared between two shells of the shape.
2253      *  \param theShape Shape to find free faces in.
2254      *  \return List of IDs of all free faces, contained in theShape.
2255      */
2256     ListOfLong GetFreeFacesIDs (in GEOM_Object theShape);
2257
2258     /*!
2259      *  \brief Get all sub-shapes of theShape1 of the given type, shared with theShape2.
2260      *  \param theShape1 Shape to find sub-shapes in.
2261      *  \param theShape2 Shape to find shared sub-shapes with.
2262      *  \param theShapeType Type of sub-shapes to be retrieved.
2263      *  \return List of sub-shapes of theShape1, shared with theShape2.
2264      */
2265     ListOfGO GetSharedShapes (in GEOM_Object theShape1,
2266                               in GEOM_Object theShape2,
2267                               in long        theShapeType);
2268
2269     /*!
2270      *  \brief Get sub-shapes, shared by input shapes.
2271      *  \param theShapes Shapes to find common sub-shapes of.
2272      *  \param theShapeType Type of sub-shapes to be retrieved.
2273      *  \param theMultiShare Specifies what type of shares should be checked:
2274      *         - \c TRUE: search sub-shapes from 1st input shape shared with all other input shapes;
2275      *         - \c FALSE: causes to search sub-shapes shared between couples of input shapes.
2276      *  \note If \a theShapes contains single compound, the shares between all possible couples of 
2277      *        its top-level shapes are returned; otherwise, only shares between 1st input shape
2278      *        and all rest input shapes are returned.
2279      *              
2280      *  \return List of all found sub-shapes.
2281      */
2282     ListOfGO GetSharedShapesMulti (in ListOfGO theShapes,
2283                                    in long     theShapeType,
2284                                    in boolean  theMultiShare);
2285
2286     /*!
2287      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2288      *  the specified plane by the certain way, defined through \a theState parameter.
2289      *  \param theShape Shape to find sub-shapes of.
2290      *  \param theShapeType Type of sub-shapes to be retrieved.
2291      *  \param theAx1 Vector (or line, or linear edge), specifying normal
2292      *                direction and location of the plane to find shapes on.
2293      *  \param theState The state of the sub-shapes to find.
2294      *  \return List of all found sub-shapes.
2295      */
2296     ListOfGO GetShapesOnPlane (in GEOM_Object theShape,
2297                                in long        theShapeType,
2298                                in GEOM_Object theAx1,
2299                                in shape_state theState);
2300     /*!
2301      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2302      *  the specified plane by the certain way, defined through \a theState parameter.
2303      *  \param theShape Shape to find sub-shapes of.
2304      *  \param theShapeType Type of sub-shapes to be retrieved.
2305      *  \param theAx1 Vector (or line, or linear edge), specifying normal
2306      *                direction of the plane to find shapes on.
2307      *  \param thePnt Point specifying location of the plane to find shapes on.
2308      *  \param theState The state of the sub-shapes to find.
2309      *  \return List of all found sub-shapes.
2310      */
2311     ListOfGO GetShapesOnPlaneWithLocation (in GEOM_Object theShape,
2312                                            in long        theShapeType,
2313                                            in GEOM_Object theAx1,
2314                                            in GEOM_Object thePnt,
2315                                            in shape_state theState);
2316
2317
2318
2319     /*!
2320      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2321      *  the specified cylinder by the certain way, defined through \a theState parameter.
2322      *  \param theShape Shape to find sub-shapes of.
2323      *  \param theShapeType Type of sub-shapes to be retrieved.
2324      *  \param theAxis Vector (or line, or linear edge), specifying
2325      *                 axis of the cylinder to find shapes on.
2326      *  \param theRadius Radius of the cylinder to find shapes on.
2327      *  \param theState The state of the sub-shapes to find.
2328      *  \return List of all found sub-shapes.
2329      */
2330     ListOfGO GetShapesOnCylinder (in GEOM_Object theShape,
2331                                   in long        theShapeType,
2332                                   in GEOM_Object theAxis,
2333                                   in double      theRadius,
2334                                   in shape_state theState);
2335
2336     /*!
2337      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2338      *  the specified cylinder by the certain way, defined through \a theState parameter.
2339      *  \param theShape Shape to find sub-shapes of.
2340      *  \param theShapeType Type of sub-shapes to be retrieved.
2341      *  \param theAxis Vector (or line, or linear edge), specifying
2342      *                 axis of the cylinder to find shapes on.
2343      *  \param thePnt Point specifying location of the bottom of the cylinder.
2344      *  \param theRadius Radius of the cylinder 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 GetShapesOnCylinderWithLocation (in GEOM_Object theShape,
2349                                               in long        theShapeType,
2350                                               in GEOM_Object theAxis,
2351                                               in GEOM_Object thePnt,
2352                                               in double      theRadius,
2353                                               in shape_state theState);
2354
2355     /*!
2356      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2357      *  the specified sphere by the certain way, defined through \a theState parameter.
2358      *  \param theShape Shape to find sub-shapes of.
2359      *  \param theShapeType Type of sub-shapes to be retrieved.
2360      *  \param theCenter Point, specifying center of the sphere to find shapes on.
2361      *  \param theRadius Radius of the sphere to find shapes on.
2362      *  \param theState The state of the sub-shapes to find.
2363      *  \return List of all found sub-shapes.
2364      */
2365     ListOfGO GetShapesOnSphere (in GEOM_Object theShape,
2366                                 in long        theShapeType,
2367                                 in GEOM_Object theCenter,
2368                                 in double      theRadius,
2369                                 in shape_state theState);
2370
2371     /*!
2372      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2373      *  the specified quadrangle by the certain way, defined through \a theState parameter.
2374      *  \param theShape Shape to find sub-shapes of.
2375      *  \param theShapeType Type of sub-shapes to be retrieved.
2376      *  \param theTopLeftPoint Top left quadrangle corner
2377      *  \param theTopRigthPoint Top right quadrangle corner
2378      *  \param theBottomLeftPoint Bottom left quadrangle corner
2379      *  \param theBottomRigthPoint Bottom right quadrangle corner
2380      *  \param theState The state of the sub-shapes to find.
2381      *  \return List of all found sub-shapes.
2382      */
2383     ListOfGO GetShapesOnQuadrangle (in GEOM_Object theShape,
2384                                     in long        theShapeType,
2385                                     in GEOM_Object theTopLeftPoint,
2386                                     in GEOM_Object theTopRigthPoint,
2387                                     in GEOM_Object theBottomLeftPoint,
2388                                     in GEOM_Object theBottomRigthPoint,
2389                                     in shape_state theState);
2390
2391     /*!
2392      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2393      *  the specified plane by the certain way, defined through \a theState parameter.
2394      *  \param theShape Shape to find sub-shapes of.
2395      *  \param theShapeType Type of sub-shapes to be retrieved.
2396      *  \param theAx1 Vector (or line, or linear edge), specifying normal
2397      *                direction and location of the plane to find shapes on.
2398      *  \param theState The state of the sub-shapes to find.
2399      *  \return List of IDs of all found sub-shapes.
2400      */
2401     ListOfLong GetShapesOnPlaneIDs (in GEOM_Object theShape,
2402                                     in long        theShapeType,
2403                                     in GEOM_Object theAx1,
2404                                     in shape_state theState);
2405
2406     /*!
2407      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2408      *  the specified plane by the certain way, defined through \a theState parameter.
2409      *  \param theShape Shape to find sub-shapes of.
2410      *  \param theShapeType Type of sub-shapes to be retrieved.
2411      *  \param theAx1 Vector (or line, or linear edge), specifying normal
2412      *                direction of the plane to find shapes on.
2413      *  \param thePnt Point specifying location of the plane to find shapes on.
2414      *  \param theState The state of the sub-shapes to find.
2415      *  \return List of IDs of all found sub-shapes.
2416      */
2417     ListOfLong GetShapesOnPlaneWithLocationIDs (in GEOM_Object theShape,
2418                                                 in long        theShapeType,
2419                                                 in GEOM_Object theAx1,
2420                                                 in GEOM_Object thePnt,
2421                                                 in shape_state theState);
2422
2423     /*!
2424      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2425      *  the specified cylinder by the certain way, defined through \a theState parameter.
2426      *  \param theShape Shape to find sub-shapes of.
2427      *  \param theShapeType Type of sub-shapes to be retrieved.
2428      *  \param theAxis Vector (or line, or linear edge), specifying
2429      *                 axis of the cylinder to find shapes on.
2430      *  \param theRadius Radius of the cylinder to find shapes on.
2431      *  \param theState The state of the sub-shapes to find.
2432      *  \return List of IDs of all found sub-shapes.
2433      */
2434     ListOfLong GetShapesOnCylinderIDs (in GEOM_Object theShape,
2435                                        in long        theShapeType,
2436                                        in GEOM_Object theAxis,
2437                                        in double      theRadius,
2438                                        in shape_state theState);
2439
2440     /*!
2441      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2442      *  the specified cylinder by the certain way, defined through \a theState parameter.
2443      *  \param theShape Shape to find sub-shapes of.
2444      *  \param theShapeType Type of sub-shapes to be retrieved.
2445      *  \param theAxis Vector (or line, or linear edge), specifying
2446      *                 axis of the cylinder to find shapes on.
2447      *  \param thePnt Point specifying location of the bottom of the cylinder.
2448      *  \param theRadius Radius of the cylinder to find shapes on.
2449      *  \param theState The state of the sub-shapes to find.
2450      *  \return List of IDs all found sub-shapes.
2451      */
2452     ListOfLong GetShapesOnCylinderWithLocationIDs (in GEOM_Object theShape,
2453                                                    in long        theShapeType,
2454                                                    in GEOM_Object theAxis,
2455                                                    in GEOM_Object thePnt,
2456                                                    in double      theRadius,
2457                                                    in shape_state theState);
2458
2459     /*!
2460      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2461      *  the specified sphere by the certain way, defined through \a theState parameter.
2462      *  \param theShape Shape to find sub-shapes of.
2463      *  \param theShapeType Type of sub-shapes to be retrieved.
2464      *  \param theCenter Point, specifying center of the sphere to find shapes on.
2465      *  \param theRadius Radius of the sphere to find shapes on.
2466      *  \param theState The state of the sub-shapes to find.
2467      *  \return List of IDs of all found sub-shapes.
2468      */
2469     ListOfLong GetShapesOnSphereIDs (in GEOM_Object theShape,
2470                                      in long        theShapeType,
2471                                      in GEOM_Object theCenter,
2472                                      in double      theRadius,
2473                                      in shape_state theState);
2474
2475     /*!
2476      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2477      *  the specified quadrangle by the certain way, defined through \a theState parameter.
2478      *  \param theShape Shape to find sub-shapes of.
2479      *  \param theShapeType Type of sub-shapes to be retrieved.
2480      *  \param theTopLeftPoint Top left quadrangle corner
2481      *  \param theTopRigthPoint Top right quadrangle corner
2482      *  \param theBottomLeftPoint Bottom left quadrangle corner
2483      *  \param theBottomRigthPoint Bottom right quadrangle corner
2484      *  \param theState The state of the sub-shapes to find.
2485      *  \return List of IDs of all found sub-shapes.
2486      */
2487     ListOfLong GetShapesOnQuadrangleIDs (in GEOM_Object theShape,
2488                                          in long        theShapeType,
2489                                          in GEOM_Object theTopLeftPoint,
2490                                          in GEOM_Object theTopRigthPoint,
2491                                          in GEOM_Object theBottomLeftPoint,
2492                                          in GEOM_Object theBottomRigthPoint,
2493                                          in shape_state theState);
2494
2495     /*!
2496      * \brief Find sub-shapes complying with given status
2497      * \param theBox - the box to check state of sub-shapes against
2498      * \param theShape - the shape to explore
2499      * \param theShapeType - type of sub-shape of theShape
2500      * \param theState - required state
2501      * \return List of IDs of all found sub-shapes.
2502      */
2503     ListOfLong GetShapesOnBoxIDs (in GEOM_Object theBox,
2504                                   in GEOM_Object theShape,
2505                                   in long        theShapeType,
2506                                   in shape_state theState);
2507
2508     /*!
2509      * \brief Find sub-shapes complying with given status
2510      * \param theBox - the box to check state of sub-shapes against
2511      * \param theShape - the shape to explore
2512      * \param theShapeType - type of sub-shape of theShape
2513      * \param theState - required state
2514      * \return List of all found sub-shapes.
2515      */
2516     ListOfGO GetShapesOnBox (in GEOM_Object theBox,
2517                              in GEOM_Object theShape,
2518                              in long        theShapeType,
2519                              in shape_state theState);
2520
2521     /*!
2522      * \brief Find sub-shapes complying with given status
2523      * \param theCheckShape - the shape to check state of sub-shapes against. It must be a solid.
2524      * \param theShape - the shape to explore
2525      * \param theShapeType - type of sub-shape of theShape
2526      * \param theState - required state
2527      * \return List of IDs of all found sub-shapes.
2528      */
2529     ListOfLong GetShapesOnShapeIDs (in GEOM_Object theCheckShape,
2530                                     in GEOM_Object theShape,
2531                                     in short       theShapeType,
2532                                     in shape_state theState);
2533
2534     /*!
2535      * \brief Find sub-shapes complying with given status
2536      * \param theCheckShape - the shape to check state of sub-shapes against. It must be a solid.
2537      * \param theShape - the shape to explore
2538      * \param theShapeType - type of sub-shape of theShape
2539      * \param theState - required state
2540      * \return List of all found sub-shapes.
2541      */
2542     ListOfGO GetShapesOnShape (in GEOM_Object theCheckShape,
2543                                in GEOM_Object theShape,
2544                                in short       theShapeType,
2545                                in shape_state theState);
2546
2547     /*!
2548      * \brief Find sub-shapes complying with given status
2549      * \param theCheckShape - the shape to check state of sub-shapes against. It must be a solid.
2550      * \param theShape - the shape to explore
2551      * \param theShapeType - type of sub-shape of theShape
2552      * \param theState - required state
2553      * \return compound includes all found sub-shapes.
2554      */
2555     GEOM_Object GetShapesOnShapeAsCompound (in GEOM_Object theCheckShape,
2556                                             in GEOM_Object theShape,
2557                                             in short       theShapeType,
2558                                             in shape_state theState);
2559
2560     /*!
2561      *  \brief Get sub-shape(s) of \a theShapeWhere, which are
2562      *  coincident with \a theShapeWhat or could be a part of it.
2563      *  \param theShapeWhere Shape to find sub-shapes of.
2564      *  \param theShapeWhat Shape, specifying what to find.
2565      *  \return Group of all found sub-shapes or a single found sub-shape.
2566      */
2567     GEOM_Object GetInPlace (in GEOM_Object theShapeWhere,
2568                             in GEOM_Object theShapeWhat);
2569
2570     /*!
2571      *  Old implementation of GetInPlace functionality, based on shape properties.
2572      */
2573     GEOM_Object GetInPlaceOld (in GEOM_Object theShapeWhere,
2574                                in GEOM_Object theShapeWhat);
2575
2576     /*!
2577      *  \brief Get sub-shape(s) of \a theShapeWhere, which are
2578      *  coincident with \a theShapeWhat or could be a part of it.
2579      *
2580      *  Implementation of this method is based on a saved history of an operation,
2581      *  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
2582      *  arguments (an argument shape or a sub-shape of an argument shape).
2583      *  The operation could be the Partition or one of boolean operations,
2584      *  performed on simple shapes (not on compounds).
2585      *
2586      *  \param theShapeWhere Shape to find sub-shapes of.
2587      *  \param theShapeWhat Shape, specifying what to find.
2588      *  \return Group of all found sub-shapes or a single found sub-shape.
2589      */
2590     GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere,
2591                                      in GEOM_Object theShapeWhat);
2592
2593     /*!
2594      *  \brief Get sub-shape of theShapeWhere, which are
2595      *  coincident with \a theShapeWhat that can either SOLID, FACE, EDGE or VERTEX.
2596      *  \param theShapeWhere Shape to find sub-shapes of.
2597      *  \param theShapeWhat Shape, specifying what to find.
2598      *  \return found sub-shape.
2599      */
2600     GEOM_Object GetSame (in GEOM_Object theShapeWhere,
2601                          in GEOM_Object theShapeWhat);
2602
2603     /*!
2604      *  \brief Get sub-shape Ids of theShapeWhere, which are
2605      *   coincident with \a theShapeWhat that can either SOLID, FACE, EDGE or VERTEX.
2606      *  \param theShapeWhere Shape to find sub-shapes of.
2607      *  \param theShapeWhat Shape, specifying what to find.
2608      *  \return found sub-shape Ids.
2609      */
2610     ListOfLong GetSameIDs (in GEOM_Object theShapeWhere,
2611                            in GEOM_Object theShapeWhat);
2612
2613     /*!
2614      *  \brief Resize the input edge with the new Min and Max parameters.
2615      *  The input edge parameters range is [0, 1]. If theMin parameter is
2616      *  negative, the input edge is extended, otherwise it is shrinked by
2617      *  theMin parameter. If theMax is greater than 1, the edge is extended,
2618      *  otherwise it is shrinked by theMax parameter.
2619      *  \param theEdge the input edge to be resized.
2620      *  \param theMin the minimal parameter value.
2621      *  \param theMax the maximal parameter value.
2622      *  \return a newly created edge.
2623      */
2624     GEOM_Object ExtendEdge(in GEOM_Object theEdge,
2625                            in double      theMin,
2626                            in double      theMax);
2627
2628     /*!
2629      *  \brief Resize the input face with the new UMin, UMax, VMin and VMax
2630      *  parameters. The input face U and V parameters range is [0, 1]. If
2631      *  theUMin parameter is negative, the input face is extended, otherwise
2632      *  it is shrinked along U direction by theUMin parameter. If theUMax is
2633      *  greater than 1, the face is extended, otherwise it is shrinked along
2634      *  U direction by theUMax parameter. So as for theVMin, theVMax and
2635      *  V direction of the input face.
2636      *  \param theFace the input face to be resized.
2637      *  \param theUMin the minimal U parameter value.
2638      *  \param theUMax the maximal U parameter value.
2639      *  \param theVMin the minimal V parameter value.
2640      *  \param theVMax the maximal V parameter value.
2641      *  \return a newly created face.
2642      */
2643     GEOM_Object ExtendFace(in GEOM_Object theFace,
2644                            in double      theUMin,
2645                            in double      theUMax,
2646                            in double      theVMin,
2647                            in double      theVMax);
2648
2649     /*!
2650      *  \brief Make a surface from a face. This function takes some face as
2651      *  input parameter and creates new GEOM_Object, i.e. topological shape
2652      *  by extracting underlying surface of the source face and limiting it
2653      *  by the Umin, Umax, Vmin, Vmax parameters of the source face (in the
2654      *  parametrical space).
2655      *  \param theFace the input face.
2656      *  \return a newly created face.
2657      */
2658     GEOM_Object MakeSurfaceFromFace(in GEOM_Object theFace);
2659
2660     /*!
2661      * \brief Explode a shape into edges sorted in a row from a starting point.
2662      * \param theShape - the shape to be exploded on edges.
2663      * \param theStartPoint - the starting point.
2664      * \return Ordered list of edges sorted in a row from a starting point.
2665      */
2666     ListOfGO GetSubShapeEdgeSorted (in GEOM_Object theShape,
2667                                     in GEOM_Object theStartPoint);
2668
2669   };
2670
2671  // # GEOM_IBlocksOperations: 
2672   /*!
2673    *  \brief Interface for Blocks construction
2674    *  Face from points or edges, Block from faces,
2675    *  Blocks multi-translation and multi-rotation
2676    */
2677   interface GEOM_IBlocksOperations : GEOM_IOperations
2678   {
2679    
2680   //  # Creation of blocks
2681
2682     /*!
2683      *  \brief Create a quadrangle face from four edges. Order of Edges is not
2684      *  important. It is  not necessary that edges share the same vertex.
2685      *  \param theEdge1,theEdge2,theEdge3,theEdge4 Edges for the face bound.
2686      *  \return New GEOM_Object, containing the created face.
2687      */
2688     GEOM_Object MakeQuad (in GEOM_Object theEdge1,
2689                           in GEOM_Object theEdge2,
2690                           in GEOM_Object theEdge3,
2691                           in GEOM_Object theEdge4);
2692
2693     /*!
2694      *  \brief Create a quadrangle face on two edges.
2695      *
2696      *  The missing edges will be built by creating the shortest ones.
2697      *  \param theEdge1,theEdge2 Two opposite edges for the face.
2698      *  \return New GEOM_Object, containing the created face.
2699      */
2700     GEOM_Object MakeQuad2Edges (in GEOM_Object theEdge1,
2701                                 in GEOM_Object theEdge2);
2702
2703     /*!
2704      *  \brief Create a quadrangle face with specified corners.
2705      *
2706      *  The missing edges will be built by creating the shortest ones.
2707      *  \param thePnt1,thePnt2,thePnt3,thePnt4 Corner vertices for the face.
2708      *  \return New GEOM_Object, containing the created face.
2709      */
2710     GEOM_Object MakeQuad4Vertices (in GEOM_Object thePnt1,
2711                                    in GEOM_Object thePnt2,
2712                                    in GEOM_Object thePnt3,
2713                                    in GEOM_Object thePnt4);
2714
2715     /*!
2716      *  \brief Create a hexahedral solid, bounded by the six given faces. Order of
2717      *  faces is not important. 
2718      *
2719      *  It is  not necessary that Faces share the same edge.
2720      *  \param theFace1,theFace2,theFace3,theFace4,theFace5,theFace6 Faces for the hexahedral solid.
2721      *  \return New GEOM_Object, containing the created solid.
2722      */
2723     GEOM_Object MakeHexa (in GEOM_Object theFace1,
2724                           in GEOM_Object theFace2,
2725                           in GEOM_Object theFace3,
2726                           in GEOM_Object theFace4,
2727                           in GEOM_Object theFace5,
2728                           in GEOM_Object theFace6);
2729
2730     /*!
2731      *  \brief Create a hexahedral solid between two given faces.
2732      *
2733      *  The missing faces will be built by creating the smallest ones.
2734      *  \param theFace1,theFace2 Two opposite faces for the hexahedral solid.
2735      *  \return New GEOM_Object, containing the created solid.
2736      */
2737     GEOM_Object MakeHexa2Faces (in GEOM_Object theFace1,
2738                                 in GEOM_Object theFace2);
2739
2740     
2741   //  # Extract elements of blocks and blocks compounds
2742      
2743
2744     /*!
2745      *  \brief Get a vertex, found in the given shape by its coordinates.
2746      *  \param theShape Block or a compound of blocks.
2747      *  \param theX,theY,theZ Coordinates of the sought vertex.
2748      *  \param theEpsilon Maximum allowed distance between the resulting
2749      *                    vertex and point with the given coordinates.
2750      *  \return New GEOM_Object, containing the found vertex.
2751      */
2752     GEOM_Object GetPoint (in GEOM_Object theShape,
2753                           in double      theX,
2754                           in double      theY,
2755                           in double      theZ,
2756                           in double      theEpsilon);
2757
2758     /*!
2759      *  \brief Find a vertex of the given shape, which has minimal distance to the given point.
2760      *  \param theShape Any shape.
2761      *  \param thePoint Point, close to the desired vertex.
2762      *  \return New GEOM_Object, containing the found vertex.
2763      */
2764     GEOM_Object GetVertexNearPoint (in GEOM_Object theShape,
2765                                     in GEOM_Object thePoint);
2766
2767     /*!
2768      *  \brief Get an edge, found in the given shape by two given vertices.
2769      *  \param theShape Block or a compound of blocks.
2770      *  \param thePoint1,thePoint2 Points, close to the ends of the desired edge.
2771      *  \return New GEOM_Object, containing the found edge.
2772      */
2773     GEOM_Object GetEdge (in GEOM_Object theShape,
2774                          in GEOM_Object thePoint1,
2775                          in GEOM_Object thePoint2);
2776
2777     /*!
2778      *  \brief Find an edge of the given shape, which has minimal distance to the given point.
2779      *  \param theShape Block or a compound of blocks.
2780      *  \param thePoint Point, close to the desired edge.
2781      *  \return New GEOM_Object, containing the found edge.
2782      */
2783     GEOM_Object GetEdgeNearPoint (in GEOM_Object theShape,
2784                                   in GEOM_Object thePoint);
2785
2786     /*!
2787      *  \brief Returns a face, found in the given shape by four given corner vertices.
2788      *  \param theShape Block or a compound of blocks.
2789      *  \param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
2790      *  \return New GEOM_Object, containing the found face.
2791      */
2792     GEOM_Object GetFaceByPoints (in GEOM_Object theShape,
2793                                  in GEOM_Object thePoint1,
2794                                  in GEOM_Object thePoint2,
2795                                  in GEOM_Object thePoint3,
2796                                  in GEOM_Object thePoint4);
2797
2798     /*!
2799      *  \brief Get a face of block, found in the given shape by two given edges.
2800      *  \param theShape Block or a compound of blocks.
2801      *  \param theEdge1,theEdge2 Edges, close to the edges of the desired face.
2802      *  \return New GEOM_Object, containing the found face.
2803      */
2804     GEOM_Object GetFaceByEdges (in GEOM_Object theShape,
2805                                 in GEOM_Object theEdge1,
2806                                 in GEOM_Object theEdge2);
2807
2808     /*!
2809      *  \brief Find a face, opposite to the given one in the given block.
2810      *  \param theBlock Must be a hexahedral solid.
2811      *  \param theFace Face of \a theBlock, opposite to the desired face.
2812      *  \return New GEOM_Object, containing the found face.
2813      */
2814     GEOM_Object GetOppositeFace (in GEOM_Object theBlock,
2815                                  in GEOM_Object theFace);
2816
2817     /*!
2818      *  \brief Find a face of the given shape, which has minimal distance to the given point.
2819      *  \param theShape Block or a compound of blocks.
2820      *  \param thePoint Point, close to the desired face.
2821      *  \return New GEOM_Object, containing the found face.
2822      */
2823     GEOM_Object GetFaceNearPoint (in GEOM_Object theShape,
2824                                   in GEOM_Object thePoint);
2825
2826     /*!
2827      *  \brief Find a face of block, whose outside normale has minimal angle with the given vector.
2828      *  \param theBlock Block or a compound of blocks.
2829      *  \param theVector Vector, close to the normale of the desired face.
2830      *  \return New GEOM_Object, containing the found face.
2831      */
2832     GEOM_Object GetFaceByNormale (in GEOM_Object theBlock,
2833                                   in GEOM_Object theVector);
2834
2835     /*!
2836      *  \brief Find all sub-shapes of type \a theShapeType of the given shape,
2837      *  which have minimal distance to the given point.
2838      *  \param theShape Any shape.
2839      *  \param thePoint Point, close to the desired shape.
2840      *  \param theShapeType Defines what kind of sub-shapes is searched.
2841      *  \param theTolerance The tolerance for distances comparison. All shapes
2842      *                      with distances to the given point in interval
2843      *                      [minimal_distance, minimal_distance + theTolerance] will be gathered.
2844      *  \return New GEOM_Object, containing a group of all found shapes.
2845      */
2846     GEOM_Object GetShapesNearPoint (in GEOM_Object theShape,
2847                                     in GEOM_Object thePoint,
2848                                     in long        theShapeType,
2849                                     in double      theTolerance);
2850
2851    //  #  Extract blocks from blocks compounds
2852      
2853
2854     /*!
2855      *  \brief Check, if the compound contains only specified blocks.
2856      *  \param theCompound The compound to check.
2857      *  \param theMinNbFaces If solid has lower number of faces, it is not a block.
2858      *  \param theMaxNbFaces If solid has higher number of faces, it is not a block.
2859      *    \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
2860      *  \param theNbBlocks Number of specified blocks in theCompound.
2861      *  \return TRUE, if the given compound contains only blocks.
2862      */
2863     boolean IsCompoundOfBlocks (in GEOM_Object theCompound,
2864                                 in long        theMinNbFaces,
2865                                 in long        theMaxNbFaces,
2866                                 out long       theNbBlocks);
2867
2868     /*!
2869      *  \brief Enumeration of Blocks Compound defects.
2870      */
2871     enum BCErrorType
2872     {
2873       /* Each element of the compound should be a Block */
2874       NOT_BLOCK,
2875
2876       /* An element is a potential block, but has degenerated and/or seam edge(s). */
2877       EXTRA_EDGE,
2878
2879       /* A connection between two Blocks should be an entire face or an entire edge */
2880       INVALID_CONNECTION,
2881
2882       /* The compound should be connexe */
2883       NOT_CONNECTED,
2884
2885       /* The glue between two quadrangle faces should be applied */
2886       NOT_GLUED
2887     };
2888
2889     /*!
2890      *  \brief Description of Blocks Compound defect: type and incriminated sub-shapes.
2891      */
2892     struct BCError
2893     {
2894       BCErrorType error;
2895       ListOfLong  incriminated;
2896     };
2897
2898     /*!
2899      *  \brief Sequence of all Blocks Compound defects.
2900      */
2901     typedef sequence<BCError> BCErrors;
2902
2903     /*!
2904      *  \brief Check, if the compound of blocks is given.
2905      *
2906      *  To be considered as a compound of blocks, the
2907      *  given shape must satisfy the following conditions:
2908      *  - Each element of the compound should be a Block (6 faces and 12 edges).
2909      *  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
2910      *  - The compound should be connexe.
2911      *  - The glue between two quadrangle faces should be applied.
2912      *    \note Single block is also accepted as a valid compound of blocks.
2913      *  \param theCompound The compound to check.
2914      *  \param theToleranceC1 the tolerance to check if two neighbor edges are
2915      *         collinear in the common vertex with this tolerance. Negative
2916      *         value means that C1 criterion is not used (old implementation).
2917      *  \param theErrors Structure, containing discovered errors and incriminated sub-shapes.
2918      *  \return TRUE, if the given shape is a compound of blocks.
2919      */
2920     boolean CheckCompoundOfBlocks (in GEOM_Object theCompound,
2921                                    in double      theToleranceC1,
2922                                    out BCErrors   theErrors);
2923
2924     /*!
2925      *  \brief Convert sequence of Blocks Compound errors, returned by
2926      *  <VAR>CheckCompoundOfBlocks()</VAR>, into string.
2927      *  \param theCompound The bad compound.
2928      *  \param theErrors The sequence of \a theCompound errors.
2929      *  \return String, describing all the errors in form, suitable for printing.
2930      */
2931     string PrintBCErrors (in GEOM_Object theCompound,
2932                           in BCErrors    theErrors);
2933
2934     /*!
2935      *  \brief Retrieve all non blocks solids and faces from a shape.
2936      *
2937      *  \param theShape The shape to explore.
2938      *  \param theToleranceC1 the tolerance to check if two neighbor edges are
2939      *         collinear in the common vertex with this tolerance. Negative
2940      *         value means that C1 criterion is not used (old implementation).
2941      *  \param theNonQuads Output parameter. Group of all non quadrangular faces.
2942      *
2943      *  \return Group of all non block solids (= not 6 faces, or with 6
2944      *          faces, but with the presence of non-quadrangular faces).
2945      */
2946     GEOM_Object GetNonBlocks (in GEOM_Object  theShape,
2947                               in double       theToleranceC1,
2948                               out GEOM_Object theNonQuads);
2949
2950     /*!
2951      *  \brief Remove all seam and degenerated edges from \a theShape.
2952      *
2953      *  Unite faces and edges, sharing one surface.
2954      *  \param theShape The compound or single solid to remove irregular edges from.
2955      *  \param theOptimumNbFaces If more than zero, unite faces only for those solids,
2956      *         that have more than theOptimumNbFaces faces. If zero, unite faces always,
2957      *         regardsless their quantity in the solid. If negative, do not unite faces at all.
2958      *         For blocks repairing recommended value is 6.
2959      *  \return Improved shape.
2960      */
2961     GEOM_Object RemoveExtraEdges (in GEOM_Object theShape,
2962                                   in long        theOptimumNbFaces);
2963
2964     /*!
2965      *  \brief Performs union faces of \a theShape.
2966      *
2967      *  Unite faces sharing one surface.
2968      *  \param theShape The compound or single solid that contains faces to perform union.
2969      *  \return Improved shape.
2970      */
2971     GEOM_Object UnionFaces (in GEOM_Object theShape);
2972
2973     /*!
2974      *  \brief Check, if the given shape is a blocks compound.
2975      *
2976      *  Fix all detected errors.
2977      *    \note Single block can be also fixed by this method.
2978      *  \param theCompound The compound to check and improve.
2979      *  \return Improved compound.
2980      */
2981     GEOM_Object CheckAndImprove (in GEOM_Object theCompound);
2982
2983     /*!
2984      *  \brief Get all the blocks, contained in the given compound.
2985      *
2986      *  \param theCompound The compound to explode.
2987      *  \param theMinNbFaces If solid has lower number of faces, it is not a block.
2988      *  \param theMaxNbFaces If solid has higher number of faces, it is not a block.
2989      *    \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
2990      *  \return List of GEOM_Object, containing the retrieved blocks.
2991      */
2992     ListOfGO ExplodeCompoundOfBlocks (in GEOM_Object theCompound,
2993                                       in long        theMinNbFaces,
2994                                       in long        theMaxNbFaces);
2995
2996     /*!
2997      *  \brief Find block, containing the given point inside its volume or on boundary.
2998      *  \param theCompound Compound, to find block in.
2999      *  \param thePoint Point, close to the desired block. If the point lays on
3000      *         boundary between some blocks, we return block with nearest center.
3001      *  \return New GEOM_Object, containing the found block.
3002      */
3003     GEOM_Object GetBlockNearPoint (in GEOM_Object theCompound,
3004                                    in GEOM_Object thePoint);
3005
3006     /*!
3007      *  \brief Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3008      *  \param theCompound Compound, to find block in.
3009      *  \param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3010      *  \return New GEOM_Object, containing the found block.
3011      */
3012     GEOM_Object GetBlockByParts (in GEOM_Object theCompound,
3013                                  in ListOfGO    theParts);
3014
3015     /*!
3016      *  \brief Return all blocks, containing all the elements, passed as the parts.
3017      *  \param theCompound Compound, to find blocks in.
3018      *  \param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3019      *  \return List of GEOM_Object, containing the found blocks.
3020      */
3021     ListOfGO GetBlocksByParts (in GEOM_Object theCompound,
3022                                in ListOfGO    theParts);
3023
3024   // #  Operations on blocks with gluing of result
3025
3026     /*!
3027      *  \brief Multi-transformate block and glue the result.
3028      *
3029      *  Transformation is defined so, as to superpose theDirFace1 with theDirFace2.
3030      *  \param theBlock Hexahedral solid to be multi-transformed.
3031      *  \param theDirFace1 First direction face global index.
3032      *  \param theDirFace2 Second direction face global index.
3033      *  \param theNbTimes Quantity of transformations to be done.
3034      *    \note Global index of sub-shape can be obtained, using method
3035      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3036      *  \return New GEOM_Object, containing the result shape.
3037      */
3038     GEOM_Object MakeMultiTransformation1D (in GEOM_Object theBlock,
3039                                            in long        theDirFace1,
3040                                            in long        theDirFace2,
3041                                            in long        theNbTimes);
3042
3043     /*!
3044      *  \brief Multi-transformate block and glue the result.
3045      *  \param theBlock Hexahedral solid to be multi-transformed.
3046      *  \param theDirFace1U,theDirFace2U Direction faces for the first transformation.
3047      *  \param theDirFace1V,theDirFace2V Direction faces for the second transformation.
3048      *  \param theNbTimesU,theNbTimesV Quantity of transformations to be done.
3049      *  \return New GEOM_Object, containing the result shape.
3050      */
3051     GEOM_Object MakeMultiTransformation2D (in GEOM_Object theBlock,
3052                                            in long        theDirFace1U,
3053                                            in long        theDirFace2U,
3054                                            in long        theNbTimesU,
3055                                            in long        theDirFace1V,
3056                                            in long        theDirFace2V,
3057                                            in long        theNbTimesV);
3058
3059   // # Special operation - propagation
3060    
3061
3062     /*!
3063      *  \brief Build all possible propagation groups.
3064      *
3065      *  Propagation group is a set of all edges, opposite to one (main)
3066      *  edge of this group directly or through other opposite edges.
3067      *  Notion of Opposite Edge make sence only on quadrangle face.
3068      *  \param theShape Shape to build propagation groups on.
3069      *  \return List of GEOM_Object, each of them is a propagation group.
3070      */
3071     ListOfGO Propagate (in GEOM_Object theShape);
3072   };
3073
3074  // # GEOM_IBooleanOperations
3075   /*!
3076    *  \brief Interface for boolean operations (Cut, Fuse, Common)
3077    */
3078   interface GEOM_IBooleanOperations : GEOM_IOperations
3079   {
3080     /*!
3081      *  \brief Perform one of boolean operations on two given shapes.
3082      *  \param theShape1 First argument for boolean operation.
3083      *  \param theShape2 Second argument for boolean operation.
3084      *  \param theOperation Indicates the operation to be done:
3085      *                      1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
3086      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3087      *                         of arguments before an operation.
3088      *  \return New GEOM_Object, containing the result shape.
3089      */
3090     GEOM_Object MakeBoolean (in GEOM_Object theShape1,
3091                              in GEOM_Object theShape2,
3092                              in long        theOperation,
3093                              in boolean     IsCheckSelfInte);
3094     /*!
3095      *  \brief Perform fusion boolean operation on two given shapes.
3096      *  \param theShape1 First argument for fuse operation.
3097      *  \param theShape2 Second argument for fuse operation.
3098      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3099      *                         of arguments before an operation.
3100      *  \param IsRmExtraEdges If TRUE, perform removal of extra edges
3101      *                        during an operation.
3102      *  \return New GEOM_Object, containing the result shape.
3103      */
3104     GEOM_Object MakeFuse (in GEOM_Object theShape1,
3105                           in GEOM_Object theShape2,
3106                           in boolean     IsCheckSelfInte,
3107                           in boolean     IsRmExtraEdges);
3108
3109     /*!
3110      *  \brief Perform fusion boolean operation on list of objects.
3111      *  \param theShapes Shapes to be fused.
3112      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3113      *                         of arguments before an operation.
3114      *  \param IsRmExtraEdges If TRUE, perform removal of extra edges
3115      *                        during an operation.
3116      *  \return New GEOM_Object, containing the result shape.
3117      */
3118     GEOM_Object MakeFuseList (in ListOfGO theShapes,
3119                               in boolean  IsCheckSelfInte,
3120                               in boolean  IsRmExtraEdges);
3121
3122     /*!
3123      *  \brief Perform common boolean operation on list of objects.
3124      *  \param theShapes Shapes for common operation.
3125      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3126      *                         of arguments before an operation.
3127      *  \return New GEOM_Object, containing the result shape.
3128      */
3129     GEOM_Object MakeCommonList (in ListOfGO theShapes,
3130                                 in boolean  IsCheckSelfInte);
3131
3132     /*!
3133      *  \brief Perform cutting of list of objects from theMainShape.
3134      *  \param theMainShape the object for cut operation.
3135      *  \param theShapes Shapes to be cut from theMainShape (tools).
3136      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3137      *                         of arguments before an operation.
3138      *  \return New GEOM_Object, containing the result shape.
3139      */
3140     GEOM_Object MakeCutList (in GEOM_Object theMainShape,
3141                              in ListOfGO theShapes,
3142                              in boolean  IsCheckSelfInte);
3143
3144     /*!
3145      *  \brief Perform partition operation.
3146      *
3147      *  \param theShapes Shapes to be intersected.
3148      *  \param theTools Shapes to intersect theShapes.
3149      *  \note  Each compound from ListShapes and ListTools will be exploded in order
3150      *         to avoid possible intersection between shapes from this compound.
3151      *  \param theLimit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
3152      *  \param theKeepNonlimitShapes: if this parameter == 0, then only shapes of
3153      *                             target type (equal to Limit) are kept in the result,
3154      *                             else standalone shapes of lower dimension
3155      *                             are kept also (if they exist).
3156      *
3157      *  After implementation new version of PartitionAlgo (October 2006)
3158      *  other parameters are ignored by current functionality. They are kept
3159      *  in this function only for supporting old versions.
3160      *  Ignored parameters:
3161      *  \param theKeepInside Shapes, outside which the results will be deleted.
3162      *         Each shape from theKeepInside must belong to theShapes also.
3163      *  \param theRemoveInside Shapes, inside which the results will be deleted.
3164      *         Each shape from theRemoveInside must belong to theShapes also.
3165      *  \param theRemoveWebs If TRUE, perform Glue 3D algorithm.
3166      *  \param theMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
3167      *
3168      *  \return New GEOM_Object, containing the result shapes.
3169      */
3170     GEOM_Object MakePartition (in ListOfGO   theShapes,
3171                                in ListOfGO   theTools,
3172                                in ListOfGO   theKeepInside,
3173                                in ListOfGO   theRemoveInside,
3174                                in short      theLimit,
3175                                in boolean    theRemoveWebs,
3176                                in ListOfLong theMaterials,
3177                                in short      theKeepNonlimitShapes);
3178
3179     /*!
3180      *  \brief Perform partition operation.
3181      *
3182      *  This method may be usefull if it is needed to make a partition for
3183      *  a compound containing nonintersected shapes. Performance will be better
3184      *  since intersection between shapes from compound is not performed.
3185      *
3186      *  Description of all parameters as in previous method MakePartition().
3187      *  One additional parameter is provided:
3188      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3189      *                         of arguments before an operation.
3190      *
3191      *  \note Passed compounds (via ListShapes or via ListTools)
3192      *        have to consist of nonintersecting shapes.
3193      *
3194      *  \return New GEOM_Object, containing the result shapes.
3195      */
3196     GEOM_Object MakePartitionNonSelfIntersectedShape (in ListOfGO   theShapes,
3197                                                       in ListOfGO   theTools,
3198                                                       in ListOfGO   theKeepInside,
3199                                                       in ListOfGO   theRemoveInside,
3200                                                       in short      theLimit,
3201                                                       in boolean    theRemoveWebs,
3202                                                       in ListOfLong theMaterials,
3203                                                       in short      theKeepNonlimitShapes,
3204                                                       in boolean    IsCheckSelfInte);
3205
3206     /*!
3207      *  \brief Perform partition of the Shape with the Plane
3208      *  \param theShape Shape to be intersected.
3209      *  \param thePlane Tool shape, to intersect theShape.
3210      *  \return New GEOM_Object, containing the result shape.
3211      */
3212     GEOM_Object MakeHalfPartition (in GEOM_Object theShape,
3213                                    in GEOM_Object thePlane);
3214   };
3215
3216  // # GEOM_ICurvesOperations:
3217   /*!
3218    *  \brief Interface for curves creation.
3219    *
3220    *  Polyline, Circle, Spline (Bezier and Interpolation)
3221    */
3222   interface GEOM_ICurvesOperations : GEOM_IOperations
3223   {
3224     /*!
3225      *  \brief Create a circle with given center, normal vector and radius.
3226      *  \param thePnt Circle center.
3227      *  \param theVec Vector, normal to the plane of the circle.
3228      *  \param theR Circle radius.
3229      *  \return New GEOM_Object, containing the created circle.
3230      */
3231     GEOM_Object MakeCirclePntVecR (in GEOM_Object thePnt,
3232                                    in GEOM_Object theVec,
3233                                    in double theR);
3234     /*!
3235      *  \brief Create a circle, passing through three given points
3236      *  \param thePnt1,thePnt2,thePnt3 Points, defining the circle.
3237      *  \return New GEOM_Object, containing the created circle.
3238      */
3239     GEOM_Object MakeCircleThreePnt (in GEOM_Object thePnt1,
3240                                     in GEOM_Object thePnt2,
3241                                     in GEOM_Object thePnt3);
3242     /*!
3243      *  \brief Create a circle with given center, with a radius equals the distance from center to Point1
3244      *  and on a plane defined by all of three points.
3245      *  \param thePnt1,thePnt2,thePnt3 Points, defining the circle.
3246      *  \return New GEOM_Object, containing the created circle.
3247      */
3248     GEOM_Object MakeCircleCenter2Pnt (in GEOM_Object thePnt1,
3249                                       in GEOM_Object thePnt2,
3250                                       in GEOM_Object thePnt3);
3251     /*!
3252      *  \brief Create an ellipse with given center, normal vector and radiuses.
3253      *  \param thePnt Ellipse center.
3254      *  \param theVec Vector, normal to the plane of the ellipse.
3255      *  \param theRMajor Major ellipse radius.
3256      *  \param theRMinor Minor ellipse radius.
3257      *  \return New GEOM_Object, containing the created ellipse.
3258      */
3259     GEOM_Object MakeEllipse (in GEOM_Object thePnt,
3260                              in GEOM_Object theVec,
3261                              in double theRMajor,
3262                              in double theRMinor);
3263
3264     /*!
3265      *  \brief Create an ellipse with given center, normal vector, main axis vector and radiuses.
3266      *  \param thePnt Ellipse center.
3267      *  \param theVec Vector, normal to the plane of the ellipse.
3268      *  \param theRMajor Major ellipse radius.
3269      *  \param theRMinor Minor ellipse radius.
3270      *  \param theVecMaj Vector, direction of the ellipse's main axis.
3271      *  \return New GEOM_Object, containing the created ellipse.
3272      */
3273     GEOM_Object MakeEllipseVec (in GEOM_Object thePnt,
3274                                 in GEOM_Object theVec,
3275                                 in double theRMajor,
3276                                 in double theRMinor,
3277                                 in GEOM_Object theVecMaj);
3278
3279     /*!
3280      *  \brief Create an arc of circle, passing through three given points.
3281      *  \param thePnt1 Start point of the arc.
3282      *  \param thePnt2 Middle point of the arc.
3283      *  \param thePnt3 End point of the arc.
3284      *  \return New GEOM_Object, containing the created arc.
3285      */
3286     GEOM_Object MakeArc (in GEOM_Object thePnt1,
3287                          in GEOM_Object thePnt2,
3288                          in GEOM_Object thePnt3);
3289
3290     /*!
3291      *  \brief Create an arc of circle of center C from one point to another
3292      *  \param theCenter Center point of the arc.
3293      *  \param thePnt1 Start point of the arc.
3294      *  \param thePnt2 End point of the arc.
3295      *  \param theSense Orientation of the arc
3296      *  \return New GEOM_Object, containing the created arc.
3297      */
3298     GEOM_Object MakeArcCenter (in GEOM_Object theCenter,
3299                                in GEOM_Object thePnt1,
3300                                in GEOM_Object thePnt2,
3301                                in boolean theSense);
3302
3303     /*!
3304      *  \brief Create an arc of ellipse of center C and two points P1 P2.
3305      *  \param theCenter Center point of the arc.
3306      *  \param thePnt1 Major radius is distance from center to Pnt1.
3307      *  \param thePnt2 define a plane and Minor radius as a shortest
3308      *                 distance from Pnt2 to vector Center->Pnt1.
3309      *  \return New GEOM_Object, containing the created arc.
3310      */
3311     GEOM_Object MakeArcOfEllipse (in GEOM_Object theCenter,
3312                                   in GEOM_Object thePnt1,
3313                                   in GEOM_Object thePnt2);
3314
3315
3316     /*!
3317      *  \brief Create a polyline on the set of points.
3318      *  \param thePoints Sequence of points for the polyline.
3319      *  \param theIsClosed If TRUE, build a closed wire.
3320      *  \return New GEOM_Object, containing the created polyline.
3321      */
3322     GEOM_Object MakePolyline (in ListOfGO thePoints,
3323                               in boolean  theIsClosed);
3324
3325     /*!
3326      *  \brief Create bezier curve on the set of points.
3327      *  \param thePoints Sequence of points for the bezier curve.
3328      *  \param theIsClosed If TRUE, build a closed curve.
3329      *  \return New GEOM_Object, containing the created bezier curve.
3330      */
3331     GEOM_Object MakeSplineBezier (in ListOfGO thePoints,
3332                                   in boolean  theIsClosed);
3333
3334     /*!
3335      *  \brief Create B-Spline curve on the set of points.
3336      *  \param thePoints Sequence of points for the B-Spline curve.
3337      *  \param theIsClosed If TRUE, build a closed curve.
3338      *  \param theDoReordering If TRUE, the algo does not follow the order of
3339      *                         \a thePoints but searches for the closest vertex.
3340      *  \return New GEOM_Object, containing the created B-Spline curve.
3341      */
3342     GEOM_Object MakeSplineInterpolation (in ListOfGO thePoints,
3343                                          in boolean  theIsClosed,
3344                                          in boolean  theDoReordering);
3345
3346     /*!
3347      *  \brief Create B-Spline curve on the set of points.
3348      *  \param thePoints Sequence of points for the B-Spline curve.
3349      *  \param theFirstVec Vector object, defining the curve direction at its first point.
3350      *  \param theLastVec Vector object, defining the curve direction at its last point.
3351      *  \return New GEOM_Object, containing the created B-Spline curve.
3352      */
3353     GEOM_Object MakeSplineInterpolWithTangents (in ListOfGO    thePoints,
3354                                                 in GEOM_Object theFirstVec,
3355                                                 in GEOM_Object theLastVec);
3356
3357     /*!
3358      *  \brief Creates a curve using the parametric definition of the basic points.
3359      *  \param thexExpr parametric equation of the coordinates X.
3360      *  \param theyExpr parametric equation of the coordinates Y.
3361      *  \param thezExpr parametric equation of the coordinates Z.
3362      *  \param theParamMin the minimal value of the parameter.
3363      *  \param theParamMax the maximum value of the parameter.
3364      *  \param theParamStep the step of the parameter.
3365      *  \param theCurveType the type of the curve.
3366      *  \return New GEOM_Object, containing the created curve.
3367      */    
3368     GEOM_Object MakeCurveParametric(in string thexExpr,
3369                                     in string theyExpr,
3370                                     in string thezExpr,
3371                                     in double theParamMin,
3372                                     in double theParamMax,
3373                                     in double theParamStep,
3374                                     in curve_type theCurveType);
3375
3376      /*!
3377      *  \brief Creates a curve using the parametric definition of the basic points.
3378      *  \param thexExpr parametric equation of the coordinates X.
3379      *  \param theyExpr parametric equation of the coordinates Y.
3380      *  \param thezExpr parametric equation of the coordinates Z.
3381      *  \param theParamMin the minimal value of the parameter.
3382      *  \param theParamMax the maximum value of the parameter.
3383      *  \param theParamNbStep the number of steps of the parameter discretization.
3384      *  \param theCurveType the type of the curve.
3385      *  \return New GEOM_Object, containing the created curve.
3386      */    
3387     GEOM_Object MakeCurveParametricNew(in string thexExpr,
3388                     in string theyExpr,
3389                     in string thezExpr,
3390                     in double theParamMin,
3391                     in double theParamMax,
3392                     in long   theParamNbStep,
3393                     in curve_type theCurveType);
3394
3395      /*!
3396      *  \brief Creates an isoline curve on a face.
3397      *  \param theFace the face for which an isoline is created.
3398      *  \param IsUIsoline True for U-isoline creation; False for V-isoline
3399      *         creation.
3400      *  \param theParameter the U parameter for U-isoline or V parameter
3401      *         for V-isoline.
3402      *  \return New GEOM_Object, containing the created isoline edge or a
3403      *          compound of edges.
3404      */
3405     GEOM_Object MakeIsoline(in GEOM_Object theFace,
3406                             in boolean     IsUIsoline,
3407                             in double      theParameter);
3408
3409     /*!
3410      *  \brief Create a sketcher (wire or face), following the textual description,
3411      *         passed through \a theCommand argument.
3412      *
3413      *  Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
3414      *  Format of the description string has to be the following:
3415      *
3416      *  "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
3417      *
3418      *  Where:
3419      *  - x1, y1 are coordinates of the first sketcher point (zero by default),
3420      *  - CMD is one of
3421      *     - "R angle" : Set the direction by angle
3422      *     - "D dx dy" : Set the direction by DX & DY
3423      *     .
3424      *       \n
3425      *     - "TT x y" : Create segment by point at X & Y
3426      *     - "T dx dy" : Create segment by point with DX & DY
3427      *     - "L length" : Create segment by direction & Length
3428      *     - "IX x" : Create segment by direction & Intersect. X
3429      *     - "IY y" : Create segment by direction & Intersect. Y
3430      *     .
3431      *       \n
3432      *     - "C radius length" : Create arc by direction, radius and length(in degree)
3433      *     .
3434      *       \n
3435      *     - "WW" : Close Wire (to finish)
3436      *     - "WF" : Close Wire and build face (to finish)
3437      *
3438      *  \param theCommand String, defining the sketcher in local
3439      *                    coordinates of the working plane.
3440      *  \param theWorkingPlane Nine double values, defining origin,
3441      *                         OZ and OX directions of the working plane.
3442      *  \return New GEOM_Object, containing the created wire or face.
3443      */
3444     GEOM_Object MakeSketcher (in string theCommand, in ListOfDouble theWorkingPlane);
3445
3446     /*!
3447      *  \brief Create a sketcher (wire or face), following the textual description,
3448      *         passed through \a theCommand argument. 
3449      *
3450      *  For format of the description string see the previous method.\n
3451      *
3452      *  \param theCommand String, defining the sketcher in local
3453      *                    coordinates of the working plane.
3454      *  \param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
3455      *  \return New GEOM_Object, containing the created wire or face.
3456      */
3457     GEOM_Object MakeSketcherOnPlane (in string theCommand, in GEOM_Object theWorkingPlane);
3458
3459     /*!
3460      *  \brief Create a 3D sketcher, following the textual description,
3461      *         passed through \a theCommand argument. 
3462      *
3463      *  Format of the description string has to be the following:
3464      *
3465      *  "3DSketcher:CMD[:CMD[:CMD...]]"
3466      *
3467      *  Where CMD is one of
3468      *     - "TT x y z" : Create segment by point at X & Y or set the first point
3469      *     - "T dx dy dz" : Create segment by point with DX & DY
3470      *     .
3471      *       \n
3472      *     - "OXY angleX angle2 length" : Create segment by two angles and length
3473      *     - "OYZ angleY angle2 length" : Create segment by two angles and length
3474      *     - "OXZ angleX angle2 length" : Create segment by two angles and length
3475      *     .
3476      *       \n
3477      *     - "WW" : Close Wire (to finish)
3478      *
3479      *  \param theCommand String, defining the sketcher in local
3480      *                    coordinates of the working plane.
3481      *  \return New GEOM_Object, containing the created wire.
3482      */
3483     GEOM_Object Make3DSketcherCommand (in string theCommand);
3484
3485     /*!
3486      *  \brief Create a 3D sketcher, made of a straight segments, joining points
3487      *         with coordinates passed through \a theCoordinates argument. 
3488      *
3489      *  Order of coordinates has to be the following:
3490      *  x1, y1, z1, x2, y2, z2, ..., xN, yN, zN
3491      *
3492      *  \param theCoordinates List of double values.
3493      *  \return New GEOM_Object, containing the created wire.
3494      */
3495     GEOM_Object Make3DSketcher (in ListOfDouble theCoordinates);
3496
3497     /*!
3498      *  \brief Create a 2D polyline (wire or a compound of wires).
3499      *
3500      *  The polyline can have several sections. Each section represents a set
3501      *  of points in the form of list of coordinates of the following order:
3502      *  x1, y1, x2, y2, ..., xN, yN
3503      *  Each section has its own name, type of curve (can be either
3504      *  GEOM::Polyline or GEOM::Interpolation) and Closed flag.
3505      *  For each section a wire is created. It represents either a polyline or
3506      *  interpolation BSpline either closed or not depending on the Closed flag.
3507      *  The result represents a wire if there is only one section is defined.
3508      *  Otherwise a compound of wires is returned.
3509      *
3510      *  \param theCoordsList the list of coordinates list. theCoordsList[0]
3511      *         is the coordinates list of the first section. theCoordsList[1]
3512      *         is for the second section etc.
3513      *  \param theNamesList the list of names. The order corresponds to
3514      *         theCoordsList.
3515      *  \param theTypesList the list of curve types. The order corresponds to
3516      *         theCoordsList.
3517      *  \param theClosedList the list of Closed flags. The order corresponds to
3518      *         theCoordsList.
3519      *  \param theWorkingPlane 9 double values, defining origin,
3520      *         OZ and OX directions of the working plane.
3521      *  \return New GEOM_Object, containing the created wire or a compound
3522      *          of wires.
3523      */
3524     GEOM_Object MakePolyline2D (in ListOfListOfDouble theCoordsList,
3525                                 in string_array       theNamesList,
3526                                 in short_array        theTypesList,
3527                                 in ListOfBool         theClosedList,
3528                                 in ListOfDouble       theWorkingPlane);
3529
3530     /*!
3531      *  \brief Create a 2D polyline (wire or a compound of wires).
3532      *
3533      *  The polyline can have several sections. Each section represents a set
3534      *  of points in the form of list of coordinates of the following order:
3535      *  x1, y1, x2, y2, ..., xN, yN
3536      *  Each section has its own name, type of curve (can be either
3537      *  GEOM::Polyline or GEOM::Interpolation) and Closed flag.
3538      *  For each section a wire is created. It represents either a polyline or
3539      *  interpolation BSpline either closed or not depending on the Closed flag.
3540      *  The result represents a wire if there is only one section is defined.
3541      *  Otherwise a compound of wires is returned.
3542      *
3543      *  \param theCoordsList the list of coordinates list. theCoordsList[0]
3544      *         is the coordinates list of the first section. theCoordsList[1]
3545      *         is for the second section etc.
3546      *  \param theNamesList the list of names. The order corresponds to
3547      *         theCoordsList.
3548      *  \param theTypesList the list of curve types. The order corresponds to
3549      *         theCoordsList.
3550      *  \param theClosedList the list of Closed flags. The order corresponds to
3551      *         theCoordsList.
3552      *  \param theWorkingPlane planar Face or LCS(Marker) of the working plane.
3553      *  \return New GEOM_Object, containing the created wire or a compound
3554      *          of wires.
3555      */
3556     GEOM_Object MakePolyline2DOnPlane (in ListOfListOfDouble theCoordsList,
3557                                        in string_array       theNamesList,
3558                                        in short_array        theTypesList,
3559                                        in ListOfBool         theClosedList,
3560                                        in GEOM_Object        theWorkingPlane);
3561
3562   };
3563
3564  // # GEOM_ILocalOperations:
3565   /*!
3566    *  \brief Interface for fillet and chamfer creation.
3567    */
3568   interface GEOM_ILocalOperations : GEOM_IOperations
3569   {
3570     /*!
3571      *  \brief Perform a fillet on all edges of the given shape.
3572      *  \param theShape Shape, to perform fillet on.
3573      *  \param theR Fillet radius.
3574      *  \return New GEOM_Object, containing the result shape.
3575      */
3576     GEOM_Object MakeFilletAll (in GEOM_Object theShape,
3577                                in double      theR);
3578
3579     /*!
3580      *  \brief Perform a fillet on the specified edges of the given shape
3581      *  \param theShape Shape, to perform fillet on.
3582      *  \param theR Fillet radius.
3583      *  \param theEdges Global indices of edges to perform fillet on.
3584      *    \note Global index of sub-shape can be obtained, using method
3585      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3586      *  \return New GEOM_Object, containing the result shape.
3587      */
3588     GEOM_Object MakeFilletEdges (in GEOM_Object theShape,
3589                                  in double      theR,
3590                                  in ListOfLong  theEdges);
3591     GEOM_Object MakeFilletEdgesR1R2 (in GEOM_Object theShape,
3592                                      in double      theR1,
3593                                      in double      theR2,
3594                                      in ListOfLong  theEdges);
3595
3596     /*!
3597      *  \brief Perform a fillet on all edges of the specified faces of the given shape.
3598      *  \param theShape Shape, to perform fillet on.
3599      *  \param theR Fillet radius.
3600      *  \param theFaces Global indices of faces to perform fillet on.
3601      *    \note Global index of sub-shape can be obtained, using method
3602      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3603      *  \return New GEOM_Object, containing the result shape.
3604      */
3605     GEOM_Object MakeFilletFaces (in GEOM_Object theShape,
3606                                  in double      theR,
3607                                  in ListOfLong  theFaces);
3608
3609     GEOM_Object MakeFilletFacesR1R2 (in GEOM_Object theShape,
3610                                      in double      theR1,
3611                                      in double      theR2,
3612                                      in ListOfLong  theFaces);
3613
3614     /*!
3615      *  \brief Perform a fillet on a face or a shell at the specified vertexes.
3616      *  \param theShape Shape, to perform fillet on.
3617      *  \param theR Fillet radius.
3618      *  \param theVertexes Global indices of vertexes to perform fillet on.
3619      *    \note Global index of sub-shape can be obtained, using method
3620      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3621      *  \return New GEOM_Object, containing the result shape.
3622      */
3623     GEOM_Object MakeFillet2D (in GEOM_Object theShape,
3624                               in double      theR,
3625                               in ListOfLong  theVertexes);
3626
3627     /*!
3628      *  \brief Perform a fillet on edges of the specified vertexes of the given wire.
3629      *  \param theShape Shape, to perform fillet on.
3630      *  \param theR Fillet radius.
3631      *  \param theVertexes Global indices of vertexes to perform fillet on.
3632      *    \note Global index of sub-shape can be obtained, using method
3633      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3634      *    \note The list of vertices coudl be empty, in this case fillet fill be done
3635      *          at all vertices in given wire
3636      *  \param doIgnoreSecantVertices If FALSE, fillet radius is always limited
3637      *         by the length of the edges, nearest to the fillet vertex.
3638      *         But sometimes the next edge is C1 continuous with the one, nearest to
3639      *         the fillet point, and such two (or more) edges can be united to allow
3640      *         bigger radius. Set this flag to TRUE to allow collinear edges union,
3641      *         thus ignoring the secant vertex (vertices).
3642      *  \return New GEOM_Object, containing the result shape.
3643      */
3644     GEOM_Object MakeFillet1D (in GEOM_Object theShape,
3645                               in double      theR,
3646                               in ListOfLong  theVertexes,
3647                               in boolean     doIgnoreSecantVertices);
3648
3649     /*!
3650      *  \brief Perform a symmetric chamfer on all edges of the given shape.
3651      *  \param theShape Shape, to perform chamfer on.
3652      *  \param theD Chamfer size along each face.
3653      *  \return New GEOM_Object, containing the result shape.
3654      */
3655     GEOM_Object MakeChamferAll (in GEOM_Object theShape,
3656                                 in double      theD);
3657
3658     /*!
3659      *  \brief Perform a chamfer on edges, common to the specified faces.
3660      *  with distance D1 on the Face1
3661      *  \param theShape Shape, to perform chamfer on.
3662      *  \param theD1 Chamfer size along \a theFace1.
3663      *  \param theD2 Chamfer size along \a theFace2.
3664      *  \param theFace1,theFace2 Global indices of two faces of \a theShape.
3665      *    \note Global index of sub-shape can be obtained, using method
3666      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3667      *  \return New GEOM_Object, containing the result shape.
3668      */
3669     GEOM_Object MakeChamferEdge (in GEOM_Object theShape,
3670                                  in double theD1, in double theD2,
3671                                  in long theFace1, in long theFace2);
3672     /*!
3673      *  \brief The Same but with params theD = Chamfer Lenght
3674      *  and theAngle = Chamfer Angle (Angle in radians)
3675      */
3676     GEOM_Object MakeChamferEdgeAD (in GEOM_Object theShape,
3677                                    in double theD, in double theAngle,
3678                                    in long theFace1, in long theFace2);
3679
3680     /*!
3681      *  \brief Perform a chamfer on all edges of the specified faces.
3682      *  with distance D1 on the first specified face (if several for one edge)
3683      *  \param theShape Shape, to perform chamfer on.
3684      *  \param theD1 Chamfer size along face from \a theFaces. If both faces,
3685      *               connected to the edge, are in \a theFaces, \a theD1
3686      *               will be get along face, which is nearer to \a theFaces beginning.
3687      *  \param theD2 Chamfer size along another of two faces, connected to the edge.
3688      *  \param theFaces Sequence of global indices of faces of \a theShape.
3689      *    \note Global index of sub-shape can be obtained, using method
3690      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3691      *  \return New GEOM_Object, containing the result shape.
3692      */
3693     GEOM_Object MakeChamferFaces (in GEOM_Object theShape,
3694                                   in double theD1, in double theD2,
3695                                   in ListOfLong theFaces);
3696     /*!
3697      *  The Same but with params theD = Chamfer Lenght
3698      *  and theAngle = Chamfer Angle (Angle in radians)
3699      */
3700     GEOM_Object MakeChamferFacesAD (in GEOM_Object theShape,
3701                                     in double theD, in double theAngle,
3702                                     in ListOfLong theFaces);
3703
3704    /*!
3705     *  \brief Perform a chamfer on edges,
3706     *  with distance D1 on the first specified face (if several for one edge)
3707     *  \param theShape Shape, to perform chamfer on.
3708     *  \param theD1,theD2 Chamfer size
3709     *  \param theEdges Sequence of edges of \a theShape.
3710     *  \return New GEOM_Object, containing the result shape.
3711     */
3712     GEOM_Object MakeChamferEdges (in GEOM_Object theShape,
3713                                   in double theD1, in double theD2,
3714                                   in ListOfLong theEdges);
3715     /*!
3716      *  The Same but with params theD = Chamfer Lenght
3717      *  and theAngle = Chamfer Angle (Angle in radians)
3718      */
3719     GEOM_Object MakeChamferEdgesAD (in GEOM_Object theShape,
3720                                     in double theD, in double theAngle,
3721                                     in ListOfLong theEdges);
3722
3723     /*!
3724      *  \brief Perform an Archimde operation on the given shape with given parameters.
3725      *                    The object presenting the resulting face is returned
3726      *  \param theShape Shape to be put in water.
3727      *  \param theWeight Weight og the shape.
3728      *  \param theWaterDensity Density of the water.
3729      *  \param theMeshDeflection Deflection od the mesh, using to compute the section.
3730      *  \return New GEOM_Object, containing a section of \a theShape
3731      *          by a plane, corresponding to water level.
3732      */
3733     GEOM_Object MakeArchimede (in GEOM_Object theShape,
3734                                in double theWeight,
3735                                in double theWaterDensity,
3736                                in double theMeshDeflection);
3737
3738     /*!
3739      *  \brief Duplicates <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3740      *
3741      *  Present here only for compatibility.
3742      */
3743     long GetSubShapeIndex (in GEOM_Object theShape, in GEOM_Object theSubShape);
3744   };
3745
3746  // #  GEOM_IHealingOperations: 
3747   /*!
3748    *  \brief Interface for shape healing operations
3749    *
3750    *  Shape Processing, SuppressFaces, etc.
3751    */
3752   interface GEOM_IHealingOperations : GEOM_IOperations
3753   {
3754     /*!
3755      *  \brief Apply a sequence of Shape Healing operators to the given object.
3756      *  \param theShapes Shape to be processed.
3757      *  \param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
3758      *  \param theParameters List of names of parameters
3759      *                    ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
3760      *  \param theValues List of values of parameters, in the same order
3761      *                    as parameters are listed in \a theParameters list.
3762      *  \return New GEOM_Object, containing processed shape.
3763      */
3764     GEOM_Object ProcessShape (in GEOM_Object theShapes,
3765                               in string_array theOperators,
3766                               in string_array theParameters,
3767                               in string_array theValues);
3768
3769     /*!
3770      *  \brief Get default sequence of operators, their parameters and parameters' values
3771      *  of Shape Process operation. 
3772      *
3773      *  In the current implementation the defaults are
3774      *  read from the file pointed by CSF_ShHealingDefaults environmental variable.
3775      *  \param theOperators Output. Default list of names of operators.
3776      *  \param theParameters Output. Default list of names of parameters.
3777      *  \param theValues Output. List of default values of parameters, in the same order
3778      *                           as parameters are listed in \a theParameters list.
3779      */
3780     void GetShapeProcessParameters (out string_array theOperators,
3781                                     out string_array theParameters,
3782                                     out string_array theValues);
3783     /*!
3784      *  \brief Get parameters and parameters' values for the given Shape Process operation.
3785      *
3786      *  In the current implementation the defaults are
3787      *  read from the file pointed by CSF_ShHealingDefaults environmental variable.
3788      *  \param theOperator Input. The operator's name.
3789      *  \param theParameters Output. Default list of names of parameters.
3790      *  \param theValues Output. List of default values of parameters, in the same order
3791      *                           as parameters are listed in \a theParameters list.
3792      */
3793     void GetOperatorParameters (in string theOperator,
3794                                 out string_array theParameters,
3795                                 out string_array theValues);
3796
3797     /*!
3798      *  \brief Remove faces from the given object (shape).
3799      *  \param theObject Shape to be processed.
3800      *  \param theFaces Indices of faces to be removed, if EMPTY then the method
3801      *                  removes ALL faces of the given object.
3802      *  \return New GEOM_Object, containing processed shape.
3803      */
3804     GEOM_Object SuppressFaces (in GEOM_Object theObject, in short_array theFaces);
3805
3806     /*!
3807      *  \brief Close an open wire.
3808      *  \param theObject Shape to be processed.
3809      *  \param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
3810      *                  if -1, then theObject itself is a wire.
3811      *  \param isCommonVertex If TRUE : closure by creation of a common vertex,
3812      *                        If FALS : closure by creation of an edge between ends.
3813      *  \return New GEOM_Object, containing processed shape.
3814      */
3815     GEOM_Object CloseContour (in GEOM_Object theObject, in short_array theWires,
3816                               in boolean isCommonVertex);
3817
3818     /*!
3819      *  \brief Remove internal wires and edges from the given object (face).
3820      *  \param theObject Shape to be processed.
3821      *  \param theWires Indices of wires to be removed, if EMPTY then the method
3822      *                  removes ALL internal wires of the given object.
3823      *  \return New GEOM_Object, containing processed shape.
3824      */
3825     GEOM_Object RemoveIntWires (in GEOM_Object theObject, in short_array theWires);
3826
3827     /*!
3828      *  \brief Remove internal closed contours (holes) from the given object.
3829      *  \param theObject Shape to be processed.
3830      *  \param theWires Indices of wires to be removed, if EMPTY then the method
3831      *                  removes ALL internal holes of the given object
3832      *  \return New GEOM_Object, containing processed shape.
3833      */
3834     GEOM_Object FillHoles (in GEOM_Object theObject, in short_array theWires);
3835
3836     /*!
3837      *  Sewing of the given object.
3838      *  \param theObjects Shapes to be processed.
3839      *  \param theTolerance Required tolerance value.
3840      *  \return New GEOM_Object, containing processed shape.
3841      */
3842     GEOM_Object Sew (in ListOfGO theObjects, in double theTolerance);
3843
3844     /*!
3845      *  Sewing of the given object. Allows non-manifold sewing.
3846      *  \param theObjects Shapes to be processed.
3847      *  \param theTolerance Required tolerance value.
3848      *  \return New GEOM_Object, containing processed shape.
3849      */
3850     GEOM_Object SewAllowNonManifold(in ListOfGO theObjects, in double theTolerance);
3851
3852     /*!
3853      *  Rebuild the topology of theSolids by removing
3854      *  the faces that are shared by several solids.
3855      *  \param theSolids A list of shapes containing solids to be processed.
3856      *  \return New GEOM_Object, containing processed shape.
3857      */
3858     GEOM_Object RemoveInternalFaces (in ListOfGO theSolids);
3859
3860     /*!
3861      *  \brief Addition of a point to a given edge of \a theObject.
3862      *  \param theObject Shape to be processed.
3863      *  \param theEdgeIndex Index of edge to be divided within theObject's shape,
3864      *                      if -1, then theObject itself is the edge.
3865      *  \param theValue Value of parameter on edge or length parameter,
3866      *                  depending on \a isByParameter.
3867      *  \param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
3868      *                       if FALSE : \a theValue is treated as a length parameter [0..1]
3869      *  \return New GEOM_Object, containing the processed shape.
3870      */
3871     GEOM_Object DivideEdge (in GEOM_Object theObject, in short theEdgeIndex,
3872                             in double theValue, in boolean isByParameter);
3873
3874     /*!
3875      *  \brief Addition of points to a given edge of \a theObject by projecting
3876      *         other points to the given edge.
3877      *  \param theObject Shape to be processed.
3878      *  \param theEdgeIndex Index of edge to be divided within theObject's shape,
3879      *                      if -1, then theObject itself is the edge.
3880      *  \param thePoints Points to project to theEdgeIndex-th edge.
3881      *  \return New GEOM_Object, containing the processed shape.
3882      */
3883     GEOM_Object DivideEdgeByPoint (in GEOM_Object theObject,
3884                                    in short       theEdgeIndex,
3885                                    in ListOfGO    thePoints);
3886
3887     /*!
3888      *  \brief Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
3889      *  \param theWire Wire to minimize the number of C1 continuous edges in.
3890      *  \param theVertices A list of vertices to suppress. If the list
3891      *                     is empty, all vertices in a wire will be assumed.
3892      *  \return New GEOM_Object with modified wire.
3893      */
3894     GEOM_Object FuseCollinearEdgesWithinWire (in GEOM_Object theWire,
3895                                               in ListOfGO theVertices);
3896
3897     /*!
3898      *  \brief Get a list of wires (wrapped in GEOM_Object-s),
3899      *  that constitute a free boundary of the given shapes.
3900      *  \param theObjects Shapes to get free boundary of.
3901      *  \param theClosedWires Output. Closed wires on the free boundary of the given shape.
3902      *  \param theOpenWires Output. Open wires on the free boundary of the given shape.
3903      *  \return FALSE, if an error(s) occured during the method execution.
3904      */
3905     boolean GetFreeBoundary (in  ListOfGO theObjects,
3906                              out ListOfGO theClosedWires,
3907                              out ListOfGO theOpenWires);
3908
3909     /*!
3910      *  \brief Change orientation of the given object.
3911      *  \param theObject Shape to be processed.
3912      *  \return New GEOM_Object, containing processed shape.
3913      */
3914     GEOM_Object ChangeOrientation (in GEOM_Object theObject);
3915     GEOM_Object ChangeOrientationCopy (in GEOM_Object theObject);
3916
3917     /*!
3918      *  \brief Try to limit tolerance of the given object by value \a theTolerance.
3919      *  \param theObject Shape to be processed.
3920      *  \param theTolerance Required tolerance value.
3921      *  \return New GEOM_Object, containing processed shape.
3922      */
3923     GEOM_Object LimitTolerance (in GEOM_Object theObject, in double theTolerance);
3924
3925
3926     /*!
3927      *  \brief Return information on what has been done by the last called healing method.
3928      *  \return ModifStatistics, information container.
3929      */
3930     ModifStatistics GetStatistics();
3931   };
3932
3933  // # GEOM_IInsertOperations:
3934   /*!
3935    *  \brief Interface for shape insert operations (like copy, import).
3936    *
3937    */
3938   interface GEOM_IInsertOperations : GEOM_IOperations
3939   {
3940     /*!
3941      *  \brief Create a copy of the given object
3942      */
3943     GEOM_Object MakeCopy (in GEOM_Object theOriginal);
3944
3945     /*!
3946      *  \brief Deprecated method. Use Export\<FormatName\> (from the
3947      *  corresponding plugin) instead; here \<FormatName\> is a name of format.
3948      *
3949      *  \brief Export the given shape into a file with given name.
3950      *  \param theObject Shape to be stored in the file.
3951      *  \param theFileName Name of the file to store the given shape in.
3952      *  \param theFormatName Specify format for the shape storage.
3953      */
3954     void Export (in GEOM_Object theObject, in string theFileName, in string theFormatName);
3955
3956     /*!
3957      *  \brief Deprecated method. Use Import\<FormatName\> (from the
3958      *  corresponding plugin) instead; here \<FormatName\> is a name of format.
3959      *
3960      *  \brief Import a shape from the STL, BREP, IGES or STEP file
3961      *  (depends on given format) with given name.
3962      *  \param theFileName The file, containing the shape.
3963      *  \param theFormatName Specify format for the file reading.
3964      *         If format 'IGES_SCALE' is used instead of 'IGES' or
3965      *            format 'STEP_SCALE' is used instead of 'STEP',
3966      *            file length unit will be ignored (set to 'meter') and result model will be scaled.
3967      *  \return List of GEOM_Object, containing the created shape and groups of materials.
3968      */
3969     ListOfGBO ImportFile (in string theFileName, in string theFormatName);
3970
3971     /*!
3972      *  \brief Deprecated method. Use ReadValue (from the corresponding plugin) instead.
3973      *
3974      *  \brief Read a value of parameter from a file, containing a shape.
3975      *  \param theFileName The file, containing the shape.
3976      *  \param theFormatName Specify format for the file reading.
3977      *  \param theParameterName Specify the parameter. For example, pass "LEN_UNITS"
3978      *                          to obtain length units, in which the file is written.
3979      *  \return Value of requested parameter in form of text string.
3980      */
3981     string ReadValue (in string theFileName, in string theFormatName, in string theParameterName);
3982
3983     /*!
3984      *  \brief Read a shape from the binary stream, containing its bounding representation (BRep).
3985      *  \note GEOM_Object::GetShapeStream() method can be used to obtain the shape's BRep stream.
3986      *  \param theStream The BRep binary stream.
3987      *  \return New GEOM_Object, containing the shape, read from theStream.
3988      */
3989     GEOM_Object RestoreShape (in SALOMEDS::TMPFile theStream);
3990
3991     /*!
3992      * \brief Load texture from file
3993      * \param theTextureFile texture file name
3994      * \return unique texture identifier
3995      */
3996     long LoadTexture(in string theTextureFile);
3997
3998     /*!
3999      * \brief Add texture to the study
4000      * \param theWidth texture width in pixels
4001      * \param theHeight texture height in pixels
4002      * \param theTexture texture byte array
4003      * \return unique texture identifier
4004      */
4005     long AddTexture(in long theWidth, in long theHeight, in SALOMEDS::TMPFile theTexture);
4006
4007     /*!
4008      * \brief Get previously loaded texture data
4009      * \param theID texture identifier
4010      * \param theWidth texture width in pixels
4011      * \param theHeight texture height in pixels
4012      * \return texture byte array
4013      */
4014     SALOMEDS::TMPFile GetTexture(in long theID, out long theWidth, out long theHeight);
4015
4016     /*!
4017      * \brief Get list of all avaiable texture IDs
4018      * \return list of all texture IDs avaiable for the current study
4019      */
4020     ListOfLong GetAllTextures();
4021
4022     /*!
4023      *  \brief Non-topological information transfer datum.
4024      */
4025     struct TransferDatum
4026     {
4027       string myName;
4028       long   myNumber;
4029       long   myMaxNumber;
4030     };
4031
4032     /*!
4033      *  \brief Sequence of non-topological information tranfer data.
4034      */
4035     typedef sequence<TransferDatum> ListOfTransferDatum;
4036
4037     /*!
4038      *  \brief Transfer non-topological data from one object to another
4039      *  \param theObjectFrom the source object of non-topological data
4040      *  \param theObjectTo the destination object of non-topological data
4041      *  \param theFindMethod method to search sub-shapes of theObjectFrom
4042      *         in shape theObjectTo. Possible values are: GEOM::FSM_GetInPlace,
4043      *         GEOM::FSM_GetInPlaceByHistory and GEOM::FSM_GetInPlace_Old.
4044      *         Other values of GEOM::find_shape_method are not supported.
4045      *  \param theResult statistics of the operation. Output parameter. It
4046      *         represents a sequence of Transfer Datum. A datum has the type
4047      *         (string code), the total number of items of this type and
4048      *         the number of transfered items.
4049      *  \return true in case of success; otherwise false.
4050      */
4051     boolean TransferData(in  GEOM_Object         theObjectFrom,
4052                          in  GEOM_Object         theObjectTo,
4053                          in  find_shape_method   theFindMethod,
4054                          out ListOfTransferDatum theResult);
4055
4056   };
4057
4058  // # GEOM_IKindOfShape:
4059   /*!
4060    *  \brief Interface for shape_kind enumeration.
4061    */
4062   interface GEOM_IKindOfShape
4063   {
4064     enum shape_kind {
4065       NO_SHAPE,
4066       //COMPOSITEs
4067       COMPOUND,
4068       COMPSOLID,
4069       SHELL,
4070       WIRE,
4071       // SOLIDs
4072       /*! full sphere */
4073       SPHERE,
4074       /*! cylinder */
4075       CYLINDER,
4076       /*! box with faces, parallel to global coordinate planes */
4077       BOX,
4078       /*! other box */
4079       ROTATED_BOX, 
4080       /*! full torus */
4081       TORUS,   
4082       /*! cone */  
4083       CONE,   
4084       /*! solid, bounded by polygons */
4085       POLYHEDRON,  
4086       /*! other solid */
4087       SOLID,       
4088       // FACEs
4089       /*! spherical face (closed) */
4090       SPHERE2D,    
4091       /*! cylindrical face with defined height */
4092       CYLINDER2D,
4093       /*! toroidal face (closed) */
4094       TORUS2D,     
4095       /*! conical face with defined height */
4096       CONE2D,
4097       /*! planar, bounded by circle */
4098       DISK_CIRCLE,
4099       /*! planar, bounded by ellipse */
4100       DISK_ELLIPSE,
4101       /*! planar, bounded by segments */
4102       POLYGON,     
4103       /*! infinite planar */
4104       PLANE,        
4105        /*! other planar */
4106       PLANAR,      
4107       /*! other face */
4108       FACE,      
4109       // EDGEs
4110       /*! full circle */
4111       CIRCLE,      
4112       /*! arc of circle */
4113       ARC_CIRCLE, 
4114       /*! full ellipse */
4115       ELLIPSE,    
4116       /*! arc of ellipse */
4117       ARC_ELLIPSE,  
4118       /*! infinite segment */
4119       LINE,         
4120       /*! segment */
4121       SEGMENT,      
4122       /*! other edge */
4123       EDGE,       
4124       // VERTEX
4125       VERTEX,
4126       // ADVANCED shapes
4127       /*! all advanced shapes (temporary implementation) */
4128       ADVANCED    
4129     };
4130   };
4131
4132  // # GEOM_IMeasureOperations:
4133   /*!
4134    *  \brief Interface for measurement (distance, whatis) and
4135    *  properties calculation (like Centre of Mass, Inertia, etc.).
4136    *
4137    */
4138   interface GEOM_IMeasureOperations : GEOM_IOperations
4139   {
4140     /*!
4141      *  \brief Get kind of theShape.
4142      *  \param theShape Shape to get a kind of.
4143      *  \param theIntegers Output. Integer and enumerated shape's parameters
4144      *                     (kind of surface, closed/unclosed, number of edges, etc.)
4145      *  \param theDoubles  Output. Double shape's parameters (coordinates, dimensions, etc.)
4146      *  \note  Concrete meaning of each value, returned via \a theIntegers
4147      *         or \a theDoubles list depends on the kind of the shape.
4148      *  \return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration.
4149      */
4150     //short KindOfShape (in GEOM_Object   theShape,
4151     GEOM_IKindOfShape::shape_kind KindOfShape (in  GEOM_Object  theShape,
4152                                                out ListOfLong   theIntegers,
4153                                                out ListOfDouble theDoubles);
4154
4155     /*!
4156      *  \brief Get position (LCS) of theShape.
4157      *  \param theShape Shape to calculate position of.
4158      *  \param Ox,Oy,Oz Output. Coordinates of shape's location origin.
4159      *                  Origin of the LCS is situated at the shape's center of mass.
4160      *  \param Zx,Zy,Zz Output. Coordinates of shape's location normal(main) direction.
4161      *  \param Xx,Xy,Xz Output. Coordinates of shape's location X direction.
4162      *                  Axes of the LCS are obtained from shape's location or,
4163      *                  if the shape is a planar face, from position of its plane.
4164      *  \return Returns position of the shape through the last nine arguments.
4165      */
4166     void GetPosition (in GEOM_Object theShape,
4167                       out double Ox, out double Oy, out double Oz,
4168                       out double Zx, out double Zy, out double Zz,
4169                       out double Xx, out double Xy, out double Xz);
4170
4171     /*!
4172      *  \brief Get summarized length of all wires,
4173      *  area of surface and volume of the given shape.
4174      *  \param theShape Shape to define properties of.
4175      *  \param theLength Output. Summarized length of all wires of the given shape.
4176      *  \param theSurfArea Output. Area of surface of the given shape.
4177      *  \param theVolume Output. Volume of the given shape.
4178      *  \return Returns shape properties through the last three arguments.
4179      */
4180     void GetBasicProperties (in GEOM_Object theShape,
4181                              out double theLength,
4182                              out double theSurfArea,
4183                              out double theVolume);
4184
4185     /*!
4186      *  \brief Get a point, situated at the centre of mass of theShape.
4187      *  \param theShape Shape to define centre of mass of.
4188      *  \return New GEOM_Object, containing the created point.
4189      */
4190     GEOM_Object GetCentreOfMass (in GEOM_Object theShape);
4191
4192     /*
4193      *  Get the vertex by index for 1D objects depends the edge/wire orientation
4194      *  \param theShape Shape (wire or edge) to find the vertex on it
4195      *  \param theIndex Index of vertex sub-shape
4196      *  \return New GEOM_Object, vertex.
4197      */
4198     GEOM_Object GetVertexByIndex( in GEOM_Object theShape, in long index );
4199
4200     /*!
4201      *  \brief Get a vector, representing the normal of theFace.
4202      *  If the face is not planar, theOptionalPoint is obligatory.
4203      *  \param theFace Shape (face) to define the normal of.
4204      *  \param theOptionalPoint Shape (point) to define the normal at.
4205      *                          Can be NULL in case of planar face.
4206      *  \return New GEOM_Object, containing the created normal vector.
4207      */
4208     GEOM_Object GetNormal (in GEOM_Object theFace,
4209                            in GEOM_Object theOptionalPoint);
4210
4211     /*!
4212      *  \brief Get inertia matrix and moments of inertia of theShape.
4213      *  \param theShape Shape to calculate inertia of.
4214      *  \param I11,I12,I13,I21,I22,I23,I31,I32,I33 Output. Components of the inertia matrix of the given shape.
4215      *  \param Ix,Iy,Iz Output. Moments of inertia of the given shape.
4216      *  \return Returns inertia through the last twelve arguments.
4217      */
4218     void GetInertia (in GEOM_Object theShape,
4219                      out double I11, out double I12, out double I13,
4220                      out double I21, out double I22, out double I23,
4221                      out double I31, out double I32, out double I33,
4222                      out double Ix , out double Iy , out double Iz);
4223
4224     /*!
4225      *  \brief Get parameters of bounding box of the given shape
4226      *  \param theShape Shape to obtain bounding box of.
4227      *  \param precise TRUE for precise computation; FALSE for fast one.
4228      *  \param Xmin,Xmax Output. Limits of shape along OX axis.
4229      *  \param Ymin,Ymax Output. Limits of shape along OY axis.
4230      *  \param Zmin,Zmax Output. Limits of shape along OZ axis.
4231      *  \return Returns parameters of bounding box through the last six arguments.
4232      */
4233     void GetBoundingBox (in GEOM_Object theShape,
4234                          in boolean precise,
4235                          out double Xmin, out double Xmax,
4236                          out double Ymin, out double Ymax,
4237                          out double Zmin, out double Zmax);
4238
4239     /*!
4240      *  \brief Get bounding box of the given shape
4241      *  \param theShape Shape to obtain bounding box of.
4242      *  \param precise TRUE for precise computation; FALSE for fast one.
4243      *  \return New GEOM_Object, containing the created bounding box.
4244      */
4245     GEOM_Object MakeBoundingBox (in GEOM_Object theShape,
4246                                  in boolean precise);
4247
4248     /*!
4249      *  \brief Get min and max tolerances of sub-shapes of theShape
4250      *  \param theShape Shape, to get tolerances of.
4251      *  \param FaceMin,FaceMax Output. Min and max tolerances of the faces.
4252      *  \param EdgeMin,EdgeMax Output. Min and max tolerances of the edges.
4253      *  \param VertMin,VertMax Output. Min and max tolerances of the vertices.
4254      *  \return Returns shape tolerances through the last six arguments.
4255      */
4256     void GetTolerance (in GEOM_Object theShape,
4257                        out double FaceMin, out double FaceMax,
4258                        out double EdgeMin, out double EdgeMax,
4259                        out double VertMin, out double VertMax);
4260
4261     /*!
4262      *  \brief Enumeration of Shape defects coming from CheckShape algorithms.
4263      */
4264     enum ShapeErrorType
4265     {
4266       /* for vertices */
4267       InvalidPointOnCurve,
4268       InvalidPointOnCurveOnSurface,
4269       InvalidPointOnSurface,
4270
4271       /* for edges */
4272       No3DCurve,
4273       Multiple3DCurve,
4274       Invalid3DCurve,
4275       NoCurveOnSurface,
4276       InvalidCurveOnSurface,
4277       InvalidCurveOnClosedSurface,
4278       InvalidSameRangeFlag,
4279       InvalidSameParameterFlag,
4280       InvalidDegeneratedFlag,
4281
4282       FreeEdge,
4283       InvalidMultiConnexity,
4284       InvalidRange,
4285
4286       /* for wires */
4287       EmptyWire,
4288       RedundantEdge,
4289       SelfIntersectingWire, /* on a face */
4290
4291       /* for faces */
4292       NoSurface,
4293       InvalidWire,
4294       RedundantWire,
4295       IntersectingWires,
4296       InvalidImbricationOfWires,
4297
4298       /* for shells */
4299       EmptyShell,
4300       RedundantFace,
4301
4302       /* for shapes */
4303       UnorientableShape,
4304       NotClosed,
4305       NotConnected,
4306
4307       SubshapeNotInShape,
4308
4309       BadOrientation,
4310       BadOrientationOfSubshape,
4311
4312       InvalidToleranceValue,
4313
4314       /* for exception */
4315       CheckFail
4316     };
4317
4318     /*!
4319      *  \brief Description of a shape defect: type and incriminated sub-shapes.
4320      */
4321     struct ShapeError
4322     {
4323       ShapeErrorType error;
4324       ListOfLong     incriminated;
4325     };
4326
4327     /*!
4328      *  \brief Sequence of all shape defects.
4329      */
4330     typedef sequence<ShapeError> ShapeErrors;
4331
4332     /*!
4333      *  \brief Check a topology of the given shape.
4334      *  \param theShape Shape to check validity of.
4335      *  \param theErrors Structure, containing discovered errors and incriminated sub-shapes.
4336      *  \return TRUE, if the shape "seems to be valid" from the topological point of view.
4337      */
4338     boolean CheckShape (in GEOM_Object  theShape,
4339                         out ShapeErrors theErrors);
4340
4341     /*!
4342      *  \brief Check a topology and a geometry of the given shape.
4343      *  \param theShape Shape to check validity of.
4344      *  \param theErrors Structure, containing discovered errors and incriminated sub-shapes.
4345      *  \return TRUE, if the shape "seems to be valid".
4346      */
4347     boolean CheckShapeWithGeometry (in GEOM_Object  theShape,
4348                                     out ShapeErrors theErrors);
4349
4350     /*!
4351      *  \brief Convert sequence of shape errors, returned by
4352      *  <VAR>CheckShape()</VAR> or <VAR>CheckShapeWithGeometry()</VAR>, into string.
4353      *  \param theShape the invalid shape.
4354      *  \param theErrors The sequence of \a theShape errors.
4355      *  \return String, describing all the errors in form, suitable for printing.
4356      */
4357     string PrintShapeErrors (in GEOM_Object theShape,
4358                              in ShapeErrors theErrors);
4359
4360     /*!
4361      *  \brief Check a topology of the given shape on self-intersections presence.
4362      *  \param theShape Shape to check validity of.
4363      *  \param theCheckLevel the level of self-interference check.
4364      *  \param theIntersections Output. List of intersected sub-shapes IDs, it contains pairs of IDs.
4365      *  \return TRUE, if the shape does not have any self-intersections.
4366      */
4367     boolean CheckSelfIntersections (in GEOM_Object theShape,
4368                                     in long        theCheckLevel,
4369                                     out ListOfLong theIntersections);
4370
4371     /*!
4372      *  \brief Detect intersections of the given shapes with algorithm based on mesh intersections.
4373      *  \param theShape1 First source object
4374      *  \param theShape2 Second source object
4375      *  \param theTolerance Specifies a distance between shapes used for detecting gaps:
4376      *                       - if \a theTolerance <= 0, algorithm detects intersections
4377      *                       - if \a theTolerance > 0, algorithm detects gaps
4378      *  \param theDeflection Linear deflection coefficient that specifies quality of tesselation:
4379      *                       - if \a theDeflection <= 0, default deflection 0.001 is used
4380      *  \param theIntersections1 Output: contains list of sub-shapes IDs from 1st shape that localize intersection
4381      *  \param theIntersections2 Output: contains list of sub-shapes IDs from 2nd shape that localize intersection
4382      *  \return TRUE, if the are intersections (gaps) between source shapes
4383      */
4384     boolean FastIntersect (in GEOM_Object theShape1,
4385                            in GEOM_Object theShape2,
4386                            in double      theTolerance,
4387                            in float       theDeflection,
4388                            out ListOfLong theIntersections1,
4389                            out ListOfLong theIntersections2);
4390
4391     /*!
4392      *  \brief Check if the given shape can be an argument for MakeSolid operation
4393      *  \param theShape Shape to be described.
4394      *  \return Empty string if a solid can be made on this shape, error code otherwise.
4395      */
4396     string IsGoodForSolid (in GEOM_Object theShape);
4397
4398     /*!
4399      *  O\brief btain description of the given shape
4400      *  \param theShape Shape to be described.
4401      *  \return Description of the given shape.
4402      */
4403     string WhatIs (in GEOM_Object theShape);
4404
4405     /*!
4406      *  \brief Check if points defined by coords = [x1, y1, z1, x2, y2, z2, ...] are inside or on
4407      *  the shape theShape.
4408      *  \param theShape Shape to check.
4409      *  \param coords list of coordinates.
4410      *  \param tolerance tolerance.
4411      *  \return list of boolean.
4412      */
4413     ListOfBool AreCoordsInside(in GEOM_Object theShape, in ListOfDouble coords, in double tolerance);
4414
4415     /*!
4416      *  \brief Get minimal distance between the given shapes.
4417      *  \param theShape1,theShape2 Shapes to find minimal distance between.
4418      *  \param X1,Y1,Z1 Output. Coordinates of point on theShape1, nearest to theShape2.
4419      *  \param X2,Y2,Z2 Output. Coordinates of point on theShape2, nearest to theShape1.
4420      *  \return Value of the minimal distance between the given shapes.
4421      */
4422     double GetMinDistance (in GEOM_Object theShape1, in GEOM_Object theShape2,
4423                            out double X1, out double Y1, out double Z1,
4424                            out double X2, out double Y2, out double Z2);
4425
4426     /*!
4427      *  \brief Get closest points of the given shapes.
4428      *  \param theShape1,theShape2 Shapes to find closest points of.
4429      *  \param theCoords Output. List of (X, Y, Z) coordinates for all couples of points.
4430      *  \return The number of found solutions (-1 in case of infinite number of solutions).
4431      */
4432     long ClosestPoints (in GEOM_Object theShape1,
4433                         in GEOM_Object theShape2,
4434                         out ListOfDouble theCoords);
4435
4436     /*!
4437      *  \brief Get angle between the given lines or linear edges.
4438      *  \param theShape1,theShape2 Shapes to find angle between. Lines or linear edges.
4439      *  \return Value of the angle between the given shapes.
4440      */
4441     double GetAngle (in GEOM_Object theShape1, in GEOM_Object theShape2);
4442
4443     /*!
4444      *  \brief Get angle between the given vectors.
4445      *  \param theShape1,theShape2 Vectors to find angle between.
4446      *  \return Value of the angle between the given vectors.
4447      */
4448     double GetAngleBtwVectors (in GEOM_Object theShape1, in GEOM_Object theShape2);
4449
4450     /*!
4451      *  \brief Get point coordinates
4452      */
4453     void PointCoordinates (in GEOM_Object theShape, out double X, out double Y, out double Z);
4454
4455     /*!
4456      *  \brief Get radius of curvature of curve in the point determinated by param
4457      *  \param theShape - curve.
4458      *  \param theParam - parameter on curve
4459      *  \return Value of curvature.
4460      */
4461     double CurveCurvatureByParam (in GEOM_Object theShape, in double theParam);
4462
4463     /*!
4464      *  \brief Get radius of curvature of curve in the given point
4465      *  \param theShape - curve.
4466      *  \param thePoint - point
4467      *  \return Value of curvature.
4468      */
4469     double CurveCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
4470
4471     /*!
4472      *  \brief Get max radius of curvature of surface in the point determinated by params
4473      *  \param theShape - surface.
4474      *  \param theUParam - U-parameter on surface
4475      *  \param theVParam - V-parameter on surface
4476      *  \return Value of curvature.
4477      */
4478     double MaxSurfaceCurvatureByParam (in GEOM_Object theShape, in double theUParam,
4479                                        in double theVParam);
4480
4481     /*!
4482      *  \brief Get max radius of curvature of surface in the given point
4483      *  \param theShape - surface.
4484      *  \param thePoint - point
4485      *  \return Value of curvature.
4486      */
4487     double MaxSurfaceCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
4488
4489     /*!
4490      *  \brief Get min radius of curvature of surface in the point determinated by params
4491      *  \param theShape - surface.
4492      *  \param theUParam - U-parameter on surface
4493      *  \param theVParam - V-parameter on surface
4494      *  \return Value of curvature.
4495      */
4496     double MinSurfaceCurvatureByParam (in GEOM_Object theShape, in double theUParam,
4497                                        in double theVParam);
4498
4499     /*!
4500      *  \brief Get min radius of curvature of surface in the given point
4501      *  \param theShape - surface.
4502      *  \param thePoint - point
4503      *  \return Value of curvature.
4504      */
4505     double MinSurfaceCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
4506
4507   };
4508
4509  // # GEOM_IGroupOperations:
4510   /*!
4511    *  \brief Interface for groups creation.
4512    */
4513   interface GEOM_IGroupOperations : GEOM_IOperations
4514   {
4515     /*!
4516      *  \brief Creates a new group which will store  sub-shapes of theMainShape
4517      *  \param theMainShape is a GEOM_Object on which the group is selected
4518      *  \param theShapeType defines a shape type of the group
4519      *  \return a newly created GEOM group
4520      */
4521     GEOM_Object CreateGroup (in GEOM_Object theMainShape, in long theShapeType);
4522
4523     /*!
4524      *  \brief Adds a sub-object with ID theSubShapeId to the group
4525      *  \param theGroup is a GEOM group to which the new sub-shape is added
4526      *  \param theSubShapeId is a sub-shape ID in the main object.
4527      *  \note Use method <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR> to get an ID by the sub-shape
4528      */
4529     void AddObject (in GEOM_Object theGroup, in long theSubShapeId);
4530
4531     /*!
4532      *  \brief Removes a sub-object with ID \a theSubShapeId from the group
4533      *  \param theGroup is a GEOM group from which the sub-shape is removed.
4534      *  \param theSubShapeId is a sub-shape ID in the main object.
4535      *  \note Use method <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR> to get an ID by the sub-shape
4536      */
4537     void RemoveObject (in GEOM_Object theGroup, in long theSubShapeId);
4538
4539     /*!
4540      *  \brief Adds to the group all the given shapes. No errors, if some shapes are alredy included.
4541      *  \param theGroup is a GEOM group to which the new sub-shapes are added.
4542      *  \param theSubShapes is a list of sub-shapes to be added.
4543      */
4544     void UnionList (in GEOM_Object theGroup, in ListOfGO theSubShapes);
4545
4546     /*!
4547      *  \brief Removes from the group all the given shapes. No errors, if some shapes are not included.
4548      *  \param theGroup is a GEOM group from which the sub-shapes are removed.
4549      *  \param theSubShapes is a list of sub-shapes to be removed.
4550      */
4551     void DifferenceList (in GEOM_Object theGroup, in ListOfGO theSubShapes);
4552
4553     /*!
4554      *  \brief Adds to the group all the given shapes. No errors, if some shapes are alredy included.
4555      *  \param theGroup is a GEOM group to which the new sub-shapes are added.
4556      *  \param theSubShapes is a list of IDs of sub-shapes to be added.
4557      */
4558     void UnionIDs (in GEOM_Object theGroup, in ListOfLong theSubShapes);
4559
4560     /*!
4561      *  \brief Removes from the group all the given shapes. No errors, if some shapes are not included.
4562      *  \param theGroup is a GEOM group from which the sub-shapes are removed.
4563      *  \param theSubShapes is a list of IDs of sub-shapes to be removed.
4564      */
4565     void DifferenceIDs (in GEOM_Object theGroup, in ListOfLong theSubShapes);
4566
4567     /*!
4568      *  \brief Union of two groups.
4569      *  New group is created. It will contain all entities
4570      *  which are present in groups theGroup1 and theGroup2.
4571      *  \param theGroup1, theGroup2 are the initial GEOM groups
4572      *                              to create the united group from.
4573      *  \return a newly created GEOM group.
4574      */
4575     GEOM_Object UnionGroups (in GEOM_Object theGroup1, in GEOM_Object theGroup2);
4576
4577     /*!
4578      *  \brief Intersection of two groups.
4579      *  New group is created. It will contain only those entities
4580      *  which are present in both groups theGroup1 and theGroup2.
4581      *  \param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
4582      *  \return a newly created GEOM group.
4583      */
4584     GEOM_Object IntersectGroups (in GEOM_Object theGroup1, in GEOM_Object theGroup2);
4585
4586     /*!
4587      *  \brief Cut of two groups.
4588      *  New group is created. It will contain entities which are
4589      *  present in group theGroup1 but are not present in group theGroup2.
4590      *  \param theGroup1 is a GEOM group to include elements of.
4591      *  \param theGroup2 is a GEOM group to exclude elements of.
4592      *  \return a newly created GEOM group.
4593      */
4594     GEOM_Object CutGroups (in GEOM_Object theGroup1, in GEOM_Object theGroup2);
4595
4596     /*!
4597      *  \brief Union of list of groups.
4598      *  New group is created. It will contain all entities that are
4599      *  present in groups listed in theGList.
4600      *  \param theGList is a list of GEOM groups to create the united group from.
4601      *  \return a newly created GEOM group.
4602      */
4603     GEOM_Object UnionListOfGroups (in ListOfGO theGList);
4604
4605     /*!
4606      *  \brief Intersection of list of groups.
4607      *  New group is created. It will contain only entities
4608      *  which are simultaneously present in the groups listed in theGList.
4609      *  \param theGList is a list of GEOM groups to get common part of.
4610      *  \return a newly created GEOM group.
4611      */
4612     GEOM_Object IntersectListOfGroups (in ListOfGO theGList);
4613
4614     /*!
4615      *  \brief Cut of lists of groups.
4616      *  New group is created. It will contain only entities
4617      *  which are present in groups listed in theGList1 but 
4618      *  are not present in groups from theGList2.
4619      *  \param theGList1 is a list of GEOM groups to include elements of.
4620      *  \param theGList2 is a list of GEOM groups to exclude elements of.
4621      *  \return a newly created GEOM group.
4622      */
4623     GEOM_Object CutListOfGroups (in ListOfGO theGList1,
4624                                  in ListOfGO theGList2);
4625
4626     /*!
4627      *  \brief Returns a type of sub-objects stored in the group
4628      *  \param theGroup is a GEOM group which type is returned.
4629      */
4630     long GetType (in GEOM_Object theGroup);
4631
4632     /*!
4633      *  \brief Returns a main shape associated with the group
4634      *  \param theGroup is a GEOM group for which a main shape object is requested
4635      *  \return a GEOM_Object which is a main shape for theGroup
4636      */
4637     GEOM_Object GetMainShape (in GEOM_Object theGroup);
4638
4639     /*!
4640      *  \brief Returns a list of sub-objects ID stored in the group
4641      *  \param theGroup is a GEOM group for which a list of IDs is requested
4642      */
4643     ListOfLong GetObjects (in GEOM_Object theGroup);
4644   };
4645
4646   // # GEOM_IFieldOperations:
4647   /*!
4648    *  \brief Interface for field operation.
4649    */
4650   interface GEOM_IFieldOperations : GEOM_IOperations
4651   {
4652     /*!
4653      *  \brief Creates a field
4654      */
4655     GEOM_Field CreateField(in GEOM_Object     shape, 
4656                            in string          name,
4657                            in field_data_type type,
4658                            in short           dimension,
4659                            in string_array    componentNames);
4660     /*!
4661      *  \brief Returns number of fields on a shape
4662      */
4663     long CountFields(in GEOM_Object shape);
4664
4665     /*!
4666      *  \brief Returns all fields on a shape
4667      */
4668     ListOfFields GetFields(in GEOM_Object shape);
4669
4670     /*!
4671      *  \brief Returns a field on a shape by its name
4672      */
4673     GEOM_Field GetField(in GEOM_Object shape, in string name);
4674
4675     /*!
4676      *  \brief Returns number of sub-shapes of given dimension
4677      */
4678     long GetNbSubShapes(in GEOM_Object shape, in short fieldDim);
4679   };
4680
4681  // # GEOM_Gen:
4682   /*!
4683    *  \brief Interface to access other GEOM interfaces.
4684    *
4685    *  Also contains some methods to access and manage GEOM_Object.
4686    */
4687   interface GEOM_Gen : Engines::EngineComponent,SALOMEDS::Driver
4688   {
4689     /*!
4690      *  \brief Undo/Redo Management
4691      */
4692
4693     void Undo (in long theStudyID);
4694
4695     void Redo (in long theStudyID);
4696
4697     /*!
4698      * \brief Publishing management
4699      *
4700      * Adds in theStudy a object theObject under with a name theName,
4701      * if theFather is not NULL the object is placed under thFather's SObject.
4702      * Returns a SObject where theObject is placed
4703      */
4704     SALOMEDS::SObject AddInStudy (in SALOMEDS::Study theStudy,
4705                                   in GEOM_BaseObject theObject,
4706                                   in string          theName,
4707                                   in GEOM_BaseObject theFather);
4708
4709     /*!
4710      *  \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments
4711      *
4712      *  To be used from python scripts out of geompy.addToStudy (non-default usage)
4713      *  \param theStudy  the study, in which theObject is published already,
4714      *                   and in which the arguments will be published
4715      *  \param theObject published GEOM_Object, arguments of which will be published
4716      *  \param theArgs   list of GEOM_Object, operation arguments to be published.
4717      *                   If this list is empty, all operation arguments will be published
4718      *  \param theFindMethod method to search sub-shapes, corresponding to arguments and
4719      *                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
4720      *  \param theInheritFirstArg set properties of the first argument for \a theObject.
4721      *                            Do not publish sub-shapes in place of arguments, but only
4722      *                            in place of sub-shapes of the first argument,
4723      *                            because the whole shape corresponds to the first argument.
4724      *                            Mainly to be used after transformations, but it also can be
4725      *                            usefull after partition with one object shape, and some other
4726      *                            operations, where only the first argument has to be considered.
4727      *                            If theObject has only one argument shape, this flag is automatically
4728      *                            considered as True, not regarding really passed value.
4729      *  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
4730      *                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
4731      *  \return list of published sub-shapes
4732      */
4733     ListOfGO RestoreSubShapesO (in SALOMEDS::Study   theStudy,
4734                                 in GEOM_Object       theObject,
4735                                 in ListOfGO          theArgs,
4736                                 in find_shape_method theFindMethod,
4737                                 in boolean           theInheritFirstArg,
4738                                 in boolean           theAddPrefix);
4739
4740     /*!
4741      *  \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments
4742      *
4743      *  To be used from python scripts out of geompy.addToStudy (non-default usage)
4744      *  \param theStudy  the study, in which theObject is published already,
4745      *                   and in which the arguments will be published
4746      *  \param theObject published GEOM_Object, arguments of which will be published
4747      *  \param theArgs   list of GEOM_Object, operation arguments to be published.
4748      *                   If this list is empty, all operation arguments will be published
4749      *  \param theFindMethod method to search sub-shapes, corresponding to arguments and
4750      *                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
4751      *  \param theInheritFirstArg set properties of the first argument for \a theObject.
4752      *                            Do not publish sub-shapes in place of arguments, but only
4753      *                            in place of sub-shapes of the first argument,
4754      *                            because the whole shape corresponds to the first argument.
4755      *                            Mainly to be used after transformations, but it also can be
4756      *                            usefull after partition with one object shape, and some other
4757      *                            operations, where only the first argument has to be considered.
4758      *                            If theObject has only one argument shape, this flag is automatically
4759      *                            considered as True, not regarding really passed value.
4760      *  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
4761      *                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
4762      *  \return list of published sub-shapes
4763      */
4764     ListOfGO RestoreGivenSubShapesO (in SALOMEDS::Study   theStudy,
4765                                      in GEOM_Object       theObject,
4766                                      in ListOfGO          theArgs,
4767                                      in find_shape_method theFindMethod,
4768                                      in boolean           theInheritFirstArg,
4769                                      in boolean           theAddPrefix);
4770
4771     /*!
4772      *  \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments
4773      *
4774      *  To be used from GUI and from geompy.addToStudy.
4775      *  Work like the above method, but accepts study object theSObject instead of GEOM_Object.
4776      *  \param theStudy  the study, in which theObject is published already,
4777      *                   and in which the arguments will be published
4778      *  \param theSObject study object, referencing GEOM_Object, arguments of which will be published
4779      *  \param theArgs   list of GEOM_Object, operation arguments to be published.
4780      *                   If this list is empty, all operation arguments will be published
4781      *  \param theFindMethod method to search sub-shapes, corresponding to arguments and
4782      *                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
4783      *  \param theInheritFirstArg set properties of the first argument for \a theObject.
4784      *                            Do not publish sub-shapes in place of arguments, but only
4785      *                            in place of sub-shapes of the first argument,
4786      *                            because the whole shape corresponds to the first argument.
4787      *                            Mainly to be used after transformations, but it also can be
4788      *                            usefull after partition with one object shape, and some other
4789      *                            operations, where only the first argument has to be considered.
4790      *                            If theObject has only one argument shape, this flag is automatically
4791      *                            considered as True, not regarding really passed value.
4792      *  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
4793      *                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
4794      */
4795     ListOfGO RestoreSubShapesSO (in SALOMEDS::Study   theStudy,
4796                                  in SALOMEDS::SObject theSObject,
4797                                  in ListOfGO          theArgs,
4798                                  in find_shape_method theFindMethod,
4799                                  in boolean           theInheritFirstArg,
4800                                  in boolean           theAddPrefix);
4801
4802     // #  Methods to access interfaces for objects creation and transformation
4803
4804     GEOM_IBasicOperations     GetIBasicOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
4805     GEOM_ITransformOperations GetITransformOperations(in long theStudyID) raises (SALOME::SALOME_Exception);
4806     GEOM_I3DPrimOperations    GetI3DPrimOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4807     GEOM_IShapesOperations    GetIShapesOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4808     GEOM_IBooleanOperations   GetIBooleanOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
4809     GEOM_ICurvesOperations    GetICurvesOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4810     GEOM_ILocalOperations     GetILocalOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
4811     GEOM_IHealingOperations   GetIHealingOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
4812     GEOM_IInsertOperations    GetIInsertOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4813     GEOM_IMeasureOperations   GetIMeasureOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
4814     GEOM_IBlocksOperations    GetIBlocksOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4815     GEOM_IGroupOperations     GetIGroupOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
4816     GEOM_IFieldOperations     GetIFieldOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
4817
4818     GEOM_IOperations GetPluginOperations (in long   theStudyID,
4819                                           in string theLibName) raises (SALOME::SALOME_Exception);
4820
4821     // # Objects Management
4822
4823
4824     /*!
4825      *  \brief Removes the object from the GEOM component
4826      *  \param theObject is a GEOM_Object to be removed
4827      */
4828     void RemoveObject (in GEOM_BaseObject theObject);
4829
4830     /*!
4831      *  \brief Returns an object defined by the study and its entry in the GEOM component
4832      *  \param theStudyID is a SALOMEDS Study ID
4833      *  \param theEntry is an entry of the requested GEOM_Object in the GEOM component
4834      *  \note if the object has not previously been created a NULL GEOM_Object is returned
4835      */
4836     GEOM_BaseObject GetObject (in long theStudyID, in string theEntry);
4837
4838     /*!
4839      *  \brief Add a sub-shape defined by indices in \a theIndices
4840      *  (contains unique IDs of sub-shapes inside \a theMainShape)
4841      *  \note The sub-shape GEOM_Object can has ONLY ONE function.
4842      *        Don't try to apply modification operations on them.
4843      *  \note Internal method
4844      */
4845     GEOM_Object AddSubShape (in GEOM_Object theMainShape, in ListOfLong theIndices);
4846
4847  // #  GEOM_Objects IOR Management
4848     
4849     /*!
4850      *  \brief Returns a GEOM_Object defined by its IOR
4851      *  \param theIOR a string containg an IOR of the requested GEOM_Object
4852      */
4853     GEOM_Object GetIORFromString (in string theIOR);
4854
4855     /*!
4856      *  \brief Returns a string which contains an IOR of the GEOM_Object
4857      *  \param theObject is a GEOM_Object which IOR is requested
4858      */
4859     string GetStringFromIOR (in GEOM_Object theObject);
4860
4861     /*!
4862      *  \brief Returns a name with which a GEOM_Object was dumped into python script
4863      *  \param theStudyEntry is an entry of the GEOM_Object in the study
4864      */
4865     string GetDumpName (in string theStudyEntry);
4866
4867     /*!
4868      *  \brief Returns all names with which a GEOM_Object was dumped
4869      *  into python script to avoid the same names in SMESH script
4870      */
4871     string_array GetAllDumpNames();
4872
4873     /*!
4874      *  \brief Publishes the named sub-shapes of given object in the study.
4875      *  \param theStudy    The study in which the object is published
4876      *  \param theObject   The object which named sub-shapes are published
4877      */
4878     ListOfGO PublishNamedShapesInStudy(in SALOMEDS::Study theStudy,
4879                                        //in SObject theSObject,
4880                                        in Object theObject);
4881
4882     /*!
4883      * \brief Creates a new folder
4884      *
4885      * Creates a new container (folder) for any GEOM objects.
4886      * Folder will have name theName.
4887      * If theFather is not NULL, the folder is placed under theFather object.
4888      * Otherwise, the folder takes place under root 'Geometry' object.
4889      * 
4890      * \param theName name of the folder
4891      * \param theFather parent object
4892      * \return SObject represented the created folder.
4893      */
4894     SALOMEDS::SObject CreateFolder (in string theName,
4895                                     in SALOMEDS::SObject theFather);
4896
4897     /*!
4898      * \brief Moves object to the specified folder
4899      *
4900      * The moved object should be first published in the study.
4901      * \param theObject GEOM object to move
4902      * \param theFolder target folder
4903      */
4904     void MoveToFolder (in GEOM_Object theObject,
4905                        in SALOMEDS::SObject theFolder);
4906
4907     /*!
4908      * \brief Moves list of objects to the specified folder
4909      *
4910      * The moved objects should be first published in the study.
4911      * \param theListOfGO list of GEOM objects to move
4912      * \param theFolder target folder
4913      */
4914     void MoveListToFolder (in ListOfGO theListOfGO,
4915                            in SALOMEDS::SObject theFolder);
4916
4917     /*!
4918      * \brief Moves objects to the specified position
4919      *
4920      * This function is used in the drag-n-drop functionality.
4921      *
4922      * \param what objects being moved
4923      * \param where parent object where objects are moved to
4924      * \param row position in the parent object's children list at which objects are moved
4925      */
4926     void Move( in object_list what, 
4927                in SALOMEDS::SObject where, 
4928                in long row );
4929
4930     /*!
4931      * \brief Collects dependencies of the given objects from other ones
4932      * \param theStudy The study in which the object is published
4933      * \param theListOfEntries List of GEOM object entries in OCAF tree (not in study)
4934      * \return Struct of dependent entries and its links as a byte array
4935      * \note This method is supposed to be used by GUI only.
4936      */
4937     SALOMEDS::TMPFile GetDependencyTree(in SALOMEDS::Study theStudy,
4938                                         in string_array theListOfEntries);
4939
4940     /*!
4941      * \brief Fills 3 lists that is used to reduce study of redundant objects:
4942      *  - dependencies of the given objects from other ones;
4943      *  - children of the given objects;
4944      *  - all other objects in study.
4945      * \param theStudy The study in which the object was published
4946      * \param theSelectedEntries List of GEOM object entries in OCAF tree
4947      * \param theParentEntries List of GEOM object entries on which the given objects depend
4948      * \param theSubEntries Children entries list of the given objects
4949      * \param theOtherEntries List of GEOM object entries which are in the study, but not in parents and children lists
4950      * \note This method is supposed to be used by GUI only.
4951      */
4952     void GetEntriesToReduceStudy(in SALOMEDS::Study theStudy,
4953                                  inout string_array theSelectedEntries,
4954                                  inout string_array theParentEntries,
4955                                  inout string_array theSubEntries,
4956                                  inout string_array theOtherEntries);
4957
4958   };
4959 };
4960
4961 #endif