00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00020
00021 #ifndef PLOTMAPLABEL_H
00022 #define PLOTMAPLABEL_H
00023
00025
00026
00027 #include <vector>
00028 using std::vector;
00029
00030
00031 #include <qcolor.h>
00032 class QPixmap;
00033 #include <qpointarray.h>
00034
00035
00036 #include "point3d.h"
00037
00038
00039 #include <qlabel.h>
00040
00042 class PlotMapLabel : public QLabel
00043 {
00044 public:
00046 PlotMapLabel(QWidget* parent, const char* name = 0, WFlags fl = 0);
00047 ~PlotMapLabel();
00048
00050 void setDrawStyle(const unsigned int style, const bool cubic);
00051 void setDensityPixmap(const QPixmap& pixmap);
00052 void setCrosses(const vector<Point3D<double> >& centers);
00053 void setGrid(const Point3D<unsigned int>& pointDimension, const Point3D<double>& pointDelta);
00054 void setIsoCurves(const vector< vector<Point3D<double> >* >& curves, const vector<QColor>& lineColors);
00055 void setPolygons(const vector< vector<Point3D<double> > >& polygons, const vector<QColor>& colors);
00056 void setColors(const QColor& zero, const QColor& atom);
00057 void startDrag(const QPoint& pos);
00058 void moveDrag(const QPoint& pos);
00059 void endDrag();
00060
00061 protected:
00063 virtual void drawContents(QPainter* p);
00064
00065 private:
00067 QPointArray pointCurve(const vector<Point3D<double> >& curve, const bool cubicInterpolation, const double scaleX, const double scaleY, const unsigned int numInterpolated = 0);
00068 QPointArray cardinalSpline(const Point3D<double>& controlPoint1, const Point3D<double>& startPoint, const Point3D<double>& endPoint, const Point3D<double>& controlPoint2, const unsigned int numInterpolated);
00069
00071 QPixmap* densityPixmap;
00072 vector<Point3D<double> > crosses;
00073 Point3D<unsigned int> numPoints;
00074 Point3D<double> delta;
00075 QPoint startPosition;
00076 QPoint endPosition;
00077 bool drawDrag;
00078 vector< vector<Point3D<double> >* > isoCurves;
00079
00080 vector<QColor> isoLineColors;
00081 QColor crossColor;
00082 QColor zeroColor;
00083 unsigned int drawStyle;
00084 bool cubicInterpolation;
00085 vector< vector<Point3D<double> > > isoPolygons;
00086 vector<QColor> isoPolygonColors;
00087 };
00088
00089 #endif
00090