Used new face graph APIs in polyhedron.

This commit is contained in:
Mostafa-ashraf19 2022-10-06 22:48:11 +02:00
parent 6469319870
commit f4b8db0837
1 changed files with 21 additions and 17 deletions

View File

@ -8,10 +8,13 @@
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr> // Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
// Mostafa Ashraf <mostaphaashraf1996@gmail.com>
#ifndef CGAL_DRAW_POLYHEDRON_H #ifndef CGAL_DRAW_POLYHEDRON_H
#define CGAL_DRAW_POLYHEDRON_H #define CGAL_DRAW_POLYHEDRON_H
#include <CGAL/Graphic_buffer.h>
#include <CGAL/Drawing_functor.h>
#include <CGAL/license/Polyhedron.h> #include <CGAL/license/Polyhedron.h>
#include <CGAL/Qt/Basic_viewer_qt.h> #include <CGAL/Qt/Basic_viewer_qt.h>
@ -32,28 +35,29 @@ template<class PolyhedronTraits_3,
class PolyhedronItems_3, class PolyhedronItems_3,
template < class T, class I, class A> template < class T, class I, class A>
class T_HDS, class T_HDS,
class Alloc> class Alloc, typename BufferType = float>
void draw(const CGAL_POLY_TYPE& apoly, void draw(const CGAL_POLY_TYPE& apoly,
const char* title="Polyhedron Basic Viewer", const char* title="Polyhedron Basic Viewer",
bool nofill=false) bool nofill=false)
{ {
#if defined(CGAL_TEST_SUITE) CGAL::Graphic_buffer<BufferType> buffer;
bool cgal_test_suite=true; add_in_graphic_buffer(apoly, buffer);
#else draw_buffer(buffer);
bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); }
#endif
if (!cgal_test_suite) template<class PolyhedronTraits_3,
{ class PolyhedronItems_3,
CGAL::Qt::init_ogl_context(4,3); template < class T, class I, class A>
int argc=1; class T_HDS,
const char* argv[2]={"polyhedron_viewer", nullptr}; class Alloc, typename BufferType = float, class DrawingFunctor>
QApplication app(argc,const_cast<char**>(argv)); void draw(const CGAL_POLY_TYPE& apoly,
SimpleFaceGraphViewerQt const DrawingFunctor &drawing_functor,
mainwindow(app.activeWindow(), apoly, title, nofill); const char* title="Polyhedron Basic Viewer",
mainwindow.show(); bool nofill=false)
app.exec(); {
} CGAL::Graphic_buffer<BufferType> buffer;
add_in_graphic_buffer(apoly, buffer, drawing_functor);
draw_buffer(buffer);
} }
#undef CGAL_POLY_TYPE #undef CGAL_POLY_TYPE