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

0030737: Visualization - implementing new selection schemes in context

AIS_SelectionScheme enumeration is defined to set which selection behaviour is used in Select of context
AIS_InteractiveContext is corrected to use single Select method instead of combination of Select/ShiftSelect methods with a selection scheme parameter.
Upgrade: Select() -> SelectDetected/Rectangle/Polygon(AIS_SelectionScheme_Replace), ShiftSelect -> SelectDetected/Rectangle/Polygon(AIS_SelectionScheme_XOR)
This commit is contained in:
nds
2020-09-18 21:36:05 +03:00
committed by bugmaster
parent b735354545
commit 75cf82505b
25 changed files with 656 additions and 224 deletions

View File

@@ -188,7 +188,9 @@ static Standard_Integer BUC60774 (Draw_Interpretor& theDi,
Standard_Integer aXPixMax = aWinWidth;
Standard_Integer aYPixMax = aWinHeight;
AIS_StatusOfPick aPickStatus = anAISContext->Select (aXPixMin, aYPixMin, aXPixMax, aYPixMax, aV3dView, Standard_False);
AIS_StatusOfPick aPickStatus = anAISContext->SelectRectangle (Graphic3d_Vec2i (aXPixMin, aYPixMin),
Graphic3d_Vec2i (aXPixMax, aYPixMax),
aV3dView);
theDi << (aPickStatus == AIS_SOP_NothingSelected
? "status = AIS_SOP_NothingSelected : OK"
: "status = AIS_SOP_NothingSelected : bugged - Faulty ");
@@ -197,7 +199,9 @@ static Standard_Integer BUC60774 (Draw_Interpretor& theDi,
theDi.Eval ("box b 10 10 10");
theDi.Eval (" vdisplay b");
aPickStatus = anAISContext->Select (aXPixMin, aYPixMin, aXPixMax, aYPixMax, aV3dView, Standard_False);
aPickStatus = anAISContext->SelectRectangle (Graphic3d_Vec2i (aXPixMin, aYPixMin),
Graphic3d_Vec2i (aXPixMax, aYPixMax),
aV3dView);
theDi << (aPickStatus == AIS_SOP_OneSelected
? "status = AIS_SOP_OneSelected : OK"
: "status = AIS_SOP_OneSelected : bugged - Faulty ");
@@ -206,7 +210,10 @@ static Standard_Integer BUC60774 (Draw_Interpretor& theDi,
theDi.Eval ("box w 20 20 20 20 20 20");
theDi.Eval (" vdisplay w");
aPickStatus = anAISContext->Select (aXPixMin, aYPixMin, aXPixMax, aYPixMax, aV3dView, Standard_True);
aPickStatus = anAISContext->SelectRectangle (Graphic3d_Vec2i (aXPixMin, aYPixMin),
Graphic3d_Vec2i (aXPixMax, aYPixMax),
aV3dView);
anAISContext->UpdateCurrentViewer();
theDi << (aPickStatus == AIS_SOP_SeveralSelected
? "status = AIS_SOP_SeveralSelected : OK"
: "status = AIS_SOP_SeveralSelected : bugged - Faulty ");

View File

@@ -4250,9 +4250,9 @@ static Standard_Integer OCC26462 (Draw_Interpretor& theDI, Standard_Integer /*th
aCtx->SetWidth (aBox2, 3, Standard_False);
aCtx->MoveTo (305, 322, ViewerTest::CurrentView(), Standard_False);
aCtx->ShiftSelect (Standard_False);
aCtx->SelectDetected (AIS_SelectionScheme_XOR);
aCtx->MoveTo (103, 322, ViewerTest::CurrentView(), Standard_False);
aCtx->ShiftSelect (Standard_False);
aCtx->SelectDetected (AIS_SelectionScheme_XOR);
if (aCtx->NbSelected() != 0)
{
theDI << "ERROR: no boxes must be selected!\n";
@@ -4262,14 +4262,14 @@ static Standard_Integer OCC26462 (Draw_Interpretor& theDI, Standard_Integer /*th
aCtx->SetSelectionSensitivity (aBox1, 2, 5);
aCtx->MoveTo (305, 322, ViewerTest::CurrentView(), Standard_False);
aCtx->ShiftSelect (Standard_False);
aCtx->SelectDetected (AIS_SelectionScheme_XOR);
if (aCtx->NbSelected() != 1)
{
theDI << "ERROR: b1 was not selected\n";
return 1;
}
aCtx->MoveTo (103, 322, ViewerTest::CurrentView(), Standard_False);
aCtx->ShiftSelect (Standard_True);
aCtx->SelectDetected (AIS_SelectionScheme_XOR);
if (aCtx->NbSelected() != 1)
{
theDI << "ERROR: b2 is selected after b1's tolerance increased\n";
@@ -5203,7 +5203,8 @@ static Standard_Integer OCC28310 (Draw_Interpretor& /*theDI*/, Standard_Integer
aCtx->Display (aBoxObj, AIS_Shaded, 0, Standard_False);
ViewerTest::CurrentView()->FitAll();
aCtx->MoveTo (200, 200, ViewerTest::CurrentView(), Standard_True);
aCtx->Select(Standard_True);
aCtx->SelectDetected();
aCtx->UpdateCurrentViewer();
aCtx->Remove (aBoxObj, Standard_True);
// nullify the object explicitly to simulate situation in project,