mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-16 10:54:53 +03:00
0022795: Make possible to display some presentable objects in overlay of others, groupped by display priority
This commit is contained in:
parent
270a5d4e0c
commit
71c4f9c655
@ -3194,7 +3194,13 @@ Standard_Integer AIS_InteractiveContext::GetZLayer (const Handle(AIS_Interactive
|
||||
return -1;
|
||||
|
||||
if (myObjects.IsBound (theIObj))
|
||||
{
|
||||
return theIObj->GetZLayer (myMainPM);
|
||||
}
|
||||
else if (HasOpenedContext ())
|
||||
{
|
||||
return myLocalContexts (myCurLocalIndex)->GetZLayer (theIObj);
|
||||
}
|
||||
|
||||
return myLocalContexts (myCurLocalIndex)->GetZLayer (theIObj);
|
||||
return -1;
|
||||
}
|
||||
|
@ -509,6 +509,9 @@ const Handle(WNT_Window) theWindow = *(Handle(WNT_Window) *) &AWindow;
|
||||
MyGraphicDriver->ClipLimit (MyCView, AWait);
|
||||
MyGraphicDriver->Environment(MyCView);
|
||||
|
||||
// Make view manager z layer list consistent with the view's list.
|
||||
MyViewManager->InstallZLayers (this);
|
||||
|
||||
// Update planses of model clipping
|
||||
UpdatePlanes ();
|
||||
|
||||
|
@ -302,6 +302,13 @@ is
|
||||
-- from lowest layer to highest ( foreground ). The first layer ID
|
||||
-- in sequence is the default layer that can't be removed.
|
||||
|
||||
InstallZLayers ( me;
|
||||
theView : View from Visual3d )
|
||||
is private;
|
||||
---Purpose: Install z layers managed by the view manager into the
|
||||
-- controlled view. This method used on the view initialization to
|
||||
-- make the layer lists consistent.
|
||||
|
||||
getZLayerGenId ( myclass )
|
||||
---Purpose: Returns global instance of z layer ids generator.
|
||||
---C++: return &
|
||||
|
@ -1248,3 +1248,26 @@ Aspect_GenId& Visual3d_ViewManager::getZLayerGenId ()
|
||||
static Aspect_GenId aGenId (1, IntegerLast());
|
||||
return aGenId;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : InstallZLayers
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Visual3d_ViewManager::InstallZLayers(const Handle(Visual3d_View)& theView) const
|
||||
{
|
||||
if (!MyDefinedView.Contains (theView))
|
||||
return;
|
||||
|
||||
// erase and insert layers iteratively to provide the same layer order as
|
||||
// in the view manager's sequence. This approach bases on the layer insertion
|
||||
// order: the new layers are always appended to the end of the list
|
||||
// inside of view, while layer remove operation doesn't affect the order.
|
||||
// Starting from second layer : no need to change the default z layer.
|
||||
for (Standard_Integer aSeqIdx = 2; aSeqIdx <= myLayerSeq.Length (); aSeqIdx++)
|
||||
{
|
||||
Standard_Integer aLayerID = myLayerSeq.Value (aSeqIdx);
|
||||
theView->RemoveZLayer (aLayerID);
|
||||
theView->AddZLayer (aLayerID);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user