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

0030824: Visualization, PrsMgr_PresentableObject - A new flag to disable automatic selection of children

A new flag myToPropagateVisualState is introduced for PrsMgr_PresentableObject: by default it is true, it means that the visual state (display/erase/color) should be propagated to all children. If false, the visual state is not propagated.
The flag can be set via the method ToPropagateVisualState() or via Draw command: "vparent <parent> -ignoreVisu"
This commit is contained in:
asl
2019-07-03 11:29:47 +03:00
committed by apn
parent acc6542a1b
commit 0d56f7433b
6 changed files with 167 additions and 27 deletions

View File

@@ -4771,6 +4771,46 @@ static Standard_Integer VChild (Draw_Interpretor& ,
return 0;
}
//=======================================================================
//function : VParent
//purpose :
//=======================================================================
static Standard_Integer VParent(Draw_Interpretor&,
Standard_Integer theNbArgs,
const char** theArgVec)
{
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if (aContext.IsNull())
{
std::cout << "Error: no active view\n";
return 1;
}
if (theNbArgs < 2 )
{
std::cout << theArgVec[0] << " error: expect at least 2 arguments\n";
return 1;
}
TCollection_AsciiString aName(theArgVec[1]);
Handle(AIS_InteractiveObject) aParent;
if (!GetMapOfAIS().Find2(theArgVec[1], aParent))
{
std::cout << "Syntax error: object '" << theArgVec[1] << "' is not found\n";
return 1;
}
ViewerTest_AutoUpdater anUpdateTool(aContext, ViewerTest::CurrentView());
for (Standard_Integer anArgIter = 2; anArgIter < theNbArgs; ++anArgIter)
{
TCollection_AsciiString anArg(theArgVec[anArgIter]);
anArg.LowerCase();
if (anArg == "-ignorevisu")
aParent->SetPropagateVisualState(Standard_False);
}
return 0;
}
//===============================================================================================
//function : VSetSelectionMode
//purpose : vselmode
@@ -6508,6 +6548,12 @@ void ViewerTest::ObjectCommands(Draw_Interpretor& theCommands)
"\n\t\t: Command for testing low-level presentation connections."
"\n\t\t: vconnect command should be used instead.",
__FILE__, VChild, group);
theCommands.Add("vparent",
"vparent parent [-ignoreVisu]"
"\n\t\t: Command for testing object properties as parent in the hierarchy."
"\n\t\t: Arguments:"
"\n\t\t: -ignoreVisu do not propagate the visual state (display/erase/color) to children objects",
__FILE__, VParent, group);
theCommands.Add ("vcomputehlr",
"vcomputehlr shapeInput hlrResult [-algoType {algo|polyAlgo}=polyAlgo]"
"\n\t\t: [eyeX eyeY eyeZ dirX dirY dirZ upX upY upZ]"