Salome HOME
Issue #653 - Double and triple click edges -- Fix Debian dynamic_pointer_cast problem...
[modules/shaper.git] / src / ModuleBase / ModuleBase_ViewerPrs.h
index cd8751fe7e69a9f425f5d61564502afb51cc851a..419447edb1096006ce2c438123e49df921dd9a14 100644 (file)
  * \ingroup GUI
  * \brief Presentation. Provides container to have feature, shape and/or selection owner.
  */
-class ModuleBase_ViewerPrs
+class MODULEBASE_EXPORT ModuleBase_ViewerPrs
 {
  public:
   /// Constructor
-  ModuleBase_ViewerPrs()
-  {
-  }
+  ModuleBase_ViewerPrs();
 
   /// Constructor
   /// \param theResult an object
   /// \param theShape a viewer shape
   /// \param theOwner a selection owner
   ModuleBase_ViewerPrs(ObjectPtr theResult, const TopoDS_Shape& theShape,
-                       Handle_SelectMgr_EntityOwner theOwner)
-      : myResult(theResult),
-        myShape(theShape),
-        myOwner(theOwner)
-  {
-  }
+                       Handle_SelectMgr_EntityOwner theOwner);
 
   /// Destructor
-  virtual ~ModuleBase_ViewerPrs()
-  {
-  }
+  virtual ~ModuleBase_ViewerPrs();
 
   /// Sets the object.
   /// \param theResult an object instance
-  void setFeature(ObjectPtr theResult)
+  void setObject(ObjectPtr theResult)
   {
     myResult = theResult;
   }
@@ -100,6 +91,14 @@ class ModuleBase_ViewerPrs
     return myInteractive;
   }
 
+  /// Returns true if all presentation fields are empty
+  /// \return boolean value
+  bool isEmpty() const
+  {
+    return myShape.IsNull() &&
+           myOwner.IsNull() && !myResult.get();
+  }
+
   /// Returns True if the current object is equal to the given one
   /// \param thePrs an object to compare
   bool operator==(const ModuleBase_ViewerPrs& thePrs)