4#include <QOpenGLWidget>
6#include "qwt3d_coordsys.h"
7#include "qwt3d_enrichment_std.h"
8#include "qwt3d_theme.h"
21class QWT3D_EXPORT
Plot3D :
public QOpenGLWidget
27 Plot3D(QWidget* parent =
nullptr);
32 QPixmap renderPixmap(
int w = 0,
int h = 0,
bool useContext =
false);
43 double xRotation()
const;
45 double yRotation()
const;
47 double zRotation()
const;
50 double xShift()
const;
52 double yShift()
const;
54 double zShift()
const;
57 double xViewportShift()
const;
59 double yViewportShift()
const;
62 double xScale()
const;
64 double yScale()
const;
66 double zScale()
const;
74 void setPlotStyle(Qwt3D::PLOTSTYLE val);
78 Qwt3D::PLOTSTYLE plotStyle()
const;
82 void setShading(Qwt3D::SHADINGSTYLE val);
84 Qwt3D::SHADINGSTYLE shading()
const;
86 void setIsolines(
int isolines);
91 void setSmoothMesh(
bool val);
93 bool smoothDataMesh()
const;
103 void setMeshLineWidth(
double lw);
105 double meshLineWidth()
const;
107 void setDataColor(
Color* col);
109 const Color* dataColor()
const;
120 void showColorLegend(
bool);
123 void setCoordinateStyle(Qwt3D::COORDSTYLE st);
125 void setPolygonOffset(
double d);
127 double polygonOffset()
const;
130 void setTitlePosition(
double rely,
double relx = 0.5, Qwt3D::ANCHOR = Qwt3D::TopCenter);
132 void setTitleFont(
const QString& family,
int pointSize,
int weight = QFont::Normal,
bool italic =
false);
136 void setTitle(
const QString& title);
144 void applyTheme(Qwt3DTheme::Preset preset);
146 void applyTheme(
const QString& presetName);
160 bool mouseEnabled()
const;
182 bool keyboardEnabled()
const;
184 void setKeySpeed(
double rot,
double scale,
double shift);
186 void keySpeed(
double& rot,
double& scale,
double& shift)
const;
189 bool lightingEnabled()
const;
191 void illuminate(
unsigned light = 0);
193 void blowout(
unsigned light = 0);
196 void setMaterialComponent(GLenum property,
double r,
double g,
double b,
double a = 1.0);
198 void setMaterialComponent(GLenum property,
double intensity);
200 void setShininess(
double exponent);
202 void setLightComponent(GLenum property,
double r,
double g,
double b,
double a = 1.0,
unsigned light = 0);
204 void setLightComponent(GLenum property,
double intensity,
unsigned light = 0);
207 double xLightRotation(
unsigned idx = 0)
const;
209 double yLightRotation(
unsigned idx = 0)
const;
211 double zLightRotation(
unsigned idx = 0)
const;
214 double xLightShift(
unsigned idx = 0)
const;
216 double yLightShift(
unsigned idx = 0)
const;
218 double zLightShift(
unsigned idx = 0)
const;
220 bool hasData()
const;
270 void setRotation(
double xVal,
double yVal,
double zVal);
272 void setShift(
double xVal,
double yVal,
double zVal);
274 void setViewportShift(
double xVal,
double yVal);
276 void setScale(
double xVal,
double yVal,
double zVal);
278 void setZoom(
double);
284 void enableMouse(
bool val =
true);
286 void disableMouse(
bool val =
true);
288 void enableKeyboard(
bool val =
true);
290 void disableKeyboard(
bool val =
true);
293 void enableLighting(
bool val =
true);
295 void disableLighting(
bool val =
true);
298 void setLightRotation(
double xVal,
double yVal,
double zVal,
unsigned int idx = 0);
300 void setLightShift(
double xVal,
double yVal,
double zVal,
unsigned int idx = 0);
303 virtual bool savePixmap(QString
const& fileName, QString
const& format);
305 virtual bool saveVector(QString
const& fileName,
306 QString
const& format,
307 VectorWriter::TEXTMODE text,
308 VectorWriter::SORTMODE sortmode);
310 virtual bool save(QString
const& fileName, QString
const& format);
313 QWT_DECLARE_PRIVATE(
Plot3D)
315 using EnrichmentList = std::list< Qwt3D::Enrichment* >;
316 using ELIT = EnrichmentList::iterator;
318 void initializeGL()
override;
319 void paintGL()
override;
320 void resizeGL(
int w,
int h)
override;
322 void mousePressEvent(QMouseEvent* e)
override;
323 void mouseReleaseEvent(QMouseEvent* e)
override;
324 void mouseMoveEvent(QMouseEvent* e)
override;
325 void wheelEvent(QWheelEvent* e)
override;
327 void keyPressEvent(QKeyEvent* e)
override;
330 std::vector< GLuint >& displayLists();
334 virtual void calculateHull() = 0;
335 virtual void createData() = 0;
339 virtual void createEnrichments();
341 void createCoordinateSystem();
344 bool initializedGL()
const;
355 void setRotationMouse(MouseState bstate,
double accel, QPoint diff);
356 void setScaleMouse(MouseState bstate,
double accel, QPoint diff);
357 void setShiftMouse(MouseState bstate,
double accel, QPoint diff);
359 void setRotationKeyboard(KeyboardState kseq,
double speed);
360 void setScaleKeyboard(KeyboardState kseq,
double speed);
361 void setShiftKeyboard(KeyboardState kseq,
double speed);
363 void applyLight(
unsigned idx);
A flat color legend
Definition qwt3d_colorlegend.h:18
Abstract base class for color functors
Definition qwt3d_color.h:19
A coordinate system with different styles (BOX, FRAME)
Definition qwt3d_coordsys.h:14
Abstract base class for plot data
Definition qwt3d_types.h:396
Abstract base class for data dependent visible user objects
Definition qwt3d_enrichment.h:20
Creates a (key-button, modifier) pair
Definition qwt3d_portability.h:53
Creates a (mouse-button, modifier) pair
Definition qwt3d_portability.h:22
Base class for all plotting widgets
Definition qwt3d_plot.h:22
void projectionChanged(bool)
Signal emitted when the projection mode is changed
void rotationChanged(double xAngle, double yAngle, double zAngle)
Signal emitted when the rotation is changed
void shiftChanged(double xShift, double yShift, double zShift)
Signal emitted when the shift is changed
void vieportShiftChanged(double xShift, double yShift)
Signal emitted when the viewport shift is changed
void scaleChanged(double xScale, double yScale, double zScale)
Signal emitted when the scaling is changed
void zoomChanged(double)
Signal emitted when the zoom is changed
Complete visual theme descriptor for Plot3D widgets.
Definition qwt3d_theme.h:34
Parallelepiped spanned by 2 Triples
Definition qwt3d_types.h:303
Red-Green-Blue-Alpha value
Definition qwt3d_types.h:364
Triple [x,y,z]
Definition qwt3d_types.h:170