X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModuleBase%2FModuleBase_ResultPrs.h;h=6d7dc8b1c52d4d4eedf1f3745f1cdcf9c676714f;hb=811681738727583c29043cd55903fb71cec19038;hp=165406ec294928b040d3911c521c86409797efc8;hpb=03ec1386ce3681558d40af584c8fb89eac5b4627;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_ResultPrs.h b/src/ModuleBase/ModuleBase_ResultPrs.h index 165406ec2..6d7dc8b1c 100644 --- a/src/ModuleBase/ModuleBase_ResultPrs.h +++ b/src/ModuleBase/ModuleBase_ResultPrs.h @@ -15,6 +15,8 @@ #include #include +#include + DEFINE_STANDARD_HANDLE(ModuleBase_BRepOwner, StdSelect_BRepOwner) /** @@ -25,11 +27,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); } @@ -48,18 +58,18 @@ DEFINE_STANDARD_HANDLE(ModuleBase_ResultPrs, ViewerData_AISShape) */ class ModuleBase_ResultPrs: public ViewerData_AISShape { +public: + enum SelectionModes { + Sel_Result = TopAbs_SHAPE + 1 /// it should be combined with Compsolid results, so it is not + /// the Shape type. It is not defined in XML as compound type + /// because this type is processed as shape with compounds inside. + }; + public: /// Constructor /// \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, const SelectMgr_SequenceOfOwner& theOwners); @@ -72,6 +82,15 @@ public: /// Returns result object Standard_EXPORT ResultPtr getResult() const { return myResult; } + /// Returns selection priorities that will be added to created selection owner + /// \return integer value + Standard_EXPORT int getAdditionalSelectionPriority() const { return myAdditionalSelectionPriority; } + + /// 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: /// Redefinition of virtual function @@ -94,6 +113,8 @@ private: /// Original shape of the result object TopoDS_Shape myOriginalShape; + /// selection priority that will be added to the standard selection priority of the selection entity + int myAdditionalSelectionPriority; };