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
28 #include <HYDROData_Object.h>
30 #include <LightApp_DataObject.h>
37 * \class HYDROGUI_DataObject
38 * \brief Module data object, used for object browser tree creation.
40 * This is an Object Browser object that contains reference to data structure
42 * This class inherits CAM_DataObject virtually, so it is necessary to call in the class
43 * constructor the CAM object constructor manually for the correct initialization
45 class HYDROGUI_DataObject : public LightApp_DataObject
50 * \param theParent parent data object
51 * \param theData reference to the corresponding object from data structure
53 HYDROGUI_DataObject( SUIT_DataObject* theParent,
54 Handle(HYDROData_Object) theData );
57 * Returns the unique object identifier string.
59 virtual QString entry() const;
62 * Returns the name of object.
64 virtual QString name() const;
67 * Returns the model data object.
69 const Handle(HYDROData_Object)& modelObject() const { return myData; }
72 * Redefines the object.
74 void setObject( Handle(HYDROData_Object) theObject ) { myData = theObject; }
77 * Returns \a HYDROGUI_DataObject by the entry string of this object.
78 * \returns NULL if this is not HYDRO entry, or cannot cast to HYDROGUI_DataObject
80 static HYDROGUI_DataObject* objectByEntry( const QString& theEntry );
83 Handle(HYDROData_Object) myData; ///< object from data model
84 QString myEntry; ///< optimization: store generated entry to return it quickly
85 int myStudyId; ///< the study identifier: check an object validity in the corresponded document
89 * \class HYDROGUI_NamedObject
90 * \brief Module data object, used for object browser tree creation.
92 * It contains only name inside, without additional data: it is just information
93 * or grouping object in the Object Browser.
94 * This class inherits CAM_DataObject virtually, so it is necessary to call in the class
95 * constructor the CAM object constructor manually for the correct initialization
97 class HYDROGUI_NamedObject : public virtual LightApp_DataObject
102 * \param theParent parent data object
103 * \param theName displayed name
105 HYDROGUI_NamedObject( SUIT_DataObject* theParent,
106 const QString& theName );
109 * Returns the unique object identifier string.
111 virtual QString entry() const;
114 * Returns the name of object.
116 virtual QString name() const;
119 * Returns name of the named object that is identified by this entry.
120 * \param theEntry entry of the object (used for selection identification).
121 * \returns name of the object, or empty string if it is not HYDRO named object
123 static QString nameByEntry( const QString& theEntry );
126 QString myName; ///< name in the OB