InteractiveViewer is used to view 3D objects and slices (anything that provides either a InterfaceBitMap or a InterfaceGeometry). More...
#include <InteractiveViewer.h>
Public Types | |
| enum class | CameraOrientation { XY , XZ , YZ , AXIAL , CORONAL , SAGITTAL , CUSTOM } |
| describes the current position of the camera. More... | |
| enum | HighlightMode { OFF , SELECTION , SELECTION_ONLY } |
| describes the current mode of display. More... | |
| enum | PickingMode { LOCATION_PICKING = 0 , POINT_PICKING = 1 , CELL_PICKING = 2 , AREA_POINT_PICKING = 3 , AREA_CELL_PICKING = 4 , PIXEL_PICKING = 5 , NO_PICKING } |
| Different kind of picking must be available: pixel in slice, a point, a cell, ... More... | |
| enum | ViewerType { SLICE_VIEWER , GEOMETRY_VIEWER } |
| there is two possibilities: this InteractiveViewer is used to display slices or geometry More... | |
| Public Types inherited from camitk::Viewer | |
| enum | ViewerType { EMBEDDED , DOCKED } |
| describes where this viewer should appear More... | |
Public Slots | |
public slots | |
| void | sliderChanged (int) |
| Slot called when the InteractiveViewer slider has been changed. | |
| void | toggleLogo (bool) |
| show/hide the logo at the bottom right corner | |
Public Member Functions | |
| virtual void | setBackgroundColor (QColor) |
| set background color | |
| virtual void | setGradientBackground (bool) |
| set gradient background on/off | |
| Q_INVOKABLE | InteractiveViewer (QString &name, camitk::InteractiveViewer::ViewerType type) |
| Construtor. | |
| virtual | ~InteractiveViewer () override |
| Destructor. | |
| QString | getName () const |
| get the scene name | |
Inherited from Viewer | |
| void | refresh (Viewer *whoIsAsking=nullptr) override |
| QWidget * | getWidget () override |
| get the InteractiveViewer widget (QTreeWidget). | |
| PropertyObject * | getPropertyObject () override |
| get the InteractiveViewer propertyObject (only non-null for GEOMETRY_VIEWER) | |
| QMenu * | getMenu () override |
| get the explorer menu | |
| QToolBar * | getToolBar () override |
| get the viewer toolbar | |
Manage the viewer frame of reference | |
| virtual void | setFrame (const std::shared_ptr< FrameOfReference > &frame) |
| virtual const FrameOfReference * | getFrame () const |
| get the FrameOfReference of the viewer (it may also contain AnatomicalOrientation information) | |
Misc | |
set the color scale in the viewport, use setColorScaleMinMax / setColorScaleTitle to change the displayed values. | |
| void | setColorScale (bool) |
| bool | getColorScale () const |
| get the current value of the color scale property. | |
| void | setColorScaleMinMax (double m, double M) |
| set the min and max values. | |
| void | setColorScaleTitle (QString t) |
| set the color scale title. | |
| void | initPicking (PickingMode) |
| Init the picker with a given picking mode. | |
| void | getBoundsOfSelected (double *bound) |
| Compute the bounding box of the selected elements [xmin,xmax, ymin,ymax, zmin,zmax]. | |
| void | getBounds (double *bound) |
| Compute the bounding box of all displayed Component. | |
| void | setSideFrameVisible (bool) |
| set the slice viewer side bar+screenshot button visibility | |
| Public Member Functions inherited from camitk::Viewer | |
| QStringList | getComponentClassNames () const |
| get the list of Component class manages by this viewer (default is set to "Component", i.e. | |
| QString | getDescription () const |
| get the name of the viewer | |
| virtual QDockWidget * | getDockWidget () const |
| Get the QDockWidget* where this viewer is currently docked (or nullptr if it is not docked anywhere or if the viewer is of type EMBEDDED). | |
| virtual QLayout * | getEmbedder () const |
| Get the QLayout* where this viewer is currently embedded (or nullptr if it is not embedded anywhere or if the viewer is of type DOCKED). | |
| virtual QPixmap | getIcon () const |
| get the viewer icon | |
| QString | getName () const |
| get the name of the viewer | |
| virtual bool | getToolBarVisibility () const |
| get the current value of the toolbar visibility | |
| ViewerType | getType () const |
| get the viewer layout | |
| QUuid | getUuid () const |
| get the Uuid of this viewer | |
| void | setDescription (QString) |
| set the viewer's description | |
| virtual bool | setDockWidget (QDockWidget *) |
| If the viewer type is DOCKED, dock the widget inside the given dock widget (do nothing if the type is EMBEDDED or if the viewer has already been docked before) Note that once set, the dock widget cannot be modified. | |
| virtual bool | setEmbedder (QLayout *) |
| If the viewer type is EMBEDDED, embed the viewer widget in the given layout (do nothing if the type is DOCKED) Note that you can call this method any time you want to move the viewer's widget to another layout (but there is only one embedder at a time). | |
| virtual void | setToolBarVisibility (bool) |
| set the visibility of the toolbar in the main window (true by default). | |
| void | setType (ViewerType) |
| set the viewer layout (the type can be changed dynamically to fit the developer's purpose) | |
| bool | setUuid (QUuid id) |
| set the Uuid of this viewer | |
| virtual void | setVisible (bool) |
| set the visibility of the viewer (show or hide its widget) | |
| Viewer (QString name, ViewerType type=EMBEDDED) | |
| default constructor | |
| virtual | ~Viewer () override |
| default destructor | |
Protected Slots | |
All the slots called by the menu actions | |
| void | renderingActorsChanged () |
| void | highlightModeChanged (QAction *selectedAction) |
| void | viewControlModeChanged (QAction *) |
| void | backgroundColor () |
| void | toggleAxes (bool) |
| void | toggleOrientationDecorations (bool) |
| void | pickingModeChanged (QAction *) |
| void | picked () |
| get the picker and populate the picked component with the picked stuff | |
| void | rightClick () |
| void | setLabel (bool) |
| if true currently selected Components label will have their label on (shown) | |
| void | setGlyph (bool) |
Protected Member Functions | |
| void | init () |
| used by both constructors | |
| Protected Member Functions inherited from camitk::Viewer | |
| void | clearSelection () |
| clear the selection | |
| void | selectionChanged (Component *comp) |
| the selection has changed to be just one comp | |
| void | selectionChanged (ComponentList &compSet) |
| The selection has changed to the given ComponentList. | |
| void | setComponentClassNames (QStringList) |
| set the list of component class names managed by this viewer | |
| void | setIcon (QPixmap icon) |
| set the default icon for the viewer extension | |
Protected Attributes | |
Picking management | |
| std::vector< Component * > | pickedComponent |
| list of Component that are currently picked, correctly displayed in the InteractiveViewer, but for speed optimization that are not yet selected in the explorer. | |
| PickingMode | pickingMode |
| Current picking mode, POINT_PICKING be default. | |
| bool | isPicking |
| Indicates that this viewer is picking. | |
| bool | isChangingSlice |
| Indicates that this viewer is changing the slice by the slice slider. | |
| bool | pickingEffectIsSelecting |
| picking effect while mouse button is kept pressed is selecting (depends on the selection state of the first component picked) | |
| bool | pickingEffectUpdated |
| was the picking effect updated (it has to be updated with the first picking for a given button down session) | |
| vtkSmartPointer< vtkEventQtSlotConnect > | connector |
Display properties | |
Properties that can be managed without the knowledge/intervention of the InterfaceGeometry:
Properties that need to be managed by the InterfaceGeometry itself (not boolean state managed somewhere by vtk, not integer/float value manage in InteractiveViewer as a user-preference)
| |
| ViewerType | myType |
| type of InteractiveViewer (display slice or geometry) | |
| QMultiMap< Component *, vtkSmartPointer< vtkProp > > | actorMap |
| the map containing all the actors in the InteractiveViewer | |
| QMap< vtkSmartPointer< vtkActor2D >, QVector3D > | transformed2DActors |
| the map containing the initial position of the vtkActor2D They have to be transformed from the creating component frame to the viewer frame each time they are added to the display as their position is always recomputed/reset in the component's frame each time getProp(..) is called. | |
| std::shared_ptr< FrameOfReference > | frameOfReference |
| The FrameOfReference in which this component's data is represented in (used to properly position the actors). | |
| unsigned int | displayedTopLevelComponents |
| number of top-level component that are currently displayed | |
| QMap< QString, vtkSmartPointerCamera > | cameraMap |
| all the available camera | |
| void | initSettings () |
| initialize the property object and state using the user settings (user preferences system files .config/.ini) | |
| void | toggleInterpolation () |
| for InterfaceBitMap, toggle the interpolation mode (intern method, not a property because it can only be modified by the keyboard interaction) | |
| void | resetLUT () |
| for InterfaceBitMap, reset the lut that was changed by the image interactor (window and level) | |
| void | updateSelectionDisplay (Component *) |
| Update the display of the given Component, according to its selection state and the current HighlightMode. | |
| 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 | |
| void | removeAllActors (Component *) |
| remove all the given Component actors from the renderer and delete comp from the map | |
| void | updateCurrentFrameOfReferenceColorIndicator () |
| update myWidget using the color of the current frame of reference | |
Widget/Action management | |
The 3D scene itself, wrapping VTK render window, renderer and interactor in a single Qt widget | |
| RendererWidget * | rendererWidget |
| SliderSpinBoxWidget * | sliceSlider |
| Slider used to control the slice index in a InteractiveViewer. | |
| InteractiveViewerFrame * | myWidget |
| the InteractiveViewer myWidget | |
| QFrame * | sideFrame |
| the right side myWidget (this is where the slider and screenshot buttons are shown) | |
| QToolBar * | screenshotActionMenu |
| the screenshot action is inside this menu (in the slice viewer side bar) | |
| QMenu * | viewerMenu |
| the QMenu for the InteractiveViewer | |
| QToolBar * | viewerToolbar |
| the QToolBar for the InteractiveViewer | |
| QComboBox * | orientationCombo |
| QComboBox * | pickingCombo |
| QAction * | screenshotAction |
| Screenshot. | |
| QMenu * | renderingMenu |
| Rendering. | |
| QAction * | surfaceAction |
| QAction * | wireframeAction |
| QAction * | pointsAction |
| QAction * | colorAction |
| QAction * | glyphAction |
| QAction * | highlightSelectionAction |
| display mode | |
| QAction * | highlightSelectionOnlyAction |
| QAction * | highlightOffAction |
| QAction * | controlModeTrackballAction |
| to change the camera control mode | |
| QAction * | controlModeJoystickAction |
| QAction * | backgroundColorAction |
| background color | |
| QAction * | toggleAxesAction |
| button allows one to display the Axes in the InteractiveViewer | |
| QAction * | toggleOrientationDecorationsAction |
| button allows one to display orientation decoration in SLICE_VIEWER mode | |
| QAction * | toggleLogoAction |
| button to remove the copyright | |
| QAction * | toggleLabelAction |
| button allows one to display the labels of the object3D | |
| QAction * | toggleLinesAsTubesAction |
| button allows one to display the lines as tubes (the lines are to be in vtkPolyData) | |
| QAction * | toggleBackfaceCullingAction |
| back face culling | |
| QAction * | toggleFxaaAntialiasingAction |
| FXAA antialiasing. | |
| QAction * | toggleScreenshotAction |
| visibility of the screenshot action in the side toolbar of slice viewer | |
| QAction * | pickPointAction |
| action of the picking menu | |
| QAction * | pickCellAction |
| QAction * | pickCellRegionAction |
| QAction * | pickPointRegionAction |
| QAction * | pickLocationAction |
| void | initActions () |
| init all the actions (called only once in the getWidget() method) | |
| void | updateActions () |
| update the viewer menu depending on the selection,... | |
| void | InteractiveViewerFrame::keyPressEvent (QKeyEvent *e) |
| the InteractiveViewerFrame keyPressEvent is a good friend of InteractiveViewer | |
Help Whats This Utility | |
| QString | whatsThis |
| bool | oddWhatsThis |
| are we currently in a odd table line | |
| void | initWhatsThis () |
| initialize the what's this html string | |
| void | startWhatsThisSection (const QString &title="") |
| start a table (section) in the what's this message | |
| void | endWhatsThisSection () |
| end a table (section) in the what's this message | |
| void | addWhatsThisItem (const QString &key, const QString &description) |
| add an item (row) in the the what's this message (to describe a shortcut) | |
CamiTK Properties of this viewer | |
| PropertyObject * | propertyObject |
| The property object that holds the properties of this viewer. | |
| Property * | highlightModeProperty |
| The property that stands for the type of highlight mode of the 3D viewer. | |
| Property * | cameraOrientationProperty |
| The property that stands for the current orientation of the viewer. | |
| Property * | backgroundColorProperty |
| The property that stands for the background color of the viewer. | |
| Property * | backgroundGradientColorProperty |
| Property that tells whether the viewer use a gradient background color or not. | |
| Property * | linesAsTubesProperty |
| Property that tells whether the viewer uses lines as tubes or not. | |
| Property * | backfaceCullingProperty |
| Property that tells whether the viewer uses the backface culling option or not. | |
| Property * | fxaaAntialiasingProperty |
| Property that tells whether the viewer uses the backface culling option or not. | |
| Property * | screenshotActionProperty |
| Property that tells whether the screenshot action is visible or not. | |
| Property * | pointSizeProperty |
| Property which defines the point size of each point in the 3D viewer. | |
| void | createProperties () |
| Create and handle the CamiTK properties of this viewer. | |
| bool | eventFilter (QObject *object, QEvent *event) override |
| Event filter of this class instance to watch its properties instances. | |
Refresh/screenshot | |
| void | resetCamera () |
| Reset scene camera. | |
| void | setActiveCamera (QString cameraName) |
| Set the active virtual camera. | |
| void | setCameraOrientation (InteractiveViewer::CameraOrientation orientation) |
| Set camera orientation (using InteractiveViewer::CameraOrientation enum class). | |
| InteractiveViewer::CameraOrientation | getCameraOrientation () |
| Get the current camera orientation. | |
| vtkSmartPointer< vtkCamera > | getCamera (QString cameraName="default") |
| get a camera by its name, creates one if it does not exist already. | |
| void | screenshot (QString) |
| call this method to take a screenshot using the given filename (the extension must be a supported format extension, see class RendererWindow) | |
| void | screenshot () |
| call this method to take a screenshot in various format and write the resulting image to a file | |
Viewing/Interaction Property | |
| void | keyPressEvent (QKeyEvent *e) |
| Handle keyboard events in the scene, let to the parent widget if not processed here. This method is a friend of class InteractiveViewerFrame. | |
| virtual void | setHighlightMode () |
| Set the current highlighting mode from the current value of the property. | |
| RendererWidget * | getRendererWidget () |
| return interactiveViewer RendererWidget | |
| void | setBackfaceCulling (bool) |
| void | setFxaaAntialiasing (bool) |
| void | setScreenshotAction (bool) |
| visibility of the screenshot in slice viewers | |
| void | setLinesAsTubes (bool tubes) |
| Update the visualization of lines (for all the InterfaceGeometry of the scene). | |
Additional Inherited Members | |
| Signals inherited from camitk::Viewer | |
| void | selectionChanged () |
| this signal is emitted when the current selection was changed by the viewer | |
InteractiveViewer is used to view 3D objects and slices (anything that provides either a InterfaceBitMap or a InterfaceGeometry).
It contains a renderer (class RendererWidget) that combines VTK and QT. The RendererWidget instance manage all the display at the VTK level. InteractiveViewer delegates all pure VTK level stuff to the renderer. All things that needs InterfaceBitMap/InterfaceGeometry interaction/knowledge/access are manage at this level. The keyboard events are all managed in InteractiveViewer as well. Keyboard/Mouse interactions: check "what's this?" on the scene 3D to get all interaction shortcuts.
InteractiveViewer manages a list of cameras. Each camera has a name. Use getCamera(QString) to create a new camera, or get the default camera and setActiveCamera(QString) to change the active camera. The default camera is called "default".
InteractiveViewer manages picking session. A picking session starts when the control key is pressed and the left mouse button is clicked and ends when the mouse button is released. A picking session is a nice/quick way to do a lot of picking by simply moving the mouse, without the need to click for each picking. At the start of a picking session, the picking action is determined: it is either selection or unselection. If one of the first picked components was already selected, then the user wants to unselect, therefore picking action is "unselection", and all subsequently calls to pickPoint(..) or pickCell(..) will use pickingIsSelecting=false (2nd parameter of the method). If the first picked component was not selected, then the picking session is going to select any picked component.
The following help is for InteractiveViewer/RendererWidget developers, please read if you want/need to change anything in one of this two class. It should help you in your coding decisions (hopefully!).
|
strong |
describes the current mode of display.
It is useful to change the way the currently selected Components look compared to the unselected ones. In the default mode a Component is not highlighted, not shaded and not hidden.
Different kind of picking must be available: pixel in slice, a point, a cell, ...
| Enumerator | |
|---|---|
| LOCATION_PICKING | pick a point on any VTK representation (can be any location) |
| POINT_PICKING | pick a point in the VTK representation of an Geometry |
| CELL_PICKING | pick a cell in the VTK representation of an Geometry |
| AREA_POINT_PICKING | pick points that are inside a rectangular area in the VTK representation of an Geometry |
| AREA_CELL_PICKING | pick cells that are inside a rectangular area in the VTK representation of an Geometry |
| PIXEL_PICKING | pick a pixel on a Slice |
| NO_PICKING | no picking possible |
there is two possibilities: this InteractiveViewer is used to display slices or geometry
| Enumerator | |
|---|---|
| SLICE_VIEWER | display slices (the view is blocked in 2D and the slider is available) |
| GEOMETRY_VIEWER | display 3D stuff (geometry, etc...) |
| camitk::InteractiveViewer::InteractiveViewer | ( | QString & | name, |
| camitk::InteractiveViewer::ViewerType | type ) |
Construtor.
| name | the name of the viewer is mandatory, it is used as an identifier (e.g. in MedicalImageViewer) |
| type | type of the InteractiveViewer, depending on which it will behave as slice viewer, i.e. with no rotation interactions are possible, or 3D viewer |
References init(), myType, and camitk::Viewer::Viewer().
Referenced by BitmapViewer::BitmapViewer(), InteractiveGeometryViewer::InteractiveGeometryViewer(), and InteractiveSliceViewer::InteractiveSliceViewer().
|
overridevirtual |
Destructor.
References viewerToolbar.
|
protected |
add the given actor of the given Component to the renderer and insert it in the map
References actorMap, camitk::TransformationManager::ensurePathToWorld(), camitk::Component::getFrame(), getFrame(), camitk::Transformation::getTransform(), camitk::TransformationManager::getTransformation(), rendererWidget, and transformed2DActors.
Referenced by refresh().
|
protected |
add an item (row) in the the what's this message (to describe a shortcut)
References myWidget, oddWhatsThis, and whatsThis.
Referenced by getWidget().
|
protectedslot |
References backgroundColorProperty, and propertyObject.
Referenced by eventFilter(), and initActions().
|
protected |
Create and handle the CamiTK properties of this viewer.
References AXIAL, backfaceCullingProperty, backgroundColorProperty, backgroundGradientColorProperty, cameraOrientationProperty, fxaaAntialiasingProperty, getName(), highlightModeProperty, linesAsTubesProperty, pointSizeProperty, propertyObject, screenshotActionProperty, and SELECTION.
Referenced by init().
|
protected |
|
overrideprotected |
Event filter of this class instance to watch its properties instances.
Each time a property is dynamically changed, this method is called.
References backfaceCullingProperty, backgroundColor(), backgroundColorProperty, backgroundGradientColorProperty, cameraOrientationProperty, frameOfReference, fxaaAntialiasingProperty, camitk::TransformationManager::getFrameOfReferenceOwnership(), camitk::TransformationManager::getFramesOfReference(), camitk::Application::getName(), camitk::Application::getSettings(), highlightModeProperty, linesAsTubesProperty, myWidget, pointSizeProperty, propertyObject, refresh(), rendererWidget, screenshotActionProperty, setCameraOrientation(), and setFrame().
Referenced by initSettings().
| void camitk::InteractiveViewer::getBounds | ( | double * | bound | ) |
Compute the bounding box of all displayed Component.
References rendererWidget.
Referenced by getBoundsOfSelected(), and MeshClipping::getWidget().
| void camitk::InteractiveViewer::getBoundsOfSelected | ( | double * | bound | ) |
Compute the bounding box of the selected elements [xmin,xmax, ymin,ymax, zmin,zmax].
References actorMap, camitk::Component::GEOMETRY, and getBounds().
Referenced by keyPressEvent().
| vtkSmartPointer< vtkCamera > camitk::InteractiveViewer::getCamera | ( | QString | cameraName = "default" | ) |
get a camera by its name, creates one if it does not exist already.
This method does not activate the given camera, please use setActiveCamera for this.
References cameraMap.
| InteractiveViewer::CameraOrientation camitk::InteractiveViewer::getCameraOrientation | ( | ) |
Get the current camera orientation.
References propertyObject.
Referenced by initSettings().
| bool camitk::InteractiveViewer::getColorScale | ( | ) | const |
get the current value of the color scale property.
References rendererWidget.
|
virtual |
get the FrameOfReference of the viewer (it may also contain AnatomicalOrientation information)
References frameOfReference.
Referenced by addActor(), picked(), refresh(), TransformationExplorer::refresh(), and setCameraOrientation().
|
overridevirtual |
get the explorer menu
Reimplemented from camitk::Viewer.
References backgroundColorAction, controlModeJoystickAction, controlModeTrackballAction, GEOMETRY_VIEWER, getToolBar(), highlightOffAction, highlightSelectionAction, highlightSelectionOnlyAction, myType, myWidget, pickCellAction, pickCellRegionAction, pickLocationAction, pickPointAction, pickPointRegionAction, renderingMenu, screenshotAction, SLICE_VIEWER, toggleAxesAction, toggleBackfaceCullingAction, toggleFxaaAntialiasingAction, toggleLabelAction, toggleLinesAsTubesAction, toggleLogoAction, toggleOrientationDecorationsAction, toggleScreenshotAction, updateActions(), and viewerMenu.
Referenced by rightClick().
| QString camitk::InteractiveViewer::getName | ( | ) | const |
get the scene name
Referenced by createProperties(), keyPressEvent(), picked(), and refresh().
|
overridevirtual |
get the InteractiveViewer propertyObject (only non-null for GEOMETRY_VIEWER)
Reimplemented from camitk::Viewer.
References propertyObject.
Referenced by getToolBar(), and InteractiveSliceViewer::InteractiveSliceViewer().
|
inline |
return interactiveViewer RendererWidget
References rendererWidget.
Referenced by BitmapViewer::BitmapViewer(), MeshClipping::getWidget(), InteractiveSliceViewer::InteractiveSliceViewer(), VRMLComponentExtension::save(), and setCameraOrientation().
|
overridevirtual |
get the viewer toolbar
Reimplemented from camitk::Viewer.
References colorAction, GEOMETRY_VIEWER, camitk::Application::getAction(), getPropertyObject(), camitk::Action::getQAction(), glyphAction, initPicking(), myType, myWidget, orientationCombo, pickCellAction, pickCellRegionAction, pickingCombo, pickingMode, pickLocationAction, pickPointAction, pickPointRegionAction, pointsAction, propertyObject, screenshotAction, surfaceAction, toggleAxesAction, toggleLabelAction, viewerToolbar, and wireframeAction.
Referenced by getMenu(), and getWidget().
|
overridevirtual |
get the InteractiveViewer widget (QTreeWidget).
Implements camitk::Viewer.
References addWhatsThisItem(), endWhatsThisSection(), getToolBar(), camitk::Viewer::getToolBarVisibility(), initActions(), initPicking(), initWhatsThis(), myType, myWidget, PIXEL_PICKING, POINT_PICKING, rendererWidget, rightClick(), screenshotAction, screenshotActionMenu, sideFrame, SLICE_VIEWER, sliceSlider, sliderChanged(), startWhatsThisSection(), updateCurrentFrameOfReferenceColorIndicator(), and whatsThis.
Referenced by BitmapViewer::getWidget().
|
protectedslot |
References highlightModeProperty, highlightOffAction, highlightSelectionAction, highlightSelectionOnlyAction, OFF, propertyObject, refresh(), SELECTION, and SELECTION_ONLY.
Referenced by initActions().
|
protected |
used by both constructors
References cameraMap, connector, createProperties(), displayedTopLevelComponents, frameOfReference, camitk::TransformationManager::getFrameOfReferenceOwnership(), camitk::TransformationManager::getWorldFrame(), initSettings(), isChangingSlice, isPicking, myType, myWidget, picked(), pickingEffectIsSelecting, rendererWidget, screenshotActionMenu, SLICE_VIEWER, sliceSlider, camitk::RendererWidget::TRACKBALL_2D, viewerMenu, and viewerToolbar.
Referenced by InteractiveViewer().
|
protected |
init all the actions (called only once in the getWidget() method)
References backfaceCullingProperty, backgroundColor(), backgroundColorAction, controlModeJoystickAction, controlModeTrackballAction, fxaaAntialiasingProperty, GEOMETRY_VIEWER, glyphAction, highlightModeChanged(), highlightOffAction, highlightSelectionAction, highlightSelectionOnlyAction, linesAsTubesProperty, myType, pickCellAction, pickCellRegionAction, pickingModeChanged(), pickLocationAction, pickPointAction, pickPointRegionAction, pointsAction, propertyObject, renderingActorsChanged(), renderingMenu, screenshot(), screenshotAction, screenshotActionProperty, setBackfaceCulling(), setFxaaAntialiasing(), setGlyph(), setLabel(), setLinesAsTubes(), setScreenshotAction(), SLICE_VIEWER, surfaceAction, toggleAxes(), toggleAxesAction, toggleBackfaceCullingAction, toggleFxaaAntialiasingAction, toggleLabelAction, toggleLinesAsTubesAction, toggleLogo(), toggleLogoAction, toggleOrientationDecorations(), toggleOrientationDecorationsAction, toggleScreenshotAction, viewControlModeChanged(), and wireframeAction.
Referenced by getWidget().
| void camitk::InteractiveViewer::initPicking | ( | PickingMode | pickingMode | ) |
Init the picker with a given picking mode.
References AREA_CELL_PICKING, AREA_POINT_PICKING, CELL_PICKING, GEOMETRY_VIEWER, LOCATION_PICKING, myType, myWidget, NO_PICKING, pickCellAction, pickCellRegionAction, pickingCombo, pickingEffectUpdated, pickingMode, pickLocationAction, pickPointAction, pickPointRegionAction, PIXEL_PICKING, POINT_PICKING, and rendererWidget.
Referenced by getToolBar(), getWidget(), and pickingModeChanged().
|
protected |
initialize the property object and state using the user settings (user preferences system files .config/.ini)
References backfaceCullingProperty, backgroundColorProperty, backgroundGradientColorProperty, eventFilter(), fxaaAntialiasingProperty, GEOMETRY_VIEWER, getCameraOrientation(), camitk::Application::getName(), camitk::Application::getSettings(), highlightModeProperty, linesAsTubesProperty, myType, pointSizeProperty, propertyObject, rendererWidget, screenshotActionProperty, SELECTION, camitk::RendererWidget::TRACKBALL, and camitk::RendererWidget::TRACKBALL_2D.
Referenced by init().
|
protected |
initialize the what's this html string
References myWidget, and whatsThis.
Referenced by getWidget().
| void camitk::InteractiveViewer::keyPressEvent | ( | QKeyEvent * | e | ) |
Handle keyboard events in the scene, let to the parent widget if not processed here. This method is a friend of class InteractiveViewerFrame.
NOTE:
PLEASE, PLEASE, PLEASE, PLEASE, PLEASE, PLEASE
DO NOT FORGET TO ADD A NEW LINE IN THE "WHAT'S THIS" MESSAGE (see constructor)
The call to methods startWhatsThisSection and addWhatsThisItem is a good comment line to add here (see below!). Please use the same order here than in the what's this help (by category, then by function, then by key name)
(PLEASE)
startWhatsThisSection("Keyboard bindings (upper or lower case)");
startWhatsThisSection("Other Shortcuts");
NOTE:
PLEASE, PLEASE, PLEASE, PLEASE, PLEASE, PLEASE?
DO NOT FORGET TO ADD A NEW LINE IN THE "WHAT'S THIS" MESSAGE (see constructor)
The call to methods startWhatsThisSection and addWhatsThisItem is a good comment line to add here (see below!). Please use the same order here than in the what's this help (by category, then by function, then by key name)
(PLEASE)
References actorMap, CAMITK_INFO, camitk::Viewer::clearSelection(), camitk::Component::GEOMETRY, GEOMETRY_VIEWER, getBoundsOfSelected(), getName(), camitk::Application::getSelectedComponents(), camitk::RendererWidget::JOYSTICK, myType, camitk::InterfaceGeometry::Points, refresh(), rendererWidget, resetCamera(), resetLUT(), screenshot(), setColorScale(), SLICE_VIEWER, sliceSlider, camitk::InterfaceGeometry::Surface, toggleAxesAction, toggleFxaaAntialiasingAction, toggleInterpolation(), toggleLabelAction, camitk::TransformationManager::toString(), camitk::RendererWidget::TRACKBALL, whatsThis, and camitk::InterfaceGeometry::Wireframe.
|
protectedslot |
get the picker and populate the picked component with the picked stuff
References actorMap, AREA_CELL_PICKING, AREA_POINT_PICKING, CAMITK_INFO, CAMITK_TRACE, CELL_PICKING, camitk::Component::cellPicked(), camitk::ArbitrarySingleImageComponent::getArbitraryFrame(), camitk::Component::getFrame(), getFrame(), camitk::Transformation::getMatrix(), camitk::Component::getName(), getName(), camitk::Transformation::getTransform(), camitk::TransformationManager::getTransformation(), isPicking, camitk::Component::isSelected(), LOCATION_PICKING, NO_PICKING, pickingEffectIsSelecting, pickingEffectUpdated, pickingMode, PIXEL_PICKING, camitk::Component::pixelPicked, POINT_PICKING, camitk::Component::pointPicked(), rendererWidget, camitk::Viewer::selectionChanged(), and camitk::Application::showStatusBarMessage().
Referenced by init().
|
protectedslot |
References AREA_CELL_PICKING, AREA_POINT_PICKING, CELL_PICKING, initPicking(), LOCATION_PICKING, pickCellAction, pickCellRegionAction, pickLocationAction, pickPointAction, pickPointRegionAction, and POINT_PICKING.
Referenced by initActions().
|
overridevirtual |
Refresh the display.
Implements camitk::Viewer.
References actorMap, addActor(), cameraOrientationProperty, displayedTopLevelComponents, camitk::Component::GEOMETRY, GEOMETRY_VIEWER, camitk::Component::get2DImageActor, camitk::Component::get3DCursor(), camitk::Application::getAllComponents(), camitk::Component::getFrame(), getFrame(), camitk::TransformationManager::getFrameOfReferenceOwnership(), getName(), camitk::Component::getNumberOfProp(), camitk::Component::getNumberOfSlices(), camitk::Component::getPickPlaneActor, camitk::Component::getProp(), camitk::Application::getSelectedComponents(), camitk::Component::getSlice(), camitk::Application::getTopLevelComponents(), camitk::TransformationManager::getWorldFrame(), camitk::Application::isAlive(), isChangingSlice, isPicking, linesAsTubesProperty, myType, myWidget, camitk::InterfaceGeometry::Points, propertyObject, removeAllActors(), rendererWidget, resetCamera(), setCameraOrientation(), setFrame(), camitk::Component::SLICE, SLICE_VIEWER, sliceSlider, camitk::InterfaceGeometry::Surface, transformed2DActors, updateActions(), updateSelectionDisplay(), camitk::Viewer::Viewer(), and camitk::InterfaceGeometry::Wireframe.
Referenced by AnglesAndTranslationAction::event(), eventFilter(), highlightModeChanged(), keyPressEvent(), BitmapViewer::refresh(), renderingActorsChanged(), screenshot(), setFrame(), setGlyph(), setHighlightMode(), and setLabel().
|
protected |
remove all the given Component actors from the renderer and delete comp from the map
References actorMap, and rendererWidget.
Referenced by refresh().
|
protectedslot |
| void camitk::InteractiveViewer::resetCamera | ( | ) |
Reset scene camera.
Use a trick (when this is a SLICE_VIEWER) for scaling up to max size in the viewer
References actorMap, myType, rendererWidget, and SLICE_VIEWER.
Referenced by keyPressEvent(), refresh(), and toggleAxes().
|
protected |
for InterfaceBitMap, reset the lut that was changed by the image interactor (window and level)
References actorMap, and camitk::Component::SLICE.
Referenced by keyPressEvent().
|
protectedslot |
References getMenu(), and rendererWidget.
Referenced by getWidget().
|
slot |
call this method to take a screenshot in various format and write the resulting image to a file
References camitk::ScreenshotFormatInfo::fileFilters(), screenshot(), and camitk::toString().
Referenced by initActions(), keyPressEvent(), and screenshot().
| void camitk::InteractiveViewer::screenshot | ( | QString | filename | ) |
call this method to take a screenshot using the given filename (the extension must be a supported format extension, see class RendererWindow)
References refresh(), and rendererWidget.
| void camitk::InteractiveViewer::setActiveCamera | ( | QString | cameraName | ) |
Set the active virtual camera.
References cameraMap, and rendererWidget.
|
slot |
set the backface culling mode (default is true).
References backfaceCullingProperty, and propertyObject.
Referenced by initActions().
|
virtual |
set background color
References backgroundColorProperty, and propertyObject.
| void camitk::InteractiveViewer::setCameraOrientation | ( | InteractiveViewer::CameraOrientation | orientation | ) |
Set camera orientation (using InteractiveViewer::CameraOrientation enum class).
| orientation |
References AXIAL, camitk::RendererWidget::BACK_DOWN, CORONAL, CUSTOM, camitk::FrameOfReference::getAnatomicalOrientation(), getFrame(), camitk::AnatomicalOrientation::getMaxLabel(), camitk::AnatomicalOrientation::getMinLabel(), getRendererWidget(), camitk::AnatomicalOrientation::isUnknown(), camitk::RendererWidget::LEFT_BACK, camitk::RendererWidget::RIGHT_DOWN, camitk::RendererWidget::RIGHT_UP, SAGITTAL, camitk::RendererWidget::setCameraOrientation(), camitk::RendererWidget::setOrientationDecorationsLetters(), toggleOrientationDecorations(), XY, XZ, and YZ.
Referenced by eventFilter(), and refresh().
| void camitk::InteractiveViewer::setColorScale | ( | bool | state | ) |
References rendererWidget.
Referenced by keyPressEvent(), and camitk::MeshComponent::setDataRepresentationOff().
| void camitk::InteractiveViewer::setColorScaleMinMax | ( | double | m, |
| double | M ) |
set the min and max values.
Automatically turns setColorScale to true.
| m | minimum value (blue) |
| M | maximum value (red) |
References rendererWidget.
| void camitk::InteractiveViewer::setColorScaleTitle | ( | QString | t | ) |
set the color scale title.
| t | title of the color scale |
References rendererWidget.
Referenced by camitk::MeshComponent::setDataRepresentationOff().
|
virtual |
set the FrameOfReference of the viewer
by default, the viewer must refresh all the actor user matrixes when its frame as changed but this is not needed if there are no actors in the viewer (for instance when called from inside the refresh() method itself)
References actorMap, camitk::TransformationManager::ensurePathToWorld(), frameOfReference, refresh(), and updateCurrentFrameOfReferenceColorIndicator().
Referenced by eventFilter(), and refresh().
|
slot |
set the FXAA antialiasing mode (default is false).
References fxaaAntialiasingProperty, and propertyObject.
Referenced by initActions().
|
protectedslot |
References camitk::Component::GEOMETRY, camitk::Application::getSelectedComponents(), and refresh().
Referenced by initActions().
|
virtual |
set gradient background on/off
References backgroundGradientColorProperty, and propertyObject.
|
virtual |
Set the current highlighting mode from the current value of the property.
References camitk::Application::getName(), camitk::Application::getSettings(), highlightModeProperty, propertyObject, and refresh().
|
protectedslot |
if true currently selected Components label will have their label on (shown)
References camitk::Component::GEOMETRY, camitk::Application::getSelectedComponents(), and refresh().
Referenced by initActions().
|
slot |
Update the visualization of lines (for all the InterfaceGeometry of the scene).
| tubes | if true, then the lines have to be displayed as tube |
References linesAsTubesProperty, and propertyObject.
Referenced by initActions().
|
slot |
visibility of the screenshot in slice viewers
References propertyObject, screenshotActionMenu, and screenshotActionProperty.
Referenced by initActions().
| void camitk::InteractiveViewer::setSideFrameVisible | ( | bool | visibility | ) |
set the slice viewer side bar+screenshot button visibility
References sideFrame.
|
slot |
Slot called when the InteractiveViewer slider has been changed.
If there is a InterfaceBitMap in the scene, set the slice index with the new slider value.
References actorMap, isChangingSlice, myType, camitk::Viewer::selectionChanged(), and SLICE_VIEWER.
Referenced by getWidget().
|
protected |
start a table (section) in the what's this message
References myWidget, oddWhatsThis, and whatsThis.
Referenced by getWidget().
|
protectedslot |
References rendererWidget, and resetCamera().
Referenced by initActions().
|
protected |
for InterfaceBitMap, toggle the interpolation mode (intern method, not a property because it can only be modified by the keyboard interaction)
References actorMap, and camitk::Component::SLICE.
Referenced by keyPressEvent().
|
slot |
show/hide the logo at the bottom right corner
References rendererWidget.
Referenced by initActions().
|
protectedslot |
References myType, rendererWidget, and SLICE_VIEWER.
Referenced by initActions(), InteractiveSliceViewer::InteractiveSliceViewer(), and setCameraOrientation().
|
protected |
update the viewer menu depending on the selection,...
References colorAction, camitk::Component::GEOMETRY, GEOMETRY_VIEWER, camitk::Component::getProp(), camitk::Component::getRenderingModes(), camitk::Component::getRepresentation(), camitk::Application::getSelectedComponents(), camitk::Component::getVisibility(), glyphAction, myType, camitk::InterfaceGeometry::Points, pointsAction, renderingMenu, camitk::InterfaceGeometry::Surface, surfaceAction, toggleLabelAction, viewerMenu, camitk::InterfaceGeometry::Wireframe, and wireframeAction.
|
protected |
update myWidget using the color of the current frame of reference
References frameOfReference, and myWidget.
Referenced by getWidget(), and setFrame().
|
protected |
Update the display of the given Component, according to its selection state and the current HighlightMode.
References camitk::InterfaceGeometry::Hidden, highlightModeProperty, camitk::Component::isSelected(), camitk::InterfaceGeometry::Normal, propertyObject, SELECTION, SELECTION_ONLY, camitk::InterfaceGeometry::setEnhancedModes(), and camitk::InterfaceGeometry::Shaded.
Referenced by refresh().
|
protectedslot |
References controlModeTrackballAction, camitk::RendererWidget::JOYSTICK, rendererWidget, and camitk::RendererWidget::TRACKBALL.
Referenced by initActions().
|
friend |
the InteractiveViewerFrame keyPressEvent is a good friend of InteractiveViewer
References camitk::InteractiveViewerFrame::keyPressEvent().
|
protected |
the map containing all the actors in the InteractiveViewer
Referenced by addActor(), getBoundsOfSelected(), keyPressEvent(), picked(), refresh(), removeAllActors(), resetCamera(), resetLUT(), setFrame(), sliderChanged(), and toggleInterpolation().
|
protected |
Property that tells whether the viewer uses the backface culling option or not.
Referenced by createProperties(), eventFilter(), initActions(), initSettings(), and setBackfaceCulling().
|
protected |
background color
Referenced by getMenu(), and initActions().
|
protected |
The property that stands for the background color of the viewer.
Referenced by backgroundColor(), createProperties(), eventFilter(), initSettings(), and setBackgroundColor().
|
protected |
Property that tells whether the viewer use a gradient background color or not.
Referenced by createProperties(), eventFilter(), initSettings(), and setGradientBackground().
|
protected |
all the available camera
Referenced by getCamera(), init(), and setActiveCamera().
|
protected |
The property that stands for the current orientation of the viewer.
Referenced by createProperties(), eventFilter(), and refresh().
|
protected |
Referenced by getToolBar(), and updateActions().
|
protected |
Referenced by init().
|
protected |
Referenced by getMenu(), and initActions().
|
protected |
to change the camera control mode
Referenced by getMenu(), initActions(), and viewControlModeChanged().
|
protected |
|
protected |
The FrameOfReference in which this component's data is represented in (used to properly position the actors).
Referenced by eventFilter(), getFrame(), init(), setFrame(), and updateCurrentFrameOfReferenceColorIndicator().
|
protected |
Property that tells whether the viewer uses the backface culling option or not.
Referenced by createProperties(), eventFilter(), initActions(), initSettings(), and setFxaaAntialiasing().
|
protected |
Referenced by getToolBar(), initActions(), and updateActions().
|
protected |
The property that stands for the type of highlight mode of the 3D viewer.
Referenced by createProperties(), eventFilter(), highlightModeChanged(), initSettings(), setHighlightMode(), and updateSelectionDisplay().
|
protected |
Referenced by getMenu(), highlightModeChanged(), and initActions().
|
protected |
display mode
Referenced by getMenu(), highlightModeChanged(), and initActions().
|
protected |
Referenced by getMenu(), highlightModeChanged(), and initActions().
|
protected |
Indicates that this viewer is changing the slice by the slice slider.
Referenced by init(), refresh(), and sliderChanged().
|
protected |
|
protected |
Property that tells whether the viewer uses lines as tubes or not.
Referenced by createProperties(), eventFilter(), initActions(), initSettings(), refresh(), and setLinesAsTubes().
|
protected |
type of InteractiveViewer (display slice or geometry)
Referenced by getMenu(), getToolBar(), getWidget(), init(), initActions(), initPicking(), initSettings(), InteractiveViewer(), keyPressEvent(), refresh(), resetCamera(), sliderChanged(), toggleOrientationDecorations(), and updateActions().
|
protected |
the InteractiveViewer myWidget
Referenced by addWhatsThisItem(), eventFilter(), getMenu(), getToolBar(), getWidget(), init(), initPicking(), initWhatsThis(), refresh(), startWhatsThisSection(), and updateCurrentFrameOfReferenceColorIndicator().
|
protected |
are we currently in a odd table line
Referenced by addWhatsThisItem(), and startWhatsThisSection().
|
protected |
Referenced by getToolBar().
|
protected |
Referenced by getMenu(), getToolBar(), initActions(), initPicking(), and pickingModeChanged().
|
protected |
Referenced by getMenu(), getToolBar(), initActions(), initPicking(), and pickingModeChanged().
|
protected |
list of Component that are currently picked, correctly displayed in the InteractiveViewer, but for speed optimization that are not yet selected in the explorer.
They will all be selected in the explorer when the user release the mouse button.
|
protected |
Referenced by getToolBar(), and initPicking().
|
protected |
|
protected |
was the picking effect updated (it has to be updated with the first picking for a given button down session)
Referenced by initPicking(), and picked().
|
protected |
Current picking mode, POINT_PICKING be default.
Referenced by getToolBar(), initPicking(), and picked().
|
protected |
Referenced by getMenu(), getToolBar(), initActions(), initPicking(), and pickingModeChanged().
|
protected |
action of the picking menu
Referenced by getMenu(), getToolBar(), initActions(), initPicking(), and pickingModeChanged().
|
protected |
Referenced by getMenu(), getToolBar(), initActions(), initPicking(), and pickingModeChanged().
|
protected |
Referenced by getToolBar(), initActions(), renderingActorsChanged(), and updateActions().
|
protected |
Property which defines the point size of each point in the 3D viewer.
Referenced by createProperties(), eventFilter(), and initSettings().
|
protected |
The property object that holds the properties of this viewer.
Referenced by backgroundColor(), createProperties(), eventFilter(), getCameraOrientation(), getPropertyObject(), getToolBar(), highlightModeChanged(), initActions(), initSettings(), refresh(), setBackfaceCulling(), setBackgroundColor(), setFxaaAntialiasing(), setGradientBackground(), setHighlightMode(), setLinesAsTubes(), setScreenshotAction(), and updateSelectionDisplay().
|
protected |
Referenced by addActor(), eventFilter(), getBounds(), getColorScale(), getRendererWidget(), getWidget(), init(), initPicking(), initSettings(), keyPressEvent(), picked(), refresh(), removeAllActors(), resetCamera(), rightClick(), screenshot(), setActiveCamera(), setColorScale(), setColorScaleMinMax(), setColorScaleTitle(), toggleAxes(), toggleLogo(), toggleOrientationDecorations(), and viewControlModeChanged().
|
protected |
Rendering.
Referenced by getMenu(), initActions(), and updateActions().
|
protected |
Screenshot.
Referenced by getMenu(), BitmapViewer::getToolBar(), getToolBar(), getWidget(), and initActions().
|
protected |
the screenshot action is inside this menu (in the slice viewer side bar)
Referenced by getWidget(), init(), and setScreenshotAction().
|
protected |
Property that tells whether the screenshot action is visible or not.
Referenced by createProperties(), eventFilter(), initActions(), initSettings(), and setScreenshotAction().
|
protected |
the right side myWidget (this is where the slider and screenshot buttons are shown)
Referenced by BitmapViewer::getWidget(), getWidget(), and setSideFrameVisible().
|
protected |
Slider used to control the slice index in a InteractiveViewer.
This slider is visible only when the scene a 2D viewer (see constructor).
Referenced by getWidget(), init(), keyPressEvent(), and refresh().
|
protected |
Referenced by getToolBar(), initActions(), renderingActorsChanged(), and updateActions().
|
protected |
button allows one to display the Axes in the InteractiveViewer
Referenced by getMenu(), getToolBar(), initActions(), and keyPressEvent().
|
protected |
back face culling
Referenced by getMenu(), and initActions().
|
protected |
FXAA antialiasing.
Referenced by getMenu(), initActions(), and keyPressEvent().
|
protected |
button allows one to display the labels of the object3D
Referenced by getMenu(), getToolBar(), initActions(), keyPressEvent(), and updateActions().
|
protected |
button allows one to display the lines as tubes (the lines are to be in vtkPolyData)
Referenced by getMenu(), and initActions().
|
protected |
button to remove the copyright
Referenced by getMenu(), and initActions().
|
protected |
button allows one to display orientation decoration in SLICE_VIEWER mode
Referenced by getMenu(), and initActions().
|
protected |
visibility of the screenshot action in the side toolbar of slice viewer
Referenced by getMenu(), and initActions().
|
protected |
the map containing the initial position of the vtkActor2D They have to be transformed from the creating component frame to the viewer frame each time they are added to the display as their position is always recomputed/reset in the component's frame each time getProp(..) is called.
Referenced by addActor(), and refresh().
|
protected |
the QMenu for the InteractiveViewer
Referenced by getMenu(), init(), and updateActions().
|
protected |
the QToolBar for the InteractiveViewer
Referenced by getToolBar(), init(), and ~InteractiveViewer().
|
protected |
The what's html string
Referenced by addWhatsThisItem(), endWhatsThisSection(), getWidget(), initWhatsThis(), keyPressEvent(), and startWhatsThisSection().
|
protected |
Referenced by getToolBar(), initActions(), renderingActorsChanged(), and updateActions().