Sketcher: improved detection of constraints visuals overlapping

This commit is contained in:
mrlukeparry 2012-07-17 11:00:31 +02:00 committed by logari81
parent b3284357d2
commit 223023d118

View File

@ -1013,14 +1013,17 @@ bool ViewProviderSketch::isConstraintAtPosition(const Base::Vector3d &constrPos,
SoRayPickAction rp(viewer->getViewportRegion()); SoRayPickAction rp(viewer->getViewportRegion());
rp.setRadius(0.1f); rp.setRadius(0.1f);
rp.setPickAll(true);
rp.setRay(SbVec3f(constrPos.x, constrPos.y,constrPos.z), SbVec3f(0, 0, 1) ); rp.setRay(SbVec3f(constrPos.x, constrPos.y, -1.f), SbVec3f(0, 0, 1) );
//problem //problem
rp.apply(edit->constrGroup); // We could narrow it down to just the SoGroup containing the constraints rp.apply(edit->constrGroup); // We could narrow it down to just the SoGroup containing the constraints
// returns a copy of the point // returns a copy of the point
SoPickedPoint *pp = rp.getPickedPoint(); SoPickedPoint *pp = rp.getPickedPoint();
const SoPickedPointList ppl = rp.getPickedPointList();
if(ppl.getLength() > 1)
return true;
if (pp) { if (pp) {
SoPath *path = pp->getPath(); SoPath *path = pp->getPath();
int length = path->getLength(); int length = path->getLength();