Volume Cartographer 2.27.0
Public Member Functions | Private Attributes | List of all members
volcart::texturing::PPMGenerator Class Reference

Generates a PerPixelMap from an ITKMesh and a UVMap. More...

#include <vc/texturing/PPMGenerator.hpp>

Inheritance diagram for volcart::texturing::PPMGenerator:
[legend]
Collaboration diagram for volcart::texturing::PPMGenerator:
[legend]

Public Member Functions

auto progressIterations () const -> std::size_t override
 Returns the maximum progress value. More...
 
void setMesh (const ITKMesh::Pointer &m)
 Set the input mesh.
 
void setUVMap (const UVMap::Pointer &u)
 Set the input UV map.
 
void setDimensions (std::size_t h, std::size_t w)
 Set the dimensions of the output PPM.
 
void setShading (Shading s)
 Set the normal shading method.
 
auto compute () -> PerPixelMap::Pointer
 Compute the PerPixelMap.
 
auto getPPM () const -> PerPixelMap::Pointer
 Get the generated PerPixelMap.
 
virtual std::size_t progressIterations () const =0
 

Private Attributes

ITKMesh::Pointer inputMesh_
 
UVMap::Pointer uvMap_
 
ITKMesh::Pointer workingMesh_
 
PerPixelMap::Pointer ppm_
 
Shading shading_ {Shading::Smooth}
 
std::size_t width_ {0}
 
std::size_t height_ {0}
 
enum class  Shading { Flat = 0 , Smooth }
 Pixel normal shading method. More...
 
 PPMGenerator ()=default
 
 PPMGenerator (std::size_t h, std::size_t w)
 

Additional Inherited Members

- Public Attributes inherited from volcart::IterationsProgress
Signal progressStarted
 
Signal< std::size_t > progressUpdated
 
Signal progressComplete
 

Detailed Description

Generates a PerPixelMap from an ITKMesh and a UVMap.

Rasters a UVMap and embeds the raster with 2D-to-3D lookup information. Each pixel in the PPM stores a vector of six double-precision floats which correspond to the 3D position and normal vector associated with that pixel: {x, y, z, nx, ny, nz}

This class uses raytracing functionality provided by the bvh library.

See also
volcart::PerPixelMap

Definition at line 28 of file PPMGenerator.hpp.

Member Enumeration Documentation

◆ Shading

Pixel normal shading method.

Enumerator
Flat 

Each pixel inherits the face's normal.

Smooth 

Each pixel's normal is a linear interpolation of the face's vertex normals. This is similar to Phong shading.

Definition at line 33 of file PPMGenerator.hpp.

Constructor & Destructor Documentation

◆ PPMGenerator() [1/2]

volcart::texturing::PPMGenerator::PPMGenerator ( )
default

Default constructor

◆ PPMGenerator() [2/2]

volcart::texturing::PPMGenerator::PPMGenerator ( std::size_t  h,
std::size_t  w 
)

Construct with dimension parameters

Member Function Documentation

◆ progressIterations()

auto volcart::texturing::PPMGenerator::progressIterations ( ) const -> std::size_t
overridevirtual

Returns the maximum progress value.

Implements volcart::IterationsProgress.

Member Data Documentation

◆ height_

std::size_t volcart::texturing::PPMGenerator::height_ {0}
private

Output height of the PerPixelMap

Definition at line 94 of file PPMGenerator.hpp.

◆ inputMesh_

ITKMesh::Pointer volcart::texturing::PPMGenerator::inputMesh_
private

Input mesh

Definition at line 81 of file PPMGenerator.hpp.

◆ ppm_

PerPixelMap::Pointer volcart::texturing::PPMGenerator::ppm_
private

Output PerPixelMap

Definition at line 88 of file PPMGenerator.hpp.

◆ shading_

Shading volcart::texturing::PPMGenerator::shading_ {Shading::Smooth}
private

Output shading

Definition at line 90 of file PPMGenerator.hpp.

◆ uvMap_

UVMap::Pointer volcart::texturing::PPMGenerator::uvMap_
private

Input UV Map

Definition at line 83 of file PPMGenerator.hpp.

◆ width_

std::size_t volcart::texturing::PPMGenerator::width_ {0}
private

Output width of the PerPixelMap

Definition at line 92 of file PPMGenerator.hpp.

◆ workingMesh_

ITKMesh::Pointer volcart::texturing::PPMGenerator::workingMesh_
private

Working mesh

Definition at line 86 of file PPMGenerator.hpp.


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