QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 类型 | Public 成员函数 | 所有成员列表
Qwt3DLine类 参考

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

#include <qwt3d_line3d.h>

类 Qwt3DLine 继承关系图:
Qwt3DPlotItem

class  PrivateData
 

Public 类型

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

Public 成员函数

 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 成员函数 继承自 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
 

详细描述

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
参见
Qwt3DPlotItem, Qwt3DPlot, Qwt3DColor

成员枚举类型说明

◆ LineStyle

Line rendering style

枚举值
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

枚举值
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)

成员函数说明

◆ color()

RGBA Qwt3DLine::color ( ) const

Returns the solid line color

返回实心线颜色

返回
RGBA 颜色值

◆ draw()

void Qwt3DLine::draw ( )
overridevirtual

Draw the item using the current GL context

实现了 Qwt3DPlotItem.

◆ hull()

ParallelEpiped Qwt3DLine::hull ( ) const
overridevirtual

Get the bounding hull of the item in 3D space

实现了 Qwt3DPlotItem.

◆ populateLegendColors()

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

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

重载 Qwt3DPlotItem .

◆ rtti()

int Qwt3DLine::rtti ( ) const
overridevirtual

运行时类型信息

返回
Rtti_Plot3DLine (= 1003)

重载 Qwt3DPlotItem .


该类的文档由以下文件生成: