Back to index

salome-kernel  6.5.0
SALOME_StudyEditor.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 // Author: Guillaume Boulant (EDF/R&D)
00020 
00021 #ifndef __STUDY_EDITOR_HXX__
00022 #define __STUDY_EDITOR_HXX__
00023 
00024 #include "KernelHelpers.hxx"
00025 
00026 #include <SALOMEconfig.h>
00027 #include CORBA_CLIENT_HEADER(SALOMEDS)
00028 #include CORBA_SERVER_HEADER(SALOME_Component)
00029 
00030 #include <vector>
00031 
00032 class KERNELHELPERS_EXPORT SALOME_StudyEditor {
00033 
00034 public:
00035   SALOME_StudyEditor(int studyId);
00036   SALOME_StudyEditor(SALOMEDS::Study_ptr study);
00037 
00038   typedef std::vector<SALOMEDS::SObject_ptr> SObjectList;
00039 
00040   SALOMEDS::SComponent_ptr newRoot(const char * moduleName);  
00041   SALOMEDS::SComponent_ptr findRoot(const char * moduleName);
00042   bool bindEngine(SALOMEDS::SComponent_var studyRoot,Engines::EngineComponent_var engine);
00043 
00044   SALOMEDS::SObject_ptr newObject(SALOMEDS::SObject_ptr parent);
00045   SALOMEDS::SObject_ptr findObject(const char * entry);
00046   void setName(SALOMEDS::SObject_var sobject, const char * value);
00047   const char * getName(SALOMEDS::SObject_var sobject);
00048 
00049   void setIcon(SALOMEDS::SObject_var sobject, const char * resourcename);
00050 
00051   void setParameterInt(SALOMEDS::SObject_var sobject, const char * name, int value);
00052   int  getParameterInt(SALOMEDS::SObject_var sobject, const char * name);
00053   void setParameterBool(SALOMEDS::SObject_var sobject, const char * name, bool value);
00054   bool getParameterBool(SALOMEDS::SObject_var sobject, const char * name);
00055 
00056   static const int UNDEFINED = -1;
00057 
00058 protected:
00059   SALOME_StudyEditor();
00060   void setStudy(SALOMEDS::Study_ptr study);
00061   void setStudyById(int studyId);
00062   int getStudyId();
00063 
00064   SALOMEDS::Study_var _study;
00065 
00066 private:
00067   SALOMEDS::StudyBuilder_var _sbuilder;
00068 };
00069 
00070 #endif // __STUDY_EDITOR_HXX__