added cN() and fixed assert in color.

This commit is contained in:
Marco Di Benedetto 2009-06-28 03:18:49 +00:00
parent 35189992a9
commit 4dae9d3d97
1 changed files with 6 additions and 1 deletions

View File

@ -416,6 +416,11 @@ public:
assert((*this).Base().NormalEnabled);
return (*this).Base().NV[(*this).Index()]; }
const NormalType &cN() const {
// you cannot use Normals before enabling them with: yourmesh.vert.EnableNormal()
assert((*this).Base().NormalEnabled);
return (*this).Base().NV[(*this).Index()]; }
template <class LeftV>
void ImportLocal(const LeftV & leftV){
if((*this).Base().NormalEnabled && leftV.Base().NormalEnabled ) // copy the data only if they are enabled in both vertices
@ -432,7 +437,7 @@ template <class T> class Normal3dOcf: public NormalOcf<vcg::Point3d, T> {};
template <class A, class T> class ColorOcf: public T {
public:
typedef A ColorType;
ColorType &C() { assert((*this).Base().NormalEnabled); return (*this).Base().CV[(*this).Index()]; }
ColorType &C() { assert((*this).Base().ColorEnabled); return (*this).Base().CV[(*this).Index()]; }
const ColorType &cC() const { assert((*this).Base().ColorEnabled); return (*this).Base().CV[(*this).Index()]; }
template <class LeftV>
void ImportLocal(const LeftV & leftV)