CGAL::Qt_widget_Nef_3<Nef_polyhedron_3

Definition

The class Qt_widget_Nef_3 uses the OpenGL interface of Qt to display a Nef_polyhedron_3. Its purpose is to provide an easy to use viewer for Nef_polyhedron_3. There are no means provided to enhance the functionality of the viewer.

In addition to the functions inherited from the Qt class OGLWidget via, Qt_widget_Nef_3 only has a single public constructor. For the usage of Qt_widget_Nef_3 see the example below.

#include <CGAL/IO/Qt_widget_Nef_3.h>

Parameters

The template parameter expects an instantiation of Nef_polyhedron_3<Traits>.

Creation

Qt_widget_Nef_3<Nef_polyhedron_3 W ( Nef_polyhedron_3 N);
Creates a widget W for displaying the 3D Nef polyhedron N.

See Also

CGAL::Nef_polyhedron_3<Traits>

Example

This example reads a 3D Nef polyhedron from standard input and displays it in a Qt widget.

// Copyright (c) 2002  Max-Planck-Institute Saarbruecken (Germany)
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.2-branch/Nef_3/demo/Nef_3/visualization_SNC.C $
// $Id: visualization_SNC.C 29577 2006-03-17 12:11:37Z hachenb $
// 
//
// Author(s)     : Peter Hachenberger

#include <CGAL/basic.h>
#ifndef CGAL_USE_QT
#include <iostream>
int main(int, char*){
  std::cout << "Sorry, this demo needs QT..." << std::endl; return 0;}
#else
#include <CGAL/Gmpz.h>
#include <CGAL/Homogeneous.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/IO/Nef_polyhedron_iostream_3.h>
#include <CGAL/IO/Qt_widget_Nef_3.h>
#include <qapplication.h>

typedef CGAL::Homogeneous<CGAL::Gmpz> Kernel;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron_3;

int main(int argc, char* argv[]) {
  Nef_polyhedron_3 N;
  std::cin >> N;

  QApplication a(argc, argv);
  CGAL::Qt_widget_Nef_3<Nef_polyhedron_3>* w = 
    new CGAL::Qt_widget_Nef_3<Nef_polyhedron_3>(N);
  a.setMainWidget(w);
  w->show();
  return a.exec();
}
#endif