VTK-m
2.2
|
Contains and manages the geometric data structures that VTK-m operates on. More...
#include <DataSet.h>
Public Member Functions | |
DataSet ()=default | |
DataSet (vtkm::cont::DataSet &&)=default | |
DataSet (const vtkm::cont::DataSet &)=default | |
vtkm::cont::DataSet & | operator= (vtkm::cont::DataSet &&)=default |
vtkm::cont::DataSet & | operator= (const vtkm::cont::DataSet &)=default |
void | Clear () |
vtkm::Id | GetNumberOfCells () const |
Get the number of cells contained in this DataSet. More... | |
vtkm::Id | GetNumberOfPoints () const |
Get the number of points contained in this DataSet. More... | |
void | AddField (const Field &field) |
Adds a field to the DataSet . More... | |
void | AddField (const std::string &name, vtkm::cont::Field::Association association, const vtkm::cont::UnknownArrayHandle &data) |
Adds a field to the DataSet . More... | |
bool | HasField (const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any) const |
bool | HasCellField (const std::string &name) const |
bool | HasGhostCellField () const |
const std::string & | GetGhostCellFieldName () const |
bool | HasPointField (const std::string &name) const |
vtkm::Id | GetFieldIndex (const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any) const |
Returns the field that matches the provided name and association. More... | |
void | SetGhostCellFieldName (const std::string &name) |
Sets the name of the field to use for cell ghost levels. More... | |
void | SetGhostCellField (const std::string &name) |
Sets the cell field of the given name as the cell ghost levels. More... | |
void | SetGhostCellField (const vtkm::cont::UnknownArrayHandle &field) |
Sets the ghost cell levels to the given array. More... | |
void | AddGhostCellField (const std::string &fieldName, const vtkm::cont::UnknownArrayHandle &field) |
void | AddGhostCellField (const vtkm::cont::UnknownArrayHandle &field) |
void | AddGhostCellField (const vtkm::cont::Field &field) |
vtkm::IdComponent | AddCoordinateSystem (const vtkm::cont::CoordinateSystem &cs) |
Adds the given CoordinateSystem to the DataSet . More... | |
vtkm::IdComponent | AddCoordinateSystem (const std::string &name, const vtkm::cont::UnknownArrayHandle &data) |
Adds a CoordinateSystem with the given name and data. More... | |
vtkm::IdComponent | AddCoordinateSystem (const std::string &pointFieldName) |
Marks the point field with the given name as a coordinate system. More... | |
bool | HasCoordinateSystem (const std::string &name) const |
vtkm::cont::CoordinateSystem | GetCoordinateSystem (vtkm::Id index=0) const |
vtkm::IdComponent | GetCoordinateSystemIndex (const std::string &name) const |
Returns the index for the CoordinateSystem whose name matches the provided string. More... | |
const std::string & | GetCoordinateSystemName (vtkm::Id index=0) const |
vtkm::cont::CoordinateSystem | GetCoordinateSystem (const std::string &name) const |
Returns the CoordinateSystem that matches the provided name. More... | |
template<typename CellSetType > | |
void | SetCellSet (const CellSetType &cellSet) |
const vtkm::cont::UnknownCellSet & | GetCellSet () const |
vtkm::cont::UnknownCellSet & | GetCellSet () |
vtkm::IdComponent | GetNumberOfFields () const |
vtkm::IdComponent | GetNumberOfCoordinateSystems () const |
void | CopyStructure (const vtkm::cont::DataSet &source) |
Copies the structure from the source dataset. More... | |
void | ConvertToExpected () |
Convert the structures in this data set to expected types. More... | |
void | PrintSummary (std::ostream &out) const |
const vtkm::cont::Field & | GetField (vtkm::Id index) const |
Retrieves a field by index. More... | |
vtkm::cont::Field & | GetField (vtkm::Id index) |
Retrieves a field by index. More... | |
const vtkm::cont::Field & | GetField (const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any) const |
Returns the field that matches the provided name and association. More... | |
vtkm::cont::Field & | GetField (const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any) |
Returns the field that matches the provided name and association. More... | |
const vtkm::cont::Field & | GetCellField (const std::string &name) const |
Returns the first cell field that matches the provided name. More... | |
vtkm::cont::Field & | GetCellField (const std::string &name) |
Returns the first cell field that matches the provided name. More... | |
vtkm::cont::Field | GetGhostCellField () const |
Returns the cell field that matches the ghost cell field name. More... | |
const vtkm::cont::Field & | GetPointField (const std::string &name) const |
Returns the first point field that matches the provided name. More... | |
vtkm::cont::Field & | GetPointField (const std::string &name) |
Returns the first point field that matches the provided name. More... | |
void | AddPointField (const std::string &fieldName, const vtkm::cont::UnknownArrayHandle &field) |
Adds a point field of a given name to the DataSet . More... | |
template<typename T , typename Storage > | |
void | AddPointField (const std::string &fieldName, const vtkm::cont::ArrayHandle< T, Storage > &field) |
Adds a point field of a given name to the DataSet . More... | |
template<typename T > | |
void | AddPointField (const std::string &fieldName, const std::vector< T > &field) |
Adds a point field of a given name to the DataSet . More... | |
template<typename T > | |
void | AddPointField (const std::string &fieldName, const T *field, const vtkm::Id &n) |
Adds a point field of a given name to the DataSet . More... | |
void | AddCellField (const std::string &fieldName, const vtkm::cont::UnknownArrayHandle &field) |
Adds a cell field of a given name to the DataSet . More... | |
template<typename T , typename Storage > | |
void | AddCellField (const std::string &fieldName, const vtkm::cont::ArrayHandle< T, Storage > &field) |
Adds a cell field of a given name to the DataSet . More... | |
template<typename T > | |
void | AddCellField (const std::string &fieldName, const std::vector< T > &field) |
Adds a cell field of a given name to the DataSet . More... | |
template<typename T > | |
void | AddCellField (const std::string &fieldName, const T *field, const vtkm::Id &n) |
Adds a cell field of a given name to the DataSet . More... | |
void | SetGhostCellField (const vtkm::cont::Field &field) |
Sets the ghost cell levels. More... | |
void | SetGhostCellField (const std::string &fieldName, const vtkm::cont::UnknownArrayHandle &field) |
Sets the ghost cell levels. More... | |
Private Member Functions | |
void | SetCellSetImpl (const vtkm::cont::UnknownCellSet &cellSet) |
Private Attributes | |
std::vector< std::string > | CoordSystemNames |
vtkm::cont::internal::FieldCollection | Fields |
vtkm::cont::UnknownCellSet | CellSet |
std::shared_ptr< std::string > | GhostCellName |
Contains and manages the geometric data structures that VTK-m operates on.
A DataSet
is the main data structure used by VTK-m to pass data in and out of filters, rendering, and other components. A data set comprises the following 3 data structures.
DataSet
also supports multiple coordinate systems for data that have multiple representations for position. For example, geospatial data could simultaneously have coordinate systems defined by 3D position, latitude-longitude, and any number of 2D projections.
|
default |
|
default |
|
default |
|
inline |
Adds a cell field of a given name to the DataSet
.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index.
|
inline |
Adds a cell field of a given name to the DataSet
.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index.
|
inline |
Adds a cell field of a given name to the DataSet
.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index.
|
inline |
Adds a cell field of a given name to the DataSet
.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index.
vtkm::IdComponent vtkm::cont::DataSet::AddCoordinateSystem | ( | const std::string & | name, |
const vtkm::cont::UnknownArrayHandle & | data | ||
) |
Adds a CoordinateSystem
with the given name and data.
The coordinate system will also be added as a point field of the same name.
vtkm::IdComponent vtkm::cont::DataSet::AddCoordinateSystem | ( | const std::string & | pointFieldName | ) |
Marks the point field with the given name as a coordinate system.
If no such point field exists or the point field is of the wrong format, an exception will be throw.
vtkm::IdComponent vtkm::cont::DataSet::AddCoordinateSystem | ( | const vtkm::cont::CoordinateSystem & | cs | ) |
Adds the given CoordinateSystem
to the DataSet
.
The coordinate system will also be added as a point field of the same name.
void vtkm::cont::DataSet::AddField | ( | const Field & | field | ) |
Adds a field to the DataSet
.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index.
void vtkm::cont::DataSet::AddField | ( | const std::string & | name, |
vtkm::cont::Field::Association | association, | ||
const vtkm::cont::UnknownArrayHandle & | data | ||
) |
Adds a field to the DataSet
.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index.
|
inline |
|
inline |
|
inline |
|
inline |
Adds a point field of a given name to the DataSet
.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index.
|
inline |
Adds a point field of a given name to the DataSet
.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index.
|
inline |
Adds a point field of a given name to the DataSet
.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index.
|
inline |
Adds a point field of a given name to the DataSet
.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index.
void vtkm::cont::DataSet::Clear | ( | ) |
void vtkm::cont::DataSet::ConvertToExpected | ( | ) |
Convert the structures in this data set to expected types.
A DataSet
object can contain data structures of unknown types. Using the data requires casting these data structures to concrete types. It is only possible to check a finite number of data structures.
The types checked by default are listed in vtkm/cont/DefaultTypes.h
, which can be configured at compile time. If a DataSet
contains data not listed there, then it is likely going to cause problems pulling the data back out. To get around this problem, you can call this method to convert the data to a form that is likely to be recognized. This conversion is likely but not guaranteed because not all types are convertable to something recognizable.
void vtkm::cont::DataSet::CopyStructure | ( | const vtkm::cont::DataSet & | source | ) |
Copies the structure from the source dataset.
The structure includes the cellset, the coordinate systems, and any ghost layer information. The fields that are not part of a coordinate system or ghost layers are left unchanged.
|
inline |
Returns the first cell field that matches the provided name.
This method will throw an exception if no match is found. Use HasCellField()
to query whether a particular field exists.
|
inline |
Returns the first cell field that matches the provided name.
This method will throw an exception if no match is found. Use HasCellField()
to query whether a particular field exists.
|
inline |
|
inline |
vtkm::cont::CoordinateSystem vtkm::cont::DataSet::GetCoordinateSystem | ( | const std::string & | name | ) | const |
Returns the CoordinateSystem that matches the provided name.
Will throw an exception if no match is found
vtkm::cont::CoordinateSystem vtkm::cont::DataSet::GetCoordinateSystem | ( | vtkm::Id | index = 0 | ) | const |
vtkm::IdComponent vtkm::cont::DataSet::GetCoordinateSystemIndex | ( | const std::string & | name | ) | const |
Returns the index for the CoordinateSystem whose name matches the provided string.
Will return -1 if no match is found
const std::string& vtkm::cont::DataSet::GetCoordinateSystemName | ( | vtkm::Id | index = 0 | ) | const |
|
inline |
Returns the field that matches the provided name and association.
This method will throw an exception if no match is found. Use HasField()
to query whether a particular field exists.
|
inline |
Returns the field that matches the provided name and association.
This method will throw an exception if no match is found. Use HasField()
to query whether a particular field exists.
|
inline |
Retrieves a field by index.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index. This method is most useful for iterating over all the fields of a DataSet
(indexed from 0
to NumberOfFields() - 1
).
|
inline |
Retrieves a field by index.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index. This method is most useful for iterating over all the fields of a DataSet
(indexed from 0
to NumberOfFields() - 1
).
|
inline |
Returns the field that matches the provided name and association.
This method will return -1 if no match for the field is found.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index.
vtkm::cont::Field vtkm::cont::DataSet::GetGhostCellField | ( | ) | const |
Returns the cell field that matches the ghost cell field name.
This method will return a constant array of zeros if no match is found. Use HasGhostCellField()
to query whether a particular field exists.
const std::string& vtkm::cont::DataSet::GetGhostCellFieldName | ( | ) | const |
vtkm::Id vtkm::cont::DataSet::GetNumberOfCells | ( | ) | const |
Get the number of cells contained in this DataSet.
|
inline |
|
inline |
vtkm::Id vtkm::cont::DataSet::GetNumberOfPoints | ( | ) | const |
|
inline |
Returns the first point field that matches the provided name.
This method will throw an exception if no match is found. Use HasPointField()
to query whether a particular field exists.
|
inline |
Returns the first point field that matches the provided name.
This method will throw an exception if no match is found. Use HasPointField()
to query whether a particular field exists.
|
inline |
|
inline |
|
inline |
bool vtkm::cont::DataSet::HasGhostCellField | ( | ) | const |
|
inline |
|
default |
|
default |
void vtkm::cont::DataSet::PrintSummary | ( | std::ostream & | out | ) | const |
|
inline |
|
private |
void vtkm::cont::DataSet::SetGhostCellField | ( | const std::string & | fieldName, |
const vtkm::cont::UnknownArrayHandle & | field | ||
) |
Sets the ghost cell levels.
A field of the given name is added to the DataSet
, and that field is set as the cell ghost levels.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index.
void vtkm::cont::DataSet::SetGhostCellField | ( | const std::string & | name | ) |
Sets the cell field of the given name as the cell ghost levels.
If a cell field of the given name does not exist, an exception is thrown.
void vtkm::cont::DataSet::SetGhostCellField | ( | const vtkm::cont::Field & | field | ) |
Sets the ghost cell levels.
A field of the given name is added to the DataSet
, and that field is set as the cell ghost levels.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index.
void vtkm::cont::DataSet::SetGhostCellField | ( | const vtkm::cont::UnknownArrayHandle & | field | ) |
Sets the ghost cell levels to the given array.
A field with the global ghost cell field name (see GlobalGhostCellFieldName
) is added to the DataSet
and made to be the cell ghost levels.
Note that the indexing of fields is not the same as the order in which they are added, and that adding a field can arbitrarily reorder the integer indexing of all the fields. To retrieve a specific field, retrieve the field by name, not by integer index.
void vtkm::cont::DataSet::SetGhostCellFieldName | ( | const std::string & | name | ) |
Sets the name of the field to use for cell ghost levels.
This value can be set regardless of whether such a cell field actually exists.
|
private |
|
private |
|
private |
|
private |