]> SALOME platform Git repositories - modules/gui.git/blob - src/SalomeApp/SalomeApp_DataObject.h
Salome HOME
New Help for KERNEL & GUI.
[modules/gui.git] / src / SalomeApp / SalomeApp_DataObject.h
1 #ifndef SALOMEAPP_DATAOBJECT_H
2 #define SALOMEAPP_DATAOBJECT_H
3
4 #include "SalomeApp.h"
5
6 #include "CAM_DataObject.h"
7 #include "CAM_RootObject.h"
8
9 #include "SALOMEDSClient.hxx"
10
11 class SalomeApp_Study;
12
13 class SALOMEAPP_EXPORT SalomeApp_DataObject : public virtual CAM_DataObject
14 {
15   class Key;
16
17 public:
18   enum { CT_Value, CT_Entry, CT_IOR, CT_RefEntry };
19
20 public:
21   SalomeApp_DataObject( SUIT_DataObject* = 0 );
22   SalomeApp_DataObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
23   virtual ~SalomeApp_DataObject();
24     
25   virtual QString                 name() const;
26   virtual QPixmap                 icon() const;
27   virtual QString                 toolTip() const;
28
29   virtual QString                 text( const int ) const;
30   virtual QColor                  color( const ColorRole ) const;
31
32   virtual SUIT_DataObjectKey*     key() const;
33   virtual QString                 entry() const;
34
35   /*! location of corresponding SALOMEDS::SObject  */
36   virtual _PTR(SObject)           object() const;
37
38   bool                            isReference() const;
39   _PTR(SObject)                   referencedObject() const;
40
41   SUIT_DataObject*                componentObject() const;
42   /*! GEOM, SMESH, VISU, etc.*/
43   QString                         componentDataType() const;
44
45 private:
46   QString                         ior( const _PTR(SObject)& ) const;
47   QString                         entry( const _PTR(SObject)& ) const;
48   QString                         value( const _PTR(SObject)& ) const;
49
50 private:
51   _PTR(SObject)                   myObject;
52 };
53
54 /*!
55  * SalomeApp_ModuleObject - class for optimized access to DataModel from
56  * SalomeApp_DataObject instances - see also CAM_RootObject.h
57  */
58
59 class SALOMEAPP_EXPORT SalomeApp_ModuleObject : public SalomeApp_DataObject,
60                                                 public CAM_RootObject
61 {
62 public:
63   SalomeApp_ModuleObject( SUIT_DataObject* = 0 );
64   SalomeApp_ModuleObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
65   SalomeApp_ModuleObject( CAM_DataModel*, const _PTR(SObject)&, SUIT_DataObject* = 0 );
66   virtual ~SalomeApp_ModuleObject();
67 };
68
69 #endif