Salome HOME
Changing version to 6.3.1
[modules/geom.git] / idl / GEOM_Gen.idl
index 21ed9b2f8f55a4d19ee061a42c0ba78a537963d0..febb9b324b3f4166c098ade03e9d40c4f44f8e13 100644 (file)
@@ -1,23 +1,23 @@
-//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : GEOM_Gen.idl
 //  Author : Sergey RUIN
@@ -135,9 +135,25 @@ module GEOM
     FOM_AutoCorrect
   };
 
+  /*!
+   * Kind of the curves.
+   * Used in the function GEOM_Gen.MakeCurveParametric()
+   */
+  enum curve_type {
+    /*! Polyline curve */
+    Polyline,
+    
+    /*! Bezier curve */
+    Bezier,
+
+    /*! Interpolation, curve */
+    Interpolation
+  };
+
 
   typedef sequence<string>      string_array;
   typedef sequence<short>       short_array;
+  typedef sequence<boolean>     ListOfBool;
   typedef sequence<long>        ListOfLong;
   typedef sequence<double>      ListOfDouble;
 
@@ -197,7 +213,7 @@ module GEOM
      *  \sa GetShapeType(), GetTopologyType(), GetMinShapeType()
      */
     shape_type GetMaxShapeType();
-    
+
     /*!
      *  Set name of the object.
      *  \param theName is a name which will be associated with this object.
@@ -325,6 +341,12 @@ module GEOM
      */
      boolean IsShape();
 
+    /*
+     *  Return true if passed object is identical to this object
+     *  \param other object being compared with this one
+     */
+    boolean IsSame(in GEOM_Object other);
+
      /*!
      *  Set list of parameters
      *  \param theParameters is a string containing the notebook variables separated by ":" symbol,
@@ -421,13 +443,15 @@ module GEOM
     /*!
      *  Create a point, corresponding to the given length on the given curve.
      *  \param theRefCurve The referenced curve.
-     *  \param theLength Length on the referenced curve.
-     *  \param theReverse Direction for the calculation of the length (false = forward or true = reversed).
+     *  \param theLength Length on the referenced curve. It can be negative.
+     *  \param theStartPoint Any vertex close to one of edge's
+     *                       ends to select start point among them.
+     *                       If NULL, fist vertex is used.
      *  \return New GEOM_Object, containing the created point.
      */
     GEOM_Object MakePointOnCurveByLength (in GEOM_Object theRefCurve,
-                                          in double theLength,
-                                          in boolean theReverse);
+                                          in double      theLength,
+                                          in GEOM_Object theStartPoint);
 
     /*!
      *  Create a point on the given curve, projecting given point
@@ -612,7 +636,8 @@ module GEOM
      *  \param theYVec Vector of Y direction.
      *  \return New GEOM_Object, containing the created coordinate system.
      */
-    GEOM_Object MakeMarkerPntTwoVec (in GEOM_Object theOrigin, in GEOM_Object theXVec, in GEOM_Object theYVec);
+    GEOM_Object MakeMarkerPntTwoVec (in GEOM_Object theOrigin,
+                                     in GEOM_Object theXVec, in GEOM_Object theYVec);
 
     /*!
      *  Create a tangent plane to specified face in the point with specified parameters.
@@ -896,6 +921,14 @@ module GEOM
      */
     GEOM_Object OffsetShapeCopy (in GEOM_Object theObject, in double theOffset);
 
+    /*!
+     *  Create new object as projection of the given one on a 2D surface.
+     *  \param theSource The source object for the projection. It can be a point, edge or wire.
+     *  \param theTarget The target object. It can be planar or cylindrical face.
+     *  \return New GEOM_Object, containing the projection.
+     */
+    GEOM_Object ProjectShapeCopy (in GEOM_Object theSource, in GEOM_Object theTarget);
+
     /*!
      *  Scale the given object by the factor.
      *  \param theObject The object to be scaled.
@@ -978,9 +1011,9 @@ module GEOM
      *  Modify the Location of the given object by Path,
      *  \param  theObject The object to be displaced.
      *  \param  thePath Wire or Edge along that the object will be translated.
-     *        \param  theDistance progress of Path (0 = actual location, 1 = end of path location).
-     *        \param  theCopy is a true or false parameter. true is to create a copy, false to move the object.
-     *        \param  theCopy is a true or false parameter. true is to reverse direction, false is to move normal direction.
+     *  \param  theDistance progress of Path (0 = actual location, 1 = end of path location).
+     *  \param  theCopy is a true or false parameter. true is to create a copy, false to move the object.
+     *  \param  theCopy is a true or false parameter. true is to reverse direction, false is to move normal direction.
      *  \return New GEOM_Object, containing the displaced shape.
      */
     GEOM_Object PositionAlongPath (in GEOM_Object theObject,
@@ -1188,6 +1221,11 @@ module GEOM
     GEOM_Object MakePrismVecH2Ways (in GEOM_Object theBase,
                                     in GEOM_Object theVec,
                                     in double      theH);
+    /*  The Same as MakePrismVecH but with scaling */
+    GEOM_Object MakePrismVecHWithScaling (in GEOM_Object theBase,
+                                          in GEOM_Object theVec,
+                                          in double      theH,
+                                          in double      theScaleFactor);
 
     /*!
      *  Create a shape by extrusion of the base shape along a vector, defined by two points.
@@ -1203,6 +1241,11 @@ module GEOM
     GEOM_Object MakePrismTwoPnt2Ways (in GEOM_Object theBase,
                                       in GEOM_Object thePoint1,
                                       in GEOM_Object thePoint2);
+    /*  The Same as MakePrismTwoPnt but with scaling */
+    GEOM_Object MakePrismTwoPntWithScaling (in GEOM_Object theBase,
+                                            in GEOM_Object thePoint1,
+                                            in GEOM_Object thePoint2,
+                                            in double      theScaleFactor);
 
     /*!
      *  Create a shape by extrusion of the base shape along a vector, defined by DX DY DZ.
@@ -1215,6 +1258,10 @@ module GEOM
     /*  The same prism but in two directions forward&backward */
     GEOM_Object MakePrismDXDYDZ2Ways (in GEOM_Object theBase,
                                       in double theDX, in double theDY, in double theDZ);
+    /*  The Same as MakePrismDXDYDZ but with scaling */
+    GEOM_Object MakePrismDXDYDZWithScaling (in GEOM_Object theBase,
+                                            in double theDX, in double theDY, in double theDZ,
+                                            in double theScaleFactor);
 
     /*!
      *  Create a shape by extrusion of the base shape along
@@ -1357,6 +1404,20 @@ module GEOM
      */
     GEOM_Object MakeEdge (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
 
+    /*!
+     *  Create an edge on another edge, corresponding to the given length on the given edge.
+     *  \param theRefCurve The referenced edge.
+     *  \param theLength Length on the referenced edge. It can be
+     *                   negative for extrapolation on base curve.
+     *  \param theStartPoint Any vertex close to one of edge's
+     *                       ends to select start point among them.
+     *                       If NULL, fist vertex is used.
+     *  \return New GEOM_Object, containing the created edge.
+     */
+    GEOM_Object MakeEdgeOnCurveByLength (in GEOM_Object theRefCurve,
+                                         in double      theLength,
+                                         in GEOM_Object theStartPoint);
+
     /*!
      *  Create an edge from specified wire.
      *  \param theWire source Wire.
@@ -1365,8 +1426,8 @@ module GEOM
      *  \return New GEOM_Object, containing the created edge.
      */
     GEOM_Object MakeEdgeWire (in GEOM_Object theWire,
-                             in double theLinearTolerance, 
-                             in double theAngularTolerance);
+                              in double theLinearTolerance,
+                              in double theAngularTolerance);
 
     /*!
      *  Create a wire from the set of edges and wires.
@@ -1448,10 +1509,42 @@ module GEOM
      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
      *  \param theFaces List of faces for gluing.
      *  \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
+     *  \param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
+     *                        will be glued, otherwise only the edges,
+     *                        belonging to <VAR>theFaces</VAR>.
      *  \return New GEOM_Object, containing a copy of theShape without some faces.
      */
     GEOM_Object MakeGlueFacesByList (in GEOM_Object theShape, in double theTolerance,
-                                     in ListOfGO theFaces, in boolean doKeepNonSolids);
+                                     in ListOfGO theFaces, in boolean doKeepNonSolids,
+                                     in boolean doGlueAllEdges);
+
+    /*!
+     *  Replace coincident edges in theShape by one edge.
+     *  \param theShape Initial shape.
+     *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
+     *  \return New GEOM_Object, containing a copy of theShape without coincident edges.
+     */
+    GEOM_Object MakeGlueEdges (in GEOM_Object theShape, in double theTolerance);
+
+    /*!
+     *  Find coincident edges in theShape for possible gluing.
+     *  \param theShape Initial shape.
+     *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
+     *  \return ListOfGO
+     */
+    ListOfGO GetGlueEdges (in GEOM_Object theShape, in double theTolerance);
+
+    /*!
+     *  Replace coincident edges in theShape by one edge
+     *  in compliance with given list of edges
+     *  \param theShape Initial shape.
+     *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
+     *  \param theFaces List of edges for gluing.
+     *  \return New GEOM_Object, containing a copy of theShape without some edges.
+     */
+    GEOM_Object MakeGlueEdgesByList (in GEOM_Object theShape,
+                                     in double theTolerance,
+                                     in ListOfGO theEdges);
 
     /*!
      *  Get all sub-shapes and groups of \a theShape,
@@ -1468,11 +1561,12 @@ module GEOM
      *  Deprecated method. Use MakeAllSubShapes() instead.
      */
     ListOfGO MakeExplode (in GEOM_Object theShape,
-                         in long        theShapeType,
-                         in boolean     isSorted);
+                          in long        theShapeType,
+                          in boolean     isSorted);
 
     /*!
-     *  Explode a shape on subshapes of a given type.
+     *  Explode a shape on subshapes of a given type. If the
+     *  shape itself has the given type, it is also returned.
      *  \param theShape Shape to be exploded.
      *  \param theShapeType Type of sub-shapes to be retrieved.
      *  \param isSorted If this parameter is TRUE, sub-shapes will be
@@ -1483,12 +1577,25 @@ module GEOM
                                in long        theShapeType,
                                in boolean     isSorted);
 
+    /*!
+     *  Extract all subshapes of the given type from
+     *  the given shape, excluding the shape itself.
+     *  \param theShape Shape to be exploded.
+     *  \param theShapeType Type of sub-shapes to be retrieved.
+     *  \param isSorted If this parameter is TRUE, sub-shapes will be
+     *                  sorted by coordinates of their gravity centers.
+     *  \return List of sub-shapes of type theShapeType, contained in theShape.
+     */
+    ListOfGO ExtractSubShapes (in GEOM_Object theShape,
+                               in long        theShapeType,
+                               in boolean     isSorted);
+
     /*!
      *  Deprecated method. Use GetAllSubShapesIDs() instead.
      */
     ListOfLong SubShapeAllIDs (in GEOM_Object theShape,
-                              in long        theShapeType,
-                              in boolean     isSorted);
+                               in long        theShapeType,
+                               in boolean     isSorted);
 
     /*!
      *  Explode a shape on subshapes of a given type.
@@ -1506,12 +1613,26 @@ module GEOM
 
     /*!
      *  Get a sub shape defined by its unique ID inside \a theMainShape
+     *  \param theMainShape Main shape.
+     *  \param theID Unique ID of sub shape inside \a theMainShape.
+     *  \return GEOM_Object, corresponding to found sub shape.
      *  \note The sub shape GEOM_Objects can has ONLY ONE function.
-     *        Don't try to apply modification operations on them.
+     *        Don't try to apply modification operations (without copy) on them.
      */
     GEOM_Object GetSubShape (in GEOM_Object theMainShape,
                              in long        theID);
 
+    /*!
+     *  Get a set of sub shapes defined by their unique IDs inside \a theMainShape
+     *  \param theMainShape Main shape.
+     *  \param theIndices List of unique IDs of sub shapes inside \a theMainShape.
+     *  \return List of GEOM_Objects, corresponding to found sub shapes.
+     *  \note The sub shape GEOM_Objects can has ONLY ONE function.
+     *        Don't try to apply modification operations (without copy) on them.
+     */
+    ListOfGO MakeSubShapes (in GEOM_Object theMainShape,
+                            in ListOfLong  theIndices);
+
     /*!
      *  Get global index of \a theSubShape in \a theMainShape.
      *  \param theMainShape Main shape.
@@ -2450,7 +2571,8 @@ module GEOM
      *  Create an arc of ellipse of center C and two points P1 P2.
      *  \param theCenter Center point of the arc.
      *  \param thePnt1 Major radius is distance from center to Pnt1.
-     *  \param thePnt2 define a plane and Minor radius as a shortest distance from Pnt2 to vector Center->Pnt1.
+     *  \param thePnt2 define a plane and Minor radius as a shortest
+     *                 distance from Pnt2 to vector Center->Pnt1.
      *  \return New GEOM_Object, containing the created arc.
      */
     GEOM_Object MakeArcOfEllipse (in GEOM_Object theCenter,
@@ -2461,25 +2583,51 @@ module GEOM
     /*!
      *  Create a polyline on the set of points.
      *  \param thePoints Sequence of points for the polyline.
+     *  \param theIsClosed If TRUE, build a closed wire.
      *  \return New GEOM_Object, containing the created polyline.
      */
-    GEOM_Object MakePolyline (in ListOfGO thePoints);
+    GEOM_Object MakePolyline (in ListOfGO thePoints,
+                              in boolean  theIsClosed);
 
     /*!
      *  Create bezier curve on the set of points.
      *  \param thePoints Sequence of points for the bezier curve.
+     *  \param theIsClosed If TRUE, build a closed curve.
      *  \return New GEOM_Object, containing the created bezier curve.
      */
-    GEOM_Object MakeSplineBezier (in ListOfGO thePoints);
+    GEOM_Object MakeSplineBezier (in ListOfGO thePoints,
+                                  in boolean  theIsClosed);
 
     /*!
      *  Create B-Spline curve on the set of points.
      *  \param thePoints Sequence of points for the B-Spline curve.
      *  \param theIsClosed If TRUE, build a closed curve.
+     *  \param theDoReordering If TRUE, the algo does not follow the order of
+     *                         \a thePoints but searches for the closest vertex.
      *  \return New GEOM_Object, containing the created B-Spline curve.
      */
     GEOM_Object MakeSplineInterpolation (in ListOfGO thePoints,
-                                         in boolean  theIsClosed);
+                                         in boolean  theIsClosed,
+                                         in boolean  theDoReordering);
+
+    /*!
+     *  Creates a curve using the parametric definition of the basic points.
+     *  \param thexExpr parametric equation of the coordinates X.
+     *  \param theyExpr parametric equation of the coordinates Y.
+     *  \param thezExpr parametric equation of the coordinates Z.
+     *  \param theParamMin the minimal value of the parameter.
+     *  \param theParamMax the maximum value of the parameter.
+     *  \param theParamStep the step of the parameter.
+     *  \param theCurveType the type of the curve.
+     *  \return New GEOM_Object, containing the created curve.
+     */    
+    GEOM_Object MakeCurveParametric(in string thexExpr,
+                                   in string theyExpr,
+                                   in string thezExpr,
+                                   in double theParamMin,
+                                   in double theParamMax,
+                                   in double theParamStep,
+                                   in curve_type theCurveType);
 
     /*!
      *  Create a sketcher (wire or face), following the textual description,
@@ -2879,7 +3027,7 @@ module GEOM
      *         set to 'meter' and result model will be scaled.
      *  \return New GEOM_Object, containing the imported shape.
      */
-    GEOM_Object Import (in string theFileName, in string theFormatName);
+    GEOM_Object ImportFile (in string theFileName, in string theFormatName);
 
     /*!
      *  Get the supported import formats and corresponding patterns for File dialog.
@@ -3114,6 +3262,13 @@ module GEOM
     boolean CheckShapeWithGeometry (in GEOM_Object theShape,
                                     out string     theDescription);
 
+    /*!
+     *  Check if the given shape can be an argument for MakeSolid operation
+     *  \param theShape Shape to be described.
+     *  \return Empty string if a solid can be made on this shape, error code otherwise.
+     */
+    string IsGoodForSolid (in GEOM_Object theShape);
+
     /*!
      *  Obtain description of the given shape
      *  \param theShape Shape to be described.
@@ -3121,6 +3276,16 @@ module GEOM
      */
     string WhatIs (in GEOM_Object theShape);
 
+    /*!
+     *  Check if points defined by coords = [x1, y1, z1, x2, y2, z2, ...] are inside or on
+     *  the shape theShape.
+     *  \param theShape Shape to check.
+     *  \param coords list of coordinates.
+     *  \param tolerance tolerance.
+     *  \return list of boolean.
+     */
+    ListOfBool AreCoordsInside(in GEOM_Object theShape, in ListOfDouble coords, in double tolerance);
+
     /*!
      *  Get minimal distance between the given shapes.
      *  \param theShape1,theShape2 Shapes to find minimal distance between.
@@ -3139,6 +3304,13 @@ module GEOM
      */
     double GetAngle (in GEOM_Object theShape1, in GEOM_Object theShape2);
 
+    /*!
+     *  Get angle between the given vectors.
+     *  \param theShape1,theShape2 Vectors to find angle between.
+     *  \return Value of the angle between the given vectors.
+     */
+    double GetAngleBtwVectors (in GEOM_Object theShape1, in GEOM_Object theShape2);
+
     /*!
      *  Get point coordinates
      */
@@ -3296,8 +3468,8 @@ module GEOM
      *  \return List of GEOM_Objects, containing the created shape and propagation groups.
      */
     ListOfGO MakePipeTShape (in double theR1, in double theW1, in double theL1,
-                                in double theR2, in double theW2, in double theL2,
-                                in boolean theHexMesh);
+                             in double theR2, in double theW2, in double theL2,
+                             in boolean theHexMesh);
     /*!
      *  Create a T-shape object with specified caracteristics for the main and
      *  the incident pipes (radius, width, half-length).
@@ -3316,9 +3488,9 @@ module GEOM
      *  \return List of GEOM_Objects, containing the created shape and propagation groups.
      */
     ListOfGO MakePipeTShapeWithPosition (in double theR1, in double theW1, in double theL1,
-                                            in double theR2, in double theW2, in double theL2,
-                                            in boolean theHexMesh,
-                                            in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
+                                         in double theR2, in double theW2, in double theL2,
+                                         in boolean theHexMesh,
+                                         in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
     /*!
      *  Create a T-shape object with specified caracteristics for the main and
      *  the incident pipes (radius, width, half-length). A chamfer is created
@@ -3359,9 +3531,9 @@ module GEOM
      *  \return List of GEOM_Objects, containing the created shape and propagation groups.
      */
     ListOfGO MakePipeTShapeChamferWithPosition (in double theR1, in double theW1, in double theL1,
-                                                   in double theR2, in double theW2, in double theL2,
-                                                   in double theH, in double theW, in boolean theHexMesh,
-                                                   in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
+                                                in double theR2, in double theW2, in double theL2,
+                                                in double theH, in double theW, in boolean theHexMesh,
+                                                in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
     /*!
      *  Create a T-shape object with specified caracteristics for the main and
      *  the incident pipes (radius, width, half-length). A fillet is created
@@ -3378,8 +3550,8 @@ module GEOM
      *  \return List of GEOM_Objects, containing the created shape and propagation groups.
      */
     ListOfGO MakePipeTShapeFillet (in double theR1, in double theW1, in double theL1,
-                                      in double theR2, in double theW2, in double theL2,
-                                      in double theRF, in boolean theHexMesh);
+                                   in double theR2, in double theW2, in double theL2,
+                                   in double theRF, in boolean theHexMesh);
     /*!
      *  Create a T-shape object with specified caracteristics for the main and
      *  the incident pipes (radius, width, half-length). A fillet is created
@@ -3400,9 +3572,9 @@ module GEOM
      *  \return List of GEOM_Objects, containing the created shape and propagation groups.
      */
     ListOfGO MakePipeTShapeFilletWithPosition (in double theR1, in double theW1, in double theL1,
-                                                  in double theR2, in double theW2, in double theL2,
-                                                  in double theRF, in boolean theHexMesh,
-                                                  in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
+                                               in double theR2, in double theW2, in double theL2,
+                                               in double theRF, in boolean theHexMesh,
+                                               in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
     /*@@ insert new functions before this line @@ do not remove this line @@*/
   };
 
@@ -3410,7 +3582,7 @@ module GEOM
    *  GEOM_Gen: Interface to access other GEOM interfaces.
    *  Also contains some methods to access and manage GEOM objects.
    */
-  interface GEOM_Gen : Engines::Component,SALOMEDS::Driver
+  interface GEOM_Gen : Engines::EngineComponent,SALOMEDS::Driver
   {
     /*!
      *  Undo/Redo Management
@@ -3455,7 +3627,7 @@ module GEOM
      *  \return list of published sub-shapes
      */
     ListOfGO RestoreSubShapesO (in SALOMEDS::Study   theStudy,
-                                 in GEOM_Object       theObject,
+                                in GEOM_Object       theObject,
                                 in ListOfGO          theArgs,
                                 in find_shape_method theFindMethod,
                                 in boolean           theInheritFirstArg,
@@ -3541,7 +3713,7 @@ module GEOM
 
     /*!
      *  Add a sub shape defined by indices in \a theIndices
-     *  (contains unique IDs of sub shapes inside theMainShape)
+     *  (contains unique IDs of sub shapes inside \a theMainShape)
      *  \note The sub shape GEOM_Objects can has ONLY ONE function.
      *        Don't try to apply modification operations on them.
      *  \note Internal method