|
Computer Assited Medical Intervention Tool Kit
version 5.0
|
|
Go to the documentation of this file.
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;
168 QObject* getPropertyObject()
override;
171 QMenu* getMenu()
override;
174 QToolBar* getToolBar()
override;
182 void refreshRenderer();
193 vtkSmartPointer<vtkCamera> getCamera(QString cameraName =
"default");
218 void setScreenshotAction(
bool);
227 void setLinesAsTubes(
bool tubes);
234 virtual void setHighlightMode();
238 return rendererWidget;
264 void initPicking(PickingMode);
267 void getBoundsOfSelected(
double* bound);
270 void getBounds(
double* bound);
273 void setSideFrameVisible(
bool);
282 void sliderChanged(
int);
285 void xAngleChanged(
double angle);
288 void yAngleChanged(
double angle);
291 void zAngleChanged(
double angle);
321 void toggleInterpolation();
330 QMultiMap<Component*, vtkSmartPointer<vtkProp> >
actorMap;
333 void addActor(
Component*, vtkSmartPointer<vtkProp>);
381 void updateActions();
479 void initWhatsThis();
482 void startWhatsThisSection(
const QString& title =
"");
485 void endWhatsThisSection();
488 void addWhatsThisItem(
const QString& key,
const QString&
description);
538 void createProperties();
546 bool eventFilter(QObject*
object, QEvent* event)
override;
554 void renderingActorsChanged();
557 void highlightModeChanged(QAction* selectedAction);
559 void cameraOrientationChanged(QAction* selectedAction);
561 void viewControlModeChanged(QAction*);
563 void backgroundColor();
569 void pickingModeChanged(QAction*);
QAction * cameraOrientationRightDownAction
to change the axes view mode
Definition: InteractiveViewer.h:405
void setBackfaceCulling(bool)
Representation getRepresentation() const
return the type of representation concretely implemented by this Component in the InteractiveViewer.
Definition: sdk/libraries/core/component/Component.cpp:302
QMultiMap< Component *, vtkSmartPointer< vtkProp > > actorMap
the map containing all the actors in the InteractiveViewer
Definition: InteractiveViewer.h:330
QAction * screenshotAction
Screenshot.
Definition: InteractiveViewer.h:384
vtkSmartPointer< vtkImageData > vtkSmartPointer< vtkImageActor > getPixelActor
Definition: sdk/libraries/core/component/Component.h:732
bool oddWhatsThis
are we currently in a odd table line
Definition: InteractiveViewer.h:476
virtual bool getVisibility(QString) const
get the visibility inside the viewer of the given name
Definition: sdk/libraries/core/component/Component.cpp:261
void setGradientBackground(bool)
set the gradient background
bool isPicking
Indicates that this viewer is picking.
Definition: InteractiveViewer.h:454
virtual vtkSmartPointer< vtkImageActor > get2DImageActor() const =0
Return the vtkImageActor (vtkProp) representing a slice to be displayed in 2D viewers.
virtual bool getFrameVisibility(QString) const =0
Get the Component Frame visibility for a given viewer.
QAction * colorAction
Definition: InteractiveViewer.h:391
QMenu * renderingMenu
Rendering.
Definition: InteractiveViewer.h:387
QAction * pickCellAction
Definition: InteractiveViewer.h:435
virtual bool isSelected() const
Check if this data component is selected.
Definition: sdk/libraries/core/component/Component.h:892
Property * highlightModeProperty
The property that stands for the type of highlight mode of the 3D viewer.
Definition: InteractiveViewer.h:503
@ RIGHT_UP
World axes are seen so that x points to the right, y points upward.
Definition: RendererWidget.h:133
void setActiveCamera(vtkCamera *cam)
set active camera
int getSlice() const override
see Component.cpp
Definition: sdk/libraries/core/component/Component.cpp:749
void screenshot(QString filename)
save the screenshot in a file
unsigned int displayedTopLevelComponents
number of top-level component that are currently displayed
Definition: InteractiveViewer.h:339
#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:261
virtual vtkSmartPointer< vtkAxesActor > getFrameAxisActor()=0
Gives the 3D representation of the frame (based on xyz arrows)
vtkSmartPointer< vtkPointSet > vtkSmartPointer< vtkAlgorithmOutput > getActor
Definition: sdk/libraries/core/component/Component.h:589
QToolBar * viewerToolbar
the QToolBar for the InteractiveViewer
Definition: InteractiveViewer.h:370
QAction * toggleLinesAsTubesAction
button allows one to display the lines as tubes (the lines are to be in vtkPolyData)
Definition: InteractiveViewer.h:425
RendererWidget(QWidget *parent=nullptr, ControlMode mode=RendererWidget::TRACKBALL)
constructors.
void toggleOrientationDecorations(bool)
display orientation decorations
@ LEFT_UP
World axes are seen so that x points to the left, y points upward.
Definition: RendererWidget.h:132
pointSize
default point size
Definition: RendererWidget.cpp:277
RendererWidget * getRendererWidget()
return interactiveViewer RendererWidget
Definition: InteractiveViewer.h:237
QAction * highlightSelectionAction
display mode
Definition: InteractiveViewer.h:396
const const RenderingModes InterfaceGeometry::RenderingModes getRenderingModes() const override
see Component.cpp
Definition: sdk/libraries/core/component/Component.cpp:622
backfaceCulling
Is back face culling on?
Definition: RendererWidget.cpp:273
QAction * toggleLogoAction
button to remove the copyright
Definition: InteractiveViewer.h:419
@ CELL_PICKING
pick a cell in the VTK representation of an Geometry
Definition: InteractiveViewer.h:128
PickingMode pickingMode
Current picking mode, NO_PICKING be default.
Definition: InteractiveViewer.h:451
void rightButtonPressed()
send when the mouse right button is clicked
QMenu * viewerMenu
the QMenu for the InteractiveViewer
Definition: InteractiveViewer.h:367
InteractiveViewer is used to view 3D objects and slices (anything that provides either a InterfaceBit...
Definition: InteractiveViewer.h:112
void keyPressEvent(QKeyEvent *) override
Handle keyboard events in the scene frame, just send everything to InteractiveViewer!
Definition: InteractiveViewerFrame.cpp:60
void setColorScale(bool)
display the color scale in the viewport, use setColorScaleMinMax to change the displayed values
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:303
InteractiveViewerFrame is the basic container for the InteractiveViewer widget.
Definition: InteractiveViewerFrame.h:73
@ PIXEL_PICKING
pick a pixel on a Slice
Definition: InteractiveViewer.h:126
QAction * glyphAction
Definition: InteractiveViewer.h:392
QAction * highlightSelectionOnlyAction
Definition: InteractiveViewer.h:397
vtkSmartPointer< vtkImageData > get3DImageActor
Definition: sdk/libraries/core/component/Component.h:728
void resetCamera()
reset the camera to the default position, default FOV.
Property * backgroundColorProperty
The property that stands for the background color of the viewer.
Definition: InteractiveViewer.h:508
controlMode
current control mode
Definition: RendererWidget.cpp:305
Action class is an abstract class that enables you to build a action (generally on a component)....
Definition: Action.h:231
void toggleAxes(bool)
display the axes
QAction * backgroundColorAction
background color
Definition: InteractiveViewer.h:410
virtual QAction * getQAction(Component *target=nullptr)
Get the corresponding QAction.
Definition: Action.cpp:204
bool isChangingSlice
Indicates that this viewer is changing the slice by the slice slider.
Definition: InteractiveViewer.h:457
virtual void pixelPicked(double, double, double)=0
This method is called when the associated plane has been picked in the InteractiveViewer,...
unsigned int getNumberOfProp() const override
return the number of additional prop
Definition: sdk/libraries/core/component/Component.h:604
QAction * controlModeTrackballAction
to change the camera control mode
Definition: InteractiveViewer.h:401
InteractiveViewerFrame * frame
the InteractiveViewer frame
Definition: InteractiveViewer.h:355
MeshDataFilterModel * scalarDataModel
Definition: InteractiveViewer.h:375
const char * description
Definition: applications/cepgenerator/main.cpp:38
QFrame * sideFrame
the right side frame (this is where the slider and screenshot buttons are shown)
Definition: InteractiveViewer.h:358
QString getName() const override
get the name to be displayed
Definition: sdk/libraries/core/component/Component.h:907
QAction * toggleAxesAction
button allows one to display the Axes in the InteractiveViewer
Definition: InteractiveViewer.h:413
vtkSmartPointer< vtkPointSet > vtkSmartPointer< vtkAlgorithmOutput > const RenderingModes vtkSmartPointer< vtkProp > getProp(const QString ¶m) override
Return the vtkProp (actors, volumes and annotations) corresponding to the given name.
Definition: sdk/libraries/core/component/Component.h:593
std::vector< Component * > pickedComponent
list of Component that are currently picked, correctly displayed in the InteractiveViewer,...
Definition: InteractiveViewer.h:448
HighlightMode
Definition: InteractiveViewer.h:138
ViewerType
Definition: InteractiveViewer.h:118
QAction * cameraOrientationRightUpAction
Definition: InteractiveViewer.h:407
PropertyObject * propertyObject
The property object that holds the properties of this viewer.
Definition: InteractiveViewer.h:498
@ OFF
both selected and non-selected Components are in default mode
Definition: InteractiveViewer.h:139
@ POINT_PICKING
pick a point in the VTK representation of an Geometry
Definition: InteractiveViewer.h:127
setBackgroundColor(0.0, 0.0, 0.0)
QAction * pickPointAction
action of the picking menu
Definition: InteractiveViewer.h:434
SliderSpinBoxWidget * sliceSlider
Slider used to control the slice index in a InteractiveViewer.
Definition: InteractiveViewer.h:352
bool getColorScale() const
get the color display state
QAction * wireframeAction
Definition: InteractiveViewer.h:389
cameraOrientation
state of the initial camera orientation
Definition: RendererWidget.cpp:306
QList< Component * > ComponentList
A list of Component.
Definition: CamiTKAPI.h:127
void keyPressEvent(QKeyEvent *e) override
key events (do nothing but pass on e to the parent widget), please do not add any shortcut management...
@ SELECTION
the selected Components are in default mode, the non-selected Components are shaded
Definition: InteractiveViewer.h:140
QAction * pickCellRegionAction
Definition: InteractiveViewer.h:436
QAction * controlModeJoystickAction
Definition: InteractiveViewer.h:402
void setColorScaleMinMax(double m, double M)
set the min and max values.
vtkSmartPointer< vtkCamera > vtkSmartPointerCamera
Definition: InteractiveViewer.h:67
void setColorScaleTitle(QString t)
set the color scale title.
Property * backfaceCullingProperty
Property that tells whether the viewer uses the backface culling option or not.
Definition: InteractiveViewer.h:523
CamiTK intern class to help automatically sort or show specific data.
Definition: MeshDataModel.h:131
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:48
Property * pointSizeProperty
Property which defines the point size of each point in the 3D viewer.
Definition: InteractiveViewer.h:533
Viewer is an abstract class that is the base class for all viewers.
Definition: Viewer.h:180
@ RIGHT_DOWN
World axes are seen so that x points to the right, y points downward.
Definition: RendererWidget.h:131
QMap< QString, vtkSmartPointerCamera > cameraMap
all the available camera
Definition: InteractiveViewer.h:342
virtual void init() override
initialize all the viewers
Definition: InteractiveSliceViewerExtension.cpp:32
virtual void setLinesAsTubes(bool)=0
set the lines as tubes (works only for vtkDataSet representation that contains lines)
QComboBox * scalarDataComboBox
the ComboBox for mesh scalar data
Definition: InteractiveViewer.h:373
RendererWidget * rendererWidget
Definition: InteractiveViewer.h:348
QAction * toggleBackfaceCullingAction
back face culling
Definition: InteractiveViewer.h:428
PickingMode
Definition: InteractiveViewer.h:125
bool pickingEffectIsSelecting
picking effect while mouse button is kept pressed is selecting (depends on the selection state of the...
Definition: InteractiveViewer.h:460
CameraOrientation
RendererWidget implements all support methods to use camiTK with Qt interface.
Definition: RendererWidget.h:130
QAction * cameraOrientationLeftUpAction
Definition: InteractiveViewer.h:406
virtual vtkSmartPointer< vtkActor > getPickPlaneActor() const =0
Return the vtkActor used to pick pixels in the slices.
void cellPicked(vtkIdType, bool) override
an inherited class can redefine this method something specific.
Definition: sdk/libraries/core/component/Component.h:659
QToolBar * screenshotActionMenu
the screenshot action is inside this menu (in the slice viewer side bar)
Definition: InteractiveViewer.h:361
QAction * pointsAction
Definition: InteractiveViewer.h:390
Q_INVOKABLE InteractiveViewer(QString &name, camitk::InteractiveViewer::ViewerType type)
Construtor.
Definition: InteractiveViewer.cpp:111
QAction * pickPointRegionAction
Definition: InteractiveViewer.h:437
void pointPicked(vtkIdType, bool) override
an inherited class can redefine this method something specific.
Definition: sdk/libraries/core/component/Component.h:654
Property * backgroundGradientColorProperty
Property that tells whether the viewer use a gradient background color or not.
Definition: InteractiveViewer.h:513
Basic component to manage any kind of mesh.
Definition: MeshComponent.h:53
QAction * toggleOrientationDecorationsAction
button allows one to display orientation decoration in SLICE_VIEWER mode
Definition: InteractiveViewer.h:416
void refresh()
refresh the display
QAction * toggleLabelAction
button allows one to display the labels of the object3D
Definition: InteractiveViewer.h:422
@ AREA_CELL_PICKING
pick cells that are inside a rectangular area in the VTK representation of an Geometry
Definition: InteractiveViewer.h:129
Property * screenshotActionProperty
Property that tells whether the screenshot action is visible or not.
Definition: InteractiveViewer.h:528
vtkSmartPointer< vtkEventQtSlotConnect > connector
Definition: InteractiveViewer.h:465
QWidgetAction * scalarDataColorAction
Definition: InteractiveViewer.h:393
@ 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:431
@ AREA_POINT_PICKING
pick points that are inside a rectangular area in the VTK representation of an Geometry
Definition: InteractiveViewer.h:130
This class describes a property object.
Definition: PropertyObject.h:94
vtkSmartPointer< vtkImageData > vtkSmartPointer< vtkImageActor > vtkSmartPointer< vtkActor > updatePickPlane double double vtkSmartPointer< vtkTransform > int getNumberOfSlices() const override
see Component.cpp
Definition: sdk/libraries/core/component/Component.cpp:739
Property * linesAsTubesProperty
Property that tells whether the viewer uses lines as tubes or not.
Definition: InteractiveViewer.h:518
QAction * highlightOffAction
Definition: InteractiveViewer.h:398
QAction * surfaceAction
Definition: InteractiveViewer.h:388
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:302
#define CAMITK_API
Definition: CamiTKAPI.h:49
Definition: Action.cpp:35
void toggleLogo(bool)
toggle logo
ViewerType myType
type of InteractiveViewer (display slice or geometry)
Definition: InteractiveViewer.h:318
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:463