ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
TextureRendererBase.cpp
Go to the documentation of this file.
1
// ----------------------------------------------------------------------------
2
// - CloudViewer: www.cloudViewer.org -
3
// ----------------------------------------------------------------------------
4
// Copyright (c) 2018-2024 www.cloudViewer.org
5
// SPDX-License-Identifier: MIT
6
// ----------------------------------------------------------------------------
7
8
#include "
renders/base/TextureRendererBase.h
"
9
10
#include <
CVLog.h
>
11
#include <
ecvMaterialSet.h
>
12
13
// VTK
14
#include <vtkActor.h>
15
#include <vtkProperty.h>
16
17
namespace
PclUtils
{
18
namespace
renders {
19
20
void
TextureRendererBase::ClearTextures
(vtkActor* actor) {
21
if
(!actor)
return
;
22
vtkProperty*
property
= actor->GetProperty();
23
if
(property) {
24
property
->RemoveAllTextures();
25
}
26
}
27
28
bool
TextureRendererBase::ValidateActor
(vtkActor* actor)
const
{
29
if
(!actor) {
30
CVLog::Error
(
"[TextureRendererBase::ValidateActor] Actor is null"
);
31
return
false
;
32
}
33
return
true
;
34
}
35
36
bool
TextureRendererBase::ValidateMaterials
(
37
const
ccMaterialSet
* materials)
const
{
38
if
(!materials) {
39
CVLog::Error
(
40
"[TextureRendererBase::ValidateMaterials] Materials is null"
);
41
return
false
;
42
}
43
if
(materials->empty()) {
44
CVLog::Warning
(
45
"[TextureRendererBase::ValidateMaterials] Materials is empty"
);
46
return
false
;
47
}
48
return
true
;
49
}
50
51
}
// namespace renders
52
}
// namespace PclUtils
CVLog.h
TextureRendererBase.h
CVLog::Warning
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition:
CVLog.cpp:133
CVLog::Error
static bool Error(const char *format,...)
Display an error dialog with formatted message.
Definition:
CVLog.cpp:143
PclUtils::renders::TextureRendererBase::ClearTextures
void ClearTextures(vtkActor *actor)
Helper: Clear all textures from actor.
Definition:
TextureRendererBase.cpp:20
PclUtils::renders::TextureRendererBase::ValidateActor
bool ValidateActor(vtkActor *actor) const
Helper: Validate actor.
Definition:
TextureRendererBase.cpp:28
PclUtils::renders::TextureRendererBase::ValidateMaterials
bool ValidateMaterials(const class ccMaterialSet *materials) const
Helper: Validate materials.
Definition:
TextureRendererBase.cpp:36
ccMaterialSet
Mesh (triangle) material.
Definition:
ecvMaterialSet.h:18
ecvMaterialSet.h
PclUtils
Definition:
CustomContextItem.cpp:18
libs
PCLEngine
PclUtils
renders
base
TextureRendererBase.cpp
Generated on Tue Feb 3 2026 07:12:25 for ACloudViewer by
1.9.1