27 #ifndef INTERACTIVE_VIEWER_H
28 #define INTERACTIVE_VIEWER_H
32 #include "Component.h"
38 #include <QPushButton>
39 #include <QWidgetAction>
46 #include <vtkSmartPointer.h>
54 class vtkEventQtSlotConnect;
58 class SliderSpinBoxWidget;
59 class GeometricObject;
60 class InterfaceGeometry;
61 class InterfaceBitMap;
62 class InteractiveViewer;
63 class MeshDataFilterModel;
155 QString getName()
const;
165 QWidget* getWidget()
override;
171 QMenu* getMenu()
override;
174 QToolBar* getToolBar()
override;
182 void refreshRenderer();
193 vtkSmartPointer<vtkCamera> getCamera(QString cameraName =
"default");
224 void setScreenshotAction(
bool);
233 void setLinesAsTubes(
bool tubes);
240 virtual void setHighlightMode();
244 return rendererWidget;
270 void initPicking(PickingMode);
273 void getBoundsOfSelected(
double* bound);
276 void getBounds(
double* bound);
279 void setSideFrameVisible(
bool);
288 void sliderChanged(
int);
291 void xAngleChanged(
double angle);
294 void yAngleChanged(
double angle);
297 void zAngleChanged(
double angle);
327 void toggleInterpolation();
336 QMultiMap<Component*, vtkSmartPointer<vtkProp> >
actorMap;
339 void addActor(
Component*, vtkSmartPointer<vtkProp>);
387 void updateActions();
488 void initWhatsThis();
491 void startWhatsThisSection(
const QString& title =
"");
494 void endWhatsThisSection();
497 void addWhatsThisItem(
const QString& key,
const QString&
description);
552 void createProperties();
560 bool eventFilter(QObject*
object, QEvent* event)
override;
569 void renderingActorsChanged();
571 void highlightModeChanged(QAction* selectedAction);
573 void cameraOrientationChanged(QAction* selectedAction);
575 void viewControlModeChanged(QAction*);
577 void backgroundColor();
583 void pickingModeChanged(QAction*);
#define CAMITK_API
Definition: CamiTKAPI.h:49
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:303
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:376
QAction * toggleAxesAction
button allows one to display the Axes in the InteractiveViewer
Definition: InteractiveViewer.h:419
Property * screenshotActionProperty
Property that tells whether the screenshot action is visible or not.
Definition: InteractiveViewer.h:542
QAction * glyphAction
Definition: InteractiveViewer.h:398
QAction * cameraOrientationLeftUpAction
Definition: InteractiveViewer.h:412
QToolBar * screenshotActionMenu
the screenshot action is inside this menu (in the slice viewer side bar)
Definition: InteractiveViewer.h:367
QAction * highlightSelectionAction
display mode
Definition: InteractiveViewer.h:402
Property * backfaceCullingProperty
Property that tells whether the viewer uses the backface culling option or not.
Definition: InteractiveViewer.h:532
QWidgetAction * scalarDataColorAction
Definition: InteractiveViewer.h:399
bool isPicking
Indicates that this viewer is picking.
Definition: InteractiveViewer.h:463
QAction * cameraOrientationRightUpAction
Definition: InteractiveViewer.h:413
PickingMode
Different kind of picking must be available: pixel in slice, a point, a cell, ...
Definition: InteractiveViewer.h:125
@ AREA_CELL_PICKING
pick cells that are inside a rectangular area in the VTK representation of an Geometry
Definition: InteractiveViewer.h:129
@ CELL_PICKING
pick a cell in the VTK representation of an Geometry
Definition: InteractiveViewer.h:128
@ AREA_POINT_PICKING
pick points that are inside a rectangular area in the VTK representation of an Geometry
Definition: InteractiveViewer.h:130
@ POINT_PICKING
pick a point in the VTK representation of an Geometry
Definition: InteractiveViewer.h:127
@ PIXEL_PICKING
pick a pixel on a Slice
Definition: InteractiveViewer.h:126
QString whatsThis
Definition: InteractiveViewer.h:482
bool oddWhatsThis
are we currently in a odd table line
Definition: InteractiveViewer.h:485
RendererWidget * rendererWidget
Definition: InteractiveViewer.h:354
QAction * toggleLabelAction
button allows one to display the labels of the object3D
Definition: InteractiveViewer.h:428
QAction * backgroundColorAction
background color
Definition: InteractiveViewer.h:416
InteractiveViewerFrame * frame
the InteractiveViewer frame
Definition: InteractiveViewer.h:361
MeshDataFilterModel * scalarDataModel
Definition: InteractiveViewer.h:381
bool isChangingSlice
Indicates that this viewer is changing the slice by the slice slider.
Definition: InteractiveViewer.h:466
vtkSmartPointer< vtkEventQtSlotConnect > connector
Definition: InteractiveViewer.h:474
ViewerType myType
type of InteractiveViewer (display slice or geometry)
Definition: InteractiveViewer.h:324
QAction * wireframeAction
Definition: InteractiveViewer.h:395
QAction * highlightOffAction
Definition: InteractiveViewer.h:404
Property * highlightModeProperty
The property that stands for the type of highlight mode of the 3D viewer.
Definition: InteractiveViewer.h:512
Property * linesAsTubesProperty
Property that tells whether the viewer uses lines as tubes or not.
Definition: InteractiveViewer.h:527
Property * backgroundColorProperty
The property that stands for the background color of the viewer.
Definition: InteractiveViewer.h:517
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:472
SliderSpinBoxWidget * sliceSlider
Slider used to control the slice index in a InteractiveViewer.
Definition: InteractiveViewer.h:358
QAction * toggleFxaaAntialiasingAction
FXAA antialiasing.
Definition: InteractiveViewer.h:437
QAction * colorAction
Definition: InteractiveViewer.h:397
QAction * screenshotAction
Screenshot.
Definition: InteractiveViewer.h:390
RendererWidget * getRendererWidget()
return interactiveViewer RendererWidget
Definition: InteractiveViewer.h:243
Property * fxaaAntialiasingProperty
Property that tells whether the viewer uses the backface culling option or not.
Definition: InteractiveViewer.h:537
PropertyObject * propertyObject
The property object that holds the properties of this viewer.
Definition: InteractiveViewer.h:507
QAction * surfaceAction
Definition: InteractiveViewer.h:394
QMenu * renderingMenu
Rendering.
Definition: InteractiveViewer.h:393
QAction * pointsAction
Definition: InteractiveViewer.h:396
QAction * pickPointRegionAction
Definition: InteractiveViewer.h:446
QAction * pickCellAction
Definition: InteractiveViewer.h:444
QAction * cameraOrientationRightDownAction
to change the axes view mode
Definition: InteractiveViewer.h:411
QAction * controlModeJoystickAction
Definition: InteractiveViewer.h:408
bool pickingEffectIsSelecting
picking effect while mouse button is kept pressed is selecting (depends on the selection state of the...
Definition: InteractiveViewer.h:469
Property * backgroundGradientColorProperty
Property that tells whether the viewer use a gradient background color or not.
Definition: InteractiveViewer.h:522
QAction * toggleLogoAction
button to remove the copyright
Definition: InteractiveViewer.h:425
QAction * toggleBackfaceCullingAction
back face culling
Definition: InteractiveViewer.h:434
QAction * toggleOrientationDecorationsAction
button allows one to display orientation decoration in SLICE_VIEWER mode
Definition: InteractiveViewer.h:422
QAction * toggleLinesAsTubesAction
button allows one to display the lines as tubes (the lines are to be in vtkPolyData)
Definition: InteractiveViewer.h:431
PickingMode pickingMode
Current picking mode, NO_PICKING be default.
Definition: InteractiveViewer.h:460
unsigned int displayedTopLevelComponents
number of top-level component that are currently displayed
Definition: InteractiveViewer.h:345
QAction * pickCellRegionAction
Definition: InteractiveViewer.h:445
HighlightMode
describes the current mode of display.
Definition: InteractiveViewer.h:138
@ SELECTION
the selected Components are in default mode, the non-selected Components are shaded
Definition: InteractiveViewer.h:140
@ OFF
both selected and non-selected Components are in default mode
Definition: InteractiveViewer.h:139
QAction * controlModeTrackballAction
to change the camera control mode
Definition: InteractiveViewer.h:407
QAction * pickPointAction
action of the picking menu
Definition: InteractiveViewer.h:443
QComboBox * scalarDataComboBox
the ComboBox for mesh scalar data
Definition: InteractiveViewer.h:379
QAction * highlightSelectionOnlyAction
Definition: InteractiveViewer.h:403
QMap< QString, vtkSmartPointerCamera > cameraMap
all the available camera
Definition: InteractiveViewer.h:348
Property * pointSizeProperty
Property which defines the point size of each point in the 3D viewer.
Definition: InteractiveViewer.h:547
QFrame * sideFrame
the right side frame (this is where the slider and screenshot buttons are shown)
Definition: InteractiveViewer.h:364
QMenu * viewerMenu
the QMenu for the InteractiveViewer
Definition: InteractiveViewer.h:373
QMultiMap< Component *, vtkSmartPointer< vtkProp > > actorMap
the map containing all the actors in the InteractiveViewer
Definition: InteractiveViewer.h:336
std::vector< Component * > pickedComponent
list of Component that are currently picked, correctly displayed in the InteractiveViewer,...
Definition: InteractiveViewer.h:457
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
QAction * toggleScreenshotAction
visibility of the screenshot action in the side toolbar of slice viewer
Definition: InteractiveViewer.h:440
CamiTK intern class to help automatically sort or show specific data.
Definition: MeshDataModel.h:108
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:280
Viewer is an abstract class that is the base class for all viewers.
Definition: Viewer.h:181
CameraOrientation
RendererWidget implements all support methods to use camiTK with Qt interface.
Definition: RendererWidget.h:155
Definition: Action.cpp:36
void setBackfaceCulling(bool)
void setColorScale(bool)
display the color scale in the viewport, use setColorScaleMinMax to change the displayed values
void setGradientBackground(bool)
set the gradient background
void setColorScaleMinMax(double m, double M)
set the min and max values.
void setFxaaAntialiasing(bool)
Set/unset FXAA Antialiasing in renderer.
void setColorScaleTitle(QString t)
set the color scale title.
setBackgroundColor(0.0, 0.0, 0.0)
void toggleLogo(bool)
toggle logo
vtkSmartPointer< vtkCamera > vtkSmartPointerCamera
Definition: InteractiveViewer.h:67
void toggleOrientationDecorations(bool)
display orientation decorations
void toggleAxes(bool)
display the axes
void keyPressEvent(QKeyEvent *e) override
key events (do nothing but pass on e to the parent widget), please do not add any shortcut management...
RendererWidget(QWidget *parent=nullptr, ControlMode mode=RendererWidget::TRACKBALL)
constructors.
bool getColorScale() const
get the color display state
void refresh()
refresh the display
void resetCamera()
reset the camera to the default position, default FOV.
void screenshot(QString filename)
save the screenshot in a file
void setActiveCamera(vtkCamera *cam)
set active camera