From b1a1b36260ecb139d233918c8c008af5781db2d1 Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 19 Oct 2012 11:45:51 +0000 Subject: [PATCH] Re added the empty component. It can be useful sometimes... --- vcg/simplex/face/component_ep.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/vcg/simplex/face/component_ep.h b/vcg/simplex/face/component_ep.h index 39f68788..02e2cf40 100644 --- a/vcg/simplex/face/component_ep.h +++ b/vcg/simplex/face/component_ep.h @@ -74,6 +74,25 @@ private: EdgePlaneType _ep; }; + +// This empty class is rarely useful but you need it if you have code +// where you eventually decide (not at compile time) what closest algorithm you need. +// (for example in unit testing...) + +template class EmptyEdgePlane: public T { +public: +typedef EdgePlaneInfo EdgePlaneType; + +typename T::VertexType::CoordType &Edge(const int ) { assert(0); static typename T::VertexType::CoordType dum; return dum;} +typename T::VertexType::CoordType &cEdge(const int ) const { assert(0); static typename T::VertexType::CoordType dum; return dum;} + +typename vcg::Plane3 &Plane() {assert(0); static typename vcg::Plane3 dum; return dum;} +typename vcg::Plane3 &cPlane() const {assert(0); static typename vcg::Plane3 dum; return dum;} +static bool HasEdgePlane() { return false; } + +static void Name(std::vector & name){name.push_back(std::string(""));T::Name(name);} +}; + } // end namespace face }// end namespace vcg #endif