Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] error C2662 in creating a surface class for surface meshing

Subject: CGAL users discussion list

List archive

[cgal-discuss] error C2662 in creating a surface class for surface meshing


Chronological Thread 
  • From: <>
  • To:
  • Subject: [cgal-discuss] error C2662 in creating a surface class for surface meshing
  • Date: Sat, 22 Nov 2008 10:15:06 +0100 (CET)

Hello,

I am trying to create my own surface_3 type for the surface mesh generation,
and ran into an error I can't diffuse. This is the essence of my definition
code:

(Line3D, Segment3D and Ray3D were defined in another file as the regular
kernel::line_3 etc.)

class MeshSurface{
public:

class MeshIntersect{
public:
CGAL::Object operator()(MeshSurface surface, Line3D l);
CGAL::Object operator()(MeshSurface surface, Ray3D l);
CGAL::Object operator()(MeshSurface surface, Segment3D l);

MeshIntersect(){}
~MeshIntersect(){}
};

class MeshInitialPoints{
public:

template <class OutputIteratorPoints>
OutputIteratorPoints operator()(MeshSurface surface,
OutputIteratorPoints pts, int n=20)
{
.....
}
}
}
MeshInitialPoints(){}
~MeshInitialPoints(){}
MeshInitialPoints(const MeshInitialPoints& mip){}
MeshInitialPoints& operator=(const MeshInitialPoints&
mip){return (*this);}
};



class MeshTraits{
public:
typedef Point3D Point_3;
typedef Segment3D Segment_3;
typedef Ray3D Ray_3;
typedef Line3D Line_3;
typedef MeshSurface Surface_3;
typedef MeshIntersect Intersect_3;
typedef MeshInitialPoints Construct_initial_points;

MeshIntersect intersect_3_object (){return MeshIntersect();}
MeshInitialPoints construct_initial_points_object (){return
MeshInitialPoints();}
MeshTraits(){}
~MeshTraits(){}
MeshTraits(const MeshTraits& mi){}
MeshTraits& operator=(const MeshTraits& mi){return (*this);}
};

typedef MeshTraits Surface_mesher_traits_3;

MeshSurface():{...}
MeshSurface(const MeshSurface& ms){...}
MeshSurface& operator=(const MeshSurface& ms){return MeshSurface(ms);}
~MeshSurface(){...};
};

I get the error "error C2662:
'MeshSurface::MeshTraits::construct_initial_points_object' : cannot convert
'this' pointer from 'const MeshSurface::MeshTraits' to
'MeshSurface::MeshTraits
&' c:\program files\cgal-3.3\include\cgal\make_surface_mesh.h".

I do have a copy constructor for MeshTraits, so I am missing something here.
Why does that happens?

Thanks,
Amir Vaxman



Archive powered by MHonArc 2.6.16.

Top of Page