 |
Computer Assited Medical Intervention Tool Kit
version 4.1
|
Go to the documentation of this file.
26 #ifndef RENDERERWIDGET_H
27 #define RENDERERWIDGET_H
30 #error "Header Error: headers reordering required. Please include Log.h after including RendererWidget.h and InteractiveViewer.h or any OpenGL window based class."
37 #include <vtkVersion.h>
39 #if VTK_MAJOR_VERSION == 6
40 #include <QVTKWidget2.h>
42 #include <vtkGenericOpenGLRenderWindow.h>
44 #elif VTK_MAJOR_VERSION == 7
45 #include <QVTKWidget.h>
49 #error "Invalid VTK version: not (yet) supported."
53 #include <vtkSmartPointer.h>
54 #include <vtkInteractorStyle.h>
55 #include <vtkRenderWindowInteractor.h>
56 #include <QVTKInteractor.h>
62 class vtkInteractorStyle;
67 class vtkScalarBarActor;
68 class vtkEventQtSlotConnect;
69 class vtkCallbackCommand;
72 class vtkAnnotatedCubeActor;
73 class vtkScalarBarWidget;
74 class vtkUnsignedCharArray;
79 class GeometricObject;
89 void PrintSelf(ostream& os, vtkIndent indent)
override;
139 #if VTK_MAJOR_VERSION == 6
142 #elif VTK_MAJOR_VERSION == 7
146 #error "Invalid VTK version: not (yet) supported."
257 void setPicker(vtkSmartPointer<vtkAbstractPropPicker> woodyWood);
415 void actorTransform(vtkSmartPointer<vtkActor>,
double*,
int,
double**,
double*,
double*);
487 vtkSmartPointer<vtkRenderer>
renderer;
511 static void divertionCallback(vtkObject* caller,
unsigned long eid,
void* clientdata,
void* calldata) {};
554 vtkSmartPointer<vtkAxesActor>
axes;
568 #endif //RENDERERWIDGET_H
vtkSmartPointer< vtkTextProperty > orientationDecorationsProp
Definition: RendererWidget.cpp:636
void setBackfaceCulling(bool)
@ BMP
Bitmap.
Definition: RendererWidget.h:193
@ PNG
Portable Network Graphics.
Definition: RendererWidget.h:191
static vtkInteractorStylePick * New()
QMap< RendererWidget::ScreenshotFormat, RendererWidget::ScreenshotFormatInfo * > screenshotMap
Definition: RendererWidget.cpp:386
addProp(copyrightTextActor)
virtual void Pick()
Definition: RendererWidget.cpp:299
void setGradientBackground(bool)
set the gradient background
vtkSmartPointer< vtkRenderWindow > renderWindow
Definition: RendererWidget.cpp:506
annotatedCube
annotated cube actor
Definition: RendererWidget.cpp:585
void setAreaPicking(bool areaPicking)
Set the interaction mode like picking or control.
@ NONE
Definition: RendererWidget.h:178
@ LEFT_BACK
Definition: RendererWidget.h:168
pickInteractorStyle
picking interactor
Definition: RendererWidget.cpp:516
int endPosition[2]
Definition: RendererWidget.h:109
ControlMode getControlMode() const
get the current control mode
bool areaPicking
Definition: RendererWidget.h:115
rendering3DRedBlue
is rendering in 3D stereo red/blue
Definition: RendererWidget.cpp:501
void startPicking()
manage left mouse release interactions
vtkSmartPointer< vtkWindowLevelLookupTable > vtklup
Definition: RendererWidget.cpp:696
void setActiveCamera(vtkCamera *cam)
set active camera
void screenshot(QString filename)
save the screenshot in a file
bool getLightFollowCamera() const
Get the current state of the property.
displayCopyright
is the copyright text displayed
Definition: RendererWidget.cpp:500
#define CAMITK_INFO(MSG)
Log for info verbosity (the second most verbose one) The msg will appear only if the user asked for I...
Definition: Log.h:258
void mousePressEvent(QMouseEvent *event) override
MouseButtonState
Definition: RendererWidget.h:182
@ JOYSTICK
the mouse is used a joystick
Definition: RendererWidget.h:175
bool getBackfaceCulling() const
Get the current state of backface culling.
int startPosition[2]
Definition: RendererWidget.h:108
vtkTypeMacro(vtkInteractorStylePick, vtkInteractorStyle)
~vtkInteractorStylePick() override=default
RendererWidget(QWidget *parent=nullptr, ControlMode mode=RendererWidget::TRACKBALL)
constructors.
pickingDiverter
is the picking diverter used
Definition: RendererWidget.cpp:538
double getPointSize() const
get the current value of point size
@ BACK_DOWN
< World axes are seen so that x points to the left, y points backward. For Medical Images Coronal Vie...
Definition: RendererWidget.h:169
renderer
The current renderer.
Definition: RendererWidget.cpp:509
void toggleOrientationDecorations(bool)
display orientation decorations
vtkStandardNewMacro(vtkInteractorStylePick)
static void buildScreenshotMap()
pointSize
default point size
Definition: RendererWidget.cpp:503
vtkSmartPointer< vtkTextProperty > copyrightTextProp
Definition: RendererWidget.cpp:671
@ TRACKBALL_2D
same as TRACKBALL but does not allow rotation using left button (but zoom and displacement parallel t...
Definition: RendererWidget.h:177
backfaceCulling
Is back face culling on?
Definition: RendererWidget.cpp:499
ControlMode
Definition: RendererWidget.h:174
static const ScreenshotFormatInfo * getScreenshotFormatInfo(unsigned int)
return the information concerning the supporting format using an index corresponding to the enum (che...
vtkCamera * getActiveCamera()
get the active camera
void rightButtonPressed()
send when the mouse right button is clicked
void getBackgroundColor(double &, double &, double &)
get the background color (rgb)
ScreenshotFormat
Definition: RendererWidget.h:190
@ PS
PostScript.
Definition: RendererWidget.h:194
void resetCameraSettings()
@ LEFT_BUTTON
the mouse left button is currently pressed
Definition: RendererWidget.h:184
void actorPicked(vtkSmartPointer< vtkPicker >)
void OnLeftButtonDown() override
Definition: RendererWidget.cpp:140
void setColorScale(bool)
display the color scale in the viewport, use setColorScaleMinMax to change the displayed values
void toggleCopyright(bool)
toggle copyright text
bool lightFollowCamera
Is the light following the camera.
Definition: RendererWidget.h:496
vtkSmartPointer< vtkTextMapper > copyrightTextMapper
Definition: RendererWidget.cpp:676
@ SVG
Scalable Vector Graphics.
Definition: RendererWidget.h:198
void resetCamera()
reset the camera to the default position, default FOV.
controlMode
current control mode
Definition: RendererWidget.cpp:522
void updateAxes()
update the axes sizes
void computeVisiblePropBounds(double *bounds)
get the bounding box of all visible actors [xmin,xmax, ymin,ymax, zmin,zmax]
void toggleAxes(bool)
display the axes
vtkSmartPointer< vtkTextMapper > orientationDecorationsTextMapper[4]
Definition: RendererWidget.h:560
vtkSmartPointer< vtkUnsignedCharArray > pixelArray
Definition: RendererWidget.h:113
vtkSmartPointer< vtkActor2D > orientationDecorationActors[4]
Definition: RendererWidget.h:559
interactor
Definition: RendererWidget.cpp:513
void mouseMoveEvent(QMouseEvent *event) override
overloaded mouse move handler because a potentialbug in vtk 5.2.1
vtkSmartPointer< vtkTextProperty > axeYTextProp
Definition: RendererWidget.cpp:563
@ EPS
Encapsulated PostScript.
Definition: RendererWidget.h:195
vtkInteractorStylePick()
Definition: RendererWidget.cpp:126
vtkSmartPointer< vtkProperty > acProp
Definition: RendererWidget.cpp:600
@ LEFT_UP
World axes are seen so that x points to the left, y points upward.
Definition: RendererWidget.h:166
@ RIGHT_DOWN
World axes are seen so that x points to the right, y points downward.
Definition: RendererWidget.h:165
static bool initScreenshotMap
Definition: RendererWidget.cpp:402
const char * description
Definition: applications/cepgenerator/main.cpp:37
void PrintSelf(ostream &os, vtkIndent indent) override
Definition: RendererWidget.cpp:381
void endPicking()
end picking
colorBarWidget
the scalar bar widget
Definition: RendererWidget.cpp:703
RendererWidget::CameraOrientation getCameraOrientation() const
Return the current axes mode.
int moving
Definition: RendererWidget.h:111
@ RIGHT_UP
World axes are seen so that x points to the right, y points upward.
Definition: RendererWidget.h:167
@ PDF
Portable Document Format.
Definition: RendererWidget.h:196
QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding)
setCameraOrientation(cameraOrientation)
vtkSmartPointer< vtkTextProperty > axeZTextProp
Definition: RendererWidget.cpp:570
@ TRACKBALL
the mouse is used as a trackball (default)
Definition: RendererWidget.h:176
@ OBJ
Alias Wavefront .OBJ.
Definition: RendererWidget.h:199
setBackgroundColor(0.0, 0.0, 0.0)
pickingButtonDiverter
the callback to remove left button interaction while in picking mode
Definition: RendererWidget.cpp:535
void getCameraSettings(double *position, double *focalPoint, double *viewUp)
get camera settings information (position, what is looked at and how) in world coordinates
bool getColorScale() const
get the color display state
void actorTransform(vtkSmartPointer< vtkActor >, double *, int, double **, double *, double *)
perform the transformation of the actor
vtkSmartPointer< vtkTransform > transform
Definition: RendererWidget.cpp:595
cameraOrientation
state of the initial camera orientation
Definition: RendererWidget.cpp:523
void keyPressEvent(QKeyEvent *e) override
key events (do nothing but pass on e to the parent widget), please do not add any shortcut management...
vtkInstantiatorNewMacro(vtkInteractorStylePick)
bool getGradientBackground()
get the current state of the gradient background
@ RIGHT_BUTTON
the mouse right button is currently pressed
Definition: RendererWidget.h:186
void RedrawRubberBand()
Definition: RendererWidget.cpp:228
Q_ENUMS(ControlMode CameraOrientation)
RendererWidget implements all support methods to use camiTK with Qt interface.
QString orientationDecorationLetters[4]
Definition: RendererWidget.cpp:630
void OnMouseMove() override
Definition: RendererWidget.cpp:177
@ NOT_SUPPORTED
Definition: RendererWidget.h:202
@ TEX
LaTeX (only the text is exported)
Definition: RendererWidget.h:197
void setColorScaleMinMax(double m, double M)
set the min and max values.
void setOrientationDecorationsLetters(QString letters[4])
give the lettres for orientation decoration: Left, Right, Top, Down
displayColorScale
is the color scale currently displayed
Definition: RendererWidget.cpp:502
void toogle3DRedBlue()
toggle stereo 3D red/blue rendering (you will need red/blue glasses)
void setColorScaleTitle(QString t)
set the color scale title.
vtkSmartPointer< vtkTextProperty > axeXTextProp
Definition: RendererWidget.cpp:549
void pickActor(int x, int y)
Perform picking from screen coordinates.
setObjectName("RendererWidget")
void removeProp(vtkSmartPointer< vtkProp > p, bool refresh=false)
remove the given vtkProp (e.g.
@ JPG
JPEG.
Definition: RendererWidget.h:192
@ MIDDLE_BUTTON
the mouse middle button is currently pressed (or 3rd button emulation)
Definition: RendererWidget.h:185
bool containsProp(vtkSmartPointer< vtkProp >)
is the given vtkProp (e.g. vtkActor or vtkActor2D) in this renderer
void mouseReleaseEvent(QMouseEvent *event) override
overloaded mouse release handler because a potentialbug in vtk 5.2.1
void pick()
Perform picking using the current mouse position.
~RendererWidget() override
destructor
axes
axes actor
Definition: RendererWidget.cpp:543
CameraOrientation
Definition: RendererWidget.h:164
static void divertionCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
a diverter observer callback (to be used to divert undesired events)
Definition: RendererWidget.h:511
if(!initScreenshotMap)
Definition: RendererWidget.cpp:403
controlInteractorStyle
for the interaction with the scene
Definition: RendererWidget.cpp:524
void resetClippingPlanes(double *bounds=nullptr)
reset the camera clipping plane to a given bounding box If no bounds are given, reset to show all vis...
@ NO_BUTTON
no buttons are currently pressed
Definition: RendererWidget.h:183
vtkScalarBarRepresentation * rep
Definition: RendererWidget.cpp:719
void setLightFollowCamera(bool)
Set/unset the light to follow the camera.
void refresh()
refresh the display
vtkSmartPointer< vtkScalarBarActor > colorScale
the color scale displaying the lookup table + values
Definition: RendererWidget.h:548
@ VRML
VRML 2.0.
Definition: RendererWidget.h:201
void getMouse3DCoordinates(double &x, double &y, double &z)
get the mouse coordinates in 3D
void OnLeftButtonUp() override
Definition: RendererWidget.cpp:212
copyrightTextActor
copyright text vtk actor
Definition: RendererWidget.cpp:681
Interactor used when we are in picking mode.
Definition: RendererWidget.h:82
@ RIB
RenderMan/BMRT .RIB.
Definition: RendererWidget.h:200
void SetAreaPicking(bool b)
Definition: RendererWidget.cpp:135
void setPicker(vtkSmartPointer< vtkAbstractPropPicker > woodyWood)
set the picker to handle the action
void rotateCamera(double angle, int axe)
Rotate the camera around param "axe" of "angle" degrees.
displayGradient
Definition: RendererWidget.cpp:724
#define CAMITK_API
Definition: CamiTKAPI.h:49
Definition: Action.cpp:36
void setPointSize(double size)
set the default point size