Przeglądaj źródła

ENH: Add interaction mode for transfer function widget tests

Julien Finet 15 lat temu
rodzic
commit
58f93fa13d

+ 6 - 3
Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkTransferFunctionWidgetTest1.cpp

@@ -57,8 +57,11 @@ int ctkTransferFunctionWidgetTest1(int argc, char * argv [] )
 
   //ctf->AddRGBPoint(0.7, 0.0,0.0,0.0);
   //ctkTransferFunctionWidget* toto = new ctkTransferFunctionWidget();
-  QTimer autoExit;
-  QObject::connect(&autoExit, SIGNAL(timeout()), &app, SLOT(quit()));
-  //autoExit.start(1000);
+  if (argc < 2 || QString(argv[1]) != "-I")
+    {
+    QTimer autoExit;
+    QObject::connect(&autoExit, SIGNAL(timeout()), &app, SLOT(quit()));
+    autoExit.start(1000);
+    }
   return app.exec();
 }

+ 6 - 3
Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkTransferFunctionWidgetTest2.cpp

@@ -56,9 +56,12 @@ int ctkTransferFunctionWidgetTest2(int argc, char * argv [] )
   // the widget is not really shown here, only when app.exec() is called
   transferFunctionWidget.show();
 
-  QTimer autoExit;
-  QObject::connect(&autoExit, SIGNAL(timeout()), &app, SLOT(quit()));
-  autoExit.start(1000);
+  if (argc < 2 || QString(argv[1]) != "-I")
+    {
+    QTimer autoExit;
+    QObject::connect(&autoExit, SIGNAL(timeout()), &app, SLOT(quit()));
+    autoExit.start(1000);
+    }
 
   return app.exec();
 }

+ 7 - 3
Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkTransferFunctionWidgetTest3.cpp

@@ -55,8 +55,12 @@ int ctkTransferFunctionWidgetTest3(int argc, char * argv [] )
   // the widget is not really shown here, only when app.exec() is called
   transferFunctionWidget.show();
 
-  QTimer autoExit;
-  QObject::connect(&autoExit, SIGNAL(timeout()), &app, SLOT(quit()));
-  //autoExit.start(1000);
+  if (argc < 2 || QString(argv[1]) != "-I")
+    {
+    QTimer autoExit;
+    QObject::connect(&autoExit, SIGNAL(timeout()), &app, SLOT(quit()));
+    autoExit.start(1000);
+    }
+
   return app.exec();
 }

+ 6 - 3
Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkTransferFunctionWidgetTest4.cpp

@@ -65,8 +65,11 @@ int ctkTransferFunctionWidgetTest4(int argc, char * argv [] )
   // the widget is not really shown here, only when app.exec() is called
   transferFunctionWidget.show();
 
-  QTimer autoExit;
-  QObject::connect(&autoExit, SIGNAL(timeout()), &app, SLOT(quit()));
-  autoExit.start(1000);
+  if (argc < 2 || QString(argv[1]) != "-I")
+    {
+    QTimer autoExit;
+    QObject::connect(&autoExit, SIGNAL(timeout()), &app, SLOT(quit()));
+    autoExit.start(1000);
+    }
   return app.exec();
 }

+ 6 - 3
Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkTransferFunctionWidgetTest5.cpp

@@ -55,9 +55,12 @@ int ctkTransferFunctionWidgetTest5(int argc, char * argv [] )
   // the widget is not really shown here, only when app.exec() is called
   transferFunctionWidget.show();
 
-  QTimer autoExit;
-  QObject::connect(&autoExit, SIGNAL(timeout()), &app, SLOT(quit()));
-  autoExit.start(1000);
+  if (argc < 2 || QString(argv[1]) != "-I")
+    {
+    QTimer autoExit;
+    QObject::connect(&autoExit, SIGNAL(timeout()), &app, SLOT(quit()));
+    autoExit.start(1000);
+    }
 
   return app.exec();
 }