[CGAL-DISCUSS] A compile error when define Halfedge_handle in the structure

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[CGAL-DISCUSS] A compile error when define Halfedge_handle in the structure

Kwangtaek Kim
[CGAL-DISCUSS] A compile error when define Halfedge_handle in the structure

Hi all,

I am programming on enriched_polyhedron.h and want to use a global structure defined as follows, but it produces an error when compiling because compiler does not recognize the Halfedge_handle. The below structure was declared out of classes in the header file of enriched_polyhedron.h to be used as a global.

struct FEATURE_III_DATA{

                int             curverindex; // current vertex index

                int     facetindex; // the index of facet having the normals

                double  binradius; // bin angle radius

                Halfedge_handle pHalfedgehandle;

};

The error is  error C2146: syntax error : missing ';' before identifier 'pHalfedgehandle'

In the enriched_polyhedron.h below header files are included.

#include <CGAL/Cartesian.h>

#include <CGAL/Polyhedron_3.h>

#include <list>

#include "curvature.h"

How should I fix the compile error to use Halfedge_handle in the Structure?


Thank you for your attention and help in advance.

Samuel

Reply | Threaded
Open this post in threaded view
|

Re: [CGAL-DISCUSS] A compile error when define Halfedge_handle in the structure

Samuel Hornus-2
On Jun 4, 2008, at 9:46 PM, samuel kim wrote:

> Hi all,
>
> I am programming on enriched_polyhedron.h and want to use a global  
> structure defined as follows, but it produces an error when  
> compiling because compiler does not recognize the Halfedge_handle.  
> The below structure was declared out of classes in the header file  
> of “enriched_polyhedron.h” to be used as a global.
>
> struct FEATURE_III_DATA{
>
>   int             curverindex; // current vertex index
>
>                 int     facetindex; // the index of facet having the  
> normals
>
>                 double  binradius; // bin angle radius
>
>                 Halfedge_handle pHalfedgehandle;
>
> }
The structure being defined "out of class" you must tell the compiler  
what a Halfedge_handle is, and do so
in your structure (if I understand your problem correctly):

        typedef  
Enriched_polyhedron<WithYourTemplateParameters>::Halfedge_handle  
Halfedge_handle;
        Halfedge_handle pHalfedgehandle;

--
sam
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss