cgal/Packages/Polygon/changes.txt

373 lines
14 KiB
Plaintext

//-----------------------------------------------------------------------//
// 2.10
+ Removed test of old-fashioned stl functionality (value_type,
iterator_category and distance_type functions) from test.
+ Removed include file guards.
//-----------------------------------------------------------------------//
// 2.9.1
+ Added a typename in Polygon_2_algorithms.C
//-----------------------------------------------------------------------//
// 2.9
+ Demo checks if LEDA is available. If not, it compiles but just gives
an informative message at runtime.
+ Adapted template parameter names in CGAL/Polygon_2.C.
//-----------------------------------------------------------------------//
// 2.8.2
+ Slight change to the documentation.
//-----------------------------------------------------------------------//
// 2.8.1
+ Added typedef for pointer, reference and const_reference in Polygon.
+ Renamed some template parameters (reserved names).
//-----------------------------------------------------------------------//
// 2.8
+Updated demo directory
- new makefile
- std:: prefixes
- display() called for window.
//-----------------------------------------------------------------------//
// 2.7
+Made some adaptations for compilation under Borland.
In CGAL/Polygon_2_algorithms.C:
- used iterator instead of const_iterator for index of
Simplicity_test_2::SweepStatus.
- Altered the declaration of area_2 a bit and moved it to the .h file
(to please MSVC, which doesn't recognise the forward declaration otherwise)
+Added a typedef of FT to example CustomPoint2.C
//-----------------------------------------------------------------------//
// 2.6
+Added std:: in several places in the testsuite.
+Removed constructor that takes a circulator as parameter. MSVC and egcs
had problems with this one in combination with the copy constructor.
//-----------------------------------------------------------------------//
// 2.5
+Added constructor that takes a circulator as parameter
//-----------------------------------------------------------------------//
// 2.4.8
+Added CGAL qualification to Less_xy_2
+Added std qualification to endl
//-----------------------------------------------------------------------//
// Changes in 2.4.8:
//-----------------------------------------------------------------------//
Some small fixes for getting things out of std (istream, ostream, endl).
//-----------------------------------------------------------------------//
// Changes in 2.4.7:
//-----------------------------------------------------------------------//
Added operator != to Polygon_2_edge_iterator.h
//-----------------------------------------------------------------------//
// Changes in 2.4.6:
//-----------------------------------------------------------------------//
Adapted the documentation.
//-----------------------------------------------------------------------//
// Changes in 2.4.5:
//-----------------------------------------------------------------------//
Incorporated the editorial changes of release 1.2 in the doc.
//-----------------------------------------------------------------------//
// Changes in 2.4.4:
//-----------------------------------------------------------------------//
Removed CGAL prefix in documentation
//-----------------------------------------------------------------------//
// Changes in 2.4:
//-----------------------------------------------------------------------//
Added operator != in Polygon_2_edge_circulator.
Aded an explicit namespace CGAL in Polygon_traits_2.h.
//-----------------------------------------------------------------------//
// Changes in 2.3:
//-----------------------------------------------------------------------//
Now the examples and demo are also converted to namespace CGAL.
//-----------------------------------------------------------------------//
// Changes from 2.1 to 2.2:
//-----------------------------------------------------------------------//
Further changes to support namespace CGAL.
//-----------------------------------------------------------------------//
// Changes from 2.0 to 2.1:
//-----------------------------------------------------------------------//
New polygon_assertions.h, generated by the new script (CGAL namespace proof).
Replaced #include <CGAL/std/...> by #include <...>
Replaced CGAL_STD by std.
//-----------------------------------------------------------------------//
// Changes from 1.13 to 2.0:
//-----------------------------------------------------------------------//
Added support for namespace CGAL in the source and test files.
Removed distance_type and value_type in Polygon_2_edge_circulator.h.
//-----------------------------------------------------------------------//
// Changes from 1.12 to 1.13:
//-----------------------------------------------------------------------//
Guarded definition of iterator_category
in include/CGAL/Polygon_2_edge_circulator.h and
include/CGAL/Polygon_2_edge_iterator.h
by the flag CGAL_CFG_NO_ITERATOR_TRAITS.
If iterator_traits are available, this definition
is not necessary, as it is provided by a template.
//-----------------------------------------------------------------------//
// Changes from 1.9 to 1.10:
//-----------------------------------------------------------------------//
-> renamed transform to CGAL_transform
-> removed comments ending with '\'
// Changes in 1.9
-> solved three further typename problems for SGI CC 7.2 in the testsuite.
//-----------------------------------------------------------------------//
// Changes from 1.8 to 1.8a:
//-----------------------------------------------------------------------//
-> solved a typename problem for the SGI CC 7.2 compiler
//-----------------------------------------------------------------------//
// Changes from 1.7 to 1.8:
//-----------------------------------------------------------------------//
-> lines longer than 80 characters were corrected (except for assertions)
//-----------------------------------------------------------------------//
// Changes from 1.6 to 1.7:
//-----------------------------------------------------------------------//
-> some minor modifications to documentation
-> typedef for value_type added (necessary for back insert iterators)
//-----------------------------------------------------------------------//
// Changes from 1.5 to 1.6:
//-----------------------------------------------------------------------//
To make the polygon code now compile with egcs the following needs
to be done:
1) the flag -ftemplate-depth-NN has to be increased (for example to 25)
2) the file circulator needs a few adaptations for egcs
-> added the keyword typename (for egcs)
-> moved the edge circulator to a separate file
-> removed some predicates from the traits class
-> added a graphical demo program
-> added polygon assertions/preconditions
-> updated the documentation
//-----------------------------------------------------------------------//
// Changes from 1.4 to 1.5:
//-----------------------------------------------------------------------//
N.B. This is an intermediary release! The main purpose is to repair
the errors in the custom points example programs.
-> some additional test progams were added (not completely finished)
-> removed the method append
-> the method insert(position, first, last) is now only available if a compiler
supports member templates
-> the custom point programs now compile on SGI C++ 4.0 and g++ 2.7.2 using
a new workaround flag CGAL_CFG_NO_TEMPLATE_FUNCTION_MATCHING
-> I have changed a few predicates in the traits class to make the simplicity
test more robust
//-----------------------------------------------------------------------//
// Changes from 1.3 to 1.4:
//-----------------------------------------------------------------------//
Removed a bug in the simplicity test. There was an error in the comparison
of two edges in the following special case:
+
e1 /
/
/
-----------------+---------+-------------- sweepline
e2
In this case the edge compare function returned
EdgeCompare(e1,e2) == true
EdgeCompare(e2,e1) == true
which may lead to inconsistencies in the sweep status.
//-----------------------------------------------------------------------//
// Changes from 1.2 to 1.3:
//-----------------------------------------------------------------------//
I have done result some experiments with defining a traits class with custom
points. As a result the traits class requirements have been adapted slightly.
Also some methods from the Polygon_2 class have been removed:
- the constructors for Point_2, Segment_2, Triangle_2 and Iso_rectangle_2
- the transform method
Using custom point types
------------------------
I have distinguished two ways of defining a custom point:
I) deriving from CGAL_Point_2<R>
II) using your own point type
The first way should of course be possible. To make this easy for the user, a
default traits class with a template parameter Point should be provided.
I think that the second way should also be possible, but I'm not sure if this
is the general opinion in CGAL. To enable this, the code may not rely directly
on CGAL types and CGAL predicates. All these types and predicates must be
put in the traits class.
These were my experiences:
1) When I define my own point type, I lose virtually all kernel types
and predicates. This means that I have to redefine and reimplement
all types and predicates in the traits class (Vector, Segment,
do_intersect() etc.).
It would be nice if I could reuse some of the kernel types and predicates.
This would have been easier if the kernel was designed like this
template <class Point> class Segment_2
template <class Point> do_intersect(const Segment_2<Point>& p1, const Segment_2<Point>& p2)
instead of
template <class R> class Segment_2
template <class R> do_intersect(const Segment_2<R>& p1, const Segment_2<R>& p2)
2) If the traits class uses many other types (Iso_rectangle, Aff_transformation_2,
Triangle_2, CGAL_Bbox_2, ...) then I have to plug in something for these types.
When I create my own traits class I really don't want to do this.
Therefore I decided to remove most of these types (and the corresponding methods)
from the polygon traits class. Only the really necessary types (Point_2, Vector_2
and Segment_2) are still present.
3) I cannot get it to work for g++ 2.7.2, for two reasons:
- the 'lazy instantiation bug' of g++ causes a problems: all methods that require
a representation type R [like transform(CGAL_Aff_transformation_2<R>&)] cannot
be used, since the g++ compiler tries to instantiate them
- even if all these methods are removed a type unification problem remains
that I don't know how to solve (this happens also when I derive a point from
CGAL_Point_2<R>)
On SGI C++ 4.0 it compiles without any problems.
4) I had to put some extra predicates in the traits class, to make the code
independent from the CGAL kernel (the predicates 'sign' and 'equal_direction').
Furthermore I decided to change the predicate
do_intersect(const Segment_2&, const Segment_2&)
into
do_intersect(const Point_2&, const Point_2&, const Point_2&, const Point_2&),
to decrease the requirements on the type Segment_2.
5) When I use my own point type, I don't want to include <CGAL/Cartesian.h>
or <CGAL/Homogeneous.h>. This is not possible. The obvious solution
(#define CGAL_REP_CLASS_DEFINED) doesn't work.
Version 1.3 contains two test programs (Polygon1.C and Polygon2.C) with
custom point types. These programs do not compile with g++ 2.7.2!
//-----------------------------------------------------------------------//
// Changes from 1.1 to 1.2:
//-----------------------------------------------------------------------//
-> <CGAL/config.h> is removed again
-> some compiler flags are updated
//-----------------------------------------------------------------------//
// Changes from 1.0 to 1.1:
//-----------------------------------------------------------------------//
-> the polygon code is now divided over three files:
- Polygon_2.h
- Polygon_2_edge_iterator.h
- Polygon_2_algorithms.h
-> the following random access methods were added:
const Point_2& vertex(int i) const
Point_2& vertex(int i)
const Point_2& operator[](int i) const
Point_2& operator[](int i)
Segment_2 edge(int i) const
These methods are only available for compilers that instantiate
templates when needed. For example the Gnu g++ 2.7.2 does not comply
to this.
-> a typedef problem for Sun C++ 4.2 is solved
-> for the moment a new version of <CGAL/config.h> is added to the
polygon code; this is needed for the flags CGAL_CFG_NO_MEMBER_TEMPLATES
and CGAL_CFG_NO_LAZY_INSTANTIATION
this file will be removed in the future
-> the documentation is not up to date yet!
//-----------------------------------------------------------------------//
// Changes from 0.9 to 1.0:
//-----------------------------------------------------------------------//
-> bug fix in area computation
-> the method 'append' is now called 'push_back'
-> the polygon now uses a traits class
-> support for Window_stream will be in the next version of Window_stream.h
The following lines should be added to this file:
//-----------------------------------------------------------------------//
#ifdef CGAL_POLYGON_2_H
#ifndef CGAL_WINDOW_STREAM_POLYGON_2_H
#define CGAL_WINDOW_STREAM_POLYGON_2_H
template < class I, class C >
CGAL_Window_stream&
operator<<(CGAL_Window_stream& os,
const CGAL_Polygon_2<I,C> &P)
{
typedef CGAL_Polygon_2<I,C>::Edge_const_circulator Edge_circ;
Edge_circ edge_circ = P.edges_circulator();
if ( edge_circ != NULL) {
Edge_circ end_circ = edge_circ;
do {
os << *edge_circ;
os << (*edge_circ).source();
++edge_circ;
} while ( edge_circ != end_circ);
}
return os;
}
#endif // CGAL_WINDOW_STREAM_POLYGON_2_H
#endif // CGAL_POLYGON_2_H
//-----------------------------------------------------------------------//