9 #ifndef CMZN_FIELDVECTOROPERATORS_HPP__
10 #define CMZN_FIELDVECTOROPERATORS_HPP__
12 #include "zinc/fieldvectoroperators.h"
13 #include "zinc/field.hpp"
14 #include "zinc/fieldmodule.hpp"
20 class FieldCrossProduct :
public Field
38 explicit FieldCrossProduct(cmzn_field_id field_id) : Field(field_id)
42 const Field *sourceFields);
45 const Field& sourceField1,
const Field& sourceField2);
49 FieldCrossProduct() : Field(0)
53 class FieldDotProduct :
public Field
65 explicit FieldDotProduct(cmzn_field_id field_id) : Field(field_id)
69 const Field& sourceField2);
73 FieldDotProduct() : Field(0)
77 class FieldMagnitude :
public Field
87 explicit FieldMagnitude(cmzn_field_id field_id) : Field(field_id)
94 FieldMagnitude() : Field(0)
98 class FieldNormalise :
public Field
110 explicit FieldNormalise(cmzn_field_id field_id) : Field(field_id)
117 FieldNormalise() : Field(0)
121 class FieldSumComponents :
public Field
134 explicit FieldSumComponents(cmzn_field_id field_id) : Field(field_id)
141 FieldSumComponents() : Field(0)
148 cmzn_field_id field = 0;
151 cmzn_field_id *source_fields =
new cmzn_field_id[fieldsCount];
152 for (
int i = 0; i < fieldsCount; i++)
154 source_fields[i] = sourceFields[i].
getId();
156 field = cmzn_fieldmodule_create_field_cross_product(
id, fieldsCount, source_fields);
157 delete[] source_fields;
165 sourceField2.
getId()));
171 sourceField2.
getId()));
187 sourceField.
getId()));
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:46
A field which has one component equal to the sum of all components of the source field.
Definition: fieldvectoroperators.hpp:130
FieldDotProduct createFieldDotProduct(const Field &sourceField1, const Field &sourceField2)
Definition: fieldvectoroperators.hpp:168
FieldNormalise createFieldNormalise(const Field &sourceField)
Definition: fieldvectoroperators.hpp:179
A scalar field whose value is the dot product of the two supplied source fields, which must have equa...
Definition: fieldvectoroperators.hpp:61
A scalar field returning the magnitude of the vector source field.
Definition: fieldvectoroperators.hpp:83
cmzn_field_id getId() const
Definition: field.hpp:98
A field returning the values of source vector field normalised to unit length.
Definition: fieldvectoroperators.hpp:106
FieldMagnitude createFieldMagnitude(const Field &sourceField)
Definition: fieldvectoroperators.hpp:174
FieldSumComponents createFieldSumComponents(const Field &sourceField)
Definition: fieldvectoroperators.hpp:184
FieldCrossProduct createFieldCrossProduct(int fieldsCount, const Field *sourceFields)
Definition: fieldvectoroperators.hpp:146
A vector field which is the cross product of the source_fields.
Definition: fieldvectoroperators.hpp:34