Subject: CGAL users discussion list
List archive
- From: Philipp Möller <>
- To:
- Cc:
- Subject: Re: [cgal-discuss] Re: Adapting Point Set Processing demo
- Date: Fri, 22 Jun 2012 14:01:24 +0200
hugodelgado
<>
writes:
> Thanks again for the reply. I understand what you said, my problem is that
> i'm doing that translations inside the Point_Set_3 file and with that code i
> cannot have a valid iterator that will insert the points inside the same
> deque, the one from the Point_Set_3.
>
> So when i'm inside the point_set_3.h file i call std::transform(begin(),
> end(), std::back_inserter(others), toCentroid), being others a new
> std::vector i've created. But what i wanted was to do something like,
> std::transform(begin(), end(), std::back_inserter(*this), toCentroid), so i
> could insert the points on the same deque.
>
> I understand that i must make a previous step before transform that could
> for example mark all the points for removal, so that after the transform i
> could delete them, cause what i need is to replace the initial points by the
> new translated points.
Would that solve your problem?
std::deque old;
{
std::deque my;
std::transform(old.begin(), old.end(), std::back_inserter(my), myFunc);
std::swap(my, old);
}
Where old is the deque you want to replace.
Alternatively and faster:
std::transform(old.begin(), old.end(), old.begin(), myFunc);
This might be unsafe should anything in myFunc depend on
the old values.
- [cgal-discuss] Adapting Point Set Processing demo, hugodelgado, 06/19/2012
- Re: [cgal-discuss] Adapting Point Set Processing demo, Sebastien Loriot (GeometryFactory), 06/19/2012
- [cgal-discuss] Re: Adapting Point Set Processing demo, hugodelgado, 06/20/2012
- Re: [cgal-discuss] Re: Adapting Point Set Processing demo, Sebastien Loriot (GeometryFactory), 06/20/2012
- [cgal-discuss] Re: Adapting Point Set Processing demo, hugodelgado, 06/22/2012
- Re: [cgal-discuss] Re: Adapting Point Set Processing demo, Philipp Möller, 06/22/2012
- [cgal-discuss] Re: Adapting Point Set Processing demo, hugodelgado, 06/22/2012
- Re: [cgal-discuss] Re: Adapting Point Set Processing demo, Sebastien Loriot (GeometryFactory), 06/20/2012
- [cgal-discuss] Re: Adapting Point Set Processing demo, hugodelgado, 06/20/2012
- Re: [cgal-discuss] Adapting Point Set Processing demo, Sebastien Loriot (GeometryFactory), 06/19/2012
Archive powered by MHonArc 2.6.18.