Version: 6.3.1

src/LightApp/LightApp_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   : LightApp_DataObject.h
00024 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
00025 //
00026 #ifndef LIGHTAPP_DATAOBJECT_H
00027 #define LIGHTAPP_DATAOBJECT_H
00028 
00029 #include "LightApp.h"
00030 #include <CAM_DataObject.h>
00031 
00032 class CAM_DataModel;
00033 class LightApp_Study;
00034 
00035 class LIGHTAPP_EXPORT LightApp_DataObject : public virtual CAM_DataObject
00036 {
00037   class Key;
00038 
00039 public:
00041   enum { 
00042     EntryId = VisibilityId + 1    
00043   };
00044 
00045 public:
00046   LightApp_DataObject( SUIT_DataObject* = 0 );
00047   virtual ~LightApp_DataObject();
00048 
00049   virtual SUIT_DataObjectKey*     key() const;
00050   virtual QString                 entry() const;
00051 
00052   virtual QString                 text( const int = NameId ) const;
00053 
00054   virtual SUIT_DataObject*        componentObject() const;
00055   virtual QString                 componentDataType() const;
00056 
00057   virtual bool                    customSorting( const int = NameId ) const;
00058   virtual bool                    compare( const QVariant&, const QVariant&, const int = NameId ) const;
00059   virtual int                     groupId() const;
00060   virtual QVariant                customData(Qtx::CustomDataType type);
00061 
00062   virtual bool                    isVisible() const;
00063   virtual bool                    renameAllowed( const int = NameId ) const;
00064   virtual bool                    setName( const QString& );
00065 
00066 protected:
00067   QString                         myCompDataType;
00068   SUIT_DataObject*                myCompObject;
00069 };
00070 
00071 class LIGHTAPP_EXPORT LightApp_ModuleObject
00072 : public virtual LightApp_DataObject, public CAM_ModuleObject
00073 {
00074 public:
00075   LightApp_ModuleObject( SUIT_DataObject* = 0 );
00076   LightApp_ModuleObject( CAM_DataModel*, SUIT_DataObject* = 0 );
00077 
00078   virtual ~LightApp_ModuleObject();
00079 
00080   virtual QString        name() const;
00081   QPixmap                icon( const int = NameId ) const;
00082   QString                toolTip( const int = NameId ) const;
00083 
00084   virtual void           insertChild( SUIT_DataObject*, int );
00085 };
00086 
00087 class LIGHTAPP_EXPORT LightApp_RootObject : public virtual LightApp_DataObject
00088 {
00089 public:
00090   LightApp_RootObject( LightApp_Study* );
00091 
00092   virtual ~LightApp_RootObject();
00093     
00094   void                   setStudy( LightApp_Study* );
00095   LightApp_Study*        study() const;
00096   
00097 private:
00098   LightApp_Study*        myStudy;
00099 };
00100 
00101 #endif  // LIGHTAPP_DATAOBJECT_H
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