Volume Cartographer 2.27.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
volcart::meshing::CalculateNormals Class Reference

Calculate vertex normals for ITK Meshes. More...

#include <vc/meshing/CalculateNormals.hpp>

Public Member Functions

 CalculateNormals (const ITKMesh::Pointer &mesh)
 
void setMesh (const ITKMesh::Pointer &mesh)
 Set the input mesh. More...
 
ITKMesh::Pointer getMesh () const
 Get the output mesh with computed normals. More...
 
ITKMesh::Pointer compute ()
 Compute vertex normals for the mesh.
 

Private Member Functions

void compute_normals_ ()
 Compute normals for each vertex. More...
 
void assign_to_mesh_ ()
 Assign the summed normals to the output mesh. More...
 

Private Attributes

ITKMesh::Pointer input_
 
ITKMesh::Pointer output_
 
std::vector< cv::Vec3d > vertexNormals_
 

Detailed Description

Calculate vertex normals for ITK Meshes.

Author
Hannah Hatch
Date
7/26/16

Given an ITK mesh, generates a copy of that mesh with embedded vertex normals.

Definition at line 25 of file CalculateNormals.hpp.

Constructor & Destructor Documentation

◆ CalculateNormals()

volcart::meshing::CalculateNormals::CalculateNormals ( const ITKMesh::Pointer &  mesh)
explicit
Parameters
meshInput Mesh whose normals you want computed

Member Function Documentation

◆ assign_to_mesh_()

void volcart::meshing::CalculateNormals::assign_to_mesh_ ( )
private

Assign the summed normals to the output mesh.

Takes the summed normals for each vertex and assigns them to the corresponding vertex in the output mesh.

◆ compute_normals_()

void volcart::meshing::CalculateNormals::compute_normals_ ( )
private

Compute normals for each vertex.

For each face, computes the normal to that face and adds the resulting vector to a sum vector for each vertex in that face.

◆ getMesh()

ITKMesh::Pointer volcart::meshing::CalculateNormals::getMesh ( ) const
inline

Get the output mesh with computed normals.

Definition at line 49 of file CalculateNormals.hpp.

◆ setMesh()

void volcart::meshing::CalculateNormals::setMesh ( const ITKMesh::Pointer &  mesh)

Set the input mesh.

Parameters
meshThe mesh for which normals will be calculated

Member Data Documentation

◆ input_

ITKMesh::Pointer volcart::meshing::CalculateNormals::input_
private

Mesh for which normals will be calculated.

Definition at line 75 of file CalculateNormals.hpp.

◆ output_

ITKMesh::Pointer volcart::meshing::CalculateNormals::output_
private

Mesh with calculated normals.

Definition at line 78 of file CalculateNormals.hpp.

◆ vertexNormals_

std::vector<cv::Vec3d> volcart::meshing::CalculateNormals::vertexNormals_
private

Storage for summed normals, organized by vertex ID

Definition at line 81 of file CalculateNormals.hpp.


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