EBGeometry 1.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
VTK< T > Class Template Reference

Class for storing VTK Polydata meshes. More...

#include <EBGeometry_VTK.hpp>

Public Member Functions

 VTK () noexcept
 Default constructor. Initializes empty member data holder.
 
 VTK (const std::string a_id) noexcept
 Constructor. Initializes empty vertices and facets but sets the VTK ID (usually the file name.
 
virtual ~VTK () noexcept
 Destructor. Clears all data.
 
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 face indices.
 
const std::vector< std::vector< size_t > > & getFacets () const noexcept
 Get the face indices.
 
std::vector< T > & getPointDataScalars (const std::string a_name) noexcept
 Get the point data scalars.
 
const std::vector< T > & getPointDataScalars (const std::string a_name) const noexcept
 Get the point data scalars.
 
std::vector< T > & getCellDataScalars (const std::string a_name) noexcept
 Get the cell data scalars.
 
const std::vector< T > & getCellDataScalars (const std::string a_name) const noexcept
 Get the cell data scalars.
 
void setPointDataScalars (const std::string a_name, const std::vector< T > &a_data) noexcept
 Set point data scalars.
 
void setCellDataScalars (const std::string a_name, const std::vector< T > &a_data) noexcept
 Set cell data scalars.
 
template<typename Meta >
std::shared_ptr< EBGeometry::DCEL::MeshT< T, Meta > > convertToDCEL () const noexcept
 Turn the VTK mesh into a DCEL mesh.
 

Protected Attributes

std::string m_id
 VTK object ID.
 
std::vector< Vec3T< T > > m_vertexCoordinates
 Vertex coordinates.
 
std::vector< std::vector< size_t > > m_facets
 Faces – each entry in the outer vector contains the indices defining one face.
 
std::map< std::string, std::vector< T > > m_pointDataScalars
 Point data scalar arrays.
 
std::map< std::string, std::vector< T > > m_cellDataScalars
 Cell data scalar arrays.
 

Detailed Description

template<typename T>
class VTK< T >

Class for storing VTK Polydata meshes.

Note
T is the precision used for storing the mesh.

Constructor & Destructor Documentation

◆ VTK()

template<typename T >
VTK< T >::VTK ( const std::string  a_id)
noexcept

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

Parameters
[in]a_idIdentifier for VTK object

Member Function Documentation

◆ convertToDCEL()

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

Turn the VTK mesh into a DCEL mesh.

This call does not populate any meta-data in the DCEL mesh structures. If you need to also populate the meta-data on vertices and faces, you should not use this function but supply your own constructor.

◆ getCellDataScalars() [1/2]

template<typename T >
const std::vector< T > & VTK< T >::getCellDataScalars ( const std::string  a_name) const
noexcept

Get the cell data scalars.

Parameters
[in]a_nameScalar array name
Note
Function will fail if the array does not exist
Returns
m_cellDataScalars at provided name

◆ getCellDataScalars() [2/2]

template<typename T >
std::vector< T > & VTK< T >::getCellDataScalars ( const std::string  a_name)
noexcept

Get the cell data scalars.

Parameters
[in]a_nameScalar array name
Note
Function will fail if the array does not exist
Returns
m_cellDataScalars at provided name

◆ getFacets() [1/2]

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

Get the face indices.

Returns
m_facets

◆ getFacets() [2/2]

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

Get the face indices.

Returns
m_facets

◆ getPointDataScalars() [1/2]

template<typename T >
const std::vector< T > & VTK< T >::getPointDataScalars ( const std::string  a_name) const
noexcept

Get the point data scalars.

Parameters
[in]a_nameScalar array name
Note
Function will fail if the array does not exist
Returns
m_pointDataScalars at provided name

◆ getPointDataScalars() [2/2]

template<typename T >
std::vector< T > & VTK< T >::getPointDataScalars ( const std::string  a_name)
noexcept

Get the point data scalars.

Parameters
[in]a_nameScalar array name
Note
Function will fail if the array does not exist
Returns
m_pointDataScalars at provided name

◆ getVertexCoordinates() [1/2]

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

Get the vertex coordinates.

Returns
m_vertexCoordinates

◆ getVertexCoordinates() [2/2]

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

Get the vertex coordinates.

Returns
m_vertexCoordinates

◆ setCellDataScalars()

template<typename T >
void VTK< T >::setCellDataScalars ( const std::string  a_name,
const std::vector< T > &  a_data 
)
noexcept

Set cell data scalars.

Parameters
[in]a_nameArray name
[in]a_dataArray data

◆ setPointDataScalars()

template<typename T >
void VTK< T >::setPointDataScalars ( const std::string  a_name,
const std::vector< T > &  a_data 
)
noexcept

Set point data scalars.

Parameters
[in]a_nameArray name
[in]a_dataArray data

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