FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
FishGrid.hpp
1#ifndef __FISH_BONE_GRID_HPP
2#define __FISH_BONE_GRID_HPP
3
4#include "Fish.hpp"
5#include <ocean/shrimp/VStringList.hpp>
6#include <bundle/GridSelector.hpp>
7#include <bundle/FieldSelector.hpp>
8
9#include "GridInspector.hpp"
10
11namespace Wizt
12{
14
15 typedef Fiber::Bundle::GridInfo_t GridInfo;
16
20template <>
22{
23static bool setValueFromText(GridSelector&i, const string&s)
24 {
25 return i.selectGrid( s );
26 }
27
28static string Text(const GridSelector&GS)
29 {
30 return GS.Gridname();
31 }
32};
33
34//extern fishbone_API TypedSlot<Fiber::BundlePtr> getSpacetimeSlot(const TypedSlot<GridSelector>&GS);
35
42template <>
43struct fishbone_API TypedSlot<Fiber::Grid> : public TypedSlot<GridSelector>
44{
45 TypedSlot(VSlotContainer*that, const string&s, const GridSelector&GS = GridSelector(), int prior=0)
46 : TypedSlot<GridSelector>(that,s, GS, prior)
47 {
48 assert(that);
49 }
50};
51
52
53template <>
54struct fishbone_API VSlotContainer::in<Fiber::Grid, VSlotContainer::InvalidExpertLevel, void> : public TypedSlot<Fiber::Grid>
55{
56 in(VSlotContainer*that, const string&name, const GridSelector&GS = GridSelector(), int expertLevel=0)
57 : TypedSlot<Fiber::Grid>(that, name, GS, expertLevel)
58 {}
59
60 ~in();
61};
62
63
68template <>
69class fishbone_API VOutput<Fiber::Grid> : public VOutput<GridSelector>
70{
71public:
72 VOutput(VConnectable*Source,
73 const string&initial_name,
76};
77
78
79template<>
80struct fishbone_API VSlotContainer::out<Fiber::Grid,void> : public VOutput<Fiber::Grid>
81{
82/* out(const VParameter::SourceObject_t&Source,
83 const string&initial_name,
84 const Fiber::GridSelector&InitValue,
85 const RefPtr<VCreationPreferences>&CP = NullPtr() )
86 : VOutput<Fiber::Grid>(Source, initial_name, InitValue, CP)
87 {}
88*/
89 out(VConnectable*Source,
90 const string&initial_name,
94 {}
95
96// out(const VSlotContainer::Deferred&)
97// : VOutput<Fiber::Grid>(VSlotContainer::Deferred())
98// {}
99
100 ~out();
101};
102
103
104
108template <>
110{
111 virtual const Fish<Fiber::Grid>&GridContainer() const = 0;
112 virtual ~Fish() = 0;
113};
114
120template <>
121struct fishbone_API Fish<Fiber::Grid> : public virtual Fish<double>
122{
124
129 Fish(const string&s = "grid", int prior=2);
130
132 virtual ~Fish();
133
136 {
137 this->registerOutput( MyGrid );
138 }
139
168
174 {
175 GridSelector GS;
176 return findMostRecentGrid(GS, VP, SpaceTime);
177 }
178
191
198 const RefPtr<ValuePool>&VP,
199 int IndexDepth = 0,
201 const override;
202
203 using Fish<double>::IterateLevels;
204
226 {
227 return Fish<double>::IterateLevels(LI, findMostRecentGrid(Context, SpaceTime), Context);
228 }
229
230
239 const RefPtr<ValuePool>&VP,
241
242};
243
244} // namespace Wizt
245
246#endif /* __FISH_BONE_GRID_HPP */
Convenience class that implements a pointer to a Bundle object but adds some useful member funtions t...
Definition Bundle.hpp:779
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
An internal class that stores a couple of textual names.
Definition FieldSelector.hpp:18
An abstract base class for a list of Grid objects.
Definition GridContainer.hpp:25
Context information to select a grid from within a bundle.
Definition GridSelector.hpp:26
const string & Gridname() const
Return the name of the currently selected Grid.
Definition GridSelector.hpp:103
bool selectGrid(const string &name)
Select a certain grid out of the given spacetime.
Definition GridSelector.hpp:134
A Grid is a set of Skeleton objects, each of them accessed via some unique SkeletonID object.
Definition Grid.hpp:60
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
std::nullptr_t NullPtr
note: cannot derive from FloatingSkeletonRenderer as long as independent base class TriangleRenderer ...
Definition fs/init.hpp:20
The information as returned by a query for Grids.
Definition GridInfo.hpp:21
void registerGridAsOutput()
Make grid visible as output.
Definition FishGrid.hpp:135
virtual GridSelector getGridSelector(const RefPtr< ValuePool > &VP) const
Provide the current Grid selector, which usually would be taken from the intrinsic TypedSlot,...
bool IterateLevelsOnMostRecentGrid(LevelIterator &LI, const RefPtr< ValuePool > &Context, const Fiber::BundlePtr &SpaceTime=Fiber::BundlePtr(NullPtr())) const
Iterate over all the selected levels of a Grid via an instance of the LevelIterator.
Definition FishGrid.hpp:224
Fiber::Bundle::GridInfo_t findMostRecentGrid(GridSelector &GS, const RefPtr< ValuePool > &VP, const Fiber::BundlePtr &SpaceTime=Fiber::BundlePtr(NullPtr())) const
This is a convenience function to find the most recent grid for the current time ( Fish<Slice>() or v...
Fiber::Bundle::GridInfo_t findMostRecentGrid(const RefPtr< ValuePool > &VP, const Fiber::BundlePtr &SpaceTime=Fiber::BundlePtr(NullPtr())) const
Find the most recent grid for the current time ( Fish<Slice>() or virtual function getTime() ).
Definition FishGrid.hpp:173
Fiber::Info< Fiber::Skeleton > getRefinementLevel(int Level, const RefPtr< ValuePool > &VP, int IndexDepth=0, const Fiber::BundlePtr &SpaceTime=Fiber::BundlePtr(NullPtr())) const override
Get an refinement level for the given spacetime based on the GridSelector as returned by getGridSelec...