#include <plotmapbase.h>
It's a replacement for spfmap with added analysis possibilities. This class provides the functionality for PlotMapWidget. The actual rendering is done in PlotMapLabel. The optionwidgets are provided by PlotMapExtensionWidget.
Definition at line 45 of file plotmapbase.h.
Public Slots | |
bool | loadMapFile () |
Tries to load a map file. | |
Signals | |
void | optionsChanged () |
Public Member Functions | |
PlotMapBase (QWidget *parent=0, const char *name=0, bool modal=FALSE, WFlags fl=0) | |
~PlotMapBase () | |
The default destructor. | |
bool | loadMapFile (const QString filename, const bool noerrors=false) |
Tries to load a map file with the specified name. | |
Protected Member Functions | |
void | mousePressEvent (QMouseEvent *e) |
Overridden from PlotMapWidget::mousePressEvent. Initiates mousedrags. | |
void | mouseReleaseEvent (QMouseEvent *e) |
Overridden from PlotMapWidget::mouseReleaseEvent. | |
void | mouseMoveEvent (QMouseEvent *e) |
Overridden from PlotMapWidget::mouseMoveEvent. | |
Private Slots | |
void | saveImage () |
Saves the image to a file. | |
void | showOptions () |
Shows the options widget. | |
void | applyOptions () |
Applies the options to the image. | |
void | autoApply (bool state) |
Turns automatic application of options on/off. | |
void | resetOptions () |
Resets the options to their defaults. | |
Private Member Functions | |
void | makeConnections () |
Sets up all permanent connections. Called once from the constructor. | |
void | init () |
Initializes the dialog. Called once from the constructor. | |
void | updateImage () |
Regenerates the image depending on the options. | |
void | updatePixmap () |
Regenerates the pixmap from density values depending on the options. | |
void | updateCrosses () |
Updates which atoms are displayed as crosses. | |
void | updateIsoLines () |
Updates the list of points with isodensity values. | |
QColor | plotColor (const QColor foregroundColor, const QColor backgroundColor, const double opaqueness) |
Returns a color calculated as the foregroundColor with an opaqueness against the backgroundColor. | |
bool | onPixmap (const QPoint position) |
Returns true if position is on the actual drawing area. | |
QPoint | mapToImage (const QPoint position) |
Returns the pixel position in the image corresponding to the point position on the widget. | |
Point3D< double > | interpolate2D (const Point3D< double > &point1, const Point3D< double > &point2, const double density1, const double density2, const double isoLevel) |
Calculates the interpolated point in 2D between point1 and point2 with density values of density1 and density2 respectively. | |
bool | hasPoint (const unsigned int segment, const unsigned int level, const vector< map< unsigned int, unsigned int > * > &segmentMaps) |
Returns true if segment has a Point3D for isoLevel index level. | |
Point3D< double > | getPoint (const unsigned int segment, const unsigned int level, const vector< map< unsigned int, unsigned int > * > &segmentMaps, const vector< vector< Point3D< double > > * > &segments) |
Returns the Point3D corresponding to the segment for isoLevel index level . | |
void | startSearch (const unsigned int segment, const unsigned int level, const bool circular, const vector< map< unsigned int, unsigned int > * > &segmentMaps, vector< bool > &segmentVisited, const vector< vector< Point3D< double > > * > &segments) |
Starts a search for an isoline. | |
bool | getNeighbours (const unsigned int currentSegment, const unsigned int previousSegment, unsigned int &segment1, unsigned int &segment2, unsigned int &segment3) |
Returns the neighbours of currentSegment not from the cell containing previousSegment. | |
bool | isHorizontal (const unsigned int segment) |
Returns true if a segment is positioned horizontally. | |
void | continuePolygon (const unsigned int startCurve, const unsigned int endCurve, unsigned int currentCurve, vector< Point3D< double > > &isoPolygon, vector< bool > &curveAdded, const Point3D< double > &startPoint, const bool fromStart, const double isoLevel) |
Recursively adds edge-curves to form a polygon. | |
void | nextPolygonCCWT (const unsigned int startCurve, const unsigned int endCurve, vector< Point3D< double > > &isoPolygon, vector< bool > &curveAdded, const Point3D< double > &startPoint, const Point3D< double > &refPoint, const double isoLevel) |
Find the next curve in a counterclockwise direction on the top row. | |
void | nextPolygonCWT (const unsigned int startCurve, const unsigned int endCurve, vector< Point3D< double > > &isoPolygon, vector< bool > &curveAdded, const Point3D< double > &startPoint, const Point3D< double > &refPoint, const double isoLevel) |
Find the next curve in a clockwise direction on the top row. | |
void | nextPolygonCCWR (const unsigned int startCurve, const unsigned int endCurve, vector< Point3D< double > > &isoPolygon, vector< bool > &curveAdded, const Point3D< double > &startPoint, const Point3D< double > &refPoint, const double isoLevel) |
Find the next curve in a counterclockwise direction on the rightmost column. | |
void | nextPolygonCWR (const unsigned int startCurve, const unsigned int endCurve, vector< Point3D< double > > &isoPolygon, vector< bool > &curveAdded, const Point3D< double > &startPoint, const Point3D< double > &refPoint, const double isoLevel) |
Find the next curve in a clockwise direction on the rightmost column. | |
void | nextPolygonCCWB (const unsigned int startCurve, const unsigned int endCurve, vector< Point3D< double > > &isoPolygon, vector< bool > &curveAdded, const Point3D< double > &startPoint, const Point3D< double > &refPoint, const double isoLevel) |
Find the next curve in a counterclockwise direction on the bottom row. | |
void | nextPolygonCWB (const unsigned int startCurve, const unsigned int endCurve, vector< Point3D< double > > &isoPolygon, vector< bool > &curveAdded, const Point3D< double > &startPoint, const Point3D< double > &refPoint, const double isoLevel) |
Find the next curve in a clockwise direction on the bottom row. | |
void | nextPolygonCCWL (const unsigned int startCurve, const unsigned int endCurve, vector< Point3D< double > > &isoPolygon, vector< bool > &curveAdded, const Point3D< double > &startPoint, const Point3D< double > &refPoint, const double isoLevel) |
Find the next curve in a counterclockwise direction on the leftmost column. | |
void | nextPolygonCWL (const unsigned int startCurve, const unsigned int endCurve, vector< Point3D< double > > &isoPolygon, vector< bool > &curveAdded, const Point3D< double > &startPoint, const Point3D< double > &refPoint, const double isoLevel) |
Find the next curve in a clockwise direction on the leftmost column. | |
QRect | labelRect () const |
Returns the inner geometry of plotLabel with respect to the widget with a provision for the aspect ratio. | |
template<typename T> | |
void | limitRange (const T &min, T &value, const T &max) |
Limits the value between min and max. | |
Private Attributes | |
Point3D< unsigned int > | numPoints |
The number of grid points in 2 directions. | |
unsigned int | numAtoms |
The number of atoms. | |
vector< vector< double > > | points |
The values of the grid points: points[numPointsY][NumPointsX]. | |
vector< Point3D< double > > | coords |
The coordinates of the atoms. | |
PlotMapExtensionWidget * | options |
The widget that allows changing the options. | |
QPoint | mousePosition |
Holds the start position of a mouse drag. | |
PlotMapLabel * | plotLabel |
Shows the resulting map. | |
bool | loadInProgress |
Is set to true if the points array is being updated. | |
Point3D< double > | origin |
Point3D< double > | delta |
The origin and cell size for the 3D grid. | |
double | maxValue |
double | minValue |
The maximum and minimum values of the grid. | |
vector< vector< Point3D< double > > * > | isoCurves |
A data structure containing all isodensity curves. | |
vector< QColor > | isoCurveColors |
A vector containing the color of each curve. | |
Static Private Attributes | |
static const double | AUTOANG = 1.0/1.889726342 |
Conversion factor atomic units -> angstrom. |
|
Definition at line 75 of file plotmapbase.cpp. |
|
The default destructor.
Definition at line 104 of file plotmapbase.cpp. |
|
Tries to load a map file with the specified name. If noerrors = true, no error-messages will be shown. Definition at line 111 of file plotmapbase.cpp. |
|
Tries to load a map file.
Definition at line 253 of file plotmapbase.cpp. |
|
|
|
Overridden from PlotMapWidget::mousePressEvent. Initiates mousedrags.
Definition at line 270 of file plotmapbase.cpp. |
|
Overridden from PlotMapWidget::mouseReleaseEvent. Handles mousedrags and shows statistics for the selected box. Definition at line 279 of file plotmapbase.cpp. |
|
Overridden from PlotMapWidget::mouseMoveEvent. Handles mousedrags in progress and updates statistics. Definition at line 364 of file plotmapbase.cpp. |
|
Saves the image to a file.
Definition at line 421 of file plotmapbase.cpp. |
|
Shows the options widget.
Definition at line 469 of file plotmapbase.cpp. |
|
Applies the options to the image.
Definition at line 492 of file plotmapbase.cpp. |
|
Turns automatic application of options on/off.
Definition at line 499 of file plotmapbase.cpp. |
|
Resets the options to their defaults.
Definition at line 512 of file plotmapbase.cpp. |
|
Sets up all permanent connections. Called once from the constructor.
Definition at line 541 of file plotmapbase.cpp. |
|
Initializes the dialog. Called once from the constructor.
Definition at line 572 of file plotmapbase.cpp. |
|
Regenerates the image depending on the options.
Definition at line 581 of file plotmapbase.cpp. |
|
Regenerates the pixmap from density values depending on the options.
Definition at line 600 of file plotmapbase.cpp. |
|
Updates which atoms are displayed as crosses.
Definition at line 651 of file plotmapbase.cpp. |
|
Updates the list of points with isodensity values. These points are calculated using a procedure related to the Marching Squares but without lookup tables. Two sets of curves are produced: one set used for isolines (one curve for each line) and one set used for polygons (one curve for each isolevel). Points are ordered so the lines can be drawn with drawPolyLine or drawPolygon. Definition at line 676 of file plotmapbase.cpp. |
|
Returns a color calculated as the foregroundColor with an opaqueness against the backgroundColor.
Definition at line 902 of file plotmapbase.cpp. |
|
Returns true if position is on the actual drawing area.
Definition at line 942 of file plotmapbase.cpp. |
|
Returns the pixel position in the image corresponding to the point position on the widget.
Definition at line 960 of file plotmapbase.cpp. |
|
Calculates the interpolated point in 2D between point1 and point2 with density values of density1 and density2 respectively. The target density is isoLevel. Definition at line 977 of file plotmapbase.cpp. |
|
Returns true if segment has a Point3D for isoLevel index level.
Definition at line 1010 of file plotmapbase.cpp. |
|
Returns the Point3D corresponding to the segment for isoLevel index
Definition at line 1019 of file plotmapbase.cpp. |
|
Starts a search for an isoline.
Definition at line 1039 of file plotmapbase.cpp. |
|
Returns the neighbours of currentSegment not from the cell containing previousSegment.
Definition at line 1180 of file plotmapbase.cpp. |
|
Returns true if a segment is positioned horizontally.
Definition at line 1296 of file plotmapbase.cpp. |
|
Recursively adds edge-curves to form a polygon.
Definition at line 1310 of file plotmapbase.cpp. |
|
Find the next curve in a counterclockwise direction on the top row.
Definition at line 1398 of file plotmapbase.cpp. |
|
Find the next curve in a clockwise direction on the top row.
Definition at line 1481 of file plotmapbase.cpp. |
|
Find the next curve in a counterclockwise direction on the rightmost column.
Definition at line 1564 of file plotmapbase.cpp. |
|
Find the next curve in a clockwise direction on the rightmost column.
Definition at line 1650 of file plotmapbase.cpp. |
|
Find the next curve in a counterclockwise direction on the bottom row.
Definition at line 1733 of file plotmapbase.cpp. |
|
Find the next curve in a clockwise direction on the bottom row.
Definition at line 1816 of file plotmapbase.cpp. |
|
Find the next curve in a counterclockwise direction on the leftmost column.
Definition at line 1899 of file plotmapbase.cpp. |
|
Find the next curve in a clockwise direction on the leftmost column.
Definition at line 1987 of file plotmapbase.cpp. |
|
Returns the inner geometry of plotLabel with respect to the widget with a provision for the aspect ratio. THe returned QRect is thus the actual drawing area. Definition at line 2070 of file plotmapbase.cpp. |
|
Limits the value between min and max.
Definition at line 2090 of file plotmapbase.cpp. |
|
The number of grid points in 2 directions.
Definition at line 104 of file plotmapbase.h. |
|
The number of atoms.
Definition at line 105 of file plotmapbase.h. |
|
The values of the grid points: points[numPointsY][NumPointsX].
Definition at line 106 of file plotmapbase.h. |
|
The coordinates of the atoms.
Definition at line 107 of file plotmapbase.h. |
|
The widget that allows changing the options.
Definition at line 108 of file plotmapbase.h. |
|
Holds the start position of a mouse drag.
Definition at line 109 of file plotmapbase.h. |
|
Shows the resulting map.
Definition at line 110 of file plotmapbase.h. |
|
Is set to true if the points array is being updated.
Definition at line 111 of file plotmapbase.h. |
|
Definition at line 112 of file plotmapbase.h. |
|
The origin and cell size for the 3D grid.
Definition at line 112 of file plotmapbase.h. |
|
Definition at line 113 of file plotmapbase.h. |
|
The maximum and minimum values of the grid.
Definition at line 113 of file plotmapbase.h. |
|
A data structure containing all isodensity curves.
Definition at line 114 of file plotmapbase.h. |
|
A vector containing the color of each curve.
Definition at line 115 of file plotmapbase.h. |
|
Conversion factor atomic units -> angstrom.
Definition at line 118 of file plotmapbase.h. |