mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0029365: Visualization, TKOpenGl - do not include hidden structures to Rendered within frame statistics
OpenGl_Layer::UpdateCulling() now considers structure as culled in case if it has Hidden state.
This commit is contained in:
parent
944768d277
commit
5dc0517d2d
@ -304,11 +304,14 @@ void OpenGl_FrameStats::FrameEnd (const Handle(OpenGl_Workspace)& theWorkspace)
|
|||||||
|| (aBits & Graphic3d_RenderingParams::PerfCounters_Points) != 0;
|
|| (aBits & Graphic3d_RenderingParams::PerfCounters_Points) != 0;
|
||||||
const Standard_Boolean toCountElems = (aBits & Graphic3d_RenderingParams::PerfCounters_GroupArrays) != 0 || toCountTris || toCountMem;
|
const Standard_Boolean toCountElems = (aBits & Graphic3d_RenderingParams::PerfCounters_GroupArrays) != 0 || toCountTris || toCountMem;
|
||||||
const Standard_Boolean toCountGroups = (aBits & Graphic3d_RenderingParams::PerfCounters_Groups) != 0 || toCountElems;
|
const Standard_Boolean toCountGroups = (aBits & Graphic3d_RenderingParams::PerfCounters_Groups) != 0 || toCountElems;
|
||||||
const Standard_Boolean toCountStructs = (aBits & Graphic3d_RenderingParams::PerfCounters_Structures) != 0 || toCountGroups;
|
const Standard_Boolean toCountStructs = (aBits & Graphic3d_RenderingParams::PerfCounters_Structures) != 0
|
||||||
|
|| (aBits & Graphic3d_RenderingParams::PerfCounters_Layers) != 0 || toCountGroups;
|
||||||
if (toCountStructs)
|
|
||||||
|
myCountersTmp[Counter_NbLayers] = theWorkspace->View()->LayerList().Layers().Size();
|
||||||
|
if (toCountStructs
|
||||||
|
|| (aBits & Graphic3d_RenderingParams::PerfCounters_Layers) != 0)
|
||||||
{
|
{
|
||||||
myCountersTmp[Counter_NbLayers] = theWorkspace->View()->LayerList().Layers().Size();
|
const Standard_Integer aViewId = theWorkspace->View()->Identification();
|
||||||
for (OpenGl_SequenceOfLayers::Iterator aLayerIter (theWorkspace->View()->LayerList().Layers()); aLayerIter.More(); aLayerIter.Next())
|
for (OpenGl_SequenceOfLayers::Iterator aLayerIter (theWorkspace->View()->LayerList().Layers()); aLayerIter.More(); aLayerIter.Next())
|
||||||
{
|
{
|
||||||
const Handle(OpenGl_Layer)& aLayer = aLayerIter.Value();
|
const Handle(OpenGl_Layer)& aLayer = aLayerIter.Value();
|
||||||
@ -320,9 +323,9 @@ void OpenGl_FrameStats::FrameEnd (const Handle(OpenGl_Workspace)& theWorkspace)
|
|||||||
myCountersTmp[Counter_NbStructsNotCulled] += aLayer->NbStructuresNotCulled();
|
myCountersTmp[Counter_NbStructsNotCulled] += aLayer->NbStructuresNotCulled();
|
||||||
if (toCountGroups)
|
if (toCountGroups)
|
||||||
{
|
{
|
||||||
updateStructures (aLayer->CullableStructuresBVH().Structures(), toCountStructs, toCountTris, toCountMem);
|
updateStructures (aViewId, aLayer->CullableStructuresBVH().Structures(), toCountElems, toCountTris, toCountMem);
|
||||||
updateStructures (aLayer->CullableTrsfPersStructuresBVH().Structures(), toCountStructs, toCountTris, toCountMem);
|
updateStructures (aViewId, aLayer->CullableTrsfPersStructuresBVH().Structures(), toCountElems, toCountTris, toCountMem);
|
||||||
updateStructures (aLayer->NonCullableStructures(), toCountStructs, toCountTris, toCountMem);
|
updateStructures (aViewId, aLayer->NonCullableStructures(), toCountElems, toCountTris, toCountMem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -387,7 +390,8 @@ void OpenGl_FrameStats::FrameEnd (const Handle(OpenGl_Workspace)& theWorkspace)
|
|||||||
// function : updateStructures
|
// function : updateStructures
|
||||||
// purpose :
|
// purpose :
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
void OpenGl_FrameStats::updateStructures (const OpenGl_IndexedMapOfStructure& theStructures,
|
void OpenGl_FrameStats::updateStructures (Standard_Integer theViewId,
|
||||||
|
const OpenGl_IndexedMapOfStructure& theStructures,
|
||||||
Standard_Boolean theToCountElems,
|
Standard_Boolean theToCountElems,
|
||||||
Standard_Boolean theToCountTris,
|
Standard_Boolean theToCountTris,
|
||||||
Standard_Boolean theToCountMem)
|
Standard_Boolean theToCountMem)
|
||||||
@ -395,7 +399,8 @@ void OpenGl_FrameStats::updateStructures (const OpenGl_IndexedMapOfStructure& th
|
|||||||
for (OpenGl_IndexedMapOfStructure::Iterator aStructIter (theStructures); aStructIter.More(); aStructIter.Next())
|
for (OpenGl_IndexedMapOfStructure::Iterator aStructIter (theStructures); aStructIter.More(); aStructIter.Next())
|
||||||
{
|
{
|
||||||
const OpenGl_Structure* aStruct = aStructIter.Value();
|
const OpenGl_Structure* aStruct = aStructIter.Value();
|
||||||
if (aStruct->IsCulled())
|
if (aStruct->IsCulled()
|
||||||
|
|| !aStruct->IsVisible (theViewId))
|
||||||
{
|
{
|
||||||
if (theToCountMem)
|
if (theToCountMem)
|
||||||
{
|
{
|
||||||
|
@ -136,7 +136,8 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
//! Updates counters for structures.
|
//! Updates counters for structures.
|
||||||
Standard_EXPORT virtual void updateStructures (const OpenGl_IndexedMapOfStructure& theStructures,
|
Standard_EXPORT virtual void updateStructures (Standard_Integer theViewId,
|
||||||
|
const OpenGl_IndexedMapOfStructure& theStructures,
|
||||||
Standard_Boolean theToCountElems,
|
Standard_Boolean theToCountElems,
|
||||||
Standard_Boolean theToCountTris,
|
Standard_Boolean theToCountTris,
|
||||||
Standard_Boolean theToCountMem);
|
Standard_Boolean theToCountMem);
|
||||||
|
@ -483,7 +483,8 @@ void OpenGl_Layer::updateBVH() const
|
|||||||
// function : UpdateCulling
|
// function : UpdateCulling
|
||||||
// purpose :
|
// purpose :
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
void OpenGl_Layer::UpdateCulling (const OpenGl_BVHTreeSelector& theSelector,
|
void OpenGl_Layer::UpdateCulling (const Standard_Integer theViewId,
|
||||||
|
const OpenGl_BVHTreeSelector& theSelector,
|
||||||
const Standard_Boolean theToTraverse)
|
const Standard_Boolean theToTraverse)
|
||||||
{
|
{
|
||||||
updateBVH();
|
updateBVH();
|
||||||
@ -583,8 +584,11 @@ void OpenGl_Layer::UpdateCulling (const OpenGl_BVHTreeSelector& theSelector,
|
|||||||
const OpenGl_Structure* aStruct = isTrsfPers
|
const OpenGl_Structure* aStruct = isTrsfPers
|
||||||
? myBVHPrimitivesTrsfPers.GetStructureById (aIdx)
|
? myBVHPrimitivesTrsfPers.GetStructureById (aIdx)
|
||||||
: myBVHPrimitives.GetStructureById (aIdx);
|
: myBVHPrimitives.GetStructureById (aIdx);
|
||||||
aStruct->MarkAsNotCulled();
|
if (aStruct->IsVisible (theViewId))
|
||||||
++myNbStructuresNotCulled;
|
{
|
||||||
|
aStruct->MarkAsNotCulled();
|
||||||
|
++myNbStructuresNotCulled;
|
||||||
|
}
|
||||||
if (aHead < 0)
|
if (aHead < 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -124,7 +124,8 @@ public:
|
|||||||
|
|
||||||
//! Update culling state - should be called before rendering.
|
//! Update culling state - should be called before rendering.
|
||||||
//! Traverses through BVH tree to determine which structures are in view volume.
|
//! Traverses through BVH tree to determine which structures are in view volume.
|
||||||
void UpdateCulling (const OpenGl_BVHTreeSelector& theSelector,
|
void UpdateCulling (const Standard_Integer theViewId,
|
||||||
|
const OpenGl_BVHTreeSelector& theSelector,
|
||||||
const Standard_Boolean theToTraverse);
|
const Standard_Boolean theToTraverse);
|
||||||
|
|
||||||
//! Returns TRUE if layer is empty or has been discarded entirely by culling test.
|
//! Returns TRUE if layer is empty or has been discarded entirely by culling test.
|
||||||
|
@ -516,6 +516,7 @@ void OpenGl_LayerList::SetLayerSettings (const Graphic3d_ZLayerId theLaye
|
|||||||
void OpenGl_LayerList::UpdateCulling (const Handle(OpenGl_Workspace)& theWorkspace,
|
void OpenGl_LayerList::UpdateCulling (const Handle(OpenGl_Workspace)& theWorkspace,
|
||||||
const Standard_Boolean theToDrawImmediate)
|
const Standard_Boolean theToDrawImmediate)
|
||||||
{
|
{
|
||||||
|
const Standard_Integer aViewId = theWorkspace->View()->Identification();
|
||||||
const OpenGl_BVHTreeSelector& aSelector = theWorkspace->View()->BVHTreeSelector();
|
const OpenGl_BVHTreeSelector& aSelector = theWorkspace->View()->BVHTreeSelector();
|
||||||
for (OpenGl_IndexedLayerIterator anIts (myLayers); anIts.More(); anIts.Next())
|
for (OpenGl_IndexedLayerIterator anIts (myLayers); anIts.More(); anIts.Next())
|
||||||
{
|
{
|
||||||
@ -525,7 +526,7 @@ void OpenGl_LayerList::UpdateCulling (const Handle(OpenGl_Workspace)& theWorkspa
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
aLayer.UpdateCulling (aSelector, theWorkspace->IsCullingEnabled());
|
aLayer.UpdateCulling (aViewId, aSelector, theWorkspace->IsCullingEnabled());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user