30class QWT3D_EXPORT
Plot3D :
public QOpenGLWidget
36 Plot3D(QWidget* parent = 0);
41 QPixmap renderPixmap(
int w = 0,
int h = 0,
bool useContext =
false);
49 return &coordinates_p;
58 double xRotation()
const
63 double yRotation()
const
68 double zRotation()
const
90 double xViewportShift()
const
95 double yViewportShift()
const
101 double xScale()
const
106 double yScale()
const
111 double zScale()
const
128 void setPlotStyle(Qwt3D::PLOTSTYLE val);
132 Qwt3D::PLOTSTYLE plotStyle()
const
139 return userplotstyle_p;
142 void setShading(Qwt3D::SHADINGSTYLE val);
144 Qwt3D::SHADINGSTYLE shading()
const
149 void setIsolines(
int isolines);
157 void setSmoothMesh(
bool val)
159 smoothdatamesh_p = val;
162 bool smoothDataMesh()
const
164 return smoothdatamesh_p;
181 void setMeshLineWidth(
double lw);
183 double meshLineWidth()
const
185 return meshLineWidth_;
188 void setDataColor(
Color* col);
190 const Color* dataColor()
const
207 void showColorLegend(
bool);
210 void setCoordinateStyle(Qwt3D::COORDSTYLE st);
212 void setPolygonOffset(
double d);
214 double polygonOffset()
const
216 return polygonOffset_;
220 void setTitlePosition(
double rely,
double relx = 0.5, Qwt3D::ANCHOR = Qwt3D::TopCenter);
222 void setTitleFont(
const QString& family,
int pointSize,
int weight = QFont::Normal,
bool italic =
false);
226 title_.setColor(col);
229 void setTitle(
const QString& title)
231 title_.setString(title);
246 bool mouseEnabled()
const;
268 bool keyboardEnabled()
const;
270 void setKeySpeed(
double rot,
double scale,
double shift);
272 void keySpeed(
double& rot,
double& scale,
double& shift)
const;
275 bool lightingEnabled()
const;
277 void illuminate(
unsigned light = 0);
279 void blowout(
unsigned light = 0);
282 void setMaterialComponent(GLenum property,
double r,
double g,
double b,
double a = 1.0);
284 void setMaterialComponent(GLenum property,
double intensity);
286 void setShininess(
double exponent);
288 void setLightComponent(GLenum property,
double r,
double g,
double b,
double a = 1.0,
unsigned light = 0);
290 void setLightComponent(GLenum property,
double intensity,
unsigned light = 0);
293 double xLightRotation(
unsigned idx = 0)
const
295 return (idx < 8) ? lights_[ idx ].rot.x : 0;
298 double yLightRotation(
unsigned idx = 0)
const
300 return (idx < 8) ? lights_[ idx ].rot.y : 0;
303 double zLightRotation(
unsigned idx = 0)
const
305 return (idx < 8) ? lights_[ idx ].rot.z : 0;
309 double xLightShift(
unsigned idx = 0)
const
311 return (idx < 8) ? lights_[ idx ].shift.x : 0;
314 double yLightShift(
unsigned idx = 0)
const
316 return (idx < 8) ? lights_[ idx ].shift.y : 0;
319 double zLightShift(
unsigned idx = 0)
const
321 return (idx < 8) ? lights_[ idx ].shift.z : 0;
326 return (actualData_p) ? !actualData_p->empty() :
false;
426 void setRotation(
double xVal,
double yVal,
double zVal);
428 void setShift(
double xVal,
double yVal,
double zVal);
430 void setViewportShift(
double xVal,
double yVal);
432 void setScale(
double xVal,
double yVal,
double zVal);
434 void setZoom(
double);
440 void enableMouse(
bool val =
true);
442 void disableMouse(
bool val =
true);
444 void enableKeyboard(
bool val =
true);
446 void disableKeyboard(
bool val =
true);
449 void enableLighting(
bool val =
true);
451 void disableLighting(
bool val =
true);
454 void setLightRotation(
double xVal,
double yVal,
double zVal,
unsigned int idx = 0);
456 void setLightShift(
double xVal,
double yVal,
double zVal,
unsigned int idx = 0);
459 virtual bool savePixmap(QString
const& fileName,
460 QString
const& format);
462 virtual bool saveVector(QString
const& fileName,
463 QString
const& format,
464 VectorWriter::TEXTMODE text,
465 VectorWriter::SORTMODE sortmode);
467 virtual bool save(QString
const& fileName, QString
const& format);
470 using EnrichmentList = std::list< Qwt3D::Enrichment* >;
471 using ELIT = EnrichmentList::iterator;
475 void resizeGL(
int w,
int h);
477 void mousePressEvent(QMouseEvent* e);
478 void mouseReleaseEvent(QMouseEvent* e);
479 void mouseMoveEvent(QMouseEvent* e);
480 void wheelEvent(QWheelEvent* e);
482 void keyPressEvent(QKeyEvent* e);
487 EnrichmentList elist_p;
489 virtual void calculateHull() = 0;
490 virtual void createData() = 0;
494 virtual void createEnrichments();
496 void createCoordinateSystem();
502 bool initializedGL()
const
504 return initializedGL_;
514 std::vector< GLuint > displaylists_p;
520 Light() : unlit(true)
527 std::vector< Light > lights_;
529 GLdouble xRot_, yRot_, zRot_, xShift_, yShift_, zShift_, zoom_, xScale_, yScale_, zScale_, xVPShift_, yVPShift_;
532 double meshLineWidth_;
534 Qwt3D::PLOTSTYLE plotstyle_;
535 Qwt3D::SHADINGSTYLE shading_;
536 Qwt3D::FLOORSTYLE floorstyle_;
538 double polygonOffset_;
541 bool smoothdatamesh_p;
549 Qwt3D::ANCHOR titleanchor_;
553 QPoint lastMouseMovePosition_;
556 MouseState xrot_mstate_, yrot_mstate_, zrot_mstate_, xscale_mstate_, yscale_mstate_, zscale_mstate_, zoom_mstate_,
557 xshift_mstate_, yshift_mstate_;
559 bool mouse_input_enabled_;
561 void setRotationMouse(MouseState bstate,
double accel, QPoint diff);
562 void setScaleMouse(MouseState bstate,
double accel, QPoint diff);
563 void setShiftMouse(MouseState bstate,
double accel, QPoint diff);
569 KeyboardState xrot_kstate_[ 2 ], yrot_kstate_[ 2 ], zrot_kstate_[ 2 ], xscale_kstate_[ 2 ], yscale_kstate_[ 2 ],
570 zscale_kstate_[ 2 ], zoom_kstate_[ 2 ], xshift_kstate_[ 2 ], yshift_kstate_[ 2 ];
572 bool kbd_input_enabled_;
573 double kbd_rot_speed_, kbd_scale_speed_, kbd_shift_speed_;
575 void setRotationKeyboard(KeyboardState kseq,
double speed);
576 void setScaleKeyboard(KeyboardState kseq,
double speed);
577 void setShiftKeyboard(KeyboardState kseq,
double speed);
579 bool lighting_enabled_;
580 void applyLight(
unsigned idx);
584 bool renderpixmaprequest_;