Changed Pm_straight_exact_traits to Pm_straight_traits_2.

This commit is contained in:
Shai Hirsch 2002-04-11 12:00:35 +00:00
parent 56f45b8943
commit 07f178e25d
16 changed files with 2066 additions and 1971 deletions

View File

@ -18,9 +18,9 @@
#ifdef USE_RATIONAL
#include <CGAL/leda_rational.h>
#endif
#include <CGAL/Pm_straight_exact_traits.h>
#include <CGAL/Pm_straight_traits_2.h>
#include <CGAL/IO/Straight_2_stream.h>
#include <CGAL/IO/Pm_straight_exact_traits_stream.h>
#include <CGAL/IO/Pm_straight_traits_2_Window_stream.h>
#ifdef CGAL_PM_DEBUG
#include <CGAL/Pm_segment_traits_2.h>
@ -52,7 +52,7 @@ typedef CGAL::Cartesian<number_type> Rep;
typedef Rep::FT FT;
typedef Rep::RT RT;
typedef CGAL::Pm_straight_exact_traits<Rep> Traits;
typedef CGAL::Pm_straight_traits_2<Rep> Traits;
typedef CGAL::Pm_default_dcel<Traits> Dcel;
typedef CGAL::Planar_map_2<Dcel,Traits> Planar_map;
typedef Planar_map::Traits_wrap Traits_wrap;

View File

@ -103,7 +103,7 @@ demo.rational.naive$(EXE_EXT): demo.rational.naive$(OBJ_EXT) draw_map.rational.n
demo.leda.rational.naive$(EXE_EXT): demo.leda.rational.naive$(OBJ_EXT) draw_map.leda.rational.naive$(OBJ_EXT)
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)demo.leda.rational.naive demo.leda.rational.naive$(OBJ_EXT) draw_map.leda.rational.naive$(OBJ_EXT) $(LDFLAGS)
draw_map_h = draw_map.h ../../include/CGAL/Pm_straight_exact_traits.h
draw_map_h = draw_map.h ../../include/CGAL/Pm_straight_traits_2.h
voronoi_h = voronoi.h ../../include/CGAL/Pm_dynamic_open_bounding_box.h ../../include/CGAL/Pm_dynamic_closed_bounding_box.h

View File

@ -64,7 +64,7 @@ The requirements of the latter are the requirements of the former with the follo
\ccMethod{bool is_bounding_box_bounded(const Bounding_box& s,const Bounding_box& l);}{returns whether the first bounding box is inside the second bounding box.}
\ccHasModels
\ccc{Pm_straight_exact_traits<R>}
\ccc{Pm_straight_traits_2<R>}
\end{ccRefConcept} % Pm_traits

View File

@ -11,17 +11,17 @@
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
\begin {ccRefClass} {Pm_straight_exact_traits<R>}
\begin {ccRefClass} {Pm_straight_traits_2<R>}
%\ccDefinition
The class \ccStyle{Pm_straight_exact_traits<R>}
The class \ccStyle{Pm_straight_traits_2<R>}
is used as the recommended class. To avoid robustness problems,
the representation type \ccStyle{R} must be an exact type such as
\ccStyle{Cartesian<leda_rational>},
\ccStyle{Homogeneous<leda_integer>} or any other exact type,
although other representation types could be used at the user's own risk.
\ccInclude{ CGAL/Pm_straight_exact_traits.h}
\ccInclude{CGAL/Pm_straight_traits_2.h}
\ccIsModel
\ccc{PlanarMapBoundingBox_2_traits}\\
@ -36,10 +36,10 @@
% \ccCreation
% \ccCreationVariable{T_exact}
% \ccConstructor{Pm_straight_exact_traits();}
% \ccConstructor{Pm_straight_traits_2();}
% {}
\end{ccRefClass} % Pm_straight_exact_traits
\end{ccRefClass} % Pm_straight_traits_2
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
\ccRefPageEnd

View File

@ -431,7 +431,7 @@ significantly reduces running time.
\ccRefIdfierPage{CGAL::Pm_dcel<V,H,F>}\\
\ccRefIdfierPage{CGAL::Pm_segment_traits_2<R>}\\
\ccRefIdfierPage{CGAL::Pm_leda_segment_traits_2}\\
\ccRefIdfierPage{CGAL::Pm_straight_exact_traits<R>}\\
\ccRefIdfierPage{CGAL::Pm_straight_traits_2<R>}\\
\ccRefIdfierPage{CGAL::File_header}\\
\ccRefIdfierPage{CGAL::Pm_file_scanner<Planar_map>}\\
\ccRefIdfierPage{CGAL::Pm_file_writer<Planar_map>}\\

View File

@ -64,7 +64,7 @@ The requirements of the latter are the requirements of the former with the follo
\ccMethod{bool is_bounding_box_bounded(const Bounding_box& s,const Bounding_box& l);}{returns whether the first bounding box is inside the second bounding box.}
\ccHasModels
\ccc{Pm_straight_exact_traits<R>}
\ccc{Pm_straight_traits_2<R>}
\end{ccRefConcept} % Pm_traits

View File

@ -11,17 +11,17 @@
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
\begin {ccRefClass} {Pm_straight_exact_traits<R>}
\begin {ccRefClass} {Pm_straight_traits_2<R>}
%\ccDefinition
The class \ccStyle{Pm_straight_exact_traits<R>}
The class \ccStyle{Pm_straight_traits_2<R>}
is used as the recommended class. To avoid robustness problems,
the representation type \ccStyle{R} must be an exact type such as
\ccStyle{Cartesian<leda_rational>},
\ccStyle{Homogeneous<leda_integer>} or any other exact type,
although other representation types could be used at the user's own risk.
\ccInclude{ CGAL/Pm_straight_exact_traits.h}
\ccInclude{CGAL/Pm_straight_traits_2.h}
\ccIsModel
\ccc{PlanarMapBoundingBox_2_traits}\\
@ -36,10 +36,10 @@
% \ccCreation
% \ccCreationVariable{T_exact}
% \ccConstructor{Pm_straight_exact_traits();}
% \ccConstructor{Pm_straight_traits_2();}
% {}
\end{ccRefClass} % Pm_straight_exact_traits
\end{ccRefClass} % Pm_straight_traits_2
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
\ccRefPageEnd

View File

@ -431,7 +431,7 @@ significantly reduces running time.
\ccRefIdfierPage{CGAL::Pm_dcel<V,H,F>}\\
\ccRefIdfierPage{CGAL::Pm_segment_traits_2<R>}\\
\ccRefIdfierPage{CGAL::Pm_leda_segment_traits_2}\\
\ccRefIdfierPage{CGAL::Pm_straight_exact_traits<R>}\\
\ccRefIdfierPage{CGAL::Pm_straight_traits_2<R>}\\
\ccRefIdfierPage{CGAL::File_header}\\
\ccRefIdfierPage{CGAL::Pm_file_scanner<Planar_map>}\\
\ccRefIdfierPage{CGAL::Pm_file_writer<Planar_map>}\\

View File

@ -15,9 +15,8 @@
// source :
// revision :
// revision_date :
// author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
//
//
// author(s) : Oren Nechushtan
// Shai Hirsch <shaihi@post.tau.ac.il>
//
// coordinator : Tel-Aviv University (Dan Halperin <halperin@math.tau.ac.il>)
//
@ -26,131 +25,7 @@
#ifndef CGAL_IO_PM_STRAIGHT_EXACT_TRAITS_STREAM_H
#define CGAL_IO_PM_STRAIGHT_EXACT_TRAITS_STREAM_H
#ifndef CGAL_PM_STRAIGHT_EXACT_TRAITS_H
#include <CGAL/Pm_straight_exact_traits.h>
#endif
#ifndef CGAL_LEDA_WINDOW_H
#include <CGAL/IO/leda_window.h>
#endif
CGAL_BEGIN_NAMESPACE
template <class R>
leda_window& operator<<(leda_window& os,const Straight_2_<R>& cv)
{
typedef Straight_2_<R> Straight;
switch(cv.current_state())
{
case Straight::EMPTY:
return os;
case Straight::POINT:
{
Point_2<R> p;
cv.current(p);
return os << p;
}
case Straight::SEGMENT:
{
Segment_2<R> seg;
cv.current(seg);
return os << seg;
}
case Straight::RAY:
{
Ray_2<R> ray;
cv.current(ray);
return os << ray;
}
case Straight::LINE:
{
Line_2<R> line;
cv.current(line);
return os << line;
}
}
CGAL_assertion_msg(
cv.current_state()==Straight::EMPTY||
cv.current_state()==Straight::POINT||
cv.current_state()==Straight::SEGMENT||
cv.current_state()==Straight::RAY||
cv.current_state()==Straight::LINE,
"\nUnknown type in leda_window& operator<<(leda_window& os,\
const Straight& cv)");
return os;
}
template <class R>
leda_window& operator>>(leda_window& os,const Straight_2_<R>& cv)
{
typedef Straight_2_<R> Straight;
switch(cv.current_state())
{
case Straight::EMPTY:
return os;
case Straight::POINT:
{
Point_2<R> p;
cv.current(p);
return os >> p;
}
case Straight::SEGMENT:
{
Segment_2<R> seg;
cv.current(seg);
return os >> seg;
}
case Straight::RAY:
{
Ray_2<R> ray;
cv.current(ray);
return os >> ray;
}
case Straight::LINE:
{
Line_2<R> line;
cv.current(line);
return os >> line;
}
}
CGAL_assertion_msg(
cv.get_type()==Straight::EMPTY||
cv.get_type()==Straight::POINT||
cv.get_type()==Straight::SEGMENT||
cv.get_type()==Straight::RAY||
cv.get_type()==Straight::LINE,
"\nUnknown type in leda_window& operator>>(leda_window& os,"
<< "const Straight& cv)");
return os;
}
template <class R>
Window_stream& write(
Window_stream& os,
const typename Pm_straight_exact_traits<R>::X_curve& cv,
const Pm_straight_exact_traits<R>& traits)
{
typedef Pm_straight_exact_traits<R> Traits;
typedef typename Traits::X_bounded_curve X_bounded_curve;
return os << X_bounded_curve(
traits.curve_source(cv),
traits.curve_target(cv));
}
CGAL_END_NAMESPACE
#include <CGAL/IO/Pm_straight_traits_2_Window_stream.h>
#endif // CGAL_IO_PM_STRAIGHT_EXACT_TRAITS_STREAM_H
// EOF

View File

@ -0,0 +1,140 @@
// ============================================================================
//
// Copyright (c) 1997 The CGAL Consortium
//
// This software and related documentation is part of an INTERNAL release
// of the Computational Geometry Algorithms Library (CGAL). It is not
// intended for general use.
//
// ----------------------------------------------------------------------------
//
// release :
// release_date :
//
// file : include/CGAL/IO/Pm_straight_traits_2_Window_stream.h
// source :
// revision :
// revision_date :
// author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// Shai Hirsch <shaihi@post.tau.ac.il>
//
// coordinator : Tel-Aviv University (Dan Halperin <halperin@math.tau.ac.il>)
//
// Chapter :
// ============================================================================
#ifndef CGAL_IO_PM_STRAIGHT_TRAITS_2_WINDOW_STREAM_H
#define CGAL_IO_PM_STRAIGHT_TRAITS_2_WINDOW_STREAM_H
#ifndef CGAL_PM_STRAIGHT_TRAITS_2_H
#include <CGAL/Pm_straight_traits_2.h>
#endif
#ifndef CGAL_CGAL_WINDOW_H
#include <CGAL/IO/cgal_window.h>
#endif
CGAL_BEGIN_NAMESPACE
template <class R>
CGAL::window& operator<<(CGAL::window& os,const Straight_2_<R>& cv)
{
typedef Straight_2_<R> Straight;
switch(cv.current_state())
{
case Straight::EMPTY:
return os;
case Straight::POINT:
{
Point_2<R> p;
cv.current(p);
return os << p;
}
case Straight::SEGMENT:
{
Segment_2<R> seg;
cv.current(seg);
return os << seg;
}
case Straight::RAY:
{
Ray_2<R> ray;
cv.current(ray);
return os << ray;
}
case Straight::LINE:
{
Line_2<R> line;
cv.current(line);
return os << line;
}
}
CGAL_assertion_msg(
cv.current_state()==Straight::EMPTY||
cv.current_state()==Straight::POINT||
cv.current_state()==Straight::SEGMENT||
cv.current_state()==Straight::RAY||
cv.current_state()==Straight::LINE,
"\nUnknown type in CGAL::window& operator<<(CGAL::window& os,\
const Straight& cv)");
return os;
}
template <class R>
CGAL::window& operator>>(CGAL::window& os,const Straight_2_<R>& cv)
{
typedef Straight_2_<R> Straight;
switch(cv.current_state())
{
case Straight::EMPTY:
return os;
case Straight::POINT:
{
Point_2<R> p;
cv.current(p);
return os >> p;
}
case Straight::SEGMENT:
{
Segment_2<R> seg;
cv.current(seg);
return os >> seg;
}
case Straight::RAY:
{
Ray_2<R> ray;
cv.current(ray);
return os >> ray;
}
case Straight::LINE:
{
Line_2<R> line;
cv.current(line);
return os >> line;
}
}
CGAL_assertion_msg(
cv.get_type()==Straight::EMPTY||
cv.get_type()==Straight::POINT||
cv.get_type()==Straight::SEGMENT||
cv.get_type()==Straight::RAY||
cv.get_type()==Straight::LINE,
"\nUnknown type in CGAL::window& operator>>(CGAL::window& os,"
<< "const Straight& cv)");
return os;
}
template <class R>
Window_stream& write(
Window_stream& os,
const typename Pm_straight_traits_2<R>::X_curve& cv,
const Pm_straight_traits_2<R>& traits)
{
typedef Pm_straight_traits_2<R> Traits;
typedef typename Traits::X_bounded_curve X_bounded_curve;
return os << X_bounded_curve(
traits.curve_source(cv),
traits.curve_target(cv));
}
CGAL_END_NAMESPACE
#endif // CGAL_IO_PM_STRAIGHT_TRAITS_2_WINDOW_STREAM_H
// EOF

View File

@ -33,26 +33,26 @@ Bounding_box_base* init_default_bounding_box(T_*) const
#ifdef CGAL_PM_STRAIGHT_EXACT_TRAITS_H
template <class R_>
Bounding_box_base* init_default_bounding_box(Pm_straight_exact_traits<R_>*)
Bounding_box_base* init_default_bounding_box(Pm_straight_traits_2<R_>*)
const
{
return new Pm_dynamic_open_bounding_box<Self>;
}
template <class R_>
Bounding_box_base*
init_default_bounding_box(const Pm_straight_exact_traits<R_>*)
init_default_bounding_box(const Pm_straight_traits_2<R_>*)
const
{
return new Pm_dynamic_open_bounding_box<Self>;
}
template <class R_>
Bounding_box_base* init_default_bounding_box(Pm_straight_exact_traits<R_>*)
Bounding_box_base* init_default_bounding_box(Pm_straight_traits_2<R_>*)
{
return new Pm_dynamic_open_bounding_box<Self>;
}
template <class R_>
Bounding_box_base*
init_default_bounding_box(const Pm_straight_exact_traits<R_>*)
init_default_bounding_box(const Pm_straight_traits_2<R_>*)
{
return new Pm_dynamic_open_bounding_box<Self>;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
// ============================================================================
//
// Copyright (c) 1997 The CGAL Consortium
//
// This software and related documentation is part of an INTERNAL release
// of the Computational Geometry Algorithms Library (CGAL). It is not
// intended for general use.
//
// ----------------------------------------------------------------------------
//
// release :
// release_date :
//
// file : include/CGAL/Pm_straight_traits_2.C
// source :
// revision :
// revision_date :
// author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
//
//
//
// coordinator : Tel-Aviv University (Dan Halperin <halperin@math.tau.ac.il>)
//
// Chapter :
// ============================================================================
#ifndef CGAL_PM_STRAIGHT_TRAITS_2_C
#define CGAL_PM_STRAIGHT_TRAITS_2_C
#ifndef CGAL_PM_STRAIGHT_TRAITS_2_H
#include <CGAL/Pm_straight_traits_2.h>
#endif
CGAL_BEGIN_NAMESPACE
template <class R_>
const typename Pm_straight_traits_2<R_>::Bounding_box
Pm_straight_traits_2<R_>::unbounded_box()
{
static const typename Pm_straight_traits_2<R_>::Bounding_box
unbounded_box_;
return unbounded_box_;
}
template <class R_>
const typename Pm_straight_traits_2<R_>::Bounding_box
Pm_straight_traits_2<R_>::unbounded_box_;
// unbounded_box_ initialized to default Bounding_box
CGAL_END_NAMESPACE
#endif // CGAL_PM_STRAIGHT_TRAITS_2_C
// EOF

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
// - 8 : TestrepH
// tests 01-04 use Pm_segment_traits_2
// test 05 uses Pm_straight_exact_traits_2
// test 05 uses Pm_straight_traits_2
// A default TESTR is was not set yet
#ifndef TESTR
@ -125,10 +125,3 @@ void usage(){
std::cout << "Test is not performed.\n";
}
#endif

View File

@ -9,7 +9,7 @@
#include <CGAL/Pm_default_dcel.h>
#include <CGAL/Planar_map_2.h>
#include <CGAL/IO/Straight_2_stream.h>
#include <CGAL/Pm_straight_exact_traits.h>
#include <CGAL/Pm_straight_traits_2.h>
#if STRATEGY == 2
#include <CGAL/Pm_naive_point_location.h>