Viskores  1.0
DotProduct.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 
19 #ifndef viskores_filter_vector_analysis_DotProduct_h
20 #define viskores_filter_vector_analysis_DotProduct_h
21 
22 #include <viskores/filter/Filter.h>
24 
25 namespace viskores
26 {
27 namespace filter
28 {
29 namespace vector_analysis
30 {
31 
39 class VISKORES_FILTER_VECTOR_ANALYSIS_EXPORT DotProduct : public viskores::filter::Filter
40 {
41 public:
43 
51  const std::string& name,
53  {
54  this->SetActiveField(name, association);
55  }
56 
58  VISKORES_CONT const std::string& GetPrimaryFieldName() const
59  {
60  return this->GetActiveFieldName();
61  }
64  {
65  return this->GetActiveFieldAssociation();
66  }
67 
70  {
71  this->SetUseCoordinateSystemAsField(flag);
72  }
75  {
76  return this->GetUseCoordinateSystemAsField();
77  }
78 
81  {
82  this->SetActiveCoordinateSystem(coord_idx);
83  }
86  {
87  return this->GetActiveCoordinateSystemIndex();
88  }
89 
97  const std::string& name,
99  {
100  this->SetActiveField(1, name, association);
101  }
102 
104  VISKORES_CONT const std::string& GetSecondaryFieldName() const
105  {
106  return this->GetActiveFieldName(1);
107  }
110  {
111  return this->GetActiveFieldAssociation(1);
112  }
113 
116  {
117  this->SetUseCoordinateSystemAsField(1, flag);
118  }
121  {
122  return this->GetUseCoordinateSystemAsField(1);
123  }
124 
127  {
128  this->SetActiveCoordinateSystem(1, index);
129  }
132  {
133  return this->GetActiveCoordinateSystemIndex(1);
134  }
135 
136 private:
137  viskores::cont::DataSet DoExecute(const viskores::cont::DataSet& input) override;
138 };
139 
140 } // namespace vector_analysis
141 } // namespace filter
142 } // namespace viskores
143 
144 #endif // viskores_filter_vector_analysis_DotProduct_h
viskores::filter::vector_analysis::DotProduct::SetPrimaryCoordinateSystem
void SetPrimaryCoordinateSystem(viskores::Id coord_idx)
Specify the primary field to operate on.
Definition: DotProduct.h:80
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::cont::Field::Association
Association
Identifies what elements of a data set a field is associated with.
Definition: Field.h:46
viskores::cont::Field::Association::Any
@ Any
Any field regardless of the association.
viskores::filter::vector_analysis::DotProduct::GetPrimaryFieldName
const std::string & GetPrimaryFieldName() const
Specify the primary field to operate on.
Definition: DotProduct.h:58
viskores::filter::Filter
Base class for all filters.
Definition: Filter.h:171
viskores::filter::vector_analysis::DotProduct::SetSecondaryCoordinateSystem
void SetSecondaryCoordinateSystem(viskores::Id index)
Specify the secondary field to operate on.
Definition: DotProduct.h:126
viskores::filter::vector_analysis::DotProduct::GetSecondaryCoordinateSystemIndex
viskores::Id GetSecondaryCoordinateSystemIndex() const
Specify the secondary field to operate on.
Definition: DotProduct.h:131
viskores::Id
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
viskores::filter::vector_analysis::DotProduct::GetUseCoordinateSystemAsSecondaryField
bool GetUseCoordinateSystemAsSecondaryField() const
Specify the secondary field to operate on.
Definition: DotProduct.h:120
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::filter::vector_analysis::DotProduct::GetSecondaryFieldAssociation
viskores::cont::Field::Association GetSecondaryFieldAssociation() const
Specify the secondary field to operate on.
Definition: DotProduct.h:109
viskores::filter::vector_analysis::DotProduct::SetUseCoordinateSystemAsPrimaryField
void SetUseCoordinateSystemAsPrimaryField(bool flag)
Specify the primary field to operate on.
Definition: DotProduct.h:69
viskores::filter::vector_analysis::DotProduct::GetUseCoordinateSystemAsPrimaryField
bool GetUseCoordinateSystemAsPrimaryField() const
Specify the primary field to operate on.
Definition: DotProduct.h:74
viskores::filter::vector_analysis::DotProduct
Compute the dot product of vector fields.
Definition: DotProduct.h:39
viskores::filter::vector_analysis::DotProduct::GetSecondaryFieldName
const std::string & GetSecondaryFieldName() const
Specify the secondary field to operate on.
Definition: DotProduct.h:104
viskores::filter::vector_analysis::DotProduct::SetPrimaryField
void SetPrimaryField(const std::string &name, viskores::cont::Field::Association association=viskores::cont::Field::Association::Any)
Specify the primary field to operate on.
Definition: DotProduct.h:50
viskores::filter::vector_analysis::DotProduct::GetPrimaryFieldAssociation
viskores::cont::Field::Association GetPrimaryFieldAssociation() const
Specify the primary field to operate on.
Definition: DotProduct.h:63
viskores::filter::vector_analysis::DotProduct::GetPrimaryCoordinateSystemIndex
viskores::Id GetPrimaryCoordinateSystemIndex() const
Specify the primary field to operate on.
Definition: DotProduct.h:85
viskores_filter_vector_analysis_export.h
viskores::filter::vector_analysis::DotProduct::SetUseCoordinateSystemAsSecondaryField
void SetUseCoordinateSystemAsSecondaryField(bool flag)
Specify the secondary field to operate on.
Definition: DotProduct.h:115
viskores::filter::vector_analysis::DotProduct::SetSecondaryField
void SetSecondaryField(const std::string &name, viskores::cont::Field::Association association=viskores::cont::Field::Association::Any)
Specify the secondary field to operate on.
Definition: DotProduct.h:96
Filter.h