Salome HOME
0022747: [EDF] Improvement of Get Shared Shapes operation
[modules/geom.git] / idl / GEOM_Gen.idl
index 9004a89816124a0f25d16fbc775ad19795224a92..26412f7e5f13a276593c72c2a29fb39ba8fe3256 100644 (file)
@@ -39,7 +39,7 @@ module GEOM
    */
   enum shape_type 
   { 
-    /*!  */
+    /*! A collection of arbitrary shapes */
     COMPOUND,
     /*! A collection of solids */ 
     COMPSOLID, 
@@ -47,16 +47,19 @@ module GEOM
     SOLID, 
     /*! A collection of faces connected by some edges of their wire boundaries */
     SHELL,
-    /*! Part of a plane (in 2D geometry) or a surface (in 3D geometry) bounded by a close wire */
+    /*! Part of a plane (in 2D geometry) or a surface (in 3D geometry) bounded by a closed wire */
     FACE, 
-    /*!  A sequence of edges connected by their vertices */
+    /*! A sequence of edges connected by their vertices */
     WIRE, 
     /*! Edge, a shape corresponding to a curve, and bound by a vertex at each extremity */
     EDGE, 
     /*! A zero-dimensional shape corresponding to a point in geometry */
     VERTEX,
-    /*!  */ 
-    SHAPE };
+    /*! Arbitrary shape in a Compound (used for processing of Compounds in some operations) */ 
+    SHAPE,
+    /*! Flat (top-level) contents of a Compound (used for processing of Compounds in some operations) */
+    FLAT
+    };
 
   /*!
    * \brief Marker type
@@ -112,7 +115,8 @@ module GEOM
    *  \brief Kind of method to find inside one main shape some sub-shapes,
    *  corresponding to other given shape (its argument)
    *
-   *  Is used in functions GEOM_Gen.RestoreSubShapesO(), GEOM_Gen.RestoreSubShapesSO()
+   *  Is used in functions GEOM_Gen.RestoreSubShapesO(), GEOM_Gen.RestoreSubShapesSO(),
+   *  TransferNames()
    */
   enum find_shape_method
   {
@@ -136,7 +140,10 @@ module GEOM
     /*! To be used only for multi-transformation result.
      *  Only this method can be used after multi-transformation.
      */
-    FSM_MultiTransformed
+    FSM_MultiTransformed,
+
+    /*! Use old GetInPlace functionality. */
+    FSM_GetInPlace_Old
   };
 
   /*!
@@ -202,7 +209,6 @@ module GEOM
     SI_ALL      // all interferences
   };
 
-
  /*!
    * \brief Object creation parameters
    *
@@ -211,7 +217,6 @@ module GEOM
   struct Parameter
   {
     string name;
-    //any value;
     string value;
   };
   typedef sequence<Parameter> Parameters;
@@ -222,6 +227,16 @@ module GEOM
     Parameters params;
   };
 
+  /*!
+   * \brief Reporting on shape healing
+   */
+  struct ModifInfo
+  {
+    string name;  // what changed
+    long   count; // how many times
+  };
+  typedef sequence<ModifInfo> ModifStatistics;
+
 
   typedef sequence<string>       string_array;
   typedef sequence<short>        short_array;
@@ -379,6 +394,18 @@ module GEOM
      */
     shape_type GetMaxShapeType();
 
+    /*!
+     *  \brief Returns a name of a sub-shape if the sub-shape is published in the study
+     *  \param subID - sub-shape ID
+     *  \return string - the found name or an empty string if the sub-shape does not
+     *          exits or is not published in the study
+     *
+     * \note Only sub-shapes directly retrieved (using e.g. ExtractSubShapes() or
+     *       via group creation) can be found. Also, as sub-shape can be published in the study
+     *       many times, only the first found name is returned.
+     */
+    string GetSubShapeName(in long subID);
+
     /*!
      *  \brief Set color of the object.
      *
@@ -1935,6 +1962,16 @@ module GEOM
     GEOM_Object MakeFaceFromSurface(in GEOM_Object theFace,
                                     in GEOM_Object theWire);
 
+    /*!
+     *  \brief Create a face from a set of edges with the given constraints.
+     *  \param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
+     *         - edges should form a closed wire;
+     *         - for each edge, constraint face is optional: if a constraint face is missing
+     *           for some edge, this means that there no constraint associated with this edge.
+     *  \return New GEOM_Object, containing the created face.
+     */
+    GEOM_Object MakeFaceWithConstraints(in ListOfGO theConstraints);
+
     /*!
      *  \brief Create a shell from the set of faces and shells.
      *  \param theFacesAndShells List of faces and/or shells.
@@ -1963,6 +2000,15 @@ module GEOM
      */
     GEOM_Object MakeCompound (in ListOfGO theShapes);
 
+    /*!
+     *  \brief Make a solid (or solids) from connected set of faces and/or shells.
+     *  \param theFacesOrShells List of faces and/or shells.
+     *  \param isIntersect If TRUE, forces performing intersections between arguments.
+     *
+     *  \return New GEOM_Object, containing the created solid (or compound of solids).
+     */
+    GEOM_Object MakeSolidFromConnectedFaces (in ListOfGO theFacesOrShells, in boolean isIntersect);
+    
     /*!
      *  \brief Replace coincident faces in \a theShapes by one face.
      *  \param theShapes Initial shapes.
@@ -2020,7 +2066,7 @@ module GEOM
      *  \param theEdges List of edges for gluing.
      *  \return New GEOM_Object containing copies of theShapes without some edges.
      */
-    GEOM_Object MakeGlueEdgesByList (in ListOfGO theShape,
+    GEOM_Object MakeGlueEdgesByList (in ListOfGO theShapes,
                                      in double   theTolerance,
                                      in ListOfGO theEdges);
 
@@ -2153,6 +2199,23 @@ module GEOM
      */
     string GetShapeTypeString (in GEOM_Object theShape);
 
+    /*!
+     *  \brief Check if the object is a sub-object of another GEOM object.
+     *
+     *  \param theSubObject Checked sub-object (or its parent object, in case if
+     *                      \a theSubObjectIndex is non-zero).
+     *  \param theSubObjectIndex When non-zero, specifies a sub-shape index that
+     *                           identifies a sub-object within its parent specified via \a theSubObject.
+     *  \param theObject An object that is checked for ownership (or its parent object,
+     *                   in case if \a theObjectIndex is non-zero).
+     *  \param theObjectIndex When non-zero, specifies a sub-shape index that
+     *                        identifies an object within its parent specified via \a theObject.
+     *  \return TRUE, if the given object contains sub-object.
+     */
+    boolean IsSubShapeBelongsTo( in GEOM_Object theSubObject,
+                                 in long        theSubObjectIndex,
+                                 in GEOM_Object theObject,
+                                 in long        theObjectIndex);
     /*!
      *  \brief Count number of faces in the given shape.
      *  \param theShape Shape to count faces in.
@@ -2204,13 +2267,21 @@ module GEOM
                               in long        theShapeType);
 
     /*!
-     *  \brief Get all sub-shapes, shared by all shapes in the list \a theShapes.
+     *  \brief Get sub-shapes, shared by input shapes.
      *  \param theShapes Shapes to find common sub-shapes of.
      *  \param theShapeType Type of sub-shapes to be retrieved.
-     *  \return List of objects, that are sub-shapes of all given shapes.
+     *  \param theMultiShare Specifies what type of shares should be checked:
+     *         - \c TRUE: search sub-shapes from 1st input shape shared with all other input shapes;
+     *         - \c FALSE: causes to search sub-shapes shared between couples of input shapes.
+     *  \note If \a theShapes contains single compound, the shares between all possible couples of 
+     *        its top-level shapes are returned; otherwise, only shares between 1st input shape
+     *        and all rest input shapes are returned.
+     *              
+     *  \return List of all found sub-shapes.
      */
     ListOfGO GetSharedShapesMulti (in ListOfGO theShapes,
-                                   in long     theShapeType);
+                                   in long     theShapeType,
+                                  in boolean  theMultiShare);
 
     /*!
      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
@@ -2539,6 +2610,53 @@ module GEOM
     ListOfLong GetSameIDs (in GEOM_Object theShapeWhere,
                            in GEOM_Object theShapeWhat);
 
+    /*!
+     *  \brief Resize the input edge with the new Min and Max parameters.
+     *  The input edge parameters range is [0, 1]. If theMin parameter is
+     *  negative, the input edge is extended, otherwise it is shrinked by
+     *  theMin parameter. If theMax is greater than 1, the edge is extended,
+     *  otherwise it is shrinked by theMax parameter.
+     *  \param theEdge the input edge to be resized.
+     *  \param theMin the minimal parameter value.
+     *  \param theMax the maximal parameter value.
+     *  \return a newly created edge.
+     */
+    GEOM_Object ExtendEdge(in GEOM_Object theEdge,
+                           in double      theMin,
+                           in double      theMax);
+
+    /*!
+     *  \brief Resize the input face with the new UMin, UMax, VMin and VMax
+     *  parameters. The input face U and V parameters range is [0, 1]. If
+     *  theUMin parameter is negative, the input face is extended, otherwise
+     *  it is shrinked along U direction by theUMin parameter. If theUMax is
+     *  greater than 1, the face is extended, otherwise it is shrinked along
+     *  U direction by theUMax parameter. So as for theVMin, theVMax and
+     *  V direction of the input face.
+     *  \param theFace the input face to be resized.
+     *  \param theUMin the minimal U parameter value.
+     *  \param theUMax the maximal U parameter value.
+     *  \param theVMin the minimal V parameter value.
+     *  \param theVMax the maximal V parameter value.
+     *  \return a newly created face.
+     */
+    GEOM_Object ExtendFace(in GEOM_Object theFace,
+                           in double      theUMin,
+                           in double      theUMax,
+                           in double      theVMin,
+                           in double      theVMax);
+
+    /*!
+     *  \brief Make a surface from a face. This function takes some face as
+     *  input parameter and creates new GEOM_Object, i.e. topological shape
+     *  by extracting underlying surface of the source face and limiting it
+     *  by the Umin, Umax, Vmin, Vmax parameters of the source face (in the
+     *  parametrical space).
+     *  \param theFace the input face.
+     *  \return a newly created face.
+     */
+    GEOM_Object MakeSurfaceFromFace(in GEOM_Object theFace);
+
   };
 
  // # GEOM_IBlocksOperations: 
@@ -3699,7 +3817,7 @@ module GEOM
 
     /*!
      *  Sewing of the given object.
-     *  \param theObject Shape to be processed.
+     *  \param theObjects Shapes to be processed.
      *  \param theTolerance Required tolerance value.
      *  \return New GEOM_Object, containing processed shape.
      */
@@ -3707,7 +3825,7 @@ module GEOM
 
     /*!
      *  Sewing of the given object. Allows non-manifold sewing.
-     *  \param theObject Shape to be processed.
+     *  \param theObjects Shapes to be processed.
      *  \param theTolerance Required tolerance value.
      *  \return New GEOM_Object, containing processed shape.
      */
@@ -3722,7 +3840,7 @@ module GEOM
     GEOM_Object RemoveInternalFaces (in ListOfGO theSolids);
 
     /*!
-     *  \brief Addition of a point to a given edge object.
+     *  \brief Addition of a point to a given edge of \a theObject.
      *  \param theObject Shape to be processed.
      *  \param theEdgeIndex Index of edge to be divided within theObject's shape,
      *                      if -1, then theObject itself is the edge.
@@ -3730,11 +3848,24 @@ module GEOM
      *                  depending on \a isByParameter.
      *  \param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
      *                       if FALSE : \a theValue is treated as a length parameter [0..1]
-     *  \return New GEOM_Object, containing processed shape.
+     *  \return New GEOM_Object, containing the processed shape.
      */
     GEOM_Object DivideEdge (in GEOM_Object theObject, in short theEdgeIndex,
                             in double theValue, in boolean isByParameter);
 
+    /*!
+     *  \brief Addition of points to a given edge of \a theObject by projecting
+     *         other points to the given edge.
+     *  \param theObject Shape to be processed.
+     *  \param theEdgeIndex Index of edge to be divided within theObject's shape,
+     *                      if -1, then theObject itself is the edge.
+     *  \param thePoints Points to project to theEdgeIndex-th edge.
+     *  \return New GEOM_Object, containing the processed shape.
+     */
+    GEOM_Object DivideEdgeByPoint (in GEOM_Object theObject,
+                                   in short       theEdgeIndex,
+                                   in ListOfGO    thePoints);
+
     /*!
      *  \brief Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
      *  \param theWire Wire to minimize the number of C1 continuous edges in.
@@ -3747,13 +3878,13 @@ module GEOM
 
     /*!
      *  \brief Get a list of wires (wrapped in GEOM_Object-s),
-     *  that constitute a free boundary of the given shape.
-     *  \param theObject Shapes to get free boundary of.
+     *  that constitute a free boundary of the given shapes.
+     *  \param theObjects Shapes to get free boundary of.
      *  \param theClosedWires Output. Closed wires on the free boundary of the given shape.
      *  \param theOpenWires Output. Open wires on the free boundary of the given shape.
      *  \return FALSE, if an error(s) occured during the method execution.
      */
-    boolean GetFreeBoundary (in ListOfGO theObjects,
+    boolean GetFreeBoundary (in  ListOfGO theObjects,
                              out ListOfGO theClosedWires,
                              out ListOfGO theOpenWires);
 
@@ -3773,6 +3904,12 @@ module GEOM
      */
     GEOM_Object LimitTolerance (in GEOM_Object theObject, in double theTolerance);
 
+
+    /*!
+     *  \brief Return information on what has been done by the last called healing method.
+     *  \return ModifStatistics, information container.
+     */
+    ModifStatistics GetStatistics();
   };
 
  // # GEOM_IInsertOperations:
@@ -3788,8 +3925,8 @@ module GEOM
     GEOM_Object MakeCopy (in GEOM_Object theOriginal);
 
     /*!
-     *  \brief Deprecated method. Use Export<FormatName> (from the
-     *  corresponding plugin) instead; here <FormatName> is a name of format.
+     *  \brief Deprecated method. Use Export\<FormatName\> (from the
+     *  corresponding plugin) instead; here \<FormatName\> is a name of format.
      *
      *  \brief Export the given shape into a file with given name.
      *  \param theObject Shape to be stored in the file.
@@ -3799,8 +3936,8 @@ module GEOM
     void Export (in GEOM_Object theObject, in string theFileName, in string theFormatName);
 
     /*!
-     *  \brief Deprecated method. Use Import<FormatName> (from the
-     *  corresponding plugin) instead; here <FormatName> is a name of format.
+     *  \brief Deprecated method. Use Import\<FormatName\> (from the
+     *  corresponding plugin) instead; here \<FormatName\> is a name of format.
      *
      *  \brief Import a shape from the STL, BREP, IGES or STEP file
      *  (depends on given format) with given name.
@@ -3863,7 +4000,41 @@ module GEOM
      * \return list of all texture IDs avaiable for the current study
      */
     ListOfLong GetAllTextures();
-    
+
+    /*!
+     *  \brief Non-topological information transfer datum.
+     */
+    struct TransferDatum
+    {
+      string myName;
+      long   myNumber;
+      long   myMaxNumber;
+    };
+
+    /*!
+     *  \brief Sequence of non-topological information tranfer data.
+     */
+    typedef sequence<TransferDatum> ListOfTransferDatum;
+
+    /*!
+     *  \brief Transfer non-topological data from one object to another
+     *  \param theObjectFrom the source object of non-topological data
+     *  \param theObjectTo the destination object of non-topological data
+     *  \param theFindMethod method to search sub-shapes of theObjectFrom
+     *         in shape theObjectTo. Possible values are: GEOM::FSM_GetInPlace,
+     *         GEOM::FSM_GetInPlaceByHistory and GEOM::FSM_GetInPlace_Old.
+     *         Other values of GEOM::find_shape_method are not supported.
+     *  \param theResult statistics of the operation. Output parameter. It
+     *         represents a sequence of Transfer Datum. A datum has the type
+     *         (string code), the total number of items of this type and
+     *         the number of transfered items.
+     *  \return true in case of success; otherwise false.
+     */
+    boolean TransferData(in  GEOM_Object         theObjectFrom,
+                         in  GEOM_Object         theObjectTo,
+                         in  find_shape_method   theFindMethod,
+                         out ListOfTransferDatum theResult);
+
   };
 
  // # GEOM_IKindOfShape:
@@ -4179,6 +4350,26 @@ module GEOM
                                     in long        theCheckLevel,
                                     out ListOfLong theIntersections);
 
+    /*!
+     *  \brief Detect intersections of the given shapes with algorithm based on mesh intersections.
+     *  \param theShape1 First source object
+     *  \param theShape2 Second source object
+     *  \param theTolerance Specifies a distance between shapes used for detecting gaps:
+     *                       - if \a theTolerance <= 0, algorithm detects intersections
+     *                       - if \a theTolerance > 0, algorithm detects gaps
+     *  \param theDeflection Linear deflection coefficient that specifies quality of tesselation:
+     *                       - if \a theDeflection <= 0, default deflection 0.001 is used
+     *  \param theIntersections1 Output: contains list of sub-shapes IDs from 1st shape that localize intersection
+     *  \param theIntersections2 Output: contains list of sub-shapes IDs from 2nd shape that localize intersection
+     *  \return TRUE, if the are intersections (gaps) between source shapes
+     */
+    boolean FastIntersect (in GEOM_Object theShape1,
+                          in GEOM_Object theShape2,
+                          in double      theTolerance,
+                          in float       theDeflection,
+                          out ListOfLong theIntersections1,
+                          out ListOfLong theIntersections2);
+
     /*!
      *  \brief Check if the given shape can be an argument for MakeSolid operation
      *  \param theShape Shape to be described.