From: smh Date: Fri, 2 Apr 2004 09:02:49 +0000 (+0000) Subject: Debug SALOME_Event X-Git-Tag: mergeto_Event_Server_20Apr04~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=54bc60f649a278b1d368833c2307d57242c4b059;p=modules%2Fvisu.git Debug SALOME_Event Add release() method --- diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 4fc35b65..71087e39 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -395,15 +395,11 @@ bool VisuGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) case 111: { - ShowTestObject(); - break; visuGUI->CopyAndImportFile(); break; } case 112: { - ShowTestObject(); - break; visuGUI->ImportFile(); break; } @@ -4029,42 +4025,35 @@ void VisuGUI::CreateTestView() 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") } diff --git a/src/VISU_SWIG/Makefile.in b/src/VISU_SWIG/Makefile.in index d5580141..680856bc 100644 --- a/src/VISU_SWIG/Makefile.in +++ b/src/VISU_SWIG/Makefile.in @@ -44,7 +44,7 @@ SWIG_DEF = libVISU_Swig.i 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 = diff --git a/src/VISU_SWIG/test_events.py b/src/VISU_SWIG/test_events.py new file mode 100755 index 00000000..33cf71eb --- /dev/null +++ b/src/VISU_SWIG/test_events.py @@ -0,0 +1,14 @@ +############################################################### +# +# 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(); +