APSS_implicit_function uses now Point_with_normal_3<Gt, Vector_3> to save memory space (4 bytes per point).

This commit is contained in:
Laurent Saboret 2008-09-30 11:15:13 +00:00
parent 4abcbea669
commit f98b56c594
4 changed files with 14 additions and 13 deletions

View File

@ -46,7 +46,7 @@ typedef Poisson_dt3<Kernel> Dt3;
typedef CGAL::Poisson_implicit_function<Kernel, Dt3> Poisson_implicit_function;
// APSS implicit function
typedef CGAL::APSS_implicit_function<Kernel,Point_with_normal> APSS_implicit_function;
typedef CGAL::APSS_implicit_function<Kernel> APSS_implicit_function;
// Surface mesh generator
typedef CGAL::Surface_mesh_vertex_base_3<Kernel> SVb;

View File

@ -55,7 +55,7 @@ typedef Kernel::Sphere_3 Sphere;
typedef std::vector<Point_with_normal> PointList;
// APSS implicit function
typedef CGAL::APSS_implicit_function<Kernel,Point_with_normal> APSS_implicit_function;
typedef CGAL::APSS_implicit_function<Kernel> APSS_implicit_function;
// Surface mesher
typedef CGAL::Surface_mesh_default_triangulation_3 STr;

View File

@ -24,6 +24,7 @@
#include <vector>
#include <algorithm>
#include <CGAL/Point_with_normal_3.h>
#include <CGAL/make_surface_mesh.h>
#include <CGAL/Orthogonal_k_neighbor_search.h>
#include <CGAL/Search_traits_3.h>
@ -49,9 +50,8 @@ CGAL_BEGIN_NAMESPACE
///
/// @heading Parameters:
/// @param Gt Geometric traits class.
/// @param PointWithNormal_3 Model of PointWithNormal_3 concept.
template <class Gt, class PointWithNormal_3>
template <class Gt>
class APSS_implicit_function
{
// Public types
@ -64,27 +64,28 @@ public:
typedef typename Geom_traits::Iso_cuboid_3 Iso_cuboid;
typedef typename Geom_traits::Sphere_3 Sphere;
typedef PointWithNormal_3 Point_with_normal; ///< Model of PointWithNormal_3 concept.
typedef typename Point_with_normal::Normal Normal; ///< Model of Kernel::Vector_3 concept.
typedef Point_with_normal_3<Gt> Point_with_normal; // Point_with_normal_3<Gt> is the most compact representation
typedef typename Point_with_normal::Normal Normal; // == Vector_3
typedef typename Geom_traits::Vector_3 Vector;
// Private types
private:
// Item in the Kd-tree: position (Point_3) + normal + index
class KdTreeElement : public PointWithNormal_3
class KdTreeElement : public Point_with_normal
{
public:
unsigned int index;
KdTreeElement(const Origin& o = ORIGIN, unsigned int id=0)
: PointWithNormal_3(o), index(id)
: Point_with_normal(o), index(id)
{}
KdTreeElement(const PointWithNormal_3& pwn, unsigned int id=0)
: PointWithNormal_3(pwn), index(id)
template <class K, class N>
KdTreeElement(const Point_with_normal_3<K,N>& pwn, unsigned int id=0)
: Point_with_normal(pwn), index(id)
{}
KdTreeElement(const Point& p, unsigned int id=0)
: PointWithNormal_3(p), index(id)
: Point_with_normal(p), index(id)
{}
};
@ -106,7 +107,7 @@ public:
/// Create an APSS implicit function from a point set.
///
/// Precondition: the value type of InputIterator must be convertible to Point_with_normal.
/// Precondition: the value type of InputIterator must be convertible to Point_with_normal_3.
///
/// @param first First point of point set.
/// @param beyond Past-the-end point of point set.

View File

@ -54,7 +54,7 @@ typedef Kernel::Sphere_3 Sphere;
typedef std::vector<Point_with_normal> PointList;
// APSS implicit function
typedef CGAL::APSS_implicit_function<Kernel,Point_with_normal> APSS_implicit_function;
typedef CGAL::APSS_implicit_function<Kernel> APSS_implicit_function;
// Surface mesher
typedef CGAL::Surface_mesh_default_triangulation_3 STr;