Navigation: Up, Table of Contents, Bibliography, Index, Title Page

Traits Class for 3D chull (CGAL_chull_traits_3)

#include <CGAL/dd_geo/chull_traits_3.h>

Definition

This traits class provides a default adaptation of the convex hull class of LEP dd_geokernel to the three-dimensional kernel of CGAL. It is parameterized with a representation class, see Reference Manual for the CGAL kernel. It defines models for the subconcepts of the chull-traits class concept as required in LEP dd_geokernel , including the requirements for the d3_surface_map() output routine.

Types

CGAL_chull_traits_3<R>::RT
== R::RT, coordinate ring type used for calculations.

CGAL_chull_traits_3<R>::POINT
== CGAL_Point_3<R>, point type.

CGAL_chull_traits_3<R>::IPOINT
== CGAL_Point_3<R>, internal point type.

CGAL_chull_traits_3<R>::PLANE
== CGAL_Plane_3<R>, hyperplane type.

CGAL_chull_traits_3<R>::VECTOR
== CGAL_Vector_3<R>, internal vector type.

CGAL_chull_traits_3<R>::IRAY
== CGAL_Ray_3<R>, internal ray type.

Example

The following example uses CGAL's 3D random point generator CGAL_Random_points_in_sphere_3<>, which generates random points on a sphere, and CGAL's STL extension function CGAL_copy_n, which copies n elements.

#include <CGAL/Homogeneous.h>
#include <CGAL/chull_traits_3.h>
#include <LEP/dd_geo/chull.h>
#include <CGAL/point_generators_3.h>
#include <CGAL/copy_n.h>
#include <vector.h>

typedef CGAL_Homogeneous< double >           RepCls;
typedef CGAL_chull_traits_3< RepCls >        ChullTraits;
typedef chull< ChullTraits >                 ChullType;
typedef ChullTraits::POINT                   Point;
typedef CGAL_Creator_uniform_3<double,Point> PointCreator;

int
main()
{
  /* generate 250 points randomly on a sphere of radius 100.0 */
  CGAL_Random_points_in_sphere_3< Point, PointCreator> gen(100.0);
  vector<Point> V;
  /* and copy them to a vector */
  CGAL_copy_n( gen, 250, back_inserter(V) );
  
  /* compute their convex hull */
  ChullType CH(3); 
  vector<Point>::iterator  it;
  for (it = V.begin(); it != V.end(); ++it)  CH.insert(*it);
 
  return 0;
}


Next: Class declaration of CGAL_Build_polyhedron_from_GRAPH<HDS>
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. 22 January, 1999.