![]() |
Computer Assited Medical Intervention Tool Kit
|
InteractiveViewer is used to view 3D objects and slices (anything that provides either a InterfaceBitMap or a InterfaceGeometry). More...
#include <InteractiveViewer.h>
Public Slots | |
void | actorPicked (vtkSmartPointer< vtkPicker >) |
Slot activated when something was picked in the 3D interactor. | |
void | sliderChanged (int) |
Slot called when the InteractiveViewer slider has been changed. | |
void | toggleCopyright (bool) |
show/hide the copyright in 3D | |
void | xAngleChanged (double angle) |
Slot called when the InteractiveViewer x angle update has been changed. | |
void | yAngleChanged (double angle) |
Slot called when the InteractiveViewer y angle update has been changed. | |
void | zAngleChanged (double angle) |
Slot called when the InteractiveViewer z angle update has been changed. |
Public Member Functions | |
Misc | |
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[6]) |
Compute the bounding box of the selected elements [xmin,xmax, ymin,ymax, zmin,zmax]. | |
void | getBounds (double bound[6]) |
Compute the bounding box of all displayed Component. | |
void | setSideFrameVisible (bool) |
set the slice viewer side bar+screenshot button visibility | |
![]() | |
virtual QMenu * | getMenu () |
get the viewer menu (returns NULL by default, i.e. there are no default edit menu) | |
virtual QObject * | getPropertyObject () |
get the viewer property object (returns NULL by default, i.e. there are no property to edit) | |
virtual QToolBar * | getToolBar () |
get the viewer toolbar (returns NULL by default, i.e. there are no default toolbar) | |
virtual QWidget * | getWidget (QWidget *parent=NULL)=0 |
get the viewer widget. | |
virtual unsigned int | numberOfViewedComponent ()=0 |
returns the number of Component that are displayed by this viewer | |
virtual void | refresh (Viewer *whoIsAsking=NULL)=0 |
refresh the view (can be interesting to know which other viewer is calling this) | |
virtual void | refreshInterfaceNode (Component *comp) |
Update the whole tree of the representation of the Component. | |
Viewer (QString name) | |
default constructor | |
virtual | ~Viewer () |
default destructor |
Protected Slots | |
All the slots called by the menu actions | |
void | renderingActorsChanged () |
void | highlightModeChanged (QAction *selectedAction) |
void | cameraOrientationChanged (QAction *selectedAction) |
void | viewControlModeChanged (QAction *) |
void | backgroundColor () |
void | toggleAxes (bool) |
void | pickingModeChanged (QAction *) |
void | rightClick () |
void | setLabel (bool) |
if true currently selected Components label will have their label on (shown) | |
void | setGlyph (bool) |
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, NO_PICKING be default. | |
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) |
Private Types | |
enum | HighlightMode { OFF, SELECTION, SELECTION_ONLY } |
describes the current mode of display. More... | |
enum | PickingMode { PIXEL_PICKING, POINT_PICKING, CELL_PICKING, NO_PICKING } |
Different kind of picking must be available: pixel in slice, a point, a cell, ... More... |
Private Member Functions | |
Q_ENUMS (HighlightMode RendererWidget::ControlMode RendererWidget::CameraOrientation) Q_PROPERTY(HighlightMode highlightMode READ getHighlightMode WRITE setHighlightMode) Q_PROPERTY(QColor backgroundColor READ getBackgroundColor WRITE setBackgroundColor) Q_PROPERTY(bool gradientBackground READ getGradientBackground WRITE setGradientBackground) Q_PROPERTY(bool linesAsTubes READ getLinesAsTubes WRITE setLinesAsTubes) Q_PROPERTY(bool backfaceCulling READ getBackfaceCulling WRITE setBackfaceCulling) Q_PROPERTY(double pointSize READ getPointSize WRITE setPointSize) public | |
Inherited from Viewer | |
virtual unsigned int | numberOfViewedComponent () |
virtual void | refresh (Viewer *whoIsAsking=NULL) |
Refresh the display. | |
virtual QWidget * | getWidget (QWidget *parent) |
get the InteractiveViewer widget (QTreeWidget). | |
virtual QObject * | getPropertyObject () |
get the InteractiveViewer propertyObject (only non-null for GEOMETRY_VIEWER) | |
virtual QMenu * | getMenu () |
get the explorer menu | |
virtual QToolBar * | getToolBar () |
get the viewer toolbar |
General/Singleton | |
static QMap< QString, InteractiveViewer * > | viewers |
the map containing all the InteractiveViewer instances | |
static QString | defaultNames [5] = {QString("3DViewer"), QString("axialViewer"), QString("coronalViewer"), QString("sagittalViewer"), QString("arbitraryViewer")} |
the QString array containing all InteractiveViewer instance default names | |
virtual | ~InteractiveViewer () |
Destructor. | |
QString | getName () const |
get the scene name | |
static InteractiveViewer * | getNewViewer (QString, ViewerType type) |
Use this method to create a new custom instance of this class. | |
static InteractiveViewer * | getViewer (QString) |
get a viewer by its name (return NULL if no instance has the given name, use getNewViewer to create one viewer) | |
static InteractiveViewer * | get3DViewer () |
get the 3D viewer default InteractiveViewer (provided for convenience, equivalent to getViewer("3DViewer") | |
static InteractiveViewer * | getAxialViewer () |
get the axial default InteractiveViewer (provided for convenience, equivalent to getViewer("axialViewer") | |
static InteractiveViewer * | getCoronalViewer () |
get the coronal default InteractiveViewer (provided for convenience, equivalent to getViewer("coronalViewer") | |
static InteractiveViewer * | getSagittalViewer () |
get the sagittal default InteractiveViewer (provided for convenience, equivalent to getViewer("sagittalViewer") | |
static InteractiveViewer * | getArbitraryViewer () |
get the arbitrary default InteractiveViewer (provided for convenience, equivalent to getViewer("arbitraryViewer") | |
InteractiveViewer (QString &name, ViewerType type) | |
Construtor. |
Refresh/screenshot | |
void | refreshRenderer () |
just refresh the renderer | |
void | resetCamera () |
Reset scene camera. | |
void | setActiveCamera (QString cameraName) |
Set the active virtual camera. | |
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 | setBackfaceCulling (bool) |
set the backface culling mode (default is true). | |
void | setLinesAsTubes (bool tubes) |
Update the visualization of lines (for all the InterfaceGeometry of the scene). | |
virtual void | setGradientBackground (bool) |
set gradient background on/off | |
bool | getGradientBackground () const |
get the current background gradient mode. | |
virtual void | setBackgroundColor (QColor) |
set background color | |
QColor | getBackgroundColor () const |
get the background color | |
bool | getBackfaceCulling () const |
get the backface current culling mode. | |
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. | |
bool | getLinesAsTubes () const |
get the boolean indicating if the lines are currently set to be displayed as tubes. | |
void | setPointSize (double size) |
update the visualization of points (for all object3D in the scene). | |
double | getPointSize () const |
get the current point size value | |
virtual void | setHighlightMode (InteractiveViewer::HighlightMode) |
Set the current highlighting mode. | |
InteractiveViewer::HighlightMode | getHighlightMode () const |
Return the current highlighting mode. | |
RendererWidget * | getRendererWidget () |
return interactiveViewer RendererWidget |
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) | |
bool | linesAsTubes |
Are lines currently displayed as tubes (the actors have to add a vtkTubeFilter between the source and the mapper) | |
HighlightMode | highlightMode |
keep the value of the hightlight mode | |
QMultiMap< Component *, vtkSmartPointer< vtkProp > > | actorMap |
the map containing all the actors in the InteractiveViewer | |
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 | updateSelectionDisplay (Component *) |
Update the display of the given Component, according to its selection state and the current HighlightMode. | |
void | addActor (Component *, vtkSmartPointer< vtkProp >) |
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 |
Widget/Action management | |
RendererWidget * | rendererWidget |
SliderSpinBoxWidget * | sliceSlider |
Slider used to control the slice index in a InteractiveViewer. | |
InteractiveViewerFrame * | frame |
the InteractiveViewer frame | |
QFrame * | sideFrame |
the right side frame (this is where the slider and screenshot buttons are shown) | |
QMenu * | viewerMenu |
the QMenu for the InteractiveViewer | |
QToolBar * | viewerToolBar |
the QToolBar for the InteractiveViewer | |
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 * | cameraOrientationRightDownAction |
to change the axes view mode | |
QAction * | cameraOrientationLeftUpAction |
QAction * | cameraOrientationRightUpAction |
QAction * | backgroundColorAction |
background color | |
QAction * | toggleAxesAction |
button allows to display the Axes in the InteractiveViewer | |
QAction * | toggleCopyrightAction |
button to remove the copyright | |
QAction * | toggleLabelAction |
button allows to display the labels of the object3D | |
QAction * | toggleLinesAsTubesAction |
button allows to display the lines as tubes (the lines are to be in vtkPolyData) | |
QAction * | toggleBackfaceCullingAction |
back face culling | |
QAction * | pickPointAction |
action of the picking menu | |
QAction * | pickCellAction |
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) |
Additional Inherited Members | |
![]() | |
void | selectionChanged () |
this signal is emitted when the current selection was changed by the viewer | |
![]() | |
void | clearSelection () |
clear the selection | |
void | selectionChanged (ComponentList &compSet) |
The selection has changed to the given ComponentList. | |
void | selectionChanged (Component *comp) |
the selection has changed to be just one comp |
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.
There are five default InteractiveViewer "singleton" instances named:
InteractiveViewer class is completely independant from MainWindow application skeleton (and please keep it that way!)
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!).
|
private |
describes the current mode of display.
It is usefull 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.
|
private |
Different kind of picking must be available: pixel in slice, a point, a cell, ...
So far, only pixel picking is implemented.
|
privatevirtual |
Destructor.
References frame, getName(), viewerMenu, viewers, and viewerToolBar.
|
protected |
Construtor.
name | the name of the scene 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 cameraMap, displayedTopLevelComponents, frame, camitk::RendererWidget::getActiveCamera(), initPicking(), initSettings(), myType, NO_PICKING, pickingEffectIsSelecting, PIXEL_PICKING, rendererWidget, sliceSlider, camitk::RendererWidget::TRACKBALL_2D, viewerMenu, and viewerToolBar.
Referenced by getNewViewer().
|
slot |
Slot activated when something was picked in the 3D interactor.
Process the picker accordingly to the current pickingMode state. It is connected to the RendererWidget actorPicked signal
References actorMap, CELL_PICKING, camitk::Component::cellPicked(), camitk::Component::getName(), NO_PICKING, pickingEffectIsSelecting, pickingEffectUpdated, pickingMode, PIXEL_PICKING, camitk::Component::pixelPicked(), POINT_PICKING, camitk::Component::pointPicked(), refresh(), camitk::Viewer::selectionChanged(), and camitk::Application::showStatusBarMessage().
Referenced by initPicking().
|
protected |
add the given actor of the given Component to the renderer and insert it in the map
References actorMap, camitk::RendererWidget::addProp(), and rendererWidget.
Referenced by refresh().
|
protected |
add an item (row) in the the what's this message (to describe a shortcut)
References oddWhatsThis, and whatsThis.
Referenced by getWidget().
|
protectedslot |
References getBackgroundColor(), camitk::RendererWidget::refresh(), rendererWidget, and setBackgroundColor().
Referenced by initActions().
|
protectedslot |
References cameraOrientationLeftUpAction, cameraOrientationRightDownAction, cameraOrientationRightUpAction, camitk::RendererWidget::getCameraOrientation(), camitk::Application::getName(), camitk::Application::getSettings(), camitk::RendererWidget::refresh(), refresh(), rendererWidget, resetCamera(), and camitk::RendererWidget::setCameraOrientation().
Referenced by initActions().
|
protected |
|
staticprivate |
get the 3D viewer default InteractiveViewer (provided for convenience, equivalent to getViewer("3DViewer")
References defaultNames, and getViewer().
Referenced by camitk::MedicalImageViewer::getPropertyObject(), camitk::MedicalImageViewer::getWidget(), camitk::MeshComponent::initRepresentation(), MshComponent::MshComponent(), OffComponent::OffComponent(), PMManagerDC::PMManagerDC(), camitk::ImageComponent::setViewIn3D(), camitk::SingleImageComponent::setViewSliceIn3D(), VtkMeshComponent::showPointData(), and VtkMeshComponent::~VtkMeshComponent().
|
staticprivate |
get the arbitrary default InteractiveViewer (provided for convenience, equivalent to getViewer("arbitraryViewer")
References defaultNames, and getViewer().
Referenced by camitk::MedicalImageViewer::getWidget(), and camitk::SingleImageComponent::initRepresentation().
|
staticprivate |
get the axial default InteractiveViewer (provided for convenience, equivalent to getViewer("axialViewer")
References defaultNames, and getViewer().
Referenced by camitk::MedicalImageViewer::getWidget(), camitk::SingleImageComponent::initRepresentation(), and camitk::MedicalImageViewer::refresh().
bool camitk::InteractiveViewer::getBackfaceCulling | ( | ) | const |
get the backface current culling mode.
References camitk::RendererWidget::getBackfaceCulling(), and rendererWidget.
Referenced by initActions().
QColor camitk::InteractiveViewer::getBackgroundColor | ( | ) | const |
get the background color
References camitk::RendererWidget::getBackgroundColor(), and rendererWidget.
Referenced by backgroundColor().
void camitk::InteractiveViewer::getBounds | ( | double | bound[6] | ) |
Compute the bounding box of all displayed Component.
References camitk::RendererWidget::computeVisiblePropBounds(), and rendererWidget.
void camitk::InteractiveViewer::getBoundsOfSelected | ( | double | bound[6] | ) |
Compute the bounding box of the selected elements [xmin,xmax, ymin,ymax, zmin,zmax].
References actorMap, camitk::Component::getBounds(), and camitk::Component::isSelected().
Referenced by keyPressEvent().
|
private |
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.
bool camitk::InteractiveViewer::getColorScale | ( | ) | const |
get the current value of the color scale property.
References camitk::RendererWidget::getColorScale(), and rendererWidget.
|
staticprivate |
get the coronal default InteractiveViewer (provided for convenience, equivalent to getViewer("coronalViewer")
References defaultNames, and getViewer().
Referenced by camitk::MedicalImageViewer::getWidget(), camitk::SingleImageComponent::initRepresentation(), and camitk::MedicalImageViewer::refresh().
bool camitk::InteractiveViewer::getGradientBackground | ( | ) | const |
get the current background gradient mode.
References camitk::RendererWidget::getGradientBackground(), and rendererWidget.
InteractiveViewer::HighlightMode camitk::InteractiveViewer::getHighlightMode | ( | ) | const |
Return the current highlighting mode.
References highlightMode.
bool camitk::InteractiveViewer::getLinesAsTubes | ( | ) | const |
get the boolean indicating if the lines are currently set to be displayed as tubes.
References linesAsTubes.
Referenced by initActions().
|
privatevirtual |
get the explorer menu
References backgroundColorAction, cameraOrientationLeftUpAction, cameraOrientationRightDownAction, cameraOrientationRightUpAction, controlModeJoystickAction, controlModeTrackballAction, frame, getToolBar(), highlightOffAction, highlightSelectionAction, highlightSelectionOnlyAction, myType, pickCellAction, pickPointAction, renderingMenu, screenshotAction, toggleAxesAction, toggleBackfaceCullingAction, toggleCopyrightAction, toggleLabelAction, toggleLinesAsTubesAction, updateActions(), and viewerMenu.
Referenced by rightClick().
|
private |
get the scene name
Referenced by keyPressEvent(), and ~InteractiveViewer().
|
staticprivate |
Use this method to create a new custom instance of this class.
Of course you can create as many InteractiveViewer instance as you like, but if you try to create a InteractiveViewer with a name that match one of the default InteractiveViewer name, getNewViewer(..) automatically will return the corresponding default InteractiveViewer instance.
References InteractiveViewer(), and viewers.
Referenced by getViewer().
double camitk::InteractiveViewer::getPointSize | ( | ) | const |
get the current point size value
References camitk::RendererWidget::getPointSize(), and rendererWidget.
|
privatevirtual |
get the InteractiveViewer propertyObject (only non-null for GEOMETRY_VIEWER)
References myType.
|
inline |
return interactiveViewer RendererWidget
|
staticprivate |
get the sagittal default InteractiveViewer (provided for convenience, equivalent to getViewer("sagittalViewer")
References defaultNames, and getViewer().
Referenced by camitk::MedicalImageViewer::getWidget(), camitk::SingleImageComponent::initRepresentation(), and camitk::MedicalImageViewer::refresh().
|
privatevirtual |
get the viewer toolbar
References colorAction, frame, glyphAction, myType, pickCellAction, pickPointAction, pointsAction, screenshotAction, surfaceAction, toggleAxesAction, toggleLabelAction, viewerToolBar, and wireframeAction.
Referenced by getMenu().
|
staticprivate |
get a viewer by its name (return NULL if no instance has the given name, use getNewViewer to create one viewer)
References defaultNames, getNewViewer(), and viewers.
Referenced by get3DViewer(), getArbitraryViewer(), getAxialViewer(), getCoronalViewer(), and getSagittalViewer().
|
privatevirtual |
get the InteractiveViewer widget (QTreeWidget).
parent | the parent widget for the viewer widget |
References addWhatsThisItem(), endWhatsThisSection(), frame, initActions(), initWhatsThis(), myType, rendererWidget, rightClick(), screenshotAction, sideFrame, sliceSlider, sliderChanged(), startWhatsThisSection(), and whatsThis.
|
protectedslot |
References highlightMode, highlightOffAction, highlightSelectionAction, highlightSelectionOnlyAction, OFF, refresh(), SELECTION, and SELECTION_ONLY.
Referenced by initActions().
|
protected |
init all the actions (called only once in the getWidget() method)
References backgroundColor(), backgroundColorAction, cameraOrientationChanged(), cameraOrientationLeftUpAction, cameraOrientationRightDownAction, cameraOrientationRightUpAction, colorAction, controlModeJoystickAction, controlModeTrackballAction, camitk::Application::getAction(), getBackfaceCulling(), camitk::RendererWidget::getCameraOrientation(), getLinesAsTubes(), camitk::Action::getQAction(), glyphAction, highlightModeChanged(), highlightOffAction, highlightSelectionAction, highlightSelectionOnlyAction, myType, pickCellAction, pickingModeChanged(), pickPointAction, pointsAction, rendererWidget, renderingActorsChanged(), renderingMenu, screenshot(), screenshotAction, setBackfaceCulling(), setGlyph(), setLabel(), setLinesAsTubes(), surfaceAction, toggleAxes(), toggleAxesAction, toggleBackfaceCullingAction, toggleCopyright(), toggleCopyrightAction, toggleLabelAction, toggleLinesAsTubesAction, viewControlModeChanged(), and wireframeAction.
Referenced by getWidget().
void camitk::InteractiveViewer::initPicking | ( | PickingMode | pickingMode | ) |
Init the picker with a given picking mode.
References actorPicked(), CELL_PICKING, NO_PICKING, pickingEffectUpdated, pickingMode, PIXEL_PICKING, POINT_PICKING, rendererWidget, and camitk::RendererWidget::setPicker().
Referenced by InteractiveViewer(), and pickingModeChanged().
|
protected |
initialize the property object and state using the user settings (user preferences system files .config/.ini)
References camitk::RendererWidget::getCameraOrientation(), camitk::Application::getName(), camitk::Application::getSettings(), highlightMode, linesAsTubes, myType, rendererWidget, SELECTION, camitk::RendererWidget::setBackfaceCulling(), camitk::RendererWidget::setBackgroundColor(), camitk::RendererWidget::setCameraOrientation(), camitk::RendererWidget::setControlMode(), camitk::RendererWidget::setGradientBackground(), camitk::RendererWidget::setPointSize(), camitk::RendererWidget::TRACKBALL, and camitk::RendererWidget::TRACKBALL_2D.
Referenced by InteractiveViewer().
|
protected |
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::SliderSpinBoxWidget::addPageStep(), camitk::SliderSpinBoxWidget::addSingleStep(), CAMITK_INFO, camitk::Viewer::clearSelection(), camitk::RendererWidget::computeVisiblePropBounds(), camitk::Component::GEOMETRY, camitk::RendererWidget::getBackfaceCulling(), getBoundsOfSelected(), camitk::RendererWidget::getCameraSettings(), camitk::RendererWidget::getColorScale(), camitk::RendererWidget::getLightFollowCamera(), getName(), camitk::Component::getRenderingModes(), camitk::Component::getRepresentation(), camitk::Application::getSelectedComponents(), camitk::Component::getVisibility(), camitk::RendererWidget::JOYSTICK, myType, camitk::RendererWidget::pick(), camitk::InterfaceGeometry::Points, camitk::RendererWidget::refresh(), refresh(), rendererWidget, resetCamera(), camitk::RendererWidget::rotateCamera(), screenshot(), camitk::RendererWidget::setBackfaceCulling(), setColorScale(), camitk::RendererWidget::setControlMode(), camitk::RendererWidget::setLightFollowCamera(), camitk::Component::setRenderingModes(), sliceSlider, camitk::SliderSpinBoxWidget::subPageStep(), camitk::SliderSpinBoxWidget::subSingleStep(), camitk::InterfaceGeometry::Surface, toggleAxesAction, toggleInterpolation(), toggleLabelAction, camitk::RendererWidget::toogle3DRedBlue(), camitk::RendererWidget::TRACKBALL, whatsThis, and camitk::InterfaceGeometry::Wireframe.
Referenced by camitk::InteractiveViewerFrame::keyPressEvent().
|
privatevirtual |
|
protectedslot |
References CELL_PICKING, initPicking(), pickCellAction, pickPointAction, and POINT_PICKING.
Referenced by initActions().
|
inlineprivate |
< display slices (the view is blocked in 2D and the slider is available)
< display 3D stuff (geometry, etc...)
|
privatevirtual |
Refresh the display.
References actorMap, addActor(), displayedTopLevelComponents, frame, camitk::Component::GEOMETRY, camitk::Component::get2DImageActor(), camitk::Component::get3DImageActor(), camitk::Component::getActor(), camitk::Application::getAllComponents(), camitk::Component::getNumberOfProp(), camitk::Component::getNumberOfSlices(), camitk::Component::getPickPlaneActor(), camitk::Component::getPixelActor(), camitk::Component::getProp(), camitk::Component::getRepresentation(), camitk::Application::getSelectedComponents(), camitk::Component::getSlice(), camitk::Application::getTopLevelComponents(), camitk::Component::getVisibility(), camitk::Application::isAlive(), linesAsTubes, myType, camitk::InterfaceGeometry::Points, camitk::RendererWidget::refresh(), removeAllActors(), rendererWidget, resetCamera(), camitk::Component::setLinesAsTubes(), camitk::SliderSpinBoxWidget::setRange(), camitk::SliderSpinBoxWidget::setValue(), camitk::Component::SLICE, sliceSlider, camitk::InterfaceGeometry::Surface, updateActions(), camitk::RendererWidget::updateAxes(), updateSelectionDisplay(), and camitk::InterfaceGeometry::Wireframe.
Referenced by actorPicked(), cameraOrientationChanged(), highlightModeChanged(), keyPressEvent(), renderingActorsChanged(), screenshot(), setGlyph(), setHighlightMode(), setLabel(), setLinesAsTubes(), camitk::ImageComponent::setViewIn3D(), and camitk::SingleImageComponent::setViewSliceIn3D().
|
private |
just refresh the renderer
References camitk::RendererWidget::refresh(), and rendererWidget.
|
protected |
remove all the given Component actors from the renderer and delete comp from the map
References actorMap, camitk::RendererWidget::removeProp(), and rendererWidget.
Referenced by refresh().
|
protectedslot |
References camitk::Application::getSelectedComponents(), camitk::InterfaceGeometry::None, camitk::InterfaceGeometry::Points, pointsAction, refresh(), camitk::Component::setRenderingModes(), camitk::InterfaceGeometry::Surface, surfaceAction, camitk::InterfaceGeometry::Wireframe, and wireframeAction.
Referenced by initActions().
|
private |
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 camitk::RendererWidget::resetCamera().
Referenced by cameraOrientationChanged(), keyPressEvent(), refresh(), and toggleAxes().
|
protectedslot |
References getMenu(), and rendererWidget.
Referenced by getWidget().
|
private |
call this method to take a screenshot using the given filename (the extension must be a supported format extension, see class RendererWindow)
References refresh(), rendererWidget, and camitk::RendererWidget::screenshot().
|
slot |
call this method to take a screenshot in various format and write the resulting image to a file
References camitk::RendererWidget::ScreenshotFormatInfo::description, camitk::RendererWidget::ScreenshotFormatInfo::extension, camitk::RendererWidget::getScreenshotFormatInfo(), and camitk::RendererWidget::NOT_SUPPORTED.
Referenced by initActions(), and keyPressEvent().
|
private |
Set the active virtual camera.
References cameraMap, rendererWidget, and camitk::RendererWidget::setActiveCamera().
|
slot |
set the backface culling mode (default is true).
References camitk::Application::getName(), camitk::Application::getSettings(), camitk::RendererWidget::refresh(), rendererWidget, and camitk::RendererWidget::setBackfaceCulling().
Referenced by initActions().
|
virtual |
set background color
References camitk::Application::getName(), camitk::Application::getSettings(), camitk::RendererWidget::refresh(), rendererWidget, and camitk::RendererWidget::setBackgroundColor().
Referenced by backgroundColor().
void camitk::InteractiveViewer::setColorScale | ( | bool | state | ) |
set the color scale in the viewport, use setColorScaleMinMax / setColorScaleTitle to change the displayed values.
References rendererWidget, and camitk::RendererWidget::setColorScale().
Referenced by keyPressEvent(), VtkMeshComponent::showPointData(), and VtkMeshComponent::~VtkMeshComponent().
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, and camitk::RendererWidget::setColorScaleMinMax().
Referenced by VtkMeshComponent::showPointData().
void camitk::InteractiveViewer::setColorScaleTitle | ( | QString | t | ) |
set the color scale title.
t | title of the color scale |
References rendererWidget, and camitk::RendererWidget::setColorScaleTitle().
Referenced by VtkMeshComponent::showPointData().
|
protectedslot |
|
virtual |
set gradient background on/off
References camitk::Application::getName(), camitk::Application::getSettings(), camitk::RendererWidget::refresh(), rendererWidget, and camitk::RendererWidget::setGradientBackground().
|
virtual |
Set the current highlighting mode.
References camitk::Application::getName(), camitk::Application::getSettings(), highlightMode, and refresh().
|
protectedslot |
if true currently selected Components label will have their label on (shown)
References camitk::Component::GEOMETRY, camitk::Component::getProp(), camitk::Component::getRepresentation(), camitk::Application::getSelectedComponents(), camitk::Component::getVisibility(), 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 camitk::Application::getName(), camitk::Application::getSettings(), linesAsTubes, and refresh().
Referenced by initActions().
void camitk::InteractiveViewer::setPointSize | ( | double | size | ) |
update the visualization of points (for all object3D in the scene).
This property acts directly on the actor, thus it can be changed outside the InterfaceGeometry, thus the InterfaceGeometry should not be aware of its value (no method should be concerned with this property)
References camitk::Application::getName(), camitk::Application::getSettings(), camitk::RendererWidget::refresh(), rendererWidget, and camitk::RendererWidget::setPointSize().
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, and myType.
Referenced by getWidget().
|
protected |
start a table (section) in the what's this message
References oddWhatsThis, and whatsThis.
Referenced by getWidget().
|
protectedslot |
References camitk::RendererWidget::refresh(), rendererWidget, resetCamera(), and camitk::RendererWidget::toggleAxes().
Referenced by initActions().
|
slot |
show/hide the copyright in 3D
References camitk::RendererWidget::refresh(), rendererWidget, and camitk::RendererWidget::toggleCopyright().
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, camitk::Component::get2DImageActor(), camitk::Component::get3DImageActor(), camitk::Component::getRepresentation(), camitk::Component::refresh(), and camitk::Component::SLICE.
Referenced by keyPressEvent().
|
protected |
update the viewer menu depending on the selection,...
References colorAction, camitk::Component::GEOMETRY, 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 the display of the given Component, according to its selection state and the current HighlightMode.
References camitk::InterfaceGeometry::Hidden, highlightMode, camitk::Component::isSelected(), camitk::InterfaceGeometry::Normal, SELECTION, SELECTION_ONLY, camitk::Component::setEnhancedModes(), and camitk::InterfaceGeometry::Shaded.
Referenced by refresh().
|
protectedslot |
References controlModeTrackballAction, camitk::RendererWidget::JOYSTICK, rendererWidget, camitk::RendererWidget::setControlMode(), and camitk::RendererWidget::TRACKBALL.
Referenced by initActions().
|
slot |
Slot called when the InteractiveViewer x angle update has been changed.
|
slot |
Slot called when the InteractiveViewer y angle update has been changed.
|
slot |
Slot called when the InteractiveViewer z angle update has been changed.
|
friend |
the InteractiveViewerFrame keyPressEvent is a good friend of InteractiveViewer
|
protected |
the map containing all the actors in the InteractiveViewer
Referenced by actorPicked(), addActor(), getBoundsOfSelected(), keyPressEvent(), numberOfViewedComponent(), refresh(), removeAllActors(), resetCamera(), sliderChanged(), toggleInterpolation(), xAngleChanged(), yAngleChanged(), and zAngleChanged().
|
protected |
background color
Referenced by getMenu(), and initActions().
|
protected |
all the available camera
Referenced by getCamera(), InteractiveViewer(), and setActiveCamera().
|
protected |
Referenced by cameraOrientationChanged(), getMenu(), and initActions().
|
protected |
to change the axes view mode
Referenced by cameraOrientationChanged(), getMenu(), and initActions().
|
protected |
Referenced by cameraOrientationChanged(), getMenu(), and initActions().
|
protected |
Referenced by getToolBar(), initActions(), and updateActions().
|
protected |
Referenced by getMenu(), and initActions().
|
protected |
to change the camera control mode
Referenced by getMenu(), initActions(), and viewControlModeChanged().
|
staticprotected |
the QString array containing all InteractiveViewer instance default names
Referenced by get3DViewer(), getArbitraryViewer(), getAxialViewer(), getCoronalViewer(), getSagittalViewer(), and getViewer().
|
protected |
number of top-level component that are currently displayed
Referenced by InteractiveViewer(), and refresh().
|
protected |
the InteractiveViewer frame
Referenced by getMenu(), getToolBar(), getWidget(), InteractiveViewer(), refresh(), and ~InteractiveViewer().
|
protected |
Referenced by getToolBar(), initActions(), and updateActions().
|
protected |
keep the value of the hightlight mode
Referenced by getHighlightMode(), 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 |
Are lines currently displayed as tubes (the actors have to add a vtkTubeFilter between the source and the mapper)
Referenced by getLinesAsTubes(), initSettings(), refresh(), and setLinesAsTubes().
|
protected |
type of InteractiveViewer (display slice or geometry)
Referenced by getMenu(), getPropertyObject(), getToolBar(), getWidget(), initActions(), initSettings(), InteractiveViewer(), keyPressEvent(), refresh(), resetCamera(), sliderChanged(), updateActions(), xAngleChanged(), yAngleChanged(), and zAngleChanged().
|
protected |
are we currently in a odd table line
Referenced by addWhatsThisItem(), and startWhatsThisSection().
|
protected |
Referenced by getMenu(), getToolBar(), initActions(), 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 |
picking effect while mouse button is kept pressed is selecting (depends on the selection state of the first component picked)
Referenced by actorPicked(), and InteractiveViewer().
|
protected |
was the picking effect updated (it has to be updated with the first picking for a given button down session)
Referenced by actorPicked(), and initPicking().
|
protected |
Current picking mode, NO_PICKING be default.
Referenced by actorPicked(), and initPicking().
|
protected |
action of the picking menu
Referenced by getMenu(), getToolBar(), initActions(), and pickingModeChanged().
|
protected |
Referenced by getToolBar(), initActions(), renderingActorsChanged(), and updateActions().
|
protected |
The 3D scene itself, wrapping VTK render window, renderer and interactor in a single Qt widget
Referenced by addActor(), backgroundColor(), cameraOrientationChanged(), getBackfaceCulling(), getBackgroundColor(), getBounds(), getColorScale(), getGradientBackground(), getPointSize(), getWidget(), initActions(), initPicking(), initSettings(), InteractiveViewer(), keyPressEvent(), refresh(), refreshRenderer(), removeAllActors(), resetCamera(), rightClick(), screenshot(), setActiveCamera(), setBackfaceCulling(), setBackgroundColor(), setColorScale(), setColorScaleMinMax(), setColorScaleTitle(), setGradientBackground(), setPointSize(), toggleAxes(), toggleCopyright(), and viewControlModeChanged().
|
protected |
Rendering.
Referenced by getMenu(), initActions(), and updateActions().
|
protected |
Screenshot.
Referenced by getMenu(), getToolBar(), getWidget(), and initActions().
|
protected |
the right side frame (this is where the slider and screenshot buttons are shown)
Referenced by 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(), InteractiveViewer(), keyPressEvent(), and refresh().
|
protected |
Referenced by getToolBar(), initActions(), renderingActorsChanged(), and updateActions().
|
protected |
button allows to display the Axes in the InteractiveViewer
Referenced by getMenu(), getToolBar(), initActions(), and keyPressEvent().
|
protected |
back face culling
Referenced by getMenu(), and initActions().
|
protected |
button to remove the copyright
Referenced by getMenu(), and initActions().
|
protected |
button allows to display the labels of the object3D
Referenced by getMenu(), getToolBar(), initActions(), keyPressEvent(), and updateActions().
|
protected |
button allows to display the lines as tubes (the lines are to be in vtkPolyData)
Referenced by getMenu(), and initActions().
|
protected |
the QMenu for the InteractiveViewer
Referenced by getMenu(), InteractiveViewer(), updateActions(), and ~InteractiveViewer().
|
staticprotected |
the map containing all the InteractiveViewer instances
the register containing all the viewers (static instanciation, global variable, but global only for this file)
Referenced by getNewViewer(), getViewer(), and ~InteractiveViewer().
|
protected |
the QToolBar for the InteractiveViewer
Referenced by getToolBar(), InteractiveViewer(), 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().