1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030520: VIS - IVtkTools_ShapePicker::GetPickPosition() returns incorrect point

vmoveto and ivtkmoveto commands now print topmost picked 3D point.
This commit is contained in:
kgv
2019-02-26 08:17:19 +03:00
committed by apn
parent 3bb61eb0fe
commit 1e756cb979
6 changed files with 33 additions and 1 deletions

View File

@@ -6704,7 +6704,7 @@ static Standard_Integer VSelect (Draw_Interpretor& di,
//function : VMoveTo
//purpose : Emulates cursor movement to defined pixel position
//=======================================================================
static Standard_Integer VMoveTo (Draw_Interpretor& ,
static Standard_Integer VMoveTo (Draw_Interpretor& theDI,
Standard_Integer theNbArgs,
const char** theArgVec)
{
@@ -6767,6 +6767,17 @@ static Standard_Integer VMoveTo (Draw_Interpretor& ,
}
ViewerTest::CurrentEventManager()->MoveTo (aMousePos.x(), aMousePos.y());
gp_Pnt aTopPnt (RealLast(), RealLast(), RealLast());
const Handle(SelectMgr_EntityOwner)& aDetOwner = aContext->DetectedOwner();
for (Standard_Integer aDetIter = 1; aDetIter <= aContext->MainSelector()->NbPicked(); ++aDetIter)
{
if (aContext->MainSelector()->Picked (aDetIter) == aDetOwner)
{
aTopPnt = aContext->MainSelector()->PickedPoint (aDetIter);
break;
}
}
theDI << aTopPnt.X() << " " << aTopPnt.Y() << " " << aTopPnt.Z();
return 0;
}