Version: 9.12.0
SalomeApp_DataObject.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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, or (at your option) any later version.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 // File : SalomeApp_DataObject.h
24 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
25 
26 #ifndef SALOMEAPP_DATAOBJECT_H
27 #define SALOMEAPP_DATAOBJECT_H
28 
29 #include "SalomeApp.h"
30 #include <LightApp_DataObject.h>
31 #include <SALOMEDSClient.hxx>
32 
33 class SalomeApp_Study;
34 
36 {
37 
38 public:
40  enum {
41  ValueId = RefEntryId + 1,
43  LastId
44  };
45 
46 public:
48  SalomeApp_DataObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
49  virtual ~SalomeApp_DataObject();
50 
51  virtual QString name() const;
52  virtual QString entry() const;
53 
54  virtual QString text( const int = NameId ) const;
55  virtual QPixmap icon( const int = NameId ) const;
56  virtual QColor color( const ColorRole, const int = NameId ) const;
57  virtual QString toolTip( const int = NameId ) const;
58  virtual QFont font( const int = NameId ) const;
59 
60  virtual _PTR(SObject) object() const;
61 
62  virtual QString refEntry() const;
63  virtual bool isReference() const;
64  _PTR(SObject) referencedObject() const;
65 
66  bool hasChildren() const;
67  bool expandable() const;
68 
69  virtual bool isVisible() const;
70 
71  virtual QString componentDataType() const;
72 
73  virtual bool customSorting( const int = NameId ) const;
74  virtual bool compare( const QVariant&, const QVariant&, const int = NameId ) const;
75 
76  virtual void insertChildAtTag( SalomeApp_DataObject*, int );
77  virtual void updateItem();
78 
79 private:
80  QString ior( const _PTR(SObject)& ) const;
81  QString entry( const _PTR(SObject)& ) const;
82  QString value( const _PTR(SObject)& ) const;
83 
84 private:
85  _PTR(SObject) myObject;
86 };
87 
89  public CAM_ModuleObject
90 {
91 public:
93  SalomeApp_ModuleObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
94  SalomeApp_ModuleObject( CAM_DataModel*, const _PTR(SObject)&, SUIT_DataObject* = 0 );
95  virtual ~SalomeApp_ModuleObject();
96 
97  virtual QString name() const;
98  QPixmap icon( const int = NameId ) const;
99  QString toolTip( const int = NameId ) const;
100 };
101 
103  public LightApp_RootObject
104 {
105 public:
107  virtual ~SalomeApp_RootObject();
108 
109  QString name() const;
110  QString entry() const;
111  QString text( const int = NameId ) const;
112  QPixmap icon( const int = NameId ) const;
113  QColor color( const ColorRole, const int = NameId ) const;
114  QString toolTip( const int = NameId ) const;
115  void setToSynchronize(bool value){_toSynchronize=value;};
116  bool toSynchronize() const {return _toSynchronize;};
117 protected:
119 };
120 
122 {
123 public:
125  virtual ~SalomeApp_SavePointObject();
126 
127  virtual QString name() const;
128  virtual QString entry() const;
129 
130  virtual QPixmap icon( const int = NameId ) const;
131  virtual QString toolTip( const int = NameId ) const;
132 
133  int getId() const;
134 
135 private:
136  int myId;
138 };
139 
141 {
142 public:
144 
145  virtual QString name() const;
146  virtual QString toolTip( const int = NameId ) const;
147 };
148 
149 #endif
#define SALOMEAPPIMPL_EXPORT
Definition: SalomeApp.h:55
_PTR(Study) SalomeApp_Application
Definition: SalomeApp_Application.cxx:1380
Base class for all data models used in CAM-based applications.
Definition: CAM_DataModel.h:37
CAM data model root object.
Definition: CAM_DataObject.h:44
Base data object class to build the data model for all the SALOME modules.
Definition: LightApp_DataObject.h:36
virtual QString text(const int=NameId) const
Get object text data for the specified column.
Definition: LightApp_DataObject.cxx:296
virtual QColor color(const ColorRole, const int=NameId) const
Get data object color for the specified column.
Definition: LightApp_DataObject.cxx:330
virtual QString componentDataType() const
Get component type.
Definition: LightApp_DataObject.cxx:392
virtual QString entry() const
Get object string identifier.
Definition: LightApp_DataObject.cxx:243
Root data object for the light (without CORBA) SALOME application.
Definition: LightApp_DataObject.h:95
Definition: LightApp_Study.h:67
Data object representing the data instance in the tree-like hierarchy.
Definition: SUIT_DataObject.h:49
virtual QPixmap icon(const int=NameId) const
Get data object icon for the specified column.
Definition: SUIT_DataObject.cxx:487
virtual QString name() const
Get data object name.
Definition: SUIT_DataObject.cxx:454
virtual QString toolTip(const int=NameId) const
Get data object tooltip for the specified column.
Definition: SUIT_DataObject.cxx:521
ColorRole
Color role.
Definition: SUIT_DataObject.h:54
virtual QFont font(const int=NameId) const
Get data object font for the specified column.
Definition: SUIT_DataObject.cxx:570
Implementation of the data object for use in CORBA-based SALOME modules.
Definition: SalomeApp_DataObject.h:36
@ IORId
IOR column.
Definition: SalomeApp_DataObject.h:42
bool hasChildren() const
QString value(const _PTR(SObject)&) const
virtual bool compare(const QVariant &, const QVariant &, const int=NameId) const
Compares data from two items for sorting purposes.
virtual QString refEntry() const
Returns the string identifier of the data objects referenced by this one.
virtual _PTR(SObject) object() const
bool expandable() const
_PTR(SObject) referencedObject() const
virtual bool isReference() const
Tells if this data objects is a reference to some other or not.
_PTR(SObject) myObject
QString ior(const _PTR(SObject)&) const
virtual void insertChildAtTag(SalomeApp_DataObject *, int)
QString entry(const _PTR(SObject)&) const
virtual bool isVisible() const
Check if the object is visible.
virtual bool customSorting(const int=NameId) const
Check if the specified column supports custom sorting.
This class is used for optimized access to the SALOMEDS-based data model from SalomeApp_DataObject cl...
Definition: SalomeApp_DataObject.h:90
Root data object for the CORBA-based SALOME application.
Definition: SalomeApp_DataObject.h:104
void setToSynchronize(bool value)
Definition: SalomeApp_DataObject.h:115
bool toSynchronize() const
Definition: SalomeApp_DataObject.h:116
bool _toSynchronize
Definition: SalomeApp_DataObject.h:116
Represents persistent visual_state object.
Definition: SalomeApp_DataObject.h:122
SalomeApp_Study * myStudy
Definition: SalomeApp_DataObject.h:137
int myId
Definition: SalomeApp_DataObject.h:136
Represents parent object for visual_state objects.
Definition: SalomeApp_DataObject.h:141
Definition: SalomeApp_Study.h:37