]> SALOME platform Git repositories - modules/gui.git/blob - src/SalomeApp/SalomeApp_DataObject.h
Salome HOME
Copyrights update
[modules/gui.git] / src / SalomeApp / SalomeApp_DataObject.h
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either 
6 // version 2.1 of the License.
7 // 
8 // This library is distributed in the hope that it will be useful 
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public  
14 // License along with this library; if not, write to the Free Software 
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/
18 //
19 #ifndef SALOMEAPP_DATAOBJECT_H
20 #define SALOMEAPP_DATAOBJECT_H
21
22 #include "SalomeApp.h"
23
24 #include "LightApp_DataObject.h"
25 #include "CAM_RootObject.h"
26
27 #include "SALOMEDSClient.hxx"
28
29 class SalomeApp_Study;
30
31 class SALOMEAPP_EXPORT SalomeApp_DataObject : public LightApp_DataObject
32 {
33
34 public:
35   enum { CT_Value, CT_Entry, CT_IOR, CT_RefEntry };
36
37 public:
38   SalomeApp_DataObject( SUIT_DataObject* = 0 );
39   SalomeApp_DataObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
40   virtual ~SalomeApp_DataObject();
41     
42   virtual QString                 name() const;
43   virtual QPixmap                 icon() const;
44   virtual QString                 toolTip() const;
45
46   virtual QString                 text( const int ) const;
47   virtual QColor                  color( const ColorRole ) const;
48
49   virtual QString                 entry() const;
50
51   /*! location of corresponding SALOMEDS::SObject  */
52   virtual _PTR(SObject)           object() const;
53
54   bool                            isReference() const;
55   _PTR(SObject)                   referencedObject() const;
56
57   /*! GEOM, SMESH, VISU, etc.*/
58   virtual QString                 componentDataType() const;
59
60 private:
61   QString                         ior( const _PTR(SObject)& ) const;
62   QString                         entry( const _PTR(SObject)& ) const;
63   QString                         value( const _PTR(SObject)& ) const;
64
65 private:
66   _PTR(SObject)                   myObject;
67 };
68
69 /*!
70  * SalomeApp_ModuleObject - class for optimized access to DataModel from
71  * SalomeApp_DataObject instances - see also CAM_RootObject.h
72  */
73
74 class SALOMEAPP_EXPORT SalomeApp_ModuleObject : public SalomeApp_DataObject,
75                                                 public CAM_RootObject
76 {
77 public:
78   SalomeApp_ModuleObject( SUIT_DataObject* = 0 );
79   SalomeApp_ModuleObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
80   SalomeApp_ModuleObject( CAM_DataModel*, const _PTR(SObject)&, SUIT_DataObject* = 0 );
81   virtual ~SalomeApp_ModuleObject();
82
83   virtual QString        name() const;
84 };
85
86 #endif