Subject: CGAL users discussion list
List archive
- From: Zohar <>
- To:
- Subject: [cgal-discuss] Polyhedron vertex_descriptor
- Date: Tue, 25 Feb 2014 16:55:32 -0800 (PST)
Hi,
I copied the code below from a simplification example in the doc. I replaced
one line:
typedef CGAL::Polyhedron_3<Kernel> Surface;
with
class Surface : public CGAL::Polyhedron_3<Kernel> {};
and I got the error below (after the code).
The error points to graph_traints.hpp:
template <typename G>
struct graph_traits {
#define BOOST_GRAPH_PULL_OPT_MEMBER(name) \
typedef typename detail::BOOST_JOIN(get_opt_member_, name)<G>::type
name;
typedef typename G::vertex_descriptor vertex_descriptor;
Since G is the polyhedron, it should have vertex_descriptor, but it doesn't.
What's going on here?
//////////// CODE
#include <iostream>
#include <fstream>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
// Adaptor for Polyhedron_3
#include <CGAL/Surface_mesh_simplification/HalfedgeGraph_Polyhedron_3.h>
// Simplification function
#include <CGAL/Surface_mesh_simplification/edge_collapse.h>
// Stop-condition policy
#include
<CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h>
// Map used to mark edges as fixed
#include <CGAL/Unique_hash_map.h>
typedef CGAL::Simple_cartesian<double> Kernel;
//typedef CGAL::Polyhedron_3<Kernel> Surface;
//Surface::vertex_descriptor p;
class Surface : public CGAL::Polyhedron_3<Kernel> {};
namespace SMS = CGAL::Surface_mesh_simplification;
//
// BGL property map which indicates whether an edge is border OR is marked
as non-removable
//
class Constrains_map : public boost::put_get_helper<bool, Constrains_map>
{
public:
typedef boost::readable_property_map_tag category;
typedef bool value_type;
typedef bool reference;
typedef boost::graph_traits<Surface const>::edge_descriptor key_type;
Constrains_map() : mConstrains(false) {}
reference operator[](key_type const& e) const { return e->is_border()
||
is_constrained(e); }
void set_is_constrained(key_type const& e, bool is) { mConstrains[e]
= is;
}
bool is_constrained(key_type const& e) const { return
mConstrains.is_defined(e) ? mConstrains[e] : false; }
private:
CGAL::Unique_hash_map<key_type, bool> mConstrains;
};
/////////////// ERROR
1>------ Build started: Project: test1, Configuration: Debug x64 ------
1>Build started 25-Feb-14 19:48:50.
1>ClCompile:
1> test1.cpp
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(57): error
C2039: 'vertex_descriptor' : is not a member of 'Surface'
1> test1.cpp(20) : see declaration of 'Surface'
1> test1.cpp(32) : see reference to class template instantiation
'boost::graph_traits<const Surface>' being compiled
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(57): error
C2146: syntax error : missing ';' before identifier 'vertex_descriptor'
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(57): error
C4430: missing type specifier - int assumed. Note: C++ does not support
default-int
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(57): error
C2602: 'boost::graph_traits<const Surface>::vertex_descriptor' is not a
member of a base class of 'boost::graph_traits<const Surface>'
1> c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(57)
: see declaration of 'boost::graph_traits<const Surface>::vertex_descriptor'
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(57): error
C2868: 'boost::graph_traits<const Surface>::vertex_descriptor' : illegal
syntax for using-declaration; expected qualified-name
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(58): error
C2039: 'edge_descriptor' : is not a member of 'Surface'
1> test1.cpp(20) : see declaration of 'Surface'
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(58): error
C2146: syntax error : missing ';' before identifier 'edge_descriptor'
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(58): error
C4430: missing type specifier - int assumed. Note: C++ does not support
default-int
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(58): error
C2602: 'boost::graph_traits<const Surface>::edge_descriptor' is not a member
of a base class of 'boost::graph_traits<const Surface>'
1> c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(58)
: see declaration of 'boost::graph_traits<const Surface>::edge_descriptor'
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(58): error
C2868: 'boost::graph_traits<const Surface>::edge_descriptor' : illegal
syntax for using-declaration; expected qualified-name
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(65): error
C2039: 'directed_category' : is not a member of 'Surface'
1> test1.cpp(20) : see declaration of 'Surface'
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(65): error
C2146: syntax error : missing ';' before identifier 'directed_category'
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(65): error
C4430: missing type specifier - int assumed. Note: C++ does not support
default-int
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(65): error
C2602: 'boost::graph_traits<const Surface>::directed_category' is not a
member of a base class of 'boost::graph_traits<const Surface>'
1> c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(65)
: see declaration of 'boost::graph_traits<const Surface>::directed_category'
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(65): error
C2868: 'boost::graph_traits<const Surface>::directed_category' : illegal
syntax for using-declaration; expected qualified-name
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(66): error
C2039: 'edge_parallel_category' : is not a member of 'Surface'
1> test1.cpp(20) : see declaration of 'Surface'
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(66): error
C2146: syntax error : missing ';' before identifier 'edge_parallel_category'
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(66): error
C4430: missing type specifier - int assumed. Note: C++ does not support
default-int
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(66): error
C2602: 'boost::graph_traits<const Surface>::edge_parallel_category' is not a
member of a base class of 'boost::graph_traits<const Surface>'
1> c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(66)
: see declaration of 'boost::graph_traits<const
Surface>::edge_parallel_category'
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(66): error
C2868: 'boost::graph_traits<const Surface>::edge_parallel_category' :
illegal syntax for using-declaration; expected qualified-name
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(67): error
C2039: 'traversal_category' : is not a member of 'Surface'
1> test1.cpp(20) : see declaration of 'Surface'
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(67): error
C2146: syntax error : missing ';' before identifier 'traversal_category'
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(67): error
C4430: missing type specifier - int assumed. Note: C++ does not support
default-int
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(67): error
C2602: 'boost::graph_traits<const Surface>::traversal_category' is not a
member of a base class of 'boost::graph_traits<const Surface>'
1> c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(67)
: see declaration of 'boost::graph_traits<const
Surface>::traversal_category'
1>c:\prj-external-libs\boost_1_55\boost/graph/graph_traits.hpp(67): error
C2868: 'boost::graph_traits<const Surface>::traversal_category' : illegal
syntax for using-declaration; expected qualified-name
1>test1.cpp(35): error C2227: left of '->is_border' must point to
class/struct/union/generic type
1> type is 'const Constrains_map::key_type'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:03.15
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Polyhedron-vertex-descriptor-tp4658859.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Polyhedron vertex_descriptor, Zohar, 02/26/2014
- Re: [cgal-discuss] Polyhedron vertex_descriptor, Sebastien Loriot (GeometryFactory), 02/26/2014
- Re: [cgal-discuss] Polyhedron vertex_descriptor, Zohar, 02/26/2014
- Re: [cgal-discuss] Polyhedron vertex_descriptor, Zohar, 02/26/2014
- Re: [cgal-discuss] Polyhedron vertex_descriptor, Sebastien Loriot (GeometryFactory), 02/26/2014
- Re: [cgal-discuss] Polyhedron vertex_descriptor, Zohar, 02/26/2014
- Re: [cgal-discuss] Polyhedron vertex_descriptor, Sebastien Loriot (GeometryFactory), 02/26/2014
- Re: [cgal-discuss] Polyhedron vertex_descriptor, Zohar, 02/26/2014
- Re: [cgal-discuss] Polyhedron vertex_descriptor, Zohar, 02/26/2014
- Re: [cgal-discuss] Polyhedron vertex_descriptor, Zohar, 02/26/2014
- Re: [cgal-discuss] Polyhedron vertex_descriptor, Sebastien Loriot (GeometryFactory), 02/26/2014
Archive powered by MHonArc 2.6.18.