4#include <QOpenGLWidget>
6#include <QOpenGLShaderProgram>
8#include "qwt3d_coordsys.h"
9#include "qwt3d_theme.h"
10#include "qwt3d_io_gl2ps.h"
46 QPixmap renderPixmap(
int w = 0,
int h = 0,
bool useContext =
false);
55 double xRotation()
const;
57 double yRotation()
const;
59 double zRotation()
const;
62 double xShift()
const;
64 double yShift()
const;
66 double zShift()
const;
69 double xViewportShift()
const;
71 double yViewportShift()
const;
74 double xScale()
const;
76 double yScale()
const;
78 double zScale()
const;
87 ASPECTRATIOMODE aspectRatioMode()
const;
90 void setBackgroundColor(
RGBA rgba);
92 RGBA backgroundRGBAColor()
const;
98 void showColorLegend(
bool);
100 bool isColorLegendShown()
const;
102 void setLegendPosition(Qwt3DColorLegend::Position pos);
104 void setLegendAbsolutePosition(
const QRectF& pixelRect);
107 void setTitlePosition(
double rely,
double relx = 0.5, ANCHOR = TopCenter);
109 void setTitleFont(
const QString& family,
int pointSize,
int weight = QFont::Normal,
bool italic =
false);
111 void setTitleColor(
RGBA col);
113 void setTitle(
const QString& title);
115 QString title()
const;
123 void applyTheme(Qwt3DTheme::Preset preset);
125 void applyTheme(
const QString& presetName);
139 bool mouseEnabled()
const;
161 bool keyboardEnabled()
const;
163 void setKeySpeed(
double rot,
double scale,
double shift);
165 void keySpeed(
double& rot,
double& scale,
double& shift)
const;
169 void setMouseSpeed(
double rot,
double scale,
double shift);
171 void mouseSpeed(
double& rot,
double& scale,
double& shift)
const;
180 bool lightingEnabled()
const;
182 bool isLightIlluminated(
unsigned idx = 0)
const;
184 RGBA lightComponent(
unsigned int property,
unsigned light = 0)
const;
186 RGBA materialComponent(
unsigned int property)
const;
188 double shininess()
const;
191 bool isVectorExportActive()
const;
193 void illuminate(
unsigned light = 0);
195 void blowout(
unsigned light = 0);
198 void setMaterialComponent(
unsigned int property,
double r,
double g,
double b,
double a = 1.0);
200 void setMaterialComponent(
unsigned int property,
double intensity);
202 void setShininess(
double exponent);
204 void setLightComponent(
unsigned int property,
double r,
double g,
double b,
double a = 1.0,
unsigned light = 0);
206 void setLightComponent(
unsigned int property,
double intensity,
unsigned light = 0);
209 double xLightRotation(
unsigned idx = 0)
const;
211 double yLightRotation(
unsigned idx = 0)
const;
213 double zLightRotation(
unsigned idx = 0)
const;
216 double xLightShift(
unsigned idx = 0)
const;
218 double yLightShift(
unsigned idx = 0)
const;
220 double zLightShift(
unsigned idx = 0)
const;
223 bool hasItems()
const;
234 bool initializedGL()
const;
237 QMatrix4x4 modelViewMatrix()
const;
239 QMatrix4x4 projectionMatrix()
const;
242 QPointF worldToScreen(
const Triple& world)
const;
244 Triple screenToWorld(
const QPointF& screen)
const;
247 QSize viewportSize()
const;
250 QOpenGLShaderProgram* lineShader()
const;
251 QOpenGLShaderProgram* pointShader()
const;
252 QOpenGLShaderProgram* polygonShader()
const;
253 QOpenGLShaderProgram* textShader()
const;
309 void setRotation(
double xVal,
double yVal,
double zVal);
311 void setShift(
double xVal,
double yVal,
double zVal);
313 void setViewportShift(
double xVal,
double yVal);
315 void setScale(
double xVal,
double yVal,
double zVal);
317 void setZoom(
double);
323 void setAspectRatioMode(ASPECTRATIOMODE mode);
326 void enableMouse(
bool val =
true);
328 void disableMouse(
bool val =
true);
330 void enableKeyboard(
bool val =
true);
332 void disableKeyboard(
bool val =
true);
335 void enableLighting(
bool val =
true);
337 void disableLighting(
bool val =
true);
340 void setLightRotation(
double xVal,
double yVal,
double zVal,
unsigned int idx = 0);
342 void setLightShift(
double xVal,
double yVal,
double zVal,
unsigned int idx = 0);
345 virtual bool savePixmap(QString
const& fileName, QString
const& format);
347 virtual bool saveVector(QString
const& fileName,
348 QString
const& format,
349 Qwt3DVectorWriter::TEXTMODE text,
350 Qwt3DVectorWriter::SORTMODE sortmode);
352 virtual bool save(QString
const& fileName, QString
const& format);
357 void initializeGL()
override;
358 void paintGL()
override;
359 void resizeGL(
int w,
int h)
override;
361 void mousePressEvent(QMouseEvent* e)
override;
362 void mouseReleaseEvent(QMouseEvent* e)
override;
363 void mouseMoveEvent(QMouseEvent* e)
override;
364 void wheelEvent(QWheelEvent* e)
override;
366 void keyPressEvent(QKeyEvent* e)
override;
369 void setRotationMouse(
Qwt3DMouseState bstate,
double accel, QPoint diff);
377 void applyLight(
unsigned idx);
381 void recalculateScene();
Definition qwt_raster_data.h:38
A flat color legend.
Definition qwt3d_colorlegend.h:19
A coordinate system with different styles (BOX, FRAME)
Definition qwt3d_coordsys.h:13
Creates a (key-button, modifier) pair.
Definition qwt3d_portability.h:52
Creates a (mouse-button, modifier) pair.
Definition qwt3d_portability.h:21
Base class for all 3D plot items.
Definition qwt3d_plotitem.h:55
Pure rendering window for 3D plots.
Definition qwt3d_plot.h:36
void projectionChanged(bool)
Signal emitted when the projection mode 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 zoomChanged(double)
Signal emitted when the zoom is changed.
void rotationChanged(double xAngle, double yAngle, double zAngle)
Signal emitted when the rotation is changed.
void aspectRatioModeChanged(ASPECTRATIOMODE mode)
Signal emitted when the aspect ratio mode is changed.
void scaleChanged(double xScale, double yScale, double zScale)
Signal emitted when the scaling is changed.
Complete visual theme descriptor for Qwt3DPlot widgets.
Definition qwt3d_theme.h:34
Parallelepiped spanned by 2 Triples.
Definition qwt3d_types.h:334
Red-Green-Blue-Alpha value.
Definition qwt3d_types.h:395
Triple [x,y,z].
Definition qwt3d_types.h:201