The Intel Compiler 14.0, with -O2 or -O3, triggers a bug in the old
version of the code. After the construction of the filtered circulator,
`test(*this)` was not guaranteed. I am not sure if the bug is in the
code or in the compiler, but the constructor was an ugly piece of
code! (*this) was used in the body of the constructor in non obvious
ways. An object is reputed constructed once the internalizers are
evaluated, as far as I know, so probably the previous version of the
code was valid. However, that sound strange to copy an object inside the
body of the constructor of that object. Maybe that confused the
compiler.
Anyway, I have modified the implementation of that constructor in a
cleaner way, and I have added an assertion (that was failing with the
old implementation).
I found out that way that <CGAL/Mesh_3/Refine_facets.h> and
<CGAL/Mesh_3/Protect_edges_sizing_field> were using global functions
instead of functors of the traits class.
Note also the funny bug that <CGAL/Regular_triangulation_cell_base_3.h> was
depending on <CGAL/Triangulation_vertex_base_3.h>!
That feature can be enabled with g++, clang++, and icpc (intel). It could
be implemented for MSVC, with the flag /Zs, but that is not yet done (and
probably will not).
The option is controlled by a CMake option, CGAL_ENABLE_CHECK_HEADERS, that
is disabled by default. If that option is enabled by the user, then CMake
will check if the compiler $CXX understand the syntax:
$CXX -x c++ -fsyntax-only CGAL/header.h
and send an error otherwise.
Then phony targets will be created:
- a target check_CGAL__header_h for each header <CGAL/header.h>,
- a target check_pkg_<pkg> for each package <pgk>,
- and a target check_headers for the whole CGAL.
Those new targets currently give a lot of compilation errors if
CGAL_ENABLE_CHECK_HEADERS is enabled!
+ fix several missing includes in Mesh_2.
-Wunused-local-typedefs is a new warning flag of gcc-4.7, and it will enabled
by -Wall since gcc-4.8 (not yet released).
The fix is a big set of removals of unused typedefs (or comments, or moves,
depending on the context).
Bug reported by a user against CGAL-4.0.2
A single triangle cannot be meshed!
The fault was a buggy assertion added in the following revision:
|-----------------------------------------------------------------------
|r66359 | lrineau | 2011-11-16 18:58:22 +0100 (Wed, 16 Nov 2011) | 3 lines
|
|Add an assertion that checks that a point constructed as the midpoint of an
|edge is located either on the edge or inside one of the two incident faces.
|
|-----------------------------------------------------------------------
And the assertion message was:
terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: zone.locate_type != Tr::FACE || zone.fh == f || zone.fh == n
File: /home/lrineau/wc/Mesh_2/test/Mesh_2/../../include/CGAL/Mesh_2/Refine_edges.h
Line: 430
Explanation: Your data set contains at least a vertex that is very close to
a constrained edge! Mesh_2 cannot mesh that sort of data set.
If one wants to use Mesh_2 with Triangulation_2_projection_traits_3 (a
projection traits constructed with a normal vector), one cannot use a
default constructed geom traits, but only one passed on argument. Then the
criteria class needs to be constructed with tr.geom_traits() as argument.
"New directory Mesh_2/include/CGAL/Meshes/ that aggregates several
non documented files that are common to Mesh_2, Mesh_3 and Surface_mesher."
I forgot to commit the removal of old files.