Version: 6.3.1

src/SalomeApp/SalomeApp_DataObject.h

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // File   : SalomeApp_DataObject.h
00024 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
00025 //
00026 #ifndef SALOMEAPP_DATAOBJECT_H
00027 #define SALOMEAPP_DATAOBJECT_H
00028 
00029 #include "SalomeApp.h"
00030 #include <LightApp_DataObject.h>
00031 #include <SALOMEDSClient.hxx>
00032 
00033 class SalomeApp_Study;
00034 
00035 class SALOMEAPP_EXPORT SalomeApp_DataObject : public virtual LightApp_DataObject
00036 {
00037 
00038 public:
00040   enum {
00041     ValueId = EntryId + 1,    
00042     IORId,                    
00043     RefEntryId                
00044   };
00045 
00046 public:
00047   SalomeApp_DataObject( SUIT_DataObject* = 0 );
00048   SalomeApp_DataObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
00049   virtual ~SalomeApp_DataObject();
00050 
00051   virtual QString        name() const;
00052   virtual QString        entry() const;
00053 
00054   virtual QString        text( const int = NameId ) const;
00055   virtual QPixmap        icon( const int = NameId ) const;
00056   virtual QColor         color( const ColorRole, const int = NameId ) const;
00057   virtual QString        toolTip( const int = NameId ) const;
00058   virtual QFont          font( const int = NameId ) const;
00059 
00060   virtual _PTR(SObject)  object() const;
00061 
00062   bool                   isReference() const;
00063   _PTR(SObject)          referencedObject() const;
00064   bool                   hasChildren() const;
00065   bool                   expandable() const;
00066 
00067   virtual bool           isVisible() const;
00068 
00069   virtual QString        componentDataType() const;
00070 
00071   virtual bool           customSorting( const int = NameId ) const;
00072   virtual bool           compare( const QVariant&, const QVariant&, const int = NameId ) const;
00073 
00074   virtual void           insertChildAtTag( SalomeApp_DataObject*, int );
00075   virtual void           updateItem();
00076 
00077 private:
00078   QString                ior( const _PTR(SObject)& ) const;
00079   QString                entry( const _PTR(SObject)& ) const;
00080   QString                value( const _PTR(SObject)& ) const;
00081 
00082 private:
00083   _PTR(SObject)          myObject;
00084 };
00085 
00086 class SALOMEAPP_EXPORT SalomeApp_ModuleObject : public SalomeApp_DataObject,
00087                                                 public CAM_ModuleObject
00088 {
00089 public:
00090   SalomeApp_ModuleObject( SUIT_DataObject* = 0 );
00091   SalomeApp_ModuleObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
00092   SalomeApp_ModuleObject( CAM_DataModel*, const _PTR(SObject)&, SUIT_DataObject* = 0 );
00093   virtual ~SalomeApp_ModuleObject();
00094 
00095   virtual QString        name() const;
00096   QPixmap                icon( const int = NameId ) const;
00097   QString                toolTip( const int = NameId ) const;
00098 };
00099 
00100 class SALOMEAPP_EXPORT SalomeApp_RootObject : public SalomeApp_DataObject,
00101                                               public LightApp_RootObject
00102 {
00103 public:
00104   SalomeApp_RootObject( LightApp_Study* );
00105   virtual ~SalomeApp_RootObject();
00106 
00107   QString                name() const;
00108   QString                entry() const;
00109   QString                text( const int = NameId ) const;
00110   QPixmap                icon( const int = NameId ) const;
00111   QColor                 color( const ColorRole, const int = NameId ) const;
00112   QString                toolTip( const int = NameId ) const;
00113   void                   setToSynchronize(bool value){_toSynchronize=value;};
00114   bool                   toSynchronize() const {return _toSynchronize;};
00115 protected:
00116   bool _toSynchronize;
00117 };
00118 
00119 class SALOMEAPP_EXPORT SalomeApp_SavePointObject : public virtual LightApp_DataObject
00120 {
00121 public:
00122   SalomeApp_SavePointObject( SUIT_DataObject*, const int, SalomeApp_Study* );
00123   virtual ~SalomeApp_SavePointObject();
00124 
00125   virtual QString        name() const;
00126   virtual QString        entry() const;
00127 
00128   virtual QPixmap        icon( const int = NameId ) const;
00129   virtual QString        toolTip( const int = NameId ) const;
00130 
00131   int                    getId() const;
00132 
00133 private:
00134   int                    myId;
00135   SalomeApp_Study*       myStudy;
00136 };
00137 
00138 class SALOMEAPP_EXPORT SalomeApp_SavePointRootObject : public SUIT_DataObject
00139 {
00140 public:
00141   SalomeApp_SavePointRootObject( SUIT_DataObject* );
00142 
00143   virtual QString        name() const;
00144   virtual QString        toolTip( const int = NameId ) const;
00145 };
00146 
00147 #endif
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS