[][src]Struct qt_3d_render::QTechnique

#[repr(C)]pub struct QTechnique { /* fields omitted */ }

Encapsulates a Technique.

C++ class: Qt3DRender::QTechnique.

C++ documentation:

Encapsulates a Technique.

A Qt3DRender::QTechnique specifies a set of Qt3DRender::QRenderPass objects, Qt3DRender::QFilterKey objects, Qt3DRender::QParameter objects and a Qt3DRender::QGraphicsApiFilter, which together define a rendering technique the given graphics API can render. The filter keys are used by Qt3DRender::QTechniqueFilter to select specific techniques at specific parts of the FrameGraph. If two QParameter instances with the same name are specified in a QTechnique and a QRenderPass, the one in Technique overrides the one used in the QRenderPass.

When creating an QEffect that targets several versions of a graphics API, it is useful to create several QTechnique nodes each with a graphicsApiFilter set to match one of the targeted GL versions. At runtime, the Qt3D renderer will select the most appropriate QTechnique based on which graphics API versions are supported and (if specified) the QFilterKey nodes that satisfy a given QTechniqueFilter in the FrameGraph.

Note: When using OpenGL as the graphics API for rendering, Qt3D relies on the QSurfaceFormat returned by QSurfaceFormat::defaultFormat() at runtime to decide what is the most appropriate GL version available. If you need to customize the QSurfaceFormat, do not forget to apply it with QSurfaceFormat::setDefaultFormat(). Setting the QSurfaceFormat on the view will likely have no effect on Qt3D related rendering.

QTechnique *gl3Technique = new QTechnique();

// Create the render passes QRenderPass firstPass = new QRenderPass(); QRenderPass secondPass = new QRenderPass();

// Add the passes to the technique gl3Technique->addRenderPass(firstPass); gl3Technique->addRenderPass(secondPass);

// Set the targeted GL version for the technique gl3Technique->graphicsApiFilter()->setApi(QGraphicsApiFilter::OpenGL); gl3Technique->graphicsApiFilter()->setMajorVersion(3); gl3Technique->graphicsApiFilter()->setMinorVersion(1); gl3Technique->graphicsApiFilter()->setProfile(QGraphicsApiFilter::CoreProfile);

// Create a FilterKey QFilterKey *filterKey = new QFilterKey(); filterKey->setName(QStringLiteral("name")); fitlerKey->setValue(QStringLiteral("zFillPass"));

// Add the FilterKey to the Technique gl3Technique->addFilterKey(filterKey);

// Create a QParameter QParameter *colorParameter = new QParameter(QStringLiteral("color"), QColor::fromRgbF(0.0f, 0.0f, 1.0f, 1.0f));

// Add parameter to technique gl3Technique->addParameter(colorParameter);

Methods

impl QTechnique[src]

pub unsafe fn add_filter_key(&self, filter_key: impl CastInto<Ptr<QFilterKey>>)[src]

Add filterKey to the Qt3DRender::QTechnique local filter keys.

Calls C++ function: void Qt3DRender::QTechnique::addFilterKey(Qt3DRender::QFilterKey* filterKey).

C++ documentation:

Add filterKey to the Qt3DRender::QTechnique local filter keys.

pub unsafe fn add_parameter(&self, p: impl CastInto<Ptr<QParameter>>)[src]

Add parameter to the technique's parameters.

Calls C++ function: void Qt3DRender::QTechnique::addParameter(Qt3DRender::QParameter* p).

C++ documentation:

Add parameter to the technique's parameters.

pub unsafe fn add_render_pass(&self, pass: impl CastInto<Ptr<QRenderPass>>)[src]

Appends a pass to the technique.

Calls C++ function: void Qt3DRender::QTechnique::addRenderPass(Qt3DRender::QRenderPass* pass).

C++ documentation:

Appends a pass to the technique.

pub unsafe fn filter_keys(&self) -> CppBox<QVectorOfQFilterKey>[src]

Returns the list of Qt3DCore::QFilterKey key objects making up the filter keys of the Qt3DRender::QTechnique.

Calls C++ function: QVector<Qt3DRender::QFilterKey*> Qt3DRender::QTechnique::filterKeys() const.

C++ documentation:

Returns the list of Qt3DCore::QFilterKey key objects making up the filter keys of the Qt3DRender::QTechnique.

pub unsafe fn graphics_api_filter_mut(&self) -> QPtr<QGraphicsApiFilter>[src]

Specifies the graphics API filter being used

Calls C++ function: Qt3DRender::QGraphicsApiFilter* Qt3DRender::QTechnique::graphicsApiFilter().

C++ documentation:

Specifies the graphics API filter being used

Access functions:

QGraphicsApiFilter *graphicsApiFilter()

pub unsafe fn graphics_api_filter(&self) -> QPtr<QGraphicsApiFilter>[src]

This is supported on cpp_lib_version="5.14.0" only.

Specifies the graphics API filter being used

Calls C++ function: const Qt3DRender::QGraphicsApiFilter* Qt3DRender::QTechnique::graphicsApiFilter() const.

C++ documentation:

Specifies the graphics API filter being used

Access functions:

Qt3DRender::QGraphicsApiFilter *graphicsApiFilter()
const Qt3DRender::QGraphicsApiFilter *graphicsApiFilter() const

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* Qt3DRender::QTechnique::metaObject() const.

pub unsafe fn new_1a(parent: impl CastInto<Ptr<QNode>>) -> QBox<QTechnique>[src]

Default constructs an instance of QTechnique.

Calls C++ function: [constructor] void Qt3DRender::QTechnique::QTechnique(Qt3DCore::QNode* parent = …).

C++ documentation:

Default constructs an instance of QTechnique.

pub unsafe fn new_0a() -> QBox<QTechnique>[src]

Encapsulates a Technique.

Calls C++ function: [constructor] void Qt3DRender::QTechnique::QTechnique().

C++ documentation:

Encapsulates a Technique.

A Qt3DRender::QTechnique specifies a set of Qt3DRender::QRenderPass objects, Qt3DRender::QFilterKey objects, Qt3DRender::QParameter objects and a Qt3DRender::QGraphicsApiFilter, which together define a rendering technique the given graphics API can render. The filter keys are used by Qt3DRender::QTechniqueFilter to select specific techniques at specific parts of the FrameGraph. If two QParameter instances with the same name are specified in a QTechnique and a QRenderPass, the one in Technique overrides the one used in the QRenderPass.

When creating an QEffect that targets several versions of a graphics API, it is useful to create several QTechnique nodes each with a graphicsApiFilter set to match one of the targeted GL versions. At runtime, the Qt3D renderer will select the most appropriate QTechnique based on which graphics API versions are supported and (if specified) the QFilterKey nodes that satisfy a given QTechniqueFilter in the FrameGraph.

Note: When using OpenGL as the graphics API for rendering, Qt3D relies on the QSurfaceFormat returned by QSurfaceFormat::defaultFormat() at runtime to decide what is the most appropriate GL version available. If you need to customize the QSurfaceFormat, do not forget to apply it with QSurfaceFormat::setDefaultFormat(). Setting the QSurfaceFormat on the view will likely have no effect on Qt3D related rendering.

QTechnique *gl3Technique = new QTechnique();

// Create the render passes QRenderPass firstPass = new QRenderPass(); QRenderPass secondPass = new QRenderPass();

// Add the passes to the technique gl3Technique->addRenderPass(firstPass); gl3Technique->addRenderPass(secondPass);

// Set the targeted GL version for the technique gl3Technique->graphicsApiFilter()->setApi(QGraphicsApiFilter::OpenGL); gl3Technique->graphicsApiFilter()->setMajorVersion(3); gl3Technique->graphicsApiFilter()->setMinorVersion(1); gl3Technique->graphicsApiFilter()->setProfile(QGraphicsApiFilter::CoreProfile);

// Create a FilterKey QFilterKey *filterKey = new QFilterKey(); filterKey->setName(QStringLiteral("name")); fitlerKey->setValue(QStringLiteral("zFillPass"));

// Add the FilterKey to the Technique gl3Technique->addFilterKey(filterKey);

// Create a QParameter QParameter *colorParameter = new QParameter(QStringLiteral("color"), QColor::fromRgbF(0.0f, 0.0f, 1.0f, 1.0f));

// Add parameter to technique gl3Technique->addParameter(colorParameter);

pub unsafe fn parameters(&self) -> CppBox<QVectorOfQParameter>[src]

Returns a vector of the techniques current parameters

Calls C++ function: QVector<Qt3DRender::QParameter*> Qt3DRender::QTechnique::parameters() const.

C++ documentation:

Returns a vector of the techniques current parameters

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int Qt3DRender::QTechnique::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* Qt3DRender::QTechnique::qt_metacast(const char* arg1).

pub unsafe fn remove_filter_key(
    &self,
    filter_key: impl CastInto<Ptr<QFilterKey>>
)
[src]

Removes filterKey from the Qt3DRender::QTechnique local filter keys.

Calls C++ function: void Qt3DRender::QTechnique::removeFilterKey(Qt3DRender::QFilterKey* filterKey).

C++ documentation:

Removes filterKey from the Qt3DRender::QTechnique local filter keys.

pub unsafe fn remove_parameter(&self, p: impl CastInto<Ptr<QParameter>>)[src]

Remove parameter from the technique's parameters.

Calls C++ function: void Qt3DRender::QTechnique::removeParameter(Qt3DRender::QParameter* p).

C++ documentation:

Remove parameter from the technique's parameters.

pub unsafe fn remove_render_pass(&self, pass: impl CastInto<Ptr<QRenderPass>>)[src]

Removes a pass from the technique.

Calls C++ function: void Qt3DRender::QTechnique::removeRenderPass(Qt3DRender::QRenderPass* pass).

C++ documentation:

Removes a pass from the technique.

pub unsafe fn render_passes(&self) -> CppBox<QVectorOfQRenderPass>[src]

Returns the list of render passes contained in the technique.

Calls C++ function: QVector<Qt3DRender::QRenderPass*> Qt3DRender::QTechnique::renderPasses() const.

C++ documentation:

Returns the list of render passes contained in the technique.

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn tr(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString Qt3DRender::QTechnique::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString Qt3DRender::QTechnique::trUtf8(const char* s, const char* c, int n).

Trait Implementations

impl CppDeletable for QTechnique[src]

unsafe fn delete(&self)[src]

Calls C++ function: virtual [destructor] void Qt3DRender::QTechnique::~QTechnique().

impl Deref for QTechnique[src]

type Target = QNode

The resulting type after dereferencing.

fn deref(&self) -> &QNode[src]

Calls C++ function: Qt3DCore::QNode* static_cast<Qt3DCore::QNode*>(Qt3DRender::QTechnique* ptr).

impl DynamicCast<QTechnique> for QNode[src]

unsafe fn dynamic_cast(ptr: Ptr<QNode>) -> Ptr<QTechnique>[src]

Calls C++ function: Qt3DRender::QTechnique* dynamic_cast<Qt3DRender::QTechnique*>(Qt3DCore::QNode* ptr).

impl DynamicCast<QTechnique> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QTechnique>[src]

Calls C++ function: Qt3DRender::QTechnique* dynamic_cast<Qt3DRender::QTechnique*>(QObject* ptr).

impl StaticDowncast<QTechnique> for QNode[src]

unsafe fn static_downcast(ptr: Ptr<QNode>) -> Ptr<QTechnique>[src]

Calls C++ function: Qt3DRender::QTechnique* static_cast<Qt3DRender::QTechnique*>(Qt3DCore::QNode* ptr).

impl StaticDowncast<QTechnique> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QTechnique>[src]

Calls C++ function: Qt3DRender::QTechnique* static_cast<Qt3DRender::QTechnique*>(QObject* ptr).

impl StaticUpcast<QNode> for QTechnique[src]

unsafe fn static_upcast(ptr: Ptr<QTechnique>) -> Ptr<QNode>[src]

Calls C++ function: Qt3DCore::QNode* static_cast<Qt3DCore::QNode*>(Qt3DRender::QTechnique* ptr).

impl StaticUpcast<QObject> for QTechnique[src]

unsafe fn static_upcast(ptr: Ptr<QTechnique>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(Qt3DRender::QTechnique* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.