Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes

DGVSurfacePlotVTK Class Reference

This class represents the DGV Surface Plot Display object using VTK. More...

#include <DGVSurfacePlotVTK.h>

Collaboration diagram for DGVSurfacePlotVTK:
Collaboration graph
[legend]

List of all members.

Public Slots

void refresh ()
 Reload the data and rest the camera and axes.
void renameData ()
 Renames the surfaces data.
void scale ()
 Ask for scale factor.
void threshold ()
 Ask for thresholding.
void thresholdUpper (double value)
 Apply a upper Thresholding.
void thresholdLower (double value)
 Apply a lower thresholding.
void xLabel ()
 Ask for x-label.
void yLabel ()
 Ask for y-label.
void zLabel ()
 Ask for z-label.
void background ()
 Ask for rgb values and change background to that colour.
void axesProperties ()
 Ask for rgb values and change axes to that colour.
void updateDisplayData ()
void toggleAxesAsClosestTriad ()
 Toggles if the axes are display with closest triad display mode.
void toggleAntiAliasing ()
 Toggles the Anti-Aliasing in display. May slow rendering if enabled.
void save ()
 Saves the data.
void updateSlice ()
 Updates slice data, normally triggered by timers for animations.
void firstSlice ()
 Updates slice count to the first slice.
void pauseAnimation ()
 Pauses and Unpauses animations.

Public Member Functions

 DGVSurfacePlotVTK (QWidget *parent=0)
 The standard constructor.
virtual ~DGVSurfacePlotVTK ()
 The standard destructor.
void setName (QString filename)
 Set the name of the plot.
void setData (Array< imageType, 2 > data)
 Set the data to be plotted.
void SetInput (vtkImageData *newData)
 Set the data to be plotted, using VTK syntax.
void setScaleFactor (double factor)
 Set the scale factor for the surface plot.
void autoScaleSurface (bool autoScale)
 Auto scale the z-axis corresponding to the surface of the plot?
void setThresholdLevels (double low, double high)
 Set the thresholding on the data plotted. (To be implemented).
void setXLabel (QString text)
 Set the label of x-axis.
void setYLabel (QString text)
 Set the label of y-axis.
void setZLabel (QString text)
 Set the label of z-axis.
void setAxesAsClosestTriad ()
 Set the axes display method as the closest triad to viewer.
void setAxesAsOuterEdges ()
void setBackground (double r, double g, double b)
 Sets the background of the renderer to colour (r,g,b).
bool saveVTI (const QString filename)
 Saves data using VTK XML Image (VTI) format with stored filename.
void generatePlot ()
 Generates a surface plot from the data provided.
void generatePlotMergedWith (vtkImageData *image)
 Generates a surface plot from the data provided and merged with image.
void generateAxes ()
 Generates and enables the axes on the plot.
void animateFromSlices (Array< imageType, 3 > *data, int interval)
 Animates a surface plot from each slice of a 3D data set.
QString strippedName ()
 Returns the stripped (path removed) name of the plot.
QString strippedNamePrefix ()
 Returns the stripped (path removed) name of the plot with "SPlot" prefix.
Array< imageType, 2 > & data ()
 Returns the data in Blitz array form.
void setConsole (DGVConsole *newConsole)
 Assigns a console for message output.
void setVerboseMode (bool verbose)
 Verbose mode for message output.

Protected Member Functions

void setupEvents ()
 Executes common events setup code.
void setupSurface ()
 Executes common code for setting up the surface in VTK.
void contextMenuEvent (QContextMenuEvent *event)
 The context menu setup member.
void printError (QString msg)
 Error message wrapper for console.
void printWarning (QString msg)
 Warning message wrapper for console.
void printInfo (QString msg)
 Info message wrapper for console.
void createActions ()
 Create actions for internal use.
void createConnections ()
 Create connections for internal use.

Protected Attributes

bool loaded
 Data loaded?
bool generated
 Plot has been generated?
bool axisGenerated
 Axis has been generated?
bool externalData
 External vtkImageData?
bool verboseMode
 Verbose messaging mode.
bool consoleAssigned
 Messaging console has been set.
bool closestTriad
 Flag for closest triad display of axes.
bool antiAliasing
 Smooth Polygons?
bool thresholded
 Thresholded data?
bool autoScaleZ
 Auto Scale the z-axis always?
bool logScaled
 Used log scale? (If so, reset scale).
bool animating
 Animation is happening?
bool pausedAnimation
 Animation is paused?
QString name
 Name of the plot.
QMenu * contextMenu
 Context Menu.
QAction * scaleAct
 Action object for scaling plot.
QAction * thresholdAct
 Action object for thresholding plot.
QAction * xLabelAct
 Change x label.
QAction * yLabelAct
 Change y label.
QAction * zLabelAct
 Change z label.
QAction * backgroundAct
 Change background colour?
QAction * axesAct
 Change axes colour?
QAction * logAct
 Show logscale?
QAction * triadAct
 Show triad axes?
QAction * antiAliasingAct
 Change Anti Aliasing.
QAction * startAct
 Start Animation for 3D datasets.
QAction * pauseAct
 Pause Animation for 3D datasets.
QAction * saveAct
 Saves data as VTI file.
QAction * refreshAct
 Refreshes window.
QAction * renameAct
 Renames window.
QAction * closeAct
 Closes window.
int bounds [6]
 Bounds of the data.
double scaling
 Scaling factor.
vtkImageData * plotData
 Actual data stored as using an image geometry.
DGVBlitzArrayCasterVTK< imageTypeBlitz
 For casting Blitz arrays to and from VTK structures.
Array< imageType, 2 > plotArray
 Plot data in array form.
Array< imageType, 3 > * volumeData
 Pointer to volume array, used for animations.
int currentSlice
 Slice being showm.
DGVConsoleconsole
 Console for message output.
ThresholdFormthresholder
 Threshold form.
vtkImageLogarithmicScale * logData
 For log scaling.
vtkImageDataGeometryFilter * geometry
 Used to create the geometry for a surface plot.
vtkWarpScalar * warp
 Surface quantifier.
vtkPolyDataNormals * surfaceNormals
 Normals for the mesh.
vtkPolyDataMapper * mapper
 Map the data to the surface.
vtkLODActor * lod
vtkCubeAxesActor2D * axes
 Axis for plot.
vtkRenderer * renderer
 Renderer of the plot.
vtkRenderWindow * renderWin
 Window that controls the renderer.

Detailed Description

This class represents the DGV Surface Plot Display object using VTK.

Author:
Shekhar S. Chandra, 2008-2009

The class displays plot values using OpenGL via the VTK library. The rendering is encapsulated within a QVTK widget. Controls:

Usage Example:

    DGVSurfacePlotVTK *plot = new DGVSurfacePlotVTK;

    plot->setName(name);
    plot->setData(data);
    plot->generatePlot();
    plot->generateAxes();
    plot->show();

Definition at line 73 of file DGVSurfacePlotVTK.h.


Constructor & Destructor Documentation

DGVSurfacePlotVTK::DGVSurfacePlotVTK ( QWidget *  parent = 0  ) 

The standard constructor.

Definition at line 30 of file DGVSurfacePlotVTK.cpp.

DGVSurfacePlotVTK::~DGVSurfacePlotVTK (  )  [virtual]

The standard destructor.

Definition at line 53 of file DGVSurfacePlotVTK.cpp.


Member Function Documentation

void DGVSurfacePlotVTK::animateFromSlices ( Array< imageType, 3 > *  data,
int  interval 
)

Animates a surface plot from each slice of a 3D data set.

Definition at line 386 of file DGVSurfacePlotVTK.cpp.

DGVSurfacePlotVTK::autoScaleSurface ( bool  autoScale  )  [inline]

Auto scale the z-axis corresponding to the surface of the plot?

Definition at line 113 of file DGVSurfacePlotVTK.h.

void DGVSurfacePlotVTK::axesProperties (  )  [slot]

Ask for rgb values and change axes to that colour.

Definition at line 551 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::background (  )  [slot]

Ask for rgb values and change background to that colour.

Definition at line 534 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::contextMenuEvent ( QContextMenuEvent *  event  )  [protected]

The context menu setup member.

< Only exists for the duration of the context selection

Global Ops

Labels and Options

Setup Toggle Options

Animation Controls

Setup Close action Close

Definition at line 730 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::createActions (  )  [protected]

Create actions for internal use.

Definition at line 834 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::createConnections (  )  [protected]

Create connections for internal use.

Definition at line 842 of file DGVSurfacePlotVTK.cpp.

DGVSurfacePlotVTK::data (  )  [inline]

Returns the data in Blitz array form.

Definition at line 191 of file DGVSurfacePlotVTK.h.

DGVSurfacePlotVTK::firstSlice (  )  [inline, slot]

Updates slice count to the first slice.

Definition at line 290 of file DGVSurfacePlotVTK.h.

void DGVSurfacePlotVTK::generateAxes (  ) 

Generates and enables the axes on the plot.

Axes

Ensure z-scale is true

Definition at line 310 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::generatePlot (  ) 

Generates a surface plot from the data provided.

Definition at line 195 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::generatePlotMergedWith ( vtkImageData *  image  ) 

Generates a surface plot from the data provided and merged with image.

Todo:
Bug: Using plotData for everything and converting causes crash on destruction.
Todo:
Bug: If values within grid are too large, then surface warp fails. Needs proper scaling.
Todo:
Bug: Colour images dont merge correctly with mono data.

< Align correctly

Definition at line 237 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::pauseAnimation (  )  [slot]

Pauses and Unpauses animations.

Definition at line 722 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::printError ( QString  msg  )  [protected]

Error message wrapper for console.

Definition at line 795 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::printInfo ( QString  msg  )  [protected]

Info message wrapper for console.

Definition at line 821 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::printWarning ( QString  msg  )  [protected]

Warning message wrapper for console.

Definition at line 808 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::refresh (  )  [slot]

Reload the data and rest the camera and axes.

Definition at line 357 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::renameData (  )  [slot]

Renames the surfaces data.

Definition at line 376 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::save (  )  [slot]

Saves the data.

Definition at line 659 of file DGVSurfacePlotVTK.cpp.

bool DGVSurfacePlotVTK::saveVTI ( const QString  filename  ) 

Saves data using VTK XML Image (VTI) format with stored filename.

Definition at line 177 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::scale (  )  [slot]

Ask for scale factor.

Definition at line 426 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::setAxesAsClosestTriad (  ) 

Set the axes display method as the closest triad to viewer.

Set the axes display method as the outer edges from the viewer.

Definition at line 152 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::setAxesAsOuterEdges (  ) 

Definition at line 160 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::setBackground ( double  r,
double  g,
double  b 
)

Sets the background of the renderer to colour (r,g,b).

Definition at line 168 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::setConsole ( DGVConsole newConsole  ) 

Assigns a console for message output.

Definition at line 417 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::setData ( Array< imageType, 2 >  data  ) 

Set the data to be plotted.

Definition at line 90 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::SetInput ( vtkImageData *  newData  ) 

Set the data to be plotted, using VTK syntax.

Definition at line 104 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::setName ( QString  filename  ) 

Set the name of the plot.

Definition at line 84 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::setScaleFactor ( double  factor  ) 

Set the scale factor for the surface plot.

Definition at line 115 of file DGVSurfacePlotVTK.cpp.

DGVSurfacePlotVTK::setThresholdLevels ( double  low,
double  high 
)

Set the thresholding on the data plotted. (To be implemented).

void DGVSurfacePlotVTK::setupEvents (  )  [protected]

Executes common events setup code.

Unbind the right mouse button events as Qt uses context menu.

Definition at line 676 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::setupSurface (  )  [protected]

Executes common code for setting up the surface in VTK.

Todo:
Bug: If values within grid are too large, then surface warp fails. Needs proper scaling.

Definition at line 683 of file DGVSurfacePlotVTK.cpp.

DGVSurfacePlotVTK::setVerboseMode ( bool  verbose  )  [inline]

Verbose mode for message output.

Definition at line 202 of file DGVSurfacePlotVTK.h.

void DGVSurfacePlotVTK::setXLabel ( QString  text  ) 

Set the label of x-axis.

Definition at line 128 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::setYLabel ( QString  text  ) 

Set the label of y-axis.

Definition at line 136 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::setZLabel ( QString  text  ) 

Set the label of z-axis.

Definition at line 144 of file DGVSurfacePlotVTK.cpp.

QString DGVSurfacePlotVTK::strippedName (  ) 

Returns the stripped (path removed) name of the plot.

Definition at line 407 of file DGVSurfacePlotVTK.cpp.

QString DGVSurfacePlotVTK::strippedNamePrefix (  ) 

Returns the stripped (path removed) name of the plot with "SPlot" prefix.

Definition at line 412 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::threshold (  )  [slot]

Ask for thresholding.

Definition at line 437 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::thresholdLower ( double  value  )  [slot]

Apply a lower thresholding.

Definition at line 481 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::thresholdUpper ( double  value  )  [slot]

Apply a upper Thresholding.

Definition at line 457 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::toggleAntiAliasing (  )  [slot]

Toggles the Anti-Aliasing in display. May slow rendering if enabled.

Definition at line 641 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::toggleAxesAsClosestTriad (  )  [slot]

Toggles if the axes are display with closest triad display mode.

Definition at line 632 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::updateDisplayData (  )  [slot]

Definition at line 582 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::updateSlice (  )  [slot]

Updates slice data, normally triggered by timers for animations.

Definition at line 711 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::xLabel (  )  [slot]

Ask for x-label.

Definition at line 504 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::yLabel (  )  [slot]

Ask for y-label.

Definition at line 514 of file DGVSurfacePlotVTK.cpp.

void DGVSurfacePlotVTK::zLabel (  )  [slot]

Ask for z-label.

Definition at line 524 of file DGVSurfacePlotVTK.cpp.


Member Data Documentation

bool DGVSurfacePlotVTK::animating [protected]

Animation is happening?

Definition at line 311 of file DGVSurfacePlotVTK.h.

Smooth Polygons?

Definition at line 307 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::antiAliasingAct [protected]

Change Anti Aliasing.

Definition at line 327 of file DGVSurfacePlotVTK.h.

Auto Scale the z-axis always?

Definition at line 309 of file DGVSurfacePlotVTK.h.

vtkCubeAxesActor2D* DGVSurfacePlotVTK::axes [protected]

Axis for plot.

Definition at line 354 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::axesAct [protected]

Change axes colour?

Definition at line 324 of file DGVSurfacePlotVTK.h.

Axis has been generated?

Definition at line 302 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::backgroundAct [protected]

Change background colour?

Definition at line 323 of file DGVSurfacePlotVTK.h.

For casting Blitz arrays to and from VTK structures.

Definition at line 340 of file DGVSurfacePlotVTK.h.

int DGVSurfacePlotVTK::bounds[6] [protected]

Bounds of the data.

Definition at line 337 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::closeAct [protected]

Closes window.

Definition at line 335 of file DGVSurfacePlotVTK.h.

Flag for closest triad display of axes.

Definition at line 306 of file DGVSurfacePlotVTK.h.

Console for message output.

Definition at line 345 of file DGVSurfacePlotVTK.h.

Messaging console has been set.

Definition at line 305 of file DGVSurfacePlotVTK.h.

QMenu* DGVSurfacePlotVTK::contextMenu [protected]

Context Menu.

Context Menu

Definition at line 316 of file DGVSurfacePlotVTK.h.

Slice being showm.

Definition at line 343 of file DGVSurfacePlotVTK.h.

External vtkImageData?

Definition at line 303 of file DGVSurfacePlotVTK.h.

bool DGVSurfacePlotVTK::generated [protected]

Plot has been generated?

Definition at line 301 of file DGVSurfacePlotVTK.h.

vtkImageDataGeometryFilter* DGVSurfacePlotVTK::geometry [protected]

Used to create the geometry for a surface plot.

Definition at line 349 of file DGVSurfacePlotVTK.h.

bool DGVSurfacePlotVTK::loaded [protected]

Data loaded?

Definition at line 300 of file DGVSurfacePlotVTK.h.

vtkLODActor* DGVSurfacePlotVTK::lod [protected]

Definition at line 353 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::logAct [protected]

Show logscale?

Definition at line 325 of file DGVSurfacePlotVTK.h.

vtkImageLogarithmicScale* DGVSurfacePlotVTK::logData [protected]

For log scaling.

Definition at line 348 of file DGVSurfacePlotVTK.h.

bool DGVSurfacePlotVTK::logScaled [protected]

Used log scale? (If so, reset scale).

Definition at line 310 of file DGVSurfacePlotVTK.h.

vtkPolyDataMapper* DGVSurfacePlotVTK::mapper [protected]

Map the data to the surface.

Definition at line 352 of file DGVSurfacePlotVTK.h.

QString DGVSurfacePlotVTK::name [protected]

Name of the plot.

Definition at line 313 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::pauseAct [protected]

Pause Animation for 3D datasets.

Definition at line 330 of file DGVSurfacePlotVTK.h.

Animation is paused?

Definition at line 312 of file DGVSurfacePlotVTK.h.

Plot data in array form.

Definition at line 341 of file DGVSurfacePlotVTK.h.

vtkImageData* DGVSurfacePlotVTK::plotData [protected]

Actual data stored as using an image geometry.

Definition at line 339 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::refreshAct [protected]

Refreshes window.

Definition at line 333 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::renameAct [protected]

Renames window.

Definition at line 334 of file DGVSurfacePlotVTK.h.

vtkRenderer* DGVSurfacePlotVTK::renderer [protected]

Renderer of the plot.

Definition at line 356 of file DGVSurfacePlotVTK.h.

vtkRenderWindow* DGVSurfacePlotVTK::renderWin [protected]

Window that controls the renderer.

Definition at line 357 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::saveAct [protected]

Saves data as VTI file.

Definition at line 332 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::scaleAct [protected]

Action object for scaling plot.

Definition at line 317 of file DGVSurfacePlotVTK.h.

double DGVSurfacePlotVTK::scaling [protected]

Scaling factor.

Definition at line 338 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::startAct [protected]

Start Animation for 3D datasets.

Definition at line 329 of file DGVSurfacePlotVTK.h.

vtkPolyDataNormals* DGVSurfacePlotVTK::surfaceNormals [protected]

Normals for the mesh.

Definition at line 351 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::thresholdAct [protected]

Action object for thresholding plot.

Definition at line 318 of file DGVSurfacePlotVTK.h.

Thresholded data?

Definition at line 308 of file DGVSurfacePlotVTK.h.

Threshold form.

Definition at line 346 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::triadAct [protected]

Show triad axes?

Definition at line 326 of file DGVSurfacePlotVTK.h.

Verbose messaging mode.

Definition at line 304 of file DGVSurfacePlotVTK.h.

Pointer to volume array, used for animations.

Definition at line 342 of file DGVSurfacePlotVTK.h.

vtkWarpScalar* DGVSurfacePlotVTK::warp [protected]

Surface quantifier.

Definition at line 350 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::xLabelAct [protected]

Change x label.

Definition at line 320 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::yLabelAct [protected]

Change y label.

Definition at line 321 of file DGVSurfacePlotVTK.h.

QAction* DGVSurfacePlotVTK::zLabelAct [protected]

Change z label.

Definition at line 322 of file DGVSurfacePlotVTK.h.


The documentation for this class was generated from the following files: