27 #ifndef INTERACTIVE_VIEWER_H
28 #define INTERACTIVE_VIEWER_H
37 #include <QPushButton>
41 #include <vtkSmartPointer.h>
53 class SliderSpinBoxWidget;
54 class GeometricObject;
55 class InterfaceGeometry;
56 class InterfaceBitMap;
134 Q_PROPERTY (
HighlightMode highlightMode READ getHighlightMode WRITE setHighlightMode )
135 Q_PROPERTY ( QColor backgroundColor READ getBackgroundColor WRITE setBackgroundColor )
136 Q_PROPERTY (
bool gradientBackground READ getGradientBackground WRITE setGradientBackground )
137 Q_PROPERTY (
bool linesAsTubes READ getLinesAsTubes WRITE setLinesAsTubes )
138 Q_PROPERTY (
bool backfaceCulling READ getBackfaceCulling WRITE setBackfaceCulling )
139 Q_PROPERTY (
double pointSize READ getPointSize WRITE setPointSize )
200 QString getName()
const;
205 virtual unsigned int numberOfViewedComponent();
210 virtual void refresh (
Viewer *whoIsAsking = NULL );
213 virtual QWidget * getWidget ( QWidget * parent );
216 virtual QObject * getPropertyObject();
219 virtual QMenu * getMenu();
222 virtual QToolBar * getToolBar();
230 void refreshRenderer();
236 void setActiveCamera ( QString cameraName );
241 vtkSmartPointer<vtkCamera> getCamera ( QString cameraName =
"default" );
244 void screenshot ( QString );
257 virtual void setGradientBackground (
bool );
260 bool getGradientBackground()
const;
263 virtual void setBackgroundColor ( QColor );
266 QColor getBackgroundColor()
const;
270 void setBackfaceCulling (
bool );
274 bool getBackfaceCulling()
const;
284 void setLinesAsTubes (
bool tubes );
288 void keyPressEvent ( QKeyEvent* e );
291 bool getLinesAsTubes()
const;
300 void setPointSize (
double size );
303 double getPointSize()
const;
313 return rendererWidget;
321 void setColorScale (
bool );
326 bool getColorScale()
const;
333 void setColorScaleMinMax (
double m,
double M );
338 void setColorScaleTitle ( QString t );
341 void initPicking ( PickingMode );
344 void getBoundsOfSelected (
double bound[6] );
347 void getBounds (
double bound[6] );
350 void setSideFrameVisible(
bool);
359 void actorPicked ( vtkSmartPointer<vtkPicker> );
363 void sliderChanged (
int );
366 void xAngleChanged (
double angle );
369 void yAngleChanged (
double angle );
372 void zAngleChanged (
double angle );
375 void toggleCopyright (
bool );
388 static QMap<QString, InteractiveViewer*>
viewers;
391 static QString defaultNames[5];
418 void toggleInterpolation();
424 void updateSelectionDisplay (
Component * );
427 QMultiMap<Component*, vtkSmartPointer<vtkProp> >
actorMap;
430 void addActor (
Component *, vtkSmartPointer<vtkProp> );
471 void updateActions();
553 void initWhatsThis();
556 void startWhatsThisSection (
const QString & title =
"" );
559 void endWhatsThisSection();
562 void addWhatsThisItem (
const QString & key,
const QString & description );
568 void renderingActorsChanged();
571 void highlightModeChanged ( QAction *selectedAction );
573 void cameraOrientationChanged ( QAction *selectedAction );
575 void viewControlModeChanged ( QAction* );
577 void backgroundColor();
579 void toggleAxes (
bool );
581 void pickingModeChanged ( QAction* );
586 void setLabel (
bool);
InteractiveViewer * myInteractiveViewer
Definition: InteractiveViewer.h:71
QMap< QString, vtkSmartPointerCamera > cameraMap
all the available camera
Definition: InteractiveViewer.h:439
InteractiveViewerFrame * frame
the InteractiveViewer frame
Definition: InteractiveViewer.h:453
QMenu * viewerMenu
the QMenu for the InteractiveViewer
Definition: InteractiveViewer.h:462
QFrame * sideFrame
the right side frame (this is where the slider and screenshot buttons are shown)
Definition: InteractiveViewer.h:456
SliderSpinBoxWidget * sliceSlider
Slider used to control the slice index in a InteractiveViewer.
Definition: InteractiveViewer.h:450
QAction * cameraOrientationRightDownAction
to change the axes view mode
Definition: InteractiveViewer.h:494
pick a pixel on a Slice
Definition: InteractiveViewer.h:151
QToolBar * viewerToolBar
the QToolBar for the InteractiveViewer
Definition: InteractiveViewer.h:465
InteractiveViewer is used to view 3D objects and slices (anything that provides either a InterfaceBit...
Definition: InteractiveViewer.h:131
QAction * controlModeTrackballAction
to change the camera control mode
Definition: InteractiveViewer.h:490
Viewer is an abstract viewer.
Definition: Viewer.h:50
RendererWidget * getRendererWidget()
return interactiveViewer RendererWidget
Definition: InteractiveViewer.h:312
PickingMode
Different kind of picking must be available: pixel in slice, a point, a cell, ... ...
Definition: InteractiveViewer.h:150
QAction * pickCellAction
Definition: InteractiveViewer.h:518
QAction * highlightOffAction
Definition: InteractiveViewer.h:487
QAction * toggleAxesAction
button allows to display the Axes in the InteractiveViewer
Definition: InteractiveViewer.h:502
bool pickingEffectUpdated
was the picking effect updated (it has to be updated with the first picking for a given button down s...
Definition: InteractiveViewer.h:539
vtkSmartPointer< vtkCamera > vtkSmartPointerCamera
Definition: InteractiveViewer.h:57
bool oddWhatsThis
are we currently in a odd table line
Definition: InteractiveViewer.h:550
QAction * screenshotAction
Screenshot.
Definition: InteractiveViewer.h:474
ViewerType myType
type of InteractiveViewer (display slice or geometry)
Definition: InteractiveViewer.h:412
QAction * cameraOrientationRightUpAction
Definition: InteractiveViewer.h:496
QMenu * renderingMenu
Rendering.
Definition: InteractiveViewer.h:477
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.
Definition: InteractiveViewer.h:530
QAction * controlModeJoystickAction
Definition: InteractiveViewer.h:491
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: Component.h:287
pick a cell in the VTK representation of an Geometry
Definition: InteractiveViewer.h:153
#define CAMITK_API
Definition: CamiTKAPI.h:49
QAction * cameraOrientationLeftUpAction
Definition: InteractiveViewer.h:495
static QMap< QString, InteractiveViewer * > viewers
the map containing all the InteractiveViewer instances
Definition: InteractiveViewer.h:388
QAction * toggleBackfaceCullingAction
back face culling
Definition: InteractiveViewer.h:514
QAction * toggleCopyrightAction
button to remove the copyright
Definition: InteractiveViewer.h:505
pick a point in the VTK representation of an Geometry
Definition: InteractiveViewer.h:152
QAction * wireframeAction
Definition: InteractiveViewer.h:479
unsigned int displayedTopLevelComponents
number of top-level component that are currently displayed
Definition: InteractiveViewer.h:436
QMultiMap< Component *, vtkSmartPointer< vtkProp > > actorMap
the map containing all the actors in the InteractiveViewer
Definition: InteractiveViewer.h:427
QAction * highlightSelectionAction
display mode
Definition: InteractiveViewer.h:485
QAction * toggleLabelAction
button allows to display the labels of the object3D
Definition: InteractiveViewer.h:508
QAction * surfaceAction
Definition: InteractiveViewer.h:478
void keyPressEvent(QKeyEvent *)
Handle keyboard events in the scene frame, just send everything to InteractiveViewer! ...
QAction * highlightSelectionOnlyAction
Definition: InteractiveViewer.h:486
bool linesAsTubes
Are lines currently displayed as tubes (the actors have to add a vtkTubeFilter between the source and...
Definition: InteractiveViewer.h:415
bool pickingEffectIsSelecting
picking effect while mouse button is kept pressed is selecting (depends on the selection state of the...
Definition: InteractiveViewer.h:536
HighlightMode highlightMode
keep the value of the hightlight mode
Definition: InteractiveViewer.h:421
QAction * pointsAction
Definition: InteractiveViewer.h:480
QAction * pickPointAction
action of the picking menu
Definition: InteractiveViewer.h:517
QAction * colorAction
Definition: InteractiveViewer.h:481
PickingMode pickingMode
Current picking mode, NO_PICKING be default.
Definition: InteractiveViewer.h:533
QAction * backgroundColorAction
background color
Definition: InteractiveViewer.h:499
the selected Components are in default mode, the non-selected Components are shaded ...
Definition: InteractiveViewer.h:163
both selected and non-selected Components are in default mode
Definition: InteractiveViewer.h:162
HighlightMode
describes the current mode of display.
Definition: InteractiveViewer.h:161
QAction * toggleLinesAsTubesAction
button allows to display the lines as tubes (the lines are to be in vtkPolyData)
Definition: InteractiveViewer.h:511
QAction * glyphAction
Definition: InteractiveViewer.h:482
InteractiveViewerFrame(QWidget *parent, InteractiveViewer *s3D)
default constructor
Definition: InteractiveViewer.h:65
InteractiveViewerFrame is just a QFrame that delegates all key events to its InteractiveViewer.
Definition: InteractiveViewer.h:62