Factorize draw functions in Basic_viewer_qt.h, when CGAL_USE_BASIC_VIEWER is not defined.

This commit is contained in:
Guillaume Damiand 2018-06-11 13:06:20 +02:00
parent fdeb5621ca
commit c08546276b
1 changed files with 43 additions and 3 deletions

View File

@ -23,6 +23,9 @@
#define CGAL_BASIC_VIEWER_QT_H #define CGAL_BASIC_VIEWER_QT_H
#include <CGAL/license/GraphicsView.h> #include <CGAL/license/GraphicsView.h>
#include <iostream>
#ifdef CGAL_USE_BASIC_VIEWER
#include <QApplication> #include <QApplication>
#include <QKeyEvent> #include <QKeyEvent>
@ -610,7 +613,7 @@ protected:
{ {
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
if(!m_are_buffers_initialized) if(!m_are_buffers_initialized)
initialize_buffers(); { initialize_buffers(); }
QColor color; QColor color;
attrib_buffers(this); attrib_buffers(this);
@ -1038,4 +1041,41 @@ private:
} // End namespace CGAL } // End namespace CGAL
#else // CGAL_USE_BASIC_VIEWER
namespace CGAL
{
template<class T, class ColorFunctor>
void draw(const T&, const char*, bool, const ColorFunctor&)
{
std::cerr<<"Impossible to draw because CGAL_USE_BASIC_VIEWER is not defined."
<<std::endl;
}
template<class T>
void draw(const T&, const char*, bool)
{
std::cerr<<"Impossible to draw because CGAL_USE_BASIC_VIEWER is not defined."
<<std::endl;
}
template<class T>
void draw(const T&, const char*)
{
std::cerr<<"Impossible to draw because CGAL_USE_BASIC_VIEWER is not defined."
<<std::endl;
}
template<class T>
void draw(const T&)
{
std::cerr<<"Impossible to draw because CGAL_USE_BASIC_VIEWER is not defined."
<<std::endl;
}
} // End namespace CGAL
#endif // CGAL_USE_BASIC_VIEWER
#endif // CGAL_BASIC_VIEWER_QT_H #endif // CGAL_BASIC_VIEWER_QT_H