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

Base class for all 3D plot items 更多...

#include <qwt3d_plotitem.h>

类 Qwt3DPlotItem 继承关系图:
Qwt3DBar Qwt3DLine Qwt3DSurface

class  PrivateData
 

Public 成员函数

 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
 
virtual void draw ()=0
 Draw the item using the current GL context
 
virtual ParallelEpiped hull () const =0
 Get the bounding hull of the item in 3D space
 
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 int rtti () const
 Runtime type information
 
virtual void itemChanged ()
 Notify the plot that the item has changed
 
virtual void populateLegendColors (ColorVector &colors) const
 Populate the legend color vector from the item's color functor
 

详细描述

Base class for all 3D plot items

A Qwt3DPlotItem is "something", that can be drawn within the GL context of a Qwt3DPlot widget. Items are not widgets themselves; they are pure data + drawing logic objects that are attached to a Qwt3DPlot via attach() and rendered during Qwt3DPlot::paintGL().

The rendering pipeline calls draw() for each attached item in order of ascending z-value. Items manage their own data, geometry caching (VBO/VAO), and color/style. The view transformation, projection, and lighting are set up by Qwt3DPlot before draw() is called.

To implement a custom 3D plot item, derive from Qwt3DPlotItem and implement the pure virtual draw() and hull() methods:

class MyItem : public Qwt3DPlotItem
{
public:
void draw() override
{
// Issue GL drawing calls using the current GL context
}
ParallelEpiped hull() const override
{
return m_hull;
}
private:
};
// Usage:
auto plot = new Qwt3DPlot(parent);
auto item = new MyItem();
item->attach(plot);
Base class for all 3D plot items
Definition qwt3d_plotitem.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
Parallelepiped spanned by 2 Triples
Definition qwt3d_types.h:334
参见
Qwt3DPlot, QwtPlotItem (2D counterpart)

构造及析构函数说明

◆ Qwt3DPlotItem()

Qwt3DPlotItem::Qwt3DPlotItem ( )

Default constructor

Constructs a Qwt3DPlotItem with default settings.

Destructor

Destroys the Qwt3DPlotItem and detaches it from any plot.

成员函数说明

◆ attach()

void Qwt3DPlotItem::attach ( Qwt3DPlot plot)

Attach the item to a plot

参数
[in]plotPlot widget to attach to

This method attaches a Qwt3DPlotItem to the Qwt3DPlot argument. It will first detach the Qwt3DPlotItem from any plot from a previous call to attach (if necessary). If a nullptr argument is passed, it will detach from any Qwt3DPlot it was attached to.

◆ detach()

void Qwt3DPlotItem::detach ( )

Detach the item from its plot

Detach the item from the plot

This method detaches a Qwt3DPlotItem from any Qwt3DPlot it has been associated with. detach() is equivalent to calling attach(nullptr).

◆ draw()

virtual void Qwt3DPlotItem::draw ( )
pure virtual

Draw the item using the current GL context

Qwt3DBar, Qwt3DLine , 以及 Qwt3DSurface 内被实现.

◆ hull()

virtual ParallelEpiped Qwt3DPlotItem::hull ( ) const
pure virtual

Get the bounding hull of the item in 3D space

Qwt3DBar, Qwt3DLine , 以及 Qwt3DSurface 内被实现.

◆ isVisible()

bool Qwt3DPlotItem::isVisible ( ) const

Check if the item is visible

返回
true if visible, false otherwise
参见
setVisible()

◆ itemChanged()

void Qwt3DPlotItem::itemChanged ( )
virtual

Notify the plot that the item has changed

Triggers a plot update so the item is redrawn.

◆ plot()

Qwt3DPlot * Qwt3DPlotItem::plot ( ) const

Get the plot this item is attached to

Get the plot the item is attached to

返回
Attached plot, or nullptr if not attached

◆ populateLegendColors()

void Qwt3DPlotItem::populateLegendColors ( ColorVector &  colors) const
virtual

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

Qwt3DBar, Qwt3DLine , 以及 Qwt3DSurface 重载.

◆ rtti()

int Qwt3DPlotItem::rtti ( ) const
virtual

Runtime type information

运行时类型信息

返回
返回 Rtti_Plot3DItem (= 0),子类应 override 此方法返回各自的 RTTI 值

用于运行时类型识别,支持安全向下转型、设置面板工厂路由和序列化分发。 设计与 2D QwtPlotItem::rtti() 完全对齐。

参见
Rtti3DValues, QwtPlotItem::rtti()

Qwt3DBar, Qwt3DLine , 以及 Qwt3DSurface 重载.

◆ setTitle()

void Qwt3DPlotItem::setTitle ( const QString &  title)

Set the item title

参数
[in]titleTitle text
参见
title()

◆ setVisible()

void Qwt3DPlotItem::setVisible ( bool  on)

Set item visibility

参数
[in]onShow if true, otherwise hide
参见
isVisible()

◆ setZ()

void Qwt3DPlotItem::setZ ( double  z)

Set the z-order value (controls draw sequence)

Set the z-order value

参数
[in]zZ-value for the item

Plot items are drawn in increasing z-order.

参见
z()

◆ title()

QString Qwt3DPlotItem::title ( ) const

Get the item title

Get the title of the item

返回
Title of the item
参见
setTitle()

◆ z()

double Qwt3DPlotItem::z ( ) const

Get the z-order value

返回
Z-value of the item

Plot items are drawn in increasing z-order.

参见
setZ()

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