![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <Material.h>
Public Types | |
| using | TextureMaps = std::unordered_map< std::string, t::geometry::Image > |
| using | ScalarPropertyMap = std::unordered_map< std::string, float > |
| using | VectorPropertyMap = std::unordered_map< std::string, Eigen::Vector4f, std::hash< std::string >, std::equal_to< std::string >, Eigen::aligned_allocator< std::pair< const std::string, Eigen::Vector4f > >> |
Public Member Functions | |
| Material ()=default | |
| Create an empty, invalid material. More... | |
| Material (const Material &mat)=default | |
| Material & | operator= (const Material &other)=default |
| Material (const std::string &material_name) | |
| Create an empty but valid material for the specified material name. More... | |
| void | SetDefaultProperties () |
| bool | IsValid () const |
| const std::string & | GetMaterialName () const |
| Get the name of the material. More... | |
| std::string | ToString () const |
| String reprentation for printing. More... | |
| const TextureMaps & | GetTextureMaps () const |
| Returns the texture map map. More... | |
| const t::geometry::Image & | GetTextureMap (const std::string &key) const |
| const ScalarPropertyMap & | GetScalarProperties () const |
| Returns the map of scalar properties. More... | |
| float | GetScalarProperty (const std::string &key) const |
| const VectorPropertyMap & | GetVectorProperties () const |
| Returns the map of vector properties. More... | |
| Eigen::Vector4f | GetVectorProperty (const std::string &key) const |
| void | SetTextureMap (const std::string &key, const t::geometry::Image &image) |
| void | SetScalarProperty (const std::string &key, float value) |
| void | SetVectorProperty (const std::string &key, const Eigen::Vector4f &value) |
| void | SetMaterialName (const std::string &material_name) |
| Set material name. The material name should match the name of a built. More... | |
| bool | HasTextureMap (const std::string &key) const |
| bool | HasScalarProperty (const std::string &key) const |
| bool | HasVectorProperty (const std::string &key) const |
| const t::geometry::Image & | GetAlbedoMap () const |
| const t::geometry::Image & | GetNormalMap () const |
| const t::geometry::Image & | GetAOMap () const |
| const t::geometry::Image & | GetMetallicMap () const |
| const t::geometry::Image & | GetRoughnessMap () const |
| const t::geometry::Image & | GetReflectanceMap () const |
| const t::geometry::Image & | GetClearcoatMap () const |
| const t::geometry::Image & | GetClearcoatRoughnessMap () const |
| const t::geometry::Image & | GetAnisotropyMap () const |
| const t::geometry::Image & | GetAORoughnessMetalMap () const |
| bool | HasAlbedoMap () const |
| bool | HasNormalMap () const |
| bool | HasAOMap () const |
| bool | HasMetallicMap () const |
| bool | HasRoughnessMap () const |
| bool | HasReflectanceMap () const |
| bool | HasClearcoatMap () const |
| bool | HasClearcoatRoughnessMap () const |
| bool | HasAnisotropyMap () const |
| bool | HasAORoughnessMetalMap () const |
| void | SetAlbedoMap (const t::geometry::Image &image) |
| void | SetNormalMap (const t::geometry::Image &image) |
| void | SetAOMap (const t::geometry::Image &image) |
| void | SetMetallicMap (const t::geometry::Image &image) |
| void | SetRoughnessMap (const t::geometry::Image &image) |
| void | SetReflectanceMap (const t::geometry::Image &image) |
| void | SetClearcoatMap (const t::geometry::Image &image) |
| void | SetClearcoatRoughnessMap (const t::geometry::Image &image) |
| void | SetAnisotropyMap (const t::geometry::Image &image) |
| void | SetAORoughnessMetalMap (const t::geometry::Image &image) |
| Eigen::Vector4f | GetBaseColor () const |
| float | GetBaseMetallic () const |
| float | GetBaseRoughness () const |
| float | GetBaseReflectance () const |
| float | GetBaseClearcoat () const |
| float | GetBaseClearcoatRoughness () const |
| float | GetAnisotropy () const |
| float | GetThickness () const |
| float | GetTransmission () const |
| Eigen::Vector4f | GetAbsorptionColor () const |
| float | GetAbsorptionDistance () const |
| Eigen::Vector4f | GetEmissiveColor () const |
| bool | HasBaseColor () const |
| bool | HasBaseMetallic () const |
| bool | HasBaseRoughness () const |
| bool | HasBaseReflectance () const |
| bool | HasBaseClearcoat () const |
| bool | HasBaseClearcoatRoughness () const |
| bool | HasAnisotropy () const |
| bool | HasThickness () const |
| bool | HasTransmission () const |
| bool | HasAbsorptionColor () const |
| bool | HasAbsorptionDistance () const |
| bool | HasEmissiveColor () const |
| void | SetBaseColor (const Eigen::Vector4f &value) |
| void | SetBaseMetallic (float value) |
| void | SetBaseRoughness (float value) |
| void | SetBaseReflectance (float value) |
| void | SetBaseClearcoat (float value) |
| void | SetBaseClearcoatRoughness (float value) |
| void | SetAnisotropy (float value) |
| void | SetThickness (float value) |
| void | SetTransmission (float value) |
| void | SetAbsorptionColor (const Eigen::Vector4f &value) |
| void | SetAbsorptionDistance (float value) |
| void | SetEmissiveColor (const Eigen::Vector4f &value) |
| float | GetPointSize () const |
| float | GetLineWidth () const |
| bool | HasPointSize () const |
| bool | HasLineWidth () const |
| void | SetPointSize (float value) |
| void | SetLineWidth (float value) |
| void | ToMaterialRecord (MaterialRecord &record) const |
| Fills a legacy MaterialRecord constructed from this Material. More... | |
Static Public Member Functions | |
| static Material | FromMaterialRecord (const MaterialRecord &mat) |
| Convert from MaterialRecord. More... | |
| using cloudViewer::visualization::rendering::Material::ScalarPropertyMap = std::unordered_map<std::string, float> |
| using cloudViewer::visualization::rendering::Material::TextureMaps = std::unordered_map<std::string, t::geometry::Image> |
| using cloudViewer::visualization::rendering::Material::VectorPropertyMap = std::unordered_map< std::string, Eigen::Vector4f, std::hash<std::string>, std::equal_to<std::string>, Eigen::aligned_allocator< std::pair<const std::string, Eigen::Vector4f> >> |
|
default |
Create an empty, invalid material.
|
default |
|
inline |
Create an empty but valid material for the specified material name.
|
static |
Convert from MaterialRecord.
References cloudViewer::visualization::rendering::MaterialRecord::absorption_distance, cloudViewer::visualization::rendering::MaterialRecord::albedo_img, cloudViewer::visualization::rendering::MaterialRecord::anisotropy_img, cloudViewer::visualization::rendering::MaterialRecord::ao_img, cloudViewer::visualization::rendering::MaterialRecord::ao_rough_metal_img, cloudViewer::visualization::rendering::MaterialRecord::base_anisotropy, cloudViewer::visualization::rendering::MaterialRecord::base_clearcoat, cloudViewer::visualization::rendering::MaterialRecord::base_clearcoat_roughness, cloudViewer::visualization::rendering::MaterialRecord::base_color, cloudViewer::visualization::rendering::MaterialRecord::base_metallic, cloudViewer::visualization::rendering::MaterialRecord::base_reflectance, cloudViewer::visualization::rendering::MaterialRecord::base_roughness, cloudViewer::visualization::rendering::MaterialRecord::clearcoat_img, cloudViewer::visualization::rendering::MaterialRecord::clearcoat_roughness_img, cloudViewer::visualization::rendering::MaterialRecord::emissive_color, cloudViewer::visualization::rendering::MaterialRecord::line_width, cloudViewer::visualization::rendering::MaterialRecord::metallic_img, cloudViewer::visualization::rendering::MaterialRecord::normal_img, cloudViewer::visualization::rendering::MaterialRecord::point_size, cloudViewer::visualization::rendering::MaterialRecord::reflectance_img, cloudViewer::visualization::rendering::MaterialRecord::roughness_img, SetAbsorptionDistance(), SetAlbedoMap(), SetAnisotropy(), SetAnisotropyMap(), SetAOMap(), SetAORoughnessMetalMap(), SetBaseClearcoat(), SetBaseClearcoatRoughness(), SetBaseColor(), SetBaseMetallic(), SetBaseReflectance(), SetBaseRoughness(), SetClearcoatMap(), SetClearcoatRoughnessMap(), SetEmissiveColor(), SetLineWidth(), SetMetallicMap(), SetNormalMap(), SetPointSize(), SetReflectanceMap(), SetRoughnessMap(), SetThickness(), SetTransmission(), cloudViewer::visualization::rendering::MaterialRecord::shader, cloudViewer::visualization::rendering::MaterialRecord::thickness, and cloudViewer::visualization::rendering::MaterialRecord::transmission.
Referenced by cloudViewer::t::geometry::TriangleMesh::FromTriangleMeshModel().
|
inline |
References GetVectorProperty().
Referenced by ToMaterialRecord().
|
inline |
References GetScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
The following are convenience methods for common PBR material properties
References GetTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References GetScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References GetTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References GetTextureMap().
Referenced by ToMaterialRecord().
|
inline |
Ambient occlusion, roughness, and metallic maps in a single 3 channel texture. Commonly used in glTF models.
References GetTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References GetScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References GetScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References GetVectorProperty().
Referenced by ToMaterialRecord().
|
inline |
References GetScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References GetScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References GetScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References GetTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References GetTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References GetVectorProperty().
Referenced by ToMaterialRecord().
|
inline |
References GetScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
Get the name of the material.
Referenced by cloudViewer::io::rpc::AddMaterialToMeshData(), cloudViewer::io::rpc::SetTriangleMesh(), and ToMaterialRecord().
|
inline |
References GetTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References GetTextureMap().
Referenced by ToMaterialRecord().
|
inline |
The following are convenience methods for Pointclouds and LineSet shaders
References GetScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References GetTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References GetTextureMap().
Referenced by ToMaterialRecord().
|
inline |
Returns the map of scalar properties.
Referenced by cloudViewer::io::rpc::AddMaterialToMeshData().
|
inline |
Get scalar properties of this Material. Throws exception if the property does not exist.
| key | Property name |
Referenced by GetAbsorptionDistance(), GetAnisotropy(), GetBaseClearcoat(), GetBaseClearcoatRoughness(), GetBaseMetallic(), GetBaseReflectance(), GetBaseRoughness(), GetLineWidth(), GetPointSize(), GetThickness(), and GetTransmission().
|
inline |
Get images (texture maps) of this Material. Throws exception if the image does not exist.
| key | Map name |
Referenced by GetAlbedoMap(), GetAnisotropyMap(), GetAOMap(), GetAORoughnessMetalMap(), GetClearcoatMap(), GetClearcoatRoughnessMap(), GetMetallicMap(), GetNormalMap(), GetReflectanceMap(), and GetRoughnessMap().
|
inline |
Returns the texture map map.
Referenced by cloudViewer::io::rpc::AddMaterialToMeshData().
|
inline |
References GetScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References GetScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
Returns the map of vector properties.
Referenced by cloudViewer::io::rpc::AddMaterialToMeshData().
|
inline |
Get vector properties of this Material. Throws exception if the property does not exist.
| key | Property name |
Referenced by GetAbsorptionColor(), GetBaseColor(), and GetEmissiveColor().
|
inline |
References HasVectorProperty().
Referenced by ToMaterialRecord().
|
inline |
References HasScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References HasTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References HasScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References HasTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References HasTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References HasTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References HasScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References HasScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References HasVectorProperty().
Referenced by ToMaterialRecord().
|
inline |
References HasScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References HasScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References HasScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References HasTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References HasTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References HasVectorProperty().
Referenced by ToMaterialRecord().
|
inline |
References HasScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References HasTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References HasTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References HasScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References HasTextureMap().
Referenced by ToMaterialRecord().
|
inline |
References HasTextureMap().
Referenced by ToMaterialRecord().
|
inline |
Return true if the property exists
| key | Property name |
Referenced by HasAbsorptionDistance(), HasAnisotropy(), HasBaseClearcoat(), HasBaseClearcoatRoughness(), HasBaseMetallic(), HasBaseReflectance(), HasBaseRoughness(), HasLineWidth(), HasPointSize(), HasThickness(), and HasTransmission().
|
inline |
Return true if the map exists
| key | Map name |
Referenced by HasAlbedoMap(), HasAnisotropyMap(), HasAOMap(), HasAORoughnessMetalMap(), HasClearcoatMap(), HasClearcoatRoughnessMap(), HasMetallicMap(), HasNormalMap(), HasReflectanceMap(), and HasRoughnessMap().
|
inline |
References HasScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
References HasScalarProperty().
Referenced by ToMaterialRecord().
|
inline |
Return true if the property exists
| key | Property name |
Referenced by HasAbsorptionColor(), HasBaseColor(), and HasEmissiveColor().
|
inline |
Returns true if the Material was not created with the default constructor and therefore has a valid shader name.
Referenced by cloudViewer::io::rpc::AddMaterialToMeshData(), cloudViewer::t::geometry::DrawableGeometry::HasMaterial(), cloudViewer::t::io::ReadTriangleMeshFromNPZ(), and ToString().
|
default |
|
inline |
References SetVectorProperty().
Referenced by SetDefaultProperties().
|
inline |
References SetScalarProperty().
Referenced by FromMaterialRecord(), and SetDefaultProperties().
|
inline |
References image, and SetTextureMap().
Referenced by FromMaterialRecord().
|
inline |
References SetScalarProperty().
Referenced by FromMaterialRecord(), and SetDefaultProperties().
|
inline |
References image, and SetTextureMap().
Referenced by FromMaterialRecord().
|
inline |
References image, and SetTextureMap().
Referenced by FromMaterialRecord().
|
inline |
References image, and SetTextureMap().
Referenced by FromMaterialRecord().
|
inline |
References SetScalarProperty().
Referenced by FromMaterialRecord(), and SetDefaultProperties().
|
inline |
References SetScalarProperty().
Referenced by FromMaterialRecord(), and SetDefaultProperties().
|
inline |
References SetVectorProperty().
Referenced by FromMaterialRecord(), and SetDefaultProperties().
|
inline |
References SetScalarProperty().
Referenced by FromMaterialRecord(), and SetDefaultProperties().
|
inline |
References SetScalarProperty().
Referenced by FromMaterialRecord(), and SetDefaultProperties().
|
inline |
References SetScalarProperty().
Referenced by FromMaterialRecord(), and SetDefaultProperties().
|
inline |
References image, and SetTextureMap().
Referenced by FromMaterialRecord().
|
inline |
References image, and SetTextureMap().
Referenced by FromMaterialRecord().
| void cloudViewer::visualization::rendering::Material::SetDefaultProperties | ( | ) |
Sets a number of properties to the defaults expected by CloudViewer shaders
References SetAbsorptionColor(), SetAbsorptionDistance(), SetAnisotropy(), SetBaseClearcoat(), SetBaseClearcoatRoughness(), SetBaseColor(), SetBaseMetallic(), SetBaseReflectance(), SetBaseRoughness(), SetEmissiveColor(), SetLineWidth(), SetPointSize(), SetThickness(), and SetTransmission().
Referenced by cloudViewer::t::io::ReadTriangleMeshFromNPZ().
|
inline |
References SetVectorProperty().
Referenced by FromMaterialRecord(), and SetDefaultProperties().
|
inline |
References SetScalarProperty().
Referenced by FromMaterialRecord(), and SetDefaultProperties().
|
inline |
Set material name. The material name should match the name of a built.
| shader | The name of the shader. |
Referenced by cloudViewer::t::io::ReadTriangleMeshFromNPZ().
|
inline |
References image, and SetTextureMap().
Referenced by FromMaterialRecord().
|
inline |
References image, and SetTextureMap().
Referenced by FromMaterialRecord().
|
inline |
References SetScalarProperty().
Referenced by FromMaterialRecord(), and SetDefaultProperties().
|
inline |
References image, and SetTextureMap().
Referenced by FromMaterialRecord().
|
inline |
References image, and SetTextureMap().
Referenced by FromMaterialRecord().
|
inline |
Set scalar property. If property already exists it is overwritten, otherwise a new key/value will be created.
| key | property name |
| value | Value to assign to property name |
Referenced by cloudViewer::io::rpc::GetMaterialFromMeshData(), cloudViewer::t::io::ReadTriangleMeshFromNPZ(), SetAbsorptionDistance(), SetAnisotropy(), SetBaseClearcoat(), SetBaseClearcoatRoughness(), SetBaseMetallic(), SetBaseReflectance(), SetBaseRoughness(), SetLineWidth(), SetPointSize(), SetThickness(), and SetTransmission().
| void cloudViewer::visualization::rendering::Material::SetTextureMap | ( | const std::string & | key, |
| const t::geometry::Image & | image | ||
| ) |
Set texture map. If map already exists it is overwritten, otherwise a new key/image will be created.
| key | map name |
| image | Image associated with map name |
References image.
Referenced by cloudViewer::io::rpc::GetMaterialFromMeshData(), cloudViewer::t::io::ReadTriangleMeshFromNPZ(), SetAlbedoMap(), SetAnisotropyMap(), SetAOMap(), SetAORoughnessMetalMap(), SetClearcoatMap(), SetClearcoatRoughnessMap(), SetMetallicMap(), SetNormalMap(), SetReflectanceMap(), and SetRoughnessMap().
|
inline |
References SetScalarProperty().
Referenced by FromMaterialRecord(), and SetDefaultProperties().
|
inline |
References SetScalarProperty().
Referenced by FromMaterialRecord(), and SetDefaultProperties().
|
inline |
Set vector property. If property already exists it is overwritten, otherwise a new key/value will be created.
| key | property name |
| value | Value to assign to property name |
Referenced by cloudViewer::io::rpc::GetMaterialFromMeshData(), SetAbsorptionColor(), SetBaseColor(), and SetEmissiveColor().
| void cloudViewer::visualization::rendering::Material::ToMaterialRecord | ( | MaterialRecord & | record | ) | const |
Fills a legacy MaterialRecord constructed from this Material.
References cloudViewer::visualization::rendering::MaterialRecord::absorption_color, cloudViewer::visualization::rendering::MaterialRecord::absorption_distance, cloudViewer::visualization::rendering::MaterialRecord::albedo_img, cloudViewer::visualization::rendering::MaterialRecord::anisotropy_img, cloudViewer::visualization::rendering::MaterialRecord::ao_img, cloudViewer::visualization::rendering::MaterialRecord::ao_rough_metal_img, cloudViewer::visualization::rendering::MaterialRecord::base_anisotropy, cloudViewer::visualization::rendering::MaterialRecord::base_clearcoat, cloudViewer::visualization::rendering::MaterialRecord::base_clearcoat_roughness, cloudViewer::visualization::rendering::MaterialRecord::base_color, cloudViewer::visualization::rendering::MaterialRecord::base_metallic, cloudViewer::visualization::rendering::MaterialRecord::base_reflectance, cloudViewer::visualization::rendering::MaterialRecord::base_roughness, cloudViewer::visualization::rendering::MaterialRecord::clearcoat_img, cloudViewer::visualization::rendering::MaterialRecord::clearcoat_roughness_img, data, cloudViewer::visualization::rendering::MaterialRecord::emissive_color, GetAbsorptionColor(), GetAbsorptionDistance(), GetAlbedoMap(), GetAnisotropy(), GetAnisotropyMap(), GetAOMap(), GetAORoughnessMetalMap(), GetBaseClearcoat(), GetBaseClearcoatRoughness(), GetBaseColor(), GetBaseMetallic(), GetBaseReflectance(), GetBaseRoughness(), GetClearcoatMap(), GetClearcoatRoughnessMap(), GetEmissiveColor(), GetLineWidth(), GetMaterialName(), GetMetallicMap(), GetNormalMap(), GetPointSize(), GetReflectanceMap(), GetRoughnessMap(), GetThickness(), GetTransmission(), HasAbsorptionColor(), HasAbsorptionDistance(), HasAlbedoMap(), HasAnisotropy(), HasAnisotropyMap(), HasAOMap(), HasAORoughnessMetalMap(), HasBaseClearcoat(), HasBaseClearcoatRoughness(), HasBaseColor(), HasBaseMetallic(), HasBaseReflectance(), HasBaseRoughness(), HasClearcoatMap(), HasClearcoatRoughnessMap(), HasEmissiveColor(), HasLineWidth(), HasMetallicMap(), HasNormalMap(), HasPointSize(), HasReflectanceMap(), HasRoughnessMap(), HasThickness(), HasTransmission(), cloudViewer::visualization::rendering::MaterialRecord::line_width, cloudViewer::visualization::rendering::MaterialRecord::metallic_img, cloudViewer::visualization::rendering::MaterialRecord::normal_img, cloudViewer::visualization::rendering::MaterialRecord::point_size, cloudViewer::visualization::rendering::MaterialRecord::reflectance_img, cloudViewer::visualization::rendering::MaterialRecord::roughness_img, cloudViewer::visualization::rendering::MaterialRecord::shader, cloudViewer::visualization::rendering::MaterialRecord::thickness, and cloudViewer::visualization::rendering::MaterialRecord::transmission.
| std::string cloudViewer::visualization::rendering::Material::ToString | ( | ) | const |
String reprentation for printing.
References IsValid().