Public Types | Public Member Functions | Private Attributes | List of all members
tesseract_geometry::MeshTexture Class Reference

Represents a texture and UV coordinates extracted from a mesh file. More...

#include <mesh_material.h>

Public Types

using ConstPtr = std::shared_ptr< const MeshTexture >
 
using Ptr = std::shared_ptr< MeshTexture >
 

Public Member Functions

std::shared_ptr< tesseract_common::ResourcegetTextureImage () const
 Get the texture image. More...
 
const std::shared_ptr< const tesseract_common::VectorVector2d > & getUVs ()
 Get the texture UV coordinates. More...
 
 MeshTexture (std::shared_ptr< tesseract_common::Resource > texture_image, std::shared_ptr< const tesseract_common::VectorVector2d > uvs)
 Construct a new MeshTexture. More...
 

Private Attributes

std::shared_ptr< tesseract_common::Resourcetexture_image_
 
std::shared_ptr< const tesseract_common::VectorVector2duvs_
 

Detailed Description

Represents a texture and UV coordinates extracted from a mesh file.

Mesh files contain (or reference) image files that form textures on the surface of the mesh. UV coordinates specify how the image is applied to the mesh. The MeshTexture structure contains a resource to the image, and the UV coordinates. Currently only jpg and png image formats are supported.

UV coordinates specify the location of each vertex in the mesh on the texture. Each (u,v) coordinate is normalized to be between 0 and 1.

Definition at line 137 of file mesh_material.h.

Member Typedef Documentation

◆ ConstPtr

Definition at line 141 of file mesh_material.h.

◆ Ptr

Definition at line 140 of file mesh_material.h.

Constructor & Destructor Documentation

◆ MeshTexture()

tesseract_geometry::MeshTexture::MeshTexture ( std::shared_ptr< tesseract_common::Resource texture_image,
std::shared_ptr< const tesseract_common::VectorVector2d uvs 
)

Construct a new MeshTexture.

Parameters
texture_imageResource representing the texture image (jpg or png)
uvsUV coordinates for texture on mesh

Definition at line 51 of file mesh_material.cpp.

Member Function Documentation

◆ getTextureImage()

std::shared_ptr< tesseract_common::Resource > tesseract_geometry::MeshTexture::getTextureImage ( ) const

Get the texture image.

Must be jpg or png

Returns
Resource to the texture image

Definition at line 57 of file mesh_material.cpp.

◆ getUVs()

const std::shared_ptr< const tesseract_common::VectorVector2d > & tesseract_geometry::MeshTexture::getUVs ( )

Get the texture UV coordinates.

Returns
UV coordinate vector

Definition at line 59 of file mesh_material.cpp.

Member Data Documentation

◆ texture_image_

std::shared_ptr<tesseract_common::Resource> tesseract_geometry::MeshTexture::texture_image_
private

Definition at line 172 of file mesh_material.h.

◆ uvs_

std::shared_ptr<const tesseract_common::VectorVector2d> tesseract_geometry::MeshTexture::uvs_
private

Definition at line 169 of file mesh_material.h.


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


tesseract_geometry
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:46