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#include "albaServiceClient.h"
27
28//----------------------------------------------------------------------------
29// forward references :
30//----------------------------------------------------------------------------
31class albaVME;
32class albaVMERoot;
33class albaView;
34class albaGUIViewPanel;
35class albaRWIBase;
37
38#ifdef ALBA_EXPORTS
39#include "albaDllMacros.h"
40EXPORT_STL_VECTOR(ALBA_EXPORT,long);
41#endif
42
43//----------------------------------------------------------------------------
44// Widgets ID's
45//----------------------------------------------------------------------------
47{
52};
53
54//----------------------------------------------------------------------------
55// albaViewManager :
56//----------------------------------------------------------------------------
58class ALBA_EXPORT albaViewManager : albaObserver, albaGUISettings, public albaServiceClient
59{
60
61public:
64 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
65 virtual void OnEvent(albaEventBase *alba_event);
66
68 void FillMenu (wxMenu* menu);
69
72
74 void VmeAdd(albaVME *n);
75
78
80 void VmeSelect(albaVME *vme);
81
83 void VmeShow(albaVME *vme, bool show);
84
86 void VmeModified(albaVME *vme); //SIL. 9-3-2005:
87
89 virtual void ViewAdd(albaView *view, bool visibleInMenu = true);
90
92 void ViewSelected(albaView *view /*, albaRWIBase *rwi*/);
93
95 void Activate(albaView *view);
96
98 virtual albaView *ViewCreate(int id);
99
101 virtual albaView *ViewCreate(wxString label);
102
104 void ViewInsert(albaView *view);
105
107 virtual void ViewDelete(albaView *view);
108
110 virtual void ViewDeleteAll();
111
113 void CameraReset(bool sel = false);
114
116 void CameraReset(albaVME *vme);
117
119 void CameraUpdate(bool only_selected = false);
120
122 void PropertyUpdate(bool fromTag = false);
123
126
128 albaVME *GetCurrentRoot() {return (albaVME*)m_RootVme;};
129
131 albaView *GetList() {return m_ViewList;};
132
134 albaView *GetFromList(const char *label);
135
137 albaView **GetListTemplate() {return m_ViewTemplate;};
138
140 void OnQuit();
141
143 albaView *GetView(int id, int mult) {return m_ViewMatrixID[id][mult];};
144
147
148 /* Return the gui for Settings Dialog*/
150
151 void OpenOnlyViewForType(int chose) { m_ViewOpenOnlyOne = chose; };
152 void MaximizeViewOnOpen(int chose) { m_ViewMaximize = chose; };
153 void EnableViewSettings(bool enable = true);
154
155protected:
156
159
161 albaView *m_ViewList; // created view list
162
163 albaView *m_ViewTemplate[MAXVIEW]; // view template vector
164 int m_TemplateNum; // number of template
165
172 albaView *m_ViewMatrixID[MAXVIEW][MAXVIEW];
173
174 std::vector<long> m_IdInvisibleMenuList;
175
177
181
183 friend class albaViewManagerTest;
184};
185#endif
MINID
Definition: albaDecl.h:416
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:62
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.
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:78