updated polygon component to the cP/P behavior for access to elements

This commit is contained in:
Paolo Cignoni 2013-03-20 08:56:20 +00:00
parent 12543d68a2
commit f3337dcb7c
1 changed files with 58 additions and 62 deletions

View File

@ -106,19 +106,15 @@ public:
// Shortcut per accedere ai punti delle facce
inline CoordType &P( const int j ) { assert(j>=0 && j<this->VN()); return _vpoly[j]->P(); }
inline const CoordType & P( const int j ) const { assert(j>=0 && j<this->VN()); return _vpoly[j]->cP(); }
inline const CoordType &cP( const int j ) const { assert(j>=0 && j<this->VN()); return _vpoly[j]->cP(); }
inline const CoordType cP( const int j ) const { assert(j>=0 && j<this->VN()); return _vpoly[j]->cP(); }
/// Shortcut per accedere ai punti delle facce
inline CoordType & P0( const int j ) { return V(j)->P();}
inline CoordType & P1( const int j ) { return V((j+1)%this->VN())->P();}
inline CoordType & P2( const int j ) { return V((j+2)%this->VN())->P();}
inline const CoordType & P0( const int j ) const { return V(j)->P();}
inline const CoordType & P1( const int j ) const { return V((j+1)%this->VN())->P();}
inline const CoordType & P2( const int j ) const { return V((j+2)%this->VN())->P();}
inline const CoordType & cP0( const int j ) const { return cV(j)->P();}
inline const CoordType & cP1( const int j ) const { return cV((j+1)%this->VN())->P();}
inline const CoordType & cP2( const int j ) const { return cV((j+2)%this->VN())->P();}
inline const CoordType cP0( const int j ) const { return cV(j)->P();}
inline const CoordType cP1( const int j ) const { return cV((j+1)%this->VN())->P();}
inline const CoordType cP2( const int j ) const { return cV((j+2)%this->VN())->P();}
template <class LeftF>
void ImportData(const LeftF & leftF){ for(int i =0; i < this->VN(); ++i) V(i) = NULL; T::ImportData(leftF);}