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;
40
41//----------------------------------------------------------------------------
42// constants:
43//----------------------------------------------------------------------------
45{
48};
49//----------------------------------------------------------------------------
50// albaRWI :
51//----------------------------------------------------------------------------
52class ALBA_EXPORT albaRWI : public albaObserver
53{
54public:
56 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) ;
57 virtual ~albaRWI();
58
59 virtual void SetListener(albaObserver *Listener) {m_Listener = Listener;};
60
61 virtual void OnEvent(albaEventBase *alba_event);
62
64 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);
65
67 void CameraReset(albaVME *vme = NULL, double zoom = 1);
68
70 void CameraReset(double bounds[6], double zoom = 1);
71
74
76 void CameraSet(int cam_position, double zoom = 1);
77
78
80 void CameraSet(double pos[3],double viewUp[3], double zoom = 1., bool parallelProjection = false);
81
83 void SetSize(int x, int y, int w,int h);
84
86 void Show(bool show);
87
89 void SetGridNormal(int normal_id);
90
92 void SetGridPosition(double position);
93
95 void SetGridVisibility(bool show);
96
98 void SetGridColor(const wxColor &col);
99
101 void SetBackgroundColor(const wxColor &col);
102
104 wxColor GetBackgroundColor() { return m_BGColour; };
105
107 void SetStereo(int stereo_type);
108
110 void SetAxesVisibility(bool show);
111
113 void SetOrientatorVisibility(bool show = true);
114
116 void SetOrientatorSingleActorVisibility(bool showLeft = true, bool showDown = true, bool showRight = true, bool showUp = true);
117
119 void SetOrientatorSingleActorText(const char* textLeft, const char* textDown, const char* textRight, const char* textUp);
120
122 void SetOrientatorProperties(double rgbText[3], double rgbBackground[3], double scale = 1);
123
124 virtual albaGUI *GetGui();
125
128
129 /* Reset camera clipping range using visualized actors */
131
134 vtkRenderer *m_RenFront;
135 vtkRenderer *m_RenBack;
137 vtkRenderWindow *m_RenderWindow;
138 vtkLight *m_Light;
139 vtkCamera *m_Camera;
141 double m_CameraPosition[3];
142 double m_FocalPoint[3];
143
144 double m_CameraViewUp[3];
145 double m_CameraOrientation[3];
146
152
153protected:
155 double *ComputeVisibleBounds(albaVME *vme = NULL);
157
159 wxColour m_BGColour;
160 wxColour m_GridColour;
162 albaGUIPicButton *m_CameraButtons[6];
163 wxBoxSizer *m_Sizer;
164
166 vtkALBAGridActor *m_Grid;
170
172
174 vtkALBATextOrientator *m_Orientator;
177
178
182};
183#endif
RWI_LAYERS
Definition: albaRWI.h:45
@ TWO_LAYER
Definition: albaRWI.h:47
@ ONE_LAYER
Definition: albaRWI.h:46
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:62
double m_GridPosition
Definition: albaRWI.h:161
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:176
void SetGridVisibility(bool show)
Set the visibility for the grid actor.
void UpdateCameraParameters()
Update member variables and GUI elements according to vtkCamera position, focal point,...
int m_GridNormal
Definition: albaRWI.h:168
wxBoxSizer * m_Sizer
Definition: albaRWI.h:163
void CameraReset(albaVME *vme=NULL, double zoom=1)
Reset the camera position.
albaSceneGraph * m_Sg
Definition: albaRWI.h:132
vtkALBATextOrientator * m_Orientator
Definition: albaRWI.h:174
virtual ~albaRWI()
int m_StereoType
Definition: albaRWI.h:173
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:160
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:151
albaRWIBase * m_RwiBase
Definition: albaRWI.h:133
vtkRenderer * m_RenFront
Renderer used to show actors on the first layer.
Definition: albaRWI.h:134
double m_TopBottomAccumulation
Definition: albaRWI.h:148
int m_ShowGrid
Flag used to show/hide the grid.
Definition: albaRWI.h:167
double m_StepCameraOrientation
Step with which rotate the camera around its focal point.
Definition: albaRWI.h:147
vtkLight * m_Light
Definition: albaRWI.h:138
void Show(bool show)
Show the render window.
wxColor GetBackgroundColor()
Get the background color for the render window.
Definition: albaRWI.h:104
virtual void SetListener(albaObserver *Listener)
Definition: albaRWI.h:59
void CameraUpdate()
Update the renderwindow.
int m_AxesType
Definition: albaRWI.h:181
albaString m_StereoMovieDir
Definition: albaRWI.h:179
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 SetStereo(int stereo_type)
Set the stereo type.
vtkRenderer * m_AlwaysVisibleRenderer
Definition: albaRWI.h:136
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:158
vtkALBAGridActor * m_Grid
Actor representing a grid showed into the render window.
Definition: albaRWI.h:166
virtual albaGUI * GetGui()
vtkRenderWindow * m_RenderWindow
< Renderer used to superimpose utility stuff to main render window
Definition: albaRWI.h:137
int m_StereoMovieEnable
Definition: albaRWI.h:180
wxColour m_BGColour
Definition: albaRWI.h:159
double m_TopBottomAccumulationLast
Definition: albaRWI.h:150
double m_LeftRigthAccumulation
Definition: albaRWI.h:149
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:140
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:165
int m_ShowOrientator
Definition: albaRWI.h:175
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:171
int m_ShowAxes
Flag used to show/hide axes in low left corner of the view.
Definition: albaRWI.h:169
vtkCamera * m_Camera
Definition: albaRWI.h:139
vtkRenderer * m_RenBack
Renderer used to show actors on the second layer.
Definition: albaRWI.h:135
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