mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0023012: Detection gives incorrect results
This commit is contained in:
@@ -114,6 +114,7 @@ uses
|
||||
SelectionManager from SelectMgr,
|
||||
PresentationManager3d from PrsMgr,
|
||||
ViewerSelector3d from StdSelect,
|
||||
SensitivityMode from StdSelect,
|
||||
MapOfInteractive from AIS,
|
||||
InteractiveObject from AIS,
|
||||
DisplayMode from AIS,
|
||||
@@ -525,6 +526,17 @@ is
|
||||
-- Removes selection mode from Interactive Objects.
|
||||
-- aMode provides the selection mode index of the entity aniobj.
|
||||
|
||||
SetSensitivityMode(me : mutable;
|
||||
aMode : SensitivityMode from StdSelect) is static;
|
||||
---Level: Public
|
||||
---Purpose: Sets the selection sensitivity mode. SM_WINDOW mode
|
||||
-- uses the specified pixel tolerance to compute the sensitivity
|
||||
-- value, SM_VIEW mode allows to define the sensitivity manually.
|
||||
|
||||
SensitivityMode(me) returns SensitivityMode from StdSelect;
|
||||
---Level: Public
|
||||
---Purpose: Returns the selection sensitivity mode.
|
||||
|
||||
SetSensitivity(me:mutable;
|
||||
aPrecision: Real from Standard);
|
||||
---Level: Public
|
||||
@@ -537,7 +549,11 @@ is
|
||||
-- When a local context is open, the defined sensitivity applies to
|
||||
-- this local context instead of the main context.
|
||||
|
||||
SetSensitivity(me:mutable;
|
||||
Sensitivity (me) returns Real from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the selection sensitivity value.
|
||||
|
||||
SetPixelTolerance(me:mutable;
|
||||
aPrecision: Integer from Standard = 4);
|
||||
---Level: Public
|
||||
---Purpose: Define the current selection pixel sensitivity
|
||||
@@ -545,6 +561,10 @@ is
|
||||
-- Warning: When a local context is open the sensitivity is apply on it
|
||||
-- instead on the main context.
|
||||
|
||||
PixelTolerance(me) returns Integer from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the pixel tolerance.
|
||||
|
||||
---Category: put locations on objects....
|
||||
--
|
||||
|
||||
|
@@ -188,12 +188,7 @@ myIsAutoActivateSelMode( Standard_True )
|
||||
{
|
||||
InitAttributes();
|
||||
mgrSelector->Add(myCollectorSel);
|
||||
#ifdef BUC60688
|
||||
SetSensitivity();
|
||||
#else
|
||||
myCollectorSel->Set(4);
|
||||
#endif
|
||||
|
||||
SetPixelTolerance();
|
||||
}
|
||||
|
||||
void AIS_InteractiveContext::Delete() const
|
||||
@@ -2977,7 +2972,33 @@ void AIS_InteractiveContext::UnsetSelectionMode(const Handle_AIS_InteractiveObje
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef BUC60688
|
||||
//=======================================================================
|
||||
//function : SetSensitivityMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_InteractiveContext::SetSensitivityMode(const StdSelect_SensitivityMode aMode) {
|
||||
|
||||
if( HasOpenedContext() )
|
||||
myLocalContexts(myCurLocalIndex)->SetSensitivityMode(aMode);
|
||||
else {
|
||||
myMainSel->SetSensitivityMode(aMode);
|
||||
if( !myCollectorSel.IsNull() ) myCollectorSel->SetSensitivityMode(aMode);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SensitivityMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
StdSelect_SensitivityMode AIS_InteractiveContext::SensitivityMode() const {
|
||||
|
||||
if( HasOpenedContext() )
|
||||
return myLocalContexts(myCurLocalIndex)->SensitivityMode();
|
||||
return myMainSel->SensitivityMode();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetSensitivity
|
||||
//purpose :
|
||||
@@ -2994,20 +3015,43 @@ void AIS_InteractiveContext::SetSensitivity(const Standard_Real aPrecision) {
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetSensitivity
|
||||
//function : Sensitivity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_InteractiveContext::SetSensitivity(const Standard_Integer aPrecision) {
|
||||
Standard_Real AIS_InteractiveContext::Sensitivity() const {
|
||||
|
||||
if( HasOpenedContext() )
|
||||
myLocalContexts(myCurLocalIndex)->SetSensitivity(aPrecision);
|
||||
return myLocalContexts(myCurLocalIndex)->Sensitivity();
|
||||
return myMainSel->Sensitivity();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPixelTolerance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_InteractiveContext::SetPixelTolerance(const Standard_Integer aPrecision) {
|
||||
|
||||
if( HasOpenedContext() )
|
||||
myLocalContexts(myCurLocalIndex)->SetPixelTolerance(aPrecision);
|
||||
else {
|
||||
myMainSel->Set(aPrecision);
|
||||
if( !myCollectorSel.IsNull() ) myCollectorSel->Set(aPrecision);
|
||||
myMainSel->SetPixelTolerance(aPrecision);
|
||||
if( !myCollectorSel.IsNull() ) myCollectorSel->SetPixelTolerance(aPrecision);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : PixelTolerance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer AIS_InteractiveContext::PixelTolerance() const {
|
||||
|
||||
if( HasOpenedContext() )
|
||||
return myLocalContexts(myCurLocalIndex)->PixelTolerance();
|
||||
return myMainSel->PixelTolerance();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsInLocal
|
||||
@@ -3063,11 +3107,7 @@ void AIS_InteractiveContext::InitAttributes()
|
||||
HLA->SetTypeOfLine(Aspect_TOL_DASH);
|
||||
|
||||
// tolerance to 4 pixels...
|
||||
#ifdef BUC60688
|
||||
SetSensitivity();
|
||||
#else
|
||||
myMainSel->Set(4);
|
||||
#endif
|
||||
SetPixelTolerance();
|
||||
|
||||
// Customizing the drawer for trihedrons and planes...
|
||||
|
||||
|
@@ -72,6 +72,7 @@ uses
|
||||
ListOfFilter from SelectMgr,
|
||||
BRepOwner from StdSelect,
|
||||
ViewerSelector3d from StdSelect,
|
||||
SensitivityMode from StdSelect,
|
||||
InteractiveContext from AIS,
|
||||
ClearMode from AIS,
|
||||
InteractiveObject from AIS,
|
||||
@@ -443,18 +444,37 @@ is
|
||||
HiCol : out NameOfColor from Quantity)
|
||||
returns Boolean from Standard;
|
||||
|
||||
SetSensitivityMode(me : mutable;
|
||||
aMode : SensitivityMode from StdSelect) is static;
|
||||
---Level: Public
|
||||
---Purpose: Sets the selection sensitivity mode. SM_WINDOW mode
|
||||
-- uses the specified pixel tolerance to compute the sensitivity
|
||||
-- value, SM_VIEW mode allows to define the sensitivity manually.
|
||||
|
||||
SensitivityMode(me) returns SensitivityMode from StdSelect;
|
||||
---Level: Public
|
||||
---Purpose: Returns the selection sensitivity mode.
|
||||
|
||||
SetSensitivity(me:mutable;
|
||||
aPrecision: Real from Standard);
|
||||
---Level: Public
|
||||
---Purpose: Define the current selection sensitivity for
|
||||
-- this local context according to the view size.
|
||||
|
||||
SetSensitivity(me:mutable;
|
||||
Sensitivity (me) returns Real from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the selection sensitivity value.
|
||||
|
||||
SetPixelTolerance(me:mutable;
|
||||
aPrecision: Integer from Standard = 2);
|
||||
---Level: Public
|
||||
---Purpose: Define the current selection sensitivity for
|
||||
-- this local context according to the view size.
|
||||
|
||||
PixelTolerance(me) returns Integer from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the pixel tolerance.
|
||||
|
||||
---Category: IMMEDIATE MODE
|
||||
|
||||
|
||||
|
@@ -1224,17 +1224,35 @@ Standard_Boolean AIS_LocalContext::EndImmediateDraw(const Handle(V3d_View)& aVie
|
||||
Standard_Boolean AIS_LocalContext::IsImmediateModeOn() const
|
||||
{return myMainPM->IsImmediateModeOn();}
|
||||
|
||||
#ifdef BUC60688
|
||||
void AIS_LocalContext::SetSensitivityMode(const StdSelect_SensitivityMode aMode) {
|
||||
|
||||
myMainVS->SetSensitivityMode(aMode);
|
||||
}
|
||||
|
||||
StdSelect_SensitivityMode AIS_LocalContext::SensitivityMode() const {
|
||||
|
||||
return myMainVS->SensitivityMode();
|
||||
}
|
||||
|
||||
void AIS_LocalContext::SetSensitivity(const Standard_Real aPrecision) {
|
||||
|
||||
myMainVS->SetSensitivity(aPrecision);
|
||||
}
|
||||
|
||||
void AIS_LocalContext::SetSensitivity(const Standard_Integer aPrecision) {
|
||||
Standard_Real AIS_LocalContext::Sensitivity() const {
|
||||
|
||||
myMainVS->Set(aPrecision);
|
||||
return myMainVS->Sensitivity();
|
||||
}
|
||||
|
||||
void AIS_LocalContext::SetPixelTolerance(const Standard_Integer aPrecision) {
|
||||
|
||||
myMainVS->SetPixelTolerance(aPrecision);
|
||||
}
|
||||
|
||||
Standard_Integer AIS_LocalContext::PixelTolerance() const {
|
||||
|
||||
return myMainVS->PixelTolerance();
|
||||
}
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : SetZLayer
|
||||
|
Reference in New Issue
Block a user