Fixes for GCC

This commit is contained in:
Clement Jamin 2013-09-19 19:48:51 +02:00
parent 730d34bb23
commit 0270e3f03d
9 changed files with 51 additions and 40 deletions

View File

@ -11,6 +11,11 @@ else()
cmake_policy(VERSION 2.6)
endif()
## Compiler flags: C++11
if(CMAKE_COMPILER_IS_GNUCXX)
set(CGAL_CXX_FLAGS "${CGAL_CXX_FLAGS} -std=c++0x")
endif()
include_directories(../../include)
include_directories(../../../Triangulation_3/include)
include_directories(../../../STL_Extension/include)
@ -59,17 +64,21 @@ if ( CGAL_FOUND )
list(APPEND CGAL_3RD_PARTY_LIBRARIES ${TBB_LIBRARIES})
endif()
find_package(Boost)
find_package(Boost COMPONENTS program_options REQUIRED)
if ( Boost_FOUND AND Boost_VERSION GREATER 103400 )
include( CGAL_CreateSingleSourceCGALProgram )
add_definitions( "-DCGAL_USE_BOOST_PROGRAM_OPTIONS" )
link_libraries( ${Boost_PROGRAM_OPTIONS_LIBRARY} )
# Compilable examples
create_single_source_cgal_program( "mesh_implicit_sphere.cpp" )
create_single_source_cgal_program( "mesh_implicit_sphere_variable_size.cpp" )
create_single_source_cgal_program( "mesh_two_implicit_spheres_with_balls.cpp" )
# create_single_source_cgal_program( "mesh_implicit_domains.cpp" "implicit_functions.cpp" )
create_single_source_cgal_program( "mesh_polyhedral_domain.cpp" )
create_single_source_cgal_program( "mesh_polyhedral_domain_TEST_ANDREW.cpp" )
create_single_source_cgal_program( "mesh_polyhedral_domain_with_features.cpp" )
if( WITH_CGAL_ImageIO )
create_single_source_cgal_program( "mesh_optimization_example.cpp" )

View File

@ -501,7 +501,7 @@ public:
for (int iVertex = 0 ; success && iVertex < 4 ; ++iVertex)
{
Vertex_handle vh = cell_handle->vertex(iVertex);
success = try_lock_vertex(vh, lock_radius);
success = this->try_lock_vertex(vh, lock_radius);
}
return success;
@ -517,7 +517,7 @@ public:
success && iVertex != facet.second ; iVertex = (iVertex+1)&3)
{
Vertex_handle vh = cell->vertex(iVertex);
success = try_lock_vertex(vh, lock_radius);
success = this->try_lock_vertex(vh, lock_radius);
}
return success;
@ -2516,7 +2516,7 @@ move_point(const Vertex_handle& old_vertex,
CGAL_assertion(could_lock_zone != NULL);
*could_lock_zone = true;
if (!try_lock_vertex(old_vertex)) // LOCK
if (!this->try_lock_vertex(old_vertex)) // LOCK
{
*could_lock_zone = false;
this->unlock_all_elements();
@ -2533,7 +2533,7 @@ move_point(const Vertex_handle& old_vertex,
}
//======= /Get incident cells ==========
if (!try_lock_point(new_position)) // LOCK
if (!this->try_lock_point(new_position)) // LOCK
{
*could_lock_zone = false;
this->unlock_all_elements();
@ -3109,7 +3109,7 @@ try_lock_and_get_incident_cells(const Vertex_handle& v,
Cell_vector &cells) const
{
Cell_handle d = v->cell();
if (!try_lock_element(d)) // LOCK
if (!this->try_lock_element(d)) // LOCK
{
this->unlock_all_elements();
return false;
@ -3126,7 +3126,7 @@ try_lock_and_get_incident_cells(const Vertex_handle& v,
continue;
Cell_handle next = c->neighbor(i);
if (!try_lock_element(next)) // LOCK
if (!this->try_lock_element(next)) // LOCK
{
BOOST_FOREACH(Cell_handle& ch,
std::make_pair(cells.begin(), cells.end()))

View File

@ -718,7 +718,7 @@ compute_move(const Vertex_handle& v)
}
// Update big moves
update_big_moves(local_move_sq_ratio);
this->update_big_moves(local_move_sq_ratio);
return move;
}

View File

@ -204,7 +204,7 @@ operator()(const Point_3& p, const Cell_handle& c) const
#else
const Cell_handle cell = tr_.locate(p,c);
#endif
set_last_cell(cell);
this->set_last_cell(cell);
if ( !tr_.is_infinite(cell) )
return interpolate_on_cell_vertices(p,cell);

View File

@ -550,7 +550,7 @@ public:
previous_level.refine(visitor.previous_level());
if(! no_longer_element_to_refine() )
{
process_one_element(visitor);
this->process_one_element(visitor);
}
}
}
@ -559,7 +559,7 @@ public:
Mesher_level_conflict_status
try_to_refine_element(Element e, Mesh_visitor visitor)
{
const Point& p = refinement_point(e);
const Point& p = this->refinement_point(e);
#ifdef CGAL_MESH_3_VERY_VERBOSE
std::cerr << "Trying to insert point: " << p <<
@ -609,15 +609,15 @@ public:
if(result == NO_CONFLICT)
{
before_insertion(e, p, zone, visitor);
this->before_insertion(e, p, zone, visitor);
Vertex_handle vh = insert(p, zone);
after_insertion(vh, visitor);
this->after_insertion(vh, visitor);
}
else
{
after_no_insertion(e, p, zone, visitor);
this->after_no_insertion(e, p, zone, visitor);
}
return result;
@ -655,7 +655,7 @@ public:
if( result != NO_CONFLICT )
return result;
return private_test_point_conflict(p, zone);
return this->private_test_point_conflict(p, zone);
}
/**
@ -722,6 +722,8 @@ public:
using Base::triangulation;
using Base::insert;
using Base::before_conflicts;
using Base::before_insertion;
using Base::after_insertion;
using Base::previous_level;
using Base::no_longer_element_to_refine;
using Base::pop_next_element;
@ -968,7 +970,7 @@ public:
Mesher_level_conflict_status
try_to_refine_element(Element e, Mesh_visitor visitor)
{
const Point& p = refinement_point(e);
const Point& p = this->refinement_point(e);
#ifdef CGAL_MESH_3_VERY_VERBOSE
std::cerr << "Trying to insert point: " << p <<
@ -1019,23 +1021,23 @@ public:
if(result == NO_CONFLICT)
{
before_insertion(e, p, zone, visitor);
this->before_insertion(e, p, zone, visitor);
Vertex_handle vh = insert(p, zone);
if (vh == Vertex_handle())
{
after_no_insertion(e, p, zone, visitor);
this->after_no_insertion(e, p, zone, visitor);
result = COULD_NOT_LOCK_ZONE;
}
else
{
after_insertion(vh, visitor);
this->after_insertion(vh, visitor);
}
}
else
{
after_no_insertion(e, p, zone, visitor);
this->after_no_insertion(e, p, zone, visitor);
}
return result;
@ -1128,7 +1130,7 @@ public:
if( result != NO_CONFLICT )
return result;
return private_test_point_conflict(p, zone);
return this->private_test_point_conflict(p, zone);
}
/**

View File

@ -384,13 +384,13 @@ public:
Cell_handle get_next_element_impl()
{
return extract_element_from_container_value(Container_::get_next_element_impl());
return this->extract_element_from_container_value(Container_::get_next_element_impl());
}
// Gets the point to insert from the element to refine
Point refinement_point_impl(const Cell_handle& cell) const
{
set_last_vertex_index(
this->set_last_vertex_index(
r_oracle_.index_from_subdomain_index(cell->subdomain_index()) );
// last_vertex_index_ = Index(cell->subdomain_index());
@ -906,7 +906,7 @@ compute_badness(const Cell_handle& cell)
const Is_cell_bad is_cell_bad = r_criteria_(cell);
if( is_cell_bad )
{
this->add_bad_element(from_cell_to_refinement_queue_element(cell), *is_cell_bad);
this->add_bad_element(this->from_cell_to_refinement_queue_element(cell), *is_cell_bad);
}
}

View File

@ -445,7 +445,7 @@ public:
Facet get_next_element_impl()
{
return extract_element_from_container_value(
return this->extract_element_from_container_value(
Container_::get_next_element_impl());
}
@ -468,7 +468,7 @@ public:
<< get_facet_surface_center(facet) << std::endl;
#endif
CGAL_assertion (is_facet_on_surface(facet));
set_last_vertex_index(get_facet_surface_center_index(facet));
this->set_last_vertex_index(get_facet_surface_center_index(facet));
return get_facet_surface_center(facet);
};
@ -720,7 +720,7 @@ private:
// Insert the facet and its mirror
Facet mirror = mirror_facet(facet);
this->add_bad_element(
from_facet_to_refinement_queue_element(facet, mirror_facet(facet)),
this->from_facet_to_refinement_queue_element(facet, mirror_facet(facet)),
quality);
}
@ -1145,7 +1145,7 @@ test_point_conflict_from_superior_impl(const Point& point, Zone& zone,
if ( is_encroached_facet_refinable(*facet_it) )
{
// Even if it doesn't succeed, it will be tried again
try_to_refine_element(*facet_it, visitor);
this->try_to_refine_element(*facet_it, visitor);
return CONFLICT_BUT_ELEMENT_CAN_BE_RECONSIDERED;
}
else
@ -1163,7 +1163,7 @@ test_point_conflict_from_superior_impl(const Point& point, Zone& zone,
if ( is_encroached_facet_refinable(*facet_it) )
{
// Even if it doesn't succeed, it will be tried again
try_to_refine_element(*facet_it, visitor);
this->try_to_refine_element(*facet_it, visitor);
return CONFLICT_BUT_ELEMENT_CAN_BE_RECONSIDERED;
}
else

View File

@ -1301,7 +1301,7 @@ perturb_vertex( PVertex pv
// may be in other threads' queues
else
{
increment_erase_counter(pv.vertex());
this->increment_erase_counter(pv.vertex());
}
// If v has been moved
@ -1572,7 +1572,7 @@ enqueue_task(const PVertex &pv,
Bad_vertices_vector &bad_vertices
) const
{
enqueue_work(
this->enqueue_work(
[&, sliver_bound, pv /*, pqueue, visitor, bad_vertices*/]()
{
bool could_lock_zone;

View File

@ -605,7 +605,7 @@ private:
const double value = sliver_criteria_(tr_.tetrahedron(cit));
if( value < sliver_bound_ )
cells_queue_insert(cit, value);
this->cells_queue_insert(cit, value);
}
}
@ -688,11 +688,11 @@ private:
// Parallel
if (boost::is_convertible<Concurrency_tag, Parallel_tag>::value)
enqueue_task<pump_vertices_on_surfaces>(
ch, get_erase_counter(ch), criterion_value);
ch, this->get_erase_counter(ch), criterion_value);
// Sequential
else
#endif
cells_queue_insert(ch, criterion_value);
this->cells_queue_insert(ch, criterion_value);
}
@ -903,9 +903,9 @@ pump_vertices(double sliver_criterion_limit,
{
Queue_value_type front = *(this->cells_queue_front());
this->cells_queue_pop_front();
Cell_handle c = extract_cell_handle_from_queue_value(front);
double q = extract_cell_quality_from_queue_value(front);
unsigned int ec = extract_erase_counter_from_queue_value(front);
Cell_handle c = this->extract_cell_handle_from_queue_value(front);
double q = this->extract_cell_quality_from_queue_value(front);
unsigned int ec = this->extract_erase_counter_from_queue_value(front);
// Low quality first (i.e. low value of q)
enqueue_task<pump_vertices_on_surfaces>(c, ec, q);
}
@ -933,7 +933,7 @@ pump_vertices(double sliver_criterion_limit,
while( !this->cells_queue_empty() && !is_time_limit_reached() )
{
Queue_value_type front = *(this->cells_queue_front());
Cell_handle c = extract_cell_handle_from_queue_value(front);
Cell_handle c = this->extract_cell_handle_from_queue_value(front);
// Low quality first (i.e. low value of cell quality)
bool vertex_pumped = false;
@ -1441,7 +1441,7 @@ update_mesh(const Weighted_point& new_point,
Umbrella umbrella = get_umbrella(internal_facets, old_vertex);
// Delete old cells from queue (they aren't in the triangulation anymore)
delete_cells_from_queue(deleted_cells);
this->delete_cells_from_queue(deleted_cells);
// Delete old cells & facets from c3t3
remove_from_c3t3(deleted_cells.begin(),deleted_cells.end());
@ -1477,7 +1477,7 @@ void
Slivers_exuder<C3T3,Md,SC,V_,FT>::
enqueue_task(Cell_handle ch, unsigned int erase_counter, double value)
{
enqueue_work(
this->enqueue_work(
[&, ch, erase_counter]()
{
#ifdef CGAL_CONCURRENT_MESH_3_PROFILING