X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_ResultPrs.h;h=e1143734ca13e70b0925bbac148525bea447ef82;hb=5b4e69308550c299e14f336d489dc0aefbc5d6f4;hp=99fa1792312bc981ee382306ea0b172836394f4d;hpb=516b77e267ed9c0ba05c1efadec0cdab5b55cac7;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_ResultPrs.h b/src/ModuleBase/ModuleBase_ResultPrs.h index 99fa17923..e1143734c 100644 --- a/src/ModuleBase/ModuleBase_ResultPrs.h +++ b/src/ModuleBase/ModuleBase_ResultPrs.h @@ -11,31 +11,78 @@ #include -#include +#include #include +#include -DEFINE_STANDARD_HANDLE(ModuleBase_ResultPrs, AIS_Shape) +#include + +DEFINE_STANDARD_HANDLE(ModuleBase_BRepOwner, StdSelect_BRepOwner) + +/** +* \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: + /// 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); } + + 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 AIS_Shape +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 selection priorities that will be added to created selection owner + /// \return integer value + Standard_EXPORT int getAdditionalSelectionPriority() const { return myAdditionalSelectionPriority; } - /// Returns a list of faces - Standard_EXPORT const std::list >& facesList() { return myFacesList; } + /// Appends a special priority for the mode of selection + /// \param theSelectionMode a mode of selection, used in ComputeSelection + /// \param thePriority a new priority value + Standard_EXPORT void setAdditionalSelectionPriority(const int thePriority); DEFINE_STANDARD_RTTI(ModuleBase_ResultPrs) protected: @@ -48,17 +95,19 @@ protected: const Standard_Integer aMode) ; private: + /// 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 > myFacesList; + /// selection priority that will be added to the standard selection priority of the selection entity + int myAdditionalSelectionPriority; };