FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
BundleProperty.hpp
1#ifndef __FIBER_BUNDLEPROPERTY_HPP
2#define __FIBER_BUNDLEPROPERTY_HPP
3
4#include "Bundle.hpp"
5
6namespace Fiber
7{
8
9class GridSelector;
10class BUNDLE_API BundleProperty;
11
12BUNDLE_API bool hasProperty(const GridSelector&, const BundleProperty&);
13
21{
22
23public:
25 {}
26
27 virtual ~BundleProperty() = 0;
28
29 friend BUNDLE_API bool hasProperty( BundlePtr, const BundleProperty&);
30 friend BUNDLE_API bool hasProperty(const Bundle& , const BundleProperty&);
31
32// friend BUNDLE_API bool hasProperty(const GridSelector&, const BundleProperty&);
33
34 virtual bool checkSlice(Slice&S, const string&GridName) const = 0;
35
36 class BUNDLE_API Anything;
37};
38
42class BUNDLE_API BundleProperty::Anything : public BundleProperty
43{
44public:
45 ~Anything();
46
47 bool checkSlice(Slice&S, const string&GridName) const override;
48};
49
59{
60public:
61 ~GridProperty() = 0;
62
63 bool checkSlice(Slice&S, const string&GridName) const override;
64
65 virtual bool checkGrid(const Grid&S) const = 0;
66};
67
76{
77public:
82
87
89
90 bool checkGrid(const Grid&S) const override;
91};
92
97
98template< class GridType >
99class hasSkeletonOfGridType : public virtual GridProperty
100{
101
102public:
103 bool checkGrid(const Grid&G) const override
104 {
105 hasSkeleton hs( GridType::ID() );
106 return hs.checkGrid( G );
107 }
108};
109
116{
117
118public:
119 bool checkGrid(const Grid&G) const override;
120
122};
123
124
132{
133
134public:
135 bool checkGrid(const Grid&G) const override;
136
138};
139
140
144template <int Dimensions>
146{
147
148public:
149 bool checkGrid(const Grid&G) const override
150 {
151 if (RefPtr<Representation> R = G.getCartesianRepresentation())
152 {
153 if (RefPtr<Field> Positions = R->getPositions() )
154 {
155 int PositionDims = Positions->Dims();
157 return true;
158
159 // no information available?
160 // in that case assume it's fitting.
161 if (PositionDims == -1)
162 return true;
163
164 return false;
165 }
166 }
167 return false;
168 }
169};
170
175{
176
177public:
178 bool checkGrid(const Grid&G) const override;
180};
181
182
188{
189
190public:
191 bool checkGrid(const Grid&G) const override;
192
194};
195
201{
202
203public:
204 bool checkGrid(const Grid&G) const override;
205
207};
208
209
213template <class FirstProperty, class SecondProperty>
214struct AND : FirstProperty, SecondProperty
215{
216 bool checkSlice(Slice&S, const string&GridName) const override
217 {
218 return FirstProperty::checkSlice(S, GridName) &&
219 SecondProperty::checkSlice(S, GridName);
220 }
221};
222
226template <class FirstProperty, class SecondProperty>
227struct OR : FirstProperty, SecondProperty
228{
229 bool checkSlice(Slice&S, const string&GridName) const override
230 {
231 return FirstProperty::checkSlice(S, GridName) ||
232 SecondProperty::checkSlice(S, GridName);
233 }
234};
235
239template <class SomeProperty>
240struct NOT : SomeProperty
241{
242 bool checkSlice(Slice&S, const string&GridName) const override
243 {
244 return !SomeProperty::checkSlice(S, GridName);
245 }
246};
247
248
249
250} /* namespace Fiber */
251
252#endif /* __FIBER_BUNDLEPROPERTY_HPP */
Convenient abstract base class for inspecting and evaluating properties of Bundles.
Definition BundleProperty.hpp:21
Convenience class that implements a pointer to a Bundle object but adds some useful member funtions t...
Definition Bundle.hpp:779
The main entity holding all information.
Definition Bundle.hpp:173
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
An abstract bundle property which returns true if a Grid with the property query as implemented in th...
Definition BundleProperty.hpp:59
A Grid is a set of Skeleton objects, each of them accessed via some unique SkeletonID object.
Definition Grid.hpp:60
A concrete Grid Property which looks for the existence of a Skeleton of the specified dimension and i...
Definition BundleProperty.hpp:76
SkeletonExistence(int Dimensionality, int theIndexDepth)
Create from Dimensions and index depth.
Definition BundleProperty.hpp:79
SkeletonExistence(const SkeletonID &sid)
Create from skeleton ID.
Definition BundleProperty.hpp:84
Identifier for Skeletons within a Grid.
Definition SkeletonID.hpp:24
Information per time slice, mainly a set of Grid objects that are accessed via GridID objects.
Definition Slice.hpp:36
Checks if the given Grid has a representation in cartesian coordinates.
Definition BundleProperty.hpp:188
Checks if the given Grid has a explicit cartesian coordinates, i.e, no procedural coordinates such as...
Definition BundleProperty.hpp:201
Definition BundleProperty.hpp:100
Checks if the given Grid is a Curvilinear Grid.
Definition BundleProperty.hpp:175
Checks if the given Grid is uniform in cartesian coordinates, possibly in multiple fragments.
Definition BundleProperty.hpp:132
Checks if the given Grid is regular.
Definition BundleProperty.hpp:146
Checks if the given Grid is uniform in cartesian coordinates.
Definition BundleProperty.hpp:116
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
Combining bundle properties as AND operation.
Definition BundleProperty.hpp:215
Inverting a bundle property.
Definition BundleProperty.hpp:241
Combining bundle properties as OR operation.
Definition BundleProperty.hpp:228