C++ main module for gpm Package  1.0
GPMG_FunctionWindow.h
Go to the documentation of this file.
1 #ifndef GPMG_FunctionWindow_H
2 #define GPMG_FunctionWindow_H
3 
4 
6 
7 #include "GUI_ChildWindow.h"
8 #include "GUI_Label.h"
9 
11 
19 class GPMG_FunctionWindow : public GUI_ChildWindow { // class
20  SP_OBJECT(GPMG_FunctionWindow);
21 
22  // ATTRIBUTES
23 
24 private:
25 
26 
27 
28  static const tFlag FUNCTIONS;
29  static const tFlag ADD_FUNCTION;
30  static const tFlag REMOVE_FUNCTION;
31  static const tFlag FUNCTION_NAME;
32  static const tFlag FUNCTION_BODY;
33  static const tFlag FUNCTION_PARAMETERS;
34  static const tFlag RETURN_TYPE;
35 
36  static const tFlag ADD_PARAMETER;
37  static const tFlag REMOVE_PARAMETER;
38  static const tFlag PARAMETER_NAME;
39  static const tFlag PARAMETER_TYPE;
40  static const tFlag PARAMETER_UP;
41  static const tFlag PARAMETER_DOWN;
42 
43 
44 
45  static const tFlag VALIDATE;
46  static const tFlag OK;
47  static const tFlag CANCEL;
48 
49  static const tFlag PAR_CONST_REAL_ARRAY;
50  static const tFlag PAR_REAL_ARRAY;
51  static const tFlag PAR_CONST_REAL;
52  static const tFlag PAR_REAL;
53  static const tFlag PAR_STRING;
54 
55  static const tFlag RET_REAL;
56  static const tFlag RET_STRING;
57 
58 private:
59 
60  int mLastSelectedFunctionIndex;
61  // ASSOCIATIONS
62  SP::GUI_Label mOutLabel;
63  SV::GPM_CompositorFunction mWorkingFunctions;
64  WP::GPMG_FunctionWindowCaller mCaller;
65  // METHODS
66 
67 
68 protected:
69  // CONSTRUCTORS
70 
74 
75 
76 
77 
78  // DESTRUCTORS
82  virtual ~GPMG_FunctionWindow(void);
83 
84 
85 
86 public:
87  // NEW
90  static inline SP::GPMG_FunctionWindow New() {
91  SP::GPMG_FunctionWindow win(new GPMG_FunctionWindow(),
92  GPMG_FunctionWindow::Delete());
93  win->setThis(win);
94  return win;
95  };
96 
99  virtual void toDoAfterThisSetting() {
100  GUI_ChildWindow::toDoAfterThisSetting();
101  createComponents();
102  };
103  // SET
104 
105 
106 public:
109  inline void setCaller(SP::GPMG_FunctionWindowCaller caller) {
110  mCaller=caller;
111  }
114  void setFunctions(SVC::GPM_CompositorFunction fs);
115 
116  // GET
117 public:
118  // SAVER & LOADER
121  virtual void loadFromUIClass(const UI_Class& mclass);
124  virtual void saveToUIClass(UI_Class& mclass) const;
125 
126  // OTHERS
127 
130  virtual void componentClicked(GUI_ActionComponent& compo);
131 
132 
133 
134 private:
135 
138  void createComponents();
139 
142  void validate();
143 
146  void enableComponents();
147 
150  void validateBody(const int& index);
151 
154  void setSelectedFunction(const GPM_CompositorFunction& f);
157  GPM_CompositorFunction* getSelectedFunction(int& iFunction);
160  void setSelectedParameter(const GPM_CompositorFunction& f,
161  const int& index);
164  int getSelectedParameter()const;
167  void getParameterSignature(tString& name,
168  tFlag& type,
169  tFlag& card,
170  tBoolean& isConst) const;
171 
172 
173 };
174 #endif
virtual ~GPMG_FunctionWindow(void)
destroy a GPMG_FunctionWindow
Definition: GPMG_FunctionWindow.cpp:65
void setFunctions(SVC::GPM_CompositorFunction fs)
Definition: GPMG_FunctionWindow.cpp:244
#define tBoolean
Definition: types.h:35
void setCaller(SP::GPMG_FunctionWindowCaller caller)
set the caller
Definition: GPMG_FunctionWindow.h:109
DEFINE_SPTR(GPMG_FunctionWindowCaller)
virtual void saveToUIClass(UI_Class &mclass) const
how to save the object from a mate model class
Definition: GPMG_FunctionWindow.cpp:234
This class describes a compositor function used in rules.
Definition: GPM_CompositorFunction.h:18
static SP::GPMG_FunctionWindow New()
create a visualization window
Definition: GPMG_FunctionWindow.h:90
this class describes a caller of GPMG_FunctionWindow
Definition: GPMG_FunctionWindowCaller.h:15
this class describes a window to display function
Definition: GPMG_FunctionWindow.h:19
virtual void componentClicked(GUI_ActionComponent &compo)
method called when a component are clicked on
Definition: GPMG_FunctionWindow.cpp:415
#define tString
Definition: types.h:36
GPMG_FunctionWindow()
build a GPMG_FunctionWindow
Definition: GPMG_FunctionWindow.cpp:59
virtual void loadFromUIClass(const UI_Class &mclass)
how to load the object from a Meta Model class
Definition: GPMG_FunctionWindow.cpp:239
#define tFlag
Definition: types.h:14
virtual void toDoAfterThisSetting()
method called after this setting
Definition: GPMG_FunctionWindow.h:99