1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0029295: Visualization, TKOpenGl - provide distance culling option

Graphic3d_ZLayerSettings::CullingDistance() and ::CullingSize() - added
new properties configuring culling of small and distant objects, disabled by default.
OpenGl_BVHTreeSelector now handles size culling and distance culling in addition to frustom culling.
This commit is contained in:
kgv
2017-11-05 18:07:25 +03:00
committed by bugmaster
parent 761d880766
commit 4ecf34cce7
9 changed files with 245 additions and 30 deletions

View File

@@ -4655,6 +4655,8 @@ inline void printZLayerInfo (Draw_Interpretor& theDI,
theDI << " Immediate: TRUE\n";
}
theDI << " Origin: " << theLayer.Origin().X() << " " << theLayer.Origin().Y() << " " << theLayer.Origin().Z() << "\n";
theDI << " Culling distance: " << theLayer.CullingDistance() << "\n";
theDI << " Culling size: " << theLayer.CullingSize() << "\n";
theDI << " Depth test: " << (theLayer.ToEnableDepthTest() ? "enabled" : "disabled") << "\n";
theDI << " Depth write: " << (theLayer.ToEnableDepthWrite() ? "enabled" : "disabled") << "\n";
theDI << " Depth buffer clearing: " << (theLayer.ToClearDepth() ? "enabled" : "disabled") << "\n";
@@ -4885,6 +4887,33 @@ static int VZLayer (Draw_Interpretor& theDI,
aSettings.SetOrigin (anOrigin);
aViewer->SetZLayerSettings (aLayerId, aSettings);
}
else if (aLayerId != Graphic3d_ZLayerId_UNKNOWN
&& anArgIter + 1 < theArgNb
&& (anArg == "-cullingdistance"
|| anArg == "-cullingdist"
|| anArg == "-culldistance"
|| anArg == "-culldist"
|| anArg == "-distcull"
|| anArg == "-distculling"
|| anArg == "-distanceculling"))
{
Graphic3d_ZLayerSettings aSettings = aViewer->ZLayerSettings (aLayerId);
const Standard_Real aDist = Draw::Atof (theArgVec[++anArgIter]);
aSettings.SetCullingDistance (aDist);
aViewer->SetZLayerSettings (aLayerId, aSettings);
}
else if (aLayerId != Graphic3d_ZLayerId_UNKNOWN
&& anArgIter + 1 < theArgNb
&& (anArg == "-cullingsize"
|| anArg == "-cullsize"
|| anArg == "-sizecull"
|| anArg == "-sizeculling"))
{
Graphic3d_ZLayerSettings aSettings = aViewer->ZLayerSettings (aLayerId);
const Standard_Real aSize = Draw::Atof (theArgVec[++anArgIter]);
aSettings.SetCullingSize (aSize);
aViewer->SetZLayerSettings (aLayerId, aSettings);
}
else if (anArg == "-settings"
|| anArg == "settings")
{
@@ -11548,6 +11577,7 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
theCommands.Add("vzlayer",
"vzlayer [layerId]"
"\n\t\t: [-add|-delete|-get|-settings]"
"\n\t\t: [-origin X Y Z] [-cullDist Distance] [-cullSize Size]"
"\n\t\t: [-enable|-disable {depthTest|depthWrite|depthClear|depthoffset}]"
"\n\t\t: [-enable|-disable {positiveOffset|negativeOffset|textureenv}]"
"\n\t\t: ZLayer list management:"