QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
Qwt3DLine Class Reference

3D line/curve plot item with VBO/VAO rendering More...

#include <qwt3d_line3d.h>

Inheritance diagram for Qwt3DLine:
Qwt3DPlotItem

Classes

class  PrivateData
 

Public Types

enum  LineStyle { Lines , Tube , Dots }
 Line rendering style. More...
 
enum  PointShape {
  Dot , Cube , Tetrahedron , Octahedron ,
  Sphere
}
 Point marker shape for the Dots style and the point-marker overlay. More...
 

Public Member Functions

 Qwt3DLine ()
 Constructs an empty line item.
 
 ~Qwt3DLine () override
 Destructor — releases GL resources and data.
 
void setSamples (const QVector< QwtPoint3D > &samples)
 Set samples from a vector of 3D points.
 
void setSamples (const QVector< double > &x, const QVector< double > &y, const QVector< double > &z)
 Set samples from parallel x, y, z arrays.
 
void setSamples (const QwtPoint3D *samples, size_t count)
 Set samples from a raw array of 3D points (not held; copied internally)
 
void setSamples (QwtSeriesData< QwtPoint3D > *data)
 Set the series data object (item takes ownership)
 
const QwtSeriesData< QwtPoint3D > * data () const
 Returns the series data.
 
size_t dataSize () const
 Returns the number of samples.
 
LineStyle lineStyle () const
 Returns the line style.
 
void setLineStyle (LineStyle style)
 Sets the line style.
 
double lineWidth () const
 Returns the GL line width (Lines style only; > 1 not guaranteed in Core)
 
void setLineWidth (double width)
 Sets the GL line width (Lines style only)
 
double tubeRadius () const
 Returns the tube radius (<= 0 means auto = 0.5% of hull diagonal)
 
void setTubeRadius (double radius)
 Sets the tube radius (<= 0 selects auto)
 
int tubeSegments () const
 Returns the tube ring segment count.
 
void setTubeSegments (int segments)
 Sets the tube ring segment count (minimum 3)
 
double pointSize () const
 Returns the point size (Dots style / point markers)
 
void setPointSize (double size)
 Sets the point size (Dots style / point markers)
 
bool pointVisible () const
 Returns true if point markers are drawn on top of Lines/Tube styles.
 
void setPointVisible (bool on)
 Draw point markers on top of Lines/Tube styles.
 
PointShape pointShape () const
 Returns the point marker shape.
 
void setPointShape (PointShape shape)
 Sets the point marker shape (Dot/Cube/Tetrahedron/Octahedron/Sphere)
 
void setColor (RGBA color)
 Sets the solid line color.
 
RGBA color () const
 Returns the solid line color.
 
void setDataColor (Qwt3DColor *color)
 Sets the data color functor for per-vertex coloring (takes ownership)
 
const Qwt3DColordataColor () const
 Returns the data color functor.
 
void invalidateColors ()
 Marks per-vertex colors as stale, triggering a VBO rebuild on the next draw.
 
int rtti () const override
 运行时类型信息
 
void draw () override
 Draw the item using the current GL context.
 
ParallelEpiped hull () const override
 Get the bounding hull of the item in 3D space.
 
void populateLegendColors (ColorVector &colors) const override
 Populate the legend color vector from the item's color functor.
 
- Public Member Functions inherited from Qwt3DPlotItem
 Qwt3DPlotItem ()
 Default constructor.
 
virtual ~Qwt3DPlotItem ()
 Destructor — detaches from any plot.
 
void attach (Qwt3DPlot *plot)
 Attach the item to a plot.
 
void detach ()
 Detach the item from its plot.
 
Qwt3DPlotplot () const
 Get the plot this item is attached to.
 
void setTitle (const QString &title)
 Set the item title.
 
QString title () const
 Get the item title.
 
void setZ (double z)
 Set the z-order value (controls draw sequence)
 
double z () const
 Get the z-order value.
 
void setVisible (bool on)
 Set item visibility.
 
bool isVisible () const
 Check if the item is visible.
 
virtual void itemChanged ()
 Notify the plot that the item has changed.
 

Detailed Description

3D line/curve plot item with VBO/VAO rendering

Qwt3DLine is a Qwt3DPlotItem that renders a polyline through 3D space using modern OpenGL (VBO/VAO + GLSL shaders). It accepts a series of QwtPoint3D samples and draws them as a connected curve.

Three rendering styles are provided:

Colors may be solid (setColor) or driven per-vertex by a Qwt3DColor functor (setDataColor), e.g. to color the curve by position or arc length.

auto plot = new Qwt3DPlot(parent);
auto line = new Qwt3DLine();
line->setSamples(samples); // QVector<QwtPoint3D>
line->setLineStyle(Qwt3DLine::Tube);
line->setDataColor(new Qwt3DColorMapColor("plasma"));
line->attach(plot);
Adapts a QwtColorMap (from qwt::core) for use as a Qwt3DColor.
Definition qwt3d_colormap_color.h:26
Qwt3DLine()
Constructs an empty line item.
Definition qwt3d_line3d.cpp:305
@ Tube
Solid lit tube swept along the polyline.
Definition qwt3d_line3d.h:55
Qwt3DPlot * plot() const
Get the plot this item is attached to.
Definition qwt3d_plotitem.cpp:84
Pure rendering window for 3D plots.
Definition qwt3d_plot.h:36
See also
Qwt3DPlotItem, Qwt3DPlot, Qwt3DColor

Member Enumeration Documentation

◆ LineStyle

Line rendering style.

Enumerator
Lines 

Thin GL line strip (1px)

Tube 

Solid lit tube swept along the polyline.

Dots 

Per-sample point markers.

◆ PointShape

Point marker shape for the Dots style and the point-marker overlay.

Enumerator
Dot 

GL_POINTS (simple screen-space dots)

Cube 

Axis-aligned cube.

Tetrahedron 

Regular 4-faced solid.

Octahedron 

8-faced diamond solid

Sphere 

UV sphere (smooth, lit)

Member Function Documentation

◆ color()

RGBA Qwt3DLine::color ( ) const

Returns the solid line color.

返回实心线颜色

Returns
RGBA 颜色值

◆ draw()

void Qwt3DLine::draw ( )
overridevirtual

Draw the item using the current GL context.

Implements Qwt3DPlotItem.

◆ hull()

ParallelEpiped Qwt3DLine::hull ( ) const
overridevirtual

Get the bounding hull of the item in 3D space.

Implements Qwt3DPlotItem.

◆ populateLegendColors()

void Qwt3DLine::populateLegendColors ( ColorVector &  colors) const
overridevirtual

Populate the legend color vector from the item's color functor.

Reimplemented from Qwt3DPlotItem.

◆ rtti()

int Qwt3DLine::rtti ( ) const
overridevirtual

运行时类型信息

Returns
Rtti_Plot3DLine (= 1003)

Reimplemented from Qwt3DPlotItem.


The documentation for this class was generated from the following files: