1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef HYDROGUI_DATAOBJECT_H
24 #define HYDROGUI_DATAOBJECT_H
26 #include <HYDROData_Object.h>
28 #include <LightApp_DataObject.h>
35 * \class HYDROGUI_DataObject
36 * \brief Module data object, used for object browser tree creation.
38 * This is an Object Browser object that contains reference to data structure
40 * This class inherits CAM_DataObject virtually, so it is necessary to call in the class
41 * constructor the CAM object constructor manually for the correct initialization
43 class HYDROGUI_DataObject : public LightApp_DataObject
48 * \param theParent parent data object
49 * \param theData reference to the corresponding object from data structure
50 * \param theParentEntry entry of the parent data object (for reference objects)
52 HYDROGUI_DataObject( SUIT_DataObject* theParent,
53 Handle(HYDROData_Object) theData,
54 const QString& theParentEntry );
57 * Returns the unique object identifier string.
59 virtual QString entry() const;
62 * Returns the entry of the referenced object.
64 virtual QString refEntry() const;
67 * Returns the name of object.
69 virtual QString name() const;
72 * Returns the font of displayed object name.
74 virtual QFont font( const int = SUIT_DataObject::NameId ) const;
77 * Returns the model data object.
79 const Handle(HYDROData_Object)& modelObject() const { return myData; }
82 * Redefines the object.
84 void setObject( Handle(HYDROData_Object) theObject ) { myData = theObject; }
87 * Returns the entry prefix for all HYDRO data objects.
89 static QString entryPrefix() { return QString( "HYDRO:" ); }
92 * Returns the full entry for the specified data object.
94 static QString dataObjectEntry( const Handle(HYDROData_Object)& theObject );
97 Handle(HYDROData_Object) myData; ///< object from data model
98 QString myParentEntry;
102 * \class HYDROGUI_NamedObject
103 * \brief Module data object, used for object browser tree creation.
105 * It contains only name inside, without additional data: it is just information
106 * or grouping object in the Object Browser.
107 * This class inherits CAM_DataObject virtually, so it is necessary to call in the class
108 * constructor the CAM object constructor manually for the correct initialization
110 class HYDROGUI_NamedObject : public virtual LightApp_DataObject
115 * \param theParent parent data object
116 * \param theName displayed name
118 HYDROGUI_NamedObject( SUIT_DataObject* theParent,
119 const QString& theName );
122 * Returns the unique object identifier string.
124 virtual QString entry() const;
127 * Returns the name of object.
129 virtual QString name() const;
132 QString myName; ///< name in the OB