DensityBase Class Reference

#include <densitybase.h>

List of all members.


Detailed Description

This class allows changing the representation of density isosurfaces.

It allows adding/deleting and changing the visual representation of isodensity surfaces. Up to 2 source densities can be loaded and combined (added/substracted). It provides the functionality for the DensityWidget class (base class).

Definition at line 40 of file densitybase.h.

Public Slots

void loadDensityA ()
 Loads the contents of a cube file for density A.
void loadDensityB ()
 Loads the contents of a cube file for density B.
void addSurface ()
 Generates a new surface with default parameters.
void addSurfacePair ()
 Generates 2 new surfaces with opposite sign.
void deleteSurface ()
 Deletes an existing surface. The currently selected surface will be removed.
void updateAll ()
 Updates all changes.

Signals

void newSurface (const unsigned int surface)
void updatedSurface (const unsigned int surface)
void deletedSurface (const unsigned int surface)
void redrawScene ()

Public Member Functions

 DensityBase (IsoSurface *surface, QWidget *parent=0, const char *name=0, bool modal=FALSE, WFlags fl=0)
 ~DensityBase ()
 The default destructor.
bool surfaceVisible (const unsigned int surface)
 Returns whether a surface is visible.
QColor surfaceColor (const unsigned int surface)
 Returns the color of a surface.
unsigned int surfaceOpacity (const unsigned int surface)
 Returns the opacity of a surface.
unsigned int surfaceType (const unsigned int surface)
 Returns the drawing type of a surface.

Protected Member Functions

void customEvent (QCustomEvent *e)
 Handles custom events originating from loadingThread.
void showEvent (QShowEvent *e)
 Restores the correct column width for the colour column after a hide/show cycle.
void hideEvent (QHideEvent *e)
 Saves the correct column width for the colour column before a hide/show cycle.

Private Types

enum  Columns {
  COLUMN_VISIBLE, COLUMN_ID, COLUMN_RGB, COLUMN_LEVEL,
  COLUMN_COLOUR, COLUMN_OPACITY, COLUMN_TYPE
}

Private Slots

void updateSliderLevel ()
 Updates SliderLevel with the contents of LineEditLevel.
void updateLineEditLevel ()
 Updates LineEditLevel with the contents of SliderLevel.
void updateListView ()
 Updates ListViewParameters with the contents of the settings.
void updateSettings ()
 Updates the settings with the contents of the currently selected item in ListViewParameters.
void updateVisibility (QListViewItem *item, const QPoint &, int column)
 Updates the visibility of a surface when a Checkbox is clicked.
void updateOperation (const unsigned int density=0)
 Updates the possible operations and the isoSurface.
void updateOpacity ()
 Updates LabelOpacity so its value corresponds with the position of SliderOpacity.

Private Member Functions

void makeConnections ()
 Sets up the permanent connections. Called once from the constructor.
void loadDensity (const bool densityA)
 Loads a new density into density A or B.
void updateDensity ()
 Updates everything after a new density is loaded.
void updateProgress (const unsigned int progress)
 Updates the progressbar of the currently loading density.
unsigned int typeToNum (const QString &type)
 Returns the number corresponding to a type string.
void enableWidgets ()
 Enables/disables all widgets depending on the current status of the class.
bool identicalGrids ()
 Returns true if the densities A and B are located on the same grid.

Private Attributes

IsoSurfaceisoSurface
 A pointer to the IsoSurface.
unsigned int idCounter
 A counter for uniquely identifying defined surfaces.
std::vector< SurfacePropertiessurfaceProperties
 A list of the properties of each defined surface.
DensityLoadThreadloadingThread
 A thread that does the actual reading of the density points from the cube file.
std::vector< double > densityPointsA
 An array holding the density values for Density A.
std::vector< double > densityPointsB
 An array holding the density values for Density B.
bool loadingDensityA
 Indicates which density is loading.
Point3D< float > originA
 Holds the coordinates of the origin of density A.
Point3D< float > originB
 Holds the coordinates of the origin of density B.
Point3D< unsigned int > numPointsA
 Holds the number of data points in each direction of density A.
Point3D< unsigned int > numPointsB
 Holds the number of data points in each direction of density B.
Point3D< float > deltaA
 Holds the cell lengths of density A.
Point3D< float > deltaB
 Holds the cell lengths of density B.
QString newDescription
 Holds the description of the contents of a new density.
int columnColourWidth
 Holds the right column width for the one containing the colour of the surface.

Static Private Attributes

static const double deltaLevel = 0.001
 The minimal change allowed in isoLevels.

Classes

struct  SurfaceProperties
 Contains the properties of a surface. More...


Member Enumeration Documentation

enum DensityBase::Columns [private]
 

Enumerator:
COLUMN_VISIBLE 
COLUMN_ID 
COLUMN_RGB 
COLUMN_LEVEL 
COLUMN_COLOUR 
COLUMN_OPACITY 
COLUMN_TYPE 

Definition at line 85 of file densitybase.h.


Constructor & Destructor Documentation

DensityBase::DensityBase IsoSurface surface,
QWidget *  parent = 0,
const char *  name = 0,
bool  modal = FALSE,
WFlags  fl = 0
 

Definition at line 70 of file densitybase.cpp.

DensityBase::~DensityBase  ) 
 

The default destructor.

Definition at line 91 of file densitybase.cpp.


Member Function Documentation

bool DensityBase::surfaceVisible const unsigned int  surface  ) 
 

Returns whether a surface is visible.

Definition at line 106 of file densitybase.cpp.

QColor DensityBase::surfaceColor const unsigned int  surface  ) 
 

Returns the color of a surface.

Definition at line 116 of file densitybase.cpp.

unsigned int DensityBase::surfaceOpacity const unsigned int  surface  ) 
 

Returns the opacity of a surface.

Definition at line 126 of file densitybase.cpp.

unsigned int DensityBase::surfaceType const unsigned int  surface  ) 
 

Returns the drawing type of a surface.

Definition at line 136 of file densitybase.cpp.

void DensityBase::newSurface const unsigned int  surface  )  [signal]
 

void DensityBase::updatedSurface const unsigned int  surface  )  [signal]
 

void DensityBase::deletedSurface const unsigned int  surface  )  [signal]
 

void DensityBase::redrawScene  )  [signal]
 

void DensityBase::loadDensityA  )  [slot]
 

Loads the contents of a cube file for density A.

Definition at line 150 of file densitybase.cpp.

void DensityBase::loadDensityB  )  [slot]
 

Loads the contents of a cube file for density B.

Definition at line 157 of file densitybase.cpp.

void DensityBase::addSurface  )  [slot]
 

Generates a new surface with default parameters.

Definition at line 164 of file densitybase.cpp.

void DensityBase::addSurfacePair  )  [slot]
 

Generates 2 new surfaces with opposite sign.

The parameters are not based on the currently selected surface.

Definition at line 194 of file densitybase.cpp.

void DensityBase::deleteSurface  )  [slot]
 

Deletes an existing surface. The currently selected surface will be removed.

Definition at line 264 of file densitybase.cpp.

void DensityBase::updateAll  )  [slot]
 

Updates all changes.

Definition at line 296 of file densitybase.cpp.

void DensityBase::customEvent QCustomEvent *  e  )  [protected]
 

Handles custom events originating from loadingThread.

Definition at line 389 of file densitybase.cpp.

void DensityBase::showEvent QShowEvent *  e  )  [protected]
 

Restores the correct column width for the colour column after a hide/show cycle.

Definition at line 401 of file densitybase.cpp.

void DensityBase::hideEvent QHideEvent *  e  )  [protected]
 

Saves the correct column width for the colour column before a hide/show cycle.

Definition at line 411 of file densitybase.cpp.

void DensityBase::updateSliderLevel  )  [private, slot]
 

Updates SliderLevel with the contents of LineEditLevel.

Definition at line 424 of file densitybase.cpp.

void DensityBase::updateLineEditLevel  )  [private, slot]
 

Updates LineEditLevel with the contents of SliderLevel.

Definition at line 437 of file densitybase.cpp.

void DensityBase::updateListView  )  [private, slot]
 

Updates ListViewParameters with the contents of the settings.

Definition at line 444 of file densitybase.cpp.

void DensityBase::updateSettings  )  [private, slot]
 

Updates the settings with the contents of the currently selected item in ListViewParameters.

Definition at line 472 of file densitybase.cpp.

void DensityBase::updateVisibility QListViewItem *  item,
const QPoint &  ,
int  column
[private, slot]
 

Updates the visibility of a surface when a Checkbox is clicked.

Definition at line 499 of file densitybase.cpp.

void DensityBase::updateOperation const unsigned int  op = 0  )  [private, slot]
 

Updates the possible operations and the isoSurface.

Possible values of op :

  • 0 : no density has changed, just the current item of ComboBoxOperation.
  • 1 : a new density was read into densityPointsA.
  • 2 : a new density was read into densityPointsB.

Definition at line 513 of file densitybase.cpp.

void DensityBase::updateOpacity  )  [private, slot]
 

Updates LabelOpacity so its value corresponds with the position of SliderOpacity.

Definition at line 732 of file densitybase.cpp.

void DensityBase::makeConnections  )  [private]
 

Sets up the permanent connections. Called once from the constructor.

Definition at line 747 of file densitybase.cpp.

void DensityBase::loadDensity const bool  densityA  )  [private]
 

Loads a new density into density A or B.

This depends on the value of densityA:

  • true : density A.
  • false : density B.

Definition at line 778 of file densitybase.cpp.

void DensityBase::updateDensity  )  [private]
 

Updates everything after a new density is loaded.

Definition at line 893 of file densitybase.cpp.

void DensityBase::updateProgress const unsigned int  progress  )  [private]
 

Updates the progressbar of the currently loading density.

Definition at line 940 of file densitybase.cpp.

unsigned int DensityBase::typeToNum const QString &  type  )  [private]
 

Returns the number corresponding to a type string.

Possible input strings:

  • Solid
  • Wireframe
  • Dots

Definition at line 950 of file densitybase.cpp.

void DensityBase::enableWidgets  )  [private]
 

Enables/disables all widgets depending on the current status of the class.

Definition at line 967 of file densitybase.cpp.

bool DensityBase::identicalGrids  )  [private]
 

Returns true if the densities A and B are located on the same grid.

If true these densities can be succesfully combined.

Definition at line 1026 of file densitybase.cpp.


Member Data Documentation

IsoSurface* DensityBase::isoSurface [private]
 

A pointer to the IsoSurface.

Definition at line 111 of file densitybase.h.

unsigned int DensityBase::idCounter [private]
 

A counter for uniquely identifying defined surfaces.

Definition at line 112 of file densitybase.h.

std::vector<SurfaceProperties> DensityBase::surfaceProperties [private]
 

A list of the properties of each defined surface.

Definition at line 113 of file densitybase.h.

DensityLoadThread* DensityBase::loadingThread [private]
 

A thread that does the actual reading of the density points from the cube file.

Definition at line 114 of file densitybase.h.

std::vector<double> DensityBase::densityPointsA [private]
 

An array holding the density values for Density A.

Definition at line 115 of file densitybase.h.

std::vector<double> DensityBase::densityPointsB [private]
 

An array holding the density values for Density B.

Definition at line 116 of file densitybase.h.

bool DensityBase::loadingDensityA [private]
 

Indicates which density is loading.

Definition at line 117 of file densitybase.h.

Point3D<float> DensityBase::originA [private]
 

Holds the coordinates of the origin of density A.

Definition at line 118 of file densitybase.h.

Point3D<float> DensityBase::originB [private]
 

Holds the coordinates of the origin of density B.

Definition at line 119 of file densitybase.h.

Point3D<unsigned int> DensityBase::numPointsA [private]
 

Holds the number of data points in each direction of density A.

Definition at line 120 of file densitybase.h.

Point3D<unsigned int> DensityBase::numPointsB [private]
 

Holds the number of data points in each direction of density B.

Definition at line 121 of file densitybase.h.

Point3D<float> DensityBase::deltaA [private]
 

Holds the cell lengths of density A.

Definition at line 122 of file densitybase.h.

Point3D<float> DensityBase::deltaB [private]
 

Holds the cell lengths of density B.

Definition at line 123 of file densitybase.h.

QString DensityBase::newDescription [private]
 

Holds the description of the contents of a new density.

Definition at line 124 of file densitybase.h.

int DensityBase::columnColourWidth [private]
 

Holds the right column width for the one containing the colour of the surface.

Definition at line 125 of file densitybase.h.

const double DensityBase::deltaLevel = 0.001 [static, private]
 

The minimal change allowed in isoLevels.

Definition at line 128 of file densitybase.h.


Generated on Fri May 19 14:31:57 2006 for Brabosphere by  doxygen 1.4.6-NO