Subject: CGAL users discussion list
List archive
- From: Stephane Tayeb <>
- To:
- Subject: Re: [cgal-discuss] including optimize_mesh_3.h produces compile error
- Date: Thu, 03 Jun 2010 17:40:51 +0200
Ramin H wrote:
Thanks Stephane, what I found was a minor issue, not the actual bug. The
real bug is still there and I was hoping you could help me resolve it.
Are you able to successfully compile the code I sent you? I am copy/pasting
the code here again:
=======================
#include <CGAL/Mesh_3/global_parameters.h>
#include <CGAL/optimize_mesh_3.h>
int main( int argc, char *argv[] )
{
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Point_3<K> Point_3;
const Point_3 p, q, r, s;
const Point_3& volume_center = CGAL::centroid(p, q, r, s);
return 0;
}
=======================
I am still getting:
error C2039: 'iterator_category' : is not a member of 'CGAL::Point_3<R_>'
d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility 764
Thanks,
-Ramin
Hi again,
The following patches should work better ! They have to be applied in include/CGAL.
Regards,
Stephane.
--
Stephane Tayeb
Software engineer - INRIA Sophia Antipolis
Geometrica Project-Team
Index: Mesh_3/C3T3_helpers.h
===================================================================
--- Mesh_3/C3T3_helpers.h
+++ Mesh_3/C3T3_helpers.h
@@ -26,6 +26,7 @@
#include <CGAL/linear_least_squares_fitting_3.h>
#include <CGAL/Mesh_3/Triangulation_helpers.h>
+#include <CGAL/tuple.h>
#include <boost/optional.hpp>
#include <boost/iterator/transform_iterator.hpp>
@@ -33,6 +34,8 @@
#include <boost/lambda/bind.hpp>
#include <functional>
+#include <vector>
+#include <set>
namespace CGAL {
namespace Mesh_3 {
Index: Mesh_3/dihedral_angle_3.h
===================================================================
--- Mesh_3/dihedral_angle_3.h
+++ Mesh_3/dihedral_angle_3.h
@@ -20,6 +20,7 @@
#ifndef CGAL_MESH_3_DIHEDRAL_ANGLE_3_H
#define CGAL_MESH_3_DIHEDRAL_ANGLE_3_H
+#include <CGAL/number_type_basic.h>
#include <CGAL/Kernel_traits.h>
#include <cmath>
Index: Mesh_3/Triangulation_sizing_field.h
===================================================================
--- Mesh_3/Triangulation_sizing_field.h
+++ Mesh_3/Triangulation_sizing_field.h
@@ -26,6 +26,8 @@
#define CGAL_MESH_3_TRIANGULATION_SIZING_FIELD_H
#include <CGAL/Triangulation_cell_base_3.h>
+#include <CGAL/Triangulation_data_structure_3.h>
+#include <CGAL/Regular_triangulation_3.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
#include <boost/iterator/transform_iterator.hpp>
Index: Mesh_3/global_parameters.h
===================================================================
--- Mesh_3/global_parameters.h
+++ Mesh_3/global_parameters.h
@@ -24,6 +24,8 @@
#ifndef CGAL_MESH_3_GLOBAL_PARAMETERS_H
#define CGAL_MESH_3_GLOBAL_PARAMETERS_H
+#include <CGAL/config.h>
+
#define BOOST_PARAMETER_MAX_ARITY 8
#include <boost/parameter.hpp>
Index: centroid.h
===================================================================
--- centroid.h
+++ centroid.h
@@ -808,20 +808,36 @@
// computes the centroid of a set of kernel objects
// takes an iterator range over kernel objects
+
+// We use two different functions here in order to avoid a wrong match with
+// CGAL::centroid(Point_3, Point_3, Point_3, Point_3)
template < typename InputIterator,
- typename K,
- typename Dim_tag >
+ typename K >
inline
typename Access::Point<K, typename Ambient_dimension<typename
std::iterator_traits<InputIterator>::value_type, K>::type>::type
centroid(InputIterator begin,
InputIterator end,
const K& k,
- Dim_tag tag)
+ Dynamic_dimension_tag tag)
{
typedef typename std::iterator_traits<InputIterator>::value_type
Value_type;
return internal::centroid(begin, end, k,(Value_type*) NULL, tag);
}
+template < typename InputIterator,
+ typename K,
+ int d>
+inline
+typename Access::Point<K, typename Ambient_dimension<typename
std::iterator_traits<InputIterator>::value_type, K>::type>::type
+centroid(InputIterator begin,
+ InputIterator end,
+ const K& k,
+ Dimension_tag<d> tag)
+{
+ typedef typename std::iterator_traits<InputIterator>::value_type
Value_type;
+ return internal::centroid(begin, end, k,(Value_type*) NULL, tag);
+}
+
namespace internal {
// computes the centroid of a set of kernel objects
- [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/02/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/02/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/07/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/07/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/02/2010
Archive powered by MHonArc 2.6.16.