19 #ifndef GFX_GRAPHICS_INCLUDED
20 #define GFX_GRAPHICS_INCLUDED
29 using vec4 = NEVec<4,int>;
38 ALLSIDES = LEFT | RIGHT | BOTTOM | TOP | FRONT | BACK
45 Patch(
int _a,
int _b,
int _c,
int _d,
double _rw,
double _rh)
46 : a(_a), b(_b), c(_c), d(_d), rw(_rw), rh(_rh)
55 VPatch(
int _a,
int _b,
int _c,
int _d,
int _e,
int _f,
int _g,
int _h,
double _rw,
double _rh,
double _rd)
56 : a(_a), b(_b), c(_c), d(_d), e(_e), f(_f), g(_g), h(_h), rw(_rw), rh(_rh), rd(_rd)
58 int a, b, c, d, e, f, g, h;
68 Nbr(
int _idx,
int _xl,
int _xr,
int _yb,
int _yt,
int _zf,
int _zb) :
69 idx(_idx), xl(_xl), xr(_xr), yb(_yb), yt(_yt), zf(_zf), zb(_zb), type(0) {
71 if (xl == -1 ) type |= LEFT;
72 if (xr == -1 ) type |= RIGHT;
73 if (yb == -1 ) type |= BOTTOM;
74 if (yt == -1 ) type |= TOP;
75 if (zf == -1 ) type |= FRONT;
76 if (zb == -1 ) type |= BACK;
80 Nbr(
int _idx,
int w,
int h,
int d,
int type)
82 xl( (type & LEFT) ? -1 : _idx - ( h ) * ( d ) ),
83 xr( (type & RIGHT) ? -1 : _idx + ( h ) * ( d ) ),
84 yb( (type & BOTTOM) ? - 1 : _idx - d ),
85 yt( (type & TOP) ? - 1 : _idx + d ),
86 zf( (type & FRONT) ? - 1 : _idx - 1 ),
87 zb( (type & BACK) ? - 1 : _idx + 1 ),
92 int idx, xl, xr, yb, yt, zf, zb, type;
93 int& operator[] (
int i) {
return (&idx)[i]; }
94 int operator[] (
int i)
const {
return (&idx)[i]; }
96 friend ostream& operator << (ostream&,
const Nbr&);
100 inline ostream& operator << (ostream& os,
const Nbr& m){
101 os <<
"NBR: \n" << m[0] <<
" " << m[1] <<
" " << m[2] <<
" " << m[3] <<
" " << m[4] <<
" " << m[5] <<
" " << m[6] <<
"\n";
111 Vxl(
int _a,
int _b,
int _c,
int _d,
int _e,
int _f,
int _g,
int _h,
int _typ = 0) :
112 a(_a), b(_b), c(_c), d(_d), e(_e), f(_f), g(_g), h(_h), type(_typ) {}
113 int a, b, c, d, e, f, g, h, type;
114 int& operator[] (
int i) {
return (&a)[i]; }
115 int operator[] (
int i)
const {
return (&a)[i]; }
123 Vxl& limit() {
for (
int i = 0; i < 8; ++i) {
if ( (*
this)[i] == -1 ) (*this)[i] = 0; }
return *
this; }
125 friend ostream& operator << (ostream&,
const Vxl&);
129 inline ostream& operator << (ostream& os,
const Vxl& m){
130 os <<
"VXL: \n" << m[0] <<
" " << m[1] <<
" " << m[2] <<
" " << m[3] <<
" " << m[4] <<
" " << m[5] <<
" " << m[6] <<
" " << m[7] <<
"\n";
Data Structure of Neighbors in a cartesian volume (left, right, bottom, top, front, back)
Definition: vsr_patch.h:65
Generic Geometric Number Types (templated on an algebra and a basis )
Definition: vsr_algebra.h:69
Volume Patch Info Container for Euler integration of a 3d Field.
Definition: vsr_patch.h:54
Info Container for Euler integration of a 2d Field.
Definition: vsr_patch.h:44
the versor library namespace
Definition: vsr_algebra.h:29
Definition: vsr_patch.h:107