 |
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;
82 class vtkInteractorStylePick :
public vtkInteractorStyle {
89 void PrintSelf(ostream& os, vtkIndent indent)
override;
113 vtkSmartPointer<vtkUnsignedCharArray>
pixelArray;
139 #if VTK_MAJOR_VERSION == 6
142 #elif VTK_MAJOR_VERSION == 7
146 #error "Invalid VTK version: not (yet) supported."
206 class ScreenshotFormatInfo {
217 ScreenshotFormatInfo() : extension(
""),
description(
"Not 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) {};
548 vtkSmartPointer<vtkScalarBarActor>
colorScale;
554 vtkSmartPointer<vtkAxesActor>
axes;
568 #endif //RENDERERWIDGET_H
vtkSmartPointer< vtkTextProperty > orientationDecorationsProp
Definition: RendererWidget.cpp:634
void setBackfaceCulling(bool)
Bitmap.
Definition: RendererWidget.h:192
Portable Network Graphics.
Definition: RendererWidget.h:190
static vtkInteractorStylePick * New()
QMap< RendererWidget::ScreenshotFormat, RendererWidget::ScreenshotFormatInfo * > screenshotMap
Definition: RendererWidget.cpp:384
addProp(copyrightTextActor)
virtual void Pick()
Definition: RendererWidget.cpp:297
void setGradientBackground(bool)
set the gradient background
vtkSmartPointer< vtkRenderWindow > renderWindow
Definition: RendererWidget.cpp:504
annotatedCube
annotated cube actor
Definition: RendererWidget.cpp:583
void setAreaPicking(bool areaPicking)
Set the interaction mode like picking or control.
Definition: RendererWidget.h:177
Definition: RendererWidget.h:167
pickInteractorStyle
picking interactor
Definition: RendererWidget.cpp:514
int endPosition[2]
Definition: RendererWidget.h:108
ControlMode getControlMode() const
get the current control mode
bool areaPicking
Definition: RendererWidget.h:114
rendering3DRedBlue
is rendering in 3D stereo red/blue
Definition: RendererWidget.cpp:499
void startPicking()
manage left mouse release interactions
vtkSmartPointer< vtkWindowLevelLookupTable > vtklup
Definition: RendererWidget.cpp:694
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:498
#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:256
void mousePressEvent(QMouseEvent *event) override
MouseButtonState
Definition: RendererWidget.h:181
the mouse is used a joystick
Definition: RendererWidget.h:174
bool getBackfaceCulling() const
Get the current state of backface culling.
int startPosition[2]
Definition: RendererWidget.h:107
vtkTypeMacro(vtkInteractorStylePick, vtkInteractorStyle)
~vtkInteractorStylePick() override=default
RendererWidget(QWidget *parent=nullptr, ControlMode mode=RendererWidget::TRACKBALL)
constructors.
pickingDiverter
is the picking diverter used
Definition: RendererWidget.cpp:536
double getPointSize() const
get the current value of point size
< World axes are seen so that x points to the left, y points backward. For Medical Images Coronal Vie...
Definition: RendererWidget.h:168
renderer
The current renderer.
Definition: RendererWidget.cpp:507
void toggleOrientationDecorations(bool)
display orientation decorations
vtkStandardNewMacro(vtkInteractorStylePick)
static void buildScreenshotMap()
pointSize
default point size
Definition: RendererWidget.cpp:501
vtkSmartPointer< vtkTextProperty > copyrightTextProp
Definition: RendererWidget.cpp:669
same as TRACKBALL but does not allow rotation using left button (but zoom and displacement parallel t...
Definition: RendererWidget.h:176
backfaceCulling
Is back face culling on?
Definition: RendererWidget.cpp:497
ControlMode
Definition: RendererWidget.h:173
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:189
PostScript.
Definition: RendererWidget.h:193
void resetCameraSettings()
the mouse left button is currently pressed
Definition: RendererWidget.h:183
void actorPicked(vtkSmartPointer< vtkPicker >)
void OnLeftButtonDown() override
Definition: RendererWidget.cpp:138
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:495
copyrightTextMapper GetTextProperty() -> ShallowCopy(copyrightTextProp)
vtkSmartPointer< vtkTextMapper > copyrightTextMapper
Definition: RendererWidget.cpp:674
Scalable Vector Graphics.
Definition: RendererWidget.h:197
void resetCamera()
reset the camera to the default position, default FOV.
controlMode
current control mode
Definition: RendererWidget.cpp:520
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:559
vtkSmartPointer< vtkUnsignedCharArray > pixelArray
Definition: RendererWidget.h:112
vtkSmartPointer< vtkActor2D > orientationDecorationActors[4]
Definition: RendererWidget.h:558
interactor
Definition: RendererWidget.cpp:511
void mouseMoveEvent(QMouseEvent *event) override
overloaded mouse move handler because a potentialbug in vtk 5.2.1
vtkSmartPointer< vtkTextProperty > axeYTextProp
Definition: RendererWidget.cpp:561
Encapsulated PostScript.
Definition: RendererWidget.h:194
vtkInteractorStylePick()
Definition: RendererWidget.cpp:124
vtkSmartPointer< vtkProperty > acProp
Definition: RendererWidget.cpp:598
World axes are seen so that x points to the left, y points upward.
Definition: RendererWidget.h:165
World axes are seen so that x points to the right, y points downward.
Definition: RendererWidget.h:164
static bool initScreenshotMap
Definition: RendererWidget.cpp:400
const char * description
Definition: applications/cepgenerator/main.cpp:37
void PrintSelf(ostream &os, vtkIndent indent) override
Definition: RendererWidget.cpp:379
void endPicking()
end picking
colorBarWidget
the scalar bar widget
Definition: RendererWidget.cpp:701
RendererWidget::CameraOrientation getCameraOrientation() const
Return the current axes mode.
int moving
Definition: RendererWidget.h:110
World axes are seen so that x points to the right, y points upward.
Definition: RendererWidget.h:166
Portable Document Format.
Definition: RendererWidget.h:195
QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding)
setCameraOrientation(cameraOrientation)
vtkSmartPointer< vtkTextProperty > axeZTextProp
Definition: RendererWidget.cpp:568
the mouse is used as a trackball (default)
Definition: RendererWidget.h:175
Alias Wavefront .OBJ.
Definition: RendererWidget.h:198
setBackgroundColor(0.0, 0.0, 0.0)
pickingButtonDiverter
the callback to remove left button interaction while in picking mode
Definition: RendererWidget.cpp:533
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:593
cameraOrientation
state of the initial camera orientation
Definition: RendererWidget.cpp:521
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
the mouse right button is currently pressed
Definition: RendererWidget.h:185
void RedrawRubberBand()
Definition: RendererWidget.cpp:226
Q_ENUMS(ControlMode CameraOrientation)
RendererWidget implements all support methods to use camiTK with Qt interface.
QString orientationDecorationLetters[4]
Definition: RendererWidget.cpp:628
void OnMouseMove() override
Definition: RendererWidget.cpp:175
Definition: RendererWidget.h:201
LaTeX (only the text is exported)
Definition: RendererWidget.h:196
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:500
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:547
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.
JPEG.
Definition: RendererWidget.h:191
the mouse middle button is currently pressed (or 3rd button emulation)
Definition: RendererWidget.h:184
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:541
CameraOrientation
Definition: RendererWidget.h:163
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:510
if(!initScreenshotMap)
Definition: RendererWidget.cpp:401
controlInteractorStyle
for the interaction with the scene
Definition: RendererWidget.cpp:522
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 buttons are currently pressed
Definition: RendererWidget.h:182
vtkScalarBarRepresentation * rep
Definition: RendererWidget.cpp:717
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:547
VRML 2.0.
Definition: RendererWidget.h:200
void getMouse3DCoordinates(double &x, double &y, double &z)
get the mouse coordinates in 3D
void OnLeftButtonUp() override
Definition: RendererWidget.cpp:210
copyrightTextActor
copyright text vtk actor
Definition: RendererWidget.cpp:679
RenderMan/BMRT .RIB.
Definition: RendererWidget.h:199
void SetAreaPicking(bool b)
Definition: RendererWidget.cpp:133
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:722
#define CAMITK_API
Definition: CamiTKAPI.h:48
Definition: Action.cpp:36
void setPointSize(double size)
set the default point size