1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0031652: Visualization - crash on highlighting HLR Computed presentation displayed with Shaded display mode

PrsMgr_PresentationManager::displayImmediate() now uses proper ZLayer for a shadow presentation
of computed presentation (fixes dynamic highlighting on mouse move).
Graphic3d_CView::SetComputedMode() - added invalidation of bounding box on turning OFF compute mode.
AIS_ViewController::contextLazyMoveTo() now ignores MoveTo() while rotating
view with temporary disabled compute mode (leading to undefined results and crashes).

Graphic3d_Structure::Graphic3d_Structure() - do not copy Graphic3d_TOS_COMPUTED visual
from linked structure, as Graphic3d_CView::SetComputedMode() does not compute such structures.
This commit is contained in:
kgv
2020-07-04 23:37:04 +03:00
committed by bugmaster
parent 72e9e86732
commit 6d1d35e4b8
5 changed files with 41 additions and 5 deletions

View File

@@ -189,6 +189,7 @@ void Graphic3d_CView::SetComputedMode (const Standard_Boolean theMode)
const Handle(Graphic3d_Structure)& aStructComp = myStructsComputed.Value (anIndex);
eraseStructure (aStructComp->CStructure());
displayStructure (aStruct->CStructure(), aStruct->DisplayPriority());
Update (aStruct->GetZLayer());
}
}
return;
@@ -223,6 +224,10 @@ void Graphic3d_CView::SetComputedMode (const Standard_Boolean theMode)
{
Handle(Graphic3d_Structure) aCompStruct;
aStruct->computeHLR (myCamera, aCompStruct);
if (aCompStruct.IsNull())
{
continue;
}
aCompStruct->SetHLRValidation (Standard_True);
const Standard_Boolean toComputeWireframe = myVisualization == Graphic3d_TOV_WIREFRAME
@@ -303,6 +308,11 @@ void Graphic3d_CView::ReCompute (const Handle(Graphic3d_Structure)& theStruct)
Handle(Graphic3d_Structure) aCompStruct = aCompStructOld;
aCompStruct->SetTransformation (Handle(TopLoc_Datum3D)());
theStruct->computeHLR (myCamera, aCompStruct);
if (aCompStruct.IsNull())
{
return;
}
aCompStruct->SetHLRValidation (Standard_True);
aCompStruct->CalculateBoundBox();
@@ -774,7 +784,10 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure)
aStruct->SetTransformation (Handle(TopLoc_Datum3D)());
}
theStructure->computeHLR (myCamera, aStruct);
if (aStruct.IsNull())
{
return;
}
aStruct->SetHLRValidation (Standard_True);
// TOCOMPUTE and COMPUTED associated to sequences are added

View File

@@ -49,8 +49,11 @@ Graphic3d_Structure::Graphic3d_Structure (const Handle(Graphic3d_StructureManage
{
if (!theLinkPrs.IsNull())
{
myOwner = theLinkPrs->myOwner;
myVisual = theLinkPrs->myVisual;
myOwner = theLinkPrs->myOwner;
if (theLinkPrs->myVisual != Graphic3d_TOS_COMPUTED)
{
myVisual = theLinkPrs->myVisual;
}
myComputeVisual = theLinkPrs->myComputeVisual;
myCStructure = theLinkPrs->myCStructure->ShadowLink (theManager);
}