ALBA
albaViewVTK.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaViewVTK
5 Authors: Silvano Imboden - 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#ifndef __albaViewVTK_H__
17#define __albaViewVTK_H__
18
19//----------------------------------------------------------------------------
20// Include:
21//----------------------------------------------------------------------------
22#include "albaView.h"
23#include "albaRWIBase.h"
24#include "albaRWI.h"
25#include "albaSceneGraph.h"
26#include "albaSceneNode.h" //used in subclasses
27#include <map>
28#include "albaAxes.h"
29//----------------------------------------------------------------------------
30// forward references :
31//----------------------------------------------------------------------------
32class albaLightKit;
33class albaVME;
35class vtkRenderWindow;
36class vtkRenderer;
38class albaTextKit;
39class albaAnimate;
40
41//----------------------------------------------------------------------------
42// albaViewVTK :
43//----------------------------------------------------------------------------
48class ALBA_EXPORT albaViewVTK: public albaView
49{
50public:
51
53 albaViewVTK(const wxString &label = "vtkView", int camera_position = CAMERA_PERSPECTIVE, bool show_axes = true, bool show_grid = false, int stereo = 0, bool show_orientator = false, int axesType = albaAxes::TRIAD);
55 virtual ~albaViewVTK();
58
60 virtual albaView* Copy(albaObserver *Listener, bool lightCopyEnabled = false);
62 virtual void Create();
64 virtual void OnEvent(albaEventBase *alba_event);
65
68 {
69 ID_ROLLOUT_ATTACH_CAMERA = Superclass::ID_LAST,
73 ID_LAST
74 };
75
77 virtual void VmeAdd(albaVME *vme);
78
80 virtual void VmeRemove(albaVME *vme);
81
82 virtual void VmeSelect(albaVME *vme, bool select);
83
85 virtual void VmeShow(albaVME *vme, bool show);
86
90 virtual void VmeUpdateProperty(albaVME *vme, bool fromTag = false);
91
94 virtual int GetNodeStatus(albaVME *vme);
95
100
105 virtual void VmeCreatePipe(albaVME *vme);
106
108 virtual void VmeDeletePipe(albaVME *vme);
109
110 virtual void CameraReset(albaVME *vme = NULL);
111 virtual void CameraSet(int camera_position);
112 virtual void CameraUpdate();
113 virtual int GetCameraPosition();
114
115 virtual void SetBackgroundColor(wxColor color);
116
117 virtual albaSceneGraph *GetSceneGraph() { return m_Sg; };
118 virtual albaRWIBase *GetRWI() {return m_Rwi->m_RwiBase;};
119
121 void GetImage(wxBitmap &bmp, int magnification = 1);
122
123 virtual vtkRenderer *GetFrontRenderer();
124 virtual vtkRenderer *GetBackRenderer();
125 virtual vtkRenderWindow *GetRenderWindow();
126
131 virtual bool FindPokedVme(albaDevice *device,albaMatrix &point_pose,vtkProp3D *&picked_prop,albaVME *&picked_vme,albaInteractor *&picked_behavior);
132
134 virtual bool Pick(int x, int y);
135
137 virtual bool Pick(albaMatrix &m);
138
140 void SetWindowSize(int w, int h);
141
144 {
147 };
148 typedef std::map<albaString, albaVisualPipeInfo> albaPipeMap;
149
151 void PlugVisualPipe(albaString vme_type, albaString pipe_type, long visibility = VISIBLE);
152
154
157
159
161 virtual void Print(std::ostream& os, const int tabs=0);// const;
162
163protected:
164
170
177
178 virtual albaGUI *CreateGui();
179
180 virtual void OnPreResetCamera();
181 virtual void OnPostResetCamera();
182
184 virtual void GetVisualPipeName(albaVME *node, albaString &pipe_name);
185};
186#endif
CAMERA_PERSPECTIVE
Definition: albaDecl.h:232
@ VISIBLE
Definition: albaView.h:59
This component allow to manage camera animation into a view.
Definition: albaAnimate.h:39
albaAttachCamera is tool to attach the camera present in albaRWI to the selected VME.
@ TRIAD
Definition: albaAxes.h:77
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
albaString - performs common string operations on c-strings.
Definition: albaString.h:43
albaTextKit is tool to visualize text into a given albaRWI.
Definition: albaTextKit.h:44
albaVME -
Definition: albaVME.h:150
albaViewVTK is a View that got a RenderWindow and a SceneGraph
Definition: albaViewVTK.h:49
virtual void Create()
create rwi
virtual void VmeShow(albaVME *vme, bool show)
Called to show/hide vme.
virtual void VmeAdd(albaVME *vme)
Add the vme to the view's scene-graph.
virtual void VmeSelect(albaVME *vme, bool select)
virtual bool Pick(int x, int y)
Perform a picking according to the screen position (x,y) and return true on success.
albaLightKit * m_LightKit
Definition: albaViewVTK.h:166
virtual void CameraSet(int camera_position)
albaAnimate * m_AnimateKit
Definition: albaViewVTK.h:169
bool m_ShowGrid
Definition: albaViewVTK.h:174
virtual void VmeDeletePipe(albaVME *vme)
Delete vme's visual pipe.
bool m_ShowOrientator
Definition: albaViewVTK.h:175
int m_StereoType
Indicate the stereo type to use with the view.
Definition: albaViewVTK.h:173
virtual void VmeUpdateProperty(albaVME *vme, bool fromTag=false)
Called to update visual pipe properties of the vme passed as argument.
void GetImage(wxBitmap &bmp, int magnification=1)
Return a pointer to the image of the renderwindow.
virtual void OnPreResetCamera()
virtual bool FindPokedVme(albaDevice *device, albaMatrix &point_pose, vtkProp3D *&picked_prop, albaVME *&picked_vme, albaInteractor *&picked_behavior)
Find the pocked VME at button down.
virtual vtkRenderer * GetBackRenderer()
virtual bool Pick(albaMatrix &m)
Perform a picking according to the absolute matrix given and return true on success.
albaAttachCamera * m_AttachCamera
Definition: albaViewVTK.h:168
virtual albaView * Copy(albaObserver *Listener, bool lightCopyEnabled=false)
clone the object
std::map< albaString, albaVisualPipeInfo > albaPipeMap
Definition: albaViewVTK.h:148
virtual albaPipe * GetNodePipe(albaVME *vme)
Return a pointer to the visual pipe of the node passed as argument.
albaViewVTK(const wxString &label="vtkView", int camera_position=CAMERA_PERSPECTIVE, bool show_axes=true, bool show_grid=false, int stereo=0, bool show_orientator=false, int axesType=albaAxes::TRIAD)
constructor
albaPipeMap m_PipeMap
Map used to store visual pipeline associated with vme types.
Definition: albaViewVTK.h:153
virtual void OnPostResetCamera()
albaRWI * m_Rwi
Definition: albaViewVTK.h:158
virtual vtkRenderer * GetFrontRenderer()
void SetMouse(albaDeviceButtonsPadMouse *mouse)
Set the mouse device to use inside the view.
virtual void SetBackgroundColor(wxColor color)
albaTypeMacro(albaViewVTK, albaView)
RTTI macro.
virtual void CameraUpdate()
virtual void VmeRemove(albaVME *vme)
Remove the vme from the view's scene-graph.
virtual void OnEvent(albaEventBase *alba_event)
listen to other object events
virtual void CameraReset(albaVME *vme=NULL)
VIEW_VTK_WIDGET_ID
IDs for the GUI.
Definition: albaViewVTK.h:68
@ ID_ROLLOUT_ANIMATE_KIT
Definition: albaViewVTK.h:72
@ ID_ROLLOUT_LIGHT_KIT
Definition: albaViewVTK.h:71
@ ID_ROLLOUT_TEXT_KIT
Definition: albaViewVTK.h:70
virtual int GetNodeStatus(albaVME *vme)
Set the visualization status for the node (visible, not visible, mutex, ...)
virtual ~albaViewVTK()
constructor
virtual vtkRenderWindow * GetRenderWindow()
int m_CameraPositionId
Integer representing a preset for camera position, focal point and view up.
Definition: albaViewVTK.h:171
virtual albaSceneGraph * GetSceneGraph()
Definition: albaViewVTK.h:117
virtual void GetVisualPipeName(albaVME *node, albaString &pipe_name)
Return the visual pipe's name.
void SetWindowSize(int w, int h)
Set the vtk RenderWindow size.
virtual void Print(std::ostream &os, const int tabs=0)
print a dump of this object
albaSceneGraph * m_Sg
Definition: albaViewVTK.h:165
albaTextKit * m_TextKit
Definition: albaViewVTK.h:167
bool m_ShowAxes
Flag used to show/hide axes in low left corner of the view.
Definition: albaViewVTK.h:172
virtual void VmeCreatePipe(albaVME *vme)
Create the visual pipe for the node passed as argument.
virtual albaGUI * CreateGui()
Internally used to create a new instance of the GUI.
void PlugVisualPipe(albaString vme_type, albaString pipe_type, long visibility=VISIBLE)
Plug a visual pipe for a particular vme.
virtual albaRWIBase * GetRWI()
Definition: albaViewVTK.h:118
virtual int GetCameraPosition()
albaView is the base class for Views in alba.
Definition: albaView.h:79
Struct containing information regarding visual pipe plugged into the view.
Definition: albaViewVTK.h:144