VTK-m  2.0
DotProduct.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_DotProduct_h
12 #define vtk_m_filter_vector_analysis_DotProduct_h
13 
15 #include <vtkm/filter/vector_analysis/vtkm_filter_vector_analysis_export.h>
16 
17 namespace vtkm
18 {
19 namespace filter
20 {
21 namespace vector_analysis
22 {
23 class VTKM_FILTER_VECTOR_ANALYSIS_EXPORT DotProduct : public vtkm::filter::FilterField
24 {
25 public:
27 
31  VTKM_CONT
33  const std::string& name,
35  {
36  this->SetActiveField(name, association);
37  }
38 
39  VTKM_CONT const std::string& GetPrimaryFieldName() const { return this->GetActiveFieldName(); }
41  {
42  return this->GetActiveFieldAssociation();
43  }
45 
49  VTKM_CONT
51  {
52  this->SetUseCoordinateSystemAsField(flag);
53  }
54  VTKM_CONT
56  {
57  return this->GetUseCoordinateSystemAsField();
58  }
60 
64  VTKM_CONT
66  {
67  this->SetActiveCoordinateSystem(coord_idx);
68  }
69  VTKM_CONT
71  {
72  return this->GetActiveCoordinateSystemIndex();
73  }
75 
79  VTKM_CONT
81  const std::string& name,
83  {
84  this->SetActiveField(1, name, association);
85  }
86 
87  VTKM_CONT const std::string& GetSecondaryFieldName() const { return this->GetActiveFieldName(1); }
89  {
90  return this->GetActiveFieldAssociation(1);
91  }
93 
97  VTKM_CONT
99  {
100  this->SetUseCoordinateSystemAsField(1, flag);
101  }
102  VTKM_CONT
104  {
105  return this->GetUseCoordinateSystemAsField(1);
106  }
108 
112  VTKM_CONT
113  void SetSecondaryCoordinateSystem(vtkm::Id index) { this->SetActiveCoordinateSystem(1, index); }
114  VTKM_CONT
116  {
117  return this->GetActiveCoordinateSystemIndex(1);
118  }
120 
121 private:
122  vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
123 };
124 } // namespace vector_analysis
125 } // namespace filter
126 } // namespace vtkm
127 
128 #endif // vtk_m_filter_vector_analysis_DotProduct_h
vtkm::filter::vector_analysis::DotProduct::GetSecondaryFieldName
const VTKM_CONT std::string & GetSecondaryFieldName() const
Definition: DotProduct.h:87
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::vector_analysis::DotProduct::SetSecondaryField
VTKM_CONT void SetSecondaryField(const std::string &name, vtkm::cont::Field::Association association=vtkm::cont::Field::Association::Any)
Definition: DotProduct.h:80
vtkm::filter::vector_analysis::DotProduct::SetSecondaryCoordinateSystem
VTKM_CONT void SetSecondaryCoordinateSystem(vtkm::Id index)
Definition: DotProduct.h:113
vtkm::filter::vector_analysis::DotProduct::GetUseCoordinateSystemAsSecondaryField
VTKM_CONT bool GetUseCoordinateSystemAsSecondaryField() const
Definition: DotProduct.h:103
vtkm::cont::Field::Association
Association
Definition: cont/Field.h:34
vtkm::filter::vector_analysis::DotProduct::GetPrimaryFieldAssociation
VTKM_CONT vtkm::cont::Field::Association GetPrimaryFieldAssociation() const
Definition: DotProduct.h:40
vtkm::filter::vector_analysis::DotProduct::GetPrimaryFieldName
const VTKM_CONT std::string & GetPrimaryFieldName() const
Definition: DotProduct.h:39
vtkm::cont::DataSet
Definition: DataSet.h:34
vtkm::filter::vector_analysis::DotProduct::GetPrimaryCoordinateSystemIndex
VTKM_CONT vtkm::Id GetPrimaryCoordinateSystemIndex() const
Definition: DotProduct.h:70
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
FilterField.h
vtkm::filter::FilterField
Definition: FilterField.h:21
vtkm::filter::vector_analysis::DotProduct::SetPrimaryCoordinateSystem
VTKM_CONT void SetPrimaryCoordinateSystem(vtkm::Id coord_idx)
Definition: DotProduct.h:65
vtkm::cont::Field::Association::Any
@ Any
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::filter::vector_analysis::DotProduct::GetUseCoordinateSystemAsPrimaryField
VTKM_CONT bool GetUseCoordinateSystemAsPrimaryField() const
Definition: DotProduct.h:55
vtkm::filter::vector_analysis::DotProduct
Definition: DotProduct.h:23
vtkm::filter::vector_analysis::DotProduct::SetPrimaryField
VTKM_CONT void SetPrimaryField(const std::string &name, vtkm::cont::Field::Association association=vtkm::cont::Field::Association::Any)
Definition: DotProduct.h:32
vtkm::filter::vector_analysis::DotProduct::SetUseCoordinateSystemAsPrimaryField
VTKM_CONT void SetUseCoordinateSystemAsPrimaryField(bool flag)
Definition: DotProduct.h:50
vtkm::filter::vector_analysis::DotProduct::SetUseCoordinateSystemAsSecondaryField
VTKM_CONT void SetUseCoordinateSystemAsSecondaryField(bool flag)
Definition: DotProduct.h:98
vtkm::filter::vector_analysis::DotProduct::GetSecondaryFieldAssociation
VTKM_CONT vtkm::cont::Field::Association GetSecondaryFieldAssociation() const
Definition: DotProduct.h:88
vtkm::filter::vector_analysis::DotProduct::GetSecondaryCoordinateSystemIndex
VTKM_CONT vtkm::Id GetSecondaryCoordinateSystemIndex() const
Definition: DotProduct.h:115