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

Traits Class for 3D chull (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

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

chull_traits_3<R>::POINT
== Point_3<R>, point type.

chull_traits_3<R>::IPOINT
== Point_3<R>, internal point type.

chull_traits_3<R>::PLANE
== Plane_3<R>, hyperplane type.

chull_traits_3<R>::VECTOR
== Vector_3<R>, internal vector type.

chull_traits_3<R>::IRAY
== Ray_3<R>, internal ray type.

Example

The following example uses CGAL's 3D random point generator Random_points_in_sphere_3<>, which generates random points on a sphere, and CGAL's STL extension function 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>

using namespace std;
using namespace CGAL;

typedef Homogeneous< double >           RepCls;
typedef chull_traits_3< RepCls >        ChullTraits;
typedef chull< ChullTraits >            ChullType;
typedef ChullTraits::POINT              Point;
typedef Creator_uniform_3<double,Point> PointCreator;

int
main()
{
  /* generate 250 points randomly on a sphere of radius 100.0 */
  Random_points_in_sphere_3< Point, PointCreator> gen(100.0);
  vector<Point> V;
  /* and copy them to a vector */
  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 Build_polyhedron_from_GRAPH<HDS>
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The GALIA project. Jan 18, 2000.