mirror of https://github.com/CGAL/cgal
added dcel template parameter
This commit is contained in:
parent
30d9bd5b9b
commit
ba02f457b5
|
|
@ -32,19 +32,29 @@ CGAL_BEGIN_NAMESPACE
|
||||||
* Representation of an envelope diagram (a minimization diagram or a
|
* Representation of an envelope diagram (a minimization diagram or a
|
||||||
* maximization diagram).
|
* maximization diagram).
|
||||||
*/
|
*/
|
||||||
template <class Traits_> class Envelope_diagram_2 :
|
template <typename T_Traits,
|
||||||
public Arrangement_2<Traits_,
|
#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
|
||||||
Envelope_pm_dcel<Traits_,
|
template <class T1, class T2>
|
||||||
typename Traits_::Xy_monotone_surface_3> >
|
#endif
|
||||||
|
class T_Dcel = Envelope_pm_dcel>
|
||||||
|
class Envelope_diagram_2 :
|
||||||
|
public Arrangement_2<T_Traits,
|
||||||
|
#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
|
||||||
|
T_Dcel<T_Traits,
|
||||||
|
typename T_Traits::Xy_monotone_surface_3>
|
||||||
|
#else
|
||||||
|
typename T_Dcel::template Dcel<T_Traits,
|
||||||
|
typename T_Traits::Xy_monotone_surface_3>
|
||||||
|
#endif
|
||||||
|
>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef Traits_ Traits_3;
|
typedef T_Traits Traits_3;
|
||||||
typedef typename Traits_3::Xy_monotone_surface_3 Xy_monotone_surface_3;
|
typedef typename Traits_3::Xy_monotone_surface_3 Xy_monotone_surface_3;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef Envelope_pm_dcel<Traits_3,
|
typedef T_Dcel<Traits_3, Xy_monotone_surface_3> Env_dcel;
|
||||||
Xy_monotone_surface_3> Env_dcel;
|
typedef Envelope_diagram_2<Traits_3, T_Dcel> Self;
|
||||||
typedef Envelope_diagram_2<Traits_3> Self;
|
|
||||||
friend class Arr_accessor<Self>;
|
friend class Arr_accessor<Self>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -70,18 +80,60 @@ public:
|
||||||
* \param min_diag Output: The minimization diagram.
|
* \param min_diag Output: The minimization diagram.
|
||||||
* \pre The value-type of InputIterator is Traits::Surface_3.
|
* \pre The value-type of InputIterator is Traits::Surface_3.
|
||||||
*/
|
*/
|
||||||
template <class InputIterator, class Traits>
|
template <typename InputIterator, typename T_Traits,
|
||||||
|
#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
|
||||||
|
template <class T1, class T2>
|
||||||
|
#endif
|
||||||
|
class T_Dcel>
|
||||||
void lower_envelope_3 (InputIterator begin, InputIterator end,
|
void lower_envelope_3 (InputIterator begin, InputIterator end,
|
||||||
Envelope_diagram_2<Traits>& min_diagram)
|
Envelope_diagram_2<T_Traits, T_Dcel> & min_diagram)
|
||||||
{
|
{
|
||||||
typedef Traits Traits_3;
|
typedef T_Traits Traits_3;
|
||||||
typedef typename Envelope_diagram_2<Traits_3>::Base Base_arr_2;
|
typedef typename Envelope_diagram_2<Traits_3, T_Dcel>::Base Base_arr_2;
|
||||||
typedef Envelope_divide_and_conquer_3<Traits_3,
|
typedef Envelope_divide_and_conquer_3<Traits_3, Base_arr_2> Envelope_algorithm;
|
||||||
Base_arr_2> Envelope_algorithm;
|
|
||||||
Envelope_algorithm env_alg (min_diagram.traits(), ENVELOPE_LOWER);
|
Envelope_algorithm env_alg (min_diagram.traits(), ENVELOPE_LOWER);
|
||||||
env_alg.construct_lu_envelope (begin, end, min_diagram);
|
env_alg.construct_lu_envelope (begin, end, min_diagram);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
/*!
|
||||||
|
* Construct the lower envelope of a given set of surfaces.
|
||||||
|
* \param begin An iterator for the first surface.
|
||||||
|
* \param end A past-the-end iterator for the surfaces in the range.
|
||||||
|
* \param min_diag Output: The minimization diagram.
|
||||||
|
* \pre The value-type of InputIterator is Traits::Surface_3.
|
||||||
|
*/
|
||||||
|
template <typename InputIterator, typename T_Traits>
|
||||||
|
void lower_envelope_3 (InputIterator begin, InputIterator end,
|
||||||
|
Envelope_diagram_2<T_Traits> & min_diagram)
|
||||||
|
{
|
||||||
|
typedef T_Traits Traits_3;
|
||||||
|
typedef typename Envelope_diagram_2<Traits_3>::Base Base_arr_2;
|
||||||
|
typedef Envelope_divide_and_conquer_3<Traits_3, Base_arr_2> Envelope_algorithm;
|
||||||
|
Envelope_algorithm env_alg (min_diagram.traits(), ENVELOPE_LOWER);
|
||||||
|
env_alg.construct_lu_envelope (begin, end, min_diagram);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Construct the upper envelope of a given set of surfaces.
|
||||||
|
* \param begin An iterator for the first surface.
|
||||||
|
* \param end A past-the-end iterator for the surfaces in the range.
|
||||||
|
* \param max_diag Output: The maximization diagram.
|
||||||
|
* \pre The value-type of InputIterator is Traits::Surface_3.
|
||||||
|
*/
|
||||||
|
template <class InputIterator, class Traits,
|
||||||
|
#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
|
||||||
|
template <class T1, class T2>
|
||||||
|
#endif
|
||||||
|
class T_Dcel>
|
||||||
|
void upper_envelope_3 (InputIterator begin, InputIterator end,
|
||||||
|
Envelope_diagram_2<Traits, T_Dcel>& max_diagram)
|
||||||
|
{
|
||||||
|
typedef Traits Traits_3;
|
||||||
|
typedef typename Envelope_diagram_2<Traits_3, T_Dcel>::Base Base_arr_2;
|
||||||
|
typedef Envelope_divide_and_conquer_3<Traits_3, Base_arr_2> Envelope_algorithm;
|
||||||
|
|
||||||
|
Envelope_algorithm env_alg (max_diagram.traits(), ENVELOPE_UPPER);
|
||||||
|
env_alg.construct_lu_envelope (begin, end, max_diagram);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -97,13 +149,34 @@ void upper_envelope_3 (InputIterator begin, InputIterator end,
|
||||||
{
|
{
|
||||||
typedef Traits Traits_3;
|
typedef Traits Traits_3;
|
||||||
typedef typename Envelope_diagram_2<Traits_3>::Base Base_arr_2;
|
typedef typename Envelope_diagram_2<Traits_3>::Base Base_arr_2;
|
||||||
typedef Envelope_divide_and_conquer_3<Traits_3,
|
typedef Envelope_divide_and_conquer_3<Traits_3, Base_arr_2>
|
||||||
Base_arr_2> Envelope_algorithm;
|
Envelope_algorithm;
|
||||||
|
|
||||||
Envelope_algorithm env_alg (max_diagram.traits(), ENVELOPE_UPPER);
|
Envelope_algorithm env_alg (max_diagram.traits(), ENVELOPE_UPPER);
|
||||||
env_alg.construct_lu_envelope (begin, end, max_diagram);
|
env_alg.construct_lu_envelope (begin, end, max_diagram);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
/*!
|
||||||
|
* Construct the lower envelope of a given set of xy_monotone surfaces.
|
||||||
|
* \param begin An iterator for the first xy-monotone surface.
|
||||||
|
* \param end A past-the-end iterator for the xy_monotone surfaces in the range.
|
||||||
|
* \param min_diag Output: The minimization diagram.
|
||||||
|
* \pre The value-type of InputIterator is Traits::Surface_3.
|
||||||
|
*/
|
||||||
|
template <class InputIterator, class Traits,
|
||||||
|
#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
|
||||||
|
template <class T1, class T2>
|
||||||
|
#endif
|
||||||
|
class T_Dcel>
|
||||||
|
void
|
||||||
|
lower_envelope_xy_monotone_3 (InputIterator begin, InputIterator end,
|
||||||
|
Envelope_diagram_2<Traits, T_Dcel>& min_diagram)
|
||||||
|
{
|
||||||
|
typedef Traits Traits_3;
|
||||||
|
typedef typename Envelope_diagram_2<Traits_3, T_Dcel>::Base Base_arr_2;
|
||||||
|
typedef Envelope_divide_and_conquer_3<Traits_3, Base_arr_2> Envelope_algorithm;
|
||||||
|
Envelope_algorithm env_alg (min_diagram.traits(), ENVELOPE_LOWER);
|
||||||
|
env_alg.construct_envelope_xy_monotone (begin, end, min_diagram);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -119,10 +192,33 @@ void lower_envelope_xy_monotone_3 (InputIterator begin, InputIterator end,
|
||||||
{
|
{
|
||||||
typedef Traits Traits_3;
|
typedef Traits Traits_3;
|
||||||
typedef typename Envelope_diagram_2<Traits_3>::Base Base_arr_2;
|
typedef typename Envelope_diagram_2<Traits_3>::Base Base_arr_2;
|
||||||
typedef Envelope_divide_and_conquer_3<Traits_3,
|
typedef Envelope_divide_and_conquer_3<Traits_3, Base_arr_2> Envelope_algorithm;
|
||||||
Base_arr_2> Envelope_algorithm;
|
|
||||||
Envelope_algorithm env_alg (min_diagram.traits(), ENVELOPE_LOWER);
|
Envelope_algorithm env_alg (min_diagram.traits(), ENVELOPE_LOWER);
|
||||||
env_alg.construct_envelope_xy_monotone (begin, end, min_diagram);
|
env_alg.construct_envelope_xy_monotone (begin, end, min_diagram);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Construct the upper envelope of a given set of xy_monotone surfaces.
|
||||||
|
* \param begin An iterator for the first xy_monotone surface.
|
||||||
|
* \param end A past-the-end iterator for the xy_monotone surfaces in the range.
|
||||||
|
* \param max_diag Output: The maximization diagram.
|
||||||
|
* \pre The value-type of InputIterator is Traits::Surface_3.
|
||||||
|
*/
|
||||||
|
template <class InputIterator, class Traits,
|
||||||
|
#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
|
||||||
|
template <class T1, class T2>
|
||||||
|
#endif
|
||||||
|
class T_Dcel>
|
||||||
|
void
|
||||||
|
upper_envelope_xy_monotone_3 (InputIterator begin, InputIterator end,
|
||||||
|
Envelope_diagram_2<Traits, T_Dcel>& max_diagram)
|
||||||
|
{
|
||||||
|
typedef Traits Traits_3;
|
||||||
|
typedef typename Envelope_diagram_2<Traits_3, T_Dcel>::Base Base_arr_2;
|
||||||
|
typedef Envelope_divide_and_conquer_3<Traits_3, Base_arr_2> Envelope_algorithm;
|
||||||
|
|
||||||
|
Envelope_algorithm env_alg (max_diagram.traits(), ENVELOPE_UPPER);
|
||||||
|
env_alg.construct_envelope_xy_monotone (begin, end, max_diagram);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue