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"
11 #include <TopoDS_Shape.hxx>
12 #include <SelectMgr_EntityOwner.hxx>
13 #include <AIS_InteractiveObject.hxx>
15 #include <ModelAPI_Result.h>
17 /**\class ModuleBase_ViewerPrs
18 * \ingroup Module base
19 * \brief Presentation. Provides container to have feature, shape and/or selection owner.
21 class ModuleBase_ViewerPrs
25 ModuleBase_ViewerPrs()
30 /// \param theFeature a model feature
31 /// \param theShape a viewer shape
32 /// \param theOwner a selection owner
33 ModuleBase_ViewerPrs(ObjectPtr theResult, const TopoDS_Shape& theShape,
34 Handle_SelectMgr_EntityOwner theOwner)
35 : myResult(theResult),
42 virtual ~ModuleBase_ViewerPrs()
47 /// \param theFeature a feature instance
48 void setFeature(ObjectPtr theResult)
53 /// Returns the feature.
54 /// \return a feature instance
55 ObjectPtr object() const
60 /// Returns the presentation owner
62 void setOwner(Handle_SelectMgr_EntityOwner theOwner)
67 /// Returns the presentation owner
69 Handle_SelectMgr_EntityOwner owner() const
75 /// \param theShape a shape instance
76 void setShape(const TopoDS_Shape& theShape)
82 /// \return a shape instance
83 const TopoDS_Shape& shape() const
88 void setInteractive(const Handle(AIS_InteractiveObject)& theIO)
90 myInteractive = theIO;
93 Handle(AIS_InteractiveObject) interactive() const
98 bool operator==(const ModuleBase_ViewerPrs& thePrs)
100 bool aResult = (myResult.get() == thePrs.object().get());
101 bool aOwner = (myOwner.Access() == thePrs.owner().Access());
102 bool aShape = myShape.IsEqual(thePrs.shape()) == Standard_True;
103 bool aIO = (myInteractive == thePrs.interactive()) == Standard_True;
104 return aResult && aOwner && aShape && aIO;
108 ObjectPtr myResult; /// the feature
109 Handle(SelectMgr_EntityOwner) myOwner; /// the selection owner
110 TopoDS_Shape myShape; /// the shape
111 Handle(AIS_InteractiveObject) myInteractive;