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