1 #ifndef ISOEX_EDGEKEY_HH
2 #define ISOEX_EDGEKEY_HH
13 template <
class Po
intIdx>
20 EdgeKey(PointIdx _p0, PointIdx _p1)
22 if (_p0 < _p1) { p0_ = _p0; p1_ = _p1; }
23 else { p0_ = _p1; p1_ = _p0; }
40 const PointIdx &p0()
const {
return p0_;}
41 const PointIdx &p1()
const {
return p1_;}
43 bool is_on_z_layer (
unsigned int &_x_res,
51 unsigned int z0 = idx;
56 unsigned int z1 = idx;
69 if ((p1_ - p0_) == 1)
return true;
172 void x_neighbor(
const EdgeKey & _ne,
173 const unsigned int &_x_res,
174 const unsigned int &_y_res,
175 const unsigned int &_z_res,
191 p0[0] = idx % _x_res; idx /= _x_res;
192 p0[1] = idx % _y_res; idx /= _y_res;
195 p1[0] = idx % _x_res; idx /= _x_res;
196 p1[1] = idx % _y_res; idx /= _y_res;
199 np0[0] = idx % _x_res; idx /= _x_res;
200 np0[1] = idx % _y_res; idx /= _y_res;
203 np1[0] = idx % _x_res; idx /= _x_res;
204 np1[1] = idx % _y_res; idx /= _y_res;
211 if (de == OpenMesh::Vec2i(1,0) )
213 if (dne == OpenMesh::Vec2i(1,0))
215 if ((
int)p0_ - (
int)_ne.p0() == 1 ) _location = LEFT;
216 else if ((
int)p0_ - (int)_ne.p0() == -1) _location = RIGHT;
217 else if ((
int)p0_ - (int)_ne.p0() == 0) _location = SAME;
220 if (p0[1] - np0[1] == -1)
224 else if (p0[1] - np0[1] == 1)
230 else if (dne == OpenMesh::Vec2i(0,1))
238 _location = TOPRIGHT;
242 _location = BOTTOMLEFT;
246 _location = BOTTOMRIGHT;
253 bool operator<(
const EdgeKey& _rhs)
const
255 if (p0_ != _rhs.p0())
256 return (p0_ < _rhs.p0());
258 return (p1_ < _rhs.p1());
271 #endif // ISOEX_EDGEKEY_HH defined
Definition: EdgeKey.hh:14
A type for volume images, or 3D textures.