1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
// Author: Laurent Saboret
#ifndef UI_POINT_3_H
#define UI_POINT_3_H
#include <CGAL/Point_with_normal_3.h>
#include <CGAL/Iterator_project.h>
#include <set>
#include <algorithm>
/// The UI_point_3 class represents a 3D point in Poisson_surface_reconstruction_3 demo.
/// It contains:
/// - a position,
/// - a normal,
/// - a radius,
///
/// @heading Parameters:
/// @param Gt Geometric traits class.
template<class Gt>
class UI_point_3
: public CGAL::Point_with_normal_3<Gt>
{
// Private types
private:
// Base class
typedef CGAL::Point_with_normal_3<Gt> Base;
// Public types
public:
/// Base class
typedef Base Point_with_normal;
// Repeat base class public types
typedef Gt Geom_traits; ///< Geometric traits class.
typedef typename Geom_traits::FT FT;
typedef typename Geom_traits::RT RT;
typedef typename Geom_traits::Point_2 Point_2; ///< typedef to Geom_traits::Point_2
typedef typename Geom_traits::Point_3 Point_3; ///< typedef to Geom_traits::Point_3
typedef typename Geom_traits::Vector_3 Vector_3; ///< typedef to Geom_traits::Vector_3
// Public methods
public:
/// Point is (0,0,0) by default.
/// Normal is (0,0,0) by default.
UI_point_3(const CGAL::Origin& o = CGAL::ORIGIN)
: Base(o)
{
m_radius = FT(0);
}
UI_point_3(FT x, FT y, FT z,
const Vector_3& normal = CGAL::NULL_VECTOR)
: Base(x,y,z,normal)
{
m_radius = FT(0);
}
UI_point_3(RT hx, RT hy, RT hz, RT hw,
const Vector_3& normal = CGAL::NULL_VECTOR)
: Base(hx,hy,hz,hw,normal)
{
m_radius = FT(0);
}
UI_point_3(const Point_3& point,
const Vector_3& normal = CGAL::NULL_VECTOR)
: Base(point, normal)
{
m_radius = FT(0);
}
template <class K>
UI_point_3(const CGAL::Point_with_normal_3<K>& pwn)
: Base(pwn)
{
m_radius = FT(0);
}
/// Copy constructor
UI_point_3(const UI_point_3& upt)
: Base(upt)
{
m_radius = upt.m_radius;
}
template<class K>
UI_point_3(const UI_point_3<K>& upt)
: Base(upt)
{
m_radius = upt.radius();
}
/// Operator =()
UI_point_3& operator=(const UI_point_3& upt)
{
Base::operator=(upt);
m_radius = upt.m_radius;
return *this;
}
// Inherited operators ==() and !=() are fine.
/// Gets/sets radius.
FT radius() const { return m_radius; }
FT& radius() { return m_radius; }
// Data
private:
/// radius.
FT m_radius;
};
#include <CGAL/Kernel_traits.h>
namespace CGAL{
template<class Gt>
struct Kernel_traits< ::UI_point_3<Gt> >{
typedef Gt Kernel;
};
} //end of CGAL namespace
#endif //UI_POINT_3_H
|