Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / src / ModuleBase / ModuleBase_ViewerPrs.h
index b595ac156cd29cd94212d85d12bc031c5ace1db1..c67c2312bd7f05a9ad06b378f55be6919e6fb644 100644 (file)
@@ -10,8 +10,9 @@
 #include <boost/shared_ptr.hpp>
 #include <TopoDS_Shape.hxx>
 #include <SelectMgr_EntityOwner.hxx>
+#include <AIS_InteractiveObject.hxx>
 
-#include <ModelAPI_Feature.h>
+#include <ModelAPI_Result.h>
 
 /**\class ModuleBase_ViewerPrs
  * \ingroup Module base
  */
 class ModuleBase_ViewerPrs
 {
-public:
+ public:
   /// Constructor
-  ModuleBase_ViewerPrs() {}
-  
+  ModuleBase_ViewerPrs()
+  {
+  }
+
   /// Constructor
   /// \param theFeature a model feature
   /// \param theShape a viewer shape
   /// \param theOwner a selection owner
-  ModuleBase_ViewerPrs(FeaturePtr theFeature,
-                 const TopoDS_Shape& theShape,
-                 Handle_SelectMgr_EntityOwner theOwner)
-  : myFeature(theFeature), myShape(theShape), myOwner(theOwner) {}
-  
+  ModuleBase_ViewerPrs(ObjectPtr theResult, const TopoDS_Shape& theShape,
+                       Handle_SelectMgr_EntityOwner theOwner)
+      : myResult(theResult),
+        myShape(theShape),
+        myOwner(theOwner)
+  {
+  }
+
   /// Destructor
-  virtual ~ModuleBase_ViewerPrs() {}
+  virtual ~ModuleBase_ViewerPrs()
+  {
+  }
 
   /// Sets the feature.
   /// \param theFeature a feature instance
-  void setFeature(FeaturePtr theFeature) { myFeature = theFeature; }
+  void setFeature(ObjectPtr theResult)
+  {
+    myResult = theResult;
+  }
 
   /// Returns the feature.
   /// \return a feature instance
-  FeaturePtr feature() const { return myFeature; }
+  ObjectPtr object() const
+  {
+    return myResult;
+  }
 
   /// Returns the presentation owner
   /// \param the owner
-  void setOwner(Handle_SelectMgr_EntityOwner theOwner) { myOwner = theOwner; }
+  void setOwner(Handle_SelectMgr_EntityOwner theOwner)
+  {
+    myOwner = theOwner;
+  }
 
   /// Returns the presentation owner
   /// \return an owner
-  Handle_SelectMgr_EntityOwner owner() const { return myOwner; }
+  Handle_SelectMgr_EntityOwner owner() const
+  {
+    return myOwner;
+  }
 
   /// Sets the shape
   /// \param theShape a shape instance
-  void setShape(const TopoDS_Shape& theShape) { myShape = theShape; }
+  void setShape(const TopoDS_Shape& theShape)
+  {
+    myShape = theShape;
+  }
 
   /// Returns the shape
   /// \return a shape instance
-  const TopoDS_Shape& shape() const { return myShape; }
+  const TopoDS_Shape& shape() const
+  {
+    return myShape;
+  }
+
+  void setInteractive(const Handle(AIS_InteractiveObject)& theIO)
+  {
+    myInteractive = theIO;
+  }
+
+  Handle(AIS_InteractiveObject) interactive() const
+  {
+    return myInteractive;
+  }
 
   bool operator==(const ModuleBase_ViewerPrs& thePrs)
   {
-    bool aFeature = (myFeature.get() == thePrs.feature().get());
+    bool aResult = (myResult.get() == thePrs.object().get());
     bool aOwner = (myOwner.Access() == thePrs.owner().Access());
     bool aShape = myShape.IsEqual(thePrs.shape());
-    return aFeature && aOwner && aShape;
+    bool aIO = (myInteractive == thePrs.interactive());
+    return aResult && aOwner && aShape && aIO;
   }
 
-private:
-  FeaturePtr myFeature; /// the feature
-  Handle(SelectMgr_EntityOwner) myOwner; /// the selection owner
-  TopoDS_Shape myShape; /// the shape
+ private:
+  ObjectPtr myResult;  /// the feature
+  Handle(SelectMgr_EntityOwner) myOwner;  /// the selection owner
+  TopoDS_Shape myShape;  /// the shape
+  Handle(AIS_InteractiveObject) myInteractive;
 };
 
 #endif