Go to the documentation of this file.
10 #ifndef vtk_m_cont_DataSetBuilderExplicit_h
11 #define vtk_m_cont_DataSetBuilderExplicit_h
39 const std::vector<vtkm::UInt8>& shapes,
40 const std::vector<vtkm::IdComponent>& numIndices,
41 const std::vector<vtkm::Id>& connectivity,
42 const std::string& coordsNm =
"coords")
44 std::vector<T> yVals(xVals.size(), 0), zVals(xVals.size(), 0);
46 xVals, yVals, zVals, shapes, numIndices, connectivity, coordsNm);
51 const std::vector<T>& yVals,
52 const std::vector<vtkm::UInt8>& shapes,
53 const std::vector<vtkm::IdComponent>& numIndices,
54 const std::vector<vtkm::Id>& connectivity,
55 const std::string& coordsNm =
"coords")
57 std::vector<T> zVals(xVals.size(), 0);
59 xVals, yVals, zVals, shapes, numIndices, connectivity, coordsNm);
64 const std::vector<T>& yVals,
65 const std::vector<T>& zVals,
66 const std::vector<vtkm::UInt8>& shapes,
67 const std::vector<vtkm::IdComponent>& numIndices,
68 const std::vector<vtkm::Id>& connectivity,
69 const std::string& coordsNm =
"coords");
73 const std::vector<vtkm::UInt8>& shapes,
74 const std::vector<vtkm::IdComponent>& numIndices,
75 const std::vector<vtkm::Id>& connectivity,
76 const std::string& coordsNm =
"coords");
84 const std::string& coordsNm =
"coords")
90 template <
typename T,
typename CellShapeTag>
94 const std::vector<vtkm::Id>& connectivity,
95 const std::string& coordsNm =
"coords");
97 template <
typename T,
typename CellShapeTag>
103 const std::string& coordsNm =
"coords")
106 coords, tag, numberOfPointsPerCell, connectivity, coordsNm);
110 template <
typename T>
116 const std::string& coordsNm);
118 template <
typename T,
typename CellShapeTag>
124 const std::string& coordsNm);
127 template <
typename T>
129 const std::vector<T>& xVals,
130 const std::vector<T>& yVals,
131 const std::vector<T>& zVals,
132 const std::vector<vtkm::UInt8>& shapes,
133 const std::vector<vtkm::IdComponent>& numIndices,
134 const std::vector<vtkm::Id>& connectivity,
135 const std::string& coordsNm)
137 VTKM_ASSERT(xVals.size() == yVals.size() && yVals.size() == zVals.size() && xVals.size() > 0);
142 for (std::size_t index = 0; index < xVals.size(); ++index)
144 coordsPortal.Set(
static_cast<vtkm::Id>(index),
157 coordsArray, shapesArray, offsetsArray, connArray, coordsNm);
160 template <
typename T>
163 const std::vector<vtkm::UInt8>& shapes,
164 const std::vector<vtkm::IdComponent>& numIndices,
165 const std::vector<vtkm::Id>& connectivity,
166 const std::string& coordsNm)
176 coordsArray, shapesArray, offsetsArray, connArray, coordsNm);
179 template <
typename T>
185 const std::string& coordsNm)
193 cellSet.
Fill(nPts, shapes, connectivity, offsets);
199 template <
typename T,
typename CellShapeTag>
204 const std::vector<vtkm::Id>& connectivity,
205 const std::string& coordsNm)
211 coordsArray, tag, numberOfPointsPerCell, connArray, coordsNm);
214 template <
typename T,
typename CellShapeTag>
220 const std::string& coordsNm)
228 cellSet.
Fill(coords.GetNumberOfValues(), tag.Id, numberOfPointsPerCell, connectivity);
241 void Begin(
const std::string& coordName =
"coords");
255 template <
typename T>
263 template <
typename T>
274 void AddCell(
const vtkm::UInt8& shape,
const std::vector<vtkm::Id>& conn);
280 void AddCellPoint(
vtkm::Id pointIndex);
293 #endif //vtk_m_cont_DataSetBuilderExplicit_h
VTKM_CONT vtkm::cont::ArrayHandleBasic< T > make_ArrayHandle(const T *array, vtkm::Id numberOfValues, vtkm::CopyFlag copy)
A convenience function for creating an ArrayHandle from a standard C array.
Definition: ArrayHandleBasic.h:217
VTKM_CONT vtkm::Id AddPoint(const T &x, const T &y, const T &z=0)
Definition: DataSetBuilderExplicit.h:256
Manages an array-worth of data.
Definition: ArrayHandle.h:283
static VTKM_CONT vtkm::cont::DataSet BuildDataSet(const vtkm::cont::ArrayHandle< vtkm::Vec< T, 3 >> &coords, const vtkm::cont::ArrayHandle< vtkm::UInt8 > &shapes, const vtkm::cont::ArrayHandle< vtkm::Id > &offsets, const vtkm::cont::ArrayHandle< vtkm::Id > &connectivity, const std::string &coordsNm)
Definition: DataSetBuilderExplicit.h:180
static VTKM_CONT vtkm::cont::DataSet Create(const std::vector< T > &xVals, const std::vector< T > &yVals, const std::vector< vtkm::UInt8 > &shapes, const std::vector< vtkm::IdComponent > &numIndices, const std::vector< vtkm::Id > &connectivity, const std::string &coordsNm="coords")
Definition: DataSetBuilderExplicit.h:50
Groups connected points that have the same field value.
Definition: Atomic.h:19
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
VTKM_CONT void Allocate(vtkm::Id numberOfValues, vtkm::CopyFlag preserve, vtkm::cont::Token &token) const
Allocates an array large enough to hold the given number of values.
Definition: ArrayHandle.h:465
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
VTKM_CONT DataSetBuilderExplicit()
Definition: DataSetBuilderExplicit.h:31
Definition: CastAndCall.h:34
VTKM_CONT vtkm::Id AddPoint(const vtkm::Vec< T, 3 > &pt)
Definition: DataSetBuilderExplicit.h:264
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
Definition: CoordinateSystem.h:25
std::vector< vtkm::Vec3f > points
Definition: DataSetBuilderExplicit.h:285
std::vector< vtkm::Id > connectivity
Definition: DataSetBuilderExplicit.h:288
static VTKM_CONT vtkm::cont::DataSet Create(const vtkm::cont::ArrayHandle< vtkm::Vec< T, 3 >> &coords, CellShapeTag tag, vtkm::IdComponent numberOfPointsPerCell, const vtkm::cont::ArrayHandle< vtkm::Id > &connectivity, const std::string &coordsNm="coords")
Definition: DataSetBuilderExplicit.h:98
static VTKM_CONT vtkm::cont::DataSet Create(const vtkm::cont::ArrayHandle< vtkm::Vec< T, 3 >> &coords, const vtkm::cont::ArrayHandle< vtkm::UInt8 > &shapes, const vtkm::cont::ArrayHandle< vtkm::IdComponent > &numIndices, const vtkm::cont::ArrayHandle< vtkm::Id > &connectivity, const std::string &coordsNm="coords")
Definition: DataSetBuilderExplicit.h:79
#define VTKM_CONT
Definition: ExportMacros.h:57
VTKM_CONT WritePortalType WritePortal() const
Get an array portal that can be used in the control environment.
Definition: ArrayHandle.h:435
VTKM_CONT void Fill(vtkm::Id numPoints, const vtkm::cont::ArrayHandle< vtkm::UInt8, ShapesStorageTag > &cellTypes, const vtkm::cont::ArrayHandle< vtkm::Id, ConnectivityStorageTag > &connectivity, const vtkm::cont::ArrayHandle< vtkm::Id, OffsetsStorageTag > &offsets)
Second method to add cells – all at once.
uint8_t UInt8
Definition: Types.h:157
constexpr VTKM_EXEC_CONT vtkm::Vec< T, vtkm::IdComponent(sizeof...(Ts)+1)> make_Vec(T value0, Ts &&... args)
Initializes and returns a Vec containing all the arguments.
Definition: Types.h:1212
VTKM_CONT_EXPORT void ConvertNumComponentsToOffsets(const vtkm::cont::UnknownArrayHandle &numComponentsArray, vtkm::cont::ArrayHandle< vtkm::Id > &offsetsArray, vtkm::Id &componentsArraySize, vtkm::cont::DeviceAdapterId device=vtkm::cont::DeviceAdapterTagAny{})
std::vector< vtkm::IdComponent > numIdx
Definition: DataSetBuilderExplicit.h:287
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:198
Definition: CastAndCall.h:36
std::vector< vtkm::UInt8 > shapes
Definition: DataSetBuilderExplicit.h:286
VTKM_CONT vtkm::IdComponent AddCoordinateSystem(const vtkm::cont::CoordinateSystem &cs)
Adds the given CoordinateSystem to the DataSet.
Definition: DataSetBuilderExplicit.h:27
VTKM_CONT void SetCellSet(const CellSetType &cellSet)
Definition: DataSet.h:355
VTKM_CONT void Fill(vtkm::Id numPoints, vtkm::UInt8 shapeId, vtkm::IdComponent numberOfPointsPerCell, const vtkm::cont::ArrayHandle< vtkm::Id, ConnectivityStorageTag > &connectivity)
Definition: CellSetSingleType.h:186
std::string coordNm
Definition: DataSetBuilderExplicit.h:283
static VTKM_CONT vtkm::cont::DataSet Create(const std::vector< T > &xVals, const std::vector< vtkm::UInt8 > &shapes, const std::vector< vtkm::IdComponent > &numIndices, const std::vector< vtkm::Id > &connectivity, const std::string &coordsNm="coords")
Definition: DataSetBuilderExplicit.h:38
Definition: DataSetBuilderExplicit.h:234