From a9f4169bb7f612e3fa065476516ce258dd18b379 Mon Sep 17 00:00:00 2001 From: Mike Kremer Date: Fri, 10 Sep 2010 12:13:59 +0000 Subject: [PATCH] Added preprocessor directives such that doxygen correctly parses the vector template class. git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@336 fdac6126-5c0c-442c-9429-916003d36597 --- src/OpenMesh/Core/Geometry/VectorT.hh | 11 +++++++---- src/OpenMesh/Core/Geometry/VectorT_inc.hh | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/OpenMesh/Core/Geometry/VectorT.hh b/src/OpenMesh/Core/Geometry/VectorT.hh index b3795fdb..dd42eeaf 100644 --- a/src/OpenMesh/Core/Geometry/VectorT.hh +++ b/src/OpenMesh/Core/Geometry/VectorT.hh @@ -46,6 +46,12 @@ // //============================================================================= +// Don't parse this header file with doxygen since +// for some reason (obviously due to a bug in doxygen, +// bugreport: https://bugzilla.gnome.org/show_bug.cgi?id=629182) +// macro expansion and preprocessor defines +// don't work properly. +#ifndef DOXYGEN #ifndef OPENMESH_VECTOR_HH #define OPENMESH_VECTOR_HH @@ -184,8 +190,6 @@ template <> struct VectorDataT //== FULL TEMPLATE SPECIALIZATIONS ============================================ #else -# ifndef DOXY_IGNORE_THIS - /// cross product for Vec3f template<> inline VectorT @@ -209,8 +213,6 @@ VectorT::operator%(const VectorT& _rhs) const values_[0]*_rhs.values_[1]-values_[1]*_rhs.values_[0]); } -# endif // DOXY_IGNORE_THIS - #endif @@ -339,3 +341,4 @@ typedef VectorT Vec6d; //============================================================================= #endif // OPENMESH_VECTOR_HH defined //============================================================================= +#endif DOXYGEN diff --git a/src/OpenMesh/Core/Geometry/VectorT_inc.hh b/src/OpenMesh/Core/Geometry/VectorT_inc.hh index eb96ed4e..ba6c4e69 100644 --- a/src/OpenMesh/Core/Geometry/VectorT_inc.hh +++ b/src/OpenMesh/Core/Geometry/VectorT_inc.hh @@ -39,6 +39,22 @@ * * \*===========================================================================*/ +// Set template keywords and class names properly when +// parsing with doxygen. This only seems to work this way since +// the scope of preprocessor defines is limited to one file in doxy. +#ifdef DOXYGEN + +// Only used for correct doxygen parsing +#define OPENMESH_VECTOR_HH + +#define DIM N +#define TEMPLATE_HEADER template +#define CLASSNAME VectorT +#define DERIVED VectorDataT +#define unroll(expr) for (int i=0; i