VTK-m  2.2
CrossProduct.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 
11 #ifndef vtk_m_filter_vector_analysis_CrossProduct_h
12 #define vtk_m_filter_vector_analysis_CrossProduct_h
13 
14 #include <vtkm/filter/Filter.h>
15 
17 
18 namespace vtkm
19 {
20 namespace filter
21 {
22 namespace vector_analysis
23 {
24 
30 {
31 public:
32  VTKM_CONT
33  CrossProduct();
34 
42  const std::string& name,
44  {
45  this->SetActiveField(name, association);
46  }
47 
49  VTKM_CONT const std::string& GetPrimaryFieldName() const { return this->GetActiveFieldName(); }
52  {
53  return this->GetActiveFieldAssociation();
54  }
55 
58  {
59  this->SetUseCoordinateSystemAsField(flag);
60  }
63  {
64  return this->GetUseCoordinateSystemAsField();
65  }
66 
68  VTKM_CONT
69  void SetPrimaryCoordinateSystem(vtkm::Id index) { this->SetActiveCoordinateSystem(index); }
71  {
72  return this->GetActiveCoordinateSystemIndex();
73  }
74 
82  const std::string& name,
84  {
85  this->SetActiveField(1, name, association);
86  }
87 
89  VTKM_CONT
90  const std::string& GetSecondaryFieldName() const { return this->GetActiveFieldName(1); }
93  {
94  return this->GetActiveFieldAssociation(1);
95  }
96 
99  {
100  this->SetUseCoordinateSystemAsField(1, flag);
101  }
104  {
105  return this->GetUseCoordinateSystemAsField(1);
106  }
107 
109  VTKM_CONT
110  void SetSecondaryCoordinateSystem(vtkm::Id index) { this->SetActiveCoordinateSystem(1, index); }
113  {
114  return this->GetActiveCoordinateSystemIndex(1);
115  }
116 
117 private:
118  VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
119 };
120 
121 } // namespace vector_analysis
122 } // namespace filter
123 } // namespace vtkm
124 
125 #endif // vtk_m_filter_vector_analysis_CrossProduct_h
vtkm::filter::vector_analysis::CrossProduct
Compute the cross product of 3D vector fields.
Definition: CrossProduct.h:29
vtkm::filter::vector_analysis::CrossProduct::GetPrimaryCoordinateSystemIndex
vtkm::Id GetPrimaryCoordinateSystemIndex() const
Definition: CrossProduct.h:70
vtkm::filter::vector_analysis::CrossProduct::SetPrimaryField
void SetPrimaryField(const std::string &name, vtkm::cont::Field::Association association=vtkm::cont::Field::Association::Any)
Specify the primary field to operate on.
Definition: CrossProduct.h:41
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::vector_analysis::CrossProduct::GetPrimaryFieldName
const std::string & GetPrimaryFieldName() const
Specify the primary field to operate on.
Definition: CrossProduct.h:49
vtkm::cont::Field::Association
Association
Identifies what elements of a data set a field is associated with.
Definition: Field.h:38
vtkm::cont::DataSet
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
VTKM_FILTER_VECTOR_ANALYSIS_EXPORT
#define VTKM_FILTER_VECTOR_ANALYSIS_EXPORT
Definition: vtkm_filter_vector_analysis_export.h:44
vtkm_filter_vector_analysis_export.h
vtkm::filter::vector_analysis::CrossProduct::GetPrimaryFieldAssociation
vtkm::cont::Field::Association GetPrimaryFieldAssociation() const
Specify the primary field to operate on.
Definition: CrossProduct.h:51
vtkm::filter::vector_analysis::CrossProduct::GetUseCoordinateSystemAsPrimaryField
bool GetUseCoordinateSystemAsPrimaryField() const
Specify the primary field to operate on.
Definition: CrossProduct.h:62
vtkm::filter::vector_analysis::CrossProduct::GetSecondaryFieldAssociation
vtkm::cont::Field::Association GetSecondaryFieldAssociation() const
Specify the secondary field to operate on.
Definition: CrossProduct.h:92
vtkm::filter::vector_analysis::CrossProduct::GetSecondaryCoordinateSystemIndex
vtkm::Id GetSecondaryCoordinateSystemIndex() const
Specify the secondary field to operate on.
Definition: CrossProduct.h:112
vtkm::filter::vector_analysis::CrossProduct::SetUseCoordinateSystemAsSecondaryField
void SetUseCoordinateSystemAsSecondaryField(bool flag)
Specify the secondary field to operate on.
Definition: CrossProduct.h:98
vtkm::filter::Filter
Base class for all filters.
Definition: Filter.h:163
vtkm::filter::vector_analysis::CrossProduct::SetPrimaryCoordinateSystem
void SetPrimaryCoordinateSystem(vtkm::Id index)
Specify the primary field to operate on.
Definition: CrossProduct.h:69
vtkm::cont::Field::Association::Any
@ Any
Any field regardless of the association.
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
vtkm::filter::vector_analysis::CrossProduct::SetSecondaryField
void SetSecondaryField(const std::string &name, vtkm::cont::Field::Association association=vtkm::cont::Field::Association::Any)
Specify the secondary field to operate on.
Definition: CrossProduct.h:81
vtkm::filter::vector_analysis::CrossProduct::SetUseCoordinateSystemAsPrimaryField
void SetUseCoordinateSystemAsPrimaryField(bool flag)
Specify the primary field to operate on.
Definition: CrossProduct.h:57
vtkm::filter::vector_analysis::CrossProduct::GetSecondaryFieldName
const std::string & GetSecondaryFieldName() const
Specify the secondary field to operate on.
Definition: CrossProduct.h:90
vtkm::filter::vector_analysis::CrossProduct::GetUseCoordinateSystemAsSecondaryField
bool GetUseCoordinateSystemAsSecondaryField() const
Specify the secondary field to operate on.
Definition: CrossProduct.h:103
vtkm::filter::vector_analysis::CrossProduct::SetSecondaryCoordinateSystem
void SetSecondaryCoordinateSystem(vtkm::Id index)
Specify the secondary field to operate on.
Definition: CrossProduct.h:110
Filter.h