X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_ResultPrs.h;h=056d757e18b619639cee7317391eedeafd3d317a;hb=061a63480f6840b6d945f7744b3b972e2d4cb25d;hp=941ef15c4cb85591138c391e83f87198fa09679b;hpb=3874b57fe5aba25ff5aee2a07654fc23c1ee8eb0;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_ResultPrs.h b/src/ModuleBase/ModuleBase_ResultPrs.h index 941ef15c4..056d757e1 100644 --- a/src/ModuleBase/ModuleBase_ResultPrs.h +++ b/src/ModuleBase/ModuleBase_ResultPrs.h @@ -11,32 +11,95 @@ #include -#include +#include #include +#include -DEFINE_STANDARD_HANDLE(ModuleBase_ResultPrs, AIS_Shape) +DEFINE_STANDARD_HANDLE(ModuleBase_BRepOwner, StdSelect_BRepOwner) -class ModuleBase_ResultPrs: public AIS_Shape +/** +* \ingroup GUI +* A redefinition of standard BRep Owner in order to provide specific selection +* of CompSolid objects. This owner is created only for selection mode TopAbs_COMPSOLID +*/ +class ModuleBase_BRepOwner: public StdSelect_BRepOwner { public: + ModuleBase_BRepOwner(const TopoDS_Shape& aShape, + const Standard_Integer aPriority = 0, + const Standard_Boolean ComesFromDecomposition = Standard_False) + : StdSelect_BRepOwner(aShape, aPriority, ComesFromDecomposition) {} + + virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& aPM, + const Quantity_NameOfColor aCol, const Standard_Integer aMode = 0) + { Selectable()->HilightOwnerWithColor(aPM, aCol, this); } + + DEFINE_STANDARD_RTTI(ModuleBase_BRepOwner) +}; + + + +DEFINE_STANDARD_HANDLE(ModuleBase_ResultPrs, ViewerData_AISShape) + +/** +* \ingroup GUI +* A redefinition of standard AIS Interactive Object in order to provide specific behaviour +* for wire presentations based in a one plane +*/ +class ModuleBase_ResultPrs: public ViewerData_AISShape +{ +public: + /// Constructor + /// \param theResult a result object Standard_EXPORT ModuleBase_ResultPrs(ResultPtr theResult); + + //! Method which draws selected owners ( for fast presentation draw ) + Standard_EXPORT virtual void HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM, + const SelectMgr_SequenceOfOwner& theOwners); + + //! Method which hilight an owner belonging to + //! this selectable object ( for fast presentation draw ) + Standard_EXPORT virtual void HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM, + const Quantity_NameOfColor theColor, const Handle(SelectMgr_EntityOwner)& theOwner); + + /// 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 >& 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 Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0); + /// Redefinition of virtual function Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, 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; + + /// 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 > myFacesList; };