27 #ifndef INTERACTIVE_VIEWER_H
28 #define INTERACTIVE_VIEWER_H
32 #include "Component.h"
37 #include <QPushButton>
41 #include <vtkSmartPointer.h>
53 class SliderSpinBoxWidget;
54 class GeometricObject;
55 class InterfaceGeometry;
56 class InterfaceBitMap;
137 Q_PROPERTY (
HighlightMode highlightMode READ getHighlightMode WRITE setHighlightMode )
138 Q_PROPERTY ( QColor backgroundColor READ getBackgroundColor WRITE setBackgroundColor )
139 Q_PROPERTY (
bool gradientBackground READ getGradientBackground WRITE setGradientBackground )
140 Q_PROPERTY (
bool linesAsTubes READ getLinesAsTubes WRITE setLinesAsTubes )
141 Q_PROPERTY (
bool backfaceCulling READ getBackfaceCulling WRITE setBackfaceCulling )
142 Q_PROPERTY (
double pointSize READ getPointSize WRITE setPointSize )
203 QString getName()
const;
208 virtual unsigned int numberOfViewedComponent();
213 virtual void refresh (
Viewer *whoIsAsking = NULL );
216 virtual QWidget * getWidget ( QWidget * parent );
219 virtual QObject * getPropertyObject();
222 virtual QMenu * getMenu();
225 virtual QToolBar * getToolBar();
233 void refreshRenderer();
239 void setActiveCamera ( QString cameraName );
244 vtkSmartPointer<vtkCamera> getCamera ( QString cameraName =
"default" );
247 void screenshot ( QString );
260 virtual void setGradientBackground (
bool );
263 bool getGradientBackground()
const;
266 virtual void setBackgroundColor ( QColor );
269 QColor getBackgroundColor()
const;
273 void setBackfaceCulling (
bool );
277 bool getBackfaceCulling()
const;
287 void setLinesAsTubes (
bool tubes );
291 void keyPressEvent ( QKeyEvent* e );
294 bool getLinesAsTubes()
const;
303 void setPointSize (
double size );
306 double getPointSize()
const;
316 return rendererWidget;
324 void setColorScale (
bool );
329 bool getColorScale()
const;
336 void setColorScaleMinMax (
double m,
double M );
341 void setColorScaleTitle ( QString t );
344 void initPicking ( PickingMode );
347 void getBoundsOfSelected (
double *bound );
350 void getBounds (
double *bound );
353 void setSideFrameVisible(
bool);
362 void actorPicked ( vtkSmartPointer<vtkPicker> );
366 void sliderChanged (
int );
369 void xAngleChanged (
double angle );
372 void yAngleChanged (
double angle );
375 void zAngleChanged (
double angle );
378 void toggleCopyright (
bool );
391 static QMap<QString, InteractiveViewer*>
viewers;
394 static QString defaultNames[5];
421 void toggleInterpolation();
427 void updateSelectionDisplay (
Component * );
430 QMultiMap<Component*, vtkSmartPointer<vtkProp> >
actorMap;
433 void addActor (
Component *, vtkSmartPointer<vtkProp> );
474 void updateActions();
556 void initWhatsThis();
559 void startWhatsThisSection (
const QString & title =
"" );
562 void endWhatsThisSection();
565 void addWhatsThisItem (
const QString & key,
const QString & description );
571 void renderingActorsChanged();
574 void highlightModeChanged ( QAction *selectedAction );
576 void cameraOrientationChanged ( QAction *selectedAction );
578 void viewControlModeChanged ( QAction* );
580 void backgroundColor();
582 void toggleAxes (
bool );
584 void pickingModeChanged ( QAction* );
589 void setLabel (
bool);
InteractiveViewer * myInteractiveViewer
Definition: InteractiveViewer.h:71
QMap< QString, vtkSmartPointerCamera > cameraMap
all the available camera
Definition: InteractiveViewer.h:442
InteractiveViewerFrame * frame
the InteractiveViewer frame
Definition: InteractiveViewer.h:456
QMenu * viewerMenu
the QMenu for the InteractiveViewer
Definition: InteractiveViewer.h:465
QFrame * sideFrame
the right side frame (this is where the slider and screenshot buttons are shown)
Definition: InteractiveViewer.h:459
SliderSpinBoxWidget * sliceSlider
Slider used to control the slice index in a InteractiveViewer.
Definition: InteractiveViewer.h:453
QAction * cameraOrientationRightDownAction
to change the axes view mode
Definition: InteractiveViewer.h:497
ControlMode
list of possible user interaction control mode
Definition: RendererWidget.h:100
QToolBar * viewerToolBar
the QToolBar for the InteractiveViewer
Definition: InteractiveViewer.h:468
InteractiveViewer is used to view 3D objects and slices (anything that provides either a InterfaceBit...
Definition: InteractiveViewer.h:134
CameraOrientation
describes the initial position and orientation of the default camera.
Definition: RendererWidget.h:93
QAction * controlModeTrackballAction
to change the camera control mode
Definition: InteractiveViewer.h:493
Viewer is an abstract viewer.
Definition: Viewer.h:55
RendererWidget * getRendererWidget()
return interactiveViewer RendererWidget
Definition: InteractiveViewer.h:315
QAction * pickCellAction
Definition: InteractiveViewer.h:521
QAction * highlightOffAction
Definition: InteractiveViewer.h:490
QAction * toggleAxesAction
button allows to display the Axes in the InteractiveViewer
Definition: InteractiveViewer.h:505
the selected Components are in default mode, the non-selected Components are shaded ...
Definition: InteractiveViewer.h:166
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:542
pick a point in the VTK representation of an Geometry
Definition: InteractiveViewer.h:155
vtkSmartPointer< vtkCamera > vtkSmartPointerCamera
Definition: InteractiveViewer.h:57
bool oddWhatsThis
are we currently in a odd table line
Definition: InteractiveViewer.h:553
both selected and non-selected Components are in default mode
Definition: InteractiveViewer.h:165
QAction * screenshotAction
Screenshot.
Definition: InteractiveViewer.h:477
ViewerType myType
type of InteractiveViewer (display slice or geometry)
Definition: InteractiveViewer.h:415
QAction * cameraOrientationRightUpAction
Definition: InteractiveViewer.h:499
pick a pixel on a Slice
Definition: InteractiveViewer.h:154
QMenu * renderingMenu
Rendering.
Definition: InteractiveViewer.h:480
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:533
QAction * controlModeJoystickAction
Definition: InteractiveViewer.h:494
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:292
#define CAMITK_API
Definition: CamiTKAPI.h:49
QAction * cameraOrientationLeftUpAction
Definition: InteractiveViewer.h:498
static QMap< QString, InteractiveViewer * > viewers
the map containing all the InteractiveViewer instances
Definition: InteractiveViewer.h:391
PickingMode
Different kind of picking must be available: pixel in slice, a point, a cell, ... ...
Definition: InteractiveViewer.h:153
QAction * toggleBackfaceCullingAction
back face culling
Definition: InteractiveViewer.h:517
QAction * toggleCopyrightAction
button to remove the copyright
Definition: InteractiveViewer.h:508
QAction * wireframeAction
Definition: InteractiveViewer.h:482
unsigned int displayedTopLevelComponents
number of top-level component that are currently displayed
Definition: InteractiveViewer.h:439
QMultiMap< Component *, vtkSmartPointer< vtkProp > > actorMap
the map containing all the actors in the InteractiveViewer
Definition: InteractiveViewer.h:430
QAction * highlightSelectionAction
display mode
Definition: InteractiveViewer.h:488
QAction * toggleLabelAction
button allows to display the labels of the object3D
Definition: InteractiveViewer.h:511
QAction * surfaceAction
Definition: InteractiveViewer.h:481
void keyPressEvent(QKeyEvent *)
Handle keyboard events in the scene frame, just send everything to InteractiveViewer! ...
QAction * highlightSelectionOnlyAction
Definition: InteractiveViewer.h:489
bool linesAsTubes
Are lines currently displayed as tubes (the actors have to add a vtkTubeFilter between the source and...
Definition: InteractiveViewer.h:418
bool pickingEffectIsSelecting
picking effect while mouse button is kept pressed is selecting (depends on the selection state of the...
Definition: InteractiveViewer.h:539
HighlightMode highlightMode
keep the value of the hightlight mode
Definition: InteractiveViewer.h:424
QAction * pointsAction
Definition: InteractiveViewer.h:483
QAction * pickPointAction
action of the picking menu
Definition: InteractiveViewer.h:520
QAction * colorAction
Definition: InteractiveViewer.h:484
PickingMode pickingMode
Current picking mode, NO_PICKING be default.
Definition: InteractiveViewer.h:536
QAction * backgroundColorAction
background color
Definition: InteractiveViewer.h:502
QAction * toggleLinesAsTubesAction
button allows to display the lines as tubes (the lines are to be in vtkPolyData)
Definition: InteractiveViewer.h:514
QAction * glyphAction
Definition: InteractiveViewer.h:485
HighlightMode
describes the current mode of display.
Definition: InteractiveViewer.h:164
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
pick a cell in the VTK representation of an Geometry
Definition: InteractiveViewer.h:156