case 111:
{
- ShowTestObject();
- break;
visuGUI->CopyAndImportFile();
break;
}
case 112:
{
- ShowTestObject();
- break;
visuGUI->ImportFile();
break;
}
void VisuGUI::ShowTestObject()
{
- MESSAGE("1")
+ float aRadius = 150.0 * random() / RAND_MAX + 10.;
+ float aX = 1000.0 * random() / RAND_MAX - 500.;
+ float aY = 1000.0 * random() / RAND_MAX - 500.;
+ float aZ = 1000.0 * random() / RAND_MAX - 500.;
+ float aR = (float)random() / RAND_MAX;
+ float aG = (float)random() / RAND_MAX;
+ float aB = (float)random() / RAND_MAX;
+
vtkSphereSource* aSource = vtkSphereSource::New();
- MESSAGE("2")
- aSource->SetRadius( 100. );
- MESSAGE("3")
+ aSource->SetRadius( aRadius );
+ aSource->SetCenter( aX, aY, aZ );
vtkProperty* prop = vtkProperty::New();
- MESSAGE("4")
+ prop->SetColor( aR, aG, aB );
vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New();
- MESSAGE("5")
aMapper->SetInput( aSource->GetOutput() );
- MESSAGE("6")
vtkActor* sphere = vtkActor::New();
- MESSAGE("7")
sphere->SetMapper( aMapper );
- MESSAGE("8")
sphere->SetProperty( prop );
- MESSAGE("9")
QAD_Desktop* desktop = VisuGUI::GetDesktop();
- MESSAGE("10")
QAD_Study* aStudy = desktop->getActiveStudy();
- MESSAGE("11")
if ( !aStudy ) {
CreateTestView();
- MESSAGE("12")
}
- MESSAGE("13")
VTKViewer_ViewFrame* vf = (VTKViewer_ViewFrame*)(desktop->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame());
- MESSAGE("14")
sphere->SetVisibility( true );
- MESSAGE("15")
vf->getRenderer()->AddActor(sphere);
- MESSAGE("16")
vf->Repaint();
- MESSAGE("17")
}
EXPORT_PYSCRIPTS = libVISU_Swig.py batchmode_visu.py batchmode_visu_table.py batchmode_visu_view3d.py \
visu_med.py visu_view3d.py visu.py visu_gui.py visu_prs_example.py\
visu_table.py visu_big_table.py visu_view.py \
- visu_swig_test.py
+ visu_swig_test.py test_events.py
EXPORT_SHAREDPYSCRIPTS = VISU_shared_modules.py
LIB_CLIENT_IDL =
--- /dev/null
+###############################################################
+#
+# File : test_events.py
+# Description : Test postEvent() functionality for VISU module
+#
+###############################################################
+
+import batchmode_visu
+
+for i in range ( 10 ):
+ batchmode_visu.myVisu.CreateTestView()
+ for j in range ( 10 ):
+ batchmode_visu.myVisu.ShowTestObject();
+