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

Abstract base class for mathematical functions 更多...

#include <qwt3d_function.h>

类 Qwt3DFunction 继承关系图:
Qwt3DGridMapping Qwt3DMapping

Public 成员函数

 Qwt3DFunction ()
 Default constructor
 
virtual double operator() (double x, double y)=0
 
void setMinZ (double val)
 Sets minimum z value for the function
 
void setMaxZ (double val)
 Sets maximum z value for the function
 
virtual Qwt3DFunctionData create ()
 Evaluates the function over the mesh grid and returns the result
 
- Public 成员函数 继承自 Qwt3DGridMapping
 Qwt3DGridMapping ()
 Default constructor
 
void setMesh (unsigned int columns, unsigned int rows)
 
void setDomain (double minu, double maxu, double minv, double maxv)
 Sets the domain (parameter range) for the u and v directions
 
void restrictRange (ParallelEpiped const &)
 Restricts the data range to a parallelepiped
 
- Public 成员函数 继承自 Qwt3DMapping
virtual QString name () const
 

额外继承的成员函数

- Protected 成员函数 继承自 Qwt3DGridMapping
ParallelEpipedrange ()
 
const ParallelEpipedrange () const
 
unsigned int meshU () const
 
unsigned int meshV () const
 
double minU () const
 
double maxU () const
 
double minV () const
 
double maxV () const
 

详细描述

Abstract base class for mathematical functions

A Qwt3DFunction encapsulates a mathematical function with rectangular domain. The user has to adapt the pure virtual operator() to get a working object. Also, the client code should call setDomain, setMesh and create for reasonable operating conditions.

create() returns a Qwt3DFunctionData struct that the caller feeds to Qwt3DSurface::loadFromData(). The function no longer holds a back-pointer to the surface item (deferred smell #2, resolved).

class MyFunction : public Qwt3DFunction
{
public:
double operator()(double x, double y) override { return std::sin(x + y); }
};
MyFunction func;
func.setMesh(50, 50);
func.setDomain(-3, 3, -3, 3);
auto data = func.create();
surface->loadFromData(data);
Abstract base class for mathematical functions
Definition qwt3d_function.h:34

成员函数说明

◆ create()

Qwt3DFunctionData Qwt3DFunction::create ( )
virtual

Evaluates the function over the mesh grid and returns the result

返回
Qwt3DFunctionData containing the z-value matrix and domain bounds

Allocates a z-value matrix, evaluates operator() over the mesh grid, clips values to the min/max z range, and returns the result. The caller is responsible for feeding this to Qwt3DSurface::loadFromData(). Returns an empty result (columns=0) if the mesh is too small.

◆ setMaxZ()

void Qwt3DFunction::setMaxZ ( double  val)

Sets maximum z value for the function

参数
valMaximum z value

◆ setMinZ()

void Qwt3DFunction::setMinZ ( double  val)

Sets minimum z value for the function

参数
valMinimum z value

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