VTK-m
2.0
|
#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 |
VTKM_CONT void | Clear () |
VTKM_CONT vtkm::Id | GetNumberOfCells () const |
Get the number of cells contained in this DataSet. More... | |
VTKM_CONT vtkm::Id | GetNumberOfPoints () const |
Get the number of points contained in this DataSet. More... | |
VTKM_CONT void | AddField (const Field &field) |
Adds a field to the DataSet . More... | |
VTKM_CONT bool | HasField (const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any) const |
VTKM_CONT bool | HasCellField (const std::string &name) const |
VTKM_CONT bool | HasGhostCellField () const |
const VTKM_CONT std::string & | GetGhostCellFieldName () const |
VTKM_CONT bool | HasPointField (const std::string &name) const |
VTKM_CONT 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... | |
VTKM_CONT void | SetGhostCellFieldName (const std::string &name) |
Sets the name of the field to use for cell ghost levels. More... | |
VTKM_CONT void | SetGhostCellField (const std::string &name) |
Sets the cell field of the given name as the cell ghost levels. More... | |
VTKM_CONT void | SetGhostCellField (const vtkm::cont::UnknownArrayHandle &field) |
Sets the ghost cell levels to the given array. More... | |
VTKM_CONT void | AddGhostCellField (const std::string &fieldName, const vtkm::cont::UnknownArrayHandle &field) |
VTKM_CONT void | AddGhostCellField (const vtkm::cont::UnknownArrayHandle &field) |
VTKM_CONT void | AddGhostCellField (const vtkm::cont::Field &field) |
VTKM_CONT vtkm::IdComponent | AddCoordinateSystem (const vtkm::cont::CoordinateSystem &cs) |
Adds the given CoordinateSystem to the DataSet . More... | |
VTKM_CONT vtkm::IdComponent | AddCoordinateSystem (const std::string &pointFieldName) |
Marks the point field with the given name as a coordinate system. More... | |
VTKM_CONT bool | HasCoordinateSystem (const std::string &name) const |
VTKM_CONT vtkm::cont::CoordinateSystem | GetCoordinateSystem (vtkm::Id index=0) const |
VTKM_CONT vtkm::IdComponent | GetCoordinateSystemIndex (const std::string &name) const |
Returns the index for the CoordinateSystem whose name matches the provided string. More... | |
const VTKM_CONT std::string & | GetCoordinateSystemName (vtkm::Id index=0) const |
VTKM_CONT vtkm::cont::CoordinateSystem | GetCoordinateSystem (const std::string &name) const |
Returns the CoordinateSystem that matches the provided name. More... | |
template<typename CellSetType > | |
VTKM_CONT void | SetCellSet (const CellSetType &cellSet) |
const VTKM_CONT vtkm::cont::UnknownCellSet & | GetCellSet () const |
VTKM_CONT vtkm::cont::UnknownCellSet & | GetCellSet () |
VTKM_CONT vtkm::IdComponent | GetNumberOfFields () const |
VTKM_CONT vtkm::IdComponent | GetNumberOfCoordinateSystems () const |
VTKM_CONT void | CopyStructure (const vtkm::cont::DataSet &source) |
Copies the structure from the source dataset. More... | |
VTKM_CONT void | ConvertToExpected () |
Convert the structures in this data set to expected types. More... | |
VTKM_CONT void | PrintSummary (std::ostream &out) const |
const VTKM_CONT vtkm::cont::Field & | GetField (vtkm::Id index) const |
Retrieves a field by index. More... | |
VTKM_CONT vtkm::cont::Field & | GetField (vtkm::Id index) |
Retrieves a field by index. More... | |
const VTKM_CONT 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 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 vtkm::cont::Field & | GetCellField (const std::string &name) const |
Returns the first cell field that matches the provided name. More... | |
VTKM_CONT vtkm::cont::Field & | GetCellField (const std::string &name) |
Returns the first cell field that matches the provided name. More... | |
const VTKM_CONT vtkm::cont::Field & | GetGhostCellField () const |
Returns the cell field that matches the ghost cell field name. More... | |
const VTKM_CONT vtkm::cont::Field & | GetPointField (const std::string &name) const |
Returns the first point field that matches the provided name. More... | |
VTKM_CONT vtkm::cont::Field & | GetPointField (const std::string &name) |
Returns the first point field that matches the provided name. More... | |
VTKM_CONT 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 > | |
VTKM_CONT 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 > | |
VTKM_CONT 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 > | |
VTKM_CONT 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... | |
VTKM_CONT 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 > | |
VTKM_CONT 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 > | |
VTKM_CONT 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 > | |
VTKM_CONT 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... | |
VTKM_CONT void | SetGhostCellField (const vtkm::cont::Field &field) |
Sets the ghost cell levels. More... | |
VTKM_CONT void | SetGhostCellField (const std::string &fieldName, const vtkm::cont::UnknownArrayHandle &field) |
Sets the ghost cell levels. More... | |
Private Member Functions | |
VTKM_CONT 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 |
|
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_CONT 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_CONT 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.
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.
VTKM_CONT void vtkm::cont::DataSet::Clear | ( | ) |
VTKM_CONT 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.
VTKM_CONT 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 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 vtkm::cont::CoordinateSystem vtkm::cont::DataSet::GetCoordinateSystem | ( | vtkm::Id | index = 0 | ) | const |
VTKM_CONT 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 VTKM_CONT 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.
const VTKM_CONT vtkm::cont::Field& vtkm::cont::DataSet::GetGhostCellField | ( | ) | const |
Returns the cell field that matches the ghost cell field name.
This method will throw an exception if no match is found. Use HasGhostCellField()
to query whether a particular field exists.
const VTKM_CONT std::string& vtkm::cont::DataSet::GetGhostCellFieldName | ( | ) | const |
Get the number of cells contained in this DataSet.
|
inline |
|
inline |
|
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 |
VTKM_CONT bool vtkm::cont::DataSet::HasGhostCellField | ( | ) | const |
|
inline |
|
default |
|
default |
VTKM_CONT void vtkm::cont::DataSet::PrintSummary | ( | std::ostream & | out | ) | const |
|
inline |
|
private |
VTKM_CONT 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.
VTKM_CONT 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.
VTKM_CONT 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.
VTKM_CONT 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.
VTKM_CONT 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 |