From 3b152298ccba0bb4a7befd5326727af7e0582703 Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 11 Feb 2010 00:14:35 +0000 Subject: [PATCH] added runtime assert to prevent dangerous simplex to simplex assignment in the case of OCF optional attributes. --- vcg/simplex/face/component_ocf.h | 7 +++++++ vcg/simplex/vertex/component_ocf.h | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/vcg/simplex/face/component_ocf.h b/vcg/simplex/face/component_ocf.h index dcd4ed4d..6a421a03 100644 --- a/vcg/simplex/face/component_ocf.h +++ b/vcg/simplex/face/component_ocf.h @@ -731,6 +731,13 @@ template class WedgeNormal3dOcf: public WedgeNormalOcf 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 &Base() const { return *_ovp;} template diff --git a/vcg/simplex/vertex/component_ocf.h b/vcg/simplex/vertex/component_ocf.h index 8364a552..62f78e6e 100644 --- a/vcg/simplex/vertex/component_ocf.h +++ b/vcg/simplex/vertex/component_ocf.h @@ -638,7 +638,13 @@ template class RadiusdOcf: public RadiusOcf {}; template < class T> class InfoOcf: public T { public: - vector_ocf &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 &Base() const { return *_ovp;} inline int Index() const { typename T::VertType const *tp=static_cast(this);