Volume Cartographer 2.27.0
Public Types | Public Member Functions | Private Attributes | List of all members
volcart::meshing::OrientNormals Class Reference

Orient vertex normals towards a reference point. More...

#include <vc/meshing/OrientNormals.hpp>

Public Types

enum class  ReferenceMode { Centroid , Manual }
 Reference point mode. More...
 

Public Member Functions

 OrientNormals ()=default
 Default constructor.
 
void setMesh (const ITKMesh::Pointer &mesh)
 Set the input mesh.
 
auto getMesh () const -> ITKMesh::Pointer
 Get the output mesh with updated normals.
 
void setReferenceMode (ReferenceMode mode)
 Set reference point mode. More...
 
auto referenceMode () const -> ReferenceMode
 Get the current reference mode.
 
void setReferencePoint (const cv::Vec3d &point)
 Set manual reference point. More...
 
auto referencePoint () const -> cv::Vec3d
 Get the manually defined reference point.
 
auto compute () -> ITKMesh::Pointer
 Compute vertex normal reorientation.
 

Private Attributes

ITKMesh::Pointer input_
 
ReferenceMode mode_ {ReferenceMode::Centroid}
 
cv::Vec3d refPt_
 
ITKMesh::Pointer output_
 

Detailed Description

Orient vertex normals towards a reference point.

If vertex normals are flipped, the face normals are also flipped by reversing the winding order of all faces. This assumes that vertex normals were originally derived from the face normals and point in generally the same direction as the face normals.

Definition at line 22 of file OrientNormals.hpp.

Member Enumeration Documentation

◆ ReferenceMode

Reference point mode.

Enumerator
Centroid 

Mesh centroid reference point for convex meshes.

Manual 

Point provided by setReferencePoint().

Definition at line 26 of file OrientNormals.hpp.

Member Function Documentation

◆ setReferenceMode()

void volcart::meshing::OrientNormals::setReferenceMode ( ReferenceMode  mode)

Set reference point mode.

Determines which automatically calculated reference point to use. See ReferenceMode for more details.

◆ setReferencePoint()

void volcart::meshing::OrientNormals::setReferencePoint ( const cv::Vec3d &  point)

Set manual reference point.

If provided, automatically sets the reference mode to ReferenceMode::Manual.

Member Data Documentation

◆ input_

ITKMesh::Pointer volcart::meshing::OrientNormals::input_
private

Input mesh

Definition at line 67 of file OrientNormals.hpp.

◆ mode_

ReferenceMode volcart::meshing::OrientNormals::mode_ {ReferenceMode::Centroid}
private

Reference point mode

Definition at line 69 of file OrientNormals.hpp.

◆ output_

ITKMesh::Pointer volcart::meshing::OrientNormals::output_
private

Output mesh

Definition at line 73 of file OrientNormals.hpp.

◆ refPt_

cv::Vec3d volcart::meshing::OrientNormals::refPt_
private

User-defined reference point

Definition at line 71 of file OrientNormals.hpp.


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