EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
EBGeometry::STL< T > Class Template Reference

Class for storing contents of STL files. More...

#include <EBGeometry_STL.hpp>

Collaboration diagram for EBGeometry::STL< T >:
Collaboration graph
[legend]

Public Member Functions

 STL () noexcept=default
 Default constructor. Initializes empty member data holder.
 
 STL (const std::string &a_id) noexcept
 Constructor. Initializes empty vertices and facets but sets the STL ID (usually the file name.
 
 STL (const STL &a_other)=default
 Copy constructor.
 
 STL (STL &&a_other) noexcept=default
 Move constructor.
 
STLoperator= (const STL &a_other)=default
 Copy assignment operator.
 
STLoperator= (STL &&a_other) noexcept=default
 Move assignment operator.
 
 ~STL () noexcept=default
 Destructor (does nothing).
 
std::string & getID () noexcept
 Get the identifier for this object.
 
const std::string & getID () const noexcept
 Get the identifier for this object.
 
std::vector< Vec3T< T > > & getVertexCoordinates () noexcept
 Get the vertex coordinates.
 
const std::vector< Vec3T< T > > & getVertexCoordinates () const noexcept
 Get the vertex coordinates.
 
std::vector< std::vector< size_t > > & getFacets () noexcept
 Get the triangle facet indices.
 
const std::vector< std::vector< size_t > > & getFacets () const noexcept
 Get the triangle facet indices.
 
template<typename Meta >
std::shared_ptr< EBGeometry::DCEL::MeshT< T, Meta > > convertToDCEL () const noexcept
 Turn the STL mesh into a DCEL mesh.
 

Protected Attributes

std::string m_id
 STL object ID.
 
std::vector< Vec3T< T > > m_vertexCoordinates
 Vertex coordinates.
 
std::vector< std::vector< size_t > > m_facets
 Triangle facets.
 

Detailed Description

template<typename T>
class EBGeometry::STL< T >

Class for storing contents of STL files.

This structure is simply used as conversion utility between STL files and various EBGeometry objects (triangle soups, DCEL meshes, etc).

Template Parameters
TFloating-point precision for vertex coordinates.

Constructor & Destructor Documentation

◆ STL() [1/3]

template<typename T >
EBGeometry::STL< T >::STL ( const std::string &  a_id)
noexcept

Constructor. Initializes empty vertices and facets but sets the STL ID (usually the file name.

Parameters
[in]a_idIdentifier for STL object

◆ STL() [2/3]

template<typename T >
EBGeometry::STL< T >::STL ( const STL< T > &  a_other)
default

Copy constructor.

Parameters
[in]a_otherOther STL object.

◆ STL() [3/3]

template<typename T >
EBGeometry::STL< T >::STL ( STL< T > &&  a_other)
defaultnoexcept

Move constructor.

Parameters
[in,out]a_otherOther STL object.

Member Function Documentation

◆ convertToDCEL()

template<typename T >
template<typename Meta >
std::shared_ptr< EBGeometry::DCEL::MeshT< T, Meta > > EBGeometry::STL< T >::convertToDCEL ( ) const
noexcept

Turn the STL mesh into a DCEL mesh.

This call does not populate any meta-data in the DCEL mesh structures.

Template Parameters
MetaMetadata type attached to DCEL vertices, edges, and faces.
Returns
Shared pointer to the constructed DCEL mesh.

◆ getFacets() [1/2]

template<typename T >
const std::vector< std::vector< size_t > > & EBGeometry::STL< T >::getFacets ( ) const
noexcept

Get the triangle facet indices.

Returns
m_facets

◆ getFacets() [2/2]

template<typename T >
std::vector< std::vector< size_t > > & EBGeometry::STL< T >::getFacets ( )
noexcept

Get the triangle facet indices.

Returns
m_facets

◆ getID() [1/2]

template<typename T >
const std::string & EBGeometry::STL< T >::getID ( ) const
noexcept

Get the identifier for this object.

Returns
Const reference to the STL object identifier.

◆ getID() [2/2]

template<typename T >
std::string & EBGeometry::STL< T >::getID ( )
noexcept

Get the identifier for this object.

Returns
Reference to the STL object identifier.

◆ getVertexCoordinates() [1/2]

template<typename T >
const std::vector< Vec3T< T > > & EBGeometry::STL< T >::getVertexCoordinates ( ) const
noexcept

Get the vertex coordinates.

Returns
m_vertexCoordinates

◆ getVertexCoordinates() [2/2]

template<typename T >
std::vector< Vec3T< T > > & EBGeometry::STL< T >::getVertexCoordinates ( )
noexcept

Get the vertex coordinates.

Returns
m_vertexCoordinates

◆ operator=() [1/2]

template<typename T >
STL & EBGeometry::STL< T >::operator= ( const STL< T > &  a_other)
default

Copy assignment operator.

Parameters
[in]a_otherOther STL object.
Returns
Reference to (*this).

◆ operator=() [2/2]

template<typename T >
STL & EBGeometry::STL< T >::operator= ( STL< T > &&  a_other)
defaultnoexcept

Move assignment operator.

Parameters
[in,out]a_otherOther STL object.
Returns
Reference to (*this).

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