PlotMapLabel Class Reference

#include <plotmaplabel.h>

List of all members.


Detailed Description

This class does the drawing of a 2D density map including isodensity lines.

The input is provided by a parent PlotMapBase class.

Definition at line 42 of file plotmaplabel.h.

Public Member Functions

 PlotMapLabel (QWidget *parent, const char *name=0, WFlags fl=0)
 ~PlotMapLabel ()
 The default destructor.
void setDrawStyle (const unsigned int style, const bool cubic)
 Sets the draw style.
void setDensityPixmap (const QPixmap &pixmap)
 Sets the pixmap containing the raw density values.
void setCrosses (const vector< Point3D< double > > &centers)
 Sets the list of positions of the atoms to be drawn as crosses.
void setGrid (const Point3D< unsigned int > &pointDimension, const Point3D< double > &pointDelta)
 Sets the parameters for the source density to be used as a reference while scaling.
void setIsoCurves (const vector< vector< Point3D< double > > * > &curves, const vector< QColor > &lineColors)
 Sets the isocurves to be drawn.
void setPolygons (const vector< vector< Point3D< double > > > &polygons, const vector< QColor > &colors)
 Sets the polygons to be drawn.
void setColors (const QColor &zero, const QColor &atom)
 Sets the primary drawing colors.
void startDrag (const QPoint &pos)
 Sets the starting position for a drag.
void moveDrag (const QPoint &pos)
 Sets the ending position for a drag.
void endDrag ()
 Signals dragging has ended .

Protected Member Functions

virtual void drawContents (QPainter *p)
 Reimplemented from QLabel::drawContents.

Private Member Functions

QPointArray pointCurve (const vector< Point3D< double > > &curve, const bool cubicInterpolation, const double scaleX, const double scaleY, const unsigned int numInterpolated=0)
 Calculates the points of the specified isodensity curve.
QPointArray cardinalSpline (const Point3D< double > &controlPoint1, const Point3D< double > &startPoint, const Point3D< double > &endPoint, const Point3D< double > &controlPoint2, const unsigned int numInterpolated)
 Calculates the points for a cardinal spline defined by the 4 given points (2D only).

Private Attributes

QPixmap * densityPixmap
 A local copy of the pixmap containing density values.
vector< Point3D< double > > crosses
 The atomic positions to be drawn as crosses.
Point3D< unsigned int > numPoints
 A Point3D containing the number of points in 2 directions.
Point3D< double > delta
 A Point3D containing the cell lengths in 2 directions.
QPoint startPosition
 Starting position for a mousedrag rectangle.
QPoint endPosition
 Ending position for a mousedrag rectangle.
bool drawDrag
 = true if a dragging rectangle should be drawn.
vector< vector< Point3D< double > > * > isoCurves
 Contains the data for drawing the isolines.
vector< QColor > isoLineColors
 Contains the color of each isoline.
QColor crossColor
 The color the crosses should be drawn in.
QColor zeroColor
 The background color.
unsigned int drawStyle
 The drawing style.
bool cubicInterpolation
 Interpolation type. Linear or cubic interpolation.
vector< vector< Point3D< double > > > isoPolygons
 Contains the data for drawing the polygons.
vector< QColor > isoPolygonColors
 Contains the color of each polygon.


Constructor & Destructor Documentation

PlotMapLabel::PlotMapLabel QWidget *  parent,
const char *  name = 0,
WFlags  fl = 0
 

Definition at line 42 of file plotmaplabel.cpp.

PlotMapLabel::~PlotMapLabel  ) 
 

The default destructor.

Definition at line 50 of file plotmaplabel.cpp.


Member Function Documentation

void PlotMapLabel::setDrawStyle const unsigned int  style,
const bool  cubic
 

Sets the draw style.

Possible values for style are:

  • 0 : raw values
  • 1 : isolines
  • 2 : polygons
  • 3 : isolines and polygons

Definition at line 58 of file plotmaplabel.cpp.

void PlotMapLabel::setDensityPixmap const QPixmap &  pixmap  ) 
 

Sets the pixmap containing the raw density values.

Definition at line 73 of file plotmaplabel.cpp.

void PlotMapLabel::setCrosses const vector< Point3D< double > > &  centers  ) 
 

Sets the list of positions of the atoms to be drawn as crosses.

Definition at line 83 of file plotmaplabel.cpp.

void PlotMapLabel::setGrid const Point3D< unsigned int > &  pointDimension,
const Point3D< double > &  pointDelta
 

Sets the parameters for the source density to be used as a reference while scaling.

These include the number of gridpoints in each direction and the cell size.

Definition at line 95 of file plotmaplabel.cpp.

void PlotMapLabel::setIsoCurves const vector< vector< Point3D< double > > * > &  curves,
const vector< QColor > &  lineColors
 

Sets the isocurves to be drawn.

Definition at line 105 of file plotmaplabel.cpp.

void PlotMapLabel::setPolygons const vector< vector< Point3D< double > > > &  polygons,
const vector< QColor > &  colors
 

Sets the polygons to be drawn.

Definition at line 122 of file plotmaplabel.cpp.

void PlotMapLabel::setColors const QColor &  zero,
const QColor &  atom
 

Sets the primary drawing colors.

Definition at line 143 of file plotmaplabel.cpp.

void PlotMapLabel::startDrag const QPoint &  pos  ) 
 

Sets the starting position for a drag.

Definition at line 151 of file plotmaplabel.cpp.

void PlotMapLabel::moveDrag const QPoint &  pos  ) 
 

Sets the ending position for a drag.

Definition at line 164 of file plotmaplabel.cpp.

void PlotMapLabel::endDrag  ) 
 

Signals dragging has ended .

Definition at line 175 of file plotmaplabel.cpp.

void PlotMapLabel::drawContents QPainter *  p  )  [protected, virtual]
 

Reimplemented from QLabel::drawContents.

Does the actual drawing of the density points, isolines, polygons, crosses and selection box.

Definition at line 187 of file plotmaplabel.cpp.

QPointArray PlotMapLabel::pointCurve const vector< Point3D< double > > &  curve,
const bool  cubicInterpolation,
const double  scaleX,
const double  scaleY,
const unsigned int  numInterpolated = 0
[private]
 

Calculates the points of the specified isodensity curve.

Curves can either be linearly or cubically interpolated.

Definition at line 410 of file plotmaplabel.cpp.

QPointArray PlotMapLabel::cardinalSpline const Point3D< double > &  controlPoint1,
const Point3D< double > &  startPoint,
const Point3D< double > &  endPoint,
const Point3D< double > &  controlPoint2,
const unsigned int  numInterpolated
[private]
 

Calculates the points for a cardinal spline defined by the 4 given points (2D only).

The hardcoded constant t can be changed to use different types of Catmull-Rom splines.

Definition at line 481 of file plotmaplabel.cpp.


Member Data Documentation

QPixmap* PlotMapLabel::densityPixmap [private]
 

A local copy of the pixmap containing density values.

Definition at line 71 of file plotmaplabel.h.

vector<Point3D<double> > PlotMapLabel::crosses [private]
 

The atomic positions to be drawn as crosses.

Definition at line 72 of file plotmaplabel.h.

Point3D<unsigned int> PlotMapLabel::numPoints [private]
 

A Point3D containing the number of points in 2 directions.

Definition at line 73 of file plotmaplabel.h.

Point3D<double> PlotMapLabel::delta [private]
 

A Point3D containing the cell lengths in 2 directions.

Definition at line 74 of file plotmaplabel.h.

QPoint PlotMapLabel::startPosition [private]
 

Starting position for a mousedrag rectangle.

Definition at line 75 of file plotmaplabel.h.

QPoint PlotMapLabel::endPosition [private]
 

Ending position for a mousedrag rectangle.

Definition at line 76 of file plotmaplabel.h.

bool PlotMapLabel::drawDrag [private]
 

= true if a dragging rectangle should be drawn.

Definition at line 77 of file plotmaplabel.h.

vector< vector<Point3D<double> >* > PlotMapLabel::isoCurves [private]
 

Contains the data for drawing the isolines.

Definition at line 78 of file plotmaplabel.h.

vector<QColor> PlotMapLabel::isoLineColors [private]
 

Contains the color of each isoline.

Definition at line 80 of file plotmaplabel.h.

QColor PlotMapLabel::crossColor [private]
 

The color the crosses should be drawn in.

Definition at line 81 of file plotmaplabel.h.

QColor PlotMapLabel::zeroColor [private]
 

The background color.

Definition at line 82 of file plotmaplabel.h.

unsigned int PlotMapLabel::drawStyle [private]
 

The drawing style.

Definition at line 83 of file plotmaplabel.h.

bool PlotMapLabel::cubicInterpolation [private]
 

Interpolation type. Linear or cubic interpolation.

Definition at line 84 of file plotmaplabel.h.

vector< vector<Point3D<double> > > PlotMapLabel::isoPolygons [private]
 

Contains the data for drawing the polygons.

Definition at line 85 of file plotmaplabel.h.

vector<QColor> PlotMapLabel::isoPolygonColors [private]
 

Contains the color of each polygon.

Definition at line 86 of file plotmaplabel.h.


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