X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FViewerTest%2FViewerTest.cxx;h=51777f2ffbd04550c670ac3d09b6111fb45f230e;hb=bc001a40308a69cad482e75abe46b8f32266ab9e;hpb=68b0769935516a289ab3d38d33c5c0e6776d932a diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx index a167153e2d..51777f2ffb 100644 --- a/src/ViewerTest/ViewerTest.cxx +++ b/src/ViewerTest/ViewerTest.cxx @@ -4169,6 +4169,41 @@ static int VDisplay2 (Draw_Interpretor& theDI, return 0; } +//======================================================================= +//function : VNbDisplayed +//purpose : Returns number of displayed objects +//======================================================================= +static Standard_Integer VNbDisplayed (Draw_Interpretor& theDi, + Standard_Integer theArgsNb, + const char** theArgVec) +{ + if(theArgsNb != 1) + { + theDi << "Usage : " << theArgVec[0] << "\n"; + return 1; + } + + Handle(AIS_InteractiveContext) aContextAIS = ViewerTest::GetAISContext(); + if (aContextAIS.IsNull()) + { + std::cout << theArgVec[0] << "AIS context is not available.\n"; + return 1; + } + + Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); + if(aContext.IsNull()) + { + theDi << "use 'vinit' command before " << theArgVec[0] << "\n"; + return 1; + } + + AIS_ListOfInteractive aListOfIO; + aContextAIS->DisplayedObjects(aListOfIO, false); + + theDi << aListOfIO.Extent() << "\n"; + return 0; +} + //=============================================================================================== //function : VUpdate //purpose : @@ -5858,6 +5893,11 @@ void ViewerTest::Commands(Draw_Interpretor& theCommands) "\n\t\t: -redisplay Recomputes presentation of objects.", __FILE__, VDisplay2, group); + theCommands.Add ("vnbdisplayed", + "vnbdisplayed" + "\n\t\t: Returns number of displayed objects", + __FILE__, VNbDisplayed, group); + theCommands.Add ("vupdate", "vupdate name1 [name2] ... [name n]" "\n\t\t: Updates named objects in interactive context",