mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0026628: Button Erase (Delete where erase algorythm is used) works incorrect
Update AIS_InteractiveContext::EraseSelected() method. Fix HLR sample Fix samples.
This commit is contained in:
parent
8a53d1c486
commit
7140edaf8e
@ -579,10 +579,8 @@ public:
|
||||
{
|
||||
return;
|
||||
}
|
||||
for(myAISContext()->InitCurrent();myAISContext()->MoreCurrent();myAISContext()->NextCurrent())
|
||||
{
|
||||
myAISContext()->Erase(myAISContext()->Current(),Standard_True);
|
||||
}
|
||||
|
||||
myAISContext()->EraseSelected (Standard_True);
|
||||
myAISContext()->ClearCurrents();
|
||||
}
|
||||
|
||||
|
@ -581,10 +581,8 @@ public:
|
||||
{
|
||||
return;
|
||||
}
|
||||
for(myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
|
||||
{
|
||||
myAISContext()->Erase (myAISContext()->Current(), Standard_True);
|
||||
}
|
||||
|
||||
myAISContext()->EraseSelected (Standard_True);
|
||||
myAISContext()->ClearCurrents();
|
||||
}
|
||||
|
||||
|
@ -188,14 +188,17 @@ void CHLRDoc::Fit()
|
||||
void CHLRDoc::OnObjectErase()
|
||||
{
|
||||
Standard_Boolean toUpdateDisplayable = Standard_False;
|
||||
for (myAISContext->InitCurrent(); myAISContext->MoreCurrent(); myAISContext->NextCurrent())
|
||||
myAISContext->InitCurrent();
|
||||
while (myAISContext->MoreCurrent())
|
||||
{
|
||||
myAISContext->Erase (myAISContext->Current(), Standard_True);
|
||||
if (myAISContext->Current()->Type() == AIS_KOI_Shape && myCSelectionDialogIsCreated)
|
||||
{
|
||||
myCSelectionDialog->DiplayableShape()->Remove (Handle(AIS_Shape)::DownCast (myAISContext->Current())->Shape());
|
||||
toUpdateDisplayable = Standard_True;
|
||||
}
|
||||
|
||||
myAISContext->Erase (myAISContext->Current(), Standard_True);
|
||||
myAISContext->InitCurrent();
|
||||
}
|
||||
|
||||
myAISContext->ClearCurrents();
|
||||
|
@ -293,10 +293,7 @@ void OCC_3dBaseDoc::OnUpdateObjectColor(CCmdUI* pCmdUI)
|
||||
|
||||
void OCC_3dBaseDoc::OnObjectErase()
|
||||
{
|
||||
for (myAISContext->InitCurrent(); myAISContext->MoreCurrent(); myAISContext->NextCurrent())
|
||||
{
|
||||
myAISContext->Erase (myAISContext->Current(), Standard_True);
|
||||
}
|
||||
myAISContext->EraseSelected();
|
||||
myAISContext->ClearCurrents();
|
||||
}
|
||||
void OCC_3dBaseDoc::OnUpdateObjectErase(CCmdUI* pCmdUI)
|
||||
|
@ -234,8 +234,7 @@ void DocumentCommon::onTransparency()
|
||||
|
||||
void DocumentCommon::onDelete()
|
||||
{
|
||||
for ( myContext->InitCurrent(); myContext->MoreCurrent(); myContext->NextCurrent() )
|
||||
myContext->Erase( myContext->Current(), false);
|
||||
myContext->EraseSelected (Standard_False);
|
||||
myContext->ClearSelected();
|
||||
getApplication()->onSelectionChanged();
|
||||
}
|
||||
|
@ -724,11 +724,17 @@ void AIS_InteractiveContext::EraseSelected (const Standard_Boolean theToUpdateVi
|
||||
|
||||
Standard_Boolean isFound = Standard_False;
|
||||
Handle(AIS_Selection) aSelIter = AIS_Selection::Selection(myCurrentName.ToCString());
|
||||
for (aSelIter->Init(); aSelIter->More(); aSelIter->Next())
|
||||
|
||||
aSelIter->Init();
|
||||
while (aSelIter->More())
|
||||
{
|
||||
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (aSelIter->Value());
|
||||
Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (aSelIter->Value());
|
||||
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
|
||||
|
||||
Erase (anObj, Standard_False);
|
||||
isFound = Standard_True;
|
||||
|
||||
aSelIter->Init();
|
||||
}
|
||||
|
||||
if (isFound && theToUpdateViewer)
|
||||
|
Loading…
x
Reference in New Issue
Block a user