32 #include <qwt3d_curve.h>
33 #include <qwt3d_surfaceplot.h>
34 #include <qwt3d_function.h>
35 #include <qwt3d_parametricsurface.h>
45 using namespace Qwt3D;
70 enum PlotType{NoTable = -1, Scatter = 0, Trajectory = 1, Bars = 2, Ribbon = 3};
71 enum PointStyle{None = 0, Dots = 1, VerticalBars = 2, HairCross = 3, Cones = 4};
88 void addFunction(
const QString& s,
double xl,
double xr,
double yl,
89 double yr,
double zl,
double zr,
int columns = 40,
int rows = 30);
90 void addParametricSurface(
const QString& xFormula,
const QString& yFormula,
91 const QString& zFormula,
double ul,
double ur,
double vl,
double vr,
92 int columns,
int rows,
bool uPeriodic,
bool vPeriodic);
93 void insertNewData(
Table* table,
const QString& colName);
96 void addMatrixData(
Matrix* m);
97 void addMatrixData(
Matrix* m,
double xl,
double xr,
double yl,
double yr,
double zl,
double zr);
98 void updateMatrixData(
Matrix* m);
100 void addRibbon(
Table* table,
const QString& xColName,
const QString& yColName);
101 void addRibbon(
Table* table,
const QString& xColName,
const QString& yColName,
102 double xl,
double xr,
double yl,
double yr,
double zl,
double zr);
103 void addData(
Table* table,
int xCol,
int yCol,
int zCol,
int type = 0);
104 void loadData(
Table* table,
int xCol,
int yCol,
int zCol,
105 double xl=0.0,
double xr=0.0,
double yl=0.0,
double yr=0.0,
double zl=0.0,
double zr=0.0,
int axis = -1);
112 void updateData(
Table* table);
113 void updateDataXY(
Table* table,
int xCol,
int yCol);
115 void changeDataColumn(
Table* table,
const QString& colName,
int type = 0);
130 void dropEvent(QDropEvent*);
131 void dragEnterEvent(QDragEnterEvent*);
132 bool eventFilter(QObject *
object, QEvent *e);
133 void resizeEvent (QResizeEvent *);
134 void scaleFonts(
double factor);
147 void setAxesLabels(
const QStringList& lst);
148 void resetAxesLabels();
150 void setXAxisLabel(
const QString&);
151 void setYAxisLabel(
const QString&);
152 void setZAxisLabel(
const QString&);
154 QFont xAxisLabelFont();
155 QFont yAxisLabelFont();
156 QFont zAxisLabelFont();
158 void setXAxisLabelFont(
const QFont& fnt);
159 void setYAxisLabelFont(
const QFont& fnt);
160 void setZAxisLabelFont(
const QFont& fnt);
162 void setXAxisLabelFont(
const QStringList& lst);
163 void setYAxisLabelFont(
const QStringList& lst);
164 void setZAxisLabelFont(
const QStringList& lst);
167 void setNumbersFont(
const QFont& font);
177 void setAxisType(
int axis,
int type);
179 int axisNumericFormat(
int axis);
180 int axisNumericPrecision(
int axis);
181 void setAxisNumericFormat(
int axis,
int format,
int precision);
183 void setScales(
double xl,
double xr,
double yl,
double yr,
double zl,
double zr,
int axis = -1);
184 void updateScales(
double xl,
double xr,
double yl,
double yr,
185 double zl,
double zr,
int xcol,
int ycol);
186 void updateScalesFromMatrix(
double xl,
double xr,
double yl,
double yr,
double zl,
double zr);
188 QStringList scaleTicks();
189 void setTicks(
const QStringList& options);
191 void setXAxisTickLength(
double majorLength,
double minorLength);
192 void setYAxisTickLength(
double majorLength,
double minorLength);
193 void setZAxisTickLength(
double majorLength,
double minorLength);
195 void setAxisTickLength(
int axis,
double majorLength,
double minorLength);
196 void setLabelsDistance(
int val);
199 QStringList axisTickLengths();
200 void setTickLengths(
const QStringList& lst);
205 void setPolygonStyle();
206 void setHiddenLineStyle();
207 void setWireframeStyle();
208 void setFilledMeshStyle();
212 void setFloorIsolines();
213 void setEmptyFloor();
215 void setMeshLineWidth(
double lw);
216 double meshLineWidth(){
if (d_active_curve)
return d_active_curve->meshLineWidth();
return 0.0;};
222 void setGrid(
int s,
bool b);
223 void setGrid(
int grids);
225 void setLeftGrid(
bool b =
true);
226 void setRightGrid(
bool b =
true);
227 void setCeilGrid(
bool b =
true);
228 void setFloorGrid(
bool b =
true);
229 void setFrontGrid(
bool b =
true);
230 void setBackGrid(
bool b =
true);
233 void setStyle(
const QStringList& st);
234 void customPlotStyle(
int style);
235 void resetNonEmptyStyle();
237 void setRotation(
double xVal,
double yVal,
double zVal);
238 void setScale(
double xVal,
double yVal,
double zVal);
239 void setShift(
double xVal,
double yVal,
double zVal);
253 double zoom(){
return sp->zoom();};
254 void setZoom(
double val);
256 Qwt3D::PLOTSTYLE plotStyle();
257 Qwt3D::FLOORSTYLE floorStyle();
258 Qwt3D::COORDSTYLE coordStyle();
261 void print(QPrinter *printer);
263 #if QT_VERSION >= 0x040500
264 void exportImage(QTextDocument *document,
int quality,
bool transparent,
265 int dpi,
const QSizeF& customSize,
int unit,
double fontsFactor);
267 QPixmap pixmap(
int dpi = 0,
const QSizeF& customSize = QSizeF(),
int unit =
FrameWidget::Pixel,
double fontsFactor = 1.0);
268 void exportImage(
const QString& fileName,
int quality = 100,
bool transparent =
false,
int dpi = 0,
269 const QSizeF& customSize = QSizeF(),
int unit =
FrameWidget::Pixel,
double fontsFactor = 1.0,
int compression = 0);
270 void exportPDF(
const QString& fileName);
271 void exportVector(
const QString& fileName,
int textExportMode = 0,
int sortMode = 1,
272 const QSizeF& customSize = QSizeF(),
int unit =
FrameWidget::Pixel,
double fontsFactor = 1.0);
273 void exportToFile(
const QString& fileName);
275 void save(
const QString& fn,
const QString& geometry,
bool =
false);
277 void zoomChanged(
double);
278 void rotationChanged(
double,
double,
double);
279 void scaleChanged(
double,
double,
double);
280 void shiftChanged(
double,
double,
double);
286 void setDataColorMap(
const QString& fileName);
287 void setDataColorMap(
const ColorVector& colors);
288 void setDataColorMap(
const ColorVector& colors,
const LinearColorMap& colorMap);
290 void changeTransparency(
double t);
291 void setTransparency(
double t);
305 static bool openColorMapFile(ColorVector& cv, QString fname);
307 void setMeshColor(
const QColor&);
308 void setAxesColor(
const QColor&);
309 void setNumbersColor(
const QColor&);
310 void setLabelsColor(
const QColor&);
311 void setBackgroundColor(
const QColor&);
312 void setGridColor(
const QColor&);
318 void setTitleFont(
const QFont& font);
321 void setTitle(
const QStringList& lst);
322 void setTitle(
const QString& s,
const QColor& color = QColor(Qt::black),
const QFont& font = QFont());
327 void setResolution(
int r);
328 int resolution(){
if (d_active_curve)
return d_active_curve->resolution();
return 0;};
333 void showColorLegend(
bool show =
true);
337 void setOptions(
bool legend,
int r,
int dist);
338 void setOptions(
const QStringList& lst);
344 void setBarRadius(
double rad);
346 void setBarLines(
bool lines =
true);
348 void setFilledBars(
bool filled =
true);
355 void setDotOptions(
double size,
bool smooth);
361 void setCrossOptions(
double rad,
double linewidth,
bool smooth,
bool boxed);
362 void setCrossStyle();
366 void setConeOptions(
double rad,
int quality);
373 void showWorksheet();
376 void setAntialiasing(
bool smooth =
true);
377 bool antialiasing(){
if (d_active_curve)
return d_active_curve->smoothDataMesh();
return false;};
381 void animate(
bool on =
true);
384 void findBestLayout();
390 void setScale(
int axis,
double start,
double end,
int majorTicks,
int minorTicks, Qwt3D::SCALETYPE type);
393 void showOptionsDialog();
397 void addHiddenConstantCurve(
double xl,
double xr,
double yl,
double yr,
double zl,
double zr);
398 void changeScales(
double xl,
double xr,
double yl,
double yr,
double zl,
double zr);
403 void resetAxesType();
417 QColor axesCol, labelsCol,
titleCol, meshCol, bgCol, numCol, gridCol;
453 double operator()(
double x,
double y);
462 double operator()(
double x,
double y);
463 QString
function(){
return formula;};
465 unsigned int rows(){
return d_rows;};
467 void setMesh (
unsigned int columns,
unsigned int rows);
479 const QString& zFormula, Qwt3D::Curve *pw);
480 Triple operator()(
double u,
double v);
482 unsigned int rows(){
return d_rows;};
484 void setMesh (
unsigned int columns,
unsigned int rows);
488 void setPeriodic (
bool u,
bool v);
494 void setDomain(
double ul,
double ur,
double vl,
double vr);
501 QString d_x_formula, d_y_formula, d_z_formula;