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.
const Handle(V3d_View)& theView,
const Graphic3d_Vec2i& thePnt)
{
- if (myPrevMoveTo == thePnt)
+ if (myPrevMoveTo == thePnt
+ || myHasHlrOnBeforeRotation) // ignore highlighting in-between rotation of HLR view
{
return;
}
const Handle(Graphic3d_Structure)& aStructComp = myStructsComputed.Value (anIndex);
eraseStructure (aStructComp->CStructure());
displayStructure (aStruct->CStructure(), aStruct->DisplayPriority());
+ Update (aStruct->GetZLayer());
}
}
return;
{
Handle(Graphic3d_Structure) aCompStruct;
aStruct->computeHLR (myCamera, aCompStruct);
+ if (aCompStruct.IsNull())
+ {
+ continue;
+ }
aCompStruct->SetHLRValidation (Standard_True);
const Standard_Boolean toComputeWireframe = myVisualization == Graphic3d_TOV_WIREFRAME
Handle(Graphic3d_Structure) aCompStruct = aCompStructOld;
aCompStruct->SetTransformation (Handle(TopLoc_Datum3D)());
theStruct->computeHLR (myCamera, aCompStruct);
+ if (aCompStruct.IsNull())
+ {
+ return;
+ }
+
aCompStruct->SetHLRValidation (Standard_True);
aCompStruct->CalculateBoundBox();
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
{
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);
}
Handle(Prs3d_PresentationShadow) aShadowPrs = Handle(Prs3d_PresentationShadow)::DownCast (aPrs);
if (!aShadowPrs.IsNull() && aView->IsComputed (aShadowPrs->ParentId(), aViewDepPrs))
{
+ const Graphic3d_ZLayerId aZLayer = aShadowPrs->GetZLayer();
aShadowPrs.Nullify();
+
aShadowPrs = new Prs3d_PresentationShadow (myStructureManager, aViewDepPrs);
- aShadowPrs->SetZLayer (aViewDepPrs->CStructure()->ZLayer());
+ aShadowPrs->SetZLayer (aZLayer);
aShadowPrs->SetClipPlanes (aViewDepPrs->ClipPlanes());
aShadowPrs->CStructure()->IsForHighlight = 1;
aShadowPrs->Highlight (aPrs->HighlightStyle());
--- /dev/null
+puts "============"
+puts "0031652: Visualization - crash on highlighting HLR Computed presentation displayed with Shaded display mode"
+puts "============"
+puts ""
+
+pload MODELING VISUALIZATION
+psphere s 1
+vclear
+vinit View1
+vdisplay -dispMode 1 s
+vaxo
+vfit
+
+vhlr on -algoType polyAlgo
+vmoveto 351 64
+
+vdump ${imagedir}/${casename}.png