@@ -24,7 +24,7 @@ class QWT3D_EXPORT Plot3D : public ExtGLWidget
2424 Q_OBJECT
2525
2626public:
27- Plot3D ( QWidget * parent = 0 , const QGLWidget * shareWidget = 0 );
27+ Plot3D (QWidget * parent = 0 , const QGLWidget * shareWidget = 0 );
2828 virtual ~Plot3D ();
2929
3030 QPixmap renderPixmap (int w=0 , int h=0 , bool useContext=false );
@@ -71,28 +71,31 @@ class QWT3D_EXPORT Plot3D : public ExtGLWidget
7171
7272 // Convenience/compatibility member for appearance(0) properties
7373
74- void setPlotStyle ( Qwt3D::PLOTSTYLE val ); // !< Set plotting style
75- Qwt3D::Enrichment* setPlotStyle ( Qwt3D::Enrichment const & val );
74+ void setPlotStyle (Qwt3D::PLOTSTYLE val); // !< Set plotting style
75+ Qwt3D::Enrichment* setPlotStyle (Qwt3D::Enrichment const & val);
7676 Qwt3D::PLOTSTYLE plotStyle () const { return appearance (0 ).plotStyle (); }// !< Returns plotting style
7777 // ! Returns current Enrichment object used for plotting styles (if set, zero else)
7878 Qwt3D::Enrichment* userStyle () const { return appearance (0 ).userStyle (); }
7979
80- void setShading ( Qwt3D::SHADINGSTYLE val ); // !<Set shading style
80+ void setShading (Qwt3D::SHADINGSTYLE val ); // !<Set shading style
8181 Qwt3D::SHADINGSTYLE shading () const { return appearance (0 ).shading (); }// !< Returns shading style
8282
83- void setSmoothMesh (bool val ) {appearance (0 ).setSmoothMesh (val);} // !< Enables/disables smooth data mesh lines. Default is false
83+ void setSmoothMesh (bool val) {appearance (0 ).setSmoothMesh (val);} // !< Enables/disables smooth data mesh lines. Default is false
8484 bool smoothDataMesh () const {return appearance (0 ).smoothDataMesh ();} // !< True if mesh antialiasing is on
85- void setMeshColor (Qwt3D::RGBA rgba ); // !< Sets color for data mesh
85+ void setMeshColor (Qwt3D::RGBA rgba); // !< Sets color for data mesh
8686 Qwt3D::RGBA meshColor () const {return appearance (0 ).meshColor ();} // !< Returns color for data mesh
87- void setMeshLineWidth (double lw ); // !< Sets line width for data mesh
87+ void setMeshLineWidth (double lw); // !< Sets line width for data mesh
8888 double meshLineWidth () const {return appearance (0 ).meshLineWidth ();} // !< Returns line width for data mesh
89- void setDataColor (const Qwt3D::Color& col ); // !< Sets new data color object
89+ void setDataColor (const Qwt3D::Color& col); // !< Sets new data color object
9090 const Qwt3D::ValuePtr<Qwt3D::Color>& dataColor () const {return appearance (0 ).dataColor ();} // !< Returns data color object
9191
9292 // tweaks
93- void setPolygonOffset (double d );
93+ void setPolygonOffset (double d);
9494 double polygonOffset () const {return appearance (0 ).polygonOffset ();} // !< Returns relative value for polygon offset [0..1]
9595
96+ // ! \since 0.3.2
97+ void enableFastNormals (bool on) { m_fastNormals = on; }
98+
9699 // !< Add an Enrichment
97100 virtual Qwt3D::Enrichment* addEnrichment (Qwt3D::Enrichment const & val){return appearance (0 ).addEnrichment (val);}
98101 virtual bool degrade (Qwt3D::Enrichment* val){return appearance (0 ).degrade (val);} // !< Remove an Enrichment
@@ -111,10 +114,10 @@ public slots:
111114
112115 // ! Combines data with their visual appearance
113116 /* *
114- A Plotlet describes the plot's part related to a single dataset. In this respect, it has
115- no own coordinate system (but a hull) and other plot-wide properties. A single
116- data- and the associated Appearance object form a Plotlet.
117- */
117+ A Plotlet describes the plot's part related to a single dataset. In this respect, it has
118+ no own coordinate system (but a hull) and other plot-wide properties. A single
119+ data- and the associated Appearance object form a Plotlet.
120+ */
118121 struct Plotlet
119122 {
120123 public:
@@ -125,17 +128,18 @@ public slots:
125128
126129 void initializeGL ();
127130 void paintGL ();
128- void resizeGL ( int w, int h );
131+ void resizeGL (int w, int h);
129132
130133 Qwt3D::CoordinateSystem coordinates_p;
131134
132135 virtual void calculateHull ();
133136 virtual void updateAppearances ();
134137 virtual void createOpenGlData ();
135138 virtual void createOpenGlData (const Plotlet& pl) = 0;
139+ virtual void drawOpenGlData ();
136140
137141 void createCoordinateSystem ();
138- void setHull (Qwt3D::ParallelEpiped const & h) {hull_ = h;}
142+ void setHull (Qwt3D::ParallelEpiped const & h) { hull_ = h; }
139143
140144 std::vector<Plotlet> plotlets_p;
141145
@@ -144,6 +148,8 @@ public slots:
144148 std::vector<double > isolinesZ_p;
145149 bool delayisolinecalculation_p;
146150
151+ bool m_fastNormals;
152+
147153 // debug
148154 quint64 m_createTime;
149155
@@ -201,7 +207,7 @@ The function returns the Appearance object for the Plotlet at idx.
201207For invalid arguments the return value contains the standard appearance
202208(equivalent to idx==0) is returned
203209*/
204- Appearance& Plot3D::appearance ( unsigned idx )
210+ Appearance& Plot3D::appearance (unsigned idx)
205211{
206212 assert (!plotlets_p.empty ());
207213 if (idx >= plotlets_p.size ())
@@ -214,7 +220,7 @@ The function returns the Appearance object for the Plotlet at idx.
214220For invalid arguments the return value contains the standard appearance
215221(equivalent to idx==0) is returned
216222*/
217- const Appearance& Plot3D::appearance ( unsigned idx ) const
223+ const Appearance& Plot3D::appearance (unsigned idx) const
218224{
219225 assert (!plotlets_p.empty ());
220226 if (idx >= plotlets_p.size ())
0 commit comments