Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Compilation errors while extending Polyhedron_3

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Compilation errors while extending Polyhedron_3


Chronological Thread 
  • From: Philipp Moeller <>
  • To: NMoreau <>
  • Cc:
  • Subject: Re: [cgal-discuss] Compilation errors while extending Polyhedron_3
  • Date: Sun, 17 Feb 2013 23:47:09 +0100
  • Organization: GeometryFactory

NMoreau
<>
writes:

> Hello!

[...snipped...]

> Here is what I have:
> *In my ExtendedPolyhedron.h file:*
>
> /typedef float number_type;
> typedef CGAL::Simple_cartesian<number_type> ExtendedKernel;
>
> template <class Refs, class T, class P, class Norm>
> class ExtendedFacet : public CGAL::HalfedgeDS_face_base<Refs,T> {
> ...
> };
> template <class Refs, class T, class Tv, class Tf>
> class ExtendedHalfedge : public CGAL::HalfedgeDS_halfedge_base<Refs,T,Tv,Tf>
> {
> ;..
> };
> template <class Refs, class T, class P, class V, class F>
> class ExtendedVertex : public CGAL::HalfedgeDS_vertex_base<Refs, T, P> {
> ...
> };
>
> struct ExtendedItems : public CGAL::Polyhedron_items_3{
> template <class Refs, class Traits>
> struct Face_wrapper{
> typedef typename Traits::Point_3 Point;
> typedef typename Traits::Vector_3 Normal;
> typedef ExtendedFacet<Refs, CGAL::Tag_true, Point, Normal>
> Face;
> };
>
> template <class Refs, class Traits>
> struct Vertex_wrapper{
> typedef typename Traits::Point_3 Point;
> typedef typename Traits::Vector_3 Vector;
> typedef typename Traits::FT F;
> typedef ExtendedVertex<Refs, CGAL::Tag_true, Point, Vector,
> F> Vertex;
> };
>
> template<class Refs, class Traits>
> struct Halfedge_wrapper
> {
> typedef ExtendedHalfedge<Refs, CGAL::Tag_true, CGAL::Tag_true,
> CGAL::Tag_true> Halfedge;
> };
> };
>
> template <class kernel, class items>
> class ExtendedPolyhedron : public CGAL::Polyhedron_3<kernel,items>{
> public:
> typedef typename kernel::FT FT;
> typedef typename kernel::Vector_3 Vector;
> typedef typename kernel::Point_3 Point;
> typedef typename
> CGAL::Polyhedron_3<kernel,items>::Halfedge_data_structure
> HDS;
>
> void compute_normals()
> {
> std::for_each(facets_begin(),facets_end(),Facet_normal());
> }
>
> void computeNormalCycle(bool IsGeod = false, FT radius = 0)
> {
> Normal_cycle<ExtendedPolyhedron&lt;ExtendedKernel, ExtendedItems> >
> estimator;
> estimator.principal_curvature(*this, IsGeod, radius);
> }
>
> };/
>
> *The Facet_normal is computed in a functor:*
>
> /struct Facet_normal // (functor)
> {
> template <class Facet>
> void operator()(Facet& f)
> {
> ...
> }
> };/
>
> *The Normal_cycle class is defined in the file that I have to use without
> modifying it. The ExtendedPolyhedron.h file is included in my Mesh.h file,
> in which I have I have a Mesh class with this attribute:*
> /ExtendedPolyhedron<ExtendedKernel,ExtendedItems> halfedgeMesh;/
>
> ---------------------------------
>
> So this is the structure of the code... Now here are the errors I get. I
> don't understand what is happening:
>
> ---------------------------------
> *In the normal_cycle.h file that I don't have to modify, I have:*
> /template <class _Poly>
> class Normal_cycle
> {
> typedef _Poly Polyhedron;
>
> typedef typename Polyhedron::Halfedge_data_structure HDS;
> typedef typename Polyhedron::Vertex Vertex;
> ...
> Vertex::Vector VKmax(VectPro[1][2],VectPro[2][2],VectPro[3][2]);
> Vertex::Vector VKmin(VectPro[1][1],VectPro[2][1],VectPro[3][1]);/
>
> *What make the following error:*
> /normal_cycle.h: In member function ‘void
> Normal_cycle<_Poly>::principal_curvature(Normal_cycle<_Poly>::Polyhedron&,
> bool, double)’:
> normal_cycle.h:130:4: erreur: need ‘typename’ before
> ‘Normal_cycle<_Poly>::Vertex:: Vector’ because ‘Normal_cycle<_Poly>::Vertex’
> is a dependent scope
> normal_cycle.h:130:19: erreur: expected ‘;’ before ‘VKmax’
> normal_cycle.h:131:4: erreur: need ‘typename’ before
> ‘Normal_cycle<_Poly>::Vertex:: Vector’ because ‘Normal_cycle<_Poly>::Vertex’
> is a dependent scope
> normal_cycle.h:131:19: erreur: expected ‘;’ before ‘VKmin’
> normal_cycle.h:157:19: erreur: ‘VKmax’ was not declared in this scope
> normal_cycle.h:158:19: erreur: ‘VKmin’ was not declared in this scope/
>
> *and this one, which is related to the previous one:*
> /normal_cycle.h:130:4: erreur: dependent-name ‘Normal_cycle<_Poly>::Vertex::
> Vector’ is parsed as a non-type, but instantiation yields a type
> normal_cycle.h:130:4: note: say ‘typename Normal_cycle<_Poly>::Vertex::
> Vector’ if a type is meant
> normal_cycle.h:131:4: erreur: dependent-name ‘Normal_cycle<_Poly>::Vertex::
> Vector’ is parsed as a non-type, but instantiation yields a type
> normal_cycle.h:131:4: note: say ‘typename Normal_cycle<_Poly>::Vertex::
> Vector’ if a type is meant/


Those errors are in a member function principal_curvature which you are
not showing. The code is probably missing the keyword `typename` in
front of some typenames (obscure, I know). A search engine should be
able to help you to find out why you need to add typename in those
places.

> *Moreover it seems that I have a problem with the *
> /void compute_normals()
> {
> std::for_each(facets_begin(),facets_end(),Facet_normal());
> }/

You are trying to use member functions of a base-class. You need to
qualify them with either the name of the base class or `this`, otherwise
they wont be found by normal look-up.

e.g.

std::for_each(this->facets_begin(), this->facets_end(),Facet_normal());

> *Finally, here is the last issue that I have:*
> /normal_cycle.h:211:2: erreur: no matching function for call to
> ‘Normal_cycle<ExtendedPolyhedron&lt;CGAL::Simple_cartesian&lt;float>,
> ExtendedItems> >::AreaFacetTriangle(
> HalfedgeDS_in_place_list_face<...>::Face_handle )
> normal_cycle.h:211:2: note: candidate is:
> normal_cycle.h:343:9: note: double
> Normal_cycle<_Poly>::AreaFacetTriangle(Normal_cycle<_Poly>::Facet_handle&)
> normal_cycle.h:343:9: note: no known conversion for argument 1 from
> ‘CGAL::I_Polyhedron_halfedge<ExtendedHalfedge&lt;CGAL::HalfedgeDS_list_types&lt;...
>> >::Face_handle (aka something)
> to ‘Normal_cycle<ExtendedPolyhedron&lt;CGAL::Simple_cartesian&lt;float>,
> ExtendedItems> >::Facet_handle& (aka the same thing&)
> /

You omitted this member as well. Maybe you should show at least its
signature.

[...snipped...]



Archive powered by MHonArc 2.6.18.

Top of Page