return 0;
}
else if (aChangeArg == "-set"
- || aChangeArg == "-unset")
+ || aChangeArg == "-unset"
+ || aChangeArg == "-setoverrideglobal")
{
// set / unset plane command
- Standard_Boolean toSet = aChangeArg == "-set";
+ const Standard_Boolean toSet = aChangeArg.StartsWith ("-set");
+ const Standard_Boolean toOverrideGlobal = aChangeArg == "-setoverrideglobal";
Standard_Integer anIt = 1;
for (; anIt < aNbChangeArgs; ++anIt)
{
{
break;
}
- else if (ViewerTest_myViews.IsBound1 (anEntityName))
+ else if (!toOverrideGlobal
+ && ViewerTest_myViews.IsBound1 (anEntityName))
{
Handle(V3d_View) aView = ViewerTest_myViews.Find1 (anEntityName);
if (toSet)
{
aIObj->RemoveClipPlane (aClipPlane);
}
+ if (!aIObj->ClipPlanes().IsNull())
+ {
+ aIObj->ClipPlanes()->SetOverrideGlobal (toOverrideGlobal);
+ }
}
else
{
theCommands.Add("vclipplane",
"vclipplane planeName [{0|1}]"
"\n\t\t: [-equation A B C D]"
- "\n\t\t: [-set|-unset [objects|views]]"
+ "\n\t\t: [-set|-unset|-setOverrideGlobal [objects|views]]"
"\n\t\t: [-maxPlanes]"
"\n\t\t: [-capping {0|1}]"
"\n\t\t: [-color R G B] [-hatch {on|off|ID}]"
--- /dev/null
+puts "============"
+puts "0029768: Visualization, TKOpenGl - structure is entirely clipped by suppressed clipping"
+puts "============"
+puts ""
+
+vclear
+vinit View1
+vaxo
+vpoint p0 0 0 0
+vzbufftrihedron
+box b0 0 0 0 1 1 1
+box b1 3 0 0 1 1 1
+vdisplay -dispMode 1 b0 b1
+vsetcolor b0 RED
+vsetcolor b1 GREEN
+vfit
+
+vclipplane pv equation -1 0 0 0.5 -set
+vclipplane pb0 equation 0 1 0 -0.5 -set b0
+vclipplane pb1 equation 0 1 0 -0.5 -setOverrideGlobal b1
+
+if { [vreadpixel 300 200 rgb name] != "GREEN3" } { puts "Error: box b1 is fully clipped" }
+vdump $imagedir/${casename}.png