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 140 class CAMITK_API RendererWidget :
public QVTKWidget2 {
142 #elif VTK_MAJOR_VERSION == 7 143 class CAMITK_API RendererWidget :
public QVTKWidget {
146 #error "Invalid VTK version: not (yet) supported." 164 enum CameraOrientation {
257 void setPicker(vtkSmartPointer<vtkAbstractPropPicker> woodyWood);
403 void addProp(vtkSmartPointer<vtkProp> p,
bool refresh =
false);
412 void removeProp(vtkSmartPointer<vtkProp> p,
bool refresh =
false);
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 void pickActor(int x, int y)
Perform picking from screen coordinates.
vtkSmartPointer< vtkUnsignedCharArray > pixelArray
Definition: RendererWidget.h:113
void removeProp(vtkSmartPointer< vtkProp > p, bool refresh=false)
remove the given vtkProp (e.g.
ControlMode
list of possible user interaction control mode
Definition: RendererWidget.h:174
renderer
The current renderer.
Definition: RendererWidget.cpp:486
pickInteractorStyle
picking interactor
Definition: RendererWidget.cpp:493
ScreenshotFormat
list of supported screenshot export formats
Definition: RendererWidget.h:190
axes
axes actor
Definition: RendererWidget.cpp:520
setBackgroundColor(0.0, 0.0, 0.0)
backfaceCulling
Is back face culling on?
Definition: RendererWidget.cpp:476
RenderMan/BMRT .RIB.
Definition: RendererWidget.h:200
cameraOrientation
state of the initial camera orientation
Definition: RendererWidget.cpp:500
Alias Wavefront .OBJ.
Definition: RendererWidget.h:199
World axes are seen so that x points to the right, y points downward.
Definition: RendererWidget.h:165
bool getGradientBackground()
get the current state of the gradient background
static const ScreenshotFormatInfo * getScreenshotFormatInfo(unsigned int)
return the information concerning the supporting format using an index corresponding to the enum (che...
RendererWidget(QWidget *parent=nullptr, ControlMode mode=RendererWidget::TRACKBALL)
constructors.
bool containsProp(vtkSmartPointer< vtkProp >)
is the given vtkProp (e.g. vtkActor or vtkActor2D) in this renderer
Portable Document Format.
Definition: RendererWidget.h:196
void screenshot(QString filename)
save the screenshot in a file
void toogle3DRedBlue()
toggle stereo 3D red/blue rendering (you will need red/blue glasses)
Scalable Vector Graphics.
Definition: RendererWidget.h:198
void SetAreaPicking(bool b)
Definition: RendererWidget.cpp:112
the mouse is used a joystick
Definition: RendererWidget.h:175
void OnLeftButtonDown() override
Definition: RendererWidget.cpp:117
the mouse middle button is currently pressed (or 3rd button emulation)
Definition: RendererWidget.h:185
void getBackgroundColor(double &, double &, double &)
get the background color (rgb)
the mouse left button is currently pressed
Definition: RendererWidget.h:184
controlMode
current control mode
Definition: RendererWidget.cpp:499
void refresh()
refresh the display
void toggleOrientationDecorations(bool)
display orientation decorations
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.
void mouseMoveEvent(QMouseEvent *event) override
overloaded mouse move handler because a potentialbug in vtk 5.2.1
void setBackfaceCulling(bool)
displayColorScale
is the color scale currently displayed
Definition: RendererWidget.cpp:479
World axes are seen so that x points to the right, y points upward.
Definition: RendererWidget.h:167
MouseButtonState
state of the pressed button (for 3 buttons mouse)
Definition: RendererWidget.h:182
vtkTypeMacro(vtkInteractorStylePick, vtkInteractorStyle)
Definition: Action.cpp:36
vtkSmartPointer< vtkTextMapper > orientationDecorationsTextMapper[4]
Definition: RendererWidget.h:560
colorBarWidget
the scalar bar widget
Definition: RendererWidget.cpp:680
int endPosition[2]
Definition: RendererWidget.h:109
void actorPicked(vtkSmartPointer< vtkPicker >)
void getMouse3DCoordinates(double &x, double &y, double &z)
get the mouse coordinates in 3D
Definition: RendererWidget.h:168
void resetCamera()
reset the camera to the default position, default FOV.
static void buildScreenshotMap()
void updateAxes()
update the axes sizes
void actorTransform(vtkSmartPointer< vtkActor >, double *, int, double **, double *, double *)
perform the transformation of the actor
bool getBackfaceCulling() const
Get the current state of backface culling.
Q_ENUMS(ControlMode CameraOrientation)
RendererWidget implements all support methods to use camiTK with Qt interface.
void getCameraSettings(double *position, double *focalPoint, double *viewUp)
get camera settings information (position, what is looked at and how) in world coordinates ...
#define CAMITK_API
Definition: CamiTKAPI.h:49
static vtkInteractorStylePick * New()
Definition: RendererWidget.h:178
same as TRACKBALL but does not allow rotation using left button (but zoom and displacement parallel t...
Definition: RendererWidget.h:177
void RedrawRubberBand()
Definition: RendererWidget.cpp:205
void setAreaPicking(bool areaPicking)
Set the interaction mode like picking or control.
interactor
Definition: RendererWidget.cpp:490
the mouse is used as a trackball (default)
Definition: RendererWidget.h:176
void PrintSelf(ostream &os, vtkIndent indent) override
Definition: RendererWidget.cpp:358
void setLightFollowCamera(bool)
Set/unset the light to follow the camera.
void toggleCopyright(bool)
toggle copyright text
< World axes are seen so that x points to the left, y points backward. For Medical Images Coronal Vie...
Definition: RendererWidget.h:169
void resetCameraSettings()
bool lightFollowCamera
Is the light following the camera.
Definition: RendererWidget.h:496
vtkSmartPointer< vtkActor2D > orientationDecorationActors[4]
Definition: RendererWidget.h:559
rendering3DRedBlue
is rendering in 3D stereo red/blue
Definition: RendererWidget.cpp:478
double getPointSize() const
get the current value of point size
displayGradient
Definition: RendererWidget.cpp:701
Bitmap.
Definition: RendererWidget.h:193
void keyPressEvent(QKeyEvent *e) override
key events (do nothing but pass on e to the parent widget), please do not add any shortcut management...
CameraOrientation
describes the initial position and orientation of the default camera.
Definition: RendererWidget.h:164
int moving
Definition: RendererWidget.h:111
void OnMouseMove() override
Definition: RendererWidget.cpp:154
bool getColorScale() const
get the color display state
LaTeX (only the text is exported)
Definition: RendererWidget.h:197
void rightButtonPressed()
send when the mouse right button is clicked
ControlMode getControlMode() const
get the current control mode
Interactor used when we are in picking mode.
Definition: RendererWidget.h:82
void setOrientationDecorationsLetters(QString letters[4])
give the lettres for orientation decoration: Left, Right, Top, Down
no buttons are currently pressed
Definition: RendererWidget.h:183
void computeVisiblePropBounds(double *bounds)
get the bounding box of all visible actors [xmin,xmax, ymin,ymax, zmin,zmax]
the mouse right button is currently pressed
Definition: RendererWidget.h:186
~vtkInteractorStylePick() override=default
bool getLightFollowCamera() const
Get the current state of the property.
Definition: RendererWidget.h:202
void OnLeftButtonUp() override
Definition: RendererWidget.cpp:189
void setColorScaleTitle(QString t)
set the color scale title.
void setPicker(vtkSmartPointer< vtkAbstractPropPicker > woodyWood)
set the picker to handle the action
Portable Network Graphics.
Definition: RendererWidget.h:191
void setColorScale(bool)
display the color scale in the viewport, use setColorScaleMinMax to change the displayed values ...
PostScript.
Definition: RendererWidget.h:194
VRML 2.0.
Definition: RendererWidget.h:201
void rotateCamera(double angle, int axe)
Rotate the camera around param "axe" of "angle" degrees.
World axes are seen so that x points to the left, y points upward.
Definition: RendererWidget.h:166
copyrightTextActor
copyright text vtk actor
Definition: RendererWidget.cpp:658
vtkSmartPointer< vtkScalarBarActor > colorScale
the color scale displaying the lookup table + values
Definition: RendererWidget.h:548
pickingDiverter
is the picking diverter used
Definition: RendererWidget.cpp:515
Encapsulated PostScript.
Definition: RendererWidget.h:195
bool areaPicking
Definition: RendererWidget.h:115
vtkInteractorStylePick()
Definition: RendererWidget.cpp:103
void setPointSize(double size)
set the default point size
void endPicking()
end picking
pointSize
default point size
Definition: RendererWidget.cpp:480
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...
displayCopyright
is the copyright text displayed
Definition: RendererWidget.cpp:477
setCameraOrientation(cameraOrientation)
annotatedCube
annotated cube actor
Definition: RendererWidget.cpp:562
void setColorScaleMinMax(double m, double M)
set the min and max values.
pickingButtonDiverter
the callback to remove left button interaction while in picking mode
Definition: RendererWidget.cpp:512
int startPosition[2]
Definition: RendererWidget.h:108
void setActiveCamera(vtkCamera *cam)
set active camera
RendererWidget::CameraOrientation getCameraOrientation() const
Return the current axes mode.
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
void startPicking()
manage left mouse release interactions
controlInteractorStyle
for the interaction with the scene
Definition: RendererWidget.cpp:501
vtkCamera * getActiveCamera()
get the active camera
void setGradientBackground(bool)
set the gradient background
virtual void Pick()
Definition: RendererWidget.cpp:276
~RendererWidget() override
destructor
void mousePressEvent(QMouseEvent *event) override
JPEG.
Definition: RendererWidget.h:192
void toggleAxes(bool)
display the axes