|
Computer Assited Medical Intervention Tool Kit
version 5.0
|
|
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."
38 #include <vtkVersion.h>
40 #include <CamiTKDisableWarnings>
41 #include <QVTKInteractor.h>
42 #include <CamiTKReEnableWarnings>
44 #if VTK_MAJOR_VERSION == 6
45 #include <QVTKWidget2.h>
47 #include <vtkGenericOpenGLRenderWindow.h>
49 #elif VTK_MAJOR_VERSION == 7
50 #include <QVTKWidget.h>
51 #include <vtkSmartPointer.h>
54 #elif VTK_MAJOR_VERSION == 8
55 #include <QVTKOpenGLWidget.h>
56 #include <vtkSmartPointer.h>
59 #error "Invalid VTK version: not (yet) supported."
64 class vtkInteractorStyle;
70 class vtkScalarBarActor;
71 class vtkEventQtSlotConnect;
72 class vtkCallbackCommand;
75 class vtkAnnotatedCubeActor;
76 class vtkScalarBarWidget;
78 class vtkAbstractPropPicker;
83 class vtkInteractorStylePick;
103 #if VTK_MAJOR_VERSION == 6
106 #elif VTK_MAJOR_VERSION == 7
109 #elif VTK_MAJOR_VERSION == 8
113 #error "Invalid VTK version: not (yet) supported."
168 RendererWidget(QWidget* parent =
nullptr, ControlMode mode = RendererWidget::TRACKBALL);
187 void setPicker(vtkSmartPointer<vtkAbstractPropPicker> woodyWood);
337 void actorTransform(vtkSmartPointer<vtkActor>,
double*,
int,
double**,
double*,
double*);
397 vtkSmartPointer<vtkRenderer>
renderer;
455 vtkSmartPointer<vtkAxesActor>
axes;
472 #endif //RENDERERWIDGET_H
vtkSmartPointer< vtkTextProperty > orientationDecorationsProp
Definition: RendererWidget.cpp:413
vtkSmartPointer< vtkPNGReader > imageReader
Definition: RendererWidget.cpp:452
void setBackfaceCulling(bool)
static void divertionCallback(vtkObject *, unsigned long, void *, void *)
a diverter observer callback (to be used to divert undesired events)
Definition: RendererWidget.h:421
#define CAMITK_WARNING(MSG)
Log for warning verbosity (the most common one) Will appear by default.
Definition: Log.h:266
QString description
the descriptionof the action
Definition: Action.h:492
void setGradientBackground(bool)
set the gradient background
vtkSmartPointer< vtkRenderWindow > renderWindow
Definition: RendererWidget.cpp:280
annotatedCube
annotated cube actor
Definition: RendererWidget.cpp:362
void setAreaPicking(bool areaPicking)
QTemporaryFile * tempLogofile
Definition: RendererWidget.cpp:450
pickInteractorStyle
picking interactor
Definition: RendererWidget.cpp:299
ControlMode getControlMode() const
get the current control mode
if(${CMAKE_VERSION} VERSION_GREATER "3.3" OR ${CMAKE_VERSION} VERSION_EQUAL "3.3") option(CAMITK_INCLUDE_WHAT_YOU_USE "Enable the header analysis on you code
rendering3DRedBlue
is rendering in 3D stereo red/blue
Definition: RendererWidget.cpp:275
vtkSmartPointer< vtkWindowLevelLookupTable > vtklup
Definition: RendererWidget.cpp:487
@ RIGHT_UP
World axes are seen so that x points to the right, y points upward.
Definition: RendererWidget.h:133
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.
void pickActor(int, int)
Perform picking from screen coordinates.
#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:261
void mousePressEvent(QMouseEvent *event) override
mouse press handler overriden to manage different version of VTK
MouseButtonState
Definition: RendererWidget.h:149
bool getBackfaceCulling() const
Get the current state of backface culling.
RendererWidget(QWidget *parent=nullptr, ControlMode mode=RendererWidget::TRACKBALL)
constructors.
pickingDiverter
is the picking diverter used
Definition: RendererWidget.cpp:315
double getPointSize() const
get the current value of point size
renderer
The current renderer.
Definition: RendererWidget.cpp:283
void toggleOrientationDecorations(bool)
display orientation decorations
@ LEFT_UP
World axes are seen so that x points to the left, y points upward.
Definition: RendererWidget.h:132
#define CAMITK_TRACE_ALT(MSG)
Definition: Log.h:257
pointSize
default point size
Definition: RendererWidget.cpp:277
backfaceCulling
Is back face culling on?
Definition: RendererWidget.cpp:273
vtkCamera * getActiveCamera()
get the active camera
displayLogo
is the logo displayed
Definition: RendererWidget.cpp:274
void rightButtonPressed()
send when the mouse right button is clicked
void getBackgroundColor(double &, double &, double &)
get the background color (rgb)
void resetCameraSettings()
@ LEFT_BUTTON
the mouse left button is currently pressed
Definition: RendererWidget.h:151
void actorPicked(vtkSmartPointer< vtkPicker >)
void setColorScale(bool)
display the color scale in the viewport, use setColorScaleMinMax to change the displayed values
bool lightFollowCamera
Is the light following the camera.
Definition: RendererWidget.h:406
void resetCamera()
reset the camera to the default position, default FOV.
vtkSmartPointer< vtkLogoRepresentation > logoRepresentation
Definition: RendererWidget.cpp:456
controlMode
current control mode
Definition: RendererWidget.cpp:305
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]
annotated cube text
Definition: RendererWidget.h:464
vtkSmartPointer< vtkActor2D > orientationDecorationActors[4]
annotated cube text actors
Definition: RendererWidget.h:461
interactor
Definition: RendererWidget.cpp:296
void mouseMoveEvent(QMouseEvent *event) override
mouse move handler overriden to manage different version of VTK
@ BACK_DOWN
< World axes are seen so that x points to the left, y points backward. For Medical Images Coronal Vie...
Definition: RendererWidget.h:135
vtkSmartPointer< vtkTextProperty > axeYTextProp
Definition: RendererWidget.cpp:340
logoWidget
logo widget
Definition: RendererWidget.cpp:476
ActionExtension * extension
the extension in which this action is declared and registered
Definition: Action.h:507
vtkSmartPointer< vtkProperty > acProp
Definition: RendererWidget.cpp:377
void endPicking()
end picking
colorBarWidget
the scalar bar widget
Definition: RendererWidget.cpp:494
RendererWidget::CameraOrientation getCameraOrientation() const
Return the current axes mode.
QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding)
setCameraOrientation(cameraOrientation)
vtkSmartPointer< vtkTextProperty > axeZTextProp
Definition: RendererWidget.cpp:347
setBackgroundColor(0.0, 0.0, 0.0)
pickingButtonDiverter
the callback to remove left button interaction while in picking mode
Definition: RendererWidget.cpp:312
@ LEFT_BACK
Definition: RendererWidget.h:134
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:372
cameraOrientation
state of the initial camera orientation
Definition: RendererWidget.cpp:306
void keyPressEvent(QKeyEvent *e) override
key events (do nothing but pass on e to the parent widget), please do not add any shortcut management...
bool getGradientBackground()
get the current state of the gradient background
@ RIGHT_BUTTON
the mouse right button is currently pressed
Definition: RendererWidget.h:153
QString orientationDecorationLetters[4]
Definition: RendererWidget.cpp:407
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:276
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:326
@ RIGHT_DOWN
World axes are seen so that x points to the right, y points downward.
Definition: RendererWidget.h:131
setObjectName("RendererWidget")
void removeProp(vtkSmartPointer< vtkProp > p, bool refresh=false)
remove the given vtkProp (e.g.
@ MIDDLE_BUTTON
the mouse middle button is currently pressed (or 3rd button emulation)
Definition: RendererWidget.h:152
CameraOrientation
RendererWidget implements all support methods to use camiTK with Qt interface.
Definition: RendererWidget.h:130
bool containsProp(vtkSmartPointer< vtkProp >)
is the given vtkProp (e.g. vtkActor or vtkActor2D) in this renderer
void mouseReleaseEvent(QMouseEvent *event) override
mouse release handler overriden to manage different version of VTK
void pick()
Perform picking using the current mouse position.
~RendererWidget() override
destructor
axes
axes actor
Definition: RendererWidget.cpp:320
#define CAMITK_WARNING_IF(COND, MSG)
Definition: Log.h:313
controlInteractorStyle
for the interaction with the scene
Definition: RendererWidget.cpp:307
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:150
vtkScalarBarRepresentation * rep
Definition: RendererWidget.cpp:510
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:449
void getMouse3DCoordinates(double &x, double &y, double &z)
get the mouse coordinates in 3D
QFile logoFile(":/camiTKIcon")
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:515
#define CAMITK_API
Definition: CamiTKAPI.h:49
Definition: Action.cpp:35
void toggleLogo(bool)
toggle logo
void setPointSize(double size)
set the default point size