cleaned up

now usable with various kernels via precompiler
macros
This commit is contained in:
Peter Hachenberger 2006-02-17 16:39:32 +00:00
parent 701b2ea7ee
commit b952566aaf
1 changed files with 55 additions and 43 deletions

View File

@ -22,10 +22,56 @@
// a manipulation language for stack ops, file loading and saving, etc. // a manipulation language for stack ops, file loading and saving, etc.
// ============================================================================ // ============================================================================
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Cartesian.h>
#include <CGAL/Simple_homogeneous.h> #ifdef CGAL_USE_LEDA
#include <CGAL/Extended_homogeneous.h> #ifdef CGAL_NEF3_CARTESIAN
#include <CGAL/Extended_cartesian.h> #include <CGAL/leda_rational.h>
typedef leda_rational LNT;
#else
#include <CGAL/leda_integer.h>
typedef leda_integer LNT;
#endif
#else
#ifdef CGAL_NEF3_CARTESIAN
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpq LNT;
#else
#include <CGAL/Gmpz.h>
typedef CGAL::Gmpz LNT;
#endif
#endif
#ifdef CGAL_USE_LAZY_EXACT_NT
#include <CGAL/Filtered_exact.h>
#include <CGAL/Nef_3/Filtered_gcd.h>
#include <CGAL/Lazy_exact_nt.h>
typedef CGAL::Lazy_exact_nt<LNT> NT;
#else
typedef LNT NT;
#endif
#ifdef CGAL_USE_EXTENDED_KERNEL
#ifdef CGAL_NEF3_CARTESIAN
#include <CGAL/Extended_cartesian.h>
typedef CGAL::Extended_cartesian<LNT> Kernel;
const char *kernelversion = "Extended cartesian kernel.";
#else
#include <CGAL/Extended_homogeneous.h>
typedef CGAL::Extended_homogeneous<LNT> Kernel;
const char *kernelversion = "Extended homogeneous kernel.";
#endif
#else
#ifdef CGAL_NEF3_CARTESIAN
#include <CGAL/Cartesian.h>
typedef CGAL::Cartesian<NT> Kernel;
const char *kernelversion = "Cartesian kernel.";
#else
#include <CGAL/Homogeneous.h>
typedef CGAL::Homogeneous<NT> Kernel;
const char *kernelversion = "Homogeneous kernel.";
#endif
#endif
#include <CGAL/rational_rotation.h> #include <CGAL/rational_rotation.h>
#include <CGAL/Polyhedron_3.h> #include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h> #include <CGAL/IO/Polyhedron_iostream.h>
@ -46,50 +92,17 @@
#include <cmath> #include <cmath>
#include <cstddef> #include <cstddef>
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron;
typedef std::vector< Nef_polyhedron> Nef_vector;
typedef Nef_vector::iterator Iterator;
using std::cout; using std::cout;
using std::cerr; using std::cerr;
using std::endl; using std::endl;
using std::strcmp; using std::strcmp;
using std::exit; using std::exit;
#define CGAL_USE_EXTENDED_KERNEL
//#ifdef CGAL_USE_LEDA
//#include <CGAL/leda_integer.h>
//typedef leda_integer LNT;
//#else
//#include <CGAL/Gmpz.h>
//typedef CGAL::Gmpz LNT;
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpq LNT;
//#endif
#ifdef CGAL_USE_LAZY_EXACT_NT
#include <CGAL/Filtered_exact.h>
#include <CGAL/Nef_3/Filtered_gcd.h>
#include <CGAL/Lazy_exact_nt.h>
#include <CGAL/Gmpz.h>
typedef CGAL::Lazy_exact_nt<CGAL::Gmpz> NT;
#else
typedef LNT NT;
#endif
#ifdef CGAL_USE_EXTENDED_KERNEL
//typedef CGAL::Extended_homogeneous<LNT> Kernel;
typedef CGAL::Extended_cartesian<LNT> Kernel;
const char *kernelversion = "Extended homogeneous 3d kernel.";
#else // #elif CGAL_USE_SIMPLE_KERNEL
typedef CGAL::Homogeneous<NT> Kernel;
const char *kernelversion = "Simple homogeneous kernel.";
#endif
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron;
//typedef CGAL::Nef_polyhedron_3<Kernel,CGAL::SNC_items,CGAL::Decomposition_mark> Nef_polyhedron;
// typedef Nef_polyhedron::Explorer Explorer;
typedef std::vector< Nef_polyhedron> Nef_vector;
typedef Nef_vector::iterator Iterator;
// Global data // Global data
Nef_vector nef; // contains stack of Nef_polyhedron Nef_vector nef; // contains stack of Nef_polyhedron
@ -634,7 +647,6 @@ int main( int argc, char* argv[]) {
exit(1); exit(1);
} }
CGAL::set_pretty_mode(std::cerr); CGAL::set_pretty_mode(std::cerr);
//std::cin>>debugthread;
// std::cout<<kernelversion<<std::endl; // std::cout<<kernelversion<<std::endl;
return eval( argc-1, argv+1); return eval( argc-1, argv+1);
} }