ALBA
albaViewCompound.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaViewCompound
5 Authors: Paolo Quadrani
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 __albaViewCompound_H__
18#define __albaViewCompound_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaView.h"
24
25//----------------------------------------------------------------------------
26// forward references :
27//----------------------------------------------------------------------------
29class albaSceneGraph;
30class albaGUI;
31class albaRWIBase;
32
33#ifdef ALBA_EXPORTS
34#include "albaDllMacros.h"
35EXPORT_STL_VECTOR(ALBA_EXPORT,albaView*);
36#endif
37
38//----------------------------------------------------------------------------
39// albaViewCompound :
40//----------------------------------------------------------------------------
50class ALBA_EXPORT albaViewCompound: public albaView
51{
52public:
53 albaViewCompound(const wxString &label = "View Compound", int num_row = 1, int num_col = 2);
55
57
59 {
60 GRID_LAYOUT = 0,
64 LAYOUT_CUSTOM
65 };
66
70 virtual void PlugChildView(albaView *child);
71
74 virtual void PackageView() {};
75
76 virtual albaView *Copy(albaObserver *Listener, bool lightCopyEnabled = false);
77
80 virtual void Create();
81
84 virtual void CreateGuiView();
85
86 virtual void OnEvent(albaEventBase *alba_event);
87
90 virtual void VmeAdd(albaVME *vme);
91
94 virtual void VmeRemove(albaVME *vme);
95 virtual void VmeSelect(albaVME *node, bool select);
98 virtual void VmeShow(albaVME *vme, bool show);
99 virtual void VmeUpdateProperty(albaVME *vme, bool fromTag = false);
100
101 virtual bool IsVmeShowed(albaVME *vme);;
102
103 virtual void CameraReset(albaVME *vme = NULL);
104 virtual void CameraUpdate();
105
109 virtual int GetNodeStatus(albaVME *vme);
110
112 virtual void SetWindowSize(int w, int h);;
113
115 virtual void OnSize(wxSizeEvent &event);
116
119 {
120 ID_DEFAULT_CHILD_VIEW = Superclass::ID_LAST,
122 ID_LAST
123 };
124
127 virtual void OnLayout();
128
130
132 virtual albaRWIBase *GetRWI();
133
136 void GetImage(wxBitmap &bmp, int magnification = 1);
137
142 virtual bool FindPokedVme(albaDevice *device,albaMatrix &point_pose,vtkProp3D *&picked_prop,albaVME *&picked_vme,albaInteractor *&picked_behavior);
143
146 virtual bool Pick(int x, int y);
147
150 virtual bool Pick(albaMatrix &m);
151
154 virtual void GetPickedPosition(double pos[3]);
155
159
163
167
171
174 int GetNumberOfSubView() {return m_NumOfChildView;};
175
178 virtual void MaximizeSubView(int subview_id = 0, bool maximize = true);
179
182 bool IsSubViewMaximized() {return m_SubViewMaximized != -1;};
183
185 virtual void OptionsUpdate();
186
187 virtual void SetBackgroundColor(wxColor color);
188
189 void SetSubViewBackgroundColor(int subView, wxColor color);
190 wxColor GetSubViewBackgroundColor(int subView);
191
192
194 int GetLayoutConfiguration() const { return m_LayoutConfiguration; }
195
197 virtual void SetLayoutConfiguration(int layoutConfiguration);
198
199protected:
207 virtual albaGUI *CreateGui();
208
210 virtual void LayoutSubView(int width, int height);
211
216
219
222
223 wxSize m_Size;
227
228
229 std::vector<albaView *> m_ChildViewList;
230 std::vector<albaView *> m_PluggedChildViewList;
231};
232#endif
#define EXPORT_STL_VECTOR(declspec_, T_)
Definition: albaDllMacros.h:84
This abstract class manages function calls coming from devices and issue specific events to interacto...
Definition: albaDevice.h:40
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaGUI is a panel with function to easily create GUI.
Definition: albaGUI.h:110
Abstract class for ALBA interactors This class provides base interface and features of ALBA continuou...
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:44
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
albaVME -
Definition: albaVME.h:150
albaViewCompound is the base class for Compound Views in ALBA.
virtual bool Pick(albaMatrix &m)
Perform a picking according to the absolute matrix given and return true on success.
void GetImage(wxBitmap &bmp, int magnification=1)
Return a pointer to the image of all sub-views.
albaTypeMacro(albaViewCompound, albaView)
int m_NumOfChildView
number of child view (is equal or greater then m_NumOfPluggedChildren)
albaView * GetSubView()
Return the sub-view in which the mouse is interacting with.
virtual void MaximizeSubView(int subview_id=0, bool maximize=true)
Let the sub-view to be maximized inside the compounded view.
virtual void VmeUpdateProperty(albaVME *vme, bool fromTag=false)
virtual void LayoutSubView(int width, int height)
Arrange sub-view into the defined layout configuration.
int m_SubViewMaximized
contain the id of the sub-view to be maximized. -1 means that all sub-views are in normal size
virtual bool FindPokedVme(albaDevice *device, albaMatrix &point_pose, vtkProp3D *&picked_prop, albaVME *&picked_vme, albaInteractor *&picked_behavior)
Find the pocked VME at button down.
int GetLayoutConfiguration() const
Returns LayoutConfiguration.
virtual void PackageView()
Redefine this method to package the compounded view.
virtual void SetBackgroundColor(wxColor color)
virtual albaVME * GetPickedVme()
Return the picked VME during the Pick method.
virtual void GetPickedPosition(double pos[3])
Write into the double array the position picked during Pick method.
virtual void SetWindowSize(int w, int h)
Set the vtk RenderWindow size.
albaView * GetSubView(int idx)
Return the sub-view with index idx.
int m_NumOfPluggedChildren
number of plugged children view
virtual void Create()
Create the plugged sub-view and call virtual method CreateGuiView()
virtual albaRWIBase * GetRWI()
albaViewCompound(const wxString &label="View Compound", int num_row=1, int num_col=2)
virtual void OnSize(wxSizeEvent &event)
On size event.
virtual void OnLayout()
Set the size of the windowing double slider according to the size of the view.
virtual void SetMouse(albaDeviceButtonsPadMouse *mouse)
virtual albaSceneGraph * GetSceneGraph()
int m_LayoutConfiguration
Arrange the subviews on different layout configuration.
virtual void VmeAdd(albaVME *vme)
Add VME into plugged sub-views.
virtual void OnEvent(albaEventBase *alba_event)
process the events sent by subjects
int m_ViewRowNum
number of rows to divide the compound view
wxWindow * m_GuiViewWindow
wxSize m_Size
size of the compound view
virtual albaView * Copy(albaObserver *Listener, bool lightCopyEnabled=false)
virtual void SetLayoutConfiguration(int layoutConfiguration)
Sets LayoutConfiguration.
std::vector< albaView * > m_ChildViewList
Child views vector.
virtual void CameraUpdate()
virtual void PlugChildView(albaView *child)
Plug the child view into the compound view.
virtual int GetNodeStatus(albaVME *vme)
return the status of the node within this view.
virtual ~albaViewCompound()
virtual void OptionsUpdate()
Called to update all components that depends on Application Options.
int GetNumberOfSubView()
Return the number of child view.
virtual void VmeSelect(albaVME *node, bool select)
int m_ViewColNum
number of cols to divide the compound view
bool IsSubViewMaximized()
Return true is one of the plugged view is maximized.
int GetSubViewIndex()
Return the sub-view num index which the mouse is interacting with.
void SetSubViewBackgroundColor(int subView, wxColor color)
virtual bool IsVmeShowed(albaVME *vme)
virtual void CreateGuiView()
Create the GUI on the bottom of the compounded view.
virtual void VmeRemove(albaVME *vme)
Remove VME into plugged sub-views.
virtual bool Pick(int x, int y)
Perform a picking according to the screen position (x,y) and return true on success.
albaDeviceButtonsPadMouse * m_Mouse
std::vector< albaView * > m_PluggedChildViewList
Plugged Child views vector.
virtual void CameraReset(albaVME *vme=NULL)
virtual void VmeShow(albaVME *vme, bool show)
Show/Hide VMEs into plugged sub-views.
virtual albaGUI * CreateGui()
Internally used to create a new instance of the GUI.
VIEWCOMPOUND_WIDGET_ID
IDs for the GUI.
wxColor GetSubViewBackgroundColor(int subView)
albaView is the base class for Views in alba.
Definition: albaView.h:79