FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
FieldID.hpp
1#ifndef __FIBER_GRID_FIELDID_HPP
2#define __FIBER_GRID_FIELDID_HPP "Created 27.02.2001 21:42:27 by werner"
3
4#include "GridAPI.h"
5#include <fiber/field/Field.hpp>
6#include <memcore/TypeInfo.hpp>
7#include <set>
8#include <list>
9
10namespace Fiber
11{
12 using MemCore::WeakPtr;
13 using MemCore::NullPtr;
14 using std::set;
15 using std::list;
16
52class GRID_API FieldID : public ReferenceBase<FieldID>
53{
54 string name;
56
57 list<FieldIDPtr> sources;
58
59 FieldID(const FieldID&)
61 {}
62
63public:
71
73 FieldID(const string&n)
75 , name(n)
76 {}
77
79 FieldID(const WeakPtr<FiberTypeBase>&FTB, const string&n)
81 , name(n)
82 , FieldType(FTB)
83 {}
84
86 const string&Name() const
87 {
88 return name;
89 }
90
91 void rename(const string&NewName)
92 {
93 name = NewName;
94 }
95
98 {
99 sources.push_front(src);
100 }
101
102 string xml() const;
103
104 bool operator==(const string&s) const
105 {
106 return name == s;
107 }
108
109 bool operator!=(const string&s) const
110 {
111 return name != s;
112 }
113};
114
115#if defined(__cpp_concepts) && (__cpp_concepts >= 201907L)
116// Concepts are supported
117
119template<typename T>
120concept is_field_identifier = std::is_convertible_v<T, std::string> || std::is_convertible_v<T, const RefPtr<FieldID>&>;
121
122#else
123
124#define is_field_identifier typename
125
126#endif
127
128
134{
135public:
136 virtual ~FieldIterator();
137
139 virtual bool apply(const FieldID&d, const Field&R) = 0;
140};
141
142
143} /* namespace Fiber */
144
145#endif /* __FIBER_GRID_FIELDID_HPP */
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Identifier for Fields within a Grid.
Definition FieldID.hpp:53
FieldID(const string &n)
Construct a Field Identifier from a name.
Definition FieldID.hpp:73
FieldID(const WeakPtr< FiberTypeBase > &FTB, const string &n)
Construct with an initial type and name.
Definition FieldID.hpp:79
const string & Name() const
Get the textual description.
Definition FieldID.hpp:86
TypeList FieldType
The type of this field.
Definition FieldID.hpp:70
void addSource(const FieldIDPtr &src)
Specify another FieldID as a source of this FieldID.
Definition FieldID.hpp:97
Class for iterating over fields, in particular those contained in a Representation object.
Definition FieldID.hpp:134
virtual bool apply(const FieldID &d, const Field &R)=0
Virtual callback function.
A Field is a collection of CreativeArrayBase reference pointers which are accessed via FragmentID obj...
Definition Field.hpp:245
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
std::nullptr_t NullPtr
bool operator==(const MultipleStringSelection &a, const MultipleStringSelection &b)
bool operator!=(const MultipleStringSelection &a, const MultipleStringSelection &b)
A set of types.
Definition FiberType.hpp:213