1 // File: ModuleBase_ViewerPrs.h
2 // Created: 20 Apr 2014
3 // Author: Natalia ERMOLAEVA
5 #ifndef ModuleBase_ViewerPrs_H
6 #define ModuleBase_ViewerPrs_H
8 #include "ModuleBase.h"
10 #include <boost/shared_ptr.hpp>
11 #include <TopoDS_Shape.hxx>
12 #include <SelectMgr_EntityOwner.hxx>
14 #include <ModelAPI_Result.h>
16 /**\class ModuleBase_ViewerPrs
17 * \ingroup Module base
18 * \brief Presentation. Provides container to have feature, shape and/or selection owner.
20 class ModuleBase_ViewerPrs
24 ModuleBase_ViewerPrs() {}
27 /// \param theFeature a model feature
28 /// \param theShape a viewer shape
29 /// \param theOwner a selection owner
30 ModuleBase_ViewerPrs(ResultPtr theResult,
31 const TopoDS_Shape& theShape,
32 Handle_SelectMgr_EntityOwner theOwner)
33 : myResult(theResult), myShape(theShape), myOwner(theOwner) {}
36 virtual ~ModuleBase_ViewerPrs() {}
39 /// \param theFeature a feature instance
40 void setFeature(ResultPtr theResult) { myResult = theResult; }
42 /// Returns the feature.
43 /// \return a feature instance
44 ResultPtr result() const { return myResult; }
46 /// Returns the presentation owner
48 void setOwner(Handle_SelectMgr_EntityOwner theOwner) { myOwner = theOwner; }
50 /// Returns the presentation owner
52 Handle_SelectMgr_EntityOwner owner() const { return myOwner; }
55 /// \param theShape a shape instance
56 void setShape(const TopoDS_Shape& theShape) { myShape = theShape; }
59 /// \return a shape instance
60 const TopoDS_Shape& shape() const { return myShape; }
62 bool operator==(const ModuleBase_ViewerPrs& thePrs)
64 bool aResult = (myResult.get() == thePrs.result().get());
65 bool aOwner = (myOwner.Access() == thePrs.owner().Access());
66 bool aShape = myShape.IsEqual(thePrs.shape());
67 return aResult && aOwner && aShape;
71 ResultPtr myResult; /// the feature
72 Handle(SelectMgr_EntityOwner) myOwner; /// the selection owner
73 TopoDS_Shape myShape; /// the shape