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