Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / XGUI / XGUI_ViewerPrs.cpp
index 4ab8801aa1f124151bff9b5aa9edbc13267e57af..f280905a7bcc43887875fcac30154e019c74238b 100644 (file)
@@ -4,13 +4,16 @@
 
 #include "XGUI_ViewerPrs.h"
 
+#include "SelectMgr_EntityOwner.hxx"
+
 XGUI_ViewerPrs::XGUI_ViewerPrs()
 {
 }
 
-XGUI_ViewerPrs::XGUI_ViewerPrs(boost::shared_ptr<ModelAPI_Feature> theFeature,
-                               const TopoDS_Shape& theShape)
-: myFeature(theFeature), myShape(theShape)
+XGUI_ViewerPrs::XGUI_ViewerPrs(FeaturePtr theFeature,
+                               const TopoDS_Shape& theShape,
+                               Handle(SelectMgr_EntityOwner) theOwner)
+: myFeature(theFeature), myShape(theShape), myOwner(theOwner)
 {
 }
 
@@ -18,22 +21,40 @@ XGUI_ViewerPrs::~XGUI_ViewerPrs()
 {
 }
 
-void XGUI_ViewerPrs::setFeature(boost::shared_ptr<ModelAPI_Feature> theFeature)
+void XGUI_ViewerPrs::setFeature(FeaturePtr theFeature)
 {
   myFeature = theFeature;
 }
 
-void XGUI_ViewerPrs::setShape(const TopoDS_Shape& theShape)
+FeaturePtr XGUI_ViewerPrs::feature() const
 {
-  myShape = theShape;
+  return myFeature;
 }
 
-boost::shared_ptr<ModelAPI_Feature> XGUI_ViewerPrs::feature() const
+void XGUI_ViewerPrs::setOwner(Handle(SelectMgr_EntityOwner) theOwner)
 {
-  return myFeature;
+  myOwner = theOwner;
+}
+
+Handle(SelectMgr_EntityOwner) XGUI_ViewerPrs::owner() const
+{
+  return myOwner;
+}
+
+void XGUI_ViewerPrs::setShape(const TopoDS_Shape& theShape)
+{
+  myShape = theShape;
 }
 
 const TopoDS_Shape& XGUI_ViewerPrs::shape() const
 {
   return myShape;
 }
+
+bool XGUI_ViewerPrs::operator==(const XGUI_ViewerPrs& thePrs)
+{
+  bool aFeature = (myFeature.get() == thePrs.feature().get());
+  bool aOwner = (myOwner.Access() == thePrs.owner().Access());
+  bool aShape = myShape.IsEqual(thePrs.shape());
+  return aFeature && aOwner && aShape;
+}