ALBA
albaViewManager.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaViewManager
5 Authors: Silvano Imboden
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16
17#ifndef __albaViewManager_H__
18#define __albaViewManager_H__
19
20//----------------------------------------------------------------------------
21// includes :
22//----------------------------------------------------------------------------
23#include "albaEvent.h"
24#include "albaObserver.h"
25#include "albaGUISettings.h"
26
27//----------------------------------------------------------------------------
28// forward references :
29//----------------------------------------------------------------------------
30class albaVME;
31class albaVMERoot;
32class albaView;
33class albaGUIViewPanel;
34class albaRWIBase;
36
37#ifdef ALBA_EXPORTS
38#include "albaDllMacros.h"
39EXPORT_STL_VECTOR(ALBA_EXPORT,long);
40#endif
41
42//----------------------------------------------------------------------------
43// Widgets ID's
44//----------------------------------------------------------------------------
46{
51};
52
53//----------------------------------------------------------------------------
54// albaViewManager :
55//----------------------------------------------------------------------------
58{
59
60public:
63 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
64 virtual void OnEvent(albaEventBase *alba_event);
65
67 void FillMenu (wxMenu* menu);
68
71
73 void VmeAdd(albaVME *n);
74
77
79 void VmeSelect(albaVME *vme);
80
82 void VmeShow(albaVME *vme, bool show);
83
85 void VmeModified(albaVME *vme); //SIL. 9-3-2005:
86
88 virtual void ViewAdd(albaView *view, bool visibleInMenu = true);
89
91 void ViewSelected(albaView *view /*, albaRWIBase *rwi*/);
92
94 void Activate(albaView *view);
95
97 virtual albaView *ViewCreate(int id);
98
100 virtual albaView *ViewCreate(wxString label);
101
103 void ViewInsert(albaView *view);
104
106 virtual void ViewDelete(albaView *view);
107
109 virtual void ViewDeleteAll();
110
112 void CameraReset(bool sel = false);
113
115 void CameraReset(albaVME *vme);
116
118 void CameraUpdate(bool only_selected = false);
119
122
124 void PropertyUpdate(bool fromTag = false);
125
128
130 albaVME *GetCurrentRoot() {return (albaVME*)m_RootVme;};
131
133 albaView *GetList() {return m_ViewList;};
134
136 albaView *GetFromList(const char *label);
137
139 albaView **GetListTemplate() {return m_ViewTemplate;};
140
142 void OnQuit();
143
145 albaView *GetView(int id, int mult) {return m_ViewMatrixID[id][mult];};
146
149
150 /* Return the gui for Settings Dialog*/
152
153 void OpenOnlyViewForType(int chose) { m_ViewOpenOnlyOne = chose; };
154 void MaximizeViewOnOpen(int chose) { m_ViewMaximize = chose; };
155 void EnableViewSettings(bool enable = true);
156
157protected:
158
161
163 albaView *m_ViewList; // created view list
164
165 albaView *m_ViewTemplate[MAXVIEW]; // view template vector
166 int m_TemplateNum; // number of template
167
174 albaView *m_ViewMatrixID[MAXVIEW][MAXVIEW];
175
176 std::vector<long> m_IdInvisibleMenuList;
177
179
183
185 friend class albaViewManagerTest;
186};
187#endif
MINID
Definition: albaDecl.h:420
const int MAXVIEW
Definition: albaDecl.h:72
#define EXPORT_STL_VECTOR(declspec_, T_)
Definition: albaDllMacros.h:84
VieweSettingsEvents
@ ID_VIEW_SETTING_MAXIMIZE
@ ID_VIEW_SETTING_OPEN_ONLY_ONE
@ ID_VIEW_SETTING_COLOR_DEFAULT
@ ID_VIEW_SETTING_COLOR
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
class name: albaGUISettings base class for more complex specified classes regarding the setting of ap...
albaGUI is a panel with function to easily create GUI.
Definition: albaGUI.h:110
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaRWIBase is a vtkRenderWindowInteractor placed on a wxWindow
Definition: albaRWIBase.h:61
albaVMERoot - a VME is the root of a tree of VME nodes.
Definition: albaVMERoot.h:35
albaVME -
Definition: albaVME.h:150
An implementation of albaViewManager with [D]ynamic view [C]reation feature.
void CameraFlyToMode()
Set the FlyTo mode for the selected view.
albaObserver * m_Listener
void VmeShow(albaVME *vme, bool show)
Show/Hide the vme in the selected view.
void CameraUpdate(bool only_selected=false)
Update the camera for all opened views; optionally the Update can be limited for the selected view.
albaVME * m_SelectedVme
virtual void ViewAdd(albaView *view, bool visibleInMenu=true)
Add the View to the view-list.
virtual albaView * ViewCreate(wxString label)
Create a view given the type.
void OnQuit()
Empty.
void ViewSelected(albaView *view)
Pass the selected render window to the mouse device.
virtual albaView * ViewCreate(int id)
Create a view at index 'id' of the view-list.
albaView * m_SelectedView
albaRWIBase * m_SelectedRWI
void VmeSelect(albaVME *vme)
Show the selection of the vme in all views.
void OpenOnlyViewForType(int chose)
albaView * GetList()
Return the created view-list.
void InitializeSettings()
Initialize the application settings.
void FillMenu(wxMenu *menu)
Fill the main menù with plugged views.
albaView * m_ViewList
bool IsVisibleInMenu(albaView *v)
Check if the view 'v' should be hidden from the 'View' menu.
void VmeModified(albaVME *vme)
inform the views that a vme was modified
void SetListener(albaObserver *Listener)
void Activate(albaView *view)
Activate the view from software to simulate the click on the view (used by remote).
virtual void OnEvent(albaEventBase *alba_event)
process the events sent by subjects
void EnableViewSettings(bool enable=true)
std::vector< long > m_IdInvisibleMenuList
List of views that are no visible into the 'View' menu item.
albaView * GetFromList(const char *label)
Return a view (defined by label) if is present on open wiews list.
void VmeAdd(albaVME *n)
Add the vme to all views.
void SetMouse(albaDeviceButtonsPadMouse *mouse)
Initialize the action for the mouse device.
albaGUI * GetSettingsGui()
albaGUI * m_SettingsGui
albaView * GetView(int id, int mult)
Return the view pointer from view's id and multiplicity.
albaVMERoot * m_RootVme
albaView * m_ViewBeingCreated
wxColour m_ViewColorBackground
virtual void ViewDeleteAll()
Delete all view.
void ViewInsert(albaView *view)
Insert the view into the view-list, fill the view with the vme tree and select the selected vme.
void MaximizeViewOnOpen(int chose)
void PropertyUpdate(bool fromTag=false)
Call PropertyUpdate for all views.
void CameraReset(albaVME *vme)
Reset the camera to fit the specified vme.
albaView * GetSelectedView()
Return the selected view.
albaVME * GetCurrentRoot()
Return the root of the vme tree.
void CameraReset(bool sel=false)
Reset the camera to fit the selected vme (if sel = true) or all (if sel = false).
albaView ** GetListTemplate()
Return the plugged view-list.
albaDeviceButtonsPadMouse * m_Mouse
virtual void ViewDelete(albaView *view)
Remove the view from the view-list and delete it.
void VmeRemove(albaVME *n)
Remove the vme from all views.
albaView is the base class for Views in alba.
Definition: albaView.h:79