Version: 6.3.1

Scalar Map

Create Scalar Map presentation on a field of the imported MED file:

import os

import salome

import VISU
import visu_gui

# The directory containing MED files
datadir = os.getenv("DATA_DIR")

# Get VISU engine
myVisu = visu_gui.myVisu

# Import a MED file
medFile = os.path.join(datadir,"MedFiles","pointe.med")
myResult = myVisu.ImportFile(medFile)

# Create a scalar map for the first timestamp of 'fieldcelldoublevector' field
meshName = 'maa1'
fieldEntity = VISU.CELL
fieldName = 'fieldcelldoublevector'
myScalarMap = myVisu.ScalarMapOnField(myResult, meshName, fieldEntity, fieldName, 1)

# Set the logarithmic scaling
myScalarMap.SetScaling(VISU.LOGARITHMIC)

# Set scalar range to [2, 5]
myScalarMap.SetRange(2, 5)

# Update the object browser
salome.sg.updateObjBrowser(1)

# Display the newly created scalar map
myViewManager = myVisu.GetViewManager()
myView = myViewManager.Create3DView()

myView.DisplayOnly(myScalarMap)
myView.FitAll()


Please, see ScalarMap interface reference documentation for more details.

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS