FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
UnaryOperator.hpp
1#ifndef __FIBER_FIELD_UNARYY_OPERATOR_HPP
2#define __FIBER_FIELD_UNARYY_OPERATOR_HPP
3
4#include "ComputationalField.hpp"
5
6namespace Fiber
7{
8
9
46template <class Operator, class PrimaryValueType,
47 class ResultValueType = PrimaryValueType>
48struct UnaryOperator : public Operator
49{
51
52 typedef ResultValueType result_type;
53
59
60 template <Dims_t Dims>
61 bool computeFragment(MemArray<Dims, result_type>&Result,
63 const RefPtr<FragmentID>&myFragmentID)
64 {
66 MultiIndex<Dims> Index;
67
68 do
69 {
70 this->Operator::binary(Result[ Index ], PrimaryArray[ Index ] );
71 }
72 while( Index.inc(Size) );
73
74 return true;
75 }
76
77 template <Dims_t Dims>
78 bool computeIndexedFragment(MemArray<Dims, result_type>&Result,
79 const MemArray<Dims, primary_value_type>&PrimaryArray,
80 const RefPtr<FragmentID>&myFragmentID)
81 {
82 MultiIndex<Dims> Size = Result.Size();
83 MultiIndex<Dims> Index;
84
85 do
86 {
87 this->Operator::binary(Index, Result[ Index ], PrimaryArray[ Index ] );
88 }
89 while( Index.inc(Size) );
90
91 return true;
92 }
93};
94
95} // namespace Fiber
96
97
98#endif // __FIBER_FIELD_UNARYY_OPERATOR_HPP
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
Wizt::VCreatorProperty< Wizt::VCreatorProperties::OPERATORNAME > Operator
Implementing an unary operation on a fields with on-demand computation per fragment and discarding da...
Definition UnaryOperator.hpp:49
UnaryOperator()
The constructor.
Definition UnaryOperator.hpp:57