ALBA
albaRWI.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaRWI
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#ifndef __albaRWI_H__
17#define __albaRWI_H__
18//----------------------------------------------------------------------------
19// Include :
20//----------------------------------------------------------------------------
21#include "albaRWIBase.h"
22#include "albaObserver.h"
23#include "albaAxes.h"
24
25//----------------------------------------------------------------------------
26// Forward References :
27//----------------------------------------------------------------------------
28class albaVME;
29class vtkALBAGridActor;
30class vtkLight;
31class vtkCamera;
32class vtkRenderer;
33class vtkRenderWindow;
34class albaRWIBase;
35class albaSceneGraph;
36class albaAxes;
37class albaGUI;
39class vtkALBATextOrientator;
40class vtkALBAProfilingActor;
41
42//----------------------------------------------------------------------------
43// constants:
44//----------------------------------------------------------------------------
46{
49};
50//----------------------------------------------------------------------------
51// albaRWI :
52//----------------------------------------------------------------------------
53class ALBA_EXPORT albaRWI : public albaObserver
54{
55public:
57 albaRWI(wxWindow *parent, RWI_LAYERS layers = ONE_LAYER, bool use_grid = false, bool show_axes = false, int stereo = 0, bool show_orientator = false, int axesType = albaAxes::TRIAD) ;
58 virtual ~albaRWI();
59
60 virtual void SetListener(albaObserver *Listener) {m_Listener = Listener;};
61
62 virtual void OnEvent(albaEventBase *alba_event);
63
65 void CreateRenderingScene(wxWindow *parent, RWI_LAYERS layers = ONE_LAYER, bool use_grid = false, bool show_axes = false, int stereo = 0, bool show_orientator = false, int axesType = albaAxes::TRIAD);
66
68 void CameraReset(albaVME *vme = NULL, double zoom = 1);
69
71 void CameraReset(double bounds[6], double zoom = 1);
72
75
77 void CameraSet(int cam_position, double zoom = 1);
78
79
81 void CameraSet(double pos[3],double viewUp[3], double zoom = 1., bool parallelProjection = false);
82
84 void SetSize(int x, int y, int w,int h);
85
87 void Show(bool show);
88
90 void SetGridNormal(int normal_id);
91
93 void SetGridPosition(double position);
94
96 void SetGridVisibility(bool show);
97
99 void SetGridColor(const wxColor &col);
100
102 void SetBackgroundColor(const wxColor &col);
103
105 wxColor GetBackgroundColor() { return m_BGColour; };
106
108 void SetStereo(int stereo_type);
109
111 void SetAxesVisibility(bool show);
112
114 void SetOrientatorVisibility(bool show = true);
115
117 void SetOrientatorSingleActorVisibility(bool showLeft = true, bool showDown = true, bool showRight = true, bool showUp = true);
118
120 void SetOrientatorSingleActorText(const char* textLeft, const char* textDown, const char* textRight, const char* textUp);
121
123 void SetOrientatorProperties(double rgbText[3], double rgbBackground[3], double scale = 1);
124
127
128 virtual albaGUI *GetGui();
129
132
133 /* Reset camera clipping range using visualized actors */
135
138 vtkRenderer *m_RenFront;
139 vtkRenderer *m_RenBack;
141 vtkRenderWindow *m_RenderWindow;
142 vtkLight *m_Light;
143 vtkCamera *m_Camera;
145 double m_CameraPosition[3];
146 double m_FocalPoint[3];
147
148 double m_CameraViewUp[3];
149 double m_CameraOrientation[3];
150
156
157protected:
159 double *ComputeVisibleBounds(albaVME *vme = NULL);
161
163 wxColour m_BGColour;
164 wxColour m_GridColour;
166 albaGUIPicButton *m_CameraButtons[6];
167 wxBoxSizer *m_Sizer;
168
170 vtkALBAGridActor *m_Grid;
174
176
178 vtkALBATextOrientator *m_Orientator;
182
183
184 vtkALBAProfilingActor *m_ProfilingActor;
185
189};
190#endif
RWI_LAYERS
Definition: albaRWI.h:46
@ TWO_LAYER
Definition: albaRWI.h:48
@ ONE_LAYER
Definition: albaRWI.h:47
Create 3D axes representation and insert them in the passed renderer: axes can be global (World Coord...
Definition: albaAxes.h:72
@ TRIAD
Definition: albaAxes.h:77
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaGUIPicButton inherit from wxBitmapButton.
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
double m_GridPosition
Definition: albaRWI.h:165
void CameraSet(double pos[3], double viewUp[3], double zoom=1., bool parallelProjection=false)
Set the camera position, set custom pos , custom viewUp , zoom and if projection is parallel.
albaObserver * m_Listener
Definition: albaRWI.h:181
void SetGridVisibility(bool show)
Set the visibility for the grid actor.
int m_ShowProfilingInformation
Definition: albaRWI.h:179
void UpdateCameraParameters()
Update member variables and GUI elements according to vtkCamera position, focal point,...
int m_GridNormal
Definition: albaRWI.h:172
wxBoxSizer * m_Sizer
Definition: albaRWI.h:167
void CameraReset(albaVME *vme=NULL, double zoom=1)
Reset the camera position.
albaSceneGraph * m_Sg
Definition: albaRWI.h:136
vtkALBATextOrientator * m_Orientator
Definition: albaRWI.h:178
virtual ~albaRWI()
int m_StereoType
Definition: albaRWI.h:177
void SetGridPosition(double position)
Set the position for the grid actor.
void CameraReset(double bounds[6], double zoom=1)
Reset the camera position according to the bounds.
void ResetCameraClippingRange()
wxColour m_GridColour
Definition: albaRWI.h:164
void SetOrientatorProperties(double rgbText[3], double rgbBackground[3], double scale=1)
Set Orientator Text Properties.
void CameraSet(int cam_position, double zoom=1)
Set the camera position.
void SetAxesVisibility(bool show)
Set the visibility for the axes actor.
double m_LeftRigthAccumulationLast
Definition: albaRWI.h:155
albaRWIBase * m_RwiBase
Definition: albaRWI.h:137
vtkRenderer * m_RenFront
Renderer used to show actors on the first layer.
Definition: albaRWI.h:138
double m_TopBottomAccumulation
Definition: albaRWI.h:152
int m_ShowGrid
Flag used to show/hide the grid.
Definition: albaRWI.h:171
double m_StepCameraOrientation
Step with which rotate the camera around its focal point.
Definition: albaRWI.h:151
vtkLight * m_Light
Definition: albaRWI.h:142
void Show(bool show)
Show the render window.
wxColor GetBackgroundColor()
Get the background color for the render window.
Definition: albaRWI.h:105
virtual void SetListener(albaObserver *Listener)
Definition: albaRWI.h:60
void CameraUpdate()
Update the renderwindow.
int m_AxesType
Definition: albaRWI.h:188
albaString m_StereoMovieDir
Definition: albaRWI.h:186
void SetGridColor(const wxColor &col)
Set the color for the grid actor.
double * ComputeVisibleBounds(albaVME *vme=NULL)
Compute the bounds for the visible actors; if vme is passed, the bounds of vme are calculated.
albaGUI * CreateGui()
void SetProfilingActorVisibility(bool show)
Set Profiling Information Text Visibility.
void SetStereo(int stereo_type)
Set the stereo type.
vtkRenderer * m_AlwaysVisibleRenderer
Definition: albaRWI.h:140
void SetOrientatorSingleActorVisibility(bool showLeft=true, bool showDown=true, bool showRight=true, bool showUp=true)
Set the visibility for the orientation single actor.
albaGUI * m_Gui
Definition: albaRWI.h:162
vtkALBAGridActor * m_Grid
Actor representing a grid showed into the render window.
Definition: albaRWI.h:170
virtual albaGUI * GetGui()
vtkRenderWindow * m_RenderWindow
< Renderer used to superimpose utility stuff to main render window
Definition: albaRWI.h:141
int m_StereoMovieEnable
Definition: albaRWI.h:187
wxColour m_BGColour
Definition: albaRWI.h:163
double m_TopBottomAccumulationLast
Definition: albaRWI.h:154
double m_LeftRigthAccumulation
Definition: albaRWI.h:153
void SetBackgroundColor(const wxColor &col)
Set the background color for the render window.
void SetSize(int x, int y, int w, int h)
Set the render window's size.
albaRWI(wxWindow *parent, RWI_LAYERS layers=ONE_LAYER, bool use_grid=false, bool show_axes=false, int stereo=0, bool show_orientator=false, int axesType=albaAxes::TRIAD)
int m_CameraPositionId
Integer representing a preset for camera position, focal point and view up.
Definition: albaRWI.h:144
void SetOrientatorSingleActorText(const char *textLeft, const char *textDown, const char *textRight, const char *textUp)
Set the text for the orientator actor.
void SetOrientatorVisibility(bool show=true)
Set the visibility for the orientation actor.
albaAxes * m_Axes
Actor representing a global reference system.
Definition: albaRWI.h:169
int m_ShowOrientator
Definition: albaRWI.h:180
void CreateRenderingScene(wxWindow *parent, RWI_LAYERS layers=ONE_LAYER, bool use_grid=false, bool show_axes=false, int stereo=0, bool show_orientator=false, int axesType=albaAxes::TRIAD)
Create all the elements necessary to build the rendering scene.
virtual void OnEvent(albaEventBase *alba_event)
process the events sent by subjects
int m_ParallelView
Flag used to set Camera Mode Orthographic or Perspective.
Definition: albaRWI.h:175
vtkALBAProfilingActor * m_ProfilingActor
Definition: albaRWI.h:184
int m_ShowAxes
Flag used to show/hide axes in low left corner of the view.
Definition: albaRWI.h:173
vtkCamera * m_Camera
Definition: albaRWI.h:143
vtkRenderer * m_RenBack
Renderer used to show actors on the second layer.
Definition: albaRWI.h:139
void SetGridNormal(int normal_id)
Set the normal for the grid actor.
albaString - performs common string operations on c-strings.
Definition: albaString.h:43
albaVME -
Definition: albaVME.h:150