Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QQuickShapeCurveMaterial Class Reference

#include <qquickshapecurvenode_p_p.h>

+ Inheritance diagram for QQuickShapeCurveMaterial:
+ Collaboration diagram for QQuickShapeCurveMaterial:

Public Member Functions

 QQuickShapeCurveMaterial (QQuickShapeCurveNode *node)
 
int compare (const QSGMaterial *other) const override
 Compares this material to other and returns 0 if they are equal; -1 if this material should sort before other and 1 if other should sort before.
 
QQuickShapeCurveNodenode () const
 
- Public Member Functions inherited from QSGMaterial
 QSGMaterial ()
 
virtual ~QSGMaterial ()
 
virtual QSGMaterialTypetype () const =0
 This function is called by the scene graph to query an identifier that is unique to the QSGMaterialShader instantiated by createShader().
 
virtual QSGMaterialShadercreateShader (QSGRendererInterface::RenderMode renderMode) const =0
 This function returns a new instance of a the QSGMaterialShader implementation used to render geometry for a specific implementation of QSGMaterial.
 
virtual int compare (const QSGMaterial *other) const
 Compares this material to other and returns 0 if they are equal; -1 if this material should sort before other and 1 if other should sort before.
 
QSGMaterial::Flags flags () const
 Returns the material's flags.
 
void setFlag (Flags flags, bool on=true)
 Sets the flags flags on this material if on is true; otherwise clears the attribute.
 

Private Member Functions

QSGMaterialTypetype () const override
 This function is called by the scene graph to query an identifier that is unique to the QSGMaterialShader instantiated by createShader().
 
QSGMaterialShadercreateShader (QSGRendererInterface::RenderMode renderMode) const override
 This function returns a new instance of a the QSGMaterialShader implementation used to render geometry for a specific implementation of QSGMaterial.
 

Additional Inherited Members

- Public Types inherited from QSGMaterial
enum  Flag {
  Blending = 0x0001 , RequiresDeterminant = 0x0002 , RequiresFullMatrixExceptTranslate = 0x0004 | RequiresDeterminant , RequiresFullMatrix = 0x0008 | RequiresFullMatrixExceptTranslate ,
  NoBatching = 0x0010
}
 \value Blending Set this flag to true if the material requires blending to be enabled during rendering. More...
 

Detailed Description

Definition at line 23 of file qquickshapecurvenode_p_p.h.

Constructor & Destructor Documentation

◆ QQuickShapeCurveMaterial()

QQuickShapeCurveMaterial::QQuickShapeCurveMaterial ( QQuickShapeCurveNode node)

Definition at line 251 of file qquickshapecurvenode_p.cpp.

References QSGMaterial::Blending, QSGMaterial::RequiresDeterminant, and QSGMaterial::setFlag().

+ Here is the call graph for this function:

Member Function Documentation

◆ compare()

int QQuickShapeCurveMaterial::compare ( const QSGMaterial other) const
overridevirtual

Compares this material to other and returns 0 if they are equal; -1 if this material should sort before other and 1 if other should sort before.

The scene graph can reorder geometry nodes to minimize state changes. The compare function is called during the sorting process so that the materials can be sorted to minimize state changes in each call to QSGMaterialShader::updateState().

The this pointer and other is guaranteed to have the same type().

Reimplemented from QSGMaterial.

Definition at line 258 of file qquickshapecurvenode_p.cpp.

References QQuickAbstractPathRenderer::GradientDesc::a, QQuickAbstractPathRenderer::GradientDesc::b, d, QList< T >::first(), i, node(), QQuickAbstractPathRenderer::NoGradient, other(), QList< T >::size(), QQuickAbstractPathRenderer::GradientDesc::spread, QQuickAbstractPathRenderer::GradientDesc::stops, type(), QQuickAbstractPathRenderer::GradientDesc::v0, QQuickAbstractPathRenderer::GradientDesc::v1, QPointF::x(), and QPointF::y().

+ Here is the call graph for this function:

◆ createShader()

QSGMaterialShader * QQuickShapeCurveMaterial::createShader ( QSGRendererInterface::RenderMode  renderMode) const
overrideprivatevirtual

This function returns a new instance of a the QSGMaterialShader implementation used to render geometry for a specific implementation of QSGMaterial.

The function will be called only once for each combination of material type and renderMode and will be cached internally.

For most materials, the renderMode can be ignored. A few materials may need custom handling for specific render modes. For instance if the material implements antialiasing in a way that needs to account for perspective transformations when RenderMode3D is in use.

Implements QSGMaterial.

Definition at line 330 of file qquickshapecurvenode_p.cpp.

References node(), and QSGRendererInterface::RenderMode3D.

+ Here is the call graph for this function:

◆ node()

QQuickShapeCurveNode * QQuickShapeCurveMaterial::node ( ) const
inline

Definition at line 29 of file qquickshapecurvenode_p_p.h.

Referenced by compare(), createShader(), type(), and QT_BEGIN_NAMESPACE::QQuickShapeCurveMaterialShader::updateUniformData().

+ Here is the caller graph for this function:

◆ type()

QSGMaterialType * QQuickShapeCurveMaterial::type ( ) const
overrideprivatevirtual

This function is called by the scene graph to query an identifier that is unique to the QSGMaterialShader instantiated by createShader().

For many materials, the typical approach will be to return a pointer to a static, and so globally available, QSGMaterialType instance. The QSGMaterialType is an opaque object. Its purpose is only to serve as a type-safe, simple way to generate unique material identifiers.

QSGMaterialType *type() const override
{
return &type;
}
QSGMaterialType * type() const override
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialSh...
The QSGMaterialType class is used as a unique type token in combination with QSGMaterial.

Implements QSGMaterial.

Definition at line 318 of file qquickshapecurvenode_p.cpp.

References QQuickShapeCurveNode::gradientType(), node(), and Q_ASSERT.

Referenced by compare().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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