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

Utility class for applying textures to mesh actors. More...

#include <MeshTextureApplier.h>

Static Public Member Functions

static bool ApplyTexturesFromCCMesh (vtkLODActor *actor, ccGenericMesh *mesh, vtkPolyData *polydata, TextureRenderManager *render_manager, vtkRenderer *renderer)
 Apply textures from ccGenericMesh (preferred method) More...
 
static bool ApplyTexturesFromMaterialSet (vtkLODActor *actor, const ccMaterialSet *materials, const std::vector< std::vector< Eigen::Vector2f >> &tex_coordinates, vtkPolyData *polydata, TextureRenderManager *render_manager, vtkRenderer *renderer)
 Apply textures from ccMaterialSet with texture coordinates. More...
 
static bool ApplyPBRTextures (vtkLODActor *actor, const pcl::TextureMesh &mesh, vtkPolyData *polydata, TextureRenderManager *render_manager, vtkRenderer *renderer)
 Apply PBR textures from PCLTextureMesh (deprecated) More...
 
static bool ApplyTraditionalTextures (vtkLODActor *actor, const pcl::TextureMesh &mesh, vtkPolyData *polydata, vtkRenderWindow *render_window)
 Apply textures from PCLTextureMesh to actor (traditional path) More...
 

Detailed Description

Utility class for applying textures to mesh actors.

Handles texture application from mesh to VTK actors. Supports both PCLTextureMesh (legacy) and ccGenericMesh (preferred) sources.

Definition at line 34 of file MeshTextureApplier.h.

Member Function Documentation

◆ ApplyPBRTextures()

bool PclUtils::renders::MeshTextureApplier::ApplyPBRTextures ( vtkLODActor *  actor,
const pcl::TextureMesh &  mesh,
vtkPolyData *  polydata,
TextureRenderManager render_manager,
vtkRenderer *  renderer 
)
static

Apply PBR textures from PCLTextureMesh (deprecated)

Deprecated:
Use ApplyTexturesFromCCMesh or ApplyTexturesFromMaterialSet instead
Note
This method converts pcl::TexMaterial to ccMaterialSet internally

Definition at line 250 of file MeshTextureApplier.cpp.

References ccMaterialSet::addMaterial(), ApplyTexturesFromMaterialSet(), pcl2cc::FromPCLMaterial(), and CVLog::Print().

Referenced by PclUtils::PCLVis::addTextureMesh().

◆ ApplyTexturesFromCCMesh()

bool PclUtils::renders::MeshTextureApplier::ApplyTexturesFromCCMesh ( vtkLODActor *  actor,
ccGenericMesh mesh,
vtkPolyData *  polydata,
TextureRenderManager render_manager,
vtkRenderer *  renderer 
)
static

Apply textures from ccGenericMesh (preferred method)

Parameters
actorVTK actor to apply textures to
meshccGenericMesh containing materials and texture coordinates
polydataPolygon data (for texture coordinates)
render_managerTexture render manager for applying materials
rendererVTK renderer (optional)
Returns
true on success

Definition at line 46 of file MeshTextureApplier.cpp.

References ApplyTexturesFromMaterialSet(), CVLog::Error(), ccGenericMesh::getAssociatedCloud(), ccGenericMesh::getMaterialSet(), cc2smReader::getVtkPolyDataWithTextures(), CVLog::Print(), ccHObjectCaster::ToPointCloud(), and CVLog::Warning().

◆ ApplyTexturesFromMaterialSet()

bool PclUtils::renders::MeshTextureApplier::ApplyTexturesFromMaterialSet ( vtkLODActor *  actor,
const ccMaterialSet materials,
const std::vector< std::vector< Eigen::Vector2f >> &  tex_coordinates,
vtkPolyData *  polydata,
TextureRenderManager render_manager,
vtkRenderer *  renderer 
)
static

Apply textures from ccMaterialSet with texture coordinates.

Parameters
actorVTK actor to apply textures to
materialsMaterial set containing texture information
tex_coordinatesTexture coordinates per material
polydataPolygon data (for texture coordinates)
render_managerTexture render manager for applying materials
rendererVTK renderer (optional)
Returns
true on success

Definition at line 111 of file MeshTextureApplier.cpp.

References PclUtils::renders::TextureRenderManager::Apply(), CVLog::PrintDebug(), and CVLog::Warning().

Referenced by PclUtils::PCLVis::addTextureMeshFromCCMesh(), ApplyPBRTextures(), and ApplyTexturesFromCCMesh().

◆ ApplyTraditionalTextures()

bool PclUtils::renders::MeshTextureApplier::ApplyTraditionalTextures ( vtkLODActor *  actor,
const pcl::TextureMesh &  mesh,
vtkPolyData *  polydata,
vtkRenderWindow *  render_window 
)
static

Apply textures from PCLTextureMesh to actor (traditional path)

Deprecated:
Use TextureRenderManager instead

Definition at line 294 of file MeshTextureApplier.cpp.

References CVLog::Warning().


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