FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
RefinedFragmentSkeleton.hpp
1#ifndef __FIBER_GRID_TYPES_REFINEDFRAGMENTSKELETON_HPP
2#define __FIBER_GRID_TYPES_REFINEDFRAGMENTSKELETON_HPP
3
4
5#include "RelativeRepresentation.hpp"
6
7namespace Fiber
8{
9
10
19{
20 DynamicSize FragmentRefinementLayout;
21
22 RefPtr<Skeleton> myParent, myChild;
23
24public:
25 RelativeRepresentation FragmentRefinement;
26
29
32
33 RefPtr<Field> getParentChildFragmentField() const
34 {
35 if (FragmentRefinement.getParentChildMapping())
36 return FragmentRefinement.getParentChildMapping();
37 return getParentChildMapping();
38 }
39
40private:
42 getFragmentMapping() const;
43
44public:
45
47 createFragmentMapping(const DynamicSize&theFragmentRefinementLayout);
48
49 const DynamicSize&getFragmentRefinementLayout() const
50 {
51 return FragmentRefinementLayout;
52 }
53
54 int getFragmentRefinementDimension() const
55 {
56 return FragmentRefinementLayout.getRank();
57 }
58
59
60 const RefPtr<Skeleton>&getParentSkeleton() const
61 {
62 return myParent;
63 }
64
65 const RefPtr<Skeleton>&getChildSkeleton() const
66 {
67 return myChild;
68 }
69
74 const FragmentMapping_t&
75 getFragmentMappingArray(const RefPtr<FragmentID>&ParentFragmentID) const;
76
84 bool setFragmentMappingArray(const RefPtr<FragmentID>&ParentFragmentID,
85 const FragmentMapping_t&ChildFragments,
86 int RefinementFragmentDims);
87
88 bool assign(const RefPtr<Grid>&theGrid, const SkeletonID&ParentSid, const SkeletonID&ChildSid,
89 int FragmentRefinementLayoutDimension);
90
91 RefinedFragmentSkeleton() = delete;
92
93 RefinedFragmentSkeleton(const RefPtr<Grid>&theGrid, const SkeletonID&ParentSid, const SkeletonID&ChildSid,
94 int FragmentRefinementLayoutDimension)
95 {
96 assign(theGrid, ParentSid, ChildSid, FragmentRefinementLayoutDimension);
97 }
98
99 RefinedFragmentSkeleton(const Grid&theGrid, const SkeletonID&ParentSid, const SkeletonID&ChildSid,
100 int FragmentRefinementLayoutDimension)
101 : RefinedFragmentSkeleton(theGrid.self(), ParentSid, ChildSid, FragmentRefinementLayoutDimension)
102 {}
103
104static RefinedFragmentSkeleton create(Grid&theGrid, const SkeletonID&ParentSid, const SkeletonID&ChildSid,
105 const DynamicSize&theFragmentRefinementLayout);
106
107static RefinedFragmentSkeleton createRefinement(Grid&theGrid, const SkeletonID&S,
108 const DynamicSize&theFragmentRefinementLayout,
109 int refinement_increment = 1)
110 {
111 return create( theGrid, S, SkeletonID::nextRefinement(S, refinement_increment), theFragmentRefinementLayout);
112 }
113
114 size_t getNumberOfChildren(const RefPtr<FragmentID>&ParentFragmentID) const;
115
116 int iterateChildren(const RefPtr<FragmentID>&ParentFragmentID,
117 const std::function<bool(const RefPtr<FragmentID>&KidID)>&F) const;
118
119 int iterateChildren(const RefPtr<FragmentID>&ParentFragmentID,
120 const std::function<bool(const RefPtr<FragmentID>&KidID,
121 const RefPtr<Skeleton>&Parent,
122 const RefPtr<Skeleton>&Child)>&F) const;
123
124 using SkeletonFragment = std::tuple< const RefPtr<Skeleton>&, const RefPtr<FragmentID>&>;
125
126 using KidIterator = std::function<bool(const SkeletonFragment&Parent, const SkeletonFragment&Kid)>;
127
128 int iterateChildren(const RefPtr<FragmentID>&ParentFragmentID, const KidIterator&F) const;
129
130};
131
132
133} // namespace Fiber
134
135
136#endif // __FIBER_GRID_TYPES_REFINEDFRAGMENTSKELETON_HPP
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
A class describing an n-dimensional space at runtime.
Definition field/DynamicSize.hpp:29
A relative representation from the fragments of one one Skeleton to the fragments of another Skeleton...
Definition RefinedFragmentSkeleton.hpp:19
static SkeletonID nextRefinement(const SkeletonID &Sid, int refinement_increment)
Create a SkeletonID that is refined by a certain increment.
Definition SkeletonID.hpp:71
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
A relative representation from one Skeleton to another Skeleton where elements of one Skeleton are re...
Definition RelativeRepresentation.hpp:19