FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
LoadField.hpp
1#ifndef __FIBER_HDF5_LOADFIELD_HPP
2#define __FIBER_HDF5_LOADFIELD_HPP
3
4
5#include <bundle/Bundle.hpp>
6#include <F5/F5F.h>
7#include "H5Group.hpp"
8#include <cstring>
9#include <eagle/PhysicalSpace.hpp>
10#include <F5/F5private.h>
11#include <F5/F5iterate.h>
12
13#include <field/FragmentAttributeNames.hpp>
14#include "FileNameInterface.hpp"
15#include "PrecisionTransformation.hpp"
16
17namespace Fiber
18{
19
23
25//void readOriginalType( RefPtr< CreativeArrayBase >& cab, F5Path*f );
26
28
29#if 0
30template <class T>
32{
33T minmax[2];
34bool exist = false;
35
36 if (strlen(fragmentname) > 0)
37// exist = F5Fget_range( f, fragmentname, minmax );
38 else
39// exist = F5Fget_range( f, NULL, minmax );
40
41 if (exist)
42 {
44 RangeAttrib[0] = minmax[0];
45 RangeAttrib[1] = minmax[1];
46
48 }
49}
50
51template <class T>
53{
54T minmax[2];
55bool exist = false;
56
57 if (strlen(fragmentname) > 0)
58// exist = F5Fget_range( f, fragmentname, minmax );
59 else
60// exist = F5Fget_range( f, NULL, minmax );
61
62 if (exist)
63 {
64 F5printf(1,"Fragment Range: [%.8f,%.8f,%.8f]-[%.8f,%.8f,%.8f]",
65 minmax[0].x, minmax[0].y, minmax[0].z,
66 minmax[1].x, minmax[1].y, minmax[1].z);
67
69 RangeAttrib[0].x() = minmax[0].x;
70 RangeAttrib[0].y() = minmax[0].y;
71 RangeAttrib[0].z() = minmax[0].z;
72
73 RangeAttrib[1].x() = minmax[1].x;
74 RangeAttrib[1].y() = minmax[1].y;
75 RangeAttrib[1].z() = minmax[1].z;
76
78
79 /* Note: ideally want to do
80
81 FragmentedFieldCreator->addInterface( new BoundingBox() );
82
83 but can't do this because class bounding box is part
84 of another library family (ocean/) which is not available in fiber/ .
85 */
86 }
87
88T minmax_ghost[2];
89
91 {
92 F5printf(1,"Fragment Range Ghost: [%.8f,%.8f,%.8f]-[%.8f,%.8f,%.8f]",
93 minmax_ghost[0].x, minmax_ghost[0].y, minmax_ghost[0].z,
94 minmax_ghost[1].x, minmax_ghost[1].y, minmax_ghost[1].z);
95
97 RangeAttribGhost[0].x() = minmax_ghost[0].x;
98 RangeAttribGhost[0].y() = minmax_ghost[0].y;
99 RangeAttribGhost[0].z() = minmax_ghost[0].z;
100
101 RangeAttribGhost[1].x() = minmax_ghost[1].x;
102 RangeAttribGhost[1].y() = minmax_ghost[1].y;
103 RangeAttribGhost[1].z() = minmax_ghost[1].z;
104
105 cab->setAttribute( AttributeNames::Fragment::GhostRange, RangeAttribGhost );
106 }
107}
108#endif
109
110
111void readDictionary(const RefPtr< CreativeArrayBase >& cab, F5Path*f, const char*fragmentname = "" );
112
113
118template <int Dims>
119bool saveDimensions(MultiIndex<Dims>&dims, F5Path*field, const char*attribute_name, hid_t id)
120{
121hsize_t extension[FIBER_MAX_RANK];
122
123 for(int i=0;i<Dims;i++)
124 extension[i] = dims[i];
125
126 F5Tpermute_dimensions(field, Dims, extension, extension);
127
128 if (F5LAsave_dimensions(id, attribute_name, Dims, extension) != Dims)
129 return false;
130
131 return true;
132}
133
139
140
141RefPtr<Field> ContiguousField(F5Path*field,
143 const char*RepresentationName,
145 const string&fieldname,
146 Grid&theGrid,
150
154
155
156
157} // Fiber namespace
158
159
160#endif // __FIBER_HDF5_LOADFIELD_HPP
constexpr pair< const _Tp &, const _Tp & > minmax(const _Tp &__a, const _Tp &__b)
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
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
RefPtr< SizeInterface > loadFieldSize(F5Path *field)
Get a field's size without loading any data.
Definition LoadField.cpp:31
RefPtr< Field > UniformField(F5Path *field, const RefPtr< FragmentIDCollection > &theFragmentIDCollection, const RefPtr< LoaderProgress > &TheLoaderProgressor)
Definition LoadField.cpp:401
void readGhostSizes(RefPtr< CreativeArrayBase > &cab, F5Path *f, const char *fragmentname)
Experimental function to store original field type as an field attribute.
Definition LoadField.cpp:69
bool saveDimensions(MultiIndex< Dims > &dims, F5Path *field, const char *attribute_name, hid_t id)
Save an n-dimensional attribute to an HDF5 ID and apply dimensional permutation according to the give...
Definition LoadField.hpp:119
Helper class.
Definition PrecisionTransformation.hpp:25