+ Get exact point on data model when picking in 3d view

This commit is contained in:
wmayer
2013-11-21 12:50:49 +01:00
parent f5a4c28f3d
commit 1333cb8734
8 changed files with 91 additions and 11 deletions

View File

@@ -369,3 +369,12 @@ SoPickedPoint* ViewProvider::getPointOnRay(const SbVec3f& pos,const SbVec3f& dir
//return (pick ? pick->copy() : 0); // needs the same instance of CRT under MS Windows
return (pick ? new SoPickedPoint(*pick) : 0);
}
std::vector<Base::Vector3d> ViewProvider::getPickedPoints(const SoPickedPoint* pp) const
{
// the default implementation just returns the picked point from the visual representation
std::vector<Base::Vector3d> pts;
const SbVec3f& vec = pp->getPoint();
pts.push_back(Base::Vector3d(vec[0],vec[1],vec[2]));
return pts;
}