FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
GridOperatorObject.hpp
1#ifndef __FIBER_POND_BONES_GRIDOPERATOROBJECT_HPP
2#define __FIBER_POND_BONES_GRIDOPERATOROBJECT_HPP
3
4#include <grid/CartesianChart.hpp>
5#include <ocean/shrimp/VChart.hpp>
6#include "FishSlice.hpp"
7#include "FishGrid.hpp"
8#include "GridActor.hpp"
9
10#include <fiber/bundle/RepresentationInfo.hpp>
11
12namespace Wizt
13{
14
15
19template <class BaseClass = VObject>
21 , public Fish<Fiber::Slice>
22 , public Fish<Fiber::Grid>
23{
24 GridOperatorObject(const string&name, int P, const RefPtr<VCreationPreferences>&VP,
25 const string&InputGridNameSlot = "grid", int InputGridNameSlotEL = 2)
26 : BaseClass(name, P, VP)
28 {
29 }
30
31 template <class ...BaseArgs>
32 GridOperatorObject(const string&name, int P, const RefPtr<VCreationPreferences>&VP,
33 const string&InputGridNameSlot = "grid", int InputGridNameSlotEL = 2,
35 : BaseClass(name, P, VP, baseargs...)
37 {
38 }
39};
40
41
45template <class BaseClass = VObject>
47 , public VChartDependent
48{
50 const string&InputGridNameSlot = "grid", int InputGridNameSlotEL = 2)
52 {
53 }
54
56 {
59
60 return G->findChart( typeid(Fiber::CartesianChart3D), theChart.Chartname() );
61 }
62
63
64virtual bool updateVertexRepresentation(const Fiber::Info<Fiber::Representation>&iR,
65 VRequest&Context, double p)
66 {
67 return true;
68 }
69
70virtual bool updateGrid(const Fiber::Bundle::GridInfo_t&iG, const RefPtr<Fiber::Chart>&theCurrentChart, VRequest&Context, double p)
71 {
72 using namespace Fiber;
73 if (RefPtr<Skeleton> Vertices = iG.getGrid()->findVertices())
74 if (RefPtr<Representation> R = (*Vertices)(theCurrentChart))
75 {
76 return updateVertexRepresentation( {{iG, Vertices}, R, theCurrentChart}, Context, p);
77 }
78
79 return true;
80 }
81
82 bool update(VRequest&Context, double p) override
83 {
84 using namespace Fiber;
85
87 iG = this->findMostRecentGrid(Context);
88
89 if (RefPtr<Grid> G = iG)
90 {
93
94 RefPtr<Chart> myCurrentChart = G->findChart( typeid(CartesianChart3D), theChart.Chartname() );
95 if (!myCurrentChart) return true;
96
97 return updateGrid(iG, myCurrentChart, Context, p);
98 }
99 return true;
100 }
101};
102
103} // namespace
104
105#endif // __FIBER_POND_BONES_GRIDOPERATOROBJECT_HPP
Chart object for cartesian coordinates.
Definition CartesianChart.hpp:15
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
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 ...
The information as returned by a query for Grids.
Definition GridInfo.hpp:21
Convenience class for objects operating on Grid objects in a certain coordinate system.
Definition GridOperatorObject.hpp:48
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...
Convenience class for objects operating on Grid objects.
Definition GridOperatorObject.hpp:23