C++ main module for gpm Package  1.0
GPMG_MovieGraphWindow.h
Go to the documentation of this file.
1 #ifndef GPMG_MovieGraphWindow_H
2 #define GPMG_MovieGraphWindow_H
3 
4 #include "GUI2D_Window.h"
5 #include "GUI_ChildWindow.h"
7 
8 #include "GPMG_MovieGraphPanel.h"
9 #include "GUI2D_MenuPanel.h"
10 
17 class GPMG_MovieGraphWindow : public GUI_ChildWindow,public GUI2D_Window, public GPMG_GraphWindowInterface { // class
18 
19  SP_OBJECT(GPMG_MovieGraphWindow);
20  // ATTRIBUTES
21 
22 private:
23 
24 
25 
26  // ASSOCIATIONS
27 
28 
29  // METHODS
30 
31 
32 protected:
33  // CONSTRUCTORS
34 
38 
39 
40 
41 
42  // DESTRUCTORS
46  virtual ~GPMG_MovieGraphWindow(void);
47 
48 
49 
50 public:
51  // NEW
54  static inline SP::GPMG_MovieGraphWindow New() {
55  SP::GPMG_MovieGraphWindow win(new GPMG_MovieGraphWindow(),
57  win->setThis(win);
58  return win;
59  };
60 
61  virtual void toDoAfterThisSetting() {
62  GUI_ChildWindow::toDoAfterThisSetting();
63  initComponents();
64  }
65 
66  // SET
67 
70  virtual void setIsMovingEnabled(const tBoolean& v) {
71  GUI2D_MenuPanel *menuPanel=dynamic_cast<GUI2D_MenuPanel*>(getMenuPanel());
72  if (menuPanel!=null) {
73  if (v) menuPanel->enableMoveInButton();
74  else menuPanel->disableMoveInButton();
75  }
76  }
77 
78 
79 
82  virtual void resetSelectedObjects() {
83  }
84 
85  // GET
86 
87  virtual const GUI2D_DrawPanel* getDrawPanel() const;
88  virtual GUI2D_DrawPanel* getDrawPanel();
89 
91  return dynamic_cast<const GPMG_MovieGraphDrawPanel*>(getDrawPanel());
92  }
94  return dynamic_cast<GPMG_MovieGraphDrawPanel*>(getDrawPanel());
95  }
96 
97  //actions
100  inline void clearGraphs() {
102  }
105  inline void addGraph(const GPM_ModelGraph& graph,
106  const tString& file,
107  const tReal minPoint[3],
108  const tReal maxPoint[3],
109  const map<tString,tReal*>& bounds) {
110 
111  getMovieDrawPanel()->addGraph(graph,file,minPoint,maxPoint,bounds);
112  }
115  inline void showGraphFiles(const GPMG_Project* project) {
116  // set the environment
117  GPMG_GraphPanel *panel=dynamic_cast<GPMG_GraphPanel*>(getRootPanel());
118  panel->updateEnvironments(project);
119 
120  //draw the files
122  project->getMinPoint(),
123  project->getMaxPoint(),
124  project->getBoundsValue());
125  }
126 
129  inline void goToFirst(){
131  };
132 
135  inline void goToLast(){
137  };
140  inline void next(){
141  getMovieDrawPanel()->next();
142  };
145  inline void previous(){
147  };
150  inline void play(){
151  getMovieDrawPanel()->play(false);
152  };
155  inline void stop(){
156  getMovieDrawPanel()->stop();
157  };
160  inline void record() {
161  getMovieDrawPanel()->save("");
162  }
163 
164 
165  // OTHERS
166 
167 
170  virtual void loadFromUIClass(const UI_Class& mclass);
173  virtual void saveToUIClass(UI_Class& mclass) const;
174 
175 
178  //void loadComponents();
183  virtual void modalWindowClosed(const tFlag& id,
184  const CORE_Object* value);
185 
186 private:
189  void initComponents();
192  //void saveComponents();
193 
194 
195 
196 };
197 #endif
void stop()
stop
Definition: GPMG_MovieGraphWindow.h:155
virtual void saveToUIClass(UI_Class &mclass) const
how to save the object from a mate model class
Definition: GPMG_MovieGraphWindow.cpp:77
virtual void resetSelectedObjects()
reset the selected objects
Definition: GPMG_MovieGraphWindow.h:82
void goToFirst()
go to first graph
Definition: GPMG_MovieGraphDrawPanel.h:241
void goToLast()
go to last graph
Definition: GPMG_MovieGraphDrawPanel.h:250
DEFINE_SPTR(GPMG_MovieGraphWindow)
virtual void setIsMovingEnabled(const tBoolean &v)
set if the moving drawing area is enabled
Definition: GPMG_MovieGraphWindow.h:70
void goToFirst()
go to first action
Definition: GPMG_MovieGraphWindow.h:129
This class describes a model graph.
Definition: GPM_ModelGraph.h:21
void addGraph(const GPM_ModelGraph &graph, const tString &file, const tReal minPoint[3], const tReal maxPoint[3], const map< tString, tReal * > &bounds)
add graph.
Definition: GPMG_MovieGraphDrawPanel.cpp:111
#define tBoolean
Definition: types.h:35
virtual void loadFromUIClass(const UI_Class &mclass)
how to load the object from a Meta Model class
Definition: GPMG_MovieGraphWindow.cpp:73
void record()
record
Definition: GPMG_MovieGraphWindow.h:160
#define null
Definition: types.h:13
virtual const GUI2D_DrawPanel * getDrawPanel() const
Definition: GPMG_MovieGraphWindow.cpp:54
void play()
play
Definition: GPMG_MovieGraphWindow.h:150
this class describes a interface for graph windows
Definition: GPMG_GraphWindowInterface.h:12
const tReal * getMinPoint() const
get the min point of the graphs
Definition: GPMG_Project.h:243
void setGraphFiles(const vector< tString > &files, const tReal minPoint[3], const tReal maxPoint[3], const map< tString, tReal * > &bounds)
set the graph files
Definition: GPMG_MovieGraphDrawPanel.h:96
GPMG_MovieGraphWindow()
build a GPMG_MovieGraphWindow
Definition: GPMG_MovieGraphWindow.cpp:14
this class describes the root panel of the graph window
Definition: GPMG_GraphPanel.h:17
void stop()
play the graphs
Definition: GPMG_MovieGraphDrawPanel.cpp:671
const vector< tString > & getResultGraphFiles() const
get the result graph files
Definition: GPMG_Project.h:361
void addGraph(const GPM_ModelGraph &graph, const tString &file, const tReal minPoint[3], const tReal maxPoint[3], const map< tString, tReal * > &bounds)
add the graph
Definition: GPMG_MovieGraphWindow.h:105
const GPMG_MovieGraphDrawPanel * getMovieDrawPanel() const
Definition: GPMG_MovieGraphWindow.h:90
void previous()
previous
Definition: GPMG_MovieGraphWindow.h:145
const map< tString, tReal * > & getBoundsValue() const
get the bounds
Definition: GPMG_Project.h:253
void play(const tBoolean &isLoopOn)
play the graphs
Definition: GPMG_MovieGraphDrawPanel.cpp:581
void save(const tString &prefix)
save the graphs
Definition: GPMG_MovieGraphDrawPanel.cpp:718
virtual ~GPMG_MovieGraphWindow(void)
destroy a GPMG_MovieGraphWindow
Definition: GPMG_MovieGraphWindow.cpp:19
static SP::GPMG_MovieGraphWindow New()
create a visualization window
Definition: GPMG_MovieGraphWindow.h:54
virtual void toDoAfterThisSetting()
method called after setThis() method this method can oly be called once.
Definition: GPMG_MovieGraphWindow.h:61
This class describes a project.
Definition: GPMG_Project.h:22
void previous()
show previous graph
Definition: GPMG_MovieGraphDrawPanel.h:235
abstract base class for most classes.
Definition: CORE_Object.h:30
#define tString
Definition: types.h:36
const tReal * getMaxPoint() const
get the max point of the graphs
Definition: GPMG_Project.h:248
GPMG_MovieGraphDrawPanel * getMovieDrawPanel()
Definition: GPMG_MovieGraphWindow.h:93
void clearGraphs()
clear the graphs
Definition: GPMG_MovieGraphWindow.h:100
void showGraphFiles(const GPMG_Project *project)
shwo the graph files
Definition: GPMG_MovieGraphWindow.h:115
this class describes a window to show movie of graphs
Definition: GPMG_MovieGraphWindow.h:17
void updateEnvironments(const GPMG_Project *project)
update the environments from a graph
Definition: GPMG_GraphPanel.cpp:136
void next()
next
Definition: GPMG_MovieGraphWindow.h:140
void clearGraphs()
clear the graph
Definition: GPMG_MovieGraphDrawPanel.cpp:171
void next()
show next graph
Definition: GPMG_MovieGraphDrawPanel.h:204
#define tReal
Definition: types.h:18
void goToLast()
go to last action
Definition: GPMG_MovieGraphWindow.h:135
this class describes a Graph Draw Panel.
Definition: GPMG_MovieGraphDrawPanel.h:17
virtual void modalWindowClosed(const tFlag &id, const CORE_Object *value)
load the components of the windows from saving file
Definition: GPMG_MovieGraphWindow.cpp:82
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106
#define tFlag
Definition: types.h:14