VTK-m
2.0
|
A FieldSelection
stores information about fields to map for input dataset to output when a filter is executed.
More...
#include <FieldSelection.h>
Public Types | |
enum | Mode { Mode::None, Mode::All, Mode::Select, Mode::Exclude } |
Public Member Functions | |
VTKM_CONT | FieldSelection (Mode mode=Mode::Select) |
VTKM_CONT | FieldSelection (const std::string &field, Mode mode=Mode::Select) |
Use this constructor to create a field selection given a single field name. More... | |
VTKM_CONT | FieldSelection (const char *field, Mode mode=Mode::Select) |
Use this constructor to create a field selection given a single field name. More... | |
VTKM_CONT | FieldSelection (const std::string &field, vtkm::cont::Field::Association association, Mode mode=Mode::Select) |
Use this constructor to create a field selection given a single name and association. More... | |
VTKM_CONT | FieldSelection (std::initializer_list< std::string > fields, Mode mode=Mode::Select) |
Use this constructor to create a field selection given the field names. More... | |
VTKM_CONT | FieldSelection (std::initializer_list< std::pair< std::string, vtkm::cont::Field::Association >> fields, Mode mode=Mode::Select) |
Use this constructor create a field selection given the field names and associations e.g. More... | |
VTKM_CONT | FieldSelection (std::initializer_list< vtkm::Pair< std::string, vtkm::cont::Field::Association >> fields, Mode mode=Mode::Select) |
Use this constructor create a field selection given the field names and associations e.g. More... | |
VTKM_CONT | FieldSelection (const FieldSelection &src) |
VTKM_CONT | FieldSelection (FieldSelection &&rhs) |
VTKM_CONT FieldSelection & | operator= (const FieldSelection &src) |
VTKM_CONT FieldSelection & | operator= (FieldSelection &&rhs) |
VTKM_CONT | ~FieldSelection () |
VTKM_CONT bool | IsFieldSelected (const vtkm::cont::Field &inputField) const |
Returns true if the input field should be mapped to the output dataset. More... | |
VTKM_CONT bool | IsFieldSelected (const std::string &name, vtkm::cont::Field::Association association=vtkm::cont::Field::Association::Any) const |
VTKM_CONT bool | HasField (const vtkm::cont::Field &inputField) const |
Returns true if the input field has been added to this selection. More... | |
VTKM_CONT bool | HasField (const std::string &name, vtkm::cont::Field::Association association=vtkm::cont::Field::Association::Any) const |
VTKM_CONT void | ClearFields () |
Clear all fields added using AddField . More... | |
VTKM_CONT Mode | GetMode () const |
Gets the mode of the field selection. More... | |
VTKM_CONT void | SetMode (Mode val) |
Sets the mode of the field selection. More... | |
VTKM_CONT void | AddField (const vtkm::cont::Field &inputField) |
VTKM_CONT void | AddField (const vtkm::cont::Field &inputField, Mode mode) |
VTKM_CONT void | AddField (const std::string &fieldName, vtkm::cont::Field::Association association=vtkm::cont::Field::Association::Any) |
VTKM_CONT void | AddField (const std::string &fieldName, Mode mode) |
VTKM_CONT void | AddField (const std::string &fieldName, vtkm::cont::Field::Association association, Mode mode) |
VTKM_CONT Mode | GetFieldMode (const vtkm::cont::Field &inputField) const |
VTKM_CONT Mode | GetFieldMode (const std::string &fieldName, vtkm::cont::Field::Association association=vtkm::cont::Field::Association::Any) const |
Private Attributes | |
std::unique_ptr< InternalStruct > | Internals |
A FieldSelection
stores information about fields to map for input dataset to output when a filter is executed.
A FieldSelection
object is passed to vtkm::filter::Filter::Execute
to execute the filter and map selected fields. It is possible to easily construct FieldSelection
that selects all or none of the input fields.
|
strong |
VTKM_CONT vtkm::filter::FieldSelection::FieldSelection | ( | Mode | mode = Mode::Select | ) |
VTKM_CONT vtkm::filter::FieldSelection::FieldSelection | ( | const std::string & | field, |
Mode | mode = Mode::Select |
||
) |
Use this constructor to create a field selection given a single field name.
VTKM_CONT vtkm::filter::FieldSelection::FieldSelection | ( | const char * | field, |
Mode | mode = Mode::Select |
||
) |
Use this constructor to create a field selection given a single field name.
VTKM_CONT vtkm::filter::FieldSelection::FieldSelection | ( | const std::string & | field, |
vtkm::cont::Field::Association | association, | ||
Mode | mode = Mode::Select |
||
) |
Use this constructor to create a field selection given a single name and association.
{cpp}
VTKM_CONT vtkm::filter::FieldSelection::FieldSelection | ( | std::initializer_list< std::string > | fields, |
Mode | mode = Mode::Select |
||
) |
Use this constructor to create a field selection given the field names.
VTKM_CONT vtkm::filter::FieldSelection::FieldSelection | ( | std::initializer_list< std::pair< std::string, vtkm::cont::Field::Association >> | fields, |
Mode | mode = Mode::Select |
||
) |
Use this constructor create a field selection given the field names and associations e.g.
VTKM_CONT vtkm::filter::FieldSelection::FieldSelection | ( | std::initializer_list< vtkm::Pair< std::string, vtkm::cont::Field::Association >> | fields, |
Mode | mode = Mode::Select |
||
) |
Use this constructor create a field selection given the field names and associations e.g.
VTKM_CONT vtkm::filter::FieldSelection::FieldSelection | ( | const FieldSelection & | src | ) |
VTKM_CONT vtkm::filter::FieldSelection::FieldSelection | ( | FieldSelection && | rhs | ) |
VTKM_CONT vtkm::filter::FieldSelection::~FieldSelection | ( | ) |
VTKM_CONT void vtkm::filter::FieldSelection::AddField | ( | const std::string & | fieldName, |
vtkm::cont::Field::Association | association, | ||
Mode | mode | ||
) |
|
inline |
|
inline |
|
inline |
VTKM_CONT void vtkm::filter::FieldSelection::ClearFields | ( | ) |
Clear all fields added using AddField
.
VTKM_CONT Mode vtkm::filter::FieldSelection::GetFieldMode | ( | const std::string & | fieldName, |
vtkm::cont::Field::Association | association = vtkm::cont::Field::Association::Any |
||
) | const |
Returns the mode for a particular field. If the field as been added with AddField
(or another means), then this will return Select
or Exclude
. If the field has not been added, None
will be returned.
|
inline |
Returns the mode for a particular field. If the field as been added with AddField
(or another means), then this will return Select
or Exclude
. If the field has not been added, None
will be returned.
Gets the mode of the field selection.
If Select
mode is on, then only fields that have a Select
mode are considered as selected. (All others are considered unselected.) Calling AddField
in this mode will mark it as Select
. If Exclude
mode is on, then all fields are considered selected except those fields with an Exclude
mode. Calling AddField
in this mode will mark it as Exclude
.
|
inline |
|
inline |
Returns true if the input field has been added to this selection.
Note that depending on the mode of this selection, the result of HasField is not necessarily the same as IsFieldSelected. (If the mode is MODE_SELECT, then the result of the two will be the same.)
VTKM_CONT bool vtkm::filter::FieldSelection::IsFieldSelected | ( | const std::string & | name, |
vtkm::cont::Field::Association | association = vtkm::cont::Field::Association::Any |
||
) | const |
|
inline |
Returns true if the input field should be mapped to the output dataset.
VTKM_CONT FieldSelection& vtkm::filter::FieldSelection::operator= | ( | const FieldSelection & | src | ) |
VTKM_CONT FieldSelection& vtkm::filter::FieldSelection::operator= | ( | FieldSelection && | rhs | ) |
Sets the mode of the field selection.
If Select
mode is on, then only fields that have a Select
mode are considered as selected. (All others are considered unselected.) Calling AddField
in this mode will mark it as Select
. If Exclude
mode is on, then all fields are considered selected except those fields with an Exclude
mode. Calling AddField
in this mode will mark it as Exclude
.
If the mode is set to None
, then the field modes are cleared and the overall mode is set to Select
(meaning none of the fields are initially selected). If the mode is set to All
, then the field modes are cleared and the overall mode is set to Exclude
(meaning all of the fields are initially selected).
|
private |