Viskores  1.0
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
viskores::cont::CellSetSingleType< ConnectivityStorageTag > Class Template Reference

An explicit cell set with all cells of the same shape. More...

#include <CastAndCall.h>

Public Member Functions

 CellSetSingleType ()
 
 CellSetSingleType (const Thisclass &src)
 
 CellSetSingleType (Thisclass &&src) noexcept
 
Thisclassoperator= (const Thisclass &src)
 
Thisclassoperator= (Thisclass &&src) noexcept
 
 ~CellSetSingleType () override
 
void PrepareToAddCells (viskores::Id numCells, viskores::Id connectivityMaxLen)
 Start adding cells one at a time. More...
 
template<typename IdVecType >
void AddCell (viskores::UInt8 shapeId, viskores::IdComponent numVertices, const IdVecType &ids)
 Add a cell. More...
 
void CompleteAddingCells (viskores::Id numPoints)
 Finish adding cells one at a time. More...
 
void Fill (viskores::Id numPoints, viskores::UInt8 shapeId, viskores::IdComponent numberOfPointsPerCell, const viskores::cont::ArrayHandle< viskores::Id, ConnectivityStorageTag > &connectivity)
 Set all the cells of the mesh. More...
 
viskores::Id GetCellShapeAsId () const
 
viskores::UInt8 GetCellShape (viskores::Id) const override
 
std::shared_ptr< CellSetNewInstance () const override
 
void DeepCopy (const CellSet *src) override
 
void PrintSummary (std::ostream &out) const override
 

Private Types

using Thisclass = viskores::cont::CellSetSingleType< ConnectivityStorageTag >
 
using Superclass = viskores::cont::CellSetExplicit< typename viskores::cont::ArrayHandleConstant< viskores::UInt8 >::StorageTag, ConnectivityStorageTag, typename viskores::cont::ArrayHandleCounting< viskores::Id >::StorageTag >
 

Private Member Functions

template<typename CellShapeTag >
void CheckNumberOfPointsPerCell (CellShapeTag, viskores::CellTraitsTagSizeFixed, viskores::IdComponent numVertices) const
 
template<typename CellShapeTag >
void CheckNumberOfPointsPerCell (CellShapeTag, viskores::CellTraitsTagSizeVariable, viskores::IdComponent) const
 
void CheckNumberOfPointsPerCell (viskores::IdComponent numVertices) const
 

Private Attributes

viskores::Id ExpectedNumberOfCellsAdded
 
viskores::Id CellShapeAsId
 
viskores::IdComponent NumberOfPointsPerCell
 

Detailed Description

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
class viskores::cont::CellSetSingleType< ConnectivityStorageTag >

An explicit cell set with all cells of the same shape.

CellSetSingleType is an explicit cell set constrained to contain cells that all have the same shape and all have the same number of points. So, for example if you are creating a surface that you know will contain only triangles, CellSetSingleType is a good representation for these data.

Using CellSetSingleType saves memory because the array of cell shapes and the array of point counts no longer need to be stored. CellSetSingleType also allows Viskores to skip some processing and other storage required for general explicit cell sets.

Member Typedef Documentation

◆ Superclass

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
using viskores::cont::CellSetSingleType< ConnectivityStorageTag >::Superclass = viskores::cont::CellSetExplicit< typename viskores::cont::ArrayHandleConstant<viskores::UInt8>::StorageTag, ConnectivityStorageTag, typename viskores::cont::ArrayHandleCounting<viskores::Id>::StorageTag>
private

◆ Thisclass

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
using viskores::cont::CellSetSingleType< ConnectivityStorageTag >::Thisclass = viskores::cont::CellSetSingleType<ConnectivityStorageTag>
private

Constructor & Destructor Documentation

◆ CellSetSingleType() [1/3]

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
viskores::cont::CellSetSingleType< ConnectivityStorageTag >::CellSetSingleType ( )
inline

◆ CellSetSingleType() [2/3]

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
viskores::cont::CellSetSingleType< ConnectivityStorageTag >::CellSetSingleType ( const Thisclass src)
inline

◆ CellSetSingleType() [3/3]

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
viskores::cont::CellSetSingleType< ConnectivityStorageTag >::CellSetSingleType ( Thisclass &&  src)
inlinenoexcept

◆ ~CellSetSingleType()

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
viskores::cont::CellSetSingleType< ConnectivityStorageTag >::~CellSetSingleType ( )
inlineoverride

Member Function Documentation

◆ AddCell()

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
template<typename IdVecType >
void viskores::cont::CellSetSingleType< ConnectivityStorageTag >::AddCell ( viskores::UInt8  shapeId,
viskores::IdComponent  numVertices,
const IdVecType &  ids 
)
inline

Add a cell.

This can only be called after AddCell.

◆ CheckNumberOfPointsPerCell() [1/3]

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
template<typename CellShapeTag >
void viskores::cont::CellSetSingleType< ConnectivityStorageTag >::CheckNumberOfPointsPerCell ( CellShapeTag  ,
viskores::CellTraitsTagSizeFixed  ,
viskores::IdComponent  numVertices 
) const
inlineprivate

◆ CheckNumberOfPointsPerCell() [2/3]

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
template<typename CellShapeTag >
void viskores::cont::CellSetSingleType< ConnectivityStorageTag >::CheckNumberOfPointsPerCell ( CellShapeTag  ,
viskores::CellTraitsTagSizeVariable  ,
viskores::IdComponent   
) const
inlineprivate

◆ CheckNumberOfPointsPerCell() [3/3]

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
void viskores::cont::CellSetSingleType< ConnectivityStorageTag >::CheckNumberOfPointsPerCell ( viskores::IdComponent  numVertices) const
inlineprivate

◆ CompleteAddingCells()

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
void viskores::cont::CellSetSingleType< ConnectivityStorageTag >::CompleteAddingCells ( viskores::Id  numPoints)
inline

Finish adding cells one at a time.

◆ DeepCopy()

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
void viskores::cont::CellSetSingleType< ConnectivityStorageTag >::DeepCopy ( const CellSet src)
inlineoverride

◆ Fill()

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
void viskores::cont::CellSetSingleType< ConnectivityStorageTag >::Fill ( viskores::Id  numPoints,
viskores::UInt8  shapeId,
viskores::IdComponent  numberOfPointsPerCell,
const viskores::cont::ArrayHandle< viskores::Id, ConnectivityStorageTag > &  connectivity 
)
inline

Set all the cells of the mesh.

This method can be used to fill the memory from another system without copying data.

◆ GetCellShape()

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
viskores::UInt8 viskores::cont::CellSetSingleType< ConnectivityStorageTag >::GetCellShape ( viskores::Id  ) const
inlineoverride

◆ GetCellShapeAsId()

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
viskores::Id viskores::cont::CellSetSingleType< ConnectivityStorageTag >::GetCellShapeAsId ( ) const
inline

◆ NewInstance()

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
std::shared_ptr<CellSet> viskores::cont::CellSetSingleType< ConnectivityStorageTag >::NewInstance ( ) const
inlineoverride

◆ operator=() [1/2]

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
Thisclass& viskores::cont::CellSetSingleType< ConnectivityStorageTag >::operator= ( const Thisclass src)
inline

◆ operator=() [2/2]

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
Thisclass& viskores::cont::CellSetSingleType< ConnectivityStorageTag >::operator= ( Thisclass &&  src)
inlinenoexcept

◆ PrepareToAddCells()

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
void viskores::cont::CellSetSingleType< ConnectivityStorageTag >::PrepareToAddCells ( viskores::Id  numCells,
viskores::Id  connectivityMaxLen 
)
inline

Start adding cells one at a time.

After this method is called, AddCell is called repeatedly to add each cell. Once all cells are added, call CompleteAddingCells.

◆ PrintSummary()

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
void viskores::cont::CellSetSingleType< ConnectivityStorageTag >::PrintSummary ( std::ostream &  out) const
inlineoverride

Member Data Documentation

◆ CellShapeAsId

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
viskores::Id viskores::cont::CellSetSingleType< ConnectivityStorageTag >::CellShapeAsId
private

◆ ExpectedNumberOfCellsAdded

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
viskores::Id viskores::cont::CellSetSingleType< ConnectivityStorageTag >::ExpectedNumberOfCellsAdded
private

◆ NumberOfPointsPerCell

template<typename ConnectivityStorageTag = VISKORES_DEFAULT_STORAGE_TAG>
viskores::IdComponent viskores::cont::CellSetSingleType< ConnectivityStorageTag >::NumberOfPointsPerCell
private

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