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

0023012: Detection gives incorrect results

This commit is contained in:
ouv
2012-03-26 19:50:04 +04:00
committed by ouv
parent 476ed21f1b
commit 3c9825482f
11 changed files with 263 additions and 47 deletions

View File

@@ -101,6 +101,7 @@ StdSelect_ViewerSelector3d
::StdSelect_ViewerSelector3d():
myprj(new Select3D_Projector()),
mylastzoom(0.0),
mysensmode(StdSelect_SM_WINDOW),
mypixtol(2),
myupdatetol(Standard_True)
{
@@ -118,6 +119,7 @@ StdSelect_ViewerSelector3d
::StdSelect_ViewerSelector3d(const Handle(Select3D_Projector)& aProj):
myprj(aProj),
mylastzoom(0.0),
mysensmode(StdSelect_SM_WINDOW),
mypixtol(2),
myupdatetol(Standard_True)
{
@@ -148,21 +150,6 @@ void StdSelect_ViewerSelector3d::Convert(const Handle(SelectMgr_Selection)& aSel
// Purpose :
//==================================================
void StdSelect_ViewerSelector3d
::Set(const Standard_Integer PixelTolerance)
{
if(mypixtol!=PixelTolerance)
{
mypixtol = PixelTolerance;
myupdatetol = Standard_True;
}
}
//==================================================
// Function: Set
// Purpose :
//==================================================
void StdSelect_ViewerSelector3d
::Set(const Handle(Select3D_Projector)& aProj)
{
@@ -170,6 +157,33 @@ void StdSelect_ViewerSelector3d
toupdate=Standard_True;
}
//==================================================
// Function: SetSensitivityMode
// Purpose :
//==================================================
void StdSelect_ViewerSelector3d
::SetSensitivityMode(const StdSelect_SensitivityMode aMode)
{
mysensmode = aMode;
toupdate = Standard_True;
}
//==================================================
// Function: SetPixelTolerance
// Purpose :
//==================================================
void StdSelect_ViewerSelector3d
::SetPixelTolerance(const Standard_Integer aTolerance)
{
if(mypixtol!=aTolerance)
{
mypixtol = aTolerance;
myupdatetol = Standard_True;
}
}
//==================================================
// Function: SelectPix
// Purpose :
@@ -247,7 +261,7 @@ void StdSelect_ViewerSelector3d
const Standard_Integer YPMax,
const Handle(V3d_View)& aView)
{
if (myupdatetol)
if (myupdatetol && SensitivityMode() == StdSelect_SM_WINDOW)
{
SetSensitivity (aView->Convert (mypixtol));
myupdatetol = Standard_False;
@@ -276,7 +290,7 @@ void StdSelect_ViewerSelector3d
::Pick(const TColgp_Array1OfPnt2d& aPolyline,
const Handle(V3d_View)& aView)
{
if (myupdatetol)
if (myupdatetol && SensitivityMode() == StdSelect_SM_WINDOW)
{
SetSensitivity (aView->Convert (mypixtol));
myupdatetol = Standard_False;
@@ -317,7 +331,7 @@ void StdSelect_ViewerSelector3d
void StdSelect_ViewerSelector3d::
DisplayAreas(const Handle(V3d_View)& aView)
{
if (myupdatetol)
if (myupdatetol && SensitivityMode() == StdSelect_SM_WINDOW)
{
SetSensitivity (aView->Convert (mypixtol));
myupdatetol = Standard_False;
@@ -500,7 +514,7 @@ UpdateProj(const Handle(V3d_View)& aView)
mylastzoom = aView->Scale();
}
if (myupdatetol)
if (myupdatetol && SensitivityMode() == StdSelect_SM_WINDOW)
{
SetSensitivity (aView->Convert (mypixtol));
myupdatetol = Standard_False;
@@ -519,7 +533,7 @@ UpdateProj(const Handle(V3d_View)& aView)
//=============================
void StdSelect_ViewerSelector3d::DisplaySensitive(const Handle(V3d_View)& aViou)
{
if (myupdatetol)
if (myupdatetol && SensitivityMode() == StdSelect_SM_WINDOW)
{
SetSensitivity (aViou->Convert (mypixtol));
myupdatetol = Standard_False;