updates before merging next

This commit is contained in:
Michal Kleinbort 2012-06-19 09:17:00 +00:00
parent e75edb8582
commit 9b4a221a66
5 changed files with 58 additions and 200 deletions

View File

@ -37,18 +37,19 @@ struct Td_active_map_item : public std::unary_function<map_item,bool>
}
};
template <class X_trapezoid,class Traits>
struct Td_active_non_degenerate_trapezoid :
public std::unary_function<X_trapezoid,bool>
{
Td_active_non_degenerate_trapezoid(Traits& t) : traits(t) {}
bool operator()(const X_trapezoid& tr) const
{
return tr.is_active() && !traits.is_degenerate(tr);
}
protected:
const Traits& traits;
};
////MICHAL: not in use
//template <class X_trapezoid,class Traits>
//struct Td_active_non_degenerate_trapezoid :
//public std::unary_function<X_trapezoid,bool>
//{
// Td_active_non_degenerate_trapezoid(Traits& t) : traits(t) {}
// bool operator()(const X_trapezoid& tr) const
// {
// return tr.is_active() && !traits.is_degenerate(tr);
// }
//protected:
// const Traits& traits;
//};
template <class map_item,class Traits>
struct Td_active_edge_item:

View File

@ -19,10 +19,6 @@
#ifndef CGAL_TD_TRAITS_H
#define CGAL_TD_TRAITS_H
#if 0
#include <CGAL/Arr_point_location/Td_X_trapezoid.h>
#endif
#include <CGAL/Arr_point_location/Td_active_trapezoid.h>
#include <CGAL/Arr_point_location/Td_inactive_trapezoid.h>
#include <CGAL/Arr_point_location/Td_active_edge.h>
@ -32,14 +28,6 @@
#include <CGAL/Arr_point_location/Td_inactive_vertex.h>
#include <CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h>
#if 0
#include <CGAL/Arr_point_location/Td_halfedge.h>
#include <CGAL/Arr_point_location/Td_vertex.h>
#include <CGAL/Arr_point_location/Td_trapezoid.h>
#include <boost/variant.hpp>
#endif
namespace CGAL {
template <class Pm_traits_,class Arrangement_>
@ -61,7 +49,6 @@ public:
TD_INACTIVE_FICTITIOUS_VERTEX
};
//! type of base class
typedef Pm_traits_ Traits_base;
@ -98,34 +85,32 @@ public:
typedef typename Traits_base::Point_2 Point;
//! type of Td_active_trapezoid
typedef CGAL::Td_active_trapezoid<Self> Td_active_trapezoid;
typedef CGAL::Td_active_trapezoid<Self> Td_active_trapezoid;
//! type of Td_inactive_trapezoid
typedef CGAL::Td_inactive_trapezoid Td_inactive_trapezoid;
//typedef char Td_inactive_trapezoid;
//MICHAL: in order to compile need to rename typedefs
//struct nil { };
typedef int Td_nothing;
typedef CGAL::Td_inactive_trapezoid Td_inactive_trapezoid;
typedef int Td_nothing;
//! type of Td_active_edge
typedef CGAL::Td_active_edge<Self> Td_active_edge;
typedef CGAL::Td_active_edge<Self> Td_active_edge;
//! type of Td_inactive_edge
typedef CGAL::Td_inactive_edge<Self> Td_inactive_edge;
typedef CGAL::Td_inactive_edge<Self> Td_inactive_edge;
//! type of Td_active_vertex
typedef CGAL::Td_active_vertex<Self> Td_active_vertex;
typedef CGAL::Td_active_vertex<Self> Td_active_vertex;
//! type of Td_active_fictitious_vertex
typedef CGAL::Td_active_fictitious_vertex<Self> Td_active_fictitious_vertex;
typedef CGAL::Td_active_fictitious_vertex<Self>
Td_active_fictitious_vertex;
//! type of Td_inactive_vertex
typedef CGAL::Td_inactive_vertex<Self> Td_inactive_vertex;
typedef CGAL::Td_inactive_vertex<Self> Td_inactive_vertex;
//! type of Td_inactive_fictitious_vertex
typedef CGAL::Td_inactive_fictitious_vertex<Self> Td_inactive_fictitious_vertex;
typedef CGAL::Td_inactive_fictitious_vertex<Self>
Td_inactive_fictitious_vertex;
//! type of td map item (Td_halfedge, Td_vertex or Td_trapezoid)
typedef boost::variant< Td_nothing,
@ -149,13 +134,7 @@ public:
//! pair of pointer to the X_monotone_curve_2 and an indicator
// for ARR_MIN_END or ARR_MAX_END
Curve_end_pair m_pair;
/*
//! a pointer to the X_monotone_curve_2
const X_monotone_curve_2* m_p_cv;
//! indicates if its ARR_MIN_END or ARR_MAX_END
Arr_curve_end m_ce;
*/
public:
//Constructor based on a Curve_end_pair
@ -593,8 +572,6 @@ public:
bool operator() (const Point& p,
const Curve_end& ce) const
{
//Kernel kernel; //MICHAL: rational-upd
bool is_ce_interior =
((m_traits->parameter_space_in_x_2_object()(ce.cv(),ce.ce())
== ARR_INTERIOR) &&
@ -607,7 +584,6 @@ public:
return false;
//else - if ce is interior
//return kernel.equal_2_object() //MICHAL: rational-upd
return m_traits_base->equal_2_object()
( p,
((ce.ce() == ARR_MIN_END) ?
@ -887,8 +863,6 @@ public:
// Td_traits class ctors and dtor
Td_traits(const Traits_base& t) : Traits_base(t)
{ }
@ -948,7 +922,7 @@ public:
/* returns true if bottom halfedges of input are the same */
inline bool is_trapezoids_bottom_equal(const Td_active_trapezoid& left,
const Td_active_trapezoid& right) const //MICHAL: this one is in use!
const Td_active_trapezoid& right) const
{
if (left.is_on_bottom_boundary())
return (right.is_on_bottom_boundary());
@ -962,7 +936,7 @@ public:
/* returns true if top halfedges of input are the same */
inline bool is_trapezoids_top_equal(const Td_active_trapezoid& left,
const Td_active_trapezoid& right) const //MICHAL: this one is in use!
const Td_active_trapezoid& right) const
{
if (left.is_on_top_boundary())
return (right.is_on_top_boundary());
@ -972,6 +946,7 @@ public:
return (left.top() == right.top() || left.top()->twin() == right.top());
}
//returns true if the trapezoid is a curve
bool is_empty_item(const Td_map_item& tr) const
{
@ -991,35 +966,7 @@ public:
}
}
////returns true if the trapezoid is a point or a curve
//bool is_degenerate(const Td_map_item& tr) const
//{
// switch (tr.which())
// {
// case TD_ACTIVE_TRAPEZOID:
// case TD_INACTIVE_TRAPEZOID:
// return false;
// default:
// return true;
// }
//}
////returns true if the trapezoid is a point
//bool is_degenerate_point(const Td_map_item& tr) const //MICHAL: TBR
//{
// switch (tr.which())
// {
// case TD_ACTIVE_VERTEX:
// case TD_ACTIVE_FICTITIOUS_VERTEX:
// case TD_INACTIVE_VERTEX:
// case TD_INACTIVE_FICTITIOUS_VERTEX:
// return true;
// default:
// return false;
// }
//}
//returns true if the map item is a vertex
//returns true if the map item is a vertex
bool is_td_vertex(const Td_map_item& tr) const
{
switch (tr.which())
@ -1034,22 +981,7 @@ public:
}
}
////returns true if the trapezoid is a curve
//bool is_degenerate_curve(const Td_map_item& tr) const //MICHAL: TBR
//{
// switch (tr.which())
// {
// case TD_ACTIVE_EDGE:
// case TD_INACTIVE_EDGE:
// return true;
// default:
// return false;
// }
//}
//returns true if the map item is an edge
//returns true if the map item is an edge
bool is_td_edge(const Td_map_item& tr) const
{
switch (tr.which())
@ -1138,39 +1070,6 @@ public:
(compare_curve_end_y_at_x_2_object()(ce, tr.top()) == SMALLER) );
}
//// returns true if the point is inside the closure of the trapezoid
//// (inlcude all boundaries)
//bool is_in_closure(const Td_map_item& tr,const Point& p) const
//{
// CGAL_assertion(tr.is_active());
// // test left and right sides
// if ((tr.is_on_left_boundary()||
// !(compare_curve_end_xy_2_object()
// (p, tr.left()->curve_end())==SMALLER)) &&
// (tr.is_on_right_boundary()||
// !(compare_curve_end_xy_2_object()
// (p, tr.right()->curve_end())==LARGER)))
// {
// // test bottom side
// if (!tr.is_on_bottom_boundary() &&
// compare_curve_end_y_at_x_2_object()(p, tr.bottom()) == SMALLER)
// {
// return false;
// }
// // test top side
// if (!tr.is_on_top_boundary() &&
// compare_curve_end_y_at_x_2_object()(p, tr.top()) == LARGER)
// {
// return false;
// }
//
// return true;
//
// }
// return false;
//}
/*! returns true if the end point is inside the closure of the trapezoid
(inlcude all boundaries) */
bool is_in_closure (const Td_active_trapezoid& tr, const Curve_end& ce ) const
@ -1205,7 +1104,7 @@ public:
}
/*! returns true if the end point is inside the closure of the trapezoid
(inlcude all boundaries) */
bool is_in_closure (const Td_active_edge& e, const Curve_end& ce ) const
bool is_in_closure (const Td_active_edge& e, const Curve_end& ce ) const
{
// test left and right sides
if (compare_curve_end_xy_2_object()(ce,Curve_end(e.halfedge(),ARR_MIN_END)) == SMALLER)
@ -1217,18 +1116,14 @@ public:
public:
//static Td_map_item blank_item() const { return m_blank; }
static Vertex_const_handle empty_vtx_handle() { return m_empty_vtx_handle; }
static Halfedge_const_handle empty_he_handle() { return m_empty_he_handle; }
//static Td_map_item empty_map_item() { return m_empty_map_item; }
private:
//static Td_map_item m_blank;
static Vertex_const_handle m_empty_vtx_handle;
static Halfedge_const_handle m_empty_he_handle;
//static Td_map_item m_empty_map_item;
};
} //namespace CGAL

View File

@ -22,12 +22,6 @@
namespace CGAL {
/*
template <class Traits,class Arrangement_on_surface_2>
typename Td_traits<Traits,Arrangement_on_surface_2>::Td_map_item
Td_traits<Traits,Arrangement_on_surface_2>::m_blank ;
*/
template <class Traits,class Arrangement_on_surface_2>
typename Td_traits<Traits,Arrangement_on_surface_2>::Vertex_const_handle
Td_traits<Traits,Arrangement_on_surface_2>::m_empty_vtx_handle = Vertex_const_handle();
@ -36,8 +30,4 @@ template <class Traits,class Arrangement_on_surface_2>
typename Td_traits<Traits,Arrangement_on_surface_2>::Halfedge_const_handle
Td_traits<Traits,Arrangement_on_surface_2>::m_empty_he_handle = Halfedge_const_handle();
//template <class Traits,class Arrangement_on_surface_2>
//typename Td_traits<Traits,Arrangement_on_surface_2>::Td_map_item
//Td_traits<Traits,Arrangement_on_surface_2>::m_empty_map_item = Td_map_item();
} //namespace CGAL

View File

@ -1943,32 +1943,6 @@ private:
bool minus_inf, Dag_node& min_node,
bool plus_inf, Dag_node& max_node,
Dag_node& node);
unsigned char build_boundaries_flag(const Curve_end& ce)
{
unsigned char bndry_flag = CGAL_TD_INTERIOR;
Arr_parameter_space x_prm_spc =
traits->parameter_space_in_x_2_object()(ce.cv(), ce.ce());
Arr_parameter_space y_prm_spc =
traits->parameter_space_in_y_2_object()(ce.cv(), ce.ce());
if (x_prm_spc != ARR_INTERIOR)
{
bndry_flag |= (x_prm_spc == ARR_LEFT_BOUNDARY)
? CGAL_TD_ON_LEFT_BOUNDARY : CGAL_TD_ON_RIGHT_BOUNDARY;
}
else //if x_prm_spc == ARR_INTERIOR
{
if (y_prm_spc != ARR_INTERIOR)
{
bndry_flag |= (y_prm_spc == ARR_BOTTOM_BOUNDARY)
? CGAL_TD_ON_BOTTOM_BOUNDARY : CGAL_TD_ON_TOP_BOUNDARY;
}
}
return bndry_flag;
}
void init()
{
@ -2233,11 +2207,12 @@ protected:
#include <CGAL/Arr_point_location/Td_inactive_vertex.h>
#include <CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h>
#ifdef CGAL_TD_DEBUG
#ifndef CGAL_TRAPEZOIDAL_DECOMPOSITION_2_IOSTREAM_H
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2_iostream.h>
#endif
#endif
////MICHAL: currently commented since it is not in use
//#ifdef CGAL_TD_DEBUG
//#ifndef CGAL_TRAPEZOIDAL_DECOMPOSITION_2_IOSTREAM_H
//#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2_iostream.h>
//#endif
//#endif
// The member-function definitions can be found under:
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h>

View File

@ -21,33 +21,30 @@
#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_MISC_H
#include <CGAL/Handle.h>
//#include <CGAL/Arr_point_location/Td_ninetuple.h>
//#include <CGAL/Arr_point_location/Td_seventuple.h>
//#include <CGAL/Arr_point_location/Td_fivetuple.h>
#ifndef CGAL_TD_DAG_H
#include <CGAL/Arr_point_location/Td_dag_node.h>
#endif
#define CGAL_TD_DELETE_SIGNATURE 0xffffffff
//type
#define CGAL_TD_VERTEX 0
#define CGAL_TD_EDGE 0x1
#define CGAL_TD_TRAPEZOID 0x2
#define CGAL_TD_TYPE_MASK 0x3
#define CGAL_TD_ON_LEFT_BOUNDARY 0x4
#define CGAL_TD_ON_RIGHT_BOUNDARY 0x8
#define CGAL_TD_ON_BOTTOM_BOUNDARY 0x10
#define CGAL_TD_ON_TOP_BOUNDARY 0x20
#define CGAL_TD_ON_ALL_BOUNDARIES \
(CGAL_TD_ON_LEFT_BOUNDARY | CGAL_TD_ON_RIGHT_BOUNDARY | \
CGAL_TD_ON_BOTTOM_BOUNDARY| CGAL_TD_ON_TOP_BOUNDARY)
#define CGAL_TD_INTERIOR 0
#define CGAL_TD_CV_MIN_END 0
#define CGAL_TD_CV_MAX_END 0x1
//#define CGAL_TD_DELETE_SIGNATURE 0xffffffff
//
////type
//#define CGAL_TD_VERTEX 0
//#define CGAL_TD_EDGE 0x1
//#define CGAL_TD_TRAPEZOID 0x2
//#define CGAL_TD_TYPE_MASK 0x3
//
//#define CGAL_TD_ON_LEFT_BOUNDARY 0x4
//#define CGAL_TD_ON_RIGHT_BOUNDARY 0x8
//#define CGAL_TD_ON_BOTTOM_BOUNDARY 0x10
//#define CGAL_TD_ON_TOP_BOUNDARY 0x20
//#define CGAL_TD_ON_ALL_BOUNDARIES \
// (CGAL_TD_ON_LEFT_BOUNDARY | CGAL_TD_ON_RIGHT_BOUNDARY | \
// CGAL_TD_ON_BOTTOM_BOUNDARY| CGAL_TD_ON_TOP_BOUNDARY)
//#define CGAL_TD_INTERIOR 0
//
//#define CGAL_TD_CV_MIN_END 0
//#define CGAL_TD_CV_MAX_END 0x1
#define CGAL_TD_DEFAULT_DEPTH_THRESHOLD 60
#define CGAL_TD_DEFAULT_SIZE_THRESHOLD 12