Viskores  1.0
Public Member Functions | Private Attributes | List of all members
viskores::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...
 
viskores::Id AddPoint (const viskores::Vec3f &pt)
 Add a point to the DataSet. More...
 
template<typename T >
viskores::Id AddPoint (const viskores::Vec< T, 3 > &pt)
 Add a point to the DataSet. More...
 
viskores::Id AddPoint (const viskores::FloatDefault &x, const viskores::FloatDefault &y, const viskores::FloatDefault &z=0)
 Add a point to the DataSet. More...
 
template<typename T >
viskores::Id AddPoint (const T &x, const T &y, const T &z=0)
 Add a point to the DataSet. More...
 
void AddCell (const viskores::UInt8 &shape, const std::vector< viskores::Id > &conn)
 Add a cell to the DataSet. More...
 
void AddCell (const viskores::UInt8 &shape, const viskores::Id *conn, const viskores::IdComponent &n)
 Add a cell to the DataSet. More...
 
void AddCell (viskores::UInt8 shape)
 Start adding a cell to the DataSet. More...
 
void AddCellPoint (viskores::Id pointIndex)
 Add an incident point to the current cell. More...
 
viskores::cont::DataSet Create ()
 Produce the DataSet. More...
 

Private Attributes

std::string coordNm
 
std::vector< viskores::Vec3fpoints
 
std::vector< viskores::UInt8shapes
 
std::vector< viskores::IdComponentnumIdx
 
std::vector< viskores::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()

viskores::cont::DataSetBuilderExplicitIterative::DataSetBuilderExplicitIterative ( )

Member Function Documentation

◆ AddCell() [1/3]

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

Add a cell to the DataSet.

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

◆ AddCell() [2/3]

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

Add a cell to the DataSet.

Parameters
[in]shapeIdentifies the shape of the cell. Use one of the viskores::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 viskores::cont::DataSetBuilderExplicitIterative::AddCell ( viskores::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 viskores::cont::DataSetBuilderExplicitIterative::AddCellPoint ( viskores::Id  pointIndex)

Add an incident point to the current cell.

Parameters
[in]pointIndexIndex to the incident point.

◆ AddPoint() [1/4]

template<typename T >
viskores::Id viskores::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]

viskores::Id viskores::cont::DataSetBuilderExplicitIterative::AddPoint ( const viskores::FloatDefault x,
const viskores::FloatDefault y,
const viskores::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]

viskores::Id viskores::cont::DataSetBuilderExplicitIterative::AddPoint ( const viskores::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 >
viskores::Id viskores::cont::DataSetBuilderExplicitIterative::AddPoint ( const viskores::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 viskores::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()

viskores::cont::DataSet viskores::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<viskores::Id> viskores::cont::DataSetBuilderExplicitIterative::connectivity
private

◆ coordNm

std::string viskores::cont::DataSetBuilderExplicitIterative::coordNm
private

◆ numIdx

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

◆ points

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

◆ shapes

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

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