C++ main module for gpm Package  1.0
GPMG_EnvironmentWindow.h
Go to the documentation of this file.
1 #ifndef GPMG_EnvironmentWindow_H
2 #define GPMG_EnvironmentWindow_H
3 
4 
5 #include "GUI_ChildWindow.h"
7 
8 
9 #include "GPMG_Project.h"
10 #include "GPMG_EnvironmentPanel.h"
11 
18 
19 class GPMG_EnvironmentWindow : public GUI_ChildWindow , public virtual GPMG_FunctionWindowCaller { // class
20  SP_OBJECT(GPMG_EnvironmentWindow);
21 
22  // ATTRIBUTES
23 
24 private:
25 
26  map<tString,SP::GPM_Variable> mGlobalEnvironment;
27 
28 
29  static const tFlag VALIDATE;
30  static const tFlag OK;
31  static const tFlag CANCEL;
32  static const tFlag FUNCTIONS;
33  static const tFlag SHOW_FUNCTIONS;
34 
35 private:
36 
37 
38  // ASSOCIATIONS
39 
40 
41  SP::GPMG_Project mProject;
42  SP::GPMG_EnvironmentPanel mEnvironmentPanel;
43 
44  // METHODS
45 
46 
47 protected:
48  // CONSTRUCTORS
49 
53 
54 
55 
56 
57  // DESTRUCTORS
61  virtual ~GPMG_EnvironmentWindow(void);
62 
63 
64 
65 public:
66  // NEW
69  static inline SP::GPMG_EnvironmentWindow New() {
70  SP::GPMG_EnvironmentWindow win(new GPMG_EnvironmentWindow(),
72  win->setThis(win);
73  return win;
74  };
75 
78  virtual void toDoAfterThisSetting() {
79  GUI_ChildWindow::toDoAfterThisSetting();
80  createComponents();
81  };
82  // SET
83 
86  inline void setProject(SP::GPMG_Project project) {
87  mProject=project;
88  setEnvironment(mProject->getEnvironment(GPMG_Project::GLOBAL_ENVIRONMENT));
89  setFunctionsPanel();
90  GUI_ActionComponent *compo=getActionComponent(SHOW_FUNCTIONS);
91  if (compo!=null) compo->setIsEnabled(mProject->areCompositorFunctionsAvailabled());
92  }
93 private:
96  void setEnvironment(const map<tString,SP::GPM_Variable>& env);
97 
100  virtual void setFunctions(SV::GPM_CompositorFunction fs);
101 
102 private:
105  void setFunctionsPanel();
106 
109  void showFunctions();
110 
111 
112  // GET
113 public:
114  // SAVER & LOADER
117  virtual void loadFromUIClass(const UI_Class& mclass);
120  virtual void saveToUIClass(UI_Class& mclass) const;
121 
122  // OTHERS
123 
126  virtual void componentClicked(GUI_ActionComponent& compo);
127 
128 
129 
130 private:
131 
134  void createComponents();
135 
138  void validate();
139 
140 };
141 #endif
virtual void loadFromUIClass(const UI_Class &mclass)
how to load the object from a Meta Model class
Definition: GPMG_EnvironmentWindow.cpp:121
virtual ~GPMG_EnvironmentWindow(void)
destroy a GPMG_EnvironmentWindow
Definition: GPMG_EnvironmentWindow.cpp:39
virtual void toDoAfterThisSetting()
method called after this setting
Definition: GPMG_EnvironmentWindow.h:78
#define null
Definition: types.h:13
this class describes a window to display environment
Definition: GPMG_EnvironmentWindow.h:19
void setProject(SP::GPMG_Project project)
set the graph
Definition: GPMG_EnvironmentWindow.h:86
this class describes a caller of GPMG_FunctionWindow
Definition: GPMG_FunctionWindowCaller.h:15
virtual void saveToUIClass(UI_Class &mclass) const
how to save the object from a mate model class
Definition: GPMG_EnvironmentWindow.cpp:116
virtual void componentClicked(GUI_ActionComponent &compo)
method called when a component are clicked on
Definition: GPMG_EnvironmentWindow.cpp:143
static SP::GPMG_EnvironmentWindow New()
create a visualization window
Definition: GPMG_EnvironmentWindow.h:69
DEFINE_SPTR(GPMG_EnvironmentWindow)
static const tFlag GLOBAL_ENVIRONMENT
Definition: GPMG_Project.h:30
GPMG_EnvironmentWindow()
build a GPMG_EnvironmentWindow
Definition: GPMG_EnvironmentWindow.cpp:33
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106
#define tFlag
Definition: types.h:14