? TypeOfDispOperation_UnsetDispMode
: TypeOfDispOperation_SetDispMode;
Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
+ if (aCtx.IsNull())
+ {
+ Message::SendFail ("Error: no active viewer");
+ return 1;
+ }
+
if (aType == TypeOfDispOperation_UnsetDispMode)
{
if (argc == 1)
if(argc==1) return 1;
Standard_Integer On = Draw::Atoi(argv[1]);
const Handle(AIS_InteractiveContext)& Ctx = ViewerTest::GetAISContext();
+ if (Ctx.IsNull())
+ {
+ Message::SendFail ("Error: no active viewer");
+ return 1;
+ }
if(argc==2)
{
// step 1: prepare the data
Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
+ if (aCtx.IsNull())
+ {
+ Message::SendFail ("Error: no active viewer");
+ return Standard_False;
+ }
+
aCtx->RemoveFilters();
AIS_ListOfInteractive aDispObjects;
aCtx->DisplayedObjects (aDispObjects);
static int VSize (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{
+ if (TheAISContext().IsNull())
+ {
+ Message::SendFail ("Error: no active viewer");
+ return 1;
+ }
+
// Declaration de booleens
Standard_Boolean ThereIsName;
Standard_Boolean ThereIsCurrent;
// Verification des arguments
if ( argc!=2) {di<<argv[0]<<" error\n"; return 1;}
+ if (TheAISContext().IsNull())
+ {
+ Message::SendFail ("Error: no active viewer");
+ return 1;
+ }
+
if (TheAISContext()->NbSelected() != 1)
{
Message::SendFail ("Error: Wrong number of selected shapes.");
--- /dev/null
+puts "# ======================================================================"
+puts "# 0031877: DRAW - some Visualization commands are not protected against uninitialized viewer"
+puts "# ======================================================================"
+
+puts "REQUIRED 31877 ALL: Error: no active viewer"
+
+pload VISUALIZATION
+catch {vsetdispmode 1}
+catch {vpickshapes}
+catch {vsize}
+catch {vplanetri a}