Salome HOME
patch for correct compilation on Linux
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_DataObject.h
index edb79f02e7006e87eea1ef74943fd9c5b18aa3c7..41a7bca4a72f7e525434afece793dd1b2a2090e3 100644 (file)
 #ifndef HYDROGUI_DATAOBJECT_H
 #define HYDROGUI_DATAOBJECT_H
 
-#include <HYDROData_Object.h>
+#include <HYDROData_Entity.h>
 
 #include <LightApp_DataObject.h>
 
 #include <QString>
 #include <QMap>
 #include <QPixmap>
+#include <QColor>
 
 /**
  * \class HYDROGUI_DataObject
 class HYDROGUI_DataObject : public LightApp_DataObject
 {
 public:
+  //! Column id
+  enum { 
+    RefObjectId = RefEntryId + 1,    //!< Ref.Object column
+    BathymetryId                     //!< Bathymetry column
+  };
+
   /**
    * Constructor.
    * \param theParent parent data object
@@ -50,7 +57,7 @@ public:
    * \param theParentEntry entry of the parent data object (for reference objects)
    */
   HYDROGUI_DataObject( SUIT_DataObject* theParent,
-                       Handle(HYDROData_Object) theData,
+                       Handle(HYDROData_Entity) theData,
                        const QString& theParentEntry );
     
   /**
@@ -76,12 +83,12 @@ public:
   /**
    * Returns the model data object.
    */
-  const Handle(HYDROData_Object)& modelObject() const { return myData; }
+  const Handle(HYDROData_Entity)& modelObject() const { return myData; }
 
   /**
    * Redefines the object.
    */
-  void setObject( Handle(HYDROData_Object) theObject ) { myData = theObject; }
+  void setObject( const Handle(HYDROData_Entity)& theObject ) { myData = theObject; }
 
   /**
    * Returns the entry prefix for all HYDRO data objects.
@@ -91,10 +98,11 @@ public:
   /**
    * Returns the full entry for the specified data object.
    */
-  static QString dataObjectEntry( const Handle(HYDROData_Object)& theObject );
+  static QString dataObjectEntry( const Handle(HYDROData_Entity)& theObject,
+                                  const bool theWithPrefix = true );
 
 protected:
-  Handle(HYDROData_Object) myData; ///< object from data model
+  Handle(HYDROData_Entity) myData; ///< object from data model
   QString myParentEntry;
 };
 
@@ -134,4 +142,24 @@ private:
   QString myParentEntry;
 };
 
+/**
+ * \brief Module data object, used for dropping items in the object browser.
+ *
+ * It inherits NamedObject with only difference - it accepts dropping.
+ */
+class HYDROGUI_DropTargetObject : public HYDROGUI_NamedObject
+{
+public:
+  /**
+   * Constructor.
+   * \param theParent parent data object
+   * \param theName displayed name
+   */
+  HYDROGUI_DropTargetObject( SUIT_DataObject* theParent,
+                             const QString& theName,
+                             const QString& theParentEntry  );
+    
+  bool isDropAccepted() const { return true; }
+};
+
 #endif