yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #14463
Re: Yade is not compatible with CGAL_4.13
-
To:
yade-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Fri, 4 Jan 2019 19:46:53 +0100
-
Face:
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEUBAQEtLS1KSkpRUVFXV1dYWFhjY2Nzc3N3d3eHh4eKioqdnZ24uLjLy8vc3NxVIagyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AIVEzgS1fgQtQAAAjRJREFUOMtt1DFv00AUAOAzFQNbjigSyoQaRaBMhKgLUyKXpVNNeUpk9vyDqFJhQ1kiBuaqAwJCqvPtSLY7RlTn5+5IdnYkkt/AOyfxXVLe5vf53Z1875kd34tOEax8djmj6GyjhB5bxz50GdsVZr9fqRjZwAtKOJw5Wqs2MMZ16ALHsaDncF7xAHix1oEFHAB8f+pRjcO4gfZDykcYzbiucRolOLUJ6kjA0xtVt+A6TySlM0RajIpK6DzwKZ/nOYbF/gclHMo1ZOHYY/+Ha+AWuM+3oMS4eeqYzZ8FiCltgUqI8cd2wwAVpJk+8LWYjBtnJdQpHQqJMd4Oxt4bU9ESiFGc5hkqaH74asAX4iabP5I5gZ+qjgGlJCqZa3h3lxhoeVcSE1qLQC4sqKOK9MGW9E3izFqqHokoztLFEgXg31sbZEKnWi2T74A4NxfVQqlkjKtcAWD+zcArFEES01dR0E/nnV0IgugmDd/2L84sOAouRBBHEc7gtc8teDkRlE0iNQPo2w3Xhh/D4TCIQ4LRLoTvgwjj6RRgavdurxYGMaIuGOyAW/PpNlCcU9/93AHenAWYjPoAwa+G3e3to/MgFNTAEKvKDjzuCzHTnY3qqdXtx24VijzQfZ0yewZ5cwRFQaa+mIYr1uI0I76+3W4xhlvoVRwOA0Fdl64HlJnxP6T8YpX/Lga4Wv4A3ErrU5oTfN7Mu/llXMl8RXEPji/lQkN3H7qXqgC2By47EXeU/7PJ/wPxRKMnuZwIeAAAAABJRU5ErkJggg==
-
In-reply-to:
<f8702ef2-9ebd-4190-bea6-676c2fe3f7a4@Spark>
It appears that this function move_point(…) had long been deprecated.
I guess that's got something to do with previous modifications where we
had to use weighted points differently.
I propose to modify this line into calling move(…) instead.
This isn't change like the previous one where the C++ template
structure was changed and I had to dwell deeply into code to recover
the original implementation. This is a "small" change of the code
which I did not write, so I suppose that Bruno I will need you to
certify this.
Let's see the code in old version:
/usr/include/CGAL/Regular_triangulation_3.h
#ifndef CGAL_NO_DEPRECATED_CODE
template < class Gt, class Tds, class Lds >
typename Delaunay_triangulation_3<Gt,Tds,Default,Lds>::Vertex_handle
Delaunay_triangulation_3<Gt,Tds,Default,Lds>::
move_point(Vertex_handle v, const Point & p)
{
CGAL_triangulation_precondition(! is_infinite(v));
CGAL_triangulation_expensive_precondition(is_vertex(v));
// Dummy implementation for a start.
// Remember an incident vertex to restart
// the point location after the removal.
Cell_handle c = v->cell();
Vertex_handle old_neighbor = c->vertex(c->index(v) == 0 ? 1 : 0);
CGAL_triangulation_assertion(old_neighbor != v);
remove(v);
if (dimension() <= 0)
return insert(p);
return insert(p, old_neighbor->cell());
}
#endif
And the code in new version:
/usr/include/CGAL/Regular_triangulation_3.h
template <class Gt, class Tds, class Lds >
typename Regular_triangulation_3<Gt,Tds,Lds>::Vertex_handle
Regular_triangulation_3<Gt,Tds,Lds>::
move(Vertex_handle v, const Weighted_point& p)
{
CGAL_triangulation_precondition(!is_infinite(v));
if(v->point() == p)
return v;
Self tmp;
Vertex_remover<Self> remover(tmp);
Vertex_inserter<Self> inserter(*this);
return Tr_Base::move(v,p,remover,inserter);
}
Which calls tr_Base::move(…) from file:
/usr/include/CGAL/Triangulation_3.h
template < class Gt, class Tds, class Lds >
template < class VertexRemover, class VertexInserter >
typename Triangulation_3<Gt,Tds,Lds>::Vertex_handle
Triangulation_3<Gt,Tds,Lds>::
move(Vertex_handle v, const Point& p,
VertexRemover& remover, VertexInserter& inserter)
{
CGAL_assertion(remover.hidden_points_begin() == remover.hidden_points_end());
CGAL_triangulation_precondition(!is_infinite(v));
if(v->point() == p)
return v;
Vertex_handle w = move_if_no_collision(v,p,remover,inserter);
if(w != v)
{
remove(v, remover);
return w;
}
return v;
}
Also let's look at the documentation for move_point:
https://doc.cgal.org/latest/Periodic_3_triangulation_3/classCGAL_1_1Periodic__3__Delaunay__triangulation__3.html#aa06932079eb7cf6eee8c5c9998088e34
It says that it is just a little more optimized regular move. So it
may be not surprise that those codes are not exactly the same. Maybe
move_point became obsolete, because they removed the inefficiency
that was present in older versions.
Note that this function was NOT removed from periodic triangulations.
This may be important since yade works in periodic too. So perhaps in
Tesselation.ipp there should be a separate move(…) function for
periodic cases, to use the old move_point function again when it is
possible. Bruno?
The compilation passed all tests and checks. But do those tests cover
the call of _Tesselation<TT>::VertexHandle _Tesselation<TT>::move(…) ?
To encourage discussion I am making a small git commit with one line changed ;)
best regards
Janek Kozicki
Follow ups
References