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