27#ifndef INTERACTIVE_VIEWER_H
28#define INTERACTIVE_VIEWER_H
39#include <QWidgetAction>
46#include <vtkSmartPointer.h>
54class vtkEventQtSlotConnect;
58class SliderSpinBoxWidget;
60class InterfaceGeometry;
62class InteractiveViewer;
65class FrameOfReference;
127 LOCATION_PICKING = 0,
130 AREA_POINT_PICKING = 3,
131 AREA_CELL_PICKING = 4,
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();
278 return rendererWidget;
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);
353 void toggleInterpolation();
362 QMultiMap<Component*, vtkSmartPointer<vtkProp> >
actorMap;
380 void updateCurrentFrameOfReferenceColorIndicator();
408 friend void InteractiveViewerFrame::keyPressEvent(QKeyEvent* e);
420 void updateActions();
522 void initWhatsThis();
525 void startWhatsThisSection(
const QString& title =
"");
528 void endWhatsThisSection();
531 void addWhatsThisItem(
const QString& key,
const QString&
description);
592 void createProperties();
600 bool eventFilter(QObject*
object, QEvent* event)
override;
609 void renderingActorsChanged();
611 void highlightModeChanged(QAction* selectedAction);
615 void viewControlModeChanged(QAction*);
617 void backgroundColor();
619 void toggleAxes(
bool);
621 void toggleOrientationDecorations(
bool);
623 void pickingModeChanged(QAction*);
#define CAMITK_API
Definition CamiTKAPI.h:66
const char * description
Definition applications/cepgenerator/main.cpp:38
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:71
InteractiveViewerFrame is the basic container for the InteractiveViewer widget.
Definition InteractiveViewerFrame.h:50
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
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
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
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
bool isChangingSlice
Indicates that this viewer is changing the slice by the slice slider.
Definition InteractiveViewer.h:500
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
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
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
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
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
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
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
QAction * pickCellAction
Definition InteractiveViewer.h:477
QAction * controlModeJoystickAction
Definition InteractiveViewer.h:446
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
QAction * toggleLogoAction
button to remove the copyright
Definition InteractiveViewer.h:458
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
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
@ OFF
both selected and non-selected Components are in default mode
Definition InteractiveViewer.h:141
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
Property * pointSizeProperty
Property which defines the point size of each point in the 3D viewer.
Definition InteractiveViewer.h:587
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
@ 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 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
vtkSmartPointer< vtkCamera > vtkSmartPointerCamera
Definition InteractiveViewer.h:67