InteractiveViewer specialized in 2D bitmap (images in jpeg, png...). More...
#include <BitmapViewer.h>
Inheritance diagram for BitmapViewer:
Collaboration diagram for BitmapViewer:Public Member Functions | |
| Q_INVOKABLE | BitmapViewer (QString name) |
| QToolBar * | getToolBar () override |
| get the viewer toolbar (returns nullptr by default, i.e. there are no default toolbar) | |
| QWidget * | getWidget () override |
| get the viewer widget. | |
| void | refresh (camitk::Viewer *whoIsAsking=nullptr) override |
| refresh the view (can be interesting to know which other viewer is calling this) | |
| virtual | ~BitmapViewer () override |
Public Member Functions inherited from camitk::InteractiveViewer | |
| 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. | |
| QString | getName () const |
| get the scene name | |
| 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 | |
| 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) | |
| 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 | |
| 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 | 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 | |
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 | |
| Q_ENUM (ViewerType) Viewer(QString name | |
| default constructor | |
| 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) | |
| virtual | ~Viewer () override |
| default destructor | |
Additional Inherited Members | |
Public Types inherited from camitk::InteractiveViewer | |
| 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 inherited from camitk::InteractiveViewer | |
| void | sliderChanged (int) |
| Slot called when the InteractiveViewer slider has been changed. | |
| void | toggleLogo (bool) |
| show/hide the logo at the bottom right corner | |
| void | screenshot () |
| call this method to take a screenshot in various format and write the resulting image to a file | |
| 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). | |
Signals inherited from camitk::Viewer | |
| void | selectionChanged () |
| this signal is emitted when the current selection was changed by the viewer | |
Public Attributes inherited from camitk::Viewer | |
| ViewerType | type = EMBEDDED) |
| this viewer's layout | |
Protected Slots inherited from camitk::InteractiveViewer | |
| 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 inherited from camitk::InteractiveViewer | |
| void | init () |
| used by both constructors | |
| 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 | |
| void | initActions () |
| init all the actions (called only once in the getWidget() method) | |
| void | updateActions () |
| update the viewer menu depending on the selection,... | |
| 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) | |
| 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. | |
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 inherited from camitk::InteractiveViewer | |
| 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 |
| 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 | |
| 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 |
| QString | whatsThis |
| bool | oddWhatsThis |
| are we currently in a odd table line | |
| 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. | |
InteractiveViewer specialized in 2D bitmap (images in jpeg, png...).
It is similar to InteractiveSliceViewer but has the proper orientation for 2D image and a gray background.
It manages the camitk::InterfaceBitMap facet of components.
All the logic is done by InteractiveViewer.
If this viewer extension is loaded, the default instance of this viewer can be accessed directly by Application::getViewer("Bitmap Explorer").
| BitmapViewer::BitmapViewer | ( | QString | name | ) |
References camitk::RendererWidget::getActiveCamera(), camitk::InteractiveViewer::getRendererWidget(), camitk::RendererWidget::RIGHT_DOWN, camitk::RendererWidget::setBackgroundColor(), camitk::RendererWidget::setCameraOrientation(), camitk::Viewer::setComponentClassNames(), camitk::Viewer::setDescription(), camitk::RendererWidget::setGradientBackground(), and camitk::RendererWidget::toggleOrientationDecorations().
Here is the call graph for this function:
|
overridevirtual |
|
overridevirtual |
get the viewer toolbar (returns nullptr by default, i.e. there are no default toolbar)
Reimplemented from camitk::Viewer.
References camitk::Application::getMainWindow(), camitk::Application::getViewer(), camitk::InteractiveViewer::screenshotAction, and camitk::MainWindow::setCentralViewer().
Here is the call graph for this function:
|
overridevirtual |
get the viewer widget.
this method is protected and to be redefined in the inheriting class.
Implements camitk::Viewer.
References camitk::InteractiveViewer::getWidget(), and camitk::InteractiveViewer::sideFrame.
Here is the call graph for this function:
|
overridevirtual |
refresh the view (can be interesting to know which other viewer is calling this)
Implements camitk::Viewer.
References camitk::InteractiveViewer::refresh().
Here is the call graph for this function: