X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_ViewerPrs.h;h=4dcca83c2d95a33b0ba99d790b6b7d214c98a716;hb=aee09da348319d21259bee81c45d00a08f657de0;hp=723a15fb6445e723648e197cbef92173c0acbb6d;hpb=77b44e467b8a8ab3a5b20b8719e593f4f24dc25e;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_ViewerPrs.h b/src/ModuleBase/ModuleBase_ViewerPrs.h index 723a15fb6..4dcca83c2 100644 --- a/src/ModuleBase/ModuleBase_ViewerPrs.h +++ b/src/ModuleBase/ModuleBase_ViewerPrs.h @@ -10,11 +10,11 @@ #include "ModuleBase.h" #include -#include #include #include #include +#include /**\class ModuleBase_ViewerPrs * \ingroup GUI @@ -23,15 +23,13 @@ class ModuleBase_ViewerPrs { public: - /// Constructor - MODULEBASE_EXPORT ModuleBase_ViewerPrs(); - /// Constructor /// \param theResult an object /// \param theShape a viewer shape /// \param theOwner a selection owner - MODULEBASE_EXPORT ModuleBase_ViewerPrs(ObjectPtr theResult, const TopoDS_Shape& theShape, - Handle_SelectMgr_EntityOwner theOwner); + MODULEBASE_EXPORT ModuleBase_ViewerPrs(ObjectPtr theResult = ObjectPtr(), + const GeomShapePtr& theShape = GeomShapePtr(), + Handle_SelectMgr_EntityOwner theOwner = NULL); /// Destructor MODULEBASE_EXPORT virtual ~ModuleBase_ViewerPrs(); @@ -66,14 +64,14 @@ class ModuleBase_ViewerPrs /// Sets the shape /// \param theShape a shape instance - MODULEBASE_EXPORT void setShape(const TopoDS_Shape& theShape) + MODULEBASE_EXPORT void setShape(const GeomShapePtr& theShape) { myShape = theShape; } /// Returns the shape /// \return a shape instance - MODULEBASE_EXPORT const TopoDS_Shape& shape() const + MODULEBASE_EXPORT const GeomShapePtr& shape() const { return myShape; } @@ -95,10 +93,14 @@ class ModuleBase_ViewerPrs /// \return boolean value MODULEBASE_EXPORT bool isEmpty() const { - return myShape.IsNull() && + return (!myShape.get() || myShape->isNull()) && myOwner.IsNull() && !myResult.get(); } + /// Returns true if all presentation fields are empty + /// \return boolean value + MODULEBASE_EXPORT bool isEqual(ModuleBase_ViewerPrs* thePrs) const; + /// Returns True if the current object is equal to the given one /// \param thePrs an object to compare MODULEBASE_EXPORT bool operator==(const ModuleBase_ViewerPrs& thePrs); @@ -106,8 +108,10 @@ class ModuleBase_ViewerPrs private: ObjectPtr myResult; /// the feature Handle(SelectMgr_EntityOwner) myOwner; /// the selection owner - TopoDS_Shape myShape; /// the shape + GeomShapePtr myShape; /// the shape Handle(AIS_InteractiveObject) myInteractive; /// interactive object }; +typedef std::shared_ptr ModuleBase_ViewerPrsPtr; + #endif