//=======================================================================
OpenGl_LayerList::OpenGl_LayerList (const Standard_Integer theNbPriorities)
-: myNbPriorities (theNbPriorities),
+: myDefaultLayerIndex (0),
+ myNbPriorities (theNbPriorities),
myNbStructures (0),
- myImmediateNbStructures (0)
+ myImmediateNbStructures (0),
+ myModifStateOfRaytraceable (0)
{
// insert default priority layers
myLayers.Append (OpenGl_Layer (myNbPriorities));
myLayers.Append (OpenGl_Layer (myNbPriorities));
myLayerIds.Bind (Graphic3d_ZLayerId_TopOSD, myLayers.Upper());
+
+ myDefaultLayerIndex = myLayerIds.Find (Graphic3d_ZLayerId_Default);
}
//=======================================================================
myLayerIds.UnBind (theLayerId);
// updated sequence indexes in map
- OpenGl_LayerSeqIds::Iterator aMapIt (myLayerIds);
- for ( ; aMapIt.More (); aMapIt.Next ())
+ for (OpenGl_LayerSeqIds::Iterator aMapIt (myLayerIds); aMapIt.More(); aMapIt.Next())
{
- Standard_Integer& aSeqIdx = aMapIt.ChangeValue ();
+ Standard_Integer& aSeqIdx = aMapIt.ChangeValue();
if (aSeqIdx > aRemovePos)
aSeqIdx--;
}
+
+ myDefaultLayerIndex = myLayerIds.Find (Graphic3d_ZLayerId_Default);
}
//=======================================================================
--myImmediateNbStructures;
}
- if (theStructure->IsRaytracable())
+ if (aLayerId == Graphic3d_ZLayerId_Default
+ && theStructure->IsRaytracable())
{
- ++myModificationState;
+ ++myModifStateOfRaytraceable;
}
return;
--myImmediateNbStructures;
}
- if (theStructure->IsRaytracable())
+ if (aSeqId == myDefaultLayerIndex
+ && theStructure->IsRaytracable())
{
- ++myModificationState;
+ ++myModifStateOfRaytraceable;
}
return;
}
// if the structure is not found there, scan through all other layers
if (aLayer.Remove (theStructure, aPriority, Standard_False))
{
+ if (theOldLayerId == Graphic3d_ZLayerId_Default
+ && theStructure->IsRaytracable())
+ {
+ ++myModifStateOfRaytraceable;
+ }
+
--myNbStructures;
if (aLayer.LayerSettings().IsImmediate)
{
OpenGl_Layer& aLayerEx = anIts.ChangeValue();
if (aLayerEx.Remove (theStructure, aPriority, Standard_True))
{
+ if (aSeqId == myDefaultLayerIndex
+ && theStructure->IsRaytracable())
+ {
+ ++myModifStateOfRaytraceable;
+ }
+
--myNbStructures;
if (aLayerEx.LayerSettings().IsImmediate)
{
aCtx->core11fwd->glGetIntegerv (GL_DEPTH_FUNC, &aDefaultSettings.DepthFunc);
aCtx->core11fwd->glGetBooleanv (GL_DEPTH_WRITEMASK, &aDefaultSettings.DepthMask);
- Standard_Integer aSeqId = myLayers.Lower(), aMainId = myLayerIds.Find (Graphic3d_ZLayerId_Default);
+ Standard_Integer aSeqId = myLayers.Lower();
for (OpenGl_SequenceOfLayers::Iterator anIts (myLayers); anIts.More(); anIts.Next(), ++aSeqId)
{
if (theLayersToProcess == OpenGl_LF_Bottom)
{
- if (aSeqId >= aMainId) continue;
+ if (aSeqId >= myDefaultLayerIndex) continue;
}
else if (theLayersToProcess == OpenGl_LF_Upper)
{
- if (aSeqId <= aMainId) continue;
+ if (aSeqId <= myDefaultLayerIndex) continue;
}
else if (theLayersToProcess == OpenGl_LF_Default)
{
- if (aSeqId != aMainId) continue;
+ if (aSeqId != myDefaultLayerIndex) continue;
}
const OpenGl_Layer& aLayer = anIts.Value();