mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-19 18:45:43 +00:00
81450f2317
CellSetExplicit can now use different storage backends to allow for cheaper representations of the data. For example a pool of triangles can now implicit handles for shape and num indices. This does raise the question if runtime polymorphism is the best approach for CellSet, or if we should do some from of CRTP.
50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#ifndef vtk_m_cont_CellSetExplicit_h
|
|
#define vtk_m_cont_CellSetExplicit_h
|
|
|
|
#include <vtkm/cont/CellSet.h>
|
|
#include <vtkm/cont/ExplicitConnectivity.h>
|
|
|
|
namespace vtkm {
|
|
namespace cont {
|
|
|
|
template<typename ShapeStorageTag = VTKM_DEFAULT_STORAGE_TAG,
|
|
typename IndiceStorageTag = VTKM_DEFAULT_STORAGE_TAG,
|
|
typename ConnectivityStorageTag = VTKM_DEFAULT_STORAGE_TAG >
|
|
class CellSetExplicit : public CellSet
|
|
{
|
|
public:
|
|
typedef ExplicitConnectivity<ShapeStorageTag,
|
|
IndiceStorageTag,
|
|
ConnectivityStorageTag
|
|
> ExplicitConnectivityType;
|
|
|
|
CellSetExplicit(const std::string &n, int d)
|
|
: CellSet(n,d)
|
|
{
|
|
}
|
|
|
|
virtual int GetNumCells()
|
|
{
|
|
return nodesOfCellsConnectivity.GetNumberOfElements();
|
|
}
|
|
|
|
ExplicitConnectivityType &GetNodeToCellConnectivity()
|
|
{
|
|
return nodesOfCellsConnectivity;
|
|
}
|
|
|
|
virtual void PrintSummary(std::ostream &out)
|
|
{
|
|
out<<" ExplicitCellSet: "<<name<<" dim= "<<dimensionality<<std::endl;
|
|
nodesOfCellsConnectivity.PrintSummary(out);
|
|
}
|
|
|
|
public:
|
|
ExplicitConnectivityType nodesOfCellsConnectivity;
|
|
};
|
|
|
|
}
|
|
} // namespace vtkm::cont
|
|
|
|
#endif //vtk_m_cont_CellSetExplicit_h
|