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