X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FLightApp%2FLightApp_Study.h;h=ba820d3063020633f3d21311935d3be8d3d64aab;hb=8d3405d6aa5e63bb6680dca7d21c2df6c555e783;hp=2e0ac32260b04ab779b93fc8e28833fd673b62fe;hpb=101fd10f1e736daa5d7f0f0ee5499b951460832a;p=modules%2Fgui.git diff --git a/src/LightApp/LightApp_Study.h b/src/LightApp/LightApp_Study.h index 2e0ac3226..ba820d306 100644 --- a/src/LightApp/LightApp_Study.h +++ b/src/LightApp/LightApp_Study.h @@ -1,37 +1,68 @@ -// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D -// +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #ifndef LIGHTAPP_STUDY_H #define LIGHTAPP_STUDY_H -#include -#include +#include "LightApp.h" +#include "LightApp_Driver.h" #include -#include -#include #include "string" #include "vector" +#include + +#include +#include +class SUIT_Study; class SUIT_Application; class CAM_DataModel; - +class CAM_ModuleObject; +class LightApp_DataObject; +class LightApp_DataModel; + +//Map to store visual property of the object. +//Key: Name of the visual property of the object. +//Value: value of the visual property. +typedef QMap PropMap; + +//Map to store objects with it's visual properties. +//Key: Entry of the object. +//Value: Map of the visual properties of the object. +typedef QMap ObjMap; + +//Map to store view managers and all objects which displayed in views of the view managers. +//Key: Id of the viewer. +//Value: Map of the objects with it's visual properties. +typedef QMap ViewMgrMap; + + +/*! + Custom study, using for open/close of documents HDF format. + Data of each module can be saved to different files, those + after that are combined into one HDF file +*/ class LIGHTAPP_EXPORT LightApp_Study : public CAM_Study { Q_OBJECT @@ -40,7 +71,7 @@ public: LightApp_Study( SUIT_Application* ); virtual ~LightApp_Study(); - virtual void createDocument(); + virtual bool createDocument( const QString& ); virtual bool openDocument( const QString& ); virtual bool loadDocument( const QString& ); @@ -61,6 +92,26 @@ public: virtual bool isComponent( const QString& ) const; virtual void children( const QString&, QStringList& ) const; virtual void components( QStringList& ) const; + virtual QString centry( const QString& ) const; + + virtual QString getVisualComponentName() const; + + virtual void setObjectProperty( int, const QString&, const QString&, const QVariant& ); + virtual void setObjectProperty( const QString&, const QString&, const QVariant& ); + virtual void setObjectProperty( int, const QString&, const QVariant& ); + virtual void setObjectProperties( int, const QString&, const PropMap& ); + virtual QVariant getObjectProperty( int, const QString&, const QString&, const QVariant& ) const; + virtual const PropMap& getObjectProperties( int, const QString& ); + virtual const ObjMap& getObjectProperties( int ); + virtual const ViewMgrMap& getObjectProperties() const; + virtual void removeObjectProperties( int ); + virtual void removeObjectProperties( const QString& ); + + virtual void setVisibilityState(const QString& theEntry, Qtx::VisibilityState theState); + virtual Qtx::VisibilityState visibilityState(const QString& theEntry) const; + virtual void setVisibilityStateForAll(Qtx::VisibilityState theState); + + virtual LightApp_DataObject* findObjectByEntry( const QString& theEntry ); protected: virtual void saveModuleData ( QString theModuleName, QStringList theListOfFiles ); @@ -76,6 +127,8 @@ protected: protected: virtual bool openDataModel ( const QString&, CAM_DataModel* ); + virtual CAM_ModuleObject* createModuleObject( LightApp_DataModel* theDataModel, + SUIT_DataObject* theParent ) const; signals: void saved ( SUIT_Study* ); @@ -83,11 +136,15 @@ signals: void closed ( SUIT_Study* ); void created( SUIT_Study* ); + void objVisibilityChanged( QString, Qtx::VisibilityState ); + private: LightApp_Driver* myDriver; + ViewMgrMap myViewMgrMap; friend class LightApp_Application; + friend class LightApp_DataModel; }; #endif