Version: 8.3.0
SALOME_StudyEditor.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author: Guillaume Boulant (EDF/R&D)
20 
21 #ifndef __STUDY_EDITOR_HXX__
22 #define __STUDY_EDITOR_HXX__
23 
24 #include "KernelHelpers.hxx"
25 
26 #include <SALOMEconfig.h>
27 #include CORBA_CLIENT_HEADER(SALOMEDS)
28 #include CORBA_SERVER_HEADER(SALOME_Component)
29 
30 #include <vector>
31 
33 
34 public:
35  SALOME_StudyEditor(int studyId);
36  SALOME_StudyEditor(SALOMEDS::Study_ptr study);
37 
38  typedef std::vector<SALOMEDS::SObject_ptr> SObjectList;
39 
40  SALOMEDS::SComponent_ptr newRoot(const char * moduleName);
41  SALOMEDS::SComponent_ptr findRoot(const char * moduleName);
42  bool bindEngine(SALOMEDS::SComponent_var studyRoot,Engines::EngineComponent_var engine);
43 
44  SALOMEDS::SObject_ptr newObject(SALOMEDS::SObject_ptr parent);
45  SALOMEDS::SObject_ptr findObject(const char * entry);
46  void setName(SALOMEDS::SObject_var sobject, const char * value);
47  const char * getName(SALOMEDS::SObject_var sobject);
48 
49  void setIcon(SALOMEDS::SObject_var sobject, const char * resourcename);
50 
51  void setParameterInt(SALOMEDS::SObject_var sobject, const char * name, int value);
52  int getParameterInt(SALOMEDS::SObject_var sobject, const char * name);
53  void setParameterBool(SALOMEDS::SObject_var sobject, const char * name, bool value);
54  bool getParameterBool(SALOMEDS::SObject_var sobject, const char * name);
55 
56  static const int UNDEFINED = -1;
57 
58 protected:
60  void setStudy(SALOMEDS::Study_ptr study);
61  void setStudyById(int studyId);
62  int getStudyId();
63 
64  SALOMEDS::Study_var _study;
65 
66 private:
67  SALOMEDS::StudyBuilder_var _sbuilder;
68 };
69 
70 #endif // __STUDY_EDITOR_HXX__