10 #pragma warning(disable : 4789)
19 std::unordered_map<std::string, cloudViewer::t::geometry::Image>)
27 namespace visualization {
31 py::bind_map<std::unordered_map<std::string, t::geometry::Image>>(
33 py::bind_map<std::unordered_map<std::string, float>>(m,
"ScalarProperties");
34 py::bind_map<Material::VectorPropertyMap>(m,
"VectorProperties");
35 py::class_<Material, std::shared_ptr<Material>> mat(
37 "Properties (texture maps, scalar and vector) related to "
38 "visualization. Materials are optionally set for 3D geometries "
39 "such as TriangleMesh, LineSets, and PointClouds");
41 .def(py::init<Material>(),
"",
"mat"_a)
42 .def(py::init<const std::string&>(),
"",
"material_name"_a)
44 "Convert from MaterialRecord.")
47 "Fills material with defaults for common PBR material "
48 "properties used by CloudViewer")
50 "Returns false if material is an empty material")
54 .def_property_readonly(
"scalar_properties",
56 .def_property_readonly(
"vector_properties",
void SetMaterialName(const std::string &material_name)
Set material name. The material name should match the name of a built.
const std::string & GetMaterialName() const
Get the name of the material.
std::string ToString() const
String reprentation for printing.
void SetDefaultProperties()
const VectorPropertyMap & GetVectorProperties() const
Returns the map of vector properties.
const ScalarPropertyMap & GetScalarProperties() const
Returns the map of scalar properties.
static Material FromMaterialRecord(const MaterialRecord &mat)
Convert from MaterialRecord.
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 > >> VectorPropertyMap
const TextureMaps & GetTextureMaps() const
Returns the texture map map.
PYBIND11_MAKE_OPAQUE(std::vector< char >)
void pybind_material(py::module &m)
Generic file read and write utility for python interface.