FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
TreeCellMapper.hpp
1#ifndef __TREECELLMAPPER_HPP
2#define __TREECELLMAPPER_HPP
3
4#include <aerie/BoundingBox.hpp>
5#include <aerie/KDTree.hpp>
6#include <eagle/PhysicalSpace.hpp>
7#include <eagle/QuadraticMatrix.hpp>
8
9#include <field/UniformCartesianArray.hpp>
10
11#include <fish/fiber/vector/Interpolate.hpp>
12#include <fish/fiber/vector/LinearIpol.hpp>
13
14#include <memcore/RefPtr.hpp>
15
16using namespace Fiber;
17using namespace Eagle;
18using namespace std;
19
20using namespace Eagle::PhysicalSpace;
21
29class TreeCellMapper : public ReferenceBase<TreeCellMapper>
30{
31RefPtr<MemArray<3, point> > m_crds_arr;
33
35
36double m_eps;
37unsigned m_spread;
38double m_max_len;
39tvector m_range_scale;
40MultiIndex<3> m_ix, m_iy, m_iz, m_max;
41tvector m_max_vec;
42
43
44public:
45
50 TreeCellMapper( RefPtr<MemArray<3, point> > crds, tvector range_scale = tvector(1.,1.,1.), double epsilon = 1./50, unsigned spread = 13 );
51
52
53static inline double maxi(const double a, const double b)
54{
55 return ( a < b ) ? b:a;
56}
57
58static inline void maxVec( double& max_len, tvector& max_vec, const tvector& v )
59{
60tvector tmp(0,0,0);
61double len = norm(v);
62
63 for(unsigned i = 0; i < tvector::Dims; i++)
64 {
65 tmp[i] = abs( v[i] );
66 max_vec[i] = tmp[i] > max_vec[i] ? tmp[i] : max_vec[i];
67 }
68
69 if( len > max_len )
70 max_len = len;
71}
72
81 unsigned localCoordinates( point&uvw, tvector& cell_size, const point&p );
82
83 void setQueryScale( tvector& scale )
84 {
85 m_range_scale = scale;
86 }
87
88};
89
90
91
92#endif // __UNIGRIDMAPPER_HPP
93
_Tp abs(const complex< _Tp > &)
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Helper class for computing local coordinates of a curvilinear block.
Definition TreeCellMapper.hpp:30
unsigned localCoordinates(point &uvw, tvector &cell_size, const point &p)
Function to compute local coordaintes based on the projective method ( planar faces only!...
Definition TreeCellMapper.cpp:152
double norm(const PhysicalSpace::bivector &v)
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
STL namespace.