The class Polyhedron_traits_3<Kernel> is a model of the PolyhedronTraits_3 concept. It defines the geometric types and primitive operations used in the polyhedral surface data structure CGAL::Polyhedron_3<PolyhedronTraits_3> in terms of the CGAL Kernel. It keeps a local copy of the kernel which makes it suitable for kernels with local state.
#include <CGAL/Polyhedron_traits_3.h>
| |
the Kernel model.
|
|
|
|
|
|
|
| ||
|
| |
default constructor, uses
Kernel() as local reference to the kernel.
| |
| |
stores kernel
as local reference.
|
|
| |
forwarded to kernel. |
CGAL::Polyhedron_traits_with_normals_3<Kernel>
Since the PolyhedronTraits_3 concept is a subset of the 3D kernel concept, this class just forwards the relevant types and access member functions from its template argument. However, it is useful for testing sufficiency of requirements.
Instantiation of a polyhedral surface with the Cartesian kernel based on double coordinates.
File: examples/Polyhedron/polyhedron_prog_simple.cpp
#include <CGAL/Simple_cartesian.h> #include <CGAL/Polyhedron_3.h> typedef CGAL::Simple_cartesian<double> Kernel; typedef CGAL::Polyhedron_3<Kernel> Polyhedron; typedef Polyhedron::Halfedge_handle Halfedge_handle; int main() { Polyhedron P; Halfedge_handle h = P.make_tetrahedron(); if ( P.is_tetrahedron(h)) return 0; return 1; }