23 QPointF line[2],
bool ignoreOnPlane )
const;
25 inline double z()
const {
return d_z; }
28 inline int compare(
double z )
const;
37 bool ignoreOnPlane )
const 42 const int eq1 =
compare( vertex[0].
z() );
43 const int eq2 =
compare( vertex[1].
z() );
44 const int eq3 =
compare( vertex[2].
z() );
59 static const int tab[3][3][3] =
62 { { 0, 0, 8 }, { 0, 2, 5 }, { 7, 6, 9 } },
63 { { 0, 3, 4 }, { 1, 10, 1 }, { 4, 3, 0 } },
64 { { 9, 6, 7 }, { 5, 2, 0 }, { 8, 0, 0 } }
67 const int edgeType = tab[eq1+1][eq2+1][eq3+1];
149 const double h1 = p1.
z() -
d_z;
150 const double h2 = p2.
z() -
d_z;
152 const double x = ( h2 * p1.
x() - h1 * p2.
x() ) / ( h2 - h1 );
153 const double y = ( h2 * p1.
y() - h1 * p2.
y() ) / ( h2 - h1 );
155 return QPointF( x, y );
281 const QRectF &rect,
const QSize &raster,
282 const QList<double> &levels,
ConrecFlags flags )
const 286 if ( levels.size() == 0 || !rect.isValid() || !raster.isValid() )
289 const double dx = rect.width() / raster.width();
290 const double dy = rect.height() / raster.height();
292 const bool ignoreOnPlane =
296 bool ignoreOutOfRange =
false;
303 for (
int y = 0;
y < raster.height() - 1;
y++ )
319 for (
int x = 0;
x < raster.width() - 1;
x++ )
321 const QPointF pos( rect.x() +
x * dx, rect.y() +
y * dy );
325 xy[TopRight].
setX( pos.x() );
326 xy[TopRight].
setY( pos.y() );
328 value( xy[TopRight].
x(), xy[TopRight].
y() )
331 xy[BottomRight].
setX( pos.x() );
332 xy[BottomRight].
setY( pos.y() + dy );
333 xy[BottomRight].
setZ(
334 value( xy[BottomRight].
x(), xy[BottomRight].
y() )
338 xy[TopLeft] = xy[TopRight];
339 xy[BottomLeft] = xy[BottomRight];
341 xy[TopRight].
setX( pos.x() + dx );
342 xy[TopRight].
setY( pos.y() );
343 xy[BottomRight].
setX( pos.x() + dx );
344 xy[BottomRight].
setY( pos.y() + dy );
347 value( xy[TopRight].
x(), xy[TopRight].
y() )
349 xy[BottomRight].
setZ(
350 value( xy[BottomRight].
x(), xy[BottomRight].
y() )
353 double zMin = xy[TopLeft].
z();
357 for (
int i = TopRight;
i <= BottomLeft;
i++ )
359 const double z = xy[
i].
z();
368 if ( qIsNaN( zSum ) )
374 if ( ignoreOutOfRange )
380 if ( zMax < levels[0] ||
381 zMin > levels[levels.size() - 1] )
386 xy[Center].
setX( pos.x() + 0.5 * dx );
387 xy[Center].
setY( pos.y() + 0.5 * dy );
388 xy[Center].
setZ( 0.25 * zSum );
390 const int numLevels = levels.size();
391 for (
int l = 0; l < numLevels; l++ )
393 const double level = levels[l];
394 if ( level < zMin || level > zMax )
396 QPolygonF &lines = contourLines[level];
402 for (
int m = TopLeft; m < NumPositions; m++ )
406 vertex[2] = xy[m != BottomLeft ? m + 1 : TopLeft];
408 const bool intersects =
409 plane.
intersect( vertex, line, ignoreOnPlane );
virtual void discardRaster()
Discard a raster.
void setY(double y)
Sets the y-coordinate of the point to the value specified by y.
virtual ~QwtRasterData()
Destructor.
virtual QRectF pixelHint(const QRectF &) const
Pixel hint.
int compare(double z) const
bool contains(double value) const
A class representing an interval.
Attribute
Raster data attributes.
void setAttribute(Attribute, bool on=true)
QwtRasterData::Attributes attributes
virtual void initRaster(const QRectF &, const QSize &raster)
Initialize a raster.
TFSIMD_FORCE_INLINE const tfScalar & y() const
Ignore all vertices on the same level.
QMap< double, QPolygonF > ContourLines
Contour lines.
virtual QwtInterval interval(Qt::Axis) const =0
virtual ContourLines contourLines(const QRectF &rect, const QSize &raster, const QList< double > &levels, ConrecFlags) const
QwtPoint3D class defines a 3D point in double coordinates.
Ignore all values, that are out of range.
void setZ(double y)
Sets the z-coordinate of the point to the value specified by z.
TFSIMD_FORCE_INLINE const tfScalar & x() const
virtual double value(double x, double y) const =0
bool intersect(const QwtPoint3D vertex[3], QPointF line[2], bool ignoreOnPlane) const
QFlags< ConrecFlag > ConrecFlags
Flags to modify the contour algorithm.
bool testAttribute(Attribute) const
QwtRasterData defines an interface to any type of raster data.
QwtRasterData()
Constructor.
void setX(double x)
Sets the x-coordinate of the point to the value specified by x.
QPointF intersection(const QwtPoint3D &p1, const QwtPoint3D &p2) const
QFlags< Attribute > Attributes
Raster data Attributes.