added runtime assert to prevent dangerous simplex to simplex assignment in the case of OCF optional attributes.

This commit is contained in:
Paolo Cignoni 2010-02-11 00:14:35 +00:00
parent 8465fa432c
commit 3b152298cc
2 changed files with 14 additions and 1 deletions

View File

@ -731,6 +731,13 @@ template <class T> class WedgeNormal3dOcf: public WedgeNormalOcf<vcg::Point3d, T
template < class T> class InfoOcf: public T {
public:
// You should never ever try to copy a vertex that has OCF stuff.
// use ImportLocal function.
inline InfoOcf &operator=(const InfoOcf &other) {
assert(0); return *this;
}
vector_ocf<typename T::FaceType> &Base() const { return *_ovp;}
template <class LeftF>

View File

@ -638,7 +638,13 @@ template <class T> class RadiusdOcf: public RadiusOcf<double, T> {};
template < class T> class InfoOcf: public T {
public:
vector_ocf<typename T::VertType> &Base() const { return *_ovp;}
// You should never ever try to copy a vertex that has OCF stuff.
// use ImportLocal function.
inline InfoOcf &operator=(const InfoOcf &other) {
assert(0); return *this;
}
vector_ocf<typename T::VertType> &Base() const { return *_ovp;}
inline int Index() const {
typename T::VertType const *tp=static_cast<typename T::VertType const*>(this);