FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
Atlas.hpp
1#ifndef __FIBER_GRID_ATLAS_HPP
2#define __FIBER_GRID_ATLAS_HPP "Created 27.02.2001 21:42:27 by werner"
3
4#include "GridAPI.h"
5#include "Chart.hpp"
6#include "Transformation.hpp"
7
8namespace Fiber
9{
10 using std::set;
12
20class GRID_API GlobalCharts : public ReferenceBase<GlobalCharts>
21 , public Intercube
22{
23public:
25 ChartDomain_t ChartDomain;
26
28
29 RefPtr<ChartIDList> operator()(const type_info&) const;
30
32
33 RefPtr<ChartID> mkChartID(const type_info&ti, const string&name)
34 {
35 return (*this)[ ti ][ name ];
36 }
37
38 RefPtr<ChartID> mkChartID(const type_info&ti, const string&name, uint16_t epsg_code)
39 {
40 RefPtr<ChartID> C = (*this)[ ti ][ name ];
41 C->epsg_code = epsg_code;
42 return C;
43 }
44
45 bool insertSharedChartID(const type_info&ti, const RefPtr<ChartID>&ExistingChartID);
46 bool insertSharedChart(const RefPtr<Chart>&ExistingChart);
47
48
49 RefPtr<ChartID> findChartID(const string&name) const;
50
53 {
54 virtual ~Iterator() = 0;
55 virtual bool apply(const type_info&ti, const RefPtr<ChartID>&ExistingChartID) = 0;
56 };
57
59 int iterate(Iterator&It) const;
60
61 unsigned iterate(const type_info&ti, const std::function<bool(const type_info&ti, const ChartID&)>&iterator) const;
62 unsigned type_iterate(const type_info&ti, const std::function<bool(const ChartID&)>&iterator) const;
63 unsigned epsg_iterate(uint16_t epsg_code, const std::function<bool(const ChartID&)>&iterator) const;
64
65 RefPtr<ChartID> findEPSG(uint16_t epsg_code) const;
66};
67
68
69class Skeleton;
70class FieldID;
71
72
98class GRID_API Transformator : public ReferenceBase<Transformator>
99{
100public:
102
104
106 {
107 RefPtr<Transformation> TransformationCallback;
108 RefPtr<Field> Sourcefield, SourcePositions;
109 };
110
132 virtual FieldTransformator
133 get(const ChartID&TargetChartName, const Skeleton&FieldContainer, const FieldID&Fieldname) = 0;
134};
135
136
152class GRID_API Atlas : public ReferenceBase<Atlas>
153{
154public:
155 typedef set<RefPtr<Chart> > Atlas_t;
156 Atlas_t ChartSet;
157 RefPtr<GlobalCharts> GlobalAtlas;
158
160
163
164 TransformationsByName LocalTransformations;
165
166 struct Globals
167 {
168 TransformationsByName myTransformations;
169 Transformators myTransformators;
170 };
171
172
173static Globals& myGlobals();
174
175static TransformationsByName& GlobalTransformations()
176 {
177 return myGlobals().myTransformations;
178 }
179
180static Transformators& GlobalTransformators()
181 {
182 return myGlobals().myTransformators;
183 }
184
185public:
186 Atlas(const RefPtr<GlobalCharts>&GA);
187
188 const RefPtr<GlobalCharts>&getGlobalAtlas() const
189 {
190 return GlobalAtlas;
191 }
192
199 {
200 if (!GlobalAtlas)
201 return NullPtr();
202
203 return (*GlobalAtlas)( ti );
204 }
205
211
217 RefPtr<ChartID> mkChartID(const type_info&ti, const string&name)
218 {
219 return (*this)[ ti ][ name ];
220 }
221
222 RefPtr<ChartID> mkChartID(const type_info&ti, const string&name, uint16_t epsg_code)
223 {
224 RefPtr<ChartID> C = (*this)[ ti ][ name ];
225 C->epsg_code = epsg_code;
226 return C;
227 }
228
229
230 void insertChart(const RefPtr<Chart>&newChart);
231
232 bool insertSharedChart(const RefPtr<Chart>&ExistingChart);
233
234
236// RefPtr<Chart> operator()(const string&) const;
238
240 RefPtr<Chart> operator()(unsigned epsg_code) const;
241
244 {
245 if (!C)
246 return NullPtr();
247
248 return (*this)( C->ID() );
249 }
250
251
256 // RefPtr<Chart> operator()(const type_info&) const;
257
262// RefPtr<Chart> operator[](const type_info&);
263
266// RefPtr<Chart> getGlobalChart(const type_info&, const string&);
267// RefPtr<Chart> newChart(const RefPtr<Chart>&);
268
269/*
270 template <class CoordinateSystem>
271 struct CreateChart
272 {
273 static RefPtr<Chart> global(GridAtlas&myGridAtlas)
274 {
275 // GridAtlas::inited += CoordinateMap<CoordinateSystem>::initialized;
276 return myGridAtlas[ typeid(CoordinateSystem) ];
277 }
278 };
279*/
280
281 RefPtr<Transformation> getTransformation(const Chart&DestinationChart, const Chart&SourceChart) const;
282
284 getTransformation(const Chart&DestinationChart) const
285 {
286 return { self(), DestinationChart.self() };
287 }
288
289 friend RefPtr<Transformation> operator>>(const std::tuple<RefPtr<Atlas>, RefPtr<Chart>>&L, const Chart&SourceChart)
290 {
291 if (!std::get<0>(L)) return nullptr;
292 if (!std::get<1>(L)) return nullptr;
293 return std::get<0>(L)->getTransformation( *std::get<1>(L), SourceChart);
294 }
295
296static RefPtr<Transformation>
297 getGlobalTransformation(const Chart&DestinationChart, const Chart&SourceChart);
298
299};
300
301/*
302template <class CoordinateSystem>
303struct GridAtlas::CreateChart<CoordinateMap<CoordinateSystem> >
304{
305static RefPtr<Chart> global(GridAtlas&myGridAtlas)
306 {
307 GridAtlas::inited += CoordinateMap<CoordinateSystem>::initialized;
308 return myGridAtlas[ typeid(CoordinateSystem) ];
309 }
310};
311*/
312
313
314} /* namespace Fiber */
315
316#endif /* __FIBER_GRID_ATLAS_HPP */
_Expr< _ValFunClos< _ValArray, _Tp >, _Tp > apply(_Tp __func(_Tp)) const
RefPtr< ChartIDList > operator()(const type_info &ti) const
Given a certain type id of a chart, return a list of possible chart identifiers that are globally ass...
Definition Atlas.hpp:198
RefPtr< Chart > operator()(const RefPtr< Chart > &C) const
Search for a compatible chart.
Definition Atlas.hpp:243
RefPtr< Chart > operator()(unsigned epsg_code) const
Search for a chart by EPSG Code.
RefPtr< ChartID > mkChartID(const type_info &ti, const string &name)
Make a chart Identifier for a given coordinate type and text.
Definition Atlas.hpp:217
RefPtr< Chart > operator()(const RefPtr< ChartID > &) const
Search for a certain chart by name.
Definition ChartID.hpp:79
A Chart ID is just a textual description of the certain chart object; there may be many chart objects...
Definition ChartID.hpp:44
A generic Chart object that may be used to cast information of points within a manifold to numerical ...
Definition Chart.hpp:91
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
A list of chart identifiers (i.e.
Definition Atlas.hpp:22
T & operator[](index_t i) const
Access an element of the array, writeable.
Definition vector/Iterator.hpp:712
A Skeleton is a set of Representation object, each of them accessed by an Representer object.
Definition Skeleton.hpp:102
Callback interface to allow interfacing a full transformation pipeline provided by external means,...
Definition Atlas.hpp:99
virtual FieldTransformator get(const ChartID &TargetChartName, const Skeleton &FieldContainer, const FieldID &Fieldname)=0
Callback function to provide a Transformation into the specific chart from the available coordinate r...
MemCore::RefPtr< RenderBasin::RenderParameter > operator>>(const Anemone_Context_String_t &ACS, const Type &Functor)
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
std::nullptr_t NullPtr
Definition Atlas.hpp:167
Definition Atlas.hpp:53