merge from next

This commit is contained in:
Sébastien Loriot 2011-05-24 12:37:18 +00:00
commit 5cbde64da7
48 changed files with 1792 additions and 653 deletions

5
.gitattributes vendored
View File

@ -266,8 +266,6 @@ Approximate_min_ellipsoid_d/documentation/boundingbox.mw -text svneol=native#app
Arithmetic_kernel/include/CGAL/CORE_arithmetic_kernel.h -text
Arithmetic_kernel/include/CGAL/GMP_arithmetic_kernel.h -text
Arithmetic_kernel/include/CGAL/LEDA_arithmetic_kernel.h -text
Arithmetic_kernel/include/CGAL/OLD/GMP/Gmpfr_interval_type.h -text
Arithmetic_kernel/include/CGAL/OLD/Gmpfr_interval.h -text
Arithmetic_kernel/package_info/Arithmetic_kernel/description.txt -text
Arithmetic_kernel/package_info/Arithmetic_kernel/maintainer -text
Arithmetic_kernel/test/Arithmetic_kernel/Arithmetic_kernel.cpp -text
@ -1378,6 +1376,8 @@ Envelope_3/test/Envelope_3/data/spheres/stest6.cin -text
Envelope_3/test/Envelope_3/data/spheres/stest7.cin -text
Envelope_3/test/Envelope_3/data/spheres/stest8.cin -text
Envelope_3/test/Envelope_3/data/spheres/stest9.cin -text
Envelope_3/test/Envelope_3/data/triangles/edge_bug.cin -text
Envelope_3/test/Envelope_3/data/triangles/edge_bug_all.cin -text
Envelope_3/test/Envelope_3/data/triangles/grid_inter_tri_const_envelope.cin -text
Envelope_3/test/Envelope_3/data/triangles/grid_inter_tri_const_envelope_40.cin -text
Envelope_3/test/Envelope_3/data/triangles/grid_intersecting_triangles.cin -text
@ -3189,6 +3189,7 @@ Scripts/developer_scripts/check_library_uses_no_qpl_files.exceptions -text
Scripts/developer_scripts/check_macro_names -text
Scripts/developer_scripts/check_no_CGAL_USE_without_includes_before -text
Scripts/developer_scripts/check_svn_keywords -text
Scripts/developer_scripts/clean_up_branch.sh -text
Scripts/developer_scripts/common_impl.rb -text
Scripts/developer_scripts/create_assertions.sh eol=lf
Scripts/developer_scripts/create_cgal_test -text

View File

@ -402,8 +402,10 @@ void MainWindow::on_actionRefine_loop_triggered()
void MainWindow::on_actionSave_snapshot_triggered()
{
// save snapshot to file
QApplication::setOverrideCursor(Qt::WaitCursor);
m_pViewer->saveSnapshot(QString("snapshot.png"));
QString filename = QFileDialog::getSaveFileName(this,tr("Save snapshot to file..."),"snapshot00.png","*.png");
m_pViewer->saveSnapshot(filename);
QApplication::restoreOverrideCursor();
}
void MainWindow::on_actionCopy_snapshot_triggered()

View File

@ -45,7 +45,7 @@ isolator<Polynomial_>::operator()(const Polynomial_ &p,unsigned int prec){
CGAL_error_msg(
"isolator not implemented for this type of polynomials");
return std::vector<Gmpfi>();
};
}
template <>
inline std::vector<Gmpfi>
@ -69,7 +69,7 @@ isolator<Polynomial<Gmpz> >::operator()(const Polynomial<Gmpz> &p,
intervals.push_back(Gmpfi(intervals_mpfi[j]));
free(intervals_mpfi);
return intervals;
};
}
} // namespace RS

View File

@ -1,166 +0,0 @@
// TODO: add sign to RET
#ifndef CGAL_GMPFR_INTERVAL_TYPE_H
#define CGAL_GMPFR_INTERVAL_TYPE_H
#include <CGAL/basic.h>
#include <CGAL/Gmpfr.h>
#include <boost/numeric/interval.hpp>
#define OP(o,d) Gmpfr r; \
mpfr_ ## o (r.fr(), a.fr(), b.fr(), GMP_RND ## d); \
return r;
namespace CGAL {
namespace internal {
struct Rounding_for_gmpfr {
private: typedef CGAL::Gmpfr T;
public:
Rounding_for_gmpfr(){};
~Rounding_for_gmpfr(){};
T conv_down(const T& a){ // TODO: fix this
return add_down(T(0),a);
};
T conv_up (const T& a){ // TODO: fix this
return add_up(T(0),a);
};
// mathematical operations
T add_down(const T& a, const T& b) {
OP(add,D);
};
T add_up (const T& a, const T& b){
OP(add,U);
};
T sub_down(const T& a, const T& b){
OP(sub,D);
};
T sub_up (const T& a, const T& b){
OP(sub,U);
};
T mul_down(const T& a, const T& b){
OP(mul,D);
};
T mul_up (const T& a, const T& b){
OP(mul,U);
};
T div_down(const T& a, const T& b){
OP(div,D);
};
T div_up (const T& a, const T& b){
OP(div,U);
};
T sqrt_down(const T& a){
T b;
mpfr_sqrt(b.fr(), a.fr(), GMP_RNDD);
return b;
};
T sqrt_up (const T& a){
T b;
mpfr_sqrt(b.fr(), a.fr(), GMP_RNDU);
return b;
};
T median(const T& a, const T& b) {
T result(a + (b-a)/2);
CGAL_postcondition(a <= result);
CGAL_postcondition(result <= b);
return result;
};
T int_down(const T& a) {
T r;
mpfr_floor(r.fr(), a.fr());
return r;
};
T int_up (const T& a) {
T r;
mpfr_ceil(r.fr(), a.fr());
return r;
};
};
class Checking_for_gmpfr {
typedef CGAL::Gmpfr T;
public:
static T pos_inf() {
T b;
mpfr_set_inf(b.fr(), 1);
return b;
}
static T neg_inf() {
T b;
mpfr_set_inf(b.fr(), -1);
return b;
}
static T nan() {
T b;
mpfr_set_nan(b.fr());
return b;
}
static bool is_nan(const T& b) {
return mpfr_nan_p(b.fr());
}
static T empty_lower() {
return T(1);
}
static T empty_upper() {
return T(0);
}
static bool is_empty(const T& a, const T& b) {
// return a==T(1) && b == T(0);
// return false;
return a > b; // TODO: optimize this
}
};
} // namespace internal
} //namespace CGAL
namespace boost {
namespace numeric {
inline
std::ostream& operator <<
(std::ostream& os, const boost::numeric::interval<CGAL::Gmpfr>& x)
{
os << "["
<< x.lower() << ", " << x.upper() << "]";
return os;
}
}//namespace numeric
}//namespace boost
namespace CGAL {
typedef boost::numeric::interval<
Gmpfr,
boost::numeric::interval_lib::policies
< internal::Rounding_for_gmpfr, internal::Checking_for_gmpfr > >
Gmpfr_interval;
// I have to redfine these operators, since the test reports an
// ambiguity with operators in CGAL::Polynomial
// However, it seems that this is due to the use of struct interval_holder
// in the definition of the operators in boost.
inline bool operator == (const Gmpfr_interval& x , const Gmpfr_interval& y)
{return x.operator==(y) ;}
} //namespace CGAL
//#endif // CGAL_USE_LEDA
#undef OP
#endif // CGAL_GMPFR_INTERVAL_TYPE_H

View File

@ -1,336 +0,0 @@
// Copyright (c) 2008 Max-Planck-Institute Saarbruecken (Germany),
// National University of Athens (Greece).
// Copyright (c) 2009 Max-Planck-Institute Saarbruecken (Germany).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
// Author(s) : George Tzoumas <geotz@di.uoa.gr>,
// Michael Hemmer <hemmer@mpi-inf.mpg.de>
//
// ============================================================================
//
// \brief provide CGAL support for class CGAL::Gmpfr_interval.
//
#ifndef CGAL_GMPFR_INTERVAL_H
#define CGAL_GMPFR_INTERVAL_H
#include <CGAL/basic.h>
#include <CGAL/Gmpz.h>
#include <CGAL/Gmpq.h>
#include <CGAL/Gmpfr.h>
#include <CGAL/GMP/Gmpfr_interval_type.h>
#include <CGAL/Interval_traits.h>
#include <CGAL/Bigfloat_interval_traits.h>
namespace CGAL {
template <> class Algebraic_structure_traits< Gmpfr_interval >
: public Algebraic_structure_traits_base < Gmpfr_interval,
Field_with_sqrt_tag >{
public:
typedef Tag_false Is_exact;
typedef Tag_true Is_numerical_sensitive;
class Sqrt
: public std::unary_function< Type, Type > {
public:
Type operator()( const Type& x ) const {
return ::boost::numeric::sqrt(x);
}
};
};
template <> class Real_embeddable_traits< Gmpfr_interval >
: public INTERN_RET::Real_embeddable_traits_base<Gmpfr_interval, CGAL::Tag_true> {
public:
class Abs
: public std::unary_function< Type, Type > {
public:
Type operator()( const Type& x ) const {
return ::boost::numeric::abs(x);
}
};
class To_double
: public std::unary_function< Type, double > {
public:
double operator()( const Type& x ) const {
return ::boost::numeric::median(x).to_double();
}
};
class To_interval
: public std::unary_function< Type, std::pair< double, double > > {
public:
std::pair<double, double> operator()( const Type& x ) const {
std::pair<double, double> lower_I(x.lower().to_interval());
std::pair<double, double> upper_I(x.upper().to_interval());
return std::pair< double, double >(
(CGAL::min)(lower_I.first , upper_I.first ),
(CGAL::max)(lower_I.second, upper_I.second));
}
};
};
template<>
class Interval_traits<Gmpfr_interval>
{
public:
typedef Interval_traits<Gmpfr_interval> Self;
typedef Gmpfr_interval Interval;
typedef CGAL::Gmpfr Bound;
typedef CGAL::Tag_true With_empty_interval;
typedef CGAL::Tag_true Is_interval;
struct Construct :public std::binary_function<Bound,Bound,Interval>{
Interval operator()( const Bound& l,const Bound& r) const {
CGAL_precondition( l < r );
return Interval(l,r);
}
};
struct Lower :public std::unary_function<Interval,Bound>{
Bound operator()( const Interval& a ) const {
return a.lower();
}
};
struct Upper :public std::unary_function<Interval,Bound>{
Bound operator()( const Interval& a ) const {
return a.upper();
}
};
struct Width :public std::unary_function<Interval,Bound>{
Bound operator()( const Interval& a ) const {
return ::boost::numeric::width(a);
}
};
struct Median :public std::unary_function<Interval,Bound>{
Bound operator()( const Interval& a ) const {
return ::boost::numeric::median(a);
}
};
struct Norm :public std::unary_function<Interval,Bound>{
Bound operator()( const Interval& a ) const {
return ::boost::numeric::norm(a);
}
};
struct Empty :public std::unary_function<Interval,bool>{
bool operator()( const Interval& a ) const {
return ::boost::numeric::empty(a);
}
};
struct Singleton :public std::unary_function<Interval,bool>{
bool operator()( const Interval& a ) const {
return ::boost::numeric::singleton(a);
}
};
struct Zero_in :public std::unary_function<Interval,bool>{
bool operator()( const Interval& a ) const {
return ::boost::numeric::in_zero(a);
}
};
struct In :public std::binary_function<Bound,Interval,bool>{
bool operator()( Bound x, const Interval& a ) const {
return ::boost::numeric::in(x,a);
}
};
struct Equal :public std::binary_function<Interval,Interval,bool>{
bool operator()( const Interval& a, const Interval& b ) const {
return ::boost::numeric::equal(a,b);
}
};
struct Overlap :public std::binary_function<Interval,Interval,bool>{
bool operator()( const Interval& a, const Interval& b ) const {
return ::boost::numeric::overlap(a,b);
}
};
struct Subset :public std::binary_function<Interval,Interval,bool>{
bool operator()( const Interval& a, const Interval& b ) const {
return ::boost::numeric::subset(a,b);
}
};
struct Proper_subset :public std::binary_function<Interval,Interval,bool>{
bool operator()( const Interval& a, const Interval& b ) const {
return ::boost::numeric::proper_subset(a,b);
}
};
struct Hull :public std::binary_function<Interval,Interval,Interval>{
Interval operator()( const Interval& a, const Interval& b ) const {
return ::boost::numeric::hull(a,b);
}
};
struct Intersection :public std::binary_function<Interval,Interval,Interval>{
Interval operator()( const Interval& a, const Interval& b ) const {
Interval r = ::boost::numeric::intersect(a,b);
return r;
}
};
};
template<>
class Bigfloat_interval_traits<Gmpfr_interval>:
public Interval_traits<Gmpfr_interval>
{
public:
typedef Gmpfr_interval NT;
typedef CGAL::Gmpfr BF;
struct Get_significant_bits: public std::unary_function<NT,long>{
long operator()( NT x) const {
if(CGAL::zero_in(x)) return -1;
BF labs = CGAL::lower(CGAL::abs(x)) ;
BF w = CGAL::width(x);
BF err;
mpfr_div(err.fr(), w.fr(), labs.fr(), GMP_RNDU);
mpfr_log2(err.fr(), err.fr(), GMP_RNDD);
return -mpfr_get_si(err.fr(), GMP_RNDU);
}
};
struct Set_precision {
// type for the \c AdaptableUnaryFunction concept.
typedef long argument_type;
// type for the \c AdaptableUnaryFunction concept.
typedef long result_type;
long operator()( long prec ) const {
long old_prec = mpfr_get_default_prec();
// std::cerr << "precision set to " << prec << " from " << old_prec << std::endl;
mpfr_set_default_prec(prec);
return old_prec;
}
};
struct Get_precision {
// type for the \c AdaptableGenerator concept.
typedef long result_type;
long operator()() const {
return mpfr_get_default_prec();
}
};
};
//Gmp internal coercions:
CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(Gmpfr_interval)
// The following definitions reflect the interaction of the Gmpfr
// built in types :
CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short ,Gmpfr_interval)
CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int ,Gmpfr_interval)
CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long ,Gmpfr_interval)
CGAL_DEFINE_COERCION_TRAITS_FROM_TO(float ,Gmpfr_interval)
CGAL_DEFINE_COERCION_TRAITS_FROM_TO(double ,Gmpfr_interval)
template <>
struct Coercion_traits<CGAL::Gmpfr_interval, CGAL::Gmpz>{
typedef Tag_true Are_explicit_interoperable;
typedef Tag_false Are_implicit_interoperable;
typedef CGAL::Gmpfr_interval Type;
struct Cast{
typedef Type result_type;
Type operator()(const CGAL::Gmpfr_interval& x) const { return x;}
Type operator()(const CGAL::Gmpz x) const {
CGAL::Gmpfr lower, upper;
mpfr_set_z (lower.fr(), x.mpz(), GMP_RNDD);
mpfr_set_z (upper.fr(), x.mpz(), GMP_RNDU);
Type bfi(lower, upper);
CGAL_postcondition( bfi.lower() <= x );
CGAL_postcondition( bfi.upper() >= x );
return bfi;
}
};
};
template <> // mirror
struct Coercion_traits<CGAL::Gmpz,CGAL::Gmpfr_interval>
:public Coercion_traits<CGAL::Gmpfr_interval, CGAL::Gmpz>{};
template <>
struct Coercion_traits<CGAL::Gmpfr_interval, CGAL::Gmpq>{
typedef Tag_true Are_explicit_interoperable;
typedef Tag_false Are_implicit_interoperable;
typedef CGAL::Gmpfr_interval Type;
typedef Coercion_traits<CGAL::Gmpfr_interval, CGAL::Gmpz> CTZ;
struct Cast{
typedef Type result_type;
Type operator()(const CGAL::Gmpfr_interval& x) const { return x;}
Type operator()(const CGAL::Gmpq x) const {
// early exits
if (CGAL::is_zero(x)) return Type(0,0);
if (CGAL::is_one(x.denominator())){
return CTZ::Cast()(x.numerator());
}
// TODO: ensure that prec is reached for resulting interval ?
Gmpfr lower, upper, nf, df;
CGAL::Gmpz num = x.numerator();
CGAL::Gmpz den = x.denominator();
mp_prec_t prec = mpfr_get_default_prec();
CGAL_assertion( mpfr_get_prec(lower.fr()) == prec);
CGAL_assertion( mpfr_get_prec(upper.fr()) == prec );
mpfr_set_z (nf.fr(), num.mpz(), GMP_RNDD);
mpfr_set_z (df.fr(), den.mpz(),
(CGAL::sign(num) == CGAL::NEGATIVE)? GMP_RNDD: GMP_RNDU);
mpfr_div(lower.fr(), nf.fr(), df.fr(), GMP_RNDD);
mpfr_set_z (nf.fr(), num.mpz(), GMP_RNDU);
mpfr_set_z (df.fr(), den.mpz(),
(CGAL::sign(num) == CGAL::NEGATIVE)? GMP_RNDU: GMP_RNDD);
mpfr_div(upper.fr(), nf.fr(), df.fr(), GMP_RNDU);
Type bfi(lower, upper);
CGAL_postcondition( bfi.lower() <= x );
CGAL_postcondition( bfi.upper() >= x );
return bfi;
}
};
};
template <> // mirror
struct Coercion_traits<CGAL::Gmpq,CGAL::Gmpfr_interval>
:public Coercion_traits<CGAL::Gmpfr_interval, CGAL::Gmpq>{};
// lower GMP types:
CGAL_DEFINE_COERCION_TRAITS_FROM_TO(Gmpfr,Gmpfr_interval)
} //namespace CGAL
#endif // CGAL_GMPFR_INTERVAL_H

View File

@ -55,7 +55,7 @@ polygon vertices is referred to as the polygon \textbf{(outer) boundary}.
\item A \textbf{Relatively simple} polygon allows vertices with a degree$>$2, but all of its edges are disjoint in their interior. Furthermore, it must be an orientable polygon. Namely when it is inserted into an arrangement and its outer boundary is traversed, the same face is adjacent to all of the halfedges (no crossing over any curve during the traversal).
%\textbf{insert relativelySimplePolygon.tex}\\
Note that while polygon C has the same curves as polygon B, traversal of the curves leads to crossing over a previouly traversed curve, and is therefore neither simple nor relatively simple.
Note that while polygon C has the same curves as polygon B, traversal of the curves leads to crossing over a previously traversed curve, and is therefore neither simple nor relatively simple.
%\textbf{insert NotRelativelySimplePolygon.tex}\\ \\
\item A polygon in our context must be relatively simple and its outer boundary vertices must be ordered in a counterclockwise direction around the interior of the polygon.
@ -98,7 +98,7 @@ In our context, a polygon must uphold the following conditions:\\
\begin{enumerate}
\item\textit{Closed Boundary} - the polygon's outer boundary must be a connected sequence of curves, that start and end at the same vertex.
\item \textit{Simplicity} - the polygon must be simple.
\item \textit{Orientaion} - the polygon's outer boundary must be \textit{counter-clockwise oriented}.
\item \textit{Orientation} - the polygon's outer boundary must be \textit{counter-clockwise oriented}.
\end{enumerate}

View File

@ -250,10 +250,10 @@ The class-template
\ccc{Gps_traits_2<ArrDirectionalXMonotoneTraits,GeneralPolygon>}
models the concept \ccc{GeneralPolygonSetTraits_2}, and can be used to
instantiate the class template \ccc{General_polygon_set_2}.
It serves as an adapter for a geoemtric traits class, which models the
It serves as an adapter for a geometric traits class, which models the
concept \ccc{ArrangementDirectionalXMonotoneTraits_2}.
It can be used for performing set-operations on general polygons.
The implementation of the adapetr is rather simple, as it is derived
The implementation of the adapter is rather simple, as it is derived
from the instantiated template-parameter \ccc{ArrXMonotoneTraits_2}
inheriting its necessary types and methods. It further exploits
the methods provided by the instantiated parameter

View File

@ -61,6 +61,6 @@ in more depth. In Section~\ref{bso_sec:bso_lin} we focus on Boolean
set-operations on linear polygons, introducing the notion of polygons with
holes and of a general polygon set. Section~\ref{bso_sec:bso_gen}
introduces general polygons.
We first discuss polygons whose edges are either line segements or circular
We first discuss polygons whose edges are either line segments or circular
arcs and then explain how to construct and use general polygons whose edges
can be arbitrary weakly $x$-monotone curves.

View File

@ -5,7 +5,7 @@ The basic library of \cgal\ includes the \ccc{Polygon_2<Kernel,Container>}
class-template that represents a linear polygon in the plane. The
polygon is represented by its vertices stored in a container of
objects of type \ccc{Kernel::Point_2}. The polygon edges are line
segments (\ccc{Kenrel::Segment_2} objects) between adjacent points in
segments (\ccc{Kernel::Segment_2} objects) between adjacent points in
the container. By default, the \ccc{Container} is a vector of
\ccc{Kernel::Point_2} objects.
@ -37,7 +37,7 @@ computes the union of two polygons is called \ccc{join()}, since
the word \ccc{union} is reserved in \CC.} \ccc{difference()},
\ccc{symmetric_difference()} and the predicate \ccc{do_intersect()}
that accept two \ccc{Polygon_2} objects as their input. We explain how
these functions should be used throught several examples in the
these functions should be used through several examples in the
following sections.
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -151,7 +151,7 @@ upside-down triangle. In general, there are many ways to arrive at
a particular point set. However, the set of polygons with holes
obtained through the application of any sequence of operations is
unique. The set depicted on the right is represented as a single
polygon having a triangular outer boundary with a single triangluar
polygon having a triangular outer boundary with a single triangular
hole in its interior --- and not as three triangles that have no holes
at all. As a general rule, if two point sets are connected, then they
belong to the same polygon with holes.
@ -233,7 +233,7 @@ output polygons to its associated container.
\subsubsection{Example --- Joining and Intersecting Simple Polygons\label{bso_sssec:ex_simple_bops}}
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following example demonstartes the usage of the free functions
The following example demonstrates the usage of the free functions
\ccc{join()} and \ccc{intersect()} for computing the union and the
intersection of the two simple polygons depicted in
Figure~\ref{fig:simple}~(b). The example uses the auxiliary function
@ -245,7 +245,7 @@ the header file \ccc{print_utils.h} under the examples folder.
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\subsubsection{Operations on Polygons with Holes\label{bso_sssec:pwh_bops}}
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We have demonstrated that free functions that perform boolean set operations on simple polygons may output polygons with holes. In addition to these functions, the Boolean set-operations package provides the following overriden free functions that accept
We have demonstrated that free functions that perform boolean set operations on simple polygons may output polygons with holes. In addition to these functions, the Boolean set-operations package provides the following overridden free functions that accept
\ccc{General_polygon_with_holes_2} objects as their input -
%Having introduced polygons with holes and explained how the free functions
%output such objects, it is only natural to perform operations on sets that
@ -284,7 +284,7 @@ contains of five holes:
\ccIncludeExampleCode{Boolean_set_operations_2/symmetric_difference.cpp}
In some cases it is convinient to connect the outer boundary of a
In some cases it is convenient to connect the outer boundary of a
polygon with holes with the holes inside it. The
function \ccc{connect_holes()} accepts a polygon with
holes, and connects the topmost vertex in each hole with the polygon
@ -331,7 +331,7 @@ into the set using the \ccc{insert()} method, as long as the inserted
polygons and the existing polygons in the set are disjoint.
The \ccc{Polygon_set_2} class also provides access functions for
accessing the polygons with holes it contains, and a few queries. The
most improtant query is \ccc{S.oriented_side(q)}, which determined
most important query is \ccc{S.oriented_side(q)}, which determined
whether the query point $q$ is contained in the interior of the set
$S$, lies on the boundary of the set, or neither.
@ -347,8 +347,8 @@ functions.
Member functions of the \ccc{General_polygon_set_2} that perform
Boolean set-operations come in two flavors: for example, \ccc{S.join(P, Q)}
computes the union of $P$ and $Q$ and assigned the reuslt to $S$, while
\ccc{S.join(P)} preformes the operation $S \longleftarrow S \cup P$.
computes the union of $P$ and $Q$ and assigned the result to $S$, while
\ccc{S.join(P)} performs the operation $S \longleftarrow S \cup P$.
Similarly, \ccc{S.complement(P)} sets $S$ to be the complement of $P$,
while $S.complement()$ simply negates the set $S$.
@ -358,7 +358,7 @@ while $S.complement()$ simply negates the set $S$.
The free functions reviewed in Section~\ref{bso_ssec:polygons_with_holes}
serve as a wrapper for the polygon-set class, and are only provided for
convinience. A typical such function constructs a pair of
convenience. A typical such function constructs a pair of
\ccc{General_polygon_set_2} objects, invokes the appropriate method to
apply the desired Boolean operation, and transforms the resulting
polygon set to the required output format. Thus, when several

View File

@ -6,7 +6,7 @@
%============
An instance of the \ccClassTemplateName\ class-template represents a
point set in the plane. An \ccc{Arrangement_2} data structure is used
internaly to represent the point set. The class template provides
internally to represent the point set. The class template provides
methods to apply Boolean-set operations on pairs of instances of
\ccc{Boolean_set_operations_2} and a few other utility methods. At this
point only regularized Boolean-set operations are implemented.
@ -122,8 +122,8 @@ with holes type.}
\ccMethod{void difference(const Boolean_set_operations_2& bops);}
{computes the difference between this and \ccc{bops}.}
\ccMethod{void symetric_difference(const Boolean_set_operations_2& bops);}
{computes the symetric difference between this and \ccc{bops}.}
\ccMethod{void symmetric_difference(const Boolean_set_operations_2& bops);}
{computes the symmetric difference between this and \ccc{bops}.}
\ccPredicates
% ===========

View File

@ -112,7 +112,7 @@ OutputIterator difference(const General_polygon_with_holes_2<Polygon> & p1,
% polygons (or general polygons with holes) given in the first range, and
% another set given in the second range. (The value type of the input iterator
% is used to distinguish between the two types.) The result, represented
% by a set of general poygon with holes, is inserted into an output container
% by a set of general polygon with holes, is inserted into an output container
% through a given output iterator \ccc{oi}. The output iterator is
% returned. The value type of the \ccc{OutputIterator} is
% \ccc{General_polygon_with_holes_2}.}

View File

@ -111,7 +111,7 @@ OutputIterator intersection(InputIterator begin, InputIterator end,
{Computes the intersection of the general polygons (or general polygons with
holes) in the given range. (The value type of the input iterator is
used to distinguish between the two.) The result, represented by a set
of general poygon with holes, is inserted into an output container
of general polygon with holes, is inserted into an output container
through a given output iterator \ccc{oi}. The output iterator is
returned. The value type of the \ccc{OutputIterator} is
\ccc{Traits::Polygon_with_holes_2}.}
@ -125,7 +125,7 @@ OutputIterator intersection(InputIterator1 pgn_begin1,
OutputIterator oi);}
{Computes the intersection of the general polygons and general polygons
with holes in the given two ranges. The result, represented by a set
of general poygon with holes, is inserted into an output container
of general polygon with holes, is inserted into an output container
through a given output iterator \ccc{oi}. The output iterator is
returned. The value type of the \ccc{OutputIterator} is
\ccc{Traits::Polygon_with_holes_2}.}

View File

@ -109,7 +109,7 @@ OutputIterator join(InputIterator begin, InputIterator end,
{Computes the union of the general polygons (or general polygons with
holes) in the given range. (The value type of the input iterator is
used to distinguish between the two.) The result, represented by a set
of general poygon with holes, is inserted into an output container
of general polygon with holes, is inserted into an output container
through a given output iterator \ccc{oi}. The output iterator is
returned. The value type of the \ccc{OutputIterator} is
\ccc{Traits::Polygon_with_holes_2}.}
@ -121,7 +121,7 @@ OutputIterator join(InputIterator1 pgn_begin1, InputIterator1 pgn_end1,
OutputIterator oi);}
{Computes the union of the general polygons and general polygons
with holes in the given two ranges. The result, represented by a set
of general poygon with holes, is inserted into an output container
of general polygon with holes, is inserted into an output container
through a given output iterator \ccc{oi}. The output iterator is
returned. The value type of the \ccc{OutputIterator} is
\ccc{Traits::Polygon_with_holes_2}.}

View File

@ -119,7 +119,7 @@ polygons with holes) in the given range. A point is contained in the
symmetric difference, if and only if it is contained in odd number of
input polygons. (The value type of the input iterator is used to
distinguish between the two.) The result, represented by a set
of general poygon with holes, is inserted into an output container
of general polygon with holes, is inserted into an output container
through a given output iterator \ccc{oi}. The output iterator is
returned. The value type of the \ccc{OutputIterator} is
\ccc{Traits::Polygon_with_holes_2}.}
@ -134,7 +134,7 @@ OutputIterator symmetric_difference(InputIterator1 pgn_begin1,
{Computes the union of the general polygons and general polygons
with holes in the given two ranges. A point is contained in the
symmetric difference, if and only if it is contained in odd number of
input polygons. The result, represented by a set of general poygon with
input polygons. The result, represented by a set of general polygon with
holes, is inserted into an output container through a given output
iterator \ccc{oi}. The output iterator is returned. The value type of
the \ccc{OutputIterator} is \ccc{Traits::Polygon_with_holes_2}.}

View File

@ -57,7 +57,7 @@ defined.
\ccCreationVariable{dcel}
% =======================
\ccConstructor{Arr_dcel();}
{constructs an empty \dcel\ with one unbouned face.}
{constructs an empty \dcel\ with one unbounded face.}
\ccMethod{Face* assign (const Self& other, const Face *uf);}{%
assigns the contents of the \ccc{other} \dcel\, whose unbounded face

View File

@ -86,7 +86,7 @@ $x$-monotone curves. It uses the operator\\
\ccMethod{Construct_holes construct_holes_object() const;}
{returns a functor that obtains begin/end iterators over a container of holes.}
\ccMethod{Is_unbounded construct_is_unbounded_object();} {returns a functor that detemines if the polygon with holes is unbounded}
\ccMethod{Is_unbounded construct_is_unbounded_object();} {returns a functor that determines if the polygon with holes is unbounded}
\ccHasModels

View File

@ -10,14 +10,14 @@
The class \ccRefName\ models the concept \ccc{GeneralPolygon_2}.
It represents a simple general-polygon. It is parameterized with the type
\ccc{ArrTraits} that models the concept
\ccc{ArrangementDirectionalXMonotoneTraits}. The latter is a refinment
\ccc{ArrangementDirectionalXMonotoneTraits}. The latter is a refinement
of the concept \ccc{ArrangementXMonotoneTraits_2}. In addition to the
requirements of the concept \ccc{ArrangementXMonotoneTraits_2}, a
model of the concept \ccc{ArrangementDirectionalXMonotoneTraits} must
support the following functions:
\begin{itemize}
\item Given an $x$-monotone curve, construct its opposite curve.
\item Given an $x$-monotone curve, compare its two endpoints lexigroaphically.
\item Given an $x$-monotone curve, compare its two endpoints lexicographically.
\end{itemize}
This class supports a few convenient operations in addition to the

View File

@ -188,7 +188,7 @@ void insert(InputIterator1 pgn_begin, InputIterator1 pgn_end,
\ccMethod{void complement(const Polygon_set_2 & other);}
{computes the complement of \ccc{other}.
\ccVar\ is overriden by the result.}
\ccVar\ is overridden by the result.}
% \ccMethod{void complement(const Polygon_2 & pgn);}
% {computes the complement of \ccc{pgn}.}
@ -346,7 +346,7 @@ void do_intersect(InputIterator1 pgn_begin, InputIterator1 pgn_end,
\ccMethod{bool locate(const Point_2 & p, Polygon_with_holes_2 & pgn);}
{obtains a polygon with holes that contains the query point \ccc{p},
if exists, through \ccc{pgn}, and returns \ccc{true}.
Otherwise, returns \ccc{flase}.}
Otherwise, returns \ccc{false}.}
\ccMethod{Oriented_side oriented_side(const Point_2 & q);}
{returns either the constant \ccc{ON_ORIENTED_BOUNDARY},

View File

@ -268,7 +268,7 @@ the basic library can have the following documentation.
|
|--- *.tex
|
+--- *.((ps)|(eps)|(pdf)|(gif)|(jpg)|(png))
+--- *.((pdf)|(gif)|(jpg)|(png))
doc_tex/Optimisation_ref/
|--- main.tex
@ -277,7 +277,7 @@ the basic library can have the following documentation.
|
|--- *.tex
|
+--- *.((ps)|(eps)|(pdf)|(gif)|(jpg)|(png))
+--- *.((pdf)|(gif)|(jpg)|(png))
\end{verbatim}
@ -300,9 +300,7 @@ the basic library can have the following documentation.
contained in this package in a systematic way.
\item[{\tt *.tex}] -- the source files for the Users' and Reference
Manual that are input by {\tt main.tex}
\item[{\tt *.((ps)|(eps))}] -- the PostScript pictures included in
the PostScript documentation.
\item[{\tt *.pdf}] -- the PDF pictures included in
\item[{\tt *.pdf}] -- the PDF pictures included in
the PDF documentation.
\item[{\tt *.((gif)|(jpg)|(png))}] -- the raster images included in
the HTML documentation.

View File

@ -632,8 +632,9 @@ public:
original_src->point())) ||
(original_src->is_at_open_boundary() && is_min_end_at_inf))
{
overlaps++;
source_is_special = true;
if (split_points.front().third == true)
overlaps++;
}
// check if target is a special vertex, by checking the last point in

View File

@ -0,0 +1,14 @@
3
0 0 0
3 0 3
0 -3 3
1 -2 0
-2 -2 3
1 1 3
1 2 0
4 2 3
1 -1 3

View File

@ -0,0 +1,21 @@
16
50 -100 0 1050 -100 1000 50 900 1000
50 -100 0 1050 -100 1000 50 -1100 1000
50 -100 0 -950 -100 1000 50 -1100 1000
50 -100 0 -950 -100 1000 50 900 1000
0 0 0 1000 0 1000 0 1000 1000
0 0 0 1000 0 1000 0 -1000 1000
0 0 0 -1000 0 1000 0 -1000 1000
0 0 0 -1000 0 1000 0 1000 1000
50 100 0 1050 100 1000 50 1100 1000
50 100 0 1050 100 1000 50 -900 1000
50 100 0 -950 100 1000 50 -900 1000
50 100 0 -950 100 1000 50 1100 1000
-50 100 0 950 100 1000 -50 1100 1000
-50 100 0 950 100 1000 -50 -900 1000
-50 100 0 -1050 100 1000 -50 -900 1000
-50 100 0 -1050 100 1000 -50 1100 1000

View File

@ -29,4 +29,7 @@
./data/triangles/grid_inter_tri_const_envelope_40.cin
./data/triangles/random_50_small_0.5.in
./data/triangles/random_50_small_1.in
./data/triangles/edge_bug.cin
./data/triangles/edge_bug_all.cin

View File

@ -1393,9 +1393,9 @@ public:
template < typename L1>
result_type
operator()(const L1& l1, int i) const
operator()(const L1& l1, int) const
{
return result_type(&l1,i);
return result_type(&l1,2);
}
};
@ -1422,9 +1422,9 @@ public:
template < typename L1>
result_type
operator()(const L1& l1, int i) const
operator()(const L1& l1, int) const
{
return result_type(&l1,i);
return result_type(&l1,3);
}
};

View File

@ -122,15 +122,15 @@ for the example output.
\end{ccTexOnly}
\begin{ccHtmlOnly}
<A NAME="PointGenerators">
<TABLE><TR><TD ALIGN=LEFT VALIGN=TOP WIDTH=60%>
Figure:
Output of example program for point generators.
</TD><TD ALIGN=LEFT VALIGN=TOP WIDTH=5% NOWRAP>
</TD><TD ALIGN=LEFT VALIGN=TOP WIDTH=35% NOWRAP>
<img src="./generators_prog1.png"
alt="Point Generator Example Output">
</TD></TR></TABLE>
<A NAME="PointGenerators">
<TABLE WIDTH=100%>
<TR ALIGN=CENTER>
<TD> <img src="./generators_prog1.png" alt="Point Generator Example Output"> </TD>
</TR>
<TR ALIGN=LEFT>
<TD> <B>Figure:</B> Output of example program for point generators. </TD>
</TR>
</TABLE>
\end{ccHtmlOnly}
\section{Example Generating Grid Points}
@ -145,16 +145,16 @@ for the example output.
\ccIncludeExampleCode{Generator/random_grid.cpp}
\begin{ccHtmlOnly}
<A NAME="IntegerPointGenerators">
<TABLE><TR><TD ALIGN=LEFT VALIGN=TOP WIDTH=60%>
Figure:
Output of example program for point generators working
on integer points.
</TD><TD ALIGN=LEFT VALIGN=TOP WIDTH=5% NOWRAP>
</TD><TD ALIGN=LEFT VALIGN=TOP WIDTH=35% NOWRAP>
<img src="./generators_prog2.png"
alt="Integer Point Generator Example Output">
</TD></TR></TABLE>
<A NAME="IntegerPointGenerators">
<TABLE WIDTH=100%>
<TR ALIGN=CENTER>
<TD> <img src="./generators_prog2.png" alt="Integer Point Generator Example Output"> </TD>
</TR>
<TR ALIGN=LEFT>
<TD> <B>Figure:</B> Output of example program for point generators working
on integer points. </TD>
</TR>
</TABLE>
\end{ccHtmlOnly}%
@ -200,15 +200,15 @@ output.
\ccIncludeExampleCode{Generator/random_segments1.cpp}
\begin{ccHtmlOnly}
<A NAME="SegmentGenerator">
<TABLE><TR><TD ALIGN=LEFT VALIGN=TOP WIDTH=60%>
Figure:
Output of example program for the generic segment generator.
</TD><TD ALIGN=LEFT VALIGN=TOP WIDTH=5% NOWRAP>
</TD><TD ALIGN=LEFT VALIGN=TOP WIDTH=35% NOWRAP>
<img src="./Segment_generator_prog1.png"
alt="Segment Generator Example Output">
</TD></TR></TABLE>
<A NAME="SegmentGenerator">
<TABLE WIDTH=100%>
<TR ALIGN=CENTER>
<TD> <img src="./Segment_generator_prog1.png" alt="Segment Generator Example Output"> </TD>
</TR>
<TR ALIGN=LEFT>
<TD> <B>Figure:</B> Output of example program for the generic segment generator. </TD>
</TR>
</TABLE>
\end{ccHtmlOnly}
The second example generates a regular structure of 100 segments; see
@ -225,16 +225,17 @@ used.
\ccIncludeExampleCode{Generator/random_segments2.cpp}
\begin{ccHtmlOnly}
<A NAME="SegmentGeneratorFan">
<TABLE><TR><TD ALIGN=LEFT VALIGN=TOP WIDTH=60%>
Figure:
<A NAME="SegmentGeneratorFan">
<TABLE WIDTH=100%>
<TR ALIGN=CENTER>
<TD> <img src="./Segment_generator_prog2.png" alt="Segment Generator Example Output 2"> </TD>
</TR>
<TR ALIGN=LEFT>
<TD> <B>Figure:</B>
Output of example program for the generic segment generator using
pre-computed point locations.
</TD><TD ALIGN=LEFT VALIGN=TOP WIDTH=5% NOWRAP>
</TD><TD ALIGN=LEFT VALIGN=TOP WIDTH=35% NOWRAP>
<img src="./Segment_generator_prog2.png"
alt="Segment Generator Example Output 2">
</TD></TR></TABLE>
pre-computed point locations. </TD>
</TR>
</TABLE>
\end{ccHtmlOnly}
\lcTex{\ccIndexSubitemEnd[c]{generator}{segment}}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -1,3 +1,23 @@
// Copyright (c) 2008 GeometryFactory Sarl (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: $
// $Id: $
//
//
// Author(s) : Ophir Setter <ophirset@post.tau.ac.il>
//
// CGAL headers
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/envelope_3.h>
@ -35,8 +55,6 @@ typedef CGAL::L1_voronoi_traits_2<Kernel> Traits_3;
typedef Traits_3::Surface_3 Surface_3;
typedef CGAL::Envelope_diagram_2<Traits_3> Envelope_diagram_2;
// Ask Efi how to get rid of this. I was not successful in defining a new
// << operator that does not output a string for Arr_linear_object
namespace CGAL {
template <typename Kernel, typename T>
Qt::PainterOstream<T>&

View File

@ -18,7 +18,7 @@
// Author(s) : Marc Glisse
//| If a compiler does not support static_assert (from C++0x)
//| CGAL_CFG_NO_STATIC_ASSERT is set.
//| CGAL_CFG_NO_CPP0X_STATIC_ASSERT is set.
int main(){
static_assert(true,"Everything is fine");

View File

@ -35,6 +35,7 @@
#undef CGAL_CFG_NO_CPP0X_ISFINITE
#undef CGAL_CFG_NO_CPP0X_LONG_LONG
#undef CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE
#undef CGAL_CFG_NO_CPP0X_STATIC_ASSERT
#undef CGAL_CFG_NO_CPP0X_TUPLE
#undef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES

View File

@ -266,17 +266,21 @@ intersection_collinear_segments(const typename K::Segment_3 &s1,
if ( cln_order(p,r,q) ){
if ( cln_order(p,s,q) )
return make_object(s2);
if ( cln_order(r,p,s) )
return r!=p ? make_object( typename K::Segment_3(r,p) ) : make_object(p);
else
return r!=q ? make_object( typename K::Segment_3(r,q) ) : make_object(q);
if ( cln_order(r,p,s) ){
if (r!=p) return make_object( typename K::Segment_3(r,p) );
if ( cln_order(r,q,s) ) return make_object(s1);
return make_object(p);
}
return r!=q ? make_object( typename K::Segment_3(r,q) ) : make_object(q);
}
if ( cln_order(p,s,q) ){
if ( cln_order(r,p,s) )
return s!=p ? make_object( typename K::Segment_3(s,p) ) : make_object(p);
else
return s!=q ? make_object( typename K::Segment_3(s,q) ) : make_object(q);
if ( cln_order(r,p,s) ){
if (s!=p) return make_object( typename K::Segment_3(s,p) );
if (cln_order(r,q,s)) return make_object(s1);
return make_object(p);
}
return s!=q ? make_object( typename K::Segment_3(s,q) ) : make_object(q);
}
if ( cln_order(r,p,s) )

View File

@ -138,8 +138,8 @@ intersection(
}
//The supporting planes of the triangles intersect along a line.
Object inter1=inter(t1,*line);
Object inter2=inter(t2,*line);
Object inter1=intersection_coplanar(t1,*line,k);
Object inter2=intersection_coplanar(t2,*line,k);
const typename Kernel::Segment_3* sgt1=CGAL::object_cast<typename Kernel::Segment_3>(&inter1);

View File

@ -9,6 +9,87 @@ typedef CGAL::Cartesian<FT> K;
// The construction test has to be working
// The equal test has to be working
#define TEST_CASE_SEGMENT_BASE(i,j,k,l,i1,i2) \
{\
typename K::Segment_3 s1(pts[i],pts[j]); \
typename K::Segment_3 s2(pts[k],pts[l]); \
CGAL::Object obj= CGAL::intersection(s1,s2); \
typename K::Segment_3 s; \
typename K::Segment_3 res(pts[i1],pts[i2]);\
if (!CGAL::assign(s,obj) || ( s!=res && s!=res.opposite() ) ) {\
std::cerr << "ERROR test-case "<< i << j << k <<l <<std::endl; \
exit (EXIT_FAILURE);\
}\
}
#define TEST_CASE_SEGMENT(i,j,k,l,i1,i2) \
TEST_CASE_SEGMENT_BASE(i,j,k,l,i1,i2) \
TEST_CASE_SEGMENT_BASE(j,i,k,l,i1,i2) \
TEST_CASE_SEGMENT_BASE(i,j,l,k,i1,i2) \
TEST_CASE_SEGMENT_BASE(j,i,l,k,i1,i2) \
TEST_CASE_SEGMENT_BASE(k,l,i,j,i1,i2) \
TEST_CASE_SEGMENT_BASE(k,l,j,i,i1,i2) \
TEST_CASE_SEGMENT_BASE(l,k,i,j,i1,i2) \
TEST_CASE_SEGMENT_BASE(l,k,j,i,i1,i2)
#define TEST_CASE_POINT_BASE(i,j,k,l,ind) \
{\
typename K::Segment_3 s1(pts[i],pts[j]); \
typename K::Segment_3 s2(pts[k],pts[l]); \
CGAL::Object obj= CGAL::intersection(s1,s2); \
typename K::Point_3 p; \
if (!CGAL::assign(p,obj) || p!=pts[ind] ) {\
std::cerr << "ERROR test-case "<< i << j << k <<l <<std::endl; \
exit (EXIT_FAILURE);\
}\
}
#define TEST_CASE_POINT(i,j,k,l,ind) \
TEST_CASE_POINT_BASE(i,j,k,l,ind) \
TEST_CASE_POINT_BASE(j,i,k,l,ind) \
TEST_CASE_POINT_BASE(i,j,l,k,ind) \
TEST_CASE_POINT_BASE(j,i,l,k,ind) \
TEST_CASE_POINT_BASE(k,l,i,j,ind) \
TEST_CASE_POINT_BASE(k,l,j,i,ind) \
TEST_CASE_POINT_BASE(l,k,i,j,ind) \
TEST_CASE_POINT_BASE(l,k,j,i,ind)
#define TEST_CASE_EMPTY_BASE(i,j,k,l) \
{\
typename K::Segment_3 s1(pts[i],pts[j]); \
typename K::Segment_3 s2(pts[k],pts[l]); \
CGAL::Object obj= CGAL::intersection(s1,s2); \
if ( !obj.empty() ) {\
std::cerr << "ERROR test-case "<< i << j << k <<l <<std::endl; \
exit (EXIT_FAILURE);\
}\
}
#define TEST_CASE_EMPTY(i,j,k,l) \
TEST_CASE_EMPTY_BASE(i,j,k,l)\
TEST_CASE_EMPTY_BASE(i,j,l,k)\
TEST_CASE_EMPTY_BASE(j,i,k,l)\
TEST_CASE_EMPTY_BASE(j,i,l,k)\
TEST_CASE_EMPTY_BASE(k,l,i,j)\
TEST_CASE_EMPTY_BASE(l,k,i,j)\
TEST_CASE_EMPTY_BASE(k,l,j,i)\
TEST_CASE_EMPTY_BASE(l,k,j,i)
template <class K>
void all_cases_collinear(typename K::Point_3 pts[4]){
std::cout << "4 points cases\n";
TEST_CASE_EMPTY(0,1,2,3)
TEST_CASE_SEGMENT(0,2,1,3,1,2)
TEST_CASE_SEGMENT(0,3,2,1,1,2)
std::cout << "3 points cases\n";
TEST_CASE_SEGMENT(0,1,0,2,0,1)
TEST_CASE_SEGMENT(0,2,1,2,1,2)
TEST_CASE_POINT(1,2,0,1,1)
std::cout << "2 points cases\n";
TEST_CASE_SEGMENT(1,2,1,2,1,2)
}
template <class K>
void _test_intersection_construct(K)
{
@ -68,5 +149,9 @@ int main()
{
K k;
_test_intersection_construct(k);
K::Point_3 pts[4] = {K::Point_3(0,0,0),K::Point_3(1,0,0),K::Point_3(2,0,0),K::Point_3(3,0,0)};
all_cases_collinear<K>(pts);
return 0;
}

View File

@ -458,6 +458,7 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\
<TD><TABLE>
<TR><TD>Point_3</TD></TR>
<TR><TD>Segment_3</TD></TR>
<TR><TD>Triangle_3</TD></TR>
<TR><TD>std::vector &lt; Point_3 &gt; </TD></TR>
</TABLE></TD>
</TR>

View File

@ -1,5 +1,6 @@
abru = Antoine Bru <Antoine.Bru@sophia.inria.fr>
afabri = Andreas Fabri <Andreas.Fabri@geometryfactory.com>
andreasfabri = Andreas Fabri <Andreas.Fabri@geometryfactory.com>
akobel = Alexander Kobel <akobel@mpi-inf.mpg.de>
amebarki = Abdelkrim Mebarki <Abdelkrim.Mebarki@sophia.inria.fr>
ameyer = Andreas Meyer <Andreas.Meyer@sophia.inria.fr>

View File

@ -1,2 +1,6 @@
export QTDIR=/usr/lib/qt-3.3
CXXFLAGS=-m32
CFLAGS=-m32
export CXXFLAGS
export CFLAGS

View File

@ -164,7 +164,14 @@ Io_implicit_function_plugin::
load_function_plugins()
{
QDir pluginsDir(qApp->applicationDirPath());
if ( !pluginsDir.cd("implicit_functions") ) { return; }
QString dirname = pluginsDir.dirName();
if ( !pluginsDir.cd("implicit_functions") ) {
// In that case, dirname may be "Debug" or "Release" and one has to
// search in ../implicit_functions/Debug or
// ../implicit_functions/Release
QString newDir = QString("../implicit_functions/") + dirname;
if( !pluginsDir.cd(newDir) ) return;
}
Q_FOREACH (QString fileName, pluginsDir.entryList(QDir::Files))
{

View File

@ -18,6 +18,7 @@
#include <QPluginLoader>
#include <QMessageBox>
#include <QScrollBar>
#include <QClipboard>
#include <CGAL_demo/Plugin_interface.h>
#include <CGAL_demo/Io_plugin_interface.h>
@ -550,3 +551,27 @@ void MainWindow::setAddKeyFrameKeyboardModifiers(::Qt::KeyboardModifiers m)
{
viewer->setAddKeyFrameKeyboardModifiers(m);
}
void MainWindow::on_actionCopy_snapshot_triggered()
{
// copy snapshot to clipboard
QApplication::setOverrideCursor(Qt::WaitCursor);
QClipboard *qb = QApplication::clipboard();
viewer->makeCurrent();
viewer->raise();
QImage snapshot = viewer->grabFrameBuffer(true);
qb->setImage(snapshot);
QApplication::restoreOverrideCursor();
}
void MainWindow::on_actionSave_snapshot_triggered()
{
// save snapshot to file
QApplication::setOverrideCursor(Qt::WaitCursor);
QString filename = QFileDialog::getSaveFileName(this,tr("Save snapshot to file..."),"snapshot00.png","*.png");
viewer->saveSnapshot(filename);
QApplication::restoreOverrideCursor();
}

View File

@ -62,6 +62,10 @@ protected slots:
void readSettings();
void writeSettings();
// snapshot
void on_actionCopy_snapshot_triggered();
void on_actionSave_snapshot_triggered();
// load, erase, duplicate
void on_actionEraseAll_triggered();
void on_actionLoad_triggered();

View File

@ -14,7 +14,7 @@
<string>CGAL 3D mesh generator demo</string>
</property>
<property name="windowIcon">
<iconset resource="Mesh_3.qrc">
<iconset>
<normaloff>:/cgal/icons/resources/cgal_logo.xpm</normaloff>:/cgal/icons/resources/cgal_logo.xpm</iconset>
</property>
<widget class="QWidget" name="centralwidget">
@ -37,7 +37,7 @@
<x>0</x>
<y>0</y>
<width>978</width>
<height>22</height>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@ -59,6 +59,9 @@
<addaction name="actionShowHide"/>
<addaction name="actionSetPolyhedronA"/>
<addaction name="actionSetPolyhedronB"/>
<addaction name="separator"/>
<addaction name="actionCopy_snapshot"/>
<addaction name="actionSave_snapshot"/>
</widget>
<widget class="QMenu" name="menuOperations">
<property name="title">
@ -125,7 +128,7 @@
<string>+</string>
</property>
<property name="icon">
<iconset resource="Mesh_3.qrc">
<iconset>
<normaloff>:/cgal/icons/plus</normaloff>:/cgal/icons/plus</iconset>
</property>
</widget>
@ -136,7 +139,7 @@
<string>-</string>
</property>
<property name="icon">
<iconset resource="Mesh_3.qrc">
<iconset>
<normaloff>:/cgal/icons/minus</normaloff>:/cgal/icons/minus</iconset>
</property>
</widget>
@ -147,7 +150,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="Mesh_3.qrc">
<iconset>
<normaloff>:/cgal/icons/duplicate</normaloff>:/cgal/icons/duplicate</iconset>
</property>
</widget>
@ -312,7 +315,7 @@
</action>
<action name="actionLoad">
<property name="icon">
<iconset resource="Mesh_3.qrc">
<iconset>
<normaloff>:/cgal/icons/plus</normaloff>:/cgal/icons/plus</iconset>
</property>
<property name="text">
@ -324,7 +327,7 @@
</action>
<action name="actionErase">
<property name="icon">
<iconset resource="Mesh_3.qrc">
<iconset>
<normaloff>:/cgal/icons/minus</normaloff>:/cgal/icons/minus</iconset>
</property>
<property name="text">
@ -336,7 +339,7 @@
</action>
<action name="actionDuplicate">
<property name="icon">
<iconset resource="Mesh_3.qrc">
<iconset>
<normaloff>:/cgal/icons/duplicate</normaloff>:/cgal/icons/duplicate</iconset>
</property>
<property name="text">
@ -498,7 +501,7 @@
</action>
<action name="actionOdt">
<property name="text">
<string>Odt-smoothing</string>
<string>ODT-smoothing</string>
</property>
</action>
<action name="actionLloyd">
@ -521,12 +524,22 @@
<string>toto</string>
</property>
</action>
<action name="actionCopy_snapshot">
<property name="text">
<string>Copy snapshot</string>
</property>
</action>
<action name="actionSave_snapshot">
<property name="text">
<string>Save snapshot</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>Viewer</class>
<extends>QWidget</extends>
<header>CGAL_demo/Viewer.h</header>
<header>CGAL_demo/Viewer.h</header>
</customwidget>
</customwidgets>
<resources>

View File

@ -112,6 +112,11 @@ public:
/// Removes facet \c facet from 2D complex
void remove_from_complex(const Facet& facet);
/// Removes facet(\c cell, \c i) from 2D complex
void remove_from_complex(const Cell_handle& c, const int i) {
remove_from_complex(Facet(c, i));
}
/// Sets surface index of facet \c facet to \c index
void set_surface_patch_index(const Facet& f, const Surface_patch_index& index)
{
@ -294,19 +299,20 @@ private:
class Facet_iterator_not_in_complex
{
const Self& c3t3_;
const Surface_patch_index index_;
const Self* c3t3_;
Surface_patch_index index_; //need by SWIG: should be const Surface_patch_index
public:
Facet_iterator_not_in_complex(){} //need by SWIG
Facet_iterator_not_in_complex(const Self& c3t3,
const Surface_patch_index& index = Surface_patch_index())
: c3t3_(c3t3)
: c3t3_(&c3t3)
, index_(index) { }
template <typename Iterator>
bool operator()(Iterator it) const
{
if ( index_ == Surface_patch_index() ) { return ! c3t3_.is_in_complex(*it); }
else { return c3t3_.surface_patch_index(*it) != index_; }
if ( index_ == Surface_patch_index() ) { return ! c3t3_->is_in_complex(*it); }
else { return c3t3_->surface_patch_index(*it) != index_; }
}
};
@ -317,8 +323,9 @@ private:
class Cell_not_in_complex
{
const Self* r_self_;
Subdomain_index index_;
Subdomain_index index_;//needed by SWIG, should be const Subdomain_index
public:
Cell_not_in_complex(){}//needed by SWIG
Cell_not_in_complex(const Self& self,
const Subdomain_index& index = Subdomain_index())
: r_self_(&self)
@ -388,7 +395,7 @@ public:
Self operator++(int) { Self tmp(*this); ++(*this); return tmp; }
Self operator--(int) { Self tmp(*this); --(*this); return tmp; }
operator Cell_handle() { return Cell_handle(this->base()); }
operator Cell_handle() const { return Cell_handle(this->base()); }
}; // end class Cells_in_complex_iterator
@ -423,7 +430,7 @@ public:
typedef Surface_patch_index Surface_index;
void set_surface_index(const Facet& f, const Surface_index& index)
{ set_surface_patch_index(f.first, index); }
{ set_surface_patch_index(f, index); }
void set_surface_index(const Cell_handle& c, const int i, const Surface_index& index)
{ set_surface_patch_index(c,i,index); }

View File

@ -301,11 +301,19 @@ struct Tester
c3t3.set_subdomain_index(ch, subdomain_index_bis);
c3t3.set_surface_patch_index(f2, surface_patch_index_bis);
#ifndef CGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX
c3t3.set_surface_index(f2, surface_patch_index_bis);
c3t3.set_surface_index(f2.first, f2.second, surface_patch_index_bis);
#endif
c3t3.set_dimension(vh, 1);
c3t3.set_index(vh, vertex_index);
assert(c3t3.subdomain_index(ch) == subdomain_index_bis);
assert(c3t3.surface_patch_index(f2) == surface_patch_index_bis);
#ifndef CGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX
assert(c3t3.surface_index(f2) == surface_patch_index_bis);
assert(c3t3.surface_index(f2.first, f2.second) == surface_patch_index_bis);
#endif
assert(c3t3.in_dimension(vh) == 1);
assert(c3t3.index(vh) == vertex_index);

View File

@ -1121,6 +1121,7 @@ public:
CGAL_DEFINE_COERCION_TRAITS_FOR_SELF_TEM(Lazy_exact_nt<ET>, class ET)
CGAL_DEFINE_COERCION_TRAITS_FROM_TO_TEM(ET,Lazy_exact_nt<ET>,class ET)
template<class ET1, class ET2 >
struct Coercion_traits< Lazy_exact_nt<ET1>, Lazy_exact_nt<ET2> >

View File

@ -136,12 +136,10 @@ compute_average_spacing(
// precondition: at least 2 nearest neighbors
CGAL_point_set_processing_precondition(k >= 2);
InputIterator it;
// Instanciate a KD-tree search.
// Note: We have to convert each input iterator to Point_3.
std::vector<Point> kd_tree_points;
for(it = first; it != beyond; it++)
for(InputIterator it = first; it != beyond; it++)
{
Point point = get(point_pmap, it);
kd_tree_points.push_back(point);
@ -152,7 +150,7 @@ compute_average_spacing(
// vectors (already normalized)
FT sum_spacings = (FT)0.0;
unsigned int nb_points = 0;
for(it = first; it != beyond; it++)
for(InputIterator it = first; it != beyond; it++)
{
sum_spacings += internal::compute_average_spacing<Kernel,Tree>(get(point_pmap,it),tree,k);
nb_points++;

View File

@ -41,13 +41,18 @@ template <class T,class U> struct is_iterator_type_<T,U,true> :
//boost::is_base_of<U,typename std::iterator_traits<T>::iterator_category>
boost::is_convertible<typename std::iterator_traits<T>::iterator_category,U>
{};
template <class T> struct decay_array { typedef T type; };
template <class T> struct decay_array<T[]> { typedef T* type; };
template <class T,int d> struct decay_array<T[d]> { typedef T* type; };
}
// NOTE: we don't want the real std::decay or functions are included
template <class T> struct is_iterator :
internal::is_iterator_<typename boost::decay<T>::type> {};
internal::is_iterator_<typename internal::decay_array<typename boost::remove_cv<typename boost::remove_reference<T>::type>::type>::type> {};
template <class T,class Tag> struct is_iterator_type :
internal::is_iterator_type_<typename boost::decay<T>::type,Tag> {};
internal::is_iterator_type_<typename internal::decay_array<typename boost::remove_cv<typename boost::remove_reference<T>::type>::type>::type,Tag> {};
}

View File

@ -0,0 +1,85 @@
#!/bin/bash
#
# usage: bash clean_up_branch.sh directory [rm]
#
# lists all files that should be removed from a branch.
# directory is the path to the repository.
# If additional rm option is passed, files will be deleted.
#
REPO_DIR=.
DELETE=0
if [ $# -gt 0 ] ; then
REPO_DIR=$1
fi
if [ ! -e $REPO_DIR/.svn/entries ]; then
echo "$REPO_DIR is not a working copy"
exit 1
fi;
if [ $# -gt 1 ]; then
if [ "$2" == "rm" ]; then
DELETE=1
else
echo "Unknown option $2"
exit 1
fi
fi;
echo Cleaning $REPO_DIR
#define regular expression to match generated files
REGEXP='ProgramOutput\.|CMakeFiles|CMakeLists.txt|\.moc$|CMakeCache\.txt|error\.txt|cmake_install\.cmake|Makefile|doc_html|doc_pdf|\.pdflg$|\.ilg$|\.cgallog$|\.blg$|\.bak$|\.hax$|\.aux$|\.maf$|\.hlg$|\.out$|demo.*\/qrc_.*\.cxx|demo.*\/ui_.*\.h'
INITIAL=`svn status --no-ignore $1| awk '{if ($1 =="?" || $1=="I" ) print $2 }'`
#first get executable files
EXECS=''
DIRS=''
KNOWN=''
OTHER=''
for i in $INITIAL; do
if [ -x $REPO_DIR/$i -a ! -d $REPO_DIR/$i ]; then
EXECS="$EXECS $i"
elif [[ "$i" =~ $REGEXP ]]; then
KNOWN="$KNOWN $i"
else
OTHER="$OTHER $i"
fi;
done
if [ "$EXECS" ]; then
echo "#Cleaning executables"
echo rm -rf $EXECS
fi
if [ "$KNOWN" ]; then
echo "#Cleaning known generated files"
echo rm -rf $KNOWN
fi
if [ "$OTHER" ]; then
echo "#No predefined behavior"
echo "# $OTHER"
fi
if [ $DELETE -eq 1 ]; then
if [ "$EXECS" -o "$KNOWN" ]; then
echo "Are you sure you want to execute the printed commands? [YES/NO]"
read ANSWER
if [ "$ANSWER" == "YES" ]; then
for i in $EXECS $KNOWN; do
rm -rf $REPO_DIR/$i
done
fi
else
echo "Nothing to do"
fi
fi

View File

@ -4,8 +4,8 @@
% | 07.09.2007 Pierre Alliez, Laurent Saboret, Gael Guennebaud
% | Package: Surface_reconstruction_points_3
% |
\RCSdef{\RCSPoissonreconstructionfunctionRev}{$Id$}
\RCSdefDate{\RCSPoissonreconstructionfunctionDate}{$Date$}
%\RCSdef{\RCSPoissonreconstructionfunctionRev}{$Id$}
%\RCSdefDate{\RCSPoissonreconstructionfunctionDate}{$Date$}
% |
\ccRefPageBegin
%%RefPage: end of header, begin of main body
@ -143,7 +143,9 @@ The function \ccc{compute_implicit_function}() must be called after the insertio
\ccGlue
\ccMethod{FT operator()(const Point& p) const;}
{
\ccc{ImplicitFunction} interface: evaluates the implicit function at a given 3D query point.
\ccc{ImplicitFunction} interface: evaluates the implicit function at a
given 3D query point. The function \ccc{compute_implicit_function} must be
called before the first call to \ccc{operator()}.
}
\ccGlue
\ccMethod{Point get_inner_point() const;}
@ -156,7 +158,7 @@ Returns a point located inside the inferred surface.
\ccExample
See \ccc{poisson_reconstruction_example.cpp}.
See \ccReferToExampleCode{Surface_reconstruction_points_3/poisson_reconstruction_example.cpp}.
\end{ccRefClass}

View File

@ -841,7 +841,11 @@ In 2009, Sylvain Pion simplified the design of the Delaunay hierarchy
so that it became the simple \ccc{Fast_location} policy in release~3.6.
In 2010, Pedro de Castro and Olivier Devillers added the point
displacement.
displacement in release 3.7.
In 2011, Pedro de Castro and Olivier Devillers implemented in release
3.8 the
structural filtering method, improving the efficiency of point location.
A new demo of this package was introduced in CGAL 3.8, coded by Fei
(Sophie) Che, who was co-mentored by Manuel Caroli and Monique