Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] simple transformation on Mesh_3 vertices
- Date: Tue, 15 Nov 2011 09:56:19 +0100
Use for_each instead.
Sebastien.
Hamid G wrote:
On Mon, Nov 14, 2011 at 12:06 PM, Sebastien Loriot (GeometryFactory)
<>
wrote:
typedef C3t3::Triangulation::Weighted_point Weighted_point;
typrdef C3t3::Triangulation::Finite_vertices_iterator Vertices_iterator;
for (Vertices_iterator itv=c3t3.triangulation().finite_vertices_begin(),
itv_end=c3t3.triangulation().finite_vertices_end();
itv!=itv_end;++itv)
{
itv->point()=
Weighted_point(itv->point().point()+K::Vector_3(x0,y0,z0),
itv->point().weight());
}
Thanks for the help.
I was just wondering how I could do this using a function object
that can be passed to STL's helpers such as 'std::transform'
I tried something like this:
class addoffset : public std::unary_function<Tr::Vertex,void>
{
K::Vector_3 _offset;
public:
explicit addoffset(double x, double y, double z) :
_offset(K::Vector_3(x,y,z)) {}
void operator()(Tr::Vertex& v)
{
v.point()=Weighted_point(v.point().point() + _offset,
v.point().weight());
}
};
addoffset Offset(x0,y0,z0);
std::transform(tr.finite_vertices_begin(), tr.finite_vertices_end(),
tr.finite_vertices_begin(),Offset);
which of-course didn't work.
- [cgal-discuss] simple transformation on Mesh_3 vertices, Hamid G, 11/14/2011
- Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Sebastien Loriot (GeometryFactory), 11/14/2011
- Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Hamid G, 11/14/2011
- Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Sebastien Loriot (GeometryFactory), 11/14/2011
- Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Hamid G, 11/15/2011
- Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Sebastien Loriot (GeometryFactory), 11/15/2011
- Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Hamid G, 11/15/2011
- Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Sebastien Loriot (GeometryFactory), 11/15/2011
- Re: Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Laurent Rineau (GeometryFactory), 11/15/2011
- Re: Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Hamid G, 11/16/2011
- Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Hamid G, 11/15/2011
- Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Sebastien Loriot (GeometryFactory), 11/15/2011
- Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Hamid G, 11/15/2011
- Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Sebastien Loriot (GeometryFactory), 11/14/2011
- Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Hamid G, 11/14/2011
- Re: [cgal-discuss] simple transformation on Mesh_3 vertices, Sebastien Loriot (GeometryFactory), 11/14/2011
Archive powered by MHonArc 2.6.16.