Go to the documentation of this file.
18 #ifndef viskores_cont_DataSetBuilderExplicit_h
19 #define viskores_cont_DataSetBuilderExplicit_h
61 const std::vector<T>& xVals,
62 const std::vector<viskores::UInt8>& shapes,
63 const std::vector<viskores::IdComponent>& numIndices,
64 const std::vector<viskores::Id>& connectivity,
65 const std::string& coordsNm =
"coords")
67 std::vector<T> yVals(xVals.size(), 0), zVals(xVals.size(), 0);
69 xVals, yVals, zVals, shapes, numIndices, connectivity, coordsNm);
93 const std::vector<T>& xVals,
94 const std::vector<T>& yVals,
95 const std::vector<viskores::UInt8>& shapes,
96 const std::vector<viskores::IdComponent>& numIndices,
97 const std::vector<viskores::Id>& connectivity,
98 const std::string& coordsNm =
"coords")
100 std::vector<T> zVals(xVals.size(), 0);
102 xVals, yVals, zVals, shapes, numIndices, connectivity, coordsNm);
125 template <
typename T>
127 const std::vector<T>& xVals,
128 const std::vector<T>& yVals,
129 const std::vector<T>& zVals,
130 const std::vector<viskores::UInt8>& shapes,
131 const std::vector<viskores::IdComponent>& numIndices,
132 const std::vector<viskores::Id>& connectivity,
133 const std::string& coordsNm =
"coords");
153 template <
typename T>
156 const std::vector<viskores::UInt8>& shapes,
157 const std::vector<viskores::IdComponent>& numIndices,
158 const std::vector<viskores::Id>& connectivity,
159 const std::string& coordsNm =
"coords");
180 template <
typename T>
186 const std::string& coordsNm =
"coords")
213 template <
typename T,
typename CellShapeTag>
218 const std::vector<viskores::Id>& connectivity,
219 const std::string& coordsNm =
"coords");
242 template <
typename T,
typename CellShapeTag>
248 const std::string& coordsNm =
"coords")
251 coords, tag, numberOfPointsPerCell, connectivity, coordsNm);
255 template <
typename T>
261 const std::string& coordsNm);
263 template <
typename T,
typename CellShapeTag>
269 const std::string& coordsNm);
272 template <
typename T>
274 const std::vector<T>& xVals,
275 const std::vector<T>& yVals,
276 const std::vector<T>& zVals,
277 const std::vector<viskores::UInt8>& shapes,
278 const std::vector<viskores::IdComponent>& numIndices,
279 const std::vector<viskores::Id>& connectivity,
280 const std::string& coordsNm)
282 VISKORES_ASSERT(xVals.size() == yVals.size() && yVals.size() == zVals.size() && xVals.size() > 0);
287 for (std::size_t index = 0; index < xVals.size(); ++index)
302 coordsArray, shapesArray, offsetsArray, connArray, coordsNm);
305 template <
typename T>
308 const std::vector<viskores::UInt8>& shapes,
309 const std::vector<viskores::IdComponent>& numIndices,
310 const std::vector<viskores::Id>& connectivity,
311 const std::string& coordsNm)
321 coordsArray, shapesArray, offsetsArray, connArray, coordsNm);
324 template <
typename T>
330 const std::string& coordsNm)
338 cellSet.
Fill(nPts, shapes, connectivity, offsets);
344 template <
typename T,
typename CellShapeTag>
349 const std::vector<viskores::Id>& connectivity,
350 const std::string& coordsNm)
356 coordsArray, tag, numberOfPointsPerCell, connArray, coordsNm);
359 template <
typename T,
typename CellShapeTag>
365 const std::string& coordsNm)
373 cellSet.
Fill(coords.GetNumberOfValues(), tag.Id, numberOfPointsPerCell, connectivity);
393 VISKORES_CONT void Begin(
const std::string& coordName =
"coords");
405 template <
typename T>
427 template <
typename T>
476 std::vector<viskores::IdComponent>
numIdx;
482 #endif //viskores_cont_DataSetBuilderExplicit_h
std::string coordNm
Definition: DataSetBuilderExplicit.h:472
Helper class to build a DataSet by iteratively adding points and cells.
Definition: DataSetBuilderExplicit.h:382
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
DataSetBuilderExplicit()
Definition: DataSetBuilderExplicit.h:39
viskores::Id AddPoint(const viskores::Vec< T, 3 > &pt)
Add a point to the DataSet.
Definition: DataSetBuilderExplicit.h:406
Manages an array-worth of data.
Definition: ArrayHandle.h:313
Manages a coordinate system for a DataSet.
Definition: CoordinateSystem.h:38
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
viskores::IdComponent AddCoordinateSystem(const viskores::cont::CoordinateSystem &cs)
Adds the given CoordinateSystem to the DataSet.
static viskores::cont::DataSet Create(const viskores::cont::ArrayHandle< viskores::Vec< T, 3 >> &coords, const viskores::cont::ArrayHandle< viskores::UInt8 > &shapes, const viskores::cont::ArrayHandle< viskores::IdComponent > &numIndices, const viskores::cont::ArrayHandle< viskores::Id > &connectivity, const std::string &coordsNm="coords")
Create a 3D DataSet with arbitrary cell connectivity.
Definition: DataSetBuilderExplicit.h:181
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores::Id AddPoint(const T &x, const T &y, const T &z=0)
Add a point to the DataSet.
Definition: DataSetBuilderExplicit.h:428
Groups connected points that have the same field value.
Definition: Atomic.h:27
std::vector< viskores::UInt8 > shapes
Definition: DataSetBuilderExplicit.h:475
static viskores::cont::DataSet BuildDataSet(const viskores::cont::ArrayHandle< viskores::Vec< T, 3 >> &coords, const viskores::cont::ArrayHandle< viskores::UInt8 > &shapes, const viskores::cont::ArrayHandle< viskores::Id > &offsets, const viskores::cont::ArrayHandle< viskores::Id > &connectivity, const std::string &coordsNm)
Definition: DataSetBuilderExplicit.h:325
void Allocate(viskores::Id numberOfValues, viskores::CopyFlag preserve, viskores::cont::Token &token) const
Allocates an array large enough to hold the given number of values.
Definition: ArrayHandle.h:504
Defines an irregular collection of cells.
Definition: CastAndCall.h:44
#define VISKORES_ASSERT(condition)
Definition: Assert.h:51
void Fill(viskores::Id numPoints, const viskores::cont::ArrayHandle< viskores::UInt8, ShapesStorageTag > &cellTypes, const viskores::cont::ArrayHandle< viskores::Id, ConnectivityStorageTag > &connectivity, const viskores::cont::ArrayHandle< viskores::Id, OffsetsStorageTag > &offsets)
Set all the cells of the mesh.
void ConvertNumComponentsToOffsets(const viskores::cont::UnknownArrayHandle &numComponentsArray, viskores::cont::ArrayHandle< viskores::Id > &offsetsArray, viskores::Id &componentsArraySize, viskores::cont::DeviceAdapterId device=viskores::cont::DeviceAdapterTagAny{})
ConvertNumComponentsToOffsets takes an array of Vec sizes (i.e.
WritePortalType WritePortal() const
Get an array portal that can be used in the control environment.
Definition: ArrayHandle.h:468
constexpr viskores::Vec< T, viskores::IdComponent(sizeof...(Ts)+1)> make_Vec(T value0, Ts &&... args)
Initializes and returns a Vec containing all the arguments.
Definition: Types.h:1262
uint8_t UInt8
Base type to use for 8-bit unsigned integer numbers.
Definition: Types.h:177
std::vector< viskores::Id > connectivity
Definition: DataSetBuilderExplicit.h:477
static viskores::cont::DataSet Create(const std::vector< T > &xVals, const std::vector< viskores::UInt8 > &shapes, const std::vector< viskores::IdComponent > &numIndices, const std::vector< viskores::Id > &connectivity, const std::string &coordsNm="coords")
Create a 1D DataSet with arbitrary cell connectivity.
Definition: DataSetBuilderExplicit.h:60
viskores::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:244
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.
Definition: CellSetSingleType.h:211
static viskores::cont::DataSet Create(const viskores::cont::ArrayHandle< viskores::Vec< T, 3 >> &coords, CellShapeTag tag, viskores::IdComponent numberOfPointsPerCell, const viskores::cont::ArrayHandle< viskores::Id > &connectivity, const std::string &coordsNm="coords")
Create a 3D DataSet with arbitrary cell connectivity for a single cell type.
Definition: DataSetBuilderExplicit.h:243
std::vector< viskores::IdComponent > numIdx
Definition: DataSetBuilderExplicit.h:476
An explicit cell set with all cells of the same shape.
Definition: CastAndCall.h:42
static viskores::cont::DataSet Create(const std::vector< T > &xVals, const std::vector< T > &yVals, const std::vector< viskores::UInt8 > &shapes, const std::vector< viskores::IdComponent > &numIndices, const std::vector< viskores::Id > &connectivity, const std::string &coordsNm="coords")
Create a 2D DataSet with arbitrary cell connectivity.
Definition: DataSetBuilderExplicit.h:92
viskores::cont::ArrayHandleBasic< T > make_ArrayHandle(const T *array, viskores::Id numberOfValues, viskores::CopyFlag copy)
A convenience function for creating an ArrayHandle from a standard C array.
Definition: ArrayHandleBasic.h:285
std::vector< viskores::Vec3f > points
Definition: DataSetBuilderExplicit.h:474
Definition: DataSetBuilderExplicit.h:35
void SetCellSet(const CellSetType &cellSet)
Definition: DataSet.h:415