From: jfa Date: Thu, 21 Jul 2005 05:48:20 +0000 (+0000) Subject: Debug visu.py; add visu_split_views.py as example of view parameters management X-Git-Tag: V3_0_1~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fe2eab5a2ef0012a9fc2d6adbe145753530aabaa;p=modules%2Fvisu.git Debug visu.py; add visu_split_views.py as example of view parameters management --- diff --git a/src/VISU_SWIG/Makefile.in b/src/VISU_SWIG/Makefile.in index fefef6c6..9c9f3dd3 100644 --- a/src/VISU_SWIG/Makefile.in +++ b/src/VISU_SWIG/Makefile.in @@ -36,22 +36,21 @@ VPATH=.:@srcdir@:@top_srcdir@/idl # Libraries targets -LIB = libVISU_Swigcmodule.la +LIB = libVISU_Swigcmodule.la LIB_SRC = VISU_Gen_s.cc -SWIG_FLAGS += +SWIG_FLAGS += 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_delete.py\ - visu_swig_test.py test_events.py batch_test_events.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_delete.py \ + visu_swig_test.py test_events.py batch_test_events.py visu_split_views.py EXPORT_SHAREDPYSCRIPTS = VISU_shared_modules.py -LIB_CLIENT_IDL = +LIB_CLIENT_IDL = CPPFLAGS += -ftemplate-depth-32 $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(QT_INCLUDES) \ $(VTK_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) LDFLAGS += $(PYTHON_LIBS) -lVisuConvertor -lVisuPipeLine @CONCLUDE@ - \ No newline at end of file diff --git a/src/VISU_SWIG/visu.py b/src/VISU_SWIG/visu.py index 54316722..aee18c91 100644 --- a/src/VISU_SWIG/visu.py +++ b/src/VISU_SWIG/visu.py @@ -494,9 +494,7 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi # aPrsObj.GetRotateY()) theView.DisplayOnly(aPrsObj) theView.FitAll() - aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + - "_" + aFieldName + "_" + str(aTimeStampId) + - "_TPLOT3D." + thePictureExt + aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TPLOT3D." + thePictureExt aPictureName = re.sub("\s+","_", aPictureName) theView.SavePicture(aPictureName) aVISUObjList.append(aPrsObj) diff --git a/src/VISU_SWIG/visu_split_views.py b/src/VISU_SWIG/visu_split_views.py new file mode 100644 index 00000000..545ed7a3 --- /dev/null +++ b/src/VISU_SWIG/visu_split_views.py @@ -0,0 +1,129 @@ + +import VISU +import SALOMEDS +from visu_gui import * + +myViewManager = myVisu.GetViewManager() + +################################################ + +myView1 = myViewManager.Create3DView() +myView1.SetTitle("The window will be soon destroyed!") +print "myView1 = myViewManager.Create3DView()" + +myView1.Maximize() +print "myView1.Maximize()" + +myView1.Restore() +print "myView1.Restore()" + +myView1.Minimize() +print "myView1.Minimize()" + +myViewManager.Destroy(myView1) +print "myViewManager.Destroy(myView1)" + +################################################ + +myView2 = myViewManager.Create3DView() +print "myView2 = myViewManager.Create3DView()" +myView2.SetTitle("myView2") + +aColor = SALOMEDS.Color(0.0,0.3,1.0) +myView2.SetBackground(aColor) +print "aColor = SALOMEDS.Color(0.0,0.3,1.0)" +print "myView2.SetBackground(aColor)" + +myView2.SetFocalPoint([0,0,0]) +print "myView2.SetFocalPoint([0,0,0])" +myView2.SetParallelScale(2) +print "myView2.SetParallelScale(2)" + +################################################ + +myView3 = myViewManager.Create3DView() +print "myView3 = myViewManager.Create3DView()" +myView3.SetTitle("myView3") + +myView3.SplitRight() +print "myView3.SplitRight()" + +aColor = SALOMEDS.Color(0.0,0.7,0.0) +print "aColor = SALOMEDS.Color(0.0,0.7,0.0)" +myView3.SetBackground(aColor) +print "myView3.SetBackground(aColor)" + +aPoint = myView3.GetPointOfView() +aPoint[0] = aPoint[0] + 10 +myView3.SetPointOfView(aPoint) +print "myView3.SetPointOfView(...)" +myView3.ScaleView(VISU.View3D.YAxis,10.0) +myView3.ScaleView(VISU.View3D.XAxis,3.0) +print "myView3.ScaleView(...)" + +myView3.FitAll() + +myView3.SaveViewParams('AAA') +print "myView3.SaveViewParams('AAA')" + +myView3.RemoveScale() +print "myView3.RemoveScale()" + +myView3.Update() +print "myView3.Update()" +myView3.FitAll() +print "myView3.FitAll()" + +################################################ + +myView4 = myViewManager.Create3DView() +print "myView4 = myViewManager.Create3DView()" +myView4.SetTitle("myView4") + +aColor = SALOMEDS.Color(1.0,0.7,0.0) +print "aColor = SALOMEDS.Color(1.0,0.7,0.0)" +myView4.SetBackground(aColor) +print "myView4.SetBackground(aColor)" + +################################################ + +myView5 = myViewManager.Create3DView() +print "myView5 = myViewManager.Create3DView()" +myView5.SetTitle("myView5") + +myView5.SplitTop() +print "myView5.SplitTop()" + +aColor = SALOMEDS.Color(0.7,0.7,0.7) +print "aColor = SALOMEDS.Color(0.7,0.7,0.7)" +myView5.SetBackground(aColor) +print "myView5.SetBackground(aColor)" + +################################################ + +myView6 = myViewManager.CreateXYPlot() +print "myView6 = myViewManager.CreateXYPlot()" +myView6.SetTitle("myView6") + +################################################ + +myView7 = myViewManager.Create3DView() +print "myView7 = myViewManager.Create3DView()" +myView7.SetTitle("myView7") + +################################################ + +myView6.OnTop() +print "myView6.OnTop()" + +myView4.Attract(myView2) +print "myView4.Attract(myView2)" + +myView4.SetRelativePositionInSplitter(0.7) +print "myView4.SetRelativePositionInSplitter(0.7)" + +myView4.SetRelativePositionX(0.2) +print "myView4.SetRelativePositionX(0.7)" + +#myView4.SetRelativePositionY(0.2) +#print "myView4.SetRelativePositionY(0.2)"