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