1#ifndef __FISH_BONE_FIELDFUNCTOR_HPP
2#define __FISH_BONE_FIELDFUNCTOR_HPP
4#include <bone/FieldOperatorObject.hpp>
5#include <bone/FieldInputCreator.hpp>
6#include <field/FunctionalCreator.hpp>
92template <
class Operation,
class Gr
idInspectorType =
typename Operation::Gr
idInspector>
101 using input_type =
typename Operation::input_type;
102 using output_type =
typename Operation::output_type;
139 bool Modified =
false;
140 bool doCreateArrayIfRequired =
true;
153#ifdef VERBOSE_FIELDFUNCTOR
165#ifdef VERBOSE_FIELDFUNCTOR
171#ifdef VERBOSE_FIELDFUNCTOR
186 ResultField =
new Field(frag->getFragmentIDCollection() );
188 ResultField =
new Field();
194 if (!CAB)
return nullptr;
196 if (!
Data)
return nullptr;
201 T =
Data->makeMemArray(
nullptr );
209#ifdef VERBOSE_FIELDFUNCTOR
223#ifdef VERBOSE_FIELDFUNCTOR
227 Result ->CacheInfoString =
"Computed field on fragment " +
wfrag->Name();
229 Result ->CacheInfoString =
"Computed field.";
235 ResultField->touch();
252 T =
Data->makeMemArray(
nullptr );
258 puts(
"FieldFunctor: OUCCCH - Some data here, but no fitting data!");
fflush(
stdout);
259 VActionNotifier::Warning(
"FieldFunctor \"" + theFieldFunctor.
Name() +
"\" :\n\n"
260 "Need data of type '" +
Typename(
typeid(input_type)) +
261 "', but input data are of type '" +
265 "Maybe a wrong input field was connected here. "
266 "The currently connected input field is \""
275#ifdef VERBOSE_FIELDFUNCTOR
287 Dst[i] = this->compute( Src[i] );
290 Result ->CacheInfoString =
"Computed field.";
294 ResultField =
new Field(frag->getFragmentIDCollection() );
296 ResultField =
new Field();
300#pragma message "Review this code to use Lambda creators!"
301 ResultField->touch();
309static string createChildname(
const string&
parent_name)
348#ifdef VERBOSE_FIELDFUNCTOR
362#ifdef VERBOSE_FIELDFUNCTOR
376 return MyOp.apply(frag, CAB);
384 if (
MyOp.ResultField)
395#ifdef VERBOSE_FIELDFUNCTOR
397 <<
", target representation "<<
Target.self() <<
" has " <<
Target.getNumberOfFields() <<
" fields";
404 OutField.accept<output_type>();
411#ifdef VERBOSE_FIELDFUNCTOR
constexpr auto end(_Container &__cont) -> decltype(__cont.end())
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
An abstract selection of fields, that is given by names of fields and possible types for each field.
Definition FieldSelection.hpp:23
An internal class that stores a couple of textual names.
Definition FieldSelector.hpp:18
double getTime() const
The time when this field was found most recently.
Definition FieldSelector.hpp:276
A Field is a collection of CreativeArrayBase reference pointers which are accessed via FragmentID obj...
Definition Field.hpp:245
Base class for iterators over the fragments of a field.
Definition FragmentID.hpp:249
index_t count() const
Return the number of steps which can be traversed through this ElementIterator.
Definition HyperslabParameters.hpp:147
A Representation is a set of Field objects, each of them accessed via some FieldID identifier.
Definition Representation.hpp:101
An intermediate class that allows to operate on the pure type information of some memory array.
Definition TypedArray.hpp:58
static RefPtr< Cache, CacheBase > & MemCache()
const std::string & Name() const
std::string BaseName(const char Separator) const
const auto & self() const
Perform operations on fields.
Definition FieldFunctor.hpp:94
virtual bool postOperation(VRequest &Context, Op &Result) const
An optional function to inspect the result of the operation, possibly modify or add something once it...
Definition FieldFunctor.hpp:337
VOutput< Fiber::Field > Result
The output: a Fiber::Field .
Definition FieldFunctor.hpp:111
FieldFunctor(const string &name, const string &fieldname, int p, const RefPtr< VCreationPreferences > &VP)
Constructor.
Definition FieldFunctor.hpp:116
bool FieldOperation(VRequest &Context, Fiber::Field &Source, Fiber::Representation &Target) override
The operation to be performed on the given field, to be overloaded in a subclass.
Definition FieldFunctor.hpp:342
bool doCreateArrayIfRequired
Flag. Is true by default.
Definition FieldFunctor.hpp:98
virtual bool modifyOperator(VRequest &Context, Operation &Op) const
An optional function to modify the current operator according the context, which may specify addition...
Definition FieldFunctor.hpp:320
Base class for objects that operate on Field objects and create new fields.
Definition FieldOperatorObject.hpp:44
MEMCORE_API std::string Typename(const std::type_info &t)
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
note: cannot derive from FloatingSkeletonRenderer as long as independent base class TriangleRenderer ...
Operator instance: The template argument as Operation paired with an Iteration over a Field's fragmen...
Definition FieldFunctor.hpp:137
bool apply(const RefPtr< FragmentID > &frag, const RefPtr< CreativeArrayBase > &CAB) override
Iteration callback function for each fragment of a Field.
Definition FieldFunctor.hpp:151
string Fieldname(const RefPtr< ValuePool > &VP) const
Get the name of the selected field.
Definition FishField.cpp:250
bool setStatusInfo(const RefPtr< ValuePool > &Context, const string &what) const
bool setStatusError(const RefPtr< ValuePool > &Context, const string &what, bool AnnouncePublic=false) const