KiCad PCB EDA Suite
Loading...
Searching...
No Matches
U3D::MESH Class Reference

#include <writer.h>

Public Member Functions

bool IsEmpty ()
 
uint32_t GetOrAddUniqueDiffuseColor (const Graphic3d_Vec4 &aColor)
 
uint32_t GetOrAddUniqueSpecularColor (const Graphic3d_Vec4 &aColor)
 

Public Attributes

std::vector< VECTOR3Dcoords
 
std::vector< VECTOR3Dnormals
 
std::vector< Graphic3d_Vec4 > diffuse_colors
 List of all unique diffuse colors.
 
std::vector< Graphic3d_Vec4 > specular_colors
 List of all unique specular colors.
 
std::unordered_map< Graphic3d_Vec4, uint32_t > diffuse_colors_index_map
 Index map helps select the color index for a given vertex when creating the colorIndices.
 
std::unordered_map< Graphic3d_Vec4, uint32_t > specular_colors_index_map
 Index map helps select the color index for a given vertex when creating the colorIndices.
 
std::vector< uint32_t > coordIndices
 Coordinate indices, maps vertex positions to triangles.
 
std::vector< uint32_t > normalIndices
 Coordinate indices, maps vertex normal positions to triangles.
 
std::vector< uint32_t > diffuseColorIndices
 Coordinate indices, maps each vertex to a diffuse color.
 
std::vector< uint32_t > specularColorIndices
 Coordinate indices, maps each vertex to a specular color.
 
Graphic3d_Vec4 diffuse_color
 Diffuse color used if not using per-vertex color.
 
Graphic3d_Vec3 specular_color
 Specular color used if not using per-vertex color.
 
std::string name
 The name of the mesh, this will be visible in U3D viewers.
 
std::string parentName
 Parent name (if any) to group the mesh under.
 
bool perVertexColor
 

Detailed Description

Definition at line 69 of file writer.h.

Member Function Documentation

◆ GetOrAddUniqueDiffuseColor()

uint32_t U3D::MESH::GetOrAddUniqueDiffuseColor ( const Graphic3d_Vec4 & aColor)
inline

Definition at line 141 of file writer.h.

References diffuse_colors, and diffuse_colors_index_map.

◆ GetOrAddUniqueSpecularColor()

uint32_t U3D::MESH::GetOrAddUniqueSpecularColor ( const Graphic3d_Vec4 & aColor)
inline

Definition at line 158 of file writer.h.

References specular_colors, and specular_colors_index_map.

◆ IsEmpty()

bool U3D::MESH::IsEmpty ( )
inline

Definition at line 136 of file writer.h.

References coordIndices, and coords.

Member Data Documentation

◆ coordIndices

std::vector<uint32_t> U3D::MESH::coordIndices

Coordinate indices, maps vertex positions to triangles.

Definition at line 97 of file writer.h.

Referenced by U3D::WRITER::collectGeometryRecursive(), U3D::WRITER::getMeshContinuationBlock(), U3D::WRITER::getMeshDeclarationBlock(), and IsEmpty().

◆ coords

◆ diffuse_color

Graphic3d_Vec4 U3D::MESH::diffuse_color

Diffuse color used if not using per-vertex color.

Definition at line 117 of file writer.h.

◆ diffuse_colors

std::vector<Graphic3d_Vec4> U3D::MESH::diffuse_colors

List of all unique diffuse colors.

Definition at line 79 of file writer.h.

Referenced by U3D::WRITER::getMeshContinuationBlock(), U3D::WRITER::getMeshDeclarationBlock(), and GetOrAddUniqueDiffuseColor().

◆ diffuse_colors_index_map

std::unordered_map<Graphic3d_Vec4, uint32_t> U3D::MESH::diffuse_colors_index_map

Index map helps select the color index for a given vertex when creating the colorIndices.

Definition at line 88 of file writer.h.

Referenced by GetOrAddUniqueDiffuseColor().

◆ diffuseColorIndices

std::vector<uint32_t> U3D::MESH::diffuseColorIndices

Coordinate indices, maps each vertex to a diffuse color.

Definition at line 107 of file writer.h.

Referenced by U3D::WRITER::getMeshContinuationBlock().

◆ name

std::string U3D::MESH::name

The name of the mesh, this will be visible in U3D viewers.

Definition at line 127 of file writer.h.

Referenced by U3D::WRITER::getMeshName().

◆ normalIndices

std::vector<uint32_t> U3D::MESH::normalIndices

Coordinate indices, maps vertex normal positions to triangles.

Definition at line 102 of file writer.h.

Referenced by U3D::WRITER::collectGeometryRecursive(), and U3D::WRITER::getMeshContinuationBlock().

◆ normals

◆ parentName

std::string U3D::MESH::parentName

Parent name (if any) to group the mesh under.

Definition at line 132 of file writer.h.

◆ perVertexColor

bool U3D::MESH::perVertexColor

Definition at line 134 of file writer.h.

◆ specular_color

Graphic3d_Vec3 U3D::MESH::specular_color

Specular color used if not using per-vertex color.

Definition at line 122 of file writer.h.

◆ specular_colors

std::vector<Graphic3d_Vec4> U3D::MESH::specular_colors

List of all unique specular colors.

Definition at line 84 of file writer.h.

Referenced by U3D::WRITER::getMeshContinuationBlock(), U3D::WRITER::getMeshDeclarationBlock(), and GetOrAddUniqueSpecularColor().

◆ specular_colors_index_map

std::unordered_map<Graphic3d_Vec4, uint32_t> U3D::MESH::specular_colors_index_map

Index map helps select the color index for a given vertex when creating the colorIndices.

Definition at line 92 of file writer.h.

Referenced by GetOrAddUniqueSpecularColor().

◆ specularColorIndices

std::vector<uint32_t> U3D::MESH::specularColorIndices

Coordinate indices, maps each vertex to a specular color.

Definition at line 112 of file writer.h.

Referenced by U3D::WRITER::getMeshContinuationBlock().


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