on_identification -> on_boundary

This commit is contained in:
Eric Berberich 2009-05-17 15:59:23 +00:00
parent 2451e4262f
commit 0624e615af
9 changed files with 98 additions and 95 deletions

View File

@ -35,6 +35,11 @@ Tags to ensure selection of "dummy" functors
Files:
======
Arr_tracing_traits_2.h: Some functors are missing!
#########

View File

@ -786,7 +786,7 @@ public:
* that lie on the horizontal identification arc.
* The parameter space does not contain a horizontal identification arc.
*/
class Compare_x_on_identification_2 {
class Compare_x_on_boundary_2 {
public:
/*! Compare the x-coordinate of two given points that lie on the
* horizontal identification arc.
@ -801,14 +801,14 @@ public:
}
};
/*! Obtain a Compare_x_on_identification_2 function object */
Compare_x_on_identification_2 compare_x_on_identification_2_object() const
{ return Compare_x_on_identification_2(); }
/*! Obtain a Compare_x_on_boundary_2 function object */
Compare_x_on_boundary_2 compare_x_on_boundary_2_object() const
{ return Compare_x_on_boundary_2(); }
/*! A functor that compares the y-coordinate of two given points
* that lie on the vertical identification arc.
*/
class Compare_y_on_identification_2 {
class Compare_y_on_boundary_2 {
protected:
typedef Arr_arc_on_sphere_traits_2<Kernel> Traits;
@ -818,7 +818,7 @@ public:
/*! Constructor
* \param traits the traits (in case it has state)
*/
Compare_y_on_identification_2(const Traits * traits) : m_traits(traits) {}
Compare_y_on_boundary_2(const Traits * traits) : m_traits(traits) {}
friend class Arr_arc_on_sphere_traits_2<Kernel>;
@ -839,9 +839,9 @@ public:
}
};
/*! Obtain a Compare_y_on_identification_2 function object */
Compare_y_on_identification_2 compare_y_on_identification_2_object() const
{ return Compare_y_on_identification_2(this); }
/*! Obtain a Compare_y_on_boundary_2 function object */
Compare_y_on_boundary_2 compare_y_on_boundary_2_object() const
{ return Compare_y_on_boundary_2(this); }
//@}
/// \name Functor definitions for supporting intersections.

View File

@ -62,8 +62,8 @@ public:
BOUNDARY_IN_Y_OP,
COMPARE_X_NEAR_BOUNDARY_OP,
COMPARE_Y_NEAR_BOUNDARY_OP,
COMPARE_X_ON_IDENTIFICATION_OP,
COMPARE_Y_ON_IDENTIFICATION_OP,
COMPARE_X_ON_BOUNDARY_OP,
COMPARE_Y_ON_BOUNDARY_OP,
NUMBER_OF_OPERATIONS
};
@ -151,11 +151,11 @@ public:
unsigned int count_compare_y_near_boundary() const
{ return m_counters[COMPARE_Y_NEAR_BOUNDARY_OP]; }
unsigned int count_compare_x_on_identification() const
{ return m_counters[COMPARE_X_ON_IDENTIFICATION_OP]; }
unsigned int count_compare_x_on_boundary() const
{ return m_counters[COMPARE_X_ON_BOUNDARY_OP]; }
unsigned int count_compare_y_on_identification() const
{ return m_counters[COMPARE_Y_ON_IDENTIFICATION_OP]; }
unsigned int count_compare_y_on_boundary() const
{ return m_counters[COMPARE_Y_ON_BOUNDARY_OP]; }
/// \name Types and functors inherited from the base
//@{
@ -547,17 +547,17 @@ public:
};
/*! A functor that compares the x-coordinate of two given points
* that lie on the horizontal identification curve.
* that lie on horizontal boundaries.
*/
class Compare_x_on_identification_2 {
class Compare_x_on_boundary_2 {
private:
typename Base::Compare_x_on_identification_2 m_object;
typename Base::Compare_x_on_boundary_2 m_object;
unsigned int & m_counter;
public:
/*! Construct */
Compare_x_on_identification_2(const Base * base, unsigned int & counter) :
m_object(base->compare_x_on_identification_2_object()),
Compare_x_on_boundary_2(const Base * base, unsigned int & counter) :
m_object(base->compare_x_on_boundary_2_object()),
m_counter(counter)
{}
@ -568,17 +568,17 @@ public:
};
/*! A functor that compares the y-coordinate of two given points
* that lie on the vertical identification curve.
* that lie on vertical boundaries.
*/
class Compare_y_on_identification_2 {
class Compare_y_on_boundary_2 {
private:
typename Base::Compare_y_on_identification_2 m_object;
typename Base::Compare_y_on_boundary_2 m_object;
unsigned int & m_counter;
public:
/*! Construct */
Compare_y_on_identification_2(const Base * base, unsigned int & counter) :
m_object(base->compare_y_on_identification_2_object()),
Compare_y_on_boundary_2(const Base * base, unsigned int & counter) :
m_object(base->compare_y_on_boundary_2_object()),
m_counter(counter)
{}
@ -722,10 +722,10 @@ Out_stream & operator<<(Out_stream & os,
<< traits.count_compare_x_near_boundary() << std::endl
<< "# of COMPARE_Y_NEAR_BOUNDARY operation = "
<< traits.count_compare_y_near_boundary() << std::endl
<< "# of COMPARE_X_ON_IDENTIFICATION operation = "
<< traits.count_compare_x_on_identification() << std::endl
<< "# of COMPARE_Y_ON_IDENTIFICATION operation = "
<< traits.count_compare_y_on_identification() << std::endl
<< "# of COMPARE_X_ON_BOUNDARY operation = "
<< traits.count_compare_x_on_boundary() << std::endl
<< "# of COMPARE_Y_ON_BOUNDARY operation = "
<< traits.count_compare_y_on_boundary() << std::endl
<< "total # = " << sum << std::endl
<< "# of traits constructed = " << Traits::increment(false)
<< std::endl;

View File

@ -1200,7 +1200,7 @@ public:
* that lie on the horizontal identification arc.
* The parameter space does not contain a horizontal identification arc.
*/
class Compare_x_on_identification_2 {
class Compare_x_on_boundary_2 {
public:
/*! Compare the x-coordinate of two given points that lie on the
* horizontal identification arc.
@ -1215,14 +1215,14 @@ public:
}
};
/*! Obtain a Compare_x_on_identification_2 function object */
Compare_x_on_identification_2 compare_x_on_identification_2_object() const
{ return Compare_x_on_identification_2(); }
/*! Obtain a Compare_x_on_boundary_2 function object */
Compare_x_on_boundary_2 compare_x_on_boundary_2_object() const
{ return Compare_x_on_boundary_2(); }
/*! A functor that compares the y-coordinate of two given points
* that lie on the vertical identification arc.
*/
class Compare_y_on_identification_2 {
class Compare_y_on_boundary_2 {
protected:
typedef Arr_geodesic_arc_on_sphere_traits_2<Kernel> Traits;
@ -1232,7 +1232,7 @@ public:
/*! Constructor
* \param traits the traits (in case it has state)
*/
Compare_y_on_identification_2(const Traits * traits) : m_traits(traits) {}
Compare_y_on_boundary_2(const Traits * traits) : m_traits(traits) {}
friend class Arr_geodesic_arc_on_sphere_traits_2<Kernel>;
@ -1255,9 +1255,9 @@ public:
}
};
/*! Obtain a Compare_y_on_identification_2 function object */
Compare_y_on_identification_2 compare_y_on_identification_2_object() const
{ return Compare_y_on_identification_2(this); }
/*! Obtain a Compare_y_on_boundary_2 function object */
Compare_y_on_boundary_2 compare_y_on_boundary_2_object() const
{ return Compare_y_on_boundary_2(this); }
//@}
/// \name Functor definitions for supporting intersections.

View File

@ -836,7 +836,7 @@ public:
/*! A functor that compares the x-coordinate of two given points
* that lie on the horizontal identification curve.
*/
class Compare_x_on_identification_2 {
class Compare_x_on_boundary_2 {
protected:
//! The base traits.
const Base_traits_2 * m_base;
@ -848,7 +848,7 @@ public:
* obtaining function, which is a member of the nesting class,
* constructing it.
*/
Compare_x_on_identification_2(const Base_traits_2 * tr) : m_base(tr) {}
Compare_x_on_boundary_2(const Base_traits_2 * tr) : m_base(tr) {}
//! Allow its functor obtaining function calling the private constructor.
friend class Arr_batched_point_location_traits_2<Arrangement_2>;
@ -861,16 +861,16 @@ public:
}
};
/*! Obtain a Compare_x_on_identification_2 functor object. */
Compare_x_on_identification_2 compare_x_on_identification_2_object () const
/*! Obtain a Compare_x_on_boundary_2 functor object. */
Compare_x_on_boundary_2 compare_x_on_boundary_2_object () const
{
return Compare_x_on_identification_2(m_base_traits);
return Compare_x_on_boundary_2(m_base_traits);
}
/*! A functor that compares the y-coordinate of two given points
* that lie on the vertical identification curve.
*/
class Compare_y_on_identification_2 {
class Compare_y_on_boundary_2 {
protected:
//! The base traits.
const Base_traits_2 * m_base;
@ -882,7 +882,7 @@ public:
* obtaining function, which is a member of the nesting class,
* constructing it.
*/
Compare_y_on_identification_2(const Base_traits_2 * tr) : m_base(tr) {}
Compare_y_on_boundary_2(const Base_traits_2 * tr) : m_base(tr) {}
//! Allow its functor obtaining function calling the private constructor.
friend class Arr_batched_point_location_traits_2<Arrangement_2>;
@ -895,10 +895,10 @@ public:
}
};
/*! Obtain a Compare_y_on_identification_2 functor object. */
Compare_y_on_identification_2 compare_y_on_identification_2_object () const
/*! Obtain a Compare_y_on_boundary_2 functor object. */
Compare_y_on_boundary_2 compare_y_on_boundary_2_object () const
{
return Compare_y_on_identification_2(m_base_traits);
return Compare_y_on_boundary_2(m_base_traits);
}
};

View File

@ -109,7 +109,7 @@ private:
Traits_adaptor_2 * m_traits;
bool operator()(const Point_2 & p1, const Point_2 & p2) const
{
return (m_traits->compare_y_on_identification_2_object()(p1, p2) ==
return (m_traits->compare_y_on_boundary_2_object()(p1, p2) ==
SMALLER);
}
};

View File

@ -443,7 +443,7 @@ are_equal(const Vertex * v,
const Point_2 & p2 = (ind == ARR_MIN_END) ?
m_traits->construct_min_vertex_2_object()(xc) :
m_traits->construct_max_vertex_2_object()(xc);
return (m_traits->compare_y_on_identification_2_object()(p1, p2) == EQUAL);
return (m_traits->compare_y_on_boundary_2_object()(p1, p2) == EQUAL);
}
/*! \brief receives a notification on the creation of a new boundary vertex */

View File

@ -62,8 +62,8 @@ public:
BOUNDARY_IN_Y_OP,
COMPARE_X_NEAR_BOUNDARY_OP,
COMPARE_Y_NEAR_BOUNDARY_OP,
COMPARE_X_ON_IDENTIFICATION_OP,
COMPARE_Y_ON_IDENTIFICATION_OP,
COMPARE_X_ON_BOUNDARY_OP,
COMPARE_Y_ON_BOUNDARY_OP,
NUMBER_OF_OPERATIONS
};
@ -137,11 +137,11 @@ private:
bool compare_y_near_boundary_op() const
{ return m_flags & (0x1 << COMPARE_Y_NEAR_BOUNDARY_OP); }
bool compare_x_on_identification_op() const
{ return m_flags & (0x1 << COMPARE_X_ON_IDENTIFICATION_OP); }
bool compare_x_on_boundary_op() const
{ return m_flags & (0x1 << COMPARE_X_ON_BOUNDARY_OP); }
bool compare_y_on_identification_op() const
{ return m_flags & (0x1 << COMPARE_Y_ON_IDENTIFICATION_OP); }
bool compare_y_on_boundary_op() const
{ return m_flags & (0x1 << COMPARE_Y_ON_BOUNDARY_OP); }
public:
/*! Default constructor */
@ -883,17 +883,17 @@ public:
};
/*! A functor that compares the x-coordinate of two given points
* that lie on the horizontal identification curve.
* that lie on horizontal boundaries.
*/
class Compare_x_on_identification_2 {
class Compare_x_on_boundary_2 {
private:
typename Base::Compare_x_on_identification_2 m_object;
typename Base::Compare_x_on_boundary_2 m_object;
bool m_enabled;
public:
/*! Construct */
Compare_x_on_identification_2(const Base * base, bool enabled = true) :
m_object(base->compare_x_on_identification_object()), m_enabled(enabled) {}
Compare_x_on_boundary_2(const Base * base, bool enabled = true) :
m_object(base->compare_x_on_boundary_object()), m_enabled(enabled) {}
/*! Operate
* \param p1 the first point.
* \param p2 the second point.
@ -901,7 +901,7 @@ public:
Comparison_result operator()(const Point_2 & p1, const Point_2 & p2) const
{
if (!m_enabled) return m_object(p1, p2);
std::cout << "compare_x_on_identification" << std::endl
std::cout << "compare_x_on_boundary" << std::endl
<< " p1: " << p1 << std::endl
<< " p2: " << p2 << std::endl;
Comparison_result cr = m_object(p1, p2);
@ -911,17 +911,17 @@ public:
};
/*! A functor that compares the y-coordinate of two given points
* that lie on the vertical identification curve.
* that lie on vertical boundaries.
*/
class Compare_y_on_identification_2 {
class Compare_y_on_boundary_2 {
private:
typename Base::Compare_y_on_identification_2 m_object;
typename Base::Compare_y_on_boundary_2 m_object;
bool m_enabled;
public:
/*! Construct */
Compare_y_on_identification_2(const Base * base, bool enabled = true) :
m_object(base->compare_y_on_identification_2_object()),
Compare_y_on_boundary_2(const Base * base, bool enabled = true) :
m_object(base->compare_y_on_boundary_2_object()),
m_enabled(enabled)
{}
@ -932,7 +932,7 @@ public:
Comparison_result operator()(const Point_2 & p1, const Point_2 & p2) const
{
if (!m_enabled) return m_object(p1, p2);
std::cout << "compare_y_on_identification" << std::endl
std::cout << "compare_y_on_boundary" << std::endl
<< " p1: " << p1 << std::endl
<< " p2: " << p2 << std::endl;
Comparison_result cr = m_object(p1, p2);
@ -1004,16 +1004,14 @@ public:
Compare_y_near_boundary_2 compare_y_near_boundary_2_object() const
{ return Compare_y_near_boundary_2(this, compare_y_near_boundary_op()); }
Compare_x_on_identification_2 compare_x_on_identification_2_object() const
Compare_x_on_boundary_2 compare_x_on_boundary_2_object() const
{
return Compare_x_on_identification_2(this,
compare_x_on_identification_op());
return Compare_x_on_boundary_2(this, compare_x_on_boundary_op());
}
Compare_y_on_identification_2 compare_y_on_identification_2_object() const
Compare_y_on_boundary_2 compare_y_on_boundary_2_object() const
{
return Compare_y_on_identification_2(this,
compare_y_on_identification_op());
return Compare_y_on_boundary_2(this, compare_y_on_boundary_op());
}
//@}
};

View File

@ -839,10 +839,10 @@ public:
}
/*! A functor that compares the y-coordinates of two points on the
* identification curve.
/*! A functor that compares the y-coordinates of two points on vertical
* boundaries.
*/
class Compare_y_on_identification_2
class Compare_y_on_boundary_2
{
protected:
//! The base traits.
@ -852,7 +852,7 @@ public:
const Point_2 & p2,
Arr_bounded_boundary_tag) const
{
return m_base->compare_y_on_identification_2_object()(p1.base(),
return m_base->compare_y_on_boundary_2_object()(p1.base(),
p2.base());
}
@ -883,7 +883,7 @@ public:
* obtaining function, which is a member of the nesting class,
* constructing it.
*/
Compare_y_on_identification_2 (const Traits_2 * base) : m_base(base) {}
Compare_y_on_boundary_2 (const Traits_2 * base) : m_base(base) {}
//! Allow its functor obtaining function calling the private constructor.
friend class Arr_basic_insertion_traits_2<Traits_, Arrangement_>;
@ -899,15 +899,15 @@ public:
}
};
/*! Obtain a Compare_y_on_identification_2 object
/*! Obtain a Compare_y_on_boundary_2 object
*/
Compare_y_on_identification_2 compare_y_on_identification_2_object() const
Compare_y_on_boundary_2 compare_y_on_boundary_2_object() const
{
return Compare_y_on_identification_2(m_base_traits);
return Compare_y_on_boundary_2(m_base_traits);
}
/*! A function object that determines whether a curve end is bounded. */
class Is_bounded_2 {
/*! A function object that determines whether a curve end is closed. */
class Is_closed_2 {
protected:
//! The base traits.
const Traits_2 * m_base;
@ -919,41 +919,41 @@ public:
* obtaining function, which is a member of the nesting class,
* constructing it.
*/
Is_bounded_2(const Traits_2 * base) : m_base(base) {}
Is_closed_2(const Traits_2 * base) : m_base(base) {}
//! Allow its functor obtaining function calling the private constructor.
friend class Arr_basic_insertion_traits_2<Traits_, Arrangement_>;
bool is_bounded (const X_monotone_curve_2 &, Arr_curve_end,
bool is_closed (const X_monotone_curve_2 &, Arr_curve_end,
Arr_no_boundary_tag) const
{ return true; }
bool is_bounded (const X_monotone_curve_2 &, Arr_curve_end,
bool is_closed (const X_monotone_curve_2 &, Arr_curve_end,
Arr_has_boundary_tag) const
{ return true; }
bool is_bounded (const X_monotone_curve_2 & xcv, Arr_curve_end ce,
bool is_closed (const X_monotone_curve_2 & xcv, Arr_curve_end ce,
Arr_unbounded_boundary_tag) const
{
return m_base->is_bounded_2_object()(xcv, ce);
return m_base->is_closed_2_object()(xcv, ce);
}
public:
/*! Is the end of an x-monotone curve bounded?
/*! Is the end of an x-monotone curve closed?
* \param xcv The x-monotone curve.
* \param ce The end of xcv identifier.
* \return true is the curve end is bounded, and false otherwise
* \return true is the curve end is closed, and false otherwise
*/
bool operator() (const X_monotone_curve_2 & xcv, Arr_curve_end ce) const
{
return is_bounded(xcv, ce, Boundary_category());
return is_closed(xcv, ce, Boundary_category());
}
};
/*! Obtain a Is_bounded_2 function object. */
Is_bounded_2 is_bounded_2_object() const
/*! Obtain a Is_closed_2 function object. */
Is_closed_2 is_closed_2_object() const
{
return Is_bounded_2(m_base_traits);
return Is_closed_2(m_base_traits);
}
};