Commit 331456cd authored by Sylvain Thery's avatar Sylvain Thery

topo selection bug

parent 6bc4d3b7
...@@ -622,22 +622,23 @@ Dart TopoRender::raySelection(MAP& map, const Geom::Vec3f& rayA, const Geom::Vec ...@@ -622,22 +622,23 @@ Dart TopoRender::raySelection(MAP& map, const Geom::Vec3f& rayA, const Geom::Vec
double dist2 = std::numeric_limits<double>::max(); double dist2 = std::numeric_limits<double>::max();
for(Dart d = map.begin(); d!=map.end(); map.next(d)) for(Dart d = map.begin(); d!=map.end(); map.next(d))
{ if (!map.isBoundaryMarkedCurrent(d))
// get back position of segment PQ
const Geom::Vec3f& P = m_bufferDartPosition[attIndex[d]];
const Geom::Vec3f& Q =m_bufferDartPosition[attIndex[d]+1];
float ld2 = Geom::squaredDistanceLine2Seg(rayA, rayAB, AB2, P, Q);
if (ld2<dm2)
{ {
Geom::Vec3f V = (P+Q)/2.0f - rayA; // get back position of segment PQ
double d2 = double(V*V); const Geom::Vec3f& P = m_bufferDartPosition[attIndex[d]];
if (d2<dist2) const Geom::Vec3f& Q =m_bufferDartPosition[attIndex[d]+1];
float ld2 = Geom::squaredDistanceLine2Seg(rayA, rayAB, AB2, P, Q);
if (ld2<dm2)
{ {
dist2 = d2; Geom::Vec3f V = (P+Q)/2.0f - rayA;
dFinal = d; double d2 = double(V*V);
if (d2<dist2)
{
dist2 = d2;
dFinal = d;
}
} }
} }
}
return dFinal; return dFinal;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment