VTK-m  2.1
Public Member Functions | Private Attributes | List of all members
vtkm::cont::DataSetBuilderExplicitIterative Class Reference

Helper class to build a DataSet by iteratively adding points and cells. More...

#include <DataSetBuilderExplicit.h>

Public Member Functions

 DataSetBuilderExplicitIterative ()
 
void Begin (const std::string &coordName="coords")
 Begin defining points and cells of a DataSet. More...
 
vtkm::Id AddPoint (const vtkm::Vec3f &pt)
 Add a point to the DataSet. More...
 
template<typename T >
vtkm::Id AddPoint (const vtkm::Vec< T, 3 > &pt)
 Add a point to the DataSet. More...
 
vtkm::Id AddPoint (const vtkm::FloatDefault &x, const vtkm::FloatDefault &y, const vtkm::FloatDefault &z=0)
 Add a point to the DataSet. More...
 
template<typename T >
vtkm::Id AddPoint (const T &x, const T &y, const T &z=0)
 Add a point to the DataSet. More...
 
void AddCell (const vtkm::UInt8 &shape, const std::vector< vtkm::Id > &conn)
 Add a cell to the DataSet. More...
 
void AddCell (const vtkm::UInt8 &shape, const vtkm::Id *conn, const vtkm::IdComponent &n)
 Add a cell to the DataSet. More...
 
void AddCell (vtkm::UInt8 shape)
 Start adding a cell to the DataSet. More...
 
void AddCellPoint (vtkm::Id pointIndex)
 Add an incident point to the current cell. More...
 
vtkm::cont::DataSet Create ()
 Produce the DataSet. More...
 

Private Attributes

std::string coordNm
 
std::vector< vtkm::Vec3fpoints
 
std::vector< vtkm::UInt8shapes
 
std::vector< vtkm::IdComponentnumIdx
 
std::vector< vtkm::Idconnectivity
 

Detailed Description

Helper class to build a DataSet by iteratively adding points and cells.

This class allows you to specify a DataSet by adding points and cells one at a time.

Constructor & Destructor Documentation

◆ DataSetBuilderExplicitIterative()

vtkm::cont::DataSetBuilderExplicitIterative::DataSetBuilderExplicitIterative ( )

Member Function Documentation

◆ AddCell() [1/3]

void vtkm::cont::DataSetBuilderExplicitIterative::AddCell ( const vtkm::UInt8 shape,
const std::vector< vtkm::Id > &  conn 
)

Add a cell to the DataSet.

Parameters
[in]shapeIdentifies the shape of the cell. Use one of the vtkm::CELL_SHAPE_* values.
[in]connList of indices to the incident points.

◆ AddCell() [2/3]

void vtkm::cont::DataSetBuilderExplicitIterative::AddCell ( const vtkm::UInt8 shape,
const vtkm::Id conn,
const vtkm::IdComponent n 
)

Add a cell to the DataSet.

Parameters
[in]shapeIdentifies the shape of the cell. Use one of the vtkm::CELL_SHAPE_* values.
[in]connList of indices to the incident points.
[in]nThe number of incident points (and the length of the conn array).

◆ AddCell() [3/3]

void vtkm::cont::DataSetBuilderExplicitIterative::AddCell ( vtkm::UInt8  shape)

Start adding a cell to the DataSet.

The incident points are later added one at a time using AddCellPoint. The cell is completed the next time AddCell or Create is called.

Parameters
[in]shapeIdentifies the shape of the cell. Use one of the

◆ AddCellPoint()

void vtkm::cont::DataSetBuilderExplicitIterative::AddCellPoint ( vtkm::Id  pointIndex)

Add an incident point to the current cell.

Parameters
[in]pointIndexIndex to the incident point.

◆ AddPoint() [1/4]

template<typename T >
vtkm::Id vtkm::cont::DataSetBuilderExplicitIterative::AddPoint ( const T &  x,
const T &  y,
const T &  z = 0 
)
inline

Add a point to the DataSet.

Parameters
[in]xThe x coordinate of the newly created point.
[in]yThe y coordinate of the newly created point.
[in]zThe z coordinate of the newly created point.
Returns
The index of the newly created point.

◆ AddPoint() [2/4]

vtkm::Id vtkm::cont::DataSetBuilderExplicitIterative::AddPoint ( const vtkm::FloatDefault x,
const vtkm::FloatDefault y,
const vtkm::FloatDefault z = 0 
)

Add a point to the DataSet.

Parameters
[in]xThe x coordinate of the newly created point.
[in]yThe y coordinate of the newly created point.
[in]zThe z coordinate of the newly created point.
Returns
The index of the newly created point.

◆ AddPoint() [3/4]

vtkm::Id vtkm::cont::DataSetBuilderExplicitIterative::AddPoint ( const vtkm::Vec3f pt)

Add a point to the DataSet.

Parameters
[in]ptThe coordinates of the point to add.
Returns
The index of the newly created point.

◆ AddPoint() [4/4]

template<typename T >
vtkm::Id vtkm::cont::DataSetBuilderExplicitIterative::AddPoint ( const vtkm::Vec< T, 3 > &  pt)
inline

Add a point to the DataSet.

Parameters
[in]ptThe coordinates of the point to add.
Returns
The index of the newly created point.

◆ Begin()

void vtkm::cont::DataSetBuilderExplicitIterative::Begin ( const std::string &  coordName = "coords")

Begin defining points and cells of a DataSet.

The state of this object is initialized to be ready to use AddPoint and AddCell methods.

Parameters
[in]coordName(optional) The name to register the coordinates as.

◆ Create()

vtkm::cont::DataSet vtkm::cont::DataSetBuilderExplicitIterative::Create ( )

Produce the DataSet.

The points and cells previously added are finalized and the resulting DataSet is returned.

Member Data Documentation

◆ connectivity

std::vector<vtkm::Id> vtkm::cont::DataSetBuilderExplicitIterative::connectivity
private

◆ coordNm

std::string vtkm::cont::DataSetBuilderExplicitIterative::coordNm
private

◆ numIdx

std::vector<vtkm::IdComponent> vtkm::cont::DataSetBuilderExplicitIterative::numIdx
private

◆ points

std::vector<vtkm::Vec3f> vtkm::cont::DataSetBuilderExplicitIterative::points
private

◆ shapes

std::vector<vtkm::UInt8> vtkm::cont::DataSetBuilderExplicitIterative::shapes
private

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