mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0028162: Draw Harness - eliminate usage of deprecated Local Context
Create a general draw command 'VRelation' and drop the old 'relation' commands. Add test cases for new draw command "vrelation". Add two new methods: Activate and Deactivate which activate/deactivate the given selection mode for all displayed objects. Eliminate deprecated local context methods in ObjectCommands, QABugs. Eliminate deprecated local context methods in mfc standard sample and qt samples.
This commit is contained in:
@@ -182,20 +182,20 @@ void CHLRDoc::Fit()
|
||||
void CHLRDoc::OnObjectErase()
|
||||
{
|
||||
Standard_Boolean toUpdateDisplayable = Standard_False;
|
||||
myAISContext->InitCurrent();
|
||||
while (myAISContext->MoreCurrent())
|
||||
myAISContext->InitSelected();
|
||||
while (myAISContext->MoreSelected())
|
||||
{
|
||||
if (myAISContext->Current()->Type() == AIS_KOI_Shape && myCSelectionDialogIsCreated)
|
||||
if (myAISContext->SelectedInteractive()->Type() == AIS_KOI_Shape && myCSelectionDialogIsCreated)
|
||||
{
|
||||
myCSelectionDialog->DiplayableShape()->Remove (Handle(AIS_Shape)::DownCast (myAISContext->Current())->Shape());
|
||||
myCSelectionDialog->DiplayableShape()->Remove (Handle(AIS_Shape)::DownCast (myAISContext->SelectedInteractive())->Shape());
|
||||
toUpdateDisplayable = Standard_True;
|
||||
}
|
||||
|
||||
myAISContext->Erase (myAISContext->Current(), Standard_True);
|
||||
myAISContext->InitCurrent();
|
||||
myAISContext->Erase (myAISContext->SelectedInteractive(), Standard_True);
|
||||
myAISContext->InitSelected();
|
||||
}
|
||||
|
||||
myAISContext->ClearCurrents();
|
||||
myAISContext->ClearSelected();
|
||||
|
||||
if (toUpdateDisplayable)
|
||||
{
|
||||
|
@@ -174,11 +174,11 @@ void CSelectionDialog::UpdateViews()
|
||||
|
||||
// Display chosen shapes in the HLR dialog view.
|
||||
Standard_Boolean OneOrMoreFound = Standard_False;
|
||||
for (myDoc->GetAISContext()->InitCurrent();
|
||||
myDoc->GetAISContext()->MoreCurrent();
|
||||
myDoc->GetAISContext()->NextCurrent())
|
||||
for (myDoc->GetAISContext()->InitSelected();
|
||||
myDoc->GetAISContext()->MoreSelected();
|
||||
myDoc->GetAISContext()->NextSelected())
|
||||
{
|
||||
Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast (myDoc->GetAISContext()->Current());
|
||||
Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast (myDoc->GetAISContext()->SelectedInteractive());
|
||||
if (!anAISShape.IsNull())
|
||||
{
|
||||
OneOrMoreFound = Standard_True;
|
||||
@@ -207,11 +207,11 @@ void CSelectionDialog::OnGetSelectedShapes()
|
||||
myInteractiveContext->Display (myTrihedron);
|
||||
|
||||
Standard_Boolean OneOrMoreFound = Standard_False;
|
||||
for (myDoc->GetAISContext()->InitCurrent();
|
||||
myDoc->GetAISContext()->MoreCurrent();
|
||||
myDoc->GetAISContext()->NextCurrent())
|
||||
for (myDoc->GetAISContext()->InitSelected();
|
||||
myDoc->GetAISContext()->MoreSelected();
|
||||
myDoc->GetAISContext()->NextSelected())
|
||||
{
|
||||
Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast (myDoc->GetAISContext()->Current());
|
||||
Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast (myDoc->GetAISContext()->SelectedInteractive());
|
||||
|
||||
if (!anAISShape.IsNull())
|
||||
{
|
||||
|
Reference in New Issue
Block a user