thePrsObj->Compute (this, Handle(Prs3d_Presentation)(), theMode);
}
- for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
+ if (thePrsObj->ToPropagateVisualState())
{
- Display (anIter.Value(), theMode);
+ for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
+ {
+ Display(anIter.Value(), theMode);
+ }
}
}
void PrsMgr_PresentationManager::Erase (const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode)
{
- for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
+ if (thePrsObj->ToPropagateVisualState())
{
- Erase (anIter.Value(), theMode);
+ for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
+ {
+ Erase(anIter.Value(), theMode);
+ }
}
PrsMgr_Presentations& aPrsList = thePrsObj->Presentations();
void PrsMgr_PresentationManager::Clear (const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode)
{
- for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
+ if (thePrsObj->ToPropagateVisualState())
{
- Clear (anIter.Value(), theMode);
+ for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
+ {
+ Clear(anIter.Value(), theMode);
+ }
}
const Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode);
const Standard_Integer theMode,
const Standard_Boolean theValue)
{
- for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
+ if (thePrsObj->ToPropagateVisualState())
{
- SetVisibility (anIter.Value(), theMode, theValue);
+ for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
+ {
+ SetVisibility(anIter.Value(), theMode, theValue);
+ }
}
if (!thePrsObj->HasOwnPresentations())
{
// =======================================================================
void PrsMgr_PresentationManager::Unhighlight (const Handle(PrsMgr_PresentableObject)& thePrsObj)
{
- for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
+ if (thePrsObj->ToPropagateVisualState())
{
- Unhighlight (anIter.Value());
+ for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
+ {
+ Unhighlight(anIter.Value());
+ }
}
const PrsMgr_Presentations& aPrsList = thePrsObj->Presentations();
const Standard_Integer theMode,
const Standard_Integer theNewPrior) const
{
- for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
+ if (thePrsObj->ToPropagateVisualState())
{
- SetDisplayPriority (anIter.Value(), theMode, theNewPrior);
+ for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
+ {
+ SetDisplayPriority(anIter.Value(), theMode, theNewPrior);
+ }
}
const Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode);
Standard_Integer PrsMgr_PresentationManager::DisplayPriority (const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode) const
{
- for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
+ if (thePrsObj->ToPropagateVisualState())
{
- Standard_Integer aPriority = DisplayPriority (anIter.Value(), theMode);
- if (aPriority != 0)
+ for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
{
- return aPriority;
+ Standard_Integer aPriority = DisplayPriority(anIter.Value(), theMode);
+ if (aPriority != 0)
+ {
+ return aPriority;
+ }
}
}
Standard_Boolean PrsMgr_PresentationManager::IsDisplayed (const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode) const
{
- for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
+ if (thePrsObj->ToPropagateVisualState())
{
- if (IsDisplayed (anIter.Value(), theMode))
+ for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
{
- return Standard_True;
+ if (IsDisplayed(anIter.Value(), theMode))
+ {
+ return Standard_True;
+ }
}
}
Standard_Boolean PrsMgr_PresentationManager::IsHighlighted (const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode) const
{
- for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
+ if (thePrsObj->ToPropagateVisualState())
{
- if (IsHighlighted (anIter.Value(), theMode))
+ for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
{
- return Standard_True;
+ if (IsHighlighted(anIter.Value(), theMode))
+ {
+ return Standard_True;
+ }
}
}
void PrsMgr_PresentationManager::SetZLayer (const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Graphic3d_ZLayerId theLayerId)
{
- for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
+ if (thePrsObj->ToPropagateVisualState())
{
- SetZLayer (anIter.Value(), theLayerId);
+ for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
+ {
+ SetZLayer(anIter.Value(), theLayerId);
+ }
}
+
if (!thePrsObj->HasOwnPresentations())
{
return;
const Handle(PrsMgr_PresentableObject)& theSelObj,
const Standard_Integer theImmediateStructLayerId)
{
- for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
+ if (thePrsObj->ToPropagateVisualState())
{
- Color (anIter.Value(), theStyle, theMode, NULL, theImmediateStructLayerId);
+ for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
+ {
+ Color(anIter.Value(), theStyle, theMode, NULL, theImmediateStructLayerId);
+ }
}
if (!thePrsObj->HasOwnPresentations())
{
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
"\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]"