Salome HOME
Implementation of 'GetEntriesToCleanStudy' function to get categorized lists of objects.
[modules/geom.git] / idl / GEOM_Gen.idl
index 542a1e8e8defdbc6ed2f3ffadfbcb0dd71df4ef2..a0f2020de211224951677bef3a29c13f56f7ded8 100644 (file)
@@ -61,8 +61,8 @@ module GEOM
   /*!
    * \brief Marker type
    */
-  enum marker_type { MT_NONE, MT_POINT, MT_PLUS, MT_STAR, MT_O, MT_X, MT_O_POINT, MT_O_PLUS,
-                     MT_O_STAR, MT_O_X, MT_BALL, MT_RING1, MT_RING2, MT_RING3, MT_USER };
+  enum marker_type { MT_NONE, MT_POINT, MT_PLUS, MT_STAR, MT_X, MT_O, MT_O_POINT, MT_O_PLUS,
+                     MT_O_STAR, MT_O_X, MT_RING1, MT_RING2, MT_RING3, MT_BALL, MT_USER };
 
   /*!
    * /brief Marker size
@@ -4002,23 +4002,104 @@ module GEOM
                        out double EdgeMin, out double EdgeMax,
                        out double VertMin, out double VertMax);
 
+    /*!
+     *  \brief Enumeration of Shape defects coming from CheckShape algorithms.
+     */
+    enum ShapeErrorType
+    {
+      /* for vertices */
+      InvalidPointOnCurve,
+      InvalidPointOnCurveOnSurface,
+      InvalidPointOnSurface,
+
+      /* for edges */
+      No3DCurve,
+      Multiple3DCurve,
+      Invalid3DCurve,
+      NoCurveOnSurface,
+      InvalidCurveOnSurface,
+      InvalidCurveOnClosedSurface,
+      InvalidSameRangeFlag,
+      InvalidSameParameterFlag,
+      InvalidDegeneratedFlag,
+
+      FreeEdge,
+      InvalidMultiConnexity,
+      InvalidRange,
+
+      /* for wires */
+      EmptyWire,
+      RedundantEdge,
+      SelfIntersectingWire, /* on a face */
+
+      /* for faces */
+      NoSurface,
+      InvalidWire,
+      RedundantWire,
+      IntersectingWires,
+      InvalidImbricationOfWires,
+
+      /* for shells */
+      EmptyShell,
+      RedundantFace,
+
+      /* for shapes */
+      UnorientableShape,
+      NotClosed,
+      NotConnected,
+
+      SubshapeNotInShape,
+
+      BadOrientation,
+      BadOrientationOfSubshape,
+
+      InvalidToleranceValue,
+
+      /* for exception */
+      CheckFail
+    };
+
+    /*!
+     *  \brief Description of a shape defect: type and incriminated sub-shapes.
+     */
+    struct ShapeError
+    {
+      ShapeErrorType error;
+      ListOfLong     incriminated;
+    };
+
+    /*!
+     *  \brief Sequence of all shape defects.
+     */
+    typedef sequence<ShapeError> ShapeErrors;
+
     /*!
      *  \brief Check a topology of the given shape.
      *  \param theShape Shape to check validity of.
-     *  \param theDescription Output. Description of problems in the shape, if they are.
+     *  \param theErrors Structure, containing discovered errors and incriminated sub-shapes.
      *  \return TRUE, if the shape "seems to be valid" from the topological point of view.
      */
-    boolean CheckShape (in GEOM_Object theShape,
-                        out string     theDescription);
+    boolean CheckShape (in GEOM_Object  theShape,
+                        out ShapeErrors theErrors);
 
     /*!
      *  \brief Check a topology and a geometry of the given shape.
      *  \param theShape Shape to check validity of.
-     *  \param theDescription Output. Description of problems in the shape, if they are.
+     *  \param theErrors Structure, containing discovered errors and incriminated sub-shapes.
      *  \return TRUE, if the shape "seems to be valid".
      */
-    boolean CheckShapeWithGeometry (in GEOM_Object theShape,
-                                    out string     theDescription);
+    boolean CheckShapeWithGeometry (in GEOM_Object  theShape,
+                                    out ShapeErrors theErrors);
+
+    /*!
+     *  \brief Convert sequence of shape errors, returned by
+     *  <VAR>CheckShape()</VAR> or <VAR>CheckShapeWithGeometry()</VAR>, into string.
+     *  \param theShape the invalid shape.
+     *  \param theErrors The sequence of \a theShape errors.
+     *  \return String, describing all the errors in form, suitable for printing.
+     */
+    string PrintShapeErrors (in GEOM_Object theShape,
+                             in ShapeErrors theErrors);
 
     /*!
      *  \brief Check a topology of the given shape on self-intersections presence.
@@ -5008,6 +5089,35 @@ module GEOM
     void Move( in object_list what, 
               in SALOMEDS::SObject where, 
               in long row );
+
+    /*!
+     * \brief Collects dependencies of the given objects from other ones
+     * \param theStudy The study in which the object is published
+     * \param theListOfEntries List of GEOM object entries in OCAF tree (not in study)
+     * \return Struct of dependent entries and its links as a byte array
+     * \note This method is supposed to be used by GUI only.
+     */
+    SALOMEDS::TMPFile GetDependencyTree(in SALOMEDS::Study theStudy,
+                                       in string_array theListOfEntries);
+
+    /*!
+     * \brief Fills 3 lists that is used to clean study of redundant objects:
+     *  - dependencies of the given objects from other ones;
+     *  - children of the given objects;
+     *  - all other objects in study.
+     * \param theStudy The study in which the object was published
+     * \param theSelectedEntries List of GEOM object entries in OCAF tree
+     * \param theParentEntries List of GEOM object entries on which the given objects depend
+     * \param theSubEntries Children entries list of the given objects
+     * \param theOtherEntries List of GEOM object entries which are in the study, but not in parents and children lists
+     * \note This method is supposed to be used by GUI only.
+     */
+    void GetEntriesToCleanStudy(in SALOMEDS::Study theStudy,
+                               inout string_array theSelectedEntries,
+                               inout string_array theParentEntries,
+                               inout string_array theSubEntries,
+                               inout string_array theOtherEntries);
+
   };
 };