Salome HOME
Issue #1015: The validate icon must be greyed and inactive instead of red and active
[modules/shaper.git] / src / ModuleBase / ModuleBase_ResultPrs.h
index 056d757e18b619639cee7317391eedeafd3d317a..7ed3db9ccfd5220c6927fd3517e0c73eeb9a5771 100644 (file)
@@ -25,11 +25,19 @@ DEFINE_STANDARD_HANDLE(ModuleBase_BRepOwner, StdSelect_BRepOwner)
 class ModuleBase_BRepOwner: public StdSelect_BRepOwner
 {
 public:
+  /// Constructor
+  /// \param aShape an owner shape
+  /// \param aPriority drawig priority
+  /// \param ComesFromDecomposition decomposition flag
   ModuleBase_BRepOwner(const TopoDS_Shape& aShape, 
     const Standard_Integer aPriority = 0, 
     const Standard_Boolean ComesFromDecomposition = Standard_False)
     : StdSelect_BRepOwner(aShape, aPriority, ComesFromDecomposition) {}
 
+  /// Highlight the presentation with the given color
+  /// \param aPM a presentations manager
+  /// \param aCol a color
+  /// \param aMode a drawing mode
   virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& aPM, 
     const Quantity_NameOfColor aCol, const Standard_Integer aMode = 0)
   {  Selectable()->HilightOwnerWithColor(aPM, aCol, this); }
@@ -53,6 +61,12 @@ public:
   /// \param theResult a result object
   Standard_EXPORT ModuleBase_ResultPrs(ResultPtr theResult);
 
+  /// Returns true if the checked type can be accepted for the base selection type
+  /// It returns true if they are coicide or if the base type is face and the checked type is wire
+  /// @return boolean result
+  static Standard_EXPORT bool isValidShapeType(const TopAbs_ShapeEnum& theBaseType,
+                                               const TopAbs_ShapeEnum& theCheckedType);
+
 
   //! Method which draws selected owners ( for fast presentation draw )
   Standard_EXPORT virtual void HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM, 
@@ -66,15 +80,6 @@ public:
   /// Returns result object
   Standard_EXPORT ResultPtr getResult() const { return myResult; }
 
-  /// Returns True if the presentation is in sketch mode
-  Standard_EXPORT bool isSketchMode() const { return myIsSketchMode; }
-
-  /// Returns a list of faces
-  Standard_EXPORT const std::list<std::shared_ptr<GeomAPI_Shape> >& facesList() { return myFacesList; }
-
-  /// Returns true if the object is used in CompSolid selection mode
-  Standard_EXPORT bool hasCompSolidSelectionMode() const;
-
   DEFINE_STANDARD_RTTI(ModuleBase_ResultPrs)
 protected:
   /// Redefinition of virtual function
@@ -86,21 +91,17 @@ protected:
     const Standard_Integer aMode) ;
 
 private:
-  /// Returns shape dependent on CompSolid selection mode
-  /// In case CompSolid selection mode it returns parent's compsolid shape
-  TopoDS_Shape getSelectionShape() const;
+  /// Appens sensitive and owners for wires of the given shape into selection
+  /// \param theSelection a current filled selection
+  /// \param theShape a shape
+  void appendWiresSelection(const Handle(SelectMgr_Selection)& theSelection,
+                            const TopoDS_Shape& theShape);
 
   /// Reference to result object
   ResultPtr myResult;
 
-  /// A sketch mode flag
-  bool myIsSketchMode;
-
   /// Original shape of the result object
   TopoDS_Shape myOriginalShape;
-
-  /// List of faces
-  std::list<std::shared_ptr<GeomAPI_Shape> > myFacesList;
 };