Added constant access function FFp and renamed F1 F2 to FFp1 FFp2

This commit is contained in:
Paolo Cignoni 2004-10-20 08:28:31 +00:00
parent f456dc361c
commit c8b9c96f29
1 changed files with 31 additions and 10 deletions

View File

@ -24,6 +24,9 @@
History
$Log: not supported by cvs2svn $
Revision 1.21 2004/10/18 17:13:50 ganovelli
added ::IsBorder
Revision 1.20 2004/09/15 11:20:15 ganovelli
changed P() to cP()
@ -537,27 +540,45 @@ public:
#endif
}
inline const FFTYPE * FFp( const int j ) const
{
assert( (_flags & DELETED) == 0 );
assert( (_flags & NOTREAD) == 0 );
assert(j>=0 && j<3);
#if defined(__VCGLIB_FACE_AF)
return _ffp[j];
#elif defined(__VCGLIB_FACE_AS)
return fs[j];
#else
assert(0);
static FFTYPE *dum=0; dum+=j;
return dum;
#endif
}
inline FFTYPE * & FFp1( const int j ) { return FFp((j+1)%3);}
inline FFTYPE * & FFp2( const int j ) { return FFp((j+2)%3);}
inline const FFTYPE * const& FFp1( const int j ) const { return FFp((j+1)%3);}
inline const FFTYPE * const& FFp2( const int j ) const { return FFp((j+2)%3);}
inline bool const IsBorder( const int & j ) const
{
assert( (_flags & DELETED) == 0 );
assert( (_flags & NOTREAD) == 0 );
assert(j>=0);
assert(j<3);
assert(j<3);
#if defined(__VCGLIB_FACE_AF)
return (_ffp[j]==this);
return (_ffp[j]==this);
#elif defined(__VCGLIB_FACE_AS)
return (fs[j]==this);
return (fs[j]==this);
#else
assert(0);
return (FFTYPE *)this;
assert(0);
return (FFTYPE *)this;
#endif
}
inline FFTYPE * & F1( const int j ) { return F((j+1)%3);}
inline FFTYPE * & F2( const int j ) { return F((j+2)%3);}
inline const FFTYPE * const& F1( const int j ) const { return F((j+1)%3);}
inline const FFTYPE * const& F2( const int j ) const { return F((j+2)%3);}
/** Return the pointer to the j-th adjacent face.
@param j Index of the edge.