1
#include "qwt3d_parametricsurface.h"
2
#include "qwt3d_surfaceplot.h"
6
ParametricSurface::ParametricSurface()
11
ParametricSurface::ParametricSurface(SurfacePlot& pw)
19
ParametricSurface::ParametricSurface(SurfacePlot* pw)
27
void ParametricSurface::setPeriodic(bool u, bool v)
33
void ParametricSurface::assign(SurfacePlot& plotWidget)
35
if (&plotWidget != plotwidget_p)
36
plotwidget_p = &plotWidget;
39
void ParametricSurface::assign(SurfacePlot* plotWidget)
41
if (plotWidget != plotwidget_p)
42
plotwidget_p = plotWidget;
46
For plotWidget != 0 the function permanently assigns her argument (In fact, assign(plotWidget) is called)
48
bool ParametricSurface::create()
50
if ((umesh_p<=2) || (vmesh_p<=2) || !plotwidget_p)
53
/* allocate some space for the mesh */
54
Triple** data = new Triple* [umesh_p] ;
57
for ( i = 0; i < umesh_p; i++)
59
data[i] = new Triple [vmesh_p];
64
double du = (maxu_p - minu_p) / (umesh_p - 1);
65
double dv = (maxv_p - minv_p) / (vmesh_p - 1);
67
for (i = 0; i < umesh_p; ++i)
69
for (j = 0; j < vmesh_p; ++j)
71
data[i][j] = operator()(minu_p + i*du, minv_p + j*dv);
73
if (data[i][j].x > range_p.maxVertex.x)
74
data[i][j].x = range_p.maxVertex.x;
75
else if (data[i][j].y > range_p.maxVertex.y)
76
data[i][j].y = range_p.maxVertex.y;
77
else if (data[i][j].z > range_p.maxVertex.z)
78
data[i][j].z = range_p.maxVertex.z;
79
else if (data[i][j].x < range_p.minVertex.x)
80
data[i][j].x = range_p.minVertex.x;
81
else if (data[i][j].y < range_p.minVertex.y)
82
data[i][j].y = range_p.minVertex.y;
83
else if (data[i][j].z < range_p.minVertex.z)
84
data[i][j].z = range_p.minVertex.z;
88
((SurfacePlot*)plotwidget_p)->loadFromData(data, umesh_p, vmesh_p, uperiodic_, vperiodic_);
90
for ( i = 0; i < umesh_p; i++)
100
bool ParametricSurface::create(SurfacePlot& pl)