Salome HOME
0023210: [CEA 1681] Regression with the function GetInPlaceByHistory
[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 Compound which includes all found sub-shapes if they have different types; 
2658      *          or group of all found shapes of the equal type; or a single found sub-shape.
2659      */
2660     GEOM_Object GetInPlace (in GEOM_Object theShapeWhere,
2661                             in GEOM_Object theShapeWhat);
2662
2663     /*!
2664      *  Old implementation of GetInPlace functionality, based on shape properties.
2665      */
2666     GEOM_Object GetInPlaceOld (in GEOM_Object theShapeWhere,
2667                                in GEOM_Object theShapeWhat);
2668
2669     /*!
2670      *  \brief Get sub-shape(s) of \a theShapeWhere, which are
2671      *  coincident with \a theShapeWhat or could be a part of it.
2672      *
2673      *  Implementation of this method is based on a saved history of an operation,
2674      *  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
2675      *  arguments (an argument shape or a sub-shape of an argument shape).
2676      *  The operation could be the Partition or one of boolean operations,
2677      *  performed on simple shapes (not on compounds).
2678      *
2679      *  \param theShapeWhere Shape to find sub-shapes of.
2680      *  \param theShapeWhat Shape, specifying what to find.
2681      *  \return Compound which includes all found sub-shapes if they have different types; 
2682      *          or group of all found shapes of the equal type; or a single found sub-shape.
2683      */
2684     GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere,
2685                                      in GEOM_Object theShapeWhat);
2686
2687     /*!
2688      *  \brief Get sub-shape of theShapeWhere, which are
2689      *  coincident with \a theShapeWhat that can either SOLID, FACE, EDGE or VERTEX.
2690      *  \param theShapeWhere Shape to find sub-shapes of.
2691      *  \param theShapeWhat Shape, specifying what to find.
2692      *  \return found sub-shape.
2693      */
2694     GEOM_Object GetSame (in GEOM_Object theShapeWhere,
2695                          in GEOM_Object theShapeWhat);
2696
2697     /*!
2698      *  \brief Get sub-shape Ids of theShapeWhere, which are
2699      *   coincident with \a theShapeWhat that can either SOLID, FACE, EDGE or VERTEX.
2700      *  \param theShapeWhere Shape to find sub-shapes of.
2701      *  \param theShapeWhat Shape, specifying what to find.
2702      *  \return found sub-shape Ids.
2703      */
2704     ListOfLong GetSameIDs (in GEOM_Object theShapeWhere,
2705                            in GEOM_Object theShapeWhat);
2706
2707     /*!
2708      *  \brief Resize the input edge with the new Min and Max parameters.
2709      *  The input edge parameters range is [0, 1]. If theMin parameter is
2710      *  negative, the input edge is extended, otherwise it is shrinked by
2711      *  theMin parameter. If theMax is greater than 1, the edge is extended,
2712      *  otherwise it is shrinked by theMax parameter.
2713      *  \param theEdge the input edge to be resized.
2714      *  \param theMin the minimal parameter value.
2715      *  \param theMax the maximal parameter value.
2716      *  \return a newly created edge.
2717      */
2718     GEOM_Object ExtendEdge(in GEOM_Object theEdge,
2719                            in double      theMin,
2720                            in double      theMax);
2721
2722     /*!
2723      *  \brief Resize the input face with the new UMin, UMax, VMin and VMax
2724      *  parameters. The input face U and V parameters range is [0, 1]. If
2725      *  theUMin parameter is negative, the input face is extended, otherwise
2726      *  it is shrinked along U direction by theUMin parameter. If theUMax is
2727      *  greater than 1, the face is extended, otherwise it is shrinked along
2728      *  U direction by theUMax parameter. So as for theVMin, theVMax and
2729      *  V direction of the input face.
2730      *  \param theFace the input face to be resized.
2731      *  \param theUMin the minimal U parameter value.
2732      *  \param theUMax the maximal U parameter value.
2733      *  \param theVMin the minimal V parameter value.
2734      *  \param theVMax the maximal V parameter value.
2735      *  \return a newly created face.
2736      */
2737     GEOM_Object ExtendFace(in GEOM_Object theFace,
2738                            in double      theUMin,
2739                            in double      theUMax,
2740                            in double      theVMin,
2741                            in double      theVMax);
2742
2743     /*!
2744      *  \brief Make a surface from a face. This function takes some face as
2745      *  input parameter and creates new GEOM_Object, i.e. topological shape
2746      *  by extracting underlying surface of the source face and limiting it
2747      *  by the Umin, Umax, Vmin, Vmax parameters of the source face (in the
2748      *  parametrical space).
2749      *  \param theFace the input face.
2750      *  \return a newly created face.
2751      */
2752     GEOM_Object MakeSurfaceFromFace(in GEOM_Object theFace);
2753
2754     /*!
2755      * \brief Explode a shape into edges sorted in a row from a starting point.
2756      * \param theShape - the shape to be exploded on edges.
2757      * \param theStartPoint - the starting point.
2758      * \return Ordered list of edges sorted in a row from a starting point.
2759      */
2760     ListOfGO GetSubShapeEdgeSorted (in GEOM_Object theShape,
2761                                     in GEOM_Object theStartPoint);
2762
2763     /*!
2764      * \brief Return the list of subshapes that satisfies a certain tolerance
2765      * criterion. The user defines the type of shapes to be returned, the
2766      * condition and the tolerance value. The operation is defined for
2767      * faces, edges and vertices only. E.g. for theShapeType FACE, theCondition
2768      * CC_GT and theTolerance 1.e-7 this method returns all faces of theShape
2769      * that have tolerances greater then 1.e7.
2770      *
2771      * \param theShape the shape to be exploded
2772      * \param theShapeType the type of shapes to be returned. Can have the
2773      *        values FACE, EDGE and VERTEX only.
2774      * \param theCondition the condition type.
2775      * \param theTolerance the tolerance filter.
2776      * \return the list of shapes that satisfy the conditions.
2777      */
2778     ListOfGO GetSubShapesWithTolerance(in GEOM_Object          theShape,
2779                                        in short                theShapeType,
2780                                        in comparison_condition theCondition,
2781                                        in double               theTolerance);
2782
2783   };
2784
2785  // # GEOM_IBlocksOperations: 
2786   /*!
2787    *  \brief Interface for Blocks construction
2788    *  Face from points or edges, Block from faces,
2789    *  Blocks multi-translation and multi-rotation
2790    */
2791   interface GEOM_IBlocksOperations : GEOM_IOperations
2792   {
2793    
2794   //  # Creation of blocks
2795
2796     /*!
2797      *  \brief Create a quadrangle face from four edges. Order of Edges is not
2798      *  important. It is  not necessary that edges share the same vertex.
2799      *  \param theEdge1,theEdge2,theEdge3,theEdge4 Edges for the face bound.
2800      *  \return New GEOM_Object, containing the created face.
2801      */
2802     GEOM_Object MakeQuad (in GEOM_Object theEdge1,
2803                           in GEOM_Object theEdge2,
2804                           in GEOM_Object theEdge3,
2805                           in GEOM_Object theEdge4);
2806
2807     /*!
2808      *  \brief Create a quadrangle face on two edges.
2809      *
2810      *  The missing edges will be built by creating the shortest ones.
2811      *  \param theEdge1,theEdge2 Two opposite edges for the face.
2812      *  \return New GEOM_Object, containing the created face.
2813      */
2814     GEOM_Object MakeQuad2Edges (in GEOM_Object theEdge1,
2815                                 in GEOM_Object theEdge2);
2816
2817     /*!
2818      *  \brief Create a quadrangle face with specified corners.
2819      *
2820      *  The missing edges will be built by creating the shortest ones.
2821      *  \param thePnt1,thePnt2,thePnt3,thePnt4 Corner vertices for the face.
2822      *  \return New GEOM_Object, containing the created face.
2823      */
2824     GEOM_Object MakeQuad4Vertices (in GEOM_Object thePnt1,
2825                                    in GEOM_Object thePnt2,
2826                                    in GEOM_Object thePnt3,
2827                                    in GEOM_Object thePnt4);
2828
2829     /*!
2830      *  \brief Create a hexahedral solid, bounded by the six given faces. Order of
2831      *  faces is not important. 
2832      *
2833      *  It is  not necessary that Faces share the same edge.
2834      *  \param theFace1,theFace2,theFace3,theFace4,theFace5,theFace6 Faces for the hexahedral solid.
2835      *  \return New GEOM_Object, containing the created solid.
2836      */
2837     GEOM_Object MakeHexa (in GEOM_Object theFace1,
2838                           in GEOM_Object theFace2,
2839                           in GEOM_Object theFace3,
2840                           in GEOM_Object theFace4,
2841                           in GEOM_Object theFace5,
2842                           in GEOM_Object theFace6);
2843
2844     /*!
2845      *  \brief Create a hexahedral solid between two given faces.
2846      *
2847      *  The missing faces will be built by creating the smallest ones.
2848      *  \param theFace1,theFace2 Two opposite faces for the hexahedral solid.
2849      *  \return New GEOM_Object, containing the created solid.
2850      */
2851     GEOM_Object MakeHexa2Faces (in GEOM_Object theFace1,
2852                                 in GEOM_Object theFace2);
2853
2854     
2855   //  # Extract elements of blocks and blocks compounds
2856      
2857
2858     /*!
2859      *  \brief Get a vertex, found in the given shape by its coordinates.
2860      *  \param theShape Block or a compound of blocks.
2861      *  \param theX,theY,theZ Coordinates of the sought vertex.
2862      *  \param theEpsilon Maximum allowed distance between the resulting
2863      *                    vertex and point with the given coordinates.
2864      *  \return New GEOM_Object, containing the found vertex.
2865      */
2866     GEOM_Object GetPoint (in GEOM_Object theShape,
2867                           in double      theX,
2868                           in double      theY,
2869                           in double      theZ,
2870                           in double      theEpsilon);
2871
2872     /*!
2873      *  \brief Find a vertex of the given shape, which has minimal distance to the given point.
2874      *  \param theShape Any shape.
2875      *  \param thePoint Point, close to the desired vertex.
2876      *  \return New GEOM_Object, containing the found vertex.
2877      */
2878     GEOM_Object GetVertexNearPoint (in GEOM_Object theShape,
2879                                     in GEOM_Object thePoint);
2880
2881     /*!
2882      *  \brief Get an edge, found in the given shape by two given vertices.
2883      *  \param theShape Block or a compound of blocks.
2884      *  \param thePoint1,thePoint2 Points, close to the ends of the desired edge.
2885      *  \return New GEOM_Object, containing the found edge.
2886      */
2887     GEOM_Object GetEdge (in GEOM_Object theShape,
2888                          in GEOM_Object thePoint1,
2889                          in GEOM_Object thePoint2);
2890
2891     /*!
2892      *  \brief Find an edge of the given shape, which has minimal distance to the given point.
2893      *  \param theShape Block or a compound of blocks.
2894      *  \param thePoint Point, close to the desired edge.
2895      *  \return New GEOM_Object, containing the found edge.
2896      */
2897     GEOM_Object GetEdgeNearPoint (in GEOM_Object theShape,
2898                                   in GEOM_Object thePoint);
2899
2900     /*!
2901      *  \brief Returns a face, found in the given shape by four given corner vertices.
2902      *  \param theShape Block or a compound of blocks.
2903      *  \param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
2904      *  \return New GEOM_Object, containing the found face.
2905      */
2906     GEOM_Object GetFaceByPoints (in GEOM_Object theShape,
2907                                  in GEOM_Object thePoint1,
2908                                  in GEOM_Object thePoint2,
2909                                  in GEOM_Object thePoint3,
2910                                  in GEOM_Object thePoint4);
2911
2912     /*!
2913      *  \brief Get a face of block, found in the given shape by two given edges.
2914      *  \param theShape Block or a compound of blocks.
2915      *  \param theEdge1,theEdge2 Edges, close to the edges of the desired face.
2916      *  \return New GEOM_Object, containing the found face.
2917      */
2918     GEOM_Object GetFaceByEdges (in GEOM_Object theShape,
2919                                 in GEOM_Object theEdge1,
2920                                 in GEOM_Object theEdge2);
2921
2922     /*!
2923      *  \brief Find a face, opposite to the given one in the given block.
2924      *  \param theBlock Must be a hexahedral solid.
2925      *  \param theFace Face of \a theBlock, opposite to the desired face.
2926      *  \return New GEOM_Object, containing the found face.
2927      */
2928     GEOM_Object GetOppositeFace (in GEOM_Object theBlock,
2929                                  in GEOM_Object theFace);
2930
2931     /*!
2932      *  \brief Find a face of the given shape, which has minimal distance to the given point.
2933      *  \param theShape Block or a compound of blocks.
2934      *  \param thePoint Point, close to the desired face.
2935      *  \return New GEOM_Object, containing the found face.
2936      */
2937     GEOM_Object GetFaceNearPoint (in GEOM_Object theShape,
2938                                   in GEOM_Object thePoint);
2939
2940     /*!
2941      *  \brief Find a face of block, whose outside normale has minimal angle with the given vector.
2942      *  \param theBlock Block or a compound of blocks.
2943      *  \param theVector Vector, close to the normale of the desired face.
2944      *  \return New GEOM_Object, containing the found face.
2945      */
2946     GEOM_Object GetFaceByNormale (in GEOM_Object theBlock,
2947                                   in GEOM_Object theVector);
2948
2949     /*!
2950      *  \brief Find all sub-shapes of type \a theShapeType of the given shape,
2951      *  which have minimal distance to the given point.
2952      *  \param theShape Any shape.
2953      *  \param thePoint Point, close to the desired shape.
2954      *  \param theShapeType Defines what kind of sub-shapes is searched.
2955      *  \param theTolerance The tolerance for distances comparison. All shapes
2956      *                      with distances to the given point in interval
2957      *                      [minimal_distance, minimal_distance + theTolerance] will be gathered.
2958      *  \return New GEOM_Object, containing a group of all found shapes.
2959      */
2960     GEOM_Object GetShapesNearPoint (in GEOM_Object theShape,
2961                                     in GEOM_Object thePoint,
2962                                     in long        theShapeType,
2963                                     in double      theTolerance);
2964
2965    //  #  Extract blocks from blocks compounds
2966      
2967
2968     /*!
2969      *  \brief Check, if the compound contains only specified blocks.
2970      *  \param theCompound The compound to check.
2971      *  \param theMinNbFaces If solid has lower number of faces, it is not a block.
2972      *  \param theMaxNbFaces If solid has higher number of faces, it is not a block.
2973      *    \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
2974      *  \param theNbBlocks Number of specified blocks in theCompound.
2975      *  \return TRUE, if the given compound contains only blocks.
2976      */
2977     boolean IsCompoundOfBlocks (in GEOM_Object theCompound,
2978                                 in long        theMinNbFaces,
2979                                 in long        theMaxNbFaces,
2980                                 out long       theNbBlocks);
2981
2982     /*!
2983      *  \brief Enumeration of Blocks Compound defects.
2984      */
2985     enum BCErrorType
2986     {
2987       /* Each element of the compound should be a Block */
2988       NOT_BLOCK,
2989
2990       /* An element is a potential block, but has degenerated and/or seam edge(s). */
2991       EXTRA_EDGE,
2992
2993       /* A connection between two Blocks should be an entire face or an entire edge */
2994       INVALID_CONNECTION,
2995
2996       /* The compound should be connexe */
2997       NOT_CONNECTED,
2998
2999       /* The glue between two quadrangle faces should be applied */
3000       NOT_GLUED
3001     };
3002
3003     /*!
3004      *  \brief Description of Blocks Compound defect: type and incriminated sub-shapes.
3005      */
3006     struct BCError
3007     {
3008       BCErrorType error;
3009       ListOfLong  incriminated;
3010     };
3011
3012     /*!
3013      *  \brief Sequence of all Blocks Compound defects.
3014      */
3015     typedef sequence<BCError> BCErrors;
3016
3017     /*!
3018      *  \brief Check, if the compound of blocks is given.
3019      *
3020      *  To be considered as a compound of blocks, the
3021      *  given shape must satisfy the following conditions:
3022      *  - Each element of the compound should be a Block (6 faces and 12 edges).
3023      *  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3024      *  - The compound should be connexe.
3025      *  - The glue between two quadrangle faces should be applied.
3026      *    \note Single block is also accepted as a valid compound of blocks.
3027      *  \param theCompound The compound to check.
3028      *  \param theToleranceC1 the tolerance to check if two neighbor edges are
3029      *         collinear in the common vertex with this tolerance. Negative
3030      *         value means that C1 criterion is not used (old implementation).
3031      *  \param theErrors Structure, containing discovered errors and incriminated sub-shapes.
3032      *  \return TRUE, if the given shape is a compound of blocks.
3033      */
3034     boolean CheckCompoundOfBlocks (in GEOM_Object theCompound,
3035                                    in double      theToleranceC1,
3036                                    out BCErrors   theErrors);
3037
3038     /*!
3039      *  \brief Convert sequence of Blocks Compound errors, returned by
3040      *  <VAR>CheckCompoundOfBlocks()</VAR>, into string.
3041      *  \param theCompound The bad compound.
3042      *  \param theErrors The sequence of \a theCompound errors.
3043      *  \return String, describing all the errors in form, suitable for printing.
3044      */
3045     string PrintBCErrors (in GEOM_Object theCompound,
3046                           in BCErrors    theErrors);
3047
3048     /*!
3049      *  \brief Retrieve all non blocks solids and faces from a shape.
3050      *
3051      *  \param theShape The shape to explore.
3052      *  \param theToleranceC1 the tolerance to check if two neighbor edges are
3053      *         collinear in the common vertex with this tolerance. Negative
3054      *         value means that C1 criterion is not used (old implementation).
3055      *  \param theNonQuads Output parameter. Group of all non quadrangular faces.
3056      *
3057      *  \return Group of all non block solids (= not 6 faces, or with 6
3058      *          faces, but with the presence of non-quadrangular faces).
3059      */
3060     GEOM_Object GetNonBlocks (in GEOM_Object  theShape,
3061                               in double       theToleranceC1,
3062                               out GEOM_Object theNonQuads);
3063
3064     /*!
3065      *  \brief Remove all seam and degenerated edges from \a theShape.
3066      *
3067      *  Unite faces and edges, sharing one surface.
3068      *  \param theShape The compound or single solid to remove irregular edges from.
3069      *  \param theOptimumNbFaces If more than zero, unite faces only for those solids,
3070      *         that have more than theOptimumNbFaces faces. If zero, unite faces always,
3071      *         regardsless their quantity in the solid. If negative, do not unite faces at all.
3072      *         For blocks repairing recommended value is 6.
3073      *  \return Improved shape.
3074      */
3075     GEOM_Object RemoveExtraEdges (in GEOM_Object theShape,
3076                                   in long        theOptimumNbFaces);
3077
3078     /*!
3079      *  \brief Performs union faces of \a theShape.
3080      *
3081      *  Unite faces sharing one surface.
3082      *  \param theShape The compound or single solid that contains faces to perform union.
3083      *  \return Improved shape.
3084      */
3085     GEOM_Object UnionFaces (in GEOM_Object theShape);
3086
3087     /*!
3088      *  \brief Check, if the given shape is a blocks compound.
3089      *
3090      *  Fix all detected errors.
3091      *    \note Single block can be also fixed by this method.
3092      *  \param theCompound The compound to check and improve.
3093      *  \return Improved compound.
3094      */
3095     GEOM_Object CheckAndImprove (in GEOM_Object theCompound);
3096
3097     /*!
3098      *  \brief Get all the blocks, contained in the given compound.
3099      *
3100      *  \param theCompound The compound to explode.
3101      *  \param theMinNbFaces If solid has lower number of faces, it is not a block.
3102      *  \param theMaxNbFaces If solid has higher number of faces, it is not a block.
3103      *    \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3104      *  \return List of GEOM_Object, containing the retrieved blocks.
3105      */
3106     ListOfGO ExplodeCompoundOfBlocks (in GEOM_Object theCompound,
3107                                       in long        theMinNbFaces,
3108                                       in long        theMaxNbFaces);
3109
3110     /*!
3111      *  \brief Find block, containing the given point inside its volume or on boundary.
3112      *  \param theCompound Compound, to find block in.
3113      *  \param thePoint Point, close to the desired block. If the point lays on
3114      *         boundary between some blocks, we return block with nearest center.
3115      *  \return New GEOM_Object, containing the found block.
3116      */
3117     GEOM_Object GetBlockNearPoint (in GEOM_Object theCompound,
3118                                    in GEOM_Object thePoint);
3119
3120     /*!
3121      *  \brief Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3122      *  \param theCompound Compound, to find block in.
3123      *  \param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3124      *  \return New GEOM_Object, containing the found block.
3125      */
3126     GEOM_Object GetBlockByParts (in GEOM_Object theCompound,
3127                                  in ListOfGO    theParts);
3128
3129     /*!
3130      *  \brief Return all blocks, containing all the elements, passed as the parts.
3131      *  \param theCompound Compound, to find blocks in.
3132      *  \param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3133      *  \return List of GEOM_Object, containing the found blocks.
3134      */
3135     ListOfGO GetBlocksByParts (in GEOM_Object theCompound,
3136                                in ListOfGO    theParts);
3137
3138   // #  Operations on blocks with gluing of result
3139
3140     /*!
3141      *  \brief Multi-transformate block and glue the result.
3142      *
3143      *  Transformation is defined so, as to superpose theDirFace1 with theDirFace2.
3144      *  \param theBlock Hexahedral solid to be multi-transformed.
3145      *  \param theDirFace1 First direction face global index.
3146      *  \param theDirFace2 Second direction face global index.
3147      *  \param theNbTimes Quantity of transformations to be done.
3148      *    \note Global index of sub-shape can be obtained, using method
3149      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3150      *  \return New GEOM_Object, containing the result shape.
3151      */
3152     GEOM_Object MakeMultiTransformation1D (in GEOM_Object theBlock,
3153                                            in long        theDirFace1,
3154                                            in long        theDirFace2,
3155                                            in long        theNbTimes);
3156
3157     /*!
3158      *  \brief Multi-transformate block and glue the result.
3159      *  \param theBlock Hexahedral solid to be multi-transformed.
3160      *  \param theDirFace1U,theDirFace2U Direction faces for the first transformation.
3161      *  \param theDirFace1V,theDirFace2V Direction faces for the second transformation.
3162      *  \param theNbTimesU,theNbTimesV Quantity of transformations to be done.
3163      *  \return New GEOM_Object, containing the result shape.
3164      */
3165     GEOM_Object MakeMultiTransformation2D (in GEOM_Object theBlock,
3166                                            in long        theDirFace1U,
3167                                            in long        theDirFace2U,
3168                                            in long        theNbTimesU,
3169                                            in long        theDirFace1V,
3170                                            in long        theDirFace2V,
3171                                            in long        theNbTimesV);
3172
3173   // # Special operation - propagation
3174    
3175
3176     /*!
3177      *  \brief Build all possible propagation groups.
3178      *
3179      *  Propagation group is a set of all edges, opposite to one (main)
3180      *  edge of this group directly or through other opposite edges.
3181      *  Notion of Opposite Edge make sence only on quadrangle face.
3182      *  \param theShape Shape to build propagation groups on.
3183      *  \return List of GEOM_Object, each of them is a propagation group.
3184      */
3185     ListOfGO Propagate (in GEOM_Object theShape);
3186   };
3187
3188  // # GEOM_IBooleanOperations
3189   /*!
3190    *  \brief Interface for boolean operations (Cut, Fuse, Common)
3191    */
3192   interface GEOM_IBooleanOperations : GEOM_IOperations
3193   {
3194     /*!
3195      *  \brief Perform one of boolean operations on two given shapes.
3196      *  \param theShape1 First argument for boolean operation.
3197      *  \param theShape2 Second argument for boolean operation.
3198      *  \param theOperation Indicates the operation to be done:
3199      *                      1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
3200      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3201      *                         of arguments before an operation.
3202      *  \return New GEOM_Object, containing the result shape.
3203      */
3204     GEOM_Object MakeBoolean (in GEOM_Object theShape1,
3205                              in GEOM_Object theShape2,
3206                              in long        theOperation,
3207                              in boolean     IsCheckSelfInte);
3208     /*!
3209      *  \brief Perform fusion boolean operation on two given shapes.
3210      *  \param theShape1 First argument for fuse operation.
3211      *  \param theShape2 Second argument for fuse operation.
3212      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3213      *                         of arguments before an operation.
3214      *  \param IsRmExtraEdges If TRUE, perform removal of extra edges
3215      *                        during an operation.
3216      *  \return New GEOM_Object, containing the result shape.
3217      */
3218     GEOM_Object MakeFuse (in GEOM_Object theShape1,
3219                           in GEOM_Object theShape2,
3220                           in boolean     IsCheckSelfInte,
3221                           in boolean     IsRmExtraEdges);
3222
3223     /*!
3224      *  \brief Perform fusion boolean operation on list of objects.
3225      *  \param theShapes Shapes to be fused.
3226      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3227      *                         of arguments before an operation.
3228      *  \param IsRmExtraEdges If TRUE, perform removal of extra edges
3229      *                        during an operation.
3230      *  \return New GEOM_Object, containing the result shape.
3231      */
3232     GEOM_Object MakeFuseList (in ListOfGO theShapes,
3233                               in boolean  IsCheckSelfInte,
3234                               in boolean  IsRmExtraEdges);
3235
3236     /*!
3237      *  \brief Perform common boolean operation on list of objects.
3238      *  \param theShapes Shapes for common operation.
3239      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3240      *                         of arguments before an operation.
3241      *  \return New GEOM_Object, containing the result shape.
3242      */
3243     GEOM_Object MakeCommonList (in ListOfGO theShapes,
3244                                 in boolean  IsCheckSelfInte);
3245
3246     /*!
3247      *  \brief Perform cutting of list of objects from theMainShape.
3248      *  \param theMainShape the object for cut operation.
3249      *  \param theShapes Shapes to be cut from theMainShape (tools).
3250      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3251      *                         of arguments before an operation.
3252      *  \return New GEOM_Object, containing the result shape.
3253      */
3254     GEOM_Object MakeCutList (in GEOM_Object theMainShape,
3255                              in ListOfGO theShapes,
3256                              in boolean  IsCheckSelfInte);
3257
3258     /*!
3259      *  \brief Perform partition operation.
3260      *
3261      *  \param theShapes Shapes to be intersected.
3262      *  \param theTools Shapes to intersect theShapes.
3263      *  \note  Each compound from ListShapes and ListTools will be exploded in order
3264      *         to avoid possible intersection between shapes from this compound.
3265      *  \param theLimit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
3266      *  \param theKeepNonlimitShapes: if this parameter == 0, then only shapes of
3267      *                             target type (equal to Limit) are kept in the result,
3268      *                             else standalone shapes of lower dimension
3269      *                             are kept also (if they exist).
3270      *
3271      *  After implementation new version of PartitionAlgo (October 2006)
3272      *  other parameters are ignored by current functionality. They are kept
3273      *  in this function only for supporting old versions.
3274      *  Ignored parameters:
3275      *  \param theKeepInside Shapes, outside which the results will be deleted.
3276      *         Each shape from theKeepInside must belong to theShapes also.
3277      *  \param theRemoveInside Shapes, inside which the results will be deleted.
3278      *         Each shape from theRemoveInside must belong to theShapes also.
3279      *  \param theRemoveWebs If TRUE, perform Glue 3D algorithm.
3280      *  \param theMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
3281      *
3282      *  \return New GEOM_Object, containing the result shapes.
3283      */
3284     GEOM_Object MakePartition (in ListOfGO   theShapes,
3285                                in ListOfGO   theTools,
3286                                in ListOfGO   theKeepInside,
3287                                in ListOfGO   theRemoveInside,
3288                                in short      theLimit,
3289                                in boolean    theRemoveWebs,
3290                                in ListOfLong theMaterials,
3291                                in short      theKeepNonlimitShapes);
3292
3293     /*!
3294      *  \brief Perform partition operation.
3295      *
3296      *  This method may be usefull if it is needed to make a partition for
3297      *  a compound containing nonintersected shapes. Performance will be better
3298      *  since intersection between shapes from compound is not performed.
3299      *
3300      *  Description of all parameters as in previous method MakePartition().
3301      *  One additional parameter is provided:
3302      *  \param IsCheckSelfInte If TRUE, perform check self intersection
3303      *                         of arguments before an operation.
3304      *
3305      *  \note Passed compounds (via ListShapes or via ListTools)
3306      *        have to consist of nonintersecting shapes.
3307      *
3308      *  \return New GEOM_Object, containing the result shapes.
3309      */
3310     GEOM_Object MakePartitionNonSelfIntersectedShape (in ListOfGO   theShapes,
3311                                                       in ListOfGO   theTools,
3312                                                       in ListOfGO   theKeepInside,
3313                                                       in ListOfGO   theRemoveInside,
3314                                                       in short      theLimit,
3315                                                       in boolean    theRemoveWebs,
3316                                                       in ListOfLong theMaterials,
3317                                                       in short      theKeepNonlimitShapes,
3318                                                       in boolean    IsCheckSelfInte);
3319
3320     /*!
3321      *  \brief Perform partition of the Shape with the Plane
3322      *  \param theShape Shape to be intersected.
3323      *  \param thePlane Tool shape, to intersect theShape.
3324      *  \return New GEOM_Object, containing the result shape.
3325      * 
3326      *  \note This operation is a shortcut to the more general \ref MakePartition
3327      *  operation, where \a theShape specifies single "object" (shape being partitioned)
3328      *  and \a thePlane specifies single "tool" (intersector shape). Other parameters of
3329      *  \ref MakePartition operation have default values:
3330      *  - \a theLimit: GEOM::SHAPE (shape limit corresponds to the type of \a theShape)
3331      *  - \a theKeepNonlimitShapes: 0
3332      *  - \a theKeepInside, \a theRemoveInside, \a theRemoveWebs,
3333      *    \a theMaterials (obsolete parameters): empty
3334      *
3335      * \sa MakePartition, MakePartitionNonSelfIntersectedShape
3336      */
3337     GEOM_Object MakeHalfPartition (in GEOM_Object theShape,
3338                                    in GEOM_Object thePlane);
3339   };
3340
3341  // # GEOM_ICurvesOperations:
3342   /*!
3343    *  \brief Interface for curves creation.
3344    *
3345    *  Polyline, Circle, Spline (Bezier and Interpolation)
3346    */
3347   interface GEOM_ICurvesOperations : GEOM_IOperations
3348   {
3349     /*!
3350      *  \brief Create a circle with given center, normal vector and radius.
3351      *  \param thePnt Circle center.
3352      *  \param theVec Vector, normal to the plane of the circle.
3353      *  \param theR Circle radius.
3354      *  \return New GEOM_Object, containing the created circle.
3355      */
3356     GEOM_Object MakeCirclePntVecR (in GEOM_Object thePnt,
3357                                    in GEOM_Object theVec,
3358                                    in double theR);
3359     /*!
3360      *  \brief Create a circle, passing through three given points
3361      *  \param thePnt1,thePnt2,thePnt3 Points, defining the circle.
3362      *  \return New GEOM_Object, containing the created circle.
3363      */
3364     GEOM_Object MakeCircleThreePnt (in GEOM_Object thePnt1,
3365                                     in GEOM_Object thePnt2,
3366                                     in GEOM_Object thePnt3);
3367     /*!
3368      *  \brief Create a circle with given center, with a radius equals the distance from center to Point1
3369      *  and on a plane defined by all of three points.
3370      *  \param thePnt1,thePnt2,thePnt3 Points, defining the circle.
3371      *  \return New GEOM_Object, containing the created circle.
3372      */
3373     GEOM_Object MakeCircleCenter2Pnt (in GEOM_Object thePnt1,
3374                                       in GEOM_Object thePnt2,
3375                                       in GEOM_Object thePnt3);
3376     /*!
3377      *  \brief Create an ellipse with given center, normal vector and radiuses.
3378      *  \param thePnt Ellipse center.
3379      *  \param theVec Vector, normal to the plane of the ellipse.
3380      *  \param theRMajor Major ellipse radius.
3381      *  \param theRMinor Minor ellipse radius.
3382      *  \return New GEOM_Object, containing the created ellipse.
3383      */
3384     GEOM_Object MakeEllipse (in GEOM_Object thePnt,
3385                              in GEOM_Object theVec,
3386                              in double theRMajor,
3387                              in double theRMinor);
3388
3389     /*!
3390      *  \brief Create an ellipse with given center, normal vector, main axis vector and radiuses.
3391      *  \param thePnt Ellipse center.
3392      *  \param theVec Vector, normal to the plane of the ellipse.
3393      *  \param theRMajor Major ellipse radius.
3394      *  \param theRMinor Minor ellipse radius.
3395      *  \param theVecMaj Vector, direction of the ellipse's main axis.
3396      *  \return New GEOM_Object, containing the created ellipse.
3397      */
3398     GEOM_Object MakeEllipseVec (in GEOM_Object thePnt,
3399                                 in GEOM_Object theVec,
3400                                 in double theRMajor,
3401                                 in double theRMinor,
3402                                 in GEOM_Object theVecMaj);
3403
3404     /*!
3405      *  \brief Create an arc of circle, passing through three given points.
3406      *  \param thePnt1 Start point of the arc.
3407      *  \param thePnt2 Middle point of the arc.
3408      *  \param thePnt3 End point of the arc.
3409      *  \return New GEOM_Object, containing the created arc.
3410      */
3411     GEOM_Object MakeArc (in GEOM_Object thePnt1,
3412                          in GEOM_Object thePnt2,
3413                          in GEOM_Object thePnt3);
3414
3415     /*!
3416      *  \brief Create an arc of circle of center C from one point to another
3417      *  \param theCenter Center point of the arc.
3418      *  \param thePnt1 Start point of the arc.
3419      *  \param thePnt2 End point of the arc.
3420      *  \param theSense Orientation of the arc
3421      *  \return New GEOM_Object, containing the created arc.
3422      */
3423     GEOM_Object MakeArcCenter (in GEOM_Object theCenter,
3424                                in GEOM_Object thePnt1,
3425                                in GEOM_Object thePnt2,
3426                                in boolean theSense);
3427
3428     /*!
3429      *  \brief Create an arc of ellipse of center C and two points P1 P2.
3430      *  \param theCenter Center point of the arc.
3431      *  \param thePnt1 Major radius is distance from center to Pnt1.
3432      *  \param thePnt2 define a plane and Minor radius as a shortest
3433      *                 distance from Pnt2 to vector Center->Pnt1.
3434      *  \return New GEOM_Object, containing the created arc.
3435      */
3436     GEOM_Object MakeArcOfEllipse (in GEOM_Object theCenter,
3437                                   in GEOM_Object thePnt1,
3438                                   in GEOM_Object thePnt2);
3439
3440
3441     /*!
3442      *  \brief Create a polyline on the set of points.
3443      *  \param thePoints Sequence of points for the polyline.
3444      *  \param theIsClosed If TRUE, build a closed wire.
3445      *  \return New GEOM_Object, containing the created polyline.
3446      */
3447     GEOM_Object MakePolyline (in ListOfGO thePoints,
3448                               in boolean  theIsClosed);
3449
3450     /*!
3451      *  \brief Create bezier curve on the set of points.
3452      *  \param thePoints Sequence of points for the bezier curve.
3453      *  \param theIsClosed If TRUE, build a closed curve.
3454      *  \return New GEOM_Object, containing the created bezier curve.
3455      */
3456     GEOM_Object MakeSplineBezier (in ListOfGO thePoints,
3457                                   in boolean  theIsClosed);
3458
3459     /*!
3460      *  \brief Create B-Spline curve on the set of points.
3461      *  \param thePoints Sequence of points for the B-Spline curve.
3462      *  \param theIsClosed If TRUE, build a closed curve.
3463      *  \param theDoReordering If TRUE, the algo does not follow the order of
3464      *                         \a thePoints but searches for the closest vertex.
3465      *  \return New GEOM_Object, containing the created B-Spline curve.
3466      */
3467     GEOM_Object MakeSplineInterpolation (in ListOfGO thePoints,
3468                                          in boolean  theIsClosed,
3469                                          in boolean  theDoReordering);
3470
3471     /*!
3472      *  \brief Create B-Spline curve on the set of points.
3473      *  \param thePoints Sequence of points for the B-Spline curve.
3474      *  \param theFirstVec Vector object, defining the curve direction at its first point.
3475      *  \param theLastVec Vector object, defining the curve direction at its last point.
3476      *  \return New GEOM_Object, containing the created B-Spline curve.
3477      */
3478     GEOM_Object MakeSplineInterpolWithTangents (in ListOfGO    thePoints,
3479                                                 in GEOM_Object theFirstVec,
3480                                                 in GEOM_Object theLastVec);
3481
3482     /*!
3483      *  \brief Creates a curve using the parametric definition of the basic points.
3484      *  \param thexExpr parametric equation of the coordinates X.
3485      *  \param theyExpr parametric equation of the coordinates Y.
3486      *  \param thezExpr parametric equation of the coordinates Z.
3487      *  \param theParamMin the minimal value of the parameter.
3488      *  \param theParamMax the maximum value of the parameter.
3489      *  \param theParamStep the step of the parameter.
3490      *  \param theCurveType the type of the curve.
3491      *  \return New GEOM_Object, containing the created curve.
3492      */    
3493     GEOM_Object MakeCurveParametric(in string thexExpr,
3494                                     in string theyExpr,
3495                                     in string thezExpr,
3496                                     in double theParamMin,
3497                                     in double theParamMax,
3498                                     in double theParamStep,
3499                                     in curve_type theCurveType);
3500
3501      /*!
3502      *  \brief Creates a curve using the parametric definition of the basic points.
3503      *  \param thexExpr parametric equation of the coordinates X.
3504      *  \param theyExpr parametric equation of the coordinates Y.
3505      *  \param thezExpr parametric equation of the coordinates Z.
3506      *  \param theParamMin the minimal value of the parameter.
3507      *  \param theParamMax the maximum value of the parameter.
3508      *  \param theParamNbStep the number of steps of the parameter discretization.
3509      *  \param theCurveType the type of the curve.
3510      *  \return New GEOM_Object, containing the created curve.
3511      */    
3512     GEOM_Object MakeCurveParametricNew(in string thexExpr,
3513                     in string theyExpr,
3514                     in string thezExpr,
3515                     in double theParamMin,
3516                     in double theParamMax,
3517                     in long   theParamNbStep,
3518                     in curve_type theCurveType);
3519
3520      /*!
3521      *  \brief Creates an isoline curve on a face.
3522      *  \param theFace the face for which an isoline is created.
3523      *  \param IsUIsoline True for U-isoline creation; False for V-isoline
3524      *         creation.
3525      *  \param theParameter the U parameter for U-isoline or V parameter
3526      *         for V-isoline.
3527      *  \return New GEOM_Object, containing the created isoline edge or a
3528      *          compound of edges.
3529      */
3530     GEOM_Object MakeIsoline(in GEOM_Object theFace,
3531                             in boolean     IsUIsoline,
3532                             in double      theParameter);
3533
3534     /*!
3535      *  \brief Create a sketcher (wire or face), following the textual description,
3536      *         passed through \a theCommand argument.
3537      *
3538      *  Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
3539      *  Format of the description string has to be the following:
3540      *
3541      *  "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
3542      *
3543      *  Where:
3544      *  - x1, y1 are coordinates of the first sketcher point (zero by default),
3545      *  - CMD is one of
3546      *     - "R angle" : Set the direction by angle
3547      *     - "D dx dy" : Set the direction by DX & DY
3548      *     .
3549      *       \n
3550      *     - "TT x y" : Create segment by point at X & Y
3551      *     - "T dx dy" : Create segment by point with DX & DY
3552      *     - "L length" : Create segment by direction & Length
3553      *     - "IX x" : Create segment by direction & Intersect. X
3554      *     - "IY y" : Create segment by direction & Intersect. Y
3555      *     .
3556      *       \n
3557      *     - "C radius length" : Create arc by direction, radius and length(in degree)
3558      *     .
3559      *       \n
3560      *     - "WW" : Close Wire (to finish)
3561      *     - "WF" : Close Wire and build face (to finish)
3562      *
3563      *  \param theCommand String, defining the sketcher in local
3564      *                    coordinates of the working plane.
3565      *  \param theWorkingPlane Nine double values, defining origin,
3566      *                         OZ and OX directions of the working plane.
3567      *  \return New GEOM_Object, containing the created wire or face.
3568      */
3569     GEOM_Object MakeSketcher (in string theCommand, in ListOfDouble theWorkingPlane);
3570
3571     /*!
3572      *  \brief Create a sketcher (wire or face), following the textual description,
3573      *         passed through \a theCommand argument. 
3574      *
3575      *  For format of the description string see the previous method.\n
3576      *
3577      *  \param theCommand String, defining the sketcher in local
3578      *                    coordinates of the working plane.
3579      *  \param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
3580      *  \return New GEOM_Object, containing the created wire or face.
3581      */
3582     GEOM_Object MakeSketcherOnPlane (in string theCommand, in GEOM_Object theWorkingPlane);
3583
3584     /*!
3585      *  \brief Create a 3D sketcher, following the textual description,
3586      *         passed through \a theCommand argument. 
3587      *
3588      *  Format of the description string has to be the following:
3589      *
3590      *  "3DSketcher:CMD[:CMD[:CMD...]]"
3591      *
3592      *  Where CMD is one of
3593      *     - "TT x y z" : Create segment by point at X & Y or set the first point
3594      *     - "T dx dy dz" : Create segment by point with DX & DY
3595      *     .
3596      *       \n
3597      *     - "OXY angleX angle2 length" : Create segment by two angles and length
3598      *     - "OYZ angleY angle2 length" : Create segment by two angles and length
3599      *     - "OXZ angleX angle2 length" : Create segment by two angles and length
3600      *     .
3601      *       \n
3602      *     - "WW" : Close Wire (to finish)
3603      *
3604      *  \param theCommand String, defining the sketcher in local
3605      *                    coordinates of the working plane.
3606      *  \return New GEOM_Object, containing the created wire.
3607      */
3608     GEOM_Object Make3DSketcherCommand (in string theCommand);
3609
3610     /*!
3611      *  \brief Create a 3D sketcher, made of a straight segments, joining points
3612      *         with coordinates passed through \a theCoordinates argument. 
3613      *
3614      *  Order of coordinates has to be the following:
3615      *  x1, y1, z1, x2, y2, z2, ..., xN, yN, zN
3616      *
3617      *  \param theCoordinates List of double values.
3618      *  \return New GEOM_Object, containing the created wire.
3619      */
3620     GEOM_Object Make3DSketcher (in ListOfDouble theCoordinates);
3621
3622     /*!
3623      *  \brief Create a 2D polyline (wire or a compound of wires).
3624      *
3625      *  The polyline can have several sections. Each section represents a set
3626      *  of points in the form of list of coordinates of the following order:
3627      *  x1, y1, x2, y2, ..., xN, yN
3628      *  Each section has its own name, type of curve (can be either
3629      *  GEOM::Polyline or GEOM::Interpolation) and Closed flag.
3630      *  For each section a wire is created. It represents either a polyline or
3631      *  interpolation BSpline either closed or not depending on the Closed flag.
3632      *  The result represents a wire if there is only one section is defined.
3633      *  Otherwise a compound of wires is returned.
3634      *
3635      *  \param theCoordsList the list of coordinates list. theCoordsList[0]
3636      *         is the coordinates list of the first section. theCoordsList[1]
3637      *         is for the second section etc.
3638      *  \param theNamesList the list of names. The order corresponds to
3639      *         theCoordsList.
3640      *  \param theTypesList the list of curve types. The order corresponds to
3641      *         theCoordsList.
3642      *  \param theClosedList the list of Closed flags. The order corresponds to
3643      *         theCoordsList.
3644      *  \param theWorkingPlane 9 double values, defining origin,
3645      *         OZ and OX directions of the working plane.
3646      *  \return New GEOM_Object, containing the created wire or a compound
3647      *          of wires.
3648      */
3649     GEOM_Object MakePolyline2D (in ListOfListOfDouble theCoordsList,
3650                                 in string_array       theNamesList,
3651                                 in short_array        theTypesList,
3652                                 in ListOfBool         theClosedList,
3653                                 in ListOfDouble       theWorkingPlane);
3654
3655     /*!
3656      *  \brief Create a 2D polyline (wire or a compound of wires).
3657      *
3658      *  The polyline can have several sections. Each section represents a set
3659      *  of points in the form of list of coordinates of the following order:
3660      *  x1, y1, x2, y2, ..., xN, yN
3661      *  Each section has its own name, type of curve (can be either
3662      *  GEOM::Polyline or GEOM::Interpolation) and Closed flag.
3663      *  For each section a wire is created. It represents either a polyline or
3664      *  interpolation BSpline either closed or not depending on the Closed flag.
3665      *  The result represents a wire if there is only one section is defined.
3666      *  Otherwise a compound of wires is returned.
3667      *
3668      *  \param theCoordsList the list of coordinates list. theCoordsList[0]
3669      *         is the coordinates list of the first section. theCoordsList[1]
3670      *         is for the second section etc.
3671      *  \param theNamesList the list of names. The order corresponds to
3672      *         theCoordsList.
3673      *  \param theTypesList the list of curve types. The order corresponds to
3674      *         theCoordsList.
3675      *  \param theClosedList the list of Closed flags. The order corresponds to
3676      *         theCoordsList.
3677      *  \param theWorkingPlane planar Face or LCS(Marker) of the working plane.
3678      *  \return New GEOM_Object, containing the created wire or a compound
3679      *          of wires.
3680      */
3681     GEOM_Object MakePolyline2DOnPlane (in ListOfListOfDouble theCoordsList,
3682                                        in string_array       theNamesList,
3683                                        in short_array        theTypesList,
3684                                        in ListOfBool         theClosedList,
3685                                        in GEOM_Object        theWorkingPlane);
3686
3687   };
3688
3689  // # GEOM_ILocalOperations:
3690   /*!
3691    *  \brief Interface for fillet and chamfer creation.
3692    */
3693   interface GEOM_ILocalOperations : GEOM_IOperations
3694   {
3695     /*!
3696      *  \brief Perform a fillet on all edges of the given shape.
3697      *  \param theShape Shape, to perform fillet on.
3698      *  \param theR Fillet radius.
3699      *  \return New GEOM_Object, containing the result shape.
3700      */
3701     GEOM_Object MakeFilletAll (in GEOM_Object theShape,
3702                                in double      theR);
3703
3704     /*!
3705      *  \brief Perform a fillet on the specified edges of the given shape
3706      *  \param theShape Shape, to perform fillet on.
3707      *  \param theR Fillet radius.
3708      *  \param theEdges Global indices of edges to perform fillet on.
3709      *    \note Global index of sub-shape can be obtained, using method
3710      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3711      *  \return New GEOM_Object, containing the result shape.
3712      */
3713     GEOM_Object MakeFilletEdges (in GEOM_Object theShape,
3714                                  in double      theR,
3715                                  in ListOfLong  theEdges);
3716     GEOM_Object MakeFilletEdgesR1R2 (in GEOM_Object theShape,
3717                                      in double      theR1,
3718                                      in double      theR2,
3719                                      in ListOfLong  theEdges);
3720
3721     /*!
3722      *  \brief Perform a fillet on all edges of the specified faces of the given shape.
3723      *  \param theShape Shape, to perform fillet on.
3724      *  \param theR Fillet radius.
3725      *  \param theFaces Global indices of faces to perform fillet on.
3726      *    \note Global index of sub-shape can be obtained, using method
3727      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3728      *  \return New GEOM_Object, containing the result shape.
3729      */
3730     GEOM_Object MakeFilletFaces (in GEOM_Object theShape,
3731                                  in double      theR,
3732                                  in ListOfLong  theFaces);
3733
3734     GEOM_Object MakeFilletFacesR1R2 (in GEOM_Object theShape,
3735                                      in double      theR1,
3736                                      in double      theR2,
3737                                      in ListOfLong  theFaces);
3738
3739     /*!
3740      *  \brief Perform a fillet on a face or a shell at the specified vertexes.
3741      *  \param theShape Shape, to perform fillet on.
3742      *  \param theR Fillet radius.
3743      *  \param theVertexes Global indices of vertexes to perform fillet on.
3744      *    \note Global index of sub-shape can be obtained, using method
3745      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3746      *  \return New GEOM_Object, containing the result shape.
3747      */
3748     GEOM_Object MakeFillet2D (in GEOM_Object theShape,
3749                               in double      theR,
3750                               in ListOfLong  theVertexes);
3751
3752     /*!
3753      *  \brief Perform a fillet on edges of the specified vertexes of the given wire.
3754      *  \param theShape Shape, to perform fillet on.
3755      *  \param theR Fillet radius.
3756      *  \param theVertexes Global indices of vertexes to perform fillet on.
3757      *    \note Global index of sub-shape can be obtained, using method
3758      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3759      *    \note The list of vertices coudl be empty, in this case fillet fill be done
3760      *          at all vertices in given wire
3761      *  \param doIgnoreSecantVertices If FALSE, fillet radius is always limited
3762      *         by the length of the edges, nearest to the fillet vertex.
3763      *         But sometimes the next edge is C1 continuous with the one, nearest to
3764      *         the fillet point, and such two (or more) edges can be united to allow
3765      *         bigger radius. Set this flag to TRUE to allow collinear edges union,
3766      *         thus ignoring the secant vertex (vertices).
3767      *  \return New GEOM_Object, containing the result shape.
3768      */
3769     GEOM_Object MakeFillet1D (in GEOM_Object theShape,
3770                               in double      theR,
3771                               in ListOfLong  theVertexes,
3772                               in boolean     doIgnoreSecantVertices);
3773
3774     /*!
3775      *  \brief Perform a symmetric chamfer on all edges of the given shape.
3776      *  \param theShape Shape, to perform chamfer on.
3777      *  \param theD Chamfer size along each face.
3778      *  \return New GEOM_Object, containing the result shape.
3779      */
3780     GEOM_Object MakeChamferAll (in GEOM_Object theShape,
3781                                 in double      theD);
3782
3783     /*!
3784      *  \brief Perform a chamfer on edges, common to the specified faces.
3785      *  with distance D1 on the Face1
3786      *  \param theShape Shape, to perform chamfer on.
3787      *  \param theD1 Chamfer size along \a theFace1.
3788      *  \param theD2 Chamfer size along \a theFace2.
3789      *  \param theFace1,theFace2 Global indices of two faces of \a theShape.
3790      *    \note Global index of sub-shape can be obtained, using method
3791      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3792      *  \return New GEOM_Object, containing the result shape.
3793      */
3794     GEOM_Object MakeChamferEdge (in GEOM_Object theShape,
3795                                  in double theD1, in double theD2,
3796                                  in long theFace1, in long theFace2);
3797     /*!
3798      *  \brief The Same but with params theD = Chamfer Lenght
3799      *  and theAngle = Chamfer Angle (Angle in radians)
3800      */
3801     GEOM_Object MakeChamferEdgeAD (in GEOM_Object theShape,
3802                                    in double theD, in double theAngle,
3803                                    in long theFace1, in long theFace2);
3804
3805     /*!
3806      *  \brief Perform a chamfer on all edges of the specified faces.
3807      *  with distance D1 on the first specified face (if several for one edge)
3808      *  \param theShape Shape, to perform chamfer on.
3809      *  \param theD1 Chamfer size along face from \a theFaces. If both faces,
3810      *               connected to the edge, are in \a theFaces, \a theD1
3811      *               will be get along face, which is nearer to \a theFaces beginning.
3812      *  \param theD2 Chamfer size along another of two faces, connected to the edge.
3813      *  \param theFaces Sequence of global indices of faces of \a theShape.
3814      *    \note Global index of sub-shape can be obtained, using method
3815      *          <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3816      *  \return New GEOM_Object, containing the result shape.
3817      */
3818     GEOM_Object MakeChamferFaces (in GEOM_Object theShape,
3819                                   in double theD1, in double theD2,
3820                                   in ListOfLong theFaces);
3821     /*!
3822      *  The Same but with params theD = Chamfer Lenght
3823      *  and theAngle = Chamfer Angle (Angle in radians)
3824      */
3825     GEOM_Object MakeChamferFacesAD (in GEOM_Object theShape,
3826                                     in double theD, in double theAngle,
3827                                     in ListOfLong theFaces);
3828
3829    /*!
3830     *  \brief Perform a chamfer on edges,
3831     *  with distance D1 on the first specified face (if several for one edge)
3832     *  \param theShape Shape, to perform chamfer on.
3833     *  \param theD1,theD2 Chamfer size
3834     *  \param theEdges Sequence of edges of \a theShape.
3835     *  \return New GEOM_Object, containing the result shape.
3836     */
3837     GEOM_Object MakeChamferEdges (in GEOM_Object theShape,
3838                                   in double theD1, in double theD2,
3839                                   in ListOfLong theEdges);
3840     /*!
3841      *  The Same but with params theD = Chamfer Lenght
3842      *  and theAngle = Chamfer Angle (Angle in radians)
3843      */
3844     GEOM_Object MakeChamferEdgesAD (in GEOM_Object theShape,
3845                                     in double theD, in double theAngle,
3846                                     in ListOfLong theEdges);
3847
3848     /*!
3849      *  \brief Perform an Archimde operation on the given shape with given parameters.
3850      *                    The object presenting the resulting face is returned
3851      *  \param theShape Shape to be put in water.
3852      *  \param theWeight Weight og the shape.
3853      *  \param theWaterDensity Density of the water.
3854      *  \param theMeshDeflection Deflection od the mesh, using to compute the section.
3855      *  \return New GEOM_Object, containing a section of \a theShape
3856      *          by a plane, corresponding to water level.
3857      */
3858     GEOM_Object MakeArchimede (in GEOM_Object theShape,
3859                                in double theWeight,
3860                                in double theWaterDensity,
3861                                in double theMeshDeflection);
3862
3863     /*!
3864      *  \brief Duplicates <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
3865      *
3866      *  Present here only for compatibility.
3867      */
3868     long GetSubShapeIndex (in GEOM_Object theShape, in GEOM_Object theSubShape);
3869   };
3870
3871  // #  GEOM_IHealingOperations: 
3872   /*!
3873    *  \brief Interface for shape healing operations
3874    *
3875    *  Shape Processing, SuppressFaces, etc.
3876    */
3877   interface GEOM_IHealingOperations : GEOM_IOperations
3878   {
3879     /*!
3880      *  \brief Apply a sequence of Shape Healing operators to the given object.
3881      *  \param theShapes Shape to be processed.
3882      *  \param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
3883      *  \param theParameters List of names of parameters
3884      *                    ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
3885      *  \param theValues List of values of parameters, in the same order
3886      *                    as parameters are listed in \a theParameters list.
3887      *  \return New GEOM_Object, containing processed shape.
3888      */
3889     GEOM_Object ProcessShape (in GEOM_Object theShapes,
3890                               in string_array theOperators,
3891                               in string_array theParameters,
3892                               in string_array theValues);
3893
3894     /*!
3895      *  \brief Get default sequence of operators, their parameters and parameters' values
3896      *  of Shape Process operation. 
3897      *
3898      *  In the current implementation the defaults are
3899      *  read from the file pointed by CSF_ShHealingDefaults environmental variable.
3900      *  \param theOperators Output. Default list of names of operators.
3901      *  \param theParameters Output. Default list of names of parameters.
3902      *  \param theValues Output. List of default values of parameters, in the same order
3903      *                           as parameters are listed in \a theParameters list.
3904      */
3905     void GetShapeProcessParameters (out string_array theOperators,
3906                                     out string_array theParameters,
3907                                     out string_array theValues);
3908     /*!
3909      *  \brief Get parameters and parameters' values for the given Shape Process operation.
3910      *
3911      *  In the current implementation the defaults are
3912      *  read from the file pointed by CSF_ShHealingDefaults environmental variable.
3913      *  \param theOperator Input. The operator's name.
3914      *  \param theParameters Output. Default list of names of parameters.
3915      *  \param theValues Output. List of default values of parameters, in the same order
3916      *                           as parameters are listed in \a theParameters list.
3917      */
3918     void GetOperatorParameters (in string theOperator,
3919                                 out string_array theParameters,
3920                                 out string_array theValues);
3921
3922     /*!
3923      *  \brief Remove faces from the given object (shape).
3924      *  \param theObject Shape to be processed.
3925      *  \param theFaces Indices of faces to be removed, if EMPTY then the method
3926      *                  removes ALL faces of the given object.
3927      *  \return New GEOM_Object, containing processed shape.
3928      */
3929     GEOM_Object SuppressFaces (in GEOM_Object theObject, in short_array theFaces);
3930
3931     /*!
3932      *  \brief Close an open wire.
3933      *  \param theObject Shape to be processed.
3934      *  \param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
3935      *                  if -1, then theObject itself is a wire.
3936      *  \param isCommonVertex If TRUE : closure by creation of a common vertex,
3937      *                        If FALS : closure by creation of an edge between ends.
3938      *  \return New GEOM_Object, containing processed shape.
3939      */
3940     GEOM_Object CloseContour (in GEOM_Object theObject, in short_array theWires,
3941                               in boolean isCommonVertex);
3942
3943     /*!
3944      *  \brief Remove internal wires and edges from the given object (face).
3945      *  \param theObject Shape to be processed.
3946      *  \param theWires Indices of wires to be removed, if EMPTY then the method
3947      *                  removes ALL internal wires of the given object.
3948      *  \return New GEOM_Object, containing processed shape.
3949      */
3950     GEOM_Object RemoveIntWires (in GEOM_Object theObject, in short_array theWires);
3951
3952     /*!
3953      *  \brief Remove internal closed contours (holes) from the given object.
3954      *  \param theObject Shape to be processed.
3955      *  \param theWires Indices of wires to be removed, if EMPTY then the method
3956      *                  removes ALL internal holes of the given object
3957      *  \return New GEOM_Object, containing processed shape.
3958      */
3959     GEOM_Object FillHoles (in GEOM_Object theObject, in short_array theWires);
3960
3961     /*!
3962      *  Sewing of the given object.
3963      *  \param theObjects Shapes to be processed.
3964      *  \param theTolerance Required tolerance value.
3965      *  \return New GEOM_Object, containing processed shape.
3966      */
3967     GEOM_Object Sew (in ListOfGO theObjects, in double theTolerance);
3968
3969     /*!
3970      *  Sewing of the given object. Allows non-manifold sewing.
3971      *  \param theObjects Shapes to be processed.
3972      *  \param theTolerance Required tolerance value.
3973      *  \return New GEOM_Object, containing processed shape.
3974      */
3975     GEOM_Object SewAllowNonManifold(in ListOfGO theObjects, in double theTolerance);
3976
3977     /*!
3978      *  Rebuild the topology of theSolids by removing
3979      *  the faces that are shared by several solids.
3980      *  \param theSolids A list of shapes containing solids to be processed.
3981      *  \return New GEOM_Object, containing processed shape.
3982      */
3983     GEOM_Object RemoveInternalFaces (in ListOfGO theSolids);
3984
3985     /*!
3986      *  \brief Addition of a point to a given edge of \a theObject.
3987      *  \param theObject Shape to be processed.
3988      *  \param theEdgeIndex Index of edge to be divided within theObject's shape,
3989      *                      if -1, then theObject itself is the edge.
3990      *  \param theValue Value of parameter on edge or length parameter,
3991      *                  depending on \a isByParameter.
3992      *  \param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
3993      *                       if FALSE : \a theValue is treated as a length parameter [0..1]
3994      *  \return New GEOM_Object, containing the processed shape.
3995      */
3996     GEOM_Object DivideEdge (in GEOM_Object theObject, in short theEdgeIndex,
3997                             in double theValue, in boolean isByParameter);
3998
3999     /*!
4000      *  \brief Addition of points to a given edge of \a theObject by projecting
4001      *         other points to the given edge.
4002      *  \param theObject Shape to be processed.
4003      *  \param theEdgeIndex Index of edge to be divided within theObject's shape,
4004      *                      if -1, then theObject itself is the edge.
4005      *  \param thePoints Points to project to theEdgeIndex-th edge.
4006      *  \return New GEOM_Object, containing the processed shape.
4007      */
4008     GEOM_Object DivideEdgeByPoint (in GEOM_Object theObject,
4009                                    in short       theEdgeIndex,
4010                                    in ListOfGO    thePoints);
4011
4012     /*!
4013      *  \brief Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4014      *  \param theWire Wire to minimize the number of C1 continuous edges in.
4015      *  \param theVertices A list of vertices to suppress. If the list
4016      *                     is empty, all vertices in a wire will be assumed.
4017      *  \return New GEOM_Object with modified wire.
4018      */
4019     GEOM_Object FuseCollinearEdgesWithinWire (in GEOM_Object theWire,
4020                                               in ListOfGO theVertices);
4021
4022     /*!
4023      *  \brief Get a list of wires (wrapped in GEOM_Object-s),
4024      *  that constitute a free boundary of the given shapes.
4025      *  \param theObjects Shapes to get free boundary of.
4026      *  \param theClosedWires Output. Closed wires on the free boundary of the given shape.
4027      *  \param theOpenWires Output. Open wires on the free boundary of the given shape.
4028      *  \return FALSE, if an error(s) occured during the method execution.
4029      */
4030     boolean GetFreeBoundary (in  ListOfGO theObjects,
4031                              out ListOfGO theClosedWires,
4032                              out ListOfGO theOpenWires);
4033
4034     /*!
4035      *  \brief Change orientation of the given object.
4036      *  \param theObject Shape to be processed.
4037      *  \return New GEOM_Object, containing processed shape.
4038      */
4039     GEOM_Object ChangeOrientation (in GEOM_Object theObject);
4040     GEOM_Object ChangeOrientationCopy (in GEOM_Object theObject);
4041
4042     /*!
4043      *  \brief Try to limit tolerance of the given object by value \a theTolerance.
4044      *  \param theObject Shape to be processed.
4045      *  \param theTolerance Required tolerance value.
4046      *  \return New GEOM_Object, containing processed shape.
4047      */
4048     GEOM_Object LimitTolerance (in GEOM_Object theObject, in double theTolerance);
4049
4050
4051     /*!
4052      *  \brief Return information on what has been done by the last called healing method.
4053      *  \return ModifStatistics, information container.
4054      */
4055     ModifStatistics GetStatistics();
4056   };
4057
4058  // # GEOM_IInsertOperations:
4059   /*!
4060    *  \brief Interface for shape insert operations (like copy, import).
4061    *
4062    */
4063   interface GEOM_IInsertOperations : GEOM_IOperations
4064   {
4065     /*!
4066      *  \brief Create a copy of the given object
4067      */
4068     GEOM_Object MakeCopy (in GEOM_Object theOriginal);
4069
4070     /*!
4071      *  \brief Deprecated method. Use Export\<FormatName\> (from the
4072      *  corresponding plugin) instead; here \<FormatName\> is a name of format.
4073      *
4074      *  \brief Export the given shape into a file with given name.
4075      *  \param theObject Shape to be stored in the file.
4076      *  \param theFileName Name of the file to store the given shape in.
4077      *  \param theFormatName Specify format for the shape storage.
4078      */
4079     void Export (in GEOM_Object theObject, in string theFileName, in string theFormatName);
4080
4081     /*!
4082      *  \brief Deprecated method. Use Import\<FormatName\> (from the
4083      *  corresponding plugin) instead; here \<FormatName\> is a name of format.
4084      *
4085      *  \brief Import a shape from the STL, BREP, IGES or STEP file
4086      *  (depends on given format) with given name.
4087      *  \param theFileName The file, containing the shape.
4088      *  \param theFormatName Specify format for the file reading.
4089      *         If format 'IGES_SCALE' is used instead of 'IGES' or
4090      *            format 'STEP_SCALE' is used instead of 'STEP',
4091      *            file length unit will be ignored (set to 'meter') and result model will be scaled.
4092      *  \return List of GEOM_Object, containing the created shape and groups of materials.
4093      */
4094     ListOfGBO ImportFile (in string theFileName, in string theFormatName);
4095
4096     /*!
4097      *  \brief Deprecated method. Use ReadValue (from the corresponding plugin) instead.
4098      *
4099      *  \brief Read a value of parameter from a file, containing a shape.
4100      *  \param theFileName The file, containing the shape.
4101      *  \param theFormatName Specify format for the file reading.
4102      *  \param theParameterName Specify the parameter. For example, pass "LEN_UNITS"
4103      *                          to obtain length units, in which the file is written.
4104      *  \return Value of requested parameter in form of text string.
4105      */
4106     string ReadValue (in string theFileName, in string theFormatName, in string theParameterName);
4107
4108     /*!
4109      *  \brief Read a shape from the binary stream, containing its bounding representation (BRep).
4110      *  \note GEOM_Object::GetShapeStream() method can be used to obtain the shape's BRep stream.
4111      *  \param theStream The BRep binary stream.
4112      *  \return New GEOM_Object, containing the shape, read from theStream.
4113      */
4114     GEOM_Object RestoreShape (in SALOMEDS::TMPFile theStream);
4115
4116     /*!
4117      * \brief Load texture from file
4118      * \param theTextureFile texture file name
4119      * \return unique texture identifier
4120      */
4121     long LoadTexture(in string theTextureFile);
4122
4123     /*!
4124      * \brief Add texture to the study
4125      * \param theWidth texture width in pixels
4126      * \param theHeight texture height in pixels
4127      * \param theTexture texture byte array
4128      * \return unique texture identifier
4129      */
4130     long AddTexture(in long theWidth, in long theHeight, in SALOMEDS::TMPFile theTexture);
4131
4132     /*!
4133      * \brief Get previously loaded texture data
4134      * \param theID texture identifier
4135      * \param theWidth texture width in pixels
4136      * \param theHeight texture height in pixels
4137      * \return texture byte array
4138      */
4139     SALOMEDS::TMPFile GetTexture(in long theID, out long theWidth, out long theHeight);
4140
4141     /*!
4142      * \brief Get list of all avaiable texture IDs
4143      * \return list of all texture IDs avaiable for the current study
4144      */
4145     ListOfLong GetAllTextures();
4146
4147     /*!
4148      *  \brief Non-topological information transfer datum.
4149      */
4150     struct TransferDatum
4151     {
4152       string myName;
4153       long   myNumber;
4154       long   myMaxNumber;
4155     };
4156
4157     /*!
4158      *  \brief Sequence of non-topological information tranfer data.
4159      */
4160     typedef sequence<TransferDatum> ListOfTransferDatum;
4161
4162     /*!
4163      *  \brief Transfer non-topological data from one object to another
4164      *  \param theObjectFrom the source object of non-topological data
4165      *  \param theObjectTo the destination object of non-topological data
4166      *  \param theFindMethod method to search sub-shapes of theObjectFrom
4167      *         in shape theObjectTo. Possible values are: GEOM::FSM_GetInPlace,
4168      *         GEOM::FSM_GetInPlaceByHistory and GEOM::FSM_GetInPlace_Old.
4169      *         Other values of GEOM::find_shape_method are not supported.
4170      *  \param theResult statistics of the operation. Output parameter. It
4171      *         represents a sequence of Transfer Datum. A datum has the type
4172      *         (string code), the total number of items of this type and
4173      *         the number of transfered items.
4174      *  \return true in case of success; otherwise false.
4175      */
4176     boolean TransferData(in  GEOM_Object         theObjectFrom,
4177                          in  GEOM_Object         theObjectTo,
4178                          in  find_shape_method   theFindMethod,
4179                          out ListOfTransferDatum theResult);
4180
4181   };
4182
4183  // # GEOM_IKindOfShape:
4184   /*!
4185    *  \brief Interface for shape_kind enumeration.
4186    */
4187   interface GEOM_IKindOfShape
4188   {
4189     enum shape_kind {
4190       NO_SHAPE,
4191       //COMPOSITEs
4192       COMPOUND,
4193       COMPSOLID,
4194       SHELL,
4195       WIRE,
4196       // SOLIDs
4197       /*! full sphere */
4198       SPHERE,
4199       /*! cylinder */
4200       CYLINDER,
4201       /*! box with faces, parallel to global coordinate planes */
4202       BOX,
4203       /*! other box */
4204       ROTATED_BOX, 
4205       /*! full torus */
4206       TORUS,   
4207       /*! cone */  
4208       CONE,   
4209       /*! solid, bounded by polygons */
4210       POLYHEDRON,  
4211       /*! other solid */
4212       SOLID,       
4213       // FACEs
4214       /*! spherical face (closed) */
4215       SPHERE2D,    
4216       /*! cylindrical face with defined height */
4217       CYLINDER2D,
4218       /*! toroidal face (closed) */
4219       TORUS2D,     
4220       /*! conical face with defined height */
4221       CONE2D,
4222       /*! planar, bounded by circle */
4223       DISK_CIRCLE,
4224       /*! planar, bounded by ellipse */
4225       DISK_ELLIPSE,
4226       /*! planar, bounded by segments */
4227       POLYGON,     
4228       /*! infinite planar */
4229       PLANE,        
4230        /*! other planar */
4231       PLANAR,      
4232       /*! other face */
4233       FACE,      
4234       // EDGEs
4235       /*! full circle */
4236       CIRCLE,      
4237       /*! arc of circle */
4238       ARC_CIRCLE, 
4239       /*! full ellipse */
4240       ELLIPSE,    
4241       /*! arc of ellipse */
4242       ARC_ELLIPSE,  
4243       /*! infinite segment */
4244       LINE,         
4245       /*! segment */
4246       SEGMENT,      
4247       /*! other edge */
4248       EDGE,       
4249       // VERTEX
4250       VERTEX,
4251       // ADVANCED shapes
4252       LCS,
4253       /*! all advanced shapes (temporary implementation) */
4254       ADVANCED    
4255     };
4256   };
4257
4258  // # GEOM_IMeasureOperations:
4259   /*!
4260    *  \brief Interface for measurement (distance, whatis) and
4261    *  properties calculation (like Centre of Mass, Inertia, etc.).
4262    *
4263    */
4264   interface GEOM_IMeasureOperations : GEOM_IOperations
4265   {
4266     /*!
4267      *  \brief Get kind of theShape.
4268      *  \param theShape Shape to get a kind of.
4269      *  \param theIntegers Output. Integer and enumerated shape's parameters
4270      *                     (kind of surface, closed/unclosed, number of edges, etc.)
4271      *  \param theDoubles  Output. Double shape's parameters (coordinates, dimensions, etc.)
4272      *  \note  Concrete meaning of each value, returned via \a theIntegers
4273      *         or \a theDoubles list depends on the kind of the shape.
4274      *  \return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration.
4275      */
4276     //short KindOfShape (in GEOM_Object   theShape,
4277     GEOM_IKindOfShape::shape_kind KindOfShape (in  GEOM_Object  theShape,
4278                                                out ListOfLong   theIntegers,
4279                                                out ListOfDouble theDoubles);
4280
4281     /*!
4282      *  \brief Get position (LCS) of theShape.
4283      *  \param theShape Shape to calculate position of.
4284      *  \param Ox,Oy,Oz Output. Coordinates of shape's location origin.
4285      *                  Origin of the LCS is situated at the shape's center of mass.
4286      *  \param Zx,Zy,Zz Output. Coordinates of shape's location normal(main) direction.
4287      *  \param Xx,Xy,Xz Output. Coordinates of shape's location X direction.
4288      *                  Axes of the LCS are obtained from shape's location or,
4289      *                  if the shape is a planar face, from position of its plane.
4290      *  \return Returns position of the shape through the last nine arguments.
4291      */
4292     void GetPosition (in GEOM_Object theShape,
4293                       out double Ox, out double Oy, out double Oz,
4294                       out double Zx, out double Zy, out double Zz,
4295                       out double Xx, out double Xy, out double Xz);
4296
4297     /*!
4298      *  \brief Get summarized length of all wires,
4299      *  area of surface and volume of the given shape.
4300      *  \param theShape Shape to define properties of.
4301      *  \param theLength Output. Summarized length of all wires of the given shape.
4302      *  \param theSurfArea Output. Area of surface of the given shape.
4303      *  \param theVolume Output. Volume of the given shape.
4304      *  \return Returns shape properties through the last three arguments.
4305      */
4306     void GetBasicProperties (in GEOM_Object theShape,
4307                              out double theLength,
4308                              out double theSurfArea,
4309                              out double theVolume);
4310
4311     /*!
4312      *  \brief Get a point, situated at the centre of mass of theShape.
4313      *  \param theShape Shape to define centre of mass of.
4314      *  \return New GEOM_Object, containing the created point.
4315      */
4316     GEOM_Object GetCentreOfMass (in GEOM_Object theShape);
4317
4318     /*
4319      *  Get the vertex by index for 1D objects depends the edge/wire orientation
4320      *  \param theShape Shape (wire or edge) to find the vertex on it
4321      *  \param theIndex Index of vertex sub-shape
4322      *  \return New GEOM_Object, vertex.
4323      */
4324     GEOM_Object GetVertexByIndex( in GEOM_Object theShape, in long index );
4325
4326     /*!
4327      *  \brief Get a vector, representing the normal of theFace.
4328      *  If the face is not planar, theOptionalPoint is obligatory.
4329      *  \param theFace Shape (face) to define the normal of.
4330      *  \param theOptionalPoint Shape (point) to define the normal at.
4331      *                          Can be NULL in case of planar face.
4332      *  \return New GEOM_Object, containing the created normal vector.
4333      */
4334     GEOM_Object GetNormal (in GEOM_Object theFace,
4335                            in GEOM_Object theOptionalPoint);
4336
4337     /*!
4338      *  \brief Get inertia matrix and moments of inertia of theShape.
4339      *  \param theShape Shape to calculate inertia of.
4340      *  \param I11,I12,I13,I21,I22,I23,I31,I32,I33 Output. Components of the inertia matrix of the given shape.
4341      *  \param Ix,Iy,Iz Output. Moments of inertia of the given shape.
4342      *  \return Returns inertia through the last twelve arguments.
4343      */
4344     void GetInertia (in GEOM_Object theShape,
4345                      out double I11, out double I12, out double I13,
4346                      out double I21, out double I22, out double I23,
4347                      out double I31, out double I32, out double I33,
4348                      out double Ix , out double Iy , out double Iz);
4349
4350     /*!
4351      *  \brief Get parameters of bounding box of the given shape
4352      *  \param theShape Shape to obtain bounding box of.
4353      *  \param precise TRUE for precise computation; FALSE for fast one.
4354      *  \param Xmin,Xmax Output. Limits of shape along OX axis.
4355      *  \param Ymin,Ymax Output. Limits of shape along OY axis.
4356      *  \param Zmin,Zmax Output. Limits of shape along OZ axis.
4357      *  \return Returns parameters of bounding box through the last six arguments.
4358      */
4359     void GetBoundingBox (in GEOM_Object theShape,
4360                          in boolean precise,
4361                          out double Xmin, out double Xmax,
4362                          out double Ymin, out double Ymax,
4363                          out double Zmin, out double Zmax);
4364
4365     /*!
4366      *  \brief Get bounding box of the given shape
4367      *  \param theShape Shape to obtain bounding box of.
4368      *  \param precise TRUE for precise computation; FALSE for fast one.
4369      *  \return New GEOM_Object, containing the created bounding box.
4370      */
4371     GEOM_Object MakeBoundingBox (in GEOM_Object theShape,
4372                                  in boolean precise);
4373
4374     /*!
4375      *  \brief Get min and max tolerances of sub-shapes of theShape
4376      *  \param theShape Shape, to get tolerances of.
4377      *  \param FaceMin,FaceMax Output. Min and max tolerances of the faces.
4378      *  \param EdgeMin,EdgeMax Output. Min and max tolerances of the edges.
4379      *  \param VertMin,VertMax Output. Min and max tolerances of the vertices.
4380      *  \return Returns shape tolerances through the last six arguments.
4381      */
4382     void GetTolerance (in GEOM_Object theShape,
4383                        out double FaceMin, out double FaceMax,
4384                        out double EdgeMin, out double EdgeMax,
4385                        out double VertMin, out double VertMax);
4386
4387     /*!
4388      *  \brief Enumeration of Shape defects coming from CheckShape algorithms.
4389      */
4390     enum ShapeErrorType
4391     {
4392       /* for vertices */
4393       InvalidPointOnCurve,
4394       InvalidPointOnCurveOnSurface,
4395       InvalidPointOnSurface,
4396
4397       /* for edges */
4398       No3DCurve,
4399       Multiple3DCurve,
4400       Invalid3DCurve,
4401       NoCurveOnSurface,
4402       InvalidCurveOnSurface,
4403       InvalidCurveOnClosedSurface,
4404       InvalidSameRangeFlag,
4405       InvalidSameParameterFlag,
4406       InvalidDegeneratedFlag,
4407
4408       FreeEdge,
4409       InvalidMultiConnexity,
4410       InvalidRange,
4411
4412       /* for wires */
4413       EmptyWire,
4414       RedundantEdge,
4415       SelfIntersectingWire, /* on a face */
4416
4417       /* for faces */
4418       NoSurface,
4419       InvalidWire,
4420       RedundantWire,
4421       IntersectingWires,
4422       InvalidImbricationOfWires,
4423
4424       /* for shells */
4425       EmptyShell,
4426       RedundantFace,
4427
4428       /* for shapes */
4429       UnorientableShape,
4430       NotClosed,
4431       NotConnected,
4432
4433       SubshapeNotInShape,
4434
4435       BadOrientation,
4436       BadOrientationOfSubshape,
4437
4438       InvalidToleranceValue,
4439
4440       /* for exception */
4441       CheckFail
4442     };
4443
4444     /*!
4445      *  \brief Description of a shape defect: type and incriminated sub-shapes.
4446      */
4447     struct ShapeError
4448     {
4449       ShapeErrorType error;
4450       ListOfLong     incriminated;
4451     };
4452
4453     /*!
4454      *  \brief Sequence of all shape defects.
4455      */
4456     typedef sequence<ShapeError> ShapeErrors;
4457
4458     /*!
4459      *  \brief Check a topology of the given shape.
4460      *  \param theShape Shape to check validity of.
4461      *  \param theErrors Structure, containing discovered errors and incriminated sub-shapes.
4462      *  \return TRUE, if the shape "seems to be valid" from the topological point of view.
4463      */
4464     boolean CheckShape (in GEOM_Object  theShape,
4465                         out ShapeErrors theErrors);
4466
4467     /*!
4468      *  \brief Check a topology and a geometry of the given shape.
4469      *  \param theShape Shape to check validity of.
4470      *  \param theErrors Structure, containing discovered errors and incriminated sub-shapes.
4471      *  \return TRUE, if the shape "seems to be valid".
4472      */
4473     boolean CheckShapeWithGeometry (in GEOM_Object  theShape,
4474                                     out ShapeErrors theErrors);
4475
4476     /*!
4477      *  \brief Convert sequence of shape errors, returned by
4478      *  <VAR>CheckShape()</VAR> or <VAR>CheckShapeWithGeometry()</VAR>, into string.
4479      *  \param theShape the invalid shape.
4480      *  \param theErrors The sequence of \a theShape errors.
4481      *  \return String, describing all the errors in form, suitable for printing.
4482      */
4483     string PrintShapeErrors (in GEOM_Object theShape,
4484                              in ShapeErrors theErrors);
4485
4486     /*!
4487      *  \brief Check a topology of the given shape on self-intersections presence.
4488      *  \param theShape Shape to check validity of.
4489      *  \param theCheckLevel the level of self-interference check.
4490      *  \param theIntersections Output. List of intersected sub-shapes IDs, it contains pairs of IDs.
4491      *  \return TRUE, if the shape does not have any self-intersections.
4492      */
4493     boolean CheckSelfIntersections (in GEOM_Object theShape,
4494                                     in long        theCheckLevel,
4495                                     out ListOfLong theIntersections);
4496
4497     /*!
4498      *  \brief Detect self-intersections of the given shape with algorithm based on mesh intersections.
4499      *  \param theShape Shape to check validity of.
4500      *  \param theDeflection Linear deflection coefficient that specifies quality of tesselation.
4501      *  \param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
4502      *                       - if \a theTolerance <= 0, algorithm detects intersections
4503      *                       - if \a theTolerance > 0, algorithm detects gaps
4504      *  \param theIntersections Output. List of intersected sub-shapes IDs, it contains pairs of IDs.
4505      *  \return TRUE, if the shape does not have any self-intersections.
4506      */
4507     boolean CheckSelfIntersectionsFast (in GEOM_Object theShape,
4508                                         in float       theDeflection,
4509                                         in double      theTolerance,
4510                                         out ListOfLong theIntersections);
4511
4512     /*!
4513      *  \brief Detect intersections of the given shapes with algorithm based on mesh intersections.
4514      *  \param theShape1 First source object
4515      *  \param theShape2 Second source object
4516      *  \param theTolerance Specifies a distance between shapes used for detecting gaps:
4517      *                       - if \a theTolerance <= 0, algorithm detects intersections
4518      *                       - if \a theTolerance > 0, algorithm detects gaps
4519      *  \param theDeflection Linear deflection coefficient that specifies quality of tesselation:
4520      *                       - if \a theDeflection <= 0, default deflection 0.001 is used
4521      *  \param theIntersections1 Output: contains list of sub-shapes IDs from 1st shape that localize intersection
4522      *  \param theIntersections2 Output: contains list of sub-shapes IDs from 2nd shape that localize intersection
4523      *  \return TRUE, if the are intersections (gaps) between source shapes
4524      */
4525     boolean FastIntersect (in GEOM_Object theShape1,
4526                            in GEOM_Object theShape2,
4527                            in double      theTolerance,
4528                            in float       theDeflection,
4529                            out ListOfLong theIntersections1,
4530                            out ListOfLong theIntersections2);
4531
4532     /*!
4533      *  \brief Check if the given shape can be an argument for MakeSolid operation
4534      *  \param theShape Shape to be described.
4535      *  \return Empty string if a solid can be made on this shape, error code otherwise.
4536      */
4537     string IsGoodForSolid (in GEOM_Object theShape);
4538
4539     /*!
4540      *  O\brief btain description of the given shape
4541      *  \param theShape Shape to be described.
4542      *  \return Description of the given shape.
4543      */
4544     string WhatIs (in GEOM_Object theShape);
4545
4546     /*!
4547      *  \brief Check if points defined by coords = [x1, y1, z1, x2, y2, z2, ...] are inside or on
4548      *  the shape theShape.
4549      *  \param theShape Shape to check.
4550      *  \param coords list of coordinates.
4551      *  \param tolerance tolerance.
4552      *  \return list of boolean.
4553      */
4554     ListOfBool AreCoordsInside(in GEOM_Object theShape, in ListOfDouble coords, in double tolerance);
4555
4556     /*!
4557      *  \brief Get minimal distance between the given shapes.
4558      *  \param theShape1,theShape2 Shapes to find minimal distance between.
4559      *  \param X1,Y1,Z1 Output. Coordinates of point on theShape1, nearest to theShape2.
4560      *  \param X2,Y2,Z2 Output. Coordinates of point on theShape2, nearest to theShape1.
4561      *  \return Value of the minimal distance between the given shapes.
4562      */
4563     double GetMinDistance (in GEOM_Object theShape1, in GEOM_Object theShape2,
4564                            out double X1, out double Y1, out double Z1,
4565                            out double X2, out double Y2, out double Z2);
4566
4567     /*!
4568      *  \brief Get closest points of the given shapes.
4569      *  \param theShape1,theShape2 Shapes to find closest points of.
4570      *  \param theCoords Output. List of (X, Y, Z) coordinates for all couples of points.
4571      *  \return The number of found solutions (-1 in case of infinite number of solutions).
4572      */
4573     long ClosestPoints (in GEOM_Object theShape1,
4574                         in GEOM_Object theShape2,
4575                         out ListOfDouble theCoords);
4576
4577     /*!
4578      *  \brief Get angle between the given lines or linear edges.
4579      *  \param theShape1,theShape2 Shapes to find angle between. Lines or linear edges.
4580      *  \return Value of the angle between the given shapes.
4581      */
4582     double GetAngle (in GEOM_Object theShape1, in GEOM_Object theShape2);
4583
4584     /*!
4585      *  \brief Get angle between the given vectors.
4586      *  \param theShape1,theShape2 Vectors to find angle between.
4587      *  \return Value of the angle between the given vectors.
4588      */
4589     double GetAngleBtwVectors (in GEOM_Object theShape1, in GEOM_Object theShape2);
4590
4591     /*!
4592      *  \brief Get point coordinates
4593      */
4594     void PointCoordinates (in GEOM_Object theShape, out double X, out double Y, out double Z);
4595
4596     /*!
4597      *  \brief Get radius of curvature of curve in the point determinated by param
4598      *  \param theShape - curve.
4599      *  \param theParam - parameter on curve
4600      *  \return Value of curvature.
4601      */
4602     double CurveCurvatureByParam (in GEOM_Object theShape, in double theParam);
4603
4604     /*!
4605      *  \brief Get radius of curvature of curve in the given point
4606      *  \param theShape - curve.
4607      *  \param thePoint - point
4608      *  \return Value of curvature.
4609      */
4610     double CurveCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
4611
4612     /*!
4613      *  \brief Get max radius of curvature of surface in the point determinated by params
4614      *  \param theShape - surface.
4615      *  \param theUParam - U-parameter on surface
4616      *  \param theVParam - V-parameter on surface
4617      *  \return Value of curvature.
4618      */
4619     double MaxSurfaceCurvatureByParam (in GEOM_Object theShape, in double theUParam,
4620                                        in double theVParam);
4621
4622     /*!
4623      *  \brief Get max radius of curvature of surface in the given point
4624      *  \param theShape - surface.
4625      *  \param thePoint - point
4626      *  \return Value of curvature.
4627      */
4628     double MaxSurfaceCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
4629
4630     /*!
4631      *  \brief Get min radius of curvature of surface in the point determinated by params
4632      *  \param theShape - surface.
4633      *  \param theUParam - U-parameter on surface
4634      *  \param theVParam - V-parameter on surface
4635      *  \return Value of curvature.
4636      */
4637     double MinSurfaceCurvatureByParam (in GEOM_Object theShape, in double theUParam,
4638                                        in double theVParam);
4639
4640     /*!
4641      *  \brief Get min radius of curvature of surface in the given point
4642      *  \param theShape - surface.
4643      *  \param thePoint - point
4644      *  \return Value of curvature.
4645      */
4646     double MinSurfaceCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
4647
4648   };
4649
4650  // # GEOM_IGroupOperations:
4651   /*!
4652    *  \brief Interface for groups creation.
4653    */
4654   interface GEOM_IGroupOperations : GEOM_IOperations
4655   {
4656     /*!
4657      *  \brief Creates a new group which will store  sub-shapes of theMainShape
4658      *  \param theMainShape is a GEOM_Object on which the group is selected
4659      *  \param theShapeType defines a shape type of the group
4660      *  \return a newly created GEOM group
4661      */
4662     GEOM_Object CreateGroup (in GEOM_Object theMainShape, in long theShapeType);
4663
4664     /*!
4665      *  \brief Adds a sub-object with ID theSubShapeId to the group
4666      *  \param theGroup is a GEOM group to which the new sub-shape is added
4667      *  \param theSubShapeId is a sub-shape ID in the main object.
4668      *  \note Use method <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR> to get an ID by the sub-shape
4669      */
4670     void AddObject (in GEOM_Object theGroup, in long theSubShapeId);
4671
4672     /*!
4673      *  \brief Removes a sub-object with ID \a theSubShapeId from the group
4674      *  \param theGroup is a GEOM group from which the sub-shape is removed.
4675      *  \param theSubShapeId is a sub-shape ID in the main object.
4676      *  \note Use method <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR> to get an ID by the sub-shape
4677      */
4678     void RemoveObject (in GEOM_Object theGroup, in long theSubShapeId);
4679
4680     /*!
4681      *  \brief Adds to the group all the given shapes. No errors, if some shapes are alredy included.
4682      *  \param theGroup is a GEOM group to which the new sub-shapes are added.
4683      *  \param theSubShapes is a list of sub-shapes to be added.
4684      */
4685     void UnionList (in GEOM_Object theGroup, in ListOfGO theSubShapes);
4686
4687     /*!
4688      *  \brief Removes from the group all the given shapes. No errors, if some shapes are not included.
4689      *  \param theGroup is a GEOM group from which the sub-shapes are removed.
4690      *  \param theSubShapes is a list of sub-shapes to be removed.
4691      */
4692     void DifferenceList (in GEOM_Object theGroup, in ListOfGO theSubShapes);
4693
4694     /*!
4695      *  \brief Adds to the group all the given shapes. No errors, if some shapes are alredy included.
4696      *  \param theGroup is a GEOM group to which the new sub-shapes are added.
4697      *  \param theSubShapes is a list of IDs of sub-shapes to be added.
4698      */
4699     void UnionIDs (in GEOM_Object theGroup, in ListOfLong theSubShapes);
4700
4701     /*!
4702      *  \brief Removes from the group all the given shapes. No errors, if some shapes are not included.
4703      *  \param theGroup is a GEOM group from which the sub-shapes are removed.
4704      *  \param theSubShapes is a list of IDs of sub-shapes to be removed.
4705      */
4706     void DifferenceIDs (in GEOM_Object theGroup, in ListOfLong theSubShapes);
4707
4708     /*!
4709      *  \brief Union of two groups.
4710      *  New group is created. It will contain all entities
4711      *  which are present in groups theGroup1 and theGroup2.
4712      *  \param theGroup1, theGroup2 are the initial GEOM groups
4713      *                              to create the united group from.
4714      *  \return a newly created GEOM group.
4715      */
4716     GEOM_Object UnionGroups (in GEOM_Object theGroup1, in GEOM_Object theGroup2);
4717
4718     /*!
4719      *  \brief Intersection of two groups.
4720      *  New group is created. It will contain only those entities
4721      *  which are present in both groups theGroup1 and theGroup2.
4722      *  \param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
4723      *  \return a newly created GEOM group.
4724      */
4725     GEOM_Object IntersectGroups (in GEOM_Object theGroup1, in GEOM_Object theGroup2);
4726
4727     /*!
4728      *  \brief Cut of two groups.
4729      *  New group is created. It will contain entities which are
4730      *  present in group theGroup1 but are not present in group theGroup2.
4731      *  \param theGroup1 is a GEOM group to include elements of.
4732      *  \param theGroup2 is a GEOM group to exclude elements of.
4733      *  \return a newly created GEOM group.
4734      */
4735     GEOM_Object CutGroups (in GEOM_Object theGroup1, in GEOM_Object theGroup2);
4736
4737     /*!
4738      *  \brief Union of list of groups.
4739      *  New group is created. It will contain all entities that are
4740      *  present in groups listed in theGList.
4741      *  \param theGList is a list of GEOM groups to create the united group from.
4742      *  \return a newly created GEOM group.
4743      */
4744     GEOM_Object UnionListOfGroups (in ListOfGO theGList);
4745
4746     /*!
4747      *  \brief Intersection of list of groups.
4748      *  New group is created. It will contain only entities
4749      *  which are simultaneously present in the groups listed in theGList.
4750      *  \param theGList is a list of GEOM groups to get common part of.
4751      *  \return a newly created GEOM group.
4752      */
4753     GEOM_Object IntersectListOfGroups (in ListOfGO theGList);
4754
4755     /*!
4756      *  \brief Cut of lists of groups.
4757      *  New group is created. It will contain only entities
4758      *  which are present in groups listed in theGList1 but 
4759      *  are not present in groups from theGList2.
4760      *  \param theGList1 is a list of GEOM groups to include elements of.
4761      *  \param theGList2 is a list of GEOM groups to exclude elements of.
4762      *  \return a newly created GEOM group.
4763      */
4764     GEOM_Object CutListOfGroups (in ListOfGO theGList1,
4765                                  in ListOfGO theGList2);
4766
4767     /*!
4768      *  \brief Returns a type of sub-objects stored in the group
4769      *  \param theGroup is a GEOM group which type is returned.
4770      */
4771     long GetType (in GEOM_Object theGroup);
4772
4773     /*!
4774      *  \brief Returns a main shape associated with the group
4775      *  \param theGroup is a GEOM group for which a main shape object is requested
4776      *  \return a GEOM_Object which is a main shape for theGroup
4777      */
4778     GEOM_Object GetMainShape (in GEOM_Object theGroup);
4779
4780     /*!
4781      *  \brief Returns a list of sub-objects ID stored in the group
4782      *  \param theGroup is a GEOM group for which a list of IDs is requested
4783      */
4784     ListOfLong GetObjects (in GEOM_Object theGroup);
4785   };
4786
4787   // # GEOM_IFieldOperations:
4788   /*!
4789    *  \brief Interface for field operation.
4790    */
4791   interface GEOM_IFieldOperations : GEOM_IOperations
4792   {
4793     /*!
4794      *  \brief Creates a field
4795      */
4796     GEOM_Field CreateField(in GEOM_Object     shape, 
4797                            in string          name,
4798                            in field_data_type type,
4799                            in short           dimension,
4800                            in string_array    componentNames);
4801     /*!
4802      *  \brief Returns number of fields on a shape
4803      */
4804     long CountFields(in GEOM_Object shape);
4805
4806     /*!
4807      *  \brief Returns all fields on a shape
4808      */
4809     ListOfFields GetFields(in GEOM_Object shape);
4810
4811     /*!
4812      *  \brief Returns a field on a shape by its name
4813      */
4814     GEOM_Field GetField(in GEOM_Object shape, in string name);
4815
4816     /*!
4817      *  \brief Returns number of sub-shapes of given dimension
4818      */
4819     long GetNbSubShapes(in GEOM_Object shape, in short fieldDim);
4820   };
4821
4822  // # GEOM_Gen:
4823   /*!
4824    *  \brief Interface to access other GEOM interfaces.
4825    *
4826    *  Also contains some methods to access and manage GEOM_Object.
4827    */
4828   interface GEOM_Gen : Engines::EngineComponent,SALOMEDS::Driver
4829   {
4830     /*!
4831      *  \brief Undo/Redo Management
4832      */
4833
4834     void Undo (in long theStudyID);
4835
4836     void Redo (in long theStudyID);
4837
4838     /*!
4839      * \brief Publishing management
4840      *
4841      * Adds in theStudy a object theObject under with a name theName,
4842      * if theFather is not NULL the object is placed under thFather's SObject.
4843      * Returns a SObject where theObject is placed
4844      */
4845     SALOMEDS::SObject AddInStudy (in SALOMEDS::Study theStudy,
4846                                   in GEOM_BaseObject theObject,
4847                                   in string          theName,
4848                                   in GEOM_BaseObject theFather);
4849
4850     /*!
4851      *  \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments
4852      *
4853      *  To be used from python scripts out of geompy.addToStudy (non-default usage)
4854      *  \param theStudy  the study, in which theObject is published already,
4855      *                   and in which the arguments will be published
4856      *  \param theObject published GEOM_Object, arguments of which will be published
4857      *  \param theArgs   list of GEOM_Object, operation arguments to be published.
4858      *                   If this list is empty, all operation arguments will be published
4859      *  \param theFindMethod method to search sub-shapes, corresponding to arguments and
4860      *                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
4861      *  \param theInheritFirstArg set properties of the first argument for \a theObject.
4862      *                            Do not publish sub-shapes in place of arguments, but only
4863      *                            in place of sub-shapes of the first argument,
4864      *                            because the whole shape corresponds to the first argument.
4865      *                            Mainly to be used after transformations, but it also can be
4866      *                            usefull after partition with one object shape, and some other
4867      *                            operations, where only the first argument has to be considered.
4868      *                            If theObject has only one argument shape, this flag is automatically
4869      *                            considered as True, not regarding really passed value.
4870      *  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
4871      *                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
4872      *  \return list of published sub-shapes
4873      */
4874     ListOfGO RestoreSubShapesO (in SALOMEDS::Study   theStudy,
4875                                 in GEOM_Object       theObject,
4876                                 in ListOfGO          theArgs,
4877                                 in find_shape_method theFindMethod,
4878                                 in boolean           theInheritFirstArg,
4879                                 in boolean           theAddPrefix);
4880
4881     /*!
4882      *  \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments
4883      *
4884      *  To be used from python scripts out of geompy.addToStudy (non-default usage)
4885      *  \param theStudy  the study, in which theObject is published already,
4886      *                   and in which the arguments will be published
4887      *  \param theObject published GEOM_Object, arguments of which will be published
4888      *  \param theArgs   list of GEOM_Object, operation arguments to be published.
4889      *                   If this list is empty, all operation arguments will be published
4890      *  \param theFindMethod method to search sub-shapes, corresponding to arguments and
4891      *                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
4892      *  \param theInheritFirstArg set properties of the first argument for \a theObject.
4893      *                            Do not publish sub-shapes in place of arguments, but only
4894      *                            in place of sub-shapes of the first argument,
4895      *                            because the whole shape corresponds to the first argument.
4896      *                            Mainly to be used after transformations, but it also can be
4897      *                            usefull after partition with one object shape, and some other
4898      *                            operations, where only the first argument has to be considered.
4899      *                            If theObject has only one argument shape, this flag is automatically
4900      *                            considered as True, not regarding really passed value.
4901      *  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
4902      *                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
4903      *  \return list of published sub-shapes
4904      */
4905     ListOfGO RestoreGivenSubShapesO (in SALOMEDS::Study   theStudy,
4906                                      in GEOM_Object       theObject,
4907                                      in ListOfGO          theArgs,
4908                                      in find_shape_method theFindMethod,
4909                                      in boolean           theInheritFirstArg,
4910                                      in boolean           theAddPrefix);
4911
4912     /*!
4913      *  \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments
4914      *
4915      *  To be used from GUI and from geompy.addToStudy.
4916      *  Work like the above method, but accepts study object theSObject instead of GEOM_Object.
4917      *  \param theStudy  the study, in which theObject is published already,
4918      *                   and in which the arguments will be published
4919      *  \param theSObject study object, referencing GEOM_Object, arguments of which will be published
4920      *  \param theArgs   list of GEOM_Object, operation arguments to be published.
4921      *                   If this list is empty, all operation arguments will be published
4922      *  \param theFindMethod method to search sub-shapes, corresponding to arguments and
4923      *                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
4924      *  \param theInheritFirstArg set properties of the first argument for \a theObject.
4925      *                            Do not publish sub-shapes in place of arguments, but only
4926      *                            in place of sub-shapes of the first argument,
4927      *                            because the whole shape corresponds to the first argument.
4928      *                            Mainly to be used after transformations, but it also can be
4929      *                            usefull after partition with one object shape, and some other
4930      *                            operations, where only the first argument has to be considered.
4931      *                            If theObject has only one argument shape, this flag is automatically
4932      *                            considered as True, not regarding really passed value.
4933      *  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
4934      *                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
4935      */
4936     ListOfGO RestoreSubShapesSO (in SALOMEDS::Study   theStudy,
4937                                  in SALOMEDS::SObject theSObject,
4938                                  in ListOfGO          theArgs,
4939                                  in find_shape_method theFindMethod,
4940                                  in boolean           theInheritFirstArg,
4941                                  in boolean           theAddPrefix);
4942
4943     // #  Methods to access interfaces for objects creation and transformation
4944
4945     GEOM_IBasicOperations     GetIBasicOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
4946     GEOM_ITransformOperations GetITransformOperations(in long theStudyID) raises (SALOME::SALOME_Exception);
4947     GEOM_I3DPrimOperations    GetI3DPrimOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4948     GEOM_IShapesOperations    GetIShapesOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4949     GEOM_IBooleanOperations   GetIBooleanOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
4950     GEOM_ICurvesOperations    GetICurvesOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4951     GEOM_ILocalOperations     GetILocalOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
4952     GEOM_IHealingOperations   GetIHealingOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
4953     GEOM_IInsertOperations    GetIInsertOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4954     GEOM_IMeasureOperations   GetIMeasureOperations  (in long theStudyID) raises (SALOME::SALOME_Exception);
4955     GEOM_IBlocksOperations    GetIBlocksOperations   (in long theStudyID) raises (SALOME::SALOME_Exception);
4956     GEOM_IGroupOperations     GetIGroupOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
4957     GEOM_IFieldOperations     GetIFieldOperations    (in long theStudyID) raises (SALOME::SALOME_Exception);
4958
4959     GEOM_IOperations GetPluginOperations (in long   theStudyID,
4960                                           in string theLibName) raises (SALOME::SALOME_Exception);
4961
4962     // # Objects Management
4963
4964
4965     /*!
4966      *  \brief Removes the object from the GEOM component
4967      *  \param theObject is a GEOM_Object to be removed
4968      */
4969     void RemoveObject (in GEOM_BaseObject theObject);
4970
4971     /*!
4972      *  \brief Returns an object defined by the study and its entry in the GEOM component
4973      *  \param theStudyID is a SALOMEDS Study ID
4974      *  \param theEntry is an entry of the requested GEOM_Object in the GEOM component
4975      *  \note if the object has not previously been created a NULL GEOM_Object is returned
4976      */
4977     GEOM_BaseObject GetObject (in long theStudyID, in string theEntry);
4978
4979     /*!
4980      *  \brief Add a sub-shape defined by indices in \a theIndices
4981      *  (contains unique IDs of sub-shapes inside \a theMainShape)
4982      *  \note The sub-shape GEOM_Object can has ONLY ONE function.
4983      *        Don't try to apply modification operations on them.
4984      *  \note Internal method
4985      */
4986     GEOM_Object AddSubShape (in GEOM_Object theMainShape, in ListOfLong theIndices);
4987
4988  // #  GEOM_Objects IOR Management
4989     
4990     /*!
4991      *  \brief Returns a GEOM_Object defined by its IOR
4992      *  \param theIOR a string containg an IOR of the requested GEOM_Object
4993      */
4994     GEOM_Object GetIORFromString (in string theIOR);
4995
4996     /*!
4997      *  \brief Returns a string which contains an IOR of the GEOM_Object
4998      *  \param theObject is a GEOM_Object which IOR is requested
4999      */
5000     string GetStringFromIOR (in GEOM_Object theObject);
5001
5002     /*!
5003      *  \brief Returns a name with which a GEOM_Object was dumped into python script
5004      *  \param theStudyEntry is an entry of the GEOM_Object in the study
5005      */
5006     string GetDumpName (in string theStudyEntry);
5007
5008     /*!
5009      *  \brief Returns all names with which a GEOM_Object was dumped
5010      *  into python script to avoid the same names in SMESH script
5011      */
5012     string_array GetAllDumpNames();
5013
5014     /*!
5015      *  \brief Publishes the named sub-shapes of given object in the study.
5016      *  \param theStudy    The study in which the object is published
5017      *  \param theObject   The object which named sub-shapes are published
5018      */
5019     ListOfGO PublishNamedShapesInStudy(in SALOMEDS::Study theStudy,
5020                                        //in SObject theSObject,
5021                                        in Object theObject);
5022
5023     /*!
5024      * \brief Creates a new folder
5025      *
5026      * Creates a new container (folder) for any GEOM objects.
5027      * Folder will have name theName.
5028      * If theFather is not NULL, the folder is placed under theFather object.
5029      * Otherwise, the folder takes place under root 'Geometry' object.
5030      * 
5031      * \param theName name of the folder
5032      * \param theFather parent object
5033      * \return SObject represented the created folder.
5034      */
5035     SALOMEDS::SObject CreateFolder (in string theName,
5036                                     in SALOMEDS::SObject theFather);
5037
5038     /*!
5039      * \brief Moves object to the specified folder
5040      *
5041      * The moved object should be first published in the study.
5042      * \param theObject GEOM object to move
5043      * \param theFolder target folder
5044      */
5045     void MoveToFolder (in GEOM_Object theObject,
5046                        in SALOMEDS::SObject theFolder);
5047
5048     /*!
5049      * \brief Moves list of objects to the specified folder
5050      *
5051      * The moved objects should be first published in the study.
5052      * \param theListOfGO list of GEOM objects to move
5053      * \param theFolder target folder
5054      */
5055     void MoveListToFolder (in ListOfGO theListOfGO,
5056                            in SALOMEDS::SObject theFolder);
5057
5058     /*!
5059      * \brief Moves objects to the specified position
5060      *
5061      * This function is used in the drag-n-drop functionality.
5062      *
5063      * \param what objects being moved
5064      * \param where parent object where objects are moved to
5065      * \param row position in the parent object's children list at which objects are moved
5066      */
5067     void Move( in object_list what, 
5068                in SALOMEDS::SObject where, 
5069                in long row );
5070
5071     /*!
5072      * \brief Collects dependencies of the given objects from other ones
5073      * \param theStudy The study in which the object is published
5074      * \param theListOfEntries List of GEOM object entries in OCAF tree (not in study)
5075      * \return Struct of dependent entries and its links as a byte array
5076      * \note This method is supposed to be used by GUI only.
5077      */
5078     SALOMEDS::TMPFile GetDependencyTree(in SALOMEDS::Study theStudy,
5079                                         in string_array theListOfEntries);
5080
5081     /*!
5082      * \brief Fills 3 lists that is used to reduce study of redundant objects:
5083      *  - dependencies of the given objects from other ones;
5084      *  - children of the given objects;
5085      *  - all other objects in study.
5086      * \param theStudy The study in which the object was published
5087      * \param theSelectedEntries List of GEOM object entries in OCAF tree
5088      * \param theParentEntries List of GEOM object entries on which the given objects depend
5089      * \param theSubEntries Children entries list of the given objects
5090      * \param theOtherEntries List of GEOM object entries which are in the study, but not in parents and children lists
5091      * \note This method is supposed to be used by GUI only.
5092      */
5093     void GetEntriesToReduceStudy(in SALOMEDS::Study theStudy,
5094                                  inout string_array theSelectedEntries,
5095                                  inout string_array theParentEntries,
5096                                  inout string_array theSubEntries,
5097                                  inout string_array theOtherEntries);
5098
5099   };
5100 };
5101
5102 #endif