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

0032704: Visualization, Prs3d_Drawer - do not implicitly create aspects within getters

Prs3d_Drawer getters now return NULL instead of implicitly creating "default" aspects.
Added missing initialization of default properties in AIS_InteractiveContext.
AIS_InteractiveContext::setContextToObject() - added missing propagation of Context to child presentations.
This commit is contained in:
kgv
2021-12-01 11:58:39 +03:00
committed by smoskvin
parent 65acdce54c
commit 4f5e934445
14 changed files with 452 additions and 1027 deletions

View File

@@ -128,6 +128,7 @@ myIsAutoActivateSelMode(Standard_True)
myStyles[Prs3d_TypeOfHighlight_LocalDynamic] = new Prs3d_Drawer();
myStyles[Prs3d_TypeOfHighlight_SubIntensity] = new Prs3d_Drawer();
myDefaultDrawer->SetupOwnDefaults();
myDefaultDrawer->SetZLayer(Graphic3d_ZLayerId_Default);
myDefaultDrawer->SetDisplayMode(0);
{
@@ -704,11 +705,15 @@ void AIS_InteractiveContext::HilightWithColor(const Handle(AIS_InteractiveObject
const Standard_Boolean theIsToUpdate)
{
if (theObj.IsNull())
{
return;
}
setContextToObject (theObj);
if (!myObjects.IsBound (theObj))
{
return;
}
const Handle(AIS_GlobalStatus)& aStatus = myObjects (theObj);
aStatus->SetHilightStatus (Standard_True);
@@ -720,7 +725,9 @@ void AIS_InteractiveContext::HilightWithColor(const Handle(AIS_InteractiveObject
}
if (theIsToUpdate)
{
myMainVwr->Update();
}
}
//=======================================================================
@@ -2300,6 +2307,33 @@ gp_Pnt AIS_InteractiveContext::GravityPoint (const Handle(V3d_View)& theView) co
return theView->GravityPoint();
}
//=======================================================================
//function : setContextToObject
//purpose :
//=======================================================================
void AIS_InteractiveContext::setContextToObject (const Handle(AIS_InteractiveObject)& theObj)
{
if (theObj->HasInteractiveContext())
{
if (theObj->myCTXPtr != this)
{
throw Standard_ProgramError("AIS_InteractiveContext - object has been already displayed in another context!");
}
}
else
{
theObj->SetContext (this);
}
for (PrsMgr_ListOfPresentableObjectsIter aPrsIter (theObj->Children()); aPrsIter.More(); aPrsIter.Next())
{
if (Handle(AIS_InteractiveObject) aChild = Handle(AIS_InteractiveObject)::DownCast (aPrsIter.Value()))
{
setContextToObject (aChild);
}
}
}
//=======================================================================
//function : setObjectStatus
//purpose :