mirror of https://github.com/CGAL/cgal
Remove paragraph in the developer manual; Some fixes
This commit is contained in:
parent
d3fca65ae5
commit
6d09a886b2
|
|
@ -20,12 +20,6 @@
|
||||||
\cgalPkgShortInfoEnd
|
\cgalPkgShortInfoEnd
|
||||||
\cgalPkgDescriptionEnd
|
\cgalPkgDescriptionEnd
|
||||||
|
|
||||||
\cgalCRPSection{Assertions}
|
|
||||||
|
|
||||||
The optimization code uses infix `OPTIMISATION` in the assertions,
|
|
||||||
e.g. defining the compiler flag
|
|
||||||
`CGAL_OPTIMISATION_NO_PRECONDITIONS` switches precondition
|
|
||||||
checking off, cf. Section \ref secchecks.
|
|
||||||
|
|
||||||
\cgalClassifedRefPages
|
\cgalClassifedRefPages
|
||||||
|
|
||||||
|
|
@ -62,4 +56,3 @@ checking off, cf. Section \ref secchecks.
|
||||||
- `CGAL::Min_sphere_of_spheres_d<Traits>`
|
- `CGAL::Min_sphere_of_spheres_d<Traits>`
|
||||||
- `MinSphereOfSpheresTraits`
|
- `MinSphereOfSpheresTraits`
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -156,53 +156,8 @@ the computation is done with some exact number type.
|
||||||
\section secchecks_controlling Controlling checks at a finer granularity
|
\section secchecks_controlling Controlling checks at a finer granularity
|
||||||
|
|
||||||
The macros and related compile-time flags described so far all operate
|
The macros and related compile-time flags described so far all operate
|
||||||
on the whole library. Sometimes the user may want to have a more
|
on the whole library. \cgal offers the possibility to turn checks on
|
||||||
selective control. \cgal offers the possibility to turn checks on
|
and off just for the kernel.
|
||||||
and off on a per-package basis. Therefore a package-specific term is
|
|
||||||
inserted in the macro names directly after the \cgal prefix,
|
|
||||||
<I>e.g.</I>, `CGAL_kernel_assertion(<Cond>)`. Similarly, the uppercase
|
|
||||||
term is used for the compile-time flags;
|
|
||||||
<I>e.g.</I>, `CGAL_KERNEL_NO_WARNINGS` switches off the warnings
|
|
||||||
in <I>only</I> the kernel. Other packages have their own specific
|
|
||||||
terms as documented in the corresponding chapters of the
|
|
||||||
reference manual.
|
|
||||||
|
|
||||||
For a new package you will first have to create a suitable header file
|
|
||||||
with all macro definitions. This is done with the shell script
|
|
||||||
<TT>cgal_create_assertions.sh</TT>, to be found in the
|
|
||||||
<TT>scripts</TT> directory.
|
|
||||||
|
|
||||||
The following command will create a file <TT>optimisation_assertions.h</TT>:
|
|
||||||
|
|
||||||
<CENTER>
|
|
||||||
<TT>sh cgal_create_assertions.sh optimisation</TT>
|
|
||||||
|
|
||||||
</CENTER>
|
|
||||||
|
|
||||||
You should place the generated file in the proper directory (and possibly
|
|
||||||
rename it). Then you can use the checks in the following fashion.
|
|
||||||
|
|
||||||
\code{.cpp}
|
|
||||||
#include <CGAL/Optimisation/assertions.h>
|
|
||||||
|
|
||||||
void optimisation_foo( int i)
|
|
||||||
{
|
|
||||||
CGAL_optimisation_precondition_msg( i == 42, "Only 42 allowed!");
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
The documentation of your new package has to name the term chosen to be
|
|
||||||
part of the package-specific macros in
|
|
||||||
order to enable the user to selectively turn off and on the checks of
|
|
||||||
your package. For example, in the documentation of the optimisation
|
|
||||||
package you can find a sentence similar to the following.
|
|
||||||
<BLOCKQUOTE>
|
|
||||||
The optimisation code uses the term OPTIMISATION for the checks;
|
|
||||||
<I>e.g.</I>, setting the compile time flag
|
|
||||||
`CGAL_OPTIMISATION_NO_PRECONDITIONS` switches off precondition
|
|
||||||
checking in the optimisation code.
|
|
||||||
</BLOCKQUOTE>
|
|
||||||
|
|
||||||
\section secchecks_cgal_assume Suppress warnings using CGAL_assume.
|
\section secchecks_cgal_assume Suppress warnings using CGAL_assume.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <CGAL/iterator.h>
|
#include <CGAL/iterator.h>
|
||||||
#include <CGAL/tuple.h>
|
#include <CGAL/tuple.h>
|
||||||
|
#include <CGAL/assertions.h>
|
||||||
#include <CGAL/Kernel/global_functions_2.h>
|
#include <CGAL/Kernel/global_functions_2.h>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
@ -415,8 +416,8 @@ template<typename Tr>
|
||||||
Cvd_cell_2<Tr> dual(const Tr& tr,
|
Cvd_cell_2<Tr> dual(const Tr& tr,
|
||||||
const typename Tr::Vertex_handle& v)
|
const typename Tr::Vertex_handle& v)
|
||||||
{
|
{
|
||||||
CGAL_triangulation_precondition( v != typename Tr::Vertex_handle());
|
CGAL_precondition( v != typename Tr::Vertex_handle());
|
||||||
CGAL_triangulation_precondition( !tr.is_infinite(v));
|
CGAL_precondition( !tr.is_infinite(v));
|
||||||
|
|
||||||
Constrained_voronoi_diagram_2<Tr> diagram(tr);
|
Constrained_voronoi_diagram_2<Tr> diagram(tr);
|
||||||
return diagram.cvd_cell(v);
|
return diagram.cvd_cell(v);
|
||||||
|
|
@ -436,8 +437,8 @@ Cvd_cell_2<Tr> dual(const Tr& tr,
|
||||||
// typedef Tr::Geom_traits::Ray_2 Ray;
|
// typedef Tr::Geom_traits::Ray_2 Ray;
|
||||||
// typedef Tr::Geom_traits::Vector_2 Vector_2;
|
// typedef Tr::Geom_traits::Vector_2 Vector_2;
|
||||||
//
|
//
|
||||||
// CGAL_triangulation_precondition( v != Vertex_handle());
|
// CGAL_precondition( v != Vertex_handle());
|
||||||
// CGAL_triangulation_precondition( !tr.is_infinite(v));
|
// CGAL_precondition( !tr.is_infinite(v));
|
||||||
//
|
//
|
||||||
// // The Circulator moves ccw.
|
// // The Circulator moves ccw.
|
||||||
// std::vector<Segment> segments;
|
// std::vector<Segment> segments;
|
||||||
|
|
|
||||||
|
|
@ -568,7 +568,7 @@ refine_mesh(std::string dump_after_refine_surface_prefix)
|
||||||
std::cerr << "Total refining surface time: " << timer.time() << "s" << std::endl;
|
std::cerr << "Total refining surface time: " << timer.time() << "s" << std::endl;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
CGAL_triangulation_postcondition(r_tr.is_valid());
|
CGAL_postcondition(r_tr.is_valid());
|
||||||
|
|
||||||
elapsed_time += timer.time();
|
elapsed_time += timer.time();
|
||||||
timer.stop(); timer.reset(); timer.start();
|
timer.stop(); timer.reset(); timer.start();
|
||||||
|
|
@ -613,7 +613,7 @@ refine_mesh(std::string dump_after_refine_surface_prefix)
|
||||||
std::cerr << "Total refining time: " << timer.time()+elapsed_time << "s" << std::endl;
|
std::cerr << "Total refining time: " << timer.time()+elapsed_time << "s" << std::endl;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
CGAL_triangulation_postcondition(r_tr.is_valid());
|
CGAL_postcondition(r_tr.is_valid());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
(void)(forced_stop()); // sets *error_code
|
(void)(forced_stop()); // sets *error_code
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue