Kanzi 4.0.0-beta2
kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment Class Reference

Container for data related to rendering into a single mipmap attachment. More...

#include <kanzi/core.ui/graphics3d/mipmap_generation_concept_impl.hpp>

Public Member Functions

void clearFramebuffers ()
 Clears the framebuffer setup.
 
MaterialBrushgetBrush () const
 Gets the brush owned by this attachment.
 
BrushRenderergetBrushRenderer () const
 Gets the brush renderer owned by this attachment.
 
TextureSharedPtr getColorTexture () const
 Gets the color texture associated with the framebuffer stack.
 
TextureSharedPtr getDepthTexture () const
 Gets the depth texture associated with the framebuffer stack.
 
MipmapFramebufferLevelgetFramebufferLevel (size_t index)
 Gets the framebuffer at given level.
 
MaterialSharedPtr getMaterial () const
 Gets the material currently associated with the contained brush.
 
constexpr bool isInitalized () const
 Indicates whether or not this attachment has been initialized.
 
 MipmapAttachment ()=default
 Default constructor.
 
 MipmapAttachment (const MipmapAttachment &)=delete
 Deleted copy constructor.
 
 MipmapAttachment (Domain *domain, const MaterialSharedPtr &material)
 Constructor for a material.
 
 MipmapAttachment (MipmapAttachment &&other)
 Move constructor.
 
constexpr operator bool () const
 Bool operator.
 
MipmapAttachmentoperator= (const MipmapAttachment &)=delete
 Deleted copy operator.
 
MipmapAttachmentoperator= (MipmapAttachment &&other)
 Move operator.
 
void setMaterial (const MaterialSharedPtr &material)
 Sets the material for the material brush.
 
void setupFramebuffers (Renderer &renderer, size_t attachmentIndex, const TextureSharedPtr &texture)
 Sets up the framebuffer chain intended for rendering into mipmap levels of given texture.
 

Protected Attributes

MaterialBrushSharedPtr m_brush
 Brush.
 
BrushRendererPtr m_brushRenderer
 Brush renderer.
 
vector< MipmapFramebufferLevelm_framebuffers
 Framebuffers for rendering into successive levels of mipmaps.
 

Detailed Description

template<typename TBaseClass, typename TDerivedClass, size_t FaceCount>
class kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment

Container for data related to rendering into a single mipmap attachment.

Instantiated per attachment.

Constructor & Destructor Documentation

◆ MipmapAttachment() [1/4]

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::MipmapAttachment ( )
explicitdefault

Default constructor.

◆ MipmapAttachment() [2/4]

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::MipmapAttachment ( Domain * domain,
const MaterialSharedPtr & material )
explicit

Constructor for a material.

Parameters
domainDomain to use.
materialMaterial to use.

◆ MipmapAttachment() [3/4]

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::MipmapAttachment ( MipmapAttachment && other)
inline

Move constructor.

Parameters
otherSource object.

◆ MipmapAttachment() [4/4]

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::MipmapAttachment ( const MipmapAttachment & )
delete

Deleted copy constructor.

Member Function Documentation

◆ operator=() [1/2]

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
MipmapAttachment & kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::operator= ( MipmapAttachment && other)
inline

Move operator.

Parameters
otherSource object.
Returns
This object.

◆ operator=() [2/2]

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
MipmapAttachment & kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::operator= ( const MipmapAttachment & )
delete

Deleted copy operator.

◆ clearFramebuffers()

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
void kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::clearFramebuffers ( )
inline

Clears the framebuffer setup.

Kanzi calls this function when there is texture associated with the attachment slot.

◆ getColorTexture()

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
TextureSharedPtr kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::getColorTexture ( ) const
inline

Gets the color texture associated with the framebuffer stack.

Returns
Color texture attached or nullptr.

◆ getDepthTexture()

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
TextureSharedPtr kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::getDepthTexture ( ) const
inline

Gets the depth texture associated with the framebuffer stack.

Returns
Depth texture attached or nullptr.

◆ getFramebufferLevel()

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
MipmapFramebufferLevel * kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::getFramebufferLevel ( size_t index)
inline

Gets the framebuffer at given level.

Parameters
indexIndex of level to get.
Returns
Framebuffer at given level or nullptr.

◆ getBrush()

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
MaterialBrush * kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::getBrush ( ) const
inline

Gets the brush owned by this attachment.

Returns
Contained brush or nullptr.

◆ getBrushRenderer()

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
BrushRenderer * kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::getBrushRenderer ( ) const
inline

Gets the brush renderer owned by this attachment.

Returns
Contained brush renderer or nullptr.

◆ isInitalized()

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
constexpr bool kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::isInitalized ( ) const
inlineconstexpr

Indicates whether or not this attachment has been initialized.

Returns
If the attachment is initialized true, false otherwise.

◆ getMaterial()

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
MaterialSharedPtr kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::getMaterial ( ) const

Gets the material currently associated with the contained brush.

Returns
Pointer to material or nullptr if uninitialized.

◆ setMaterial()

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
void kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::setMaterial ( const MaterialSharedPtr & material)

Sets the material for the material brush.

Parameters
materialMaterial to use.

◆ setupFramebuffers()

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
void kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::setupFramebuffers ( Renderer & renderer,
size_t attachmentIndex,
const TextureSharedPtr & texture )

Sets up the framebuffer chain intended for rendering into mipmap levels of given texture.

This function must be ran every time the texture is modified. Framebuffers are created and destroyed as needed.

Parameters
rendererRenderer to use.
attachmentIndexAttachment target.
textureTexture to render to.

◆ operator bool()

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
constexpr kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::operator bool ( ) const
inlineconstexpr

Bool operator.

Wraps around to initialization check.

Returns
If the attachment is initialized true, false otherwise.

Member Data Documentation

◆ m_framebuffers

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
vector<MipmapFramebufferLevel> kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::m_framebuffers
protected

Framebuffers for rendering into successive levels of mipmaps.

◆ m_brush

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
MaterialBrushSharedPtr kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::m_brush
protected

◆ m_brushRenderer

template<typename TBaseClass , typename TDerivedClass , size_t FaceCount>
BrushRendererPtr kanzi::MipmapGenerationConceptImpl< TBaseClass, TDerivedClass, FaceCount >::MipmapAttachment::m_brushRenderer
protected

Brush renderer.


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