ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
PclUtils::renders::MultiTextureRenderer Class Reference

Multi-texture renderer. More...

#include <MultiTextureRenderer.h>

Inheritance diagram for PclUtils::renders::MultiTextureRenderer:
Collaboration diagram for PclUtils::renders::MultiTextureRenderer:

Public Member Functions

 MultiTextureRenderer ()
 
 ~MultiTextureRenderer () override=default
 
bool CanHandle (size_t material_count, bool has_pbr_textures, bool has_multiple_map_kd) const override
 Check if this renderer can handle the given material. More...
 
RenderingMode GetMode () const override
 Get the rendering mode this renderer implements. More...
 
bool Apply (vtkLODActor *actor, const class ccMaterialSet *materials, vtkPolyData *polydata, vtkRenderer *renderer) override
 Apply rendering to actor. More...
 
bool Update (vtkActor *actor, const class ccMaterialSet *materials, vtkPolyData *polydata, vtkRenderer *renderer) override
 Update existing actor with new materials. More...
 
std::string GetName () const override
 Get renderer name for logging. More...
 
bool ApplyMaterial (ccMaterial::CShared material, vtkActor *actor, float intensity_scale=1.0f) const
 Apply material properties to actor. More...
 
- Public Member Functions inherited from PclUtils::renders::TextureRendererBase
 TextureRendererBase ()=default
 
virtual ~TextureRendererBase ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from PclUtils::renders::TextureRendererBase
void ClearTextures (vtkActor *actor)
 Helper: Clear all textures from actor. More...
 
bool ValidateActor (vtkActor *actor) const
 Helper: Validate actor. More...
 
bool ValidateMaterials (const class ccMaterialSet *materials) const
 Helper: Validate materials. More...
 

Detailed Description

Multi-texture renderer.

Traditional multi-texture rendering using VTK's multi-texture API. Supports multiple textures with blending modes (REPLACE, ADD). Used when:

  • Multiple map_Kd textures are present (VTK PBR limitation)
  • Traditional texture rendering is preferred

Definition at line 32 of file MultiTextureRenderer.h.

Constructor & Destructor Documentation

◆ MultiTextureRenderer()

PclUtils::renders::MultiTextureRenderer::MultiTextureRenderer ( )
default

◆ ~MultiTextureRenderer()

PclUtils::renders::MultiTextureRenderer::~MultiTextureRenderer ( )
overridedefault

Member Function Documentation

◆ Apply()

bool PclUtils::renders::MultiTextureRenderer::Apply ( vtkLODActor *  actor,
const class ccMaterialSet materials,
vtkPolyData *  polydata,
vtkRenderer *  renderer 
)
overridevirtual

Apply rendering to actor.

Parameters
actorVTK actor to render
materialsMaterial set
polydataPolygon data (for texture coordinates)
rendererVTK renderer (for lighting setup)
Returns
true on success

Implements PclUtils::renders::TextureRendererBase.

Definition at line 67 of file MultiTextureRenderer.cpp.

References ecvColor::RgbaTpl< Type >::a, ApplyMaterial(), PclUtils::renders::TextureRendererBase::ClearTextures(), CVLog::Error(), CVTools::FromQString(), ccMaterial::GetTexture(), CVLog::Print(), CVLog::PrintDebug(), PclUtils::renders::TextureRendererBase::ValidateActor(), PclUtils::renders::TextureRendererBase::ValidateMaterials(), and CVLog::Warning().

Referenced by Update().

◆ ApplyMaterial()

bool PclUtils::renders::MultiTextureRenderer::ApplyMaterial ( ccMaterial::CShared  material,
vtkActor *  actor,
float  intensity_scale = 1.0f 
) const

Apply material properties to actor.

Note
This is a public method that can be used standalone

Definition at line 582 of file MultiTextureRenderer.cpp.

References ecvColor::RgbaTpl< Type >::a, ecvColor::RgbaTpl< Type >::b, ecvColor::RgbaTpl< Type >::g, and ecvColor::RgbaTpl< Type >::r.

Referenced by Apply().

◆ CanHandle()

bool PclUtils::renders::MultiTextureRenderer::CanHandle ( size_t  material_count,
bool  has_pbr_textures,
bool  has_multiple_map_kd 
) const
overridevirtual

Check if this renderer can handle the given material.

Parameters
material_countNumber of materials
has_pbr_texturesWhether material has PBR textures
has_multiple_map_kdWhether material has multiple map_Kd textures
Returns
true if this renderer can handle the material

Implements PclUtils::renders::TextureRendererBase.

Definition at line 51 of file MultiTextureRenderer.cpp.

◆ GetMode()

RenderingMode PclUtils::renders::MultiTextureRenderer::GetMode ( ) const
overridevirtual

Get the rendering mode this renderer implements.

Implements PclUtils::renders::TextureRendererBase.

Definition at line 63 of file MultiTextureRenderer.cpp.

References PclUtils::renders::MULTI_TEXTURE.

◆ GetName()

std::string PclUtils::renders::MultiTextureRenderer::GetName ( ) const
overridevirtual

Get renderer name for logging.

Implements PclUtils::renders::TextureRendererBase.

Definition at line 446 of file MultiTextureRenderer.cpp.

◆ Update()

bool PclUtils::renders::MultiTextureRenderer::Update ( vtkActor *  actor,
const class ccMaterialSet materials,
vtkPolyData *  polydata,
vtkRenderer *  renderer 
)
overridevirtual

Update existing actor with new materials.

Parameters
actorVTK actor to update
materialsMaterial set
polydataPolygon data
rendererVTK renderer
Returns
true on success

Implements PclUtils::renders::TextureRendererBase.

Definition at line 428 of file MultiTextureRenderer.cpp.

References Apply(), PclUtils::renders::TextureRendererBase::ValidateActor(), PclUtils::renders::TextureRendererBase::ValidateMaterials(), and CVLog::Warning().


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