27#ifndef INTERACTIVE_VIEWER_H
28#define INTERACTIVE_VIEWER_H
39#include <QWidgetAction>
46#include <vtkSmartPointer.h>
54class vtkEventQtSlotConnect;
171 QString getName()
const;
178 void refresh(
Viewer* whoIsAsking =
nullptr)
override;
181 QWidget* getWidget()
override;
187 QMenu* getMenu()
override;
190 QToolBar* getToolBar()
override;
199 virtual void setFrame(
const std::shared_ptr<FrameOfReference>& frame);
214 void setActiveCamera(QString cameraName);
227 vtkSmartPointer<vtkCamera> getCamera(QString cameraName =
"default");
230 void screenshot(QString);
239 virtual void setGradientBackground(
bool);
242 virtual void setBackgroundColor(QColor);
249 void setBackfaceCulling(
bool);
255 void setFxaaAntialiasing(
bool);
258 void setScreenshotAction(
bool);
267 void setLinesAsTubes(
bool tubes);
271 void keyPressEvent(QKeyEvent* e);
274 virtual void setHighlightMode();
286 void setColorScale(
bool);
289 bool getColorScale()
const;
296 void setColorScaleMinMax(
double m,
double M);
301 void setColorScaleTitle(QString t);
304 void initPicking(PickingMode);
307 void getBoundsOfSelected(
double* bound);
310 void getBounds(
double* bound);
313 void setSideFrameVisible(
bool);
322 void sliderChanged(
int);
325 void toggleLogo(
bool);
362 QMultiMap<Component*, vtkSmartPointer<vtkProp> >
actorMap;
600 bool eventFilter(QObject*
object, QEvent* event)
override;
#define CAMITK_API
Definition CamiTKAPI.h:66
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition sdk/libraries/core/component/Component.h:304
FrameOfReference is only a label for an abstract coordinate system.
Definition FrameOfReference.h:69
A geometric object allows one to create geometric object (sphere, arrow, ...) that can be added direc...
Definition GeometricObject.h:54
InteractiveViewerFrame is the basic container for the InteractiveViewer widget.
Definition InteractiveViewerFrame.h:50
void keyPressEvent(QKeyEvent *) override
Handle keyboard events in the scene frame, just send everything to InteractiveViewer!
Definition InteractiveViewerFrame.cpp:37
InteractiveViewer is used to view 3D objects and slices (anything that provides either a InterfaceBit...
Definition InteractiveViewer.h:112
QToolBar * viewerToolbar
the QToolBar for the InteractiveViewer
Definition InteractiveViewer.h:414
QAction * toggleAxesAction
button allows one to display the Axes in the InteractiveViewer
Definition InteractiveViewer.h:452
Property * screenshotActionProperty
Property that tells whether the screenshot action is visible or not.
Definition InteractiveViewer.h:582
QAction * glyphAction
Definition InteractiveViewer.h:437
QToolBar * screenshotActionMenu
the screenshot action is inside this menu (in the slice viewer side bar)
Definition InteractiveViewer.h:405
QAction * highlightSelectionAction
display mode
Definition InteractiveViewer.h:440
Property * backfaceCullingProperty
Property that tells whether the viewer uses the backface culling option or not.
Definition InteractiveViewer.h:572
void updateSelectionDisplay(Component *)
Update the display of the given Component, according to its selection state and the current Highlight...
Definition InteractiveViewer.cpp:1770
bool isPicking
Indicates that this viewer is picking.
Definition InteractiveViewer.h:497
PickingMode
Different kind of picking must be available: pixel in slice, a point, a cell, ...
Definition InteractiveViewer.h:126
@ AREA_CELL_PICKING
pick cells that are inside a rectangular area in the VTK representation of an Geometry
Definition InteractiveViewer.h:131
@ CELL_PICKING
pick a cell in the VTK representation of an Geometry
Definition InteractiveViewer.h:129
@ AREA_POINT_PICKING
pick points that are inside a rectangular area in the VTK representation of an Geometry
Definition InteractiveViewer.h:130
@ NO_PICKING
no picking possible
Definition InteractiveViewer.h:133
@ POINT_PICKING
pick a point in the VTK representation of an Geometry
Definition InteractiveViewer.h:128
@ PIXEL_PICKING
pick a pixel on a Slice
Definition InteractiveViewer.h:132
@ LOCATION_PICKING
pick a point on any VTK representation (can be any location)
Definition InteractiveViewer.h:127
QString whatsThis
Definition InteractiveViewer.h:516
bool oddWhatsThis
are we currently in a odd table line
Definition InteractiveViewer.h:519
RendererWidget * rendererWidget
Definition InteractiveViewer.h:392
QAction * toggleLabelAction
button allows one to display the labels of the object3D
Definition InteractiveViewer.h:461
void renderingActorsChanged()
Definition InteractiveViewer.cpp:2033
Property * cameraOrientationProperty
The property that stands for the current orientation of the viewer.
Definition InteractiveViewer.h:551
QAction * backgroundColorAction
background color
Definition InteractiveViewer.h:449
void createProperties()
Create and handle the CamiTK properties of this viewer.
Definition InteractiveViewer.cpp:2452
bool isChangingSlice
Indicates that this viewer is changing the slice by the slice slider.
Definition InteractiveViewer.h:500
void pickingModeChanged(QAction *)
Definition InteractiveViewer.cpp:2173
void addWhatsThisItem(const QString &key, const QString &description)
add an item (row) in the the what's this message (to describe a shortcut)
Definition InteractiveViewer.cpp:1044
void initActions()
init all the actions (called only once in the getWidget() method)
Definition InteractiveViewer.cpp:844
void initWhatsThis()
initialize the what's this html string
Definition InteractiveViewer.cpp:1020
void backgroundColor()
Definition InteractiveViewer.cpp:2094
vtkSmartPointer< vtkEventQtSlotConnect > connector
Definition InteractiveViewer.h:508
ViewerType myType
type of InteractiveViewer (display slice or geometry)
Definition InteractiveViewer.h:350
QAction * wireframeAction
Definition InteractiveViewer.h:434
void endWhatsThisSection()
end a table (section) in the what's this message
Definition InteractiveViewer.cpp:1038
QAction * highlightOffAction
Definition InteractiveViewer.h:442
Property * highlightModeProperty
The property that stands for the type of highlight mode of the 3D viewer.
Definition InteractiveViewer.h:546
Property * linesAsTubesProperty
Property that tells whether the viewer uses lines as tubes or not.
Definition InteractiveViewer.h:567
Property * backgroundColorProperty
The property that stands for the background color of the viewer.
Definition InteractiveViewer.h:557
void toggleAxes(bool)
Definition InteractiveViewer.cpp:2104
bool pickingEffectUpdated
was the picking effect updated (it has to be updated with the first picking for a given button down s...
Definition InteractiveViewer.h:506
Q_INVOKABLE InteractiveViewer(QString &name, camitk::InteractiveViewer::ViewerType type)
Construtor.
Definition InteractiveViewer.cpp:98
SliderSpinBoxWidget * sliceSlider
Slider used to control the slice index in a InteractiveViewer.
Definition InteractiveViewer.h:396
CameraOrientation
describes the current position of the camera.
Definition InteractiveViewer.h:150
void toggleInterpolation()
for InterfaceBitMap, toggle the interpolation mode (intern method, not a property because it can only...
Definition InteractiveViewer.cpp:1738
void setLabel(bool)
if true currently selected Components label will have their label on (shown)
Definition InteractiveViewer.cpp:2125
QAction * toggleFxaaAntialiasingAction
FXAA antialiasing.
Definition InteractiveViewer.h:470
QAction * colorAction
Definition InteractiveViewer.h:436
QAction * screenshotAction
Screenshot.
Definition InteractiveViewer.h:429
std::shared_ptr< FrameOfReference > frameOfReference
The FrameOfReference in which this component's data is represented in (used to properly position the ...
Definition InteractiveViewer.h:371
void rightClick()
Definition InteractiveViewer.cpp:2440
Property * fxaaAntialiasingProperty
Property that tells whether the viewer uses the backface culling option or not.
Definition InteractiveViewer.h:577
PropertyObject * propertyObject
The property object that holds the properties of this viewer.
Definition InteractiveViewer.h:541
void highlightModeChanged(QAction *selectedAction)
Definition InteractiveViewer.cpp:2067
QAction * surfaceAction
Definition InteractiveViewer.h:433
QMenu * renderingMenu
Rendering.
Definition InteractiveViewer.h:432
QAction * pointsAction
Definition InteractiveViewer.h:435
QAction * pickPointRegionAction
Definition InteractiveViewer.h:479
bool eventFilter(QObject *object, QEvent *event) override
Event filter of this class instance to watch its properties instances.
Definition InteractiveViewer.cpp:2507
QAction * pickCellAction
Definition InteractiveViewer.h:477
void updateActions()
update the viewer menu depending on the selection,...
Definition InteractiveViewer.cpp:1929
QAction * controlModeJoystickAction
Definition InteractiveViewer.h:446
void updateCurrentFrameOfReferenceColorIndicator()
update myWidget using the color of the current frame of reference
Definition InteractiveViewer.cpp:396
bool pickingEffectIsSelecting
picking effect while mouse button is kept pressed is selecting (depends on the selection state of the...
Definition InteractiveViewer.h:503
Property * backgroundGradientColorProperty
Property that tells whether the viewer use a gradient background color or not.
Definition InteractiveViewer.h:562
void viewControlModeChanged(QAction *)
Definition InteractiveViewer.cpp:2084
QAction * toggleLogoAction
button to remove the copyright
Definition InteractiveViewer.h:458
void picked()
get the picker and populate the picked component with the picked stuff
Definition InteractiveViewer.cpp:2192
void startWhatsThisSection(const QString &title="")
start a table (section) in the what's this message
Definition InteractiveViewer.cpp:1028
QAction * toggleBackfaceCullingAction
back face culling
Definition InteractiveViewer.h:467
QComboBox * pickingCombo
Definition InteractiveViewer.h:426
QAction * toggleOrientationDecorationsAction
button allows one to display orientation decoration in SLICE_VIEWER mode
Definition InteractiveViewer.h:455
QAction * toggleLinesAsTubesAction
button allows one to display the lines as tubes (the lines are to be in vtkPolyData)
Definition InteractiveViewer.h:464
void resetLUT()
for InterfaceBitMap, reset the lut that was changed by the image interactor (window and level)
Definition InteractiveViewer.cpp:1753
PickingMode pickingMode
Current picking mode, POINT_PICKING be default.
Definition InteractiveViewer.h:494
unsigned int displayedTopLevelComponents
number of top-level component that are currently displayed
Definition InteractiveViewer.h:383
InteractiveViewerFrame * myWidget
the InteractiveViewer myWidget
Definition InteractiveViewer.h:399
QAction * pickCellRegionAction
Definition InteractiveViewer.h:478
RendererWidget * getRendererWidget()
return interactiveViewer RendererWidget
Definition InteractiveViewer.h:277
HighlightMode
describes the current mode of display.
Definition InteractiveViewer.h:140
@ SELECTION
the selected Components are in default mode, the non-selected Components are shaded
Definition InteractiveViewer.h:142
@ SELECTION_ONLY
the selected Components are in default mode, the non-selected are hidden
Definition InteractiveViewer.h:143
@ OFF
both selected and non-selected Components are in default mode
Definition InteractiveViewer.h:141
void removeAllActors(Component *)
remove all the given Component actors from the renderer and delete comp from the map
Definition InteractiveViewer.cpp:613
QAction * controlModeTrackballAction
to change the camera control mode
Definition InteractiveViewer.h:445
QAction * pickPointAction
action of the picking menu
Definition InteractiveViewer.h:476
QAction * pickLocationAction
Definition InteractiveViewer.h:480
QAction * highlightSelectionOnlyAction
Definition InteractiveViewer.h:441
QMap< QString, vtkSmartPointerCamera > cameraMap
all the available camera
Definition InteractiveViewer.h:386
void setGlyph(bool)
Definition InteractiveViewer.cpp:2137
void toggleOrientationDecorations(bool)
Definition InteractiveViewer.cpp:2111
Property * pointSizeProperty
Property which defines the point size of each point in the 3D viewer.
Definition InteractiveViewer.h:587
void addActor(Component *, vtkSmartPointer< vtkProp >, const FrameOfReference *sourceFrame=nullptr)
add the given actor of the given Component to the renderer and insert it in the map
Definition InteractiveViewer.cpp:626
QFrame * sideFrame
the right side myWidget (this is where the slider and screenshot buttons are shown)
Definition InteractiveViewer.h:402
QMenu * viewerMenu
the QMenu for the InteractiveViewer
Definition InteractiveViewer.h:411
QMultiMap< Component *, vtkSmartPointer< vtkProp > > actorMap
the map containing all the actors in the InteractiveViewer
Definition InteractiveViewer.h:362
std::vector< Component * > pickedComponent
list of Component that are currently picked, correctly displayed in the InteractiveViewer,...
Definition InteractiveViewer.h:491
ViewerType
there is two possibilities: this InteractiveViewer is used to display slices or geometry
Definition InteractiveViewer.h:118
@ GEOMETRY_VIEWER
display 3D stuff (geometry, etc...)
Definition InteractiveViewer.h:120
@ SLICE_VIEWER
display slices (the view is blocked in 2D and the slider is available)
Definition InteractiveViewer.h:119
QComboBox * orientationCombo
Definition InteractiveViewer.h:423
QAction * toggleScreenshotAction
visibility of the screenshot action in the side toolbar of slice viewer
Definition InteractiveViewer.h:473
QMap< vtkSmartPointer< vtkActor2D >, QVector3D > transformed2DActors
the map containing the initial position of the vtkActor2D They have to be transformed from the creati...
Definition InteractiveViewer.h:368
This class describes what are the methods to implement for a BitMap.
Definition InterfaceBitMap.h:68
This class describes what are the methods to implement for a Geometry (rendering parameters,...
Definition InterfaceGeometry.h:61
This class describes a property object.
Definition PropertyObject.h:72
This class describes a property that can be used in components and actions or any class that needs to...
Definition Property.h:306
Viewer is an abstract class that is the base class for all viewers.
Definition Viewer.h:182
Viewer(QString name, ViewerType type=EMBEDDED)
default constructor
Definition Viewer.cpp:41
vtkSmartPointer< vtkCamera > vtkSmartPointerCamera
Definition InteractiveViewer.h:67