Viskores  1.0
CrossProduct.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_CrossProduct_h
20 #define viskores_filter_vector_analysis_CrossProduct_h
21 
22 #include <viskores/filter/Filter.h>
23 
25 
26 namespace viskores
27 {
28 namespace filter
29 {
30 namespace vector_analysis
31 {
32 
37 class VISKORES_FILTER_VECTOR_ANALYSIS_EXPORT CrossProduct : public viskores::filter::Filter
38 {
39 public:
41  CrossProduct();
42 
50  const std::string& name,
52  {
53  this->SetActiveField(name, association);
54  }
55 
57  VISKORES_CONT const std::string& GetPrimaryFieldName() const
58  {
59  return this->GetActiveFieldName();
60  }
63  {
64  return this->GetActiveFieldAssociation();
65  }
66 
69  {
70  this->SetUseCoordinateSystemAsField(flag);
71  }
74  {
75  return this->GetUseCoordinateSystemAsField();
76  }
77 
80  void SetPrimaryCoordinateSystem(viskores::Id index) { this->SetActiveCoordinateSystem(index); }
82  {
83  return this->GetActiveCoordinateSystemIndex();
84  }
85 
93  const std::string& name,
95  {
96  this->SetActiveField(1, name, association);
97  }
98 
101  const std::string& GetSecondaryFieldName() const { return this->GetActiveFieldName(1); }
104  {
105  return this->GetActiveFieldAssociation(1);
106  }
107 
110  {
111  this->SetUseCoordinateSystemAsField(1, flag);
112  }
115  {
116  return this->GetUseCoordinateSystemAsField(1);
117  }
118 
122  {
123  this->SetActiveCoordinateSystem(1, index);
124  }
127  {
128  return this->GetActiveCoordinateSystemIndex(1);
129  }
130 
131 private:
132  VISKORES_CONT viskores::cont::DataSet DoExecute(const viskores::cont::DataSet& input) override;
133 };
134 
135 } // namespace vector_analysis
136 } // namespace filter
137 } // namespace viskores
138 
139 #endif // viskores_filter_vector_analysis_CrossProduct_h
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::CrossProduct::GetPrimaryFieldAssociation
viskores::cont::Field::Association GetPrimaryFieldAssociation() const
Specify the primary field to operate on.
Definition: CrossProduct.h:62
viskores::filter::Filter
Base class for all filters.
Definition: Filter.h:171
viskores::filter::vector_analysis::CrossProduct::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: CrossProduct.h:92
viskores::Id
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
viskores::filter::vector_analysis::CrossProduct::GetPrimaryFieldName
const std::string & GetPrimaryFieldName() const
Specify the primary field to operate on.
Definition: CrossProduct.h:57
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::CrossProduct::GetSecondaryFieldAssociation
viskores::cont::Field::Association GetSecondaryFieldAssociation() const
Specify the secondary field to operate on.
Definition: CrossProduct.h:103
viskores::filter::vector_analysis::CrossProduct::SetSecondaryCoordinateSystem
void SetSecondaryCoordinateSystem(viskores::Id index)
Specify the secondary field to operate on.
Definition: CrossProduct.h:121
viskores::filter::vector_analysis::CrossProduct
Compute the cross product of 3D vector fields.
Definition: CrossProduct.h:37
viskores::filter::vector_analysis::CrossProduct::GetUseCoordinateSystemAsPrimaryField
bool GetUseCoordinateSystemAsPrimaryField() const
Specify the primary field to operate on.
Definition: CrossProduct.h:73
viskores::filter::vector_analysis::CrossProduct::GetUseCoordinateSystemAsSecondaryField
bool GetUseCoordinateSystemAsSecondaryField() const
Specify the secondary field to operate on.
Definition: CrossProduct.h:114
viskores::filter::vector_analysis::CrossProduct::SetPrimaryCoordinateSystem
void SetPrimaryCoordinateSystem(viskores::Id index)
Specify the primary field to operate on.
Definition: CrossProduct.h:80
viskores::filter::vector_analysis::CrossProduct::GetPrimaryCoordinateSystemIndex
viskores::Id GetPrimaryCoordinateSystemIndex() const
Definition: CrossProduct.h:81
viskores_filter_vector_analysis_export.h
viskores::filter::vector_analysis::CrossProduct::SetUseCoordinateSystemAsSecondaryField
void SetUseCoordinateSystemAsSecondaryField(bool flag)
Specify the secondary field to operate on.
Definition: CrossProduct.h:109
viskores::filter::vector_analysis::CrossProduct::GetSecondaryCoordinateSystemIndex
viskores::Id GetSecondaryCoordinateSystemIndex() const
Specify the secondary field to operate on.
Definition: CrossProduct.h:126
viskores::filter::vector_analysis::CrossProduct::SetUseCoordinateSystemAsPrimaryField
void SetUseCoordinateSystemAsPrimaryField(bool flag)
Specify the primary field to operate on.
Definition: CrossProduct.h:68
viskores::filter::vector_analysis::CrossProduct::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: CrossProduct.h:49
viskores::filter::vector_analysis::CrossProduct::GetSecondaryFieldName
const std::string & GetSecondaryFieldName() const
Specify the secondary field to operate on.
Definition: CrossProduct.h:101
Filter.h