Salome HOME
MPV: Merge V1_2d
authorsmh <smh@opencascade.com>
Thu, 29 Jan 2004 13:42:13 +0000 (13:42 +0000)
committersmh <smh@opencascade.com>
Thu, 29 Jan 2004 13:42:13 +0000 (13:42 +0000)
src/VISU_SWIG/Makefile.in
src/VISU_SWIG/batchmode_visu_table.py
src/VISU_SWIG/visu.py
src/VISU_SWIG/visu_big_table.py
src/VISU_SWIG/visu_med.py
src/VISU_SWIG/visu_prs_example.py
src/VISU_SWIG/visu_table.py

index b81b2a870ad1784946933f8ce4c290305a99f1a2..ff40e7bca0df9610b2bbd7cd8b798ce3fbbb28c0 100644 (file)
@@ -45,7 +45,6 @@ EXPORT_PYSCRIPTS = libVISU_Swig.py batchmode_visu.py batchmode_visu_table.py bat
        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
-
 EXPORT_SHAREDPYSCRIPTS = VISU_shared_modules.py
 
 LIB_CLIENT_IDL = 
@@ -55,4 +54,4 @@ CPPFLAGS += -ftemplate-depth-32 $(PYTHON_INCLUDES) $(QT_INCLUDES) \
 LDFLAGS += $(PYTHON_LIBS) -lVisuConvertor -lVisuPipeLine
 
 @CONCLUDE@
\ No newline at end of file
index e8c0afa7e1c2cf3c986b445ca0fb54a3a8cbac3d..fe85ef7595de88e4e67bf212233f6c8a1ad0cfba 100644 (file)
@@ -19,7 +19,7 @@ import math
 myBuilder = myStudy.NewBuilder()
 
 # >>> Getting (loading) VISU component =======================================
-myVisu = lcc.FindOrLoadComponent("FactoryServer", "Visu")
+myVisu = lcc.FindOrLoadComponent("FactoryServer", "VISU")
 myComponent = myStudy.FindComponent("VISU")
 myVisu.SetCurrentStudy(myStudy)
 if not myComponent:
index 1cb4f7ce684e5acbe3e5c047871d1b317fe5267d..86d8adc8a7392b8dccfdde36f65d6f9a3d58a542 100644 (file)
 import os
 import re
 from time import sleep
-#
 
 import VISU
 import SALOME
+import SALOME_Session_idl
 import SALOMEDS
 import SALOME_MED
 from omniORB import CORBA
@@ -39,6 +39,7 @@ def Initialize(theORB, theNamingService, theLifeCycleCORBA, theStudyManager, the
     myLifeCycleCORBA = theLifeCycleCORBA
     myLocalStudyManager = theStudyManager
     mySession = myNamingService.Resolve("/Kernel/Session")
+    mySession = mySession._narrow(SALOME.Session)
     mySession.GetInterface()
     myDelay = theDelay
     sleep(myDelay)
@@ -76,10 +77,10 @@ def HasValue(theList, theValue) :
 def CreateStudyForMed(theVisu, theFileName) :
     print "CreateStudyForMed ", theFileName,
     if os.path.isfile(theFileName) :
-        if os.path.splitext(theFileName)[1] == '.med' :
+        if re.search("\.med$", theFileName) is not None :
             print "OK"
             aStudyName = os.path.basename(theFileName)
-            aStudyName = os.path.splitext(aStudyName)[0]
+            aStudyName = re.sub(r'\.med', "", aStudyName)
             aStudyName = generateName(aStudyName)
             print "myLocalStudyManager.NewStudy -", aStudyName, "...",
             aStudy = myLocalStudyManager.NewStudy(aStudyName)
@@ -169,7 +170,7 @@ def CreatePrsForMed(theVisu, theFileName, thePrsTypeList, thePictureDir, thePict
         aVISUObjList.append(aResult)
         aVISUObjList.extend(CreatePrsForResult(theVisu, aResult, myView, thePrsTypeList, thePictureDir, thePictureExt))
         
-        aFolderIter = myLocalStudy.NewChildIterator(aMedSObj);
+        aFolderIter = myLocalStudy.NewChildIterator(aMedSObj.GetFather());
         while aFolderIter.More() :
             aFolderSObj = aFolderIter.Value()
             aFolderIter.Next()
@@ -242,7 +243,7 @@ def CreatePrsForFile(theVisu, theFileName, thePrsTypeList, thePictureDir, thePic
  #   try:
         aVISUObjList = [myLocalStudy, myViewManager, myView] = CreateStudyForMed(theVisu, theFileName)
 
-        print "theVisu.ImportMed..."
+        print "theVisu.ImportMed...",
         aResult = theVisu.ImportFile(theFileName)
         if aResult is None : raise RuntimeError, "Error"
         else : print "OK"
@@ -423,7 +424,7 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
                                 aPrsObj = theVisu.CutPlanesOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
                                 if aPrsObj is None : print "Error"
                                 else : print ",OK"
-                                aPrsObj.SetOrientationType(VISU.CutPlanes.ZX)
+                                aPrsObj.SetOrientation(VISU.CutPlanes.ZX,aPrsObj.GetRotateX(),aPrsObj.GetRotateY())
                                 theView.DisplayOnly(aPrsObj)
                                 theView.FitAll()
                                 aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TCUTPLANES." + thePictureExt
@@ -436,8 +437,8 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
                                 aPrsObj = theVisu.CutLinesOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
                                 if aPrsObj is None : print "Error"
                                 else : print ",OK"
-                                aPrsObj.SetOrientationType(VISU.CutPlanes.XY)
-                                aPrsObj.SetOrientationType2(VISU.CutPlanes.ZX)
+                                aPrsObj.SetOrientation(VISU.CutPlanes.XY,aPrsObj.GetRotateX(),aPrsObj.GetRotateY())
+                                aPrsObj.SetOrientation2(VISU.CutPlanes.ZX,aPrsObj.GetRotateX2(),aPrsObj.GetRotateY2())
                                 theView.DisplayOnly(aPrsObj)
                                 theView.FitAll()
                                 aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TCUTLINES." + thePictureExt
@@ -461,7 +462,7 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
 
                                 if HasValue(thePrsTypeList,VISU.TVECTORS) :
                                     print "          Creating VectorsOnField",
-                                    aPrsObj = theVisu.VectorsOnField(theResult,aMeshNamePic,anEntity,aFieldName,aTimeStampId)
+                                    aPrsObj = theVisu.VectorsOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
                                     if aPrsObj is None : print "Error"
                                     else : print ",OK"
                                     theView.DisplayOnly(aPrsObj)
@@ -632,10 +633,6 @@ def try_cutplanes_parameters(thePattern) :
     ind = random.randint(1,2)
     anObj = try_scalarmap_parameters(thePattern)
         
-    # --- ORIENTATION ---
-    anObj.SetOrientationType(ORIENT[random.randint(0,2)])
-
-    # --- NUMBER OF PLANES ---
     if ind%2 :   anObj.SetNbPlanes(random.randint(-40,40))
     else :       anObj.SetNbPlanes(random.randint(0,10)) #try behaivor if NbPlanes=0
 
@@ -660,8 +657,8 @@ def try_cutplanes_parameters(thePattern) :
             angle1 = random.random()*3.14
             angle2 = random.random()*3.14
         
-    anObj.SetRotateX(angle1)
-    anObj.SetRotateY(angle2)
+    # --- ORIENTATION ---
+    anObj.SetOrientation(ORIENT[random.randint(0,2)],angle1,angle2)
 
     return anObj
         
@@ -694,8 +691,12 @@ def try_cutlines_parameters(thePattern):
     anObj = try_scalarmap_parameters(thePattern)
 
     # --- ORIENTATION ---
-    anObj.SetOrientationType(ORIENT[random.randint(0,2)])
-    anObj.SetOrientationType2(ORIENT[random.randint(0,2)])
+    anObj.SetOrientation(ORIENT[random.randint(0,2)],
+                         random.randint(-100,100)*random.random(),
+                         random.randint(-100,100)*random.random())
+    anObj.SetOrientation2(ORIENT[random.randint(0,2)],
+                          random.randint(-100,100)*random.random(),
+                          random.randint(-100,100)*random.random())
 
     # --- Base Plane Position ---
     anObj.SetBasePlanePosition( random.random()*random.randint(-100000,100000))
@@ -704,12 +705,6 @@ def try_cutlines_parameters(thePattern):
     if ind%2:
             anObj.SetNbLines(random.randint(-5, 50))
 
-    # --- ROTATION ---
-    anObj.SetRotateX(random.randint(-100,100)*random.random())
-    anObj.SetRotateX2(random.randint(-100,100)*random.random())
-    anObj.SetRotateY(random.randint(-100,100)*random.random())
-    anObj.SetRotateY2(random.randint(-100,100)*random.random())
-
     return anObj
 
 def dump_cutlines_parameters(theObject):
index 15d18205f7ea0a8c02a0ffc06c41fab7b464e103..9a3317c4636ecfc2dfa90f6264172eea9bac6e28 100644 (file)
@@ -19,7 +19,7 @@ myStudy = salome.myStudy
 myBuilder = myStudy.NewBuilder()
 
 # >>> Getting (loading) VISU component =======================================
-myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "Visu")
+myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "VISU")
 myComponent = myStudy.FindComponent("VISU")
 myVisu.SetCurrentStudy(myStudy)
 if not myComponent:
index 2a75f06ac8bae9a29cca9d50b614b5e25d8a7af6..46f7bedfd0b86fc5ed8bcd8e2e37c398acbf144d 100644 (file)
@@ -53,7 +53,7 @@ def importMed(medFile):
     importMedFrom(medDir,medFile)
 
 #med_obj = getMedObjectFromStudy()
-myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "Visu")
+myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "VISU")
 print "Use importMed(medFile) or importMedFrom(medDir,medFile) functions !"
 
 #myField = getFieldObjectFromStudy(2,1)
index d8cba43139bae3933edada58b09dc7b186c34d81..002ebd103ef661aeab1936d14bbb4a450f935c83 100644 (file)
@@ -27,7 +27,7 @@ print medFile
 
 studyCurrent = salome.myStudyName
 
-med_comp = salome.lcc.FindOrLoadComponent("FactoryServer", "Med")
+med_comp = salome.lcc.FindOrLoadComponent("FactoryServer", "MED")
 #myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "Visu")
 
 try:
index d39beaf73d627aa9a30df2600e1246dad8b117f5..38641bbd0a37721e8d8179128bc2a14b61b19b59 100644 (file)
@@ -19,7 +19,7 @@ myStudy = salome.myStudy
 myBuilder = myStudy.NewBuilder()
 
 # >>> Getting (loading) VISU component =======================================
-myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "Visu")
+myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "VISU")
 myComponent = myStudy.FindComponent("VISU")
 myVisu.SetCurrentStudy(myStudy)
 if not myComponent: