1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0032388: Visualization - provide ray-picking interface with zero tolerance for rectangular frustum

This commit is contained in:
osa
2021-05-25 17:57:48 +03:00
committed by bugmaster
parent 807340d924
commit 0038de11f4
7 changed files with 63 additions and 8 deletions

View File

@@ -50,7 +50,7 @@ public:
//! Allows to manage sensitivity of a particular sensitive entity
void SetSensitivityFactor (const Standard_Integer theNewSens)
{
Standard_ASSERT_RAISE (theNewSens > 0, "Error! Selection sensitivity have positive value.");
Standard_ASSERT_RAISE (theNewSens >= 0, "Error! Selection sensitivity should not be negative value.");
mySFactor = theNewSens;
}

View File

@@ -364,8 +364,8 @@ Handle(SelectMgr_BaseIntersector) SelectMgr_RectangularFrustum::ScaleAndTransfor
Standard_ASSERT_RAISE (mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
"Error! SelectMgr_RectangularFrustum::ScaleAndTransform() should be called after selection frustum initialization");
Standard_ASSERT_RAISE (theScaleFactor > 0,
"Error! Pixel tolerance for selection should be greater than zero");
Standard_ASSERT_RAISE (theScaleFactor >= 0,
"Error! Pixel tolerance for selection should not be negative");
Handle(SelectMgr_RectangularFrustum) aRes = new SelectMgr_RectangularFrustum();
const Standard_Boolean isToScale = theScaleFactor != 1;

View File

@@ -574,7 +574,7 @@ void SelectMgr_SelectionManager::SetSelectionSensitivity (const Handle(SelectMgr
const Standard_Integer theMode,
const Standard_Integer theNewSens)
{
Standard_ASSERT_RAISE (theNewSens > 0, "Error! Selection sensitivity have positive value.");
Standard_ASSERT_RAISE (theNewSens >= 0, "Error! Selection sensitivity should not be negative value.");
if (theObject.IsNull())
{
return;

View File

@@ -78,7 +78,7 @@ void SelectMgr_ToleranceMap::Decrement (const Standard_Integer& theTolerance)
if (theTolerance == myLargestKey
&& *aFreq == 0)
{
myLargestKey = 0;
myLargestKey = -1;
for (NCollection_DataMap<Standard_Integer, Standard_Integer>::Iterator anIter (myTolerances); anIter.More(); anIter.Next())
{
if (anIter.Value() != 0)

View File

@@ -40,7 +40,7 @@ public:
//! Returns a current tolerance that must be applied
Standard_Integer Tolerance() const
{
if (myLargestKey < Precision::Confusion())
if (myLargestKey < 0)
{
return 2; // default tolerance value
}

View File

@@ -1898,9 +1898,9 @@ struct ViewerTest_AspectsChangeSet
Message::SendFail() << "Error: the max parameter value should be greater than zero (specified " << MaxParamValue << ")";
isOk = Standard_False;
}
if (Sensitivity <= 0 && ToSetSensitivity)
if (Sensitivity < 0 && ToSetSensitivity)
{
Message::SendFail() << "Error: sensitivity parameter value should be positive (specified " << Sensitivity << ")";
Message::SendFail() << "Error: sensitivity parameter value should not be negative (specified " << Sensitivity << ")";
isOk = Standard_False;
}
if (ToSetHatch == 1 && StdHatchStyle < 0 && PathToHatchPattern == "")