本文整理汇总了Python中pyvisi.renderers.gnuplot.common.debugMsg函数的典型用法代码示例。如果您正苦于以下问题:Python debugMsg函数的具体用法?Python debugMsg怎么用?Python debugMsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debugMsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, scene):
"""
Initialisation of LinePlot class
@param scene: the scene with which to associate the LinePlot
@type scene: Scene object
"""
debugMsg("Called LinePlot.__init__()")
Plot.__init__(self, scene)
self.renderer = scene.renderer
self.title = None
self.xlabel = None
self.ylabel = None
self.zlabel = None
self.linestyle = 'lines' # pyvisi-defined linestyle
self._linestyle = None # renderer-specific linestyle
# is the LinePlot data offset (vertically) from each other?
self.offset = False
# now add the object to the scene
scene.add(self)
示例2: save
def save(self, fname, format):
"""
Save the scene to a file
Possible formats are:
- JPEG
- Postscript
- PNG
- PBM
@param fname: Name of output file
@type fname: string
@param format: Graphics format of output file
@type format: Image object or string
"""
debugMsg("Called Scene.save()")
self.renderer.runString("# Scene.save()")
# if the format is passed in as a string or object, react
# appropriately
import types
if type(format) is types.StringType:
fmt = format.lower()
else:
fmt = format.format
# set the output format
if fmt == "ps":
self.renderer.runString(\
"_gnuplot('set terminal postscript color')")
elif fmt == "png":
evalString = "_gnuplot('set terminal png size %d,%d')" % \
(self.xSize, self.ySize)
self.renderer.runString(evalString)
elif fmt == "pbm":
self.renderer.runString(\
"_gnuplot('set terminal pbm color')")
# set the size of the output
# have to scale properly to do this
xScale = float(self.xSize)/640.0
yScale = float(self.ySize)/480.0
evalString = "_gnuplot('set size %f,%f')" % \
(xScale, yScale)
self.renderer.runString(evalString)
elif fmt == "jpeg" or fmt == "jpg":
evalString = "_gnuplot('set terminal jpeg size %d,%d')" % \
(self.xSize, self.ySize)
self.renderer.runString(evalString)
else:
raise ValueError, "Unknown graphics format. I got: %s" % fmt
# set the output filename
evalString = "_gnuplot('set output \"%s\"')" % fname
self.renderer.runString(evalString)
# now render the whole shebang (again)
self.render()
return
示例3: __init__
def __init__(self):
"""
Initialisation of Renderer() class
"""
debugMsg("Called Renderer.__init__()")
BaseRenderer.__init__(self)
# initialise some attributes
self.renderWindowWidth = 640
self.renderWindowHeight = 480
# what is the name of my renderer?
self.name = _rendererName
# initialise the evalstack
self._evalStack = ""
# the namespace to run the exec code
self.renderDict = {}
# keep the initial setup of the module for later reuse
self._initStack = ""
# initialise the renderer module
self.addToInitStack("# Renderer.__init__()")
self.addToInitStack("import Gnuplot")
# Gnuplot package needs Numeric package
self.addToInitStack("from Numeric import *")
# need to add a check here to see if the Numeric module has been
# imported, and if not, throw an error.
self.addToInitStack("_gnuplot = Gnuplot.Gnuplot()")
示例4: __init__
def __init__(self, scene):
"""
Initialisation of SurfacePlot class
@param scene: the scene with which to associate the SurfacePlot
@type scene: Scene object
"""
debugMsg("Called SurfacePlot.__init__()")
Plot.__init__(self, scene)
# grab the renderer
self.renderer = scene.renderer
# set up some of the attributes
self.title = None
self.xlabel = None
self.ylabel = None
self.zlabel = None
# to show contours of the surface on the bottom of the axes, set
# this variable to True
self.contours = False
# now add the object to the scene
scene.add(self)
示例5: getElevation
def getElevation(self):
"""
Gets the elevation angle (in degrees) of the Camera
"""
debugMsg("Called Camera.getElevation()")
return self.elevation
示例6: render
def render(self):
"""
Perform Plane object specific (pre)rendering tasks
"""
debugMsg("Called Plane.mapImageToPlane()")
return
示例7: render
def render(self):
"""
Does ContourPlot object specific rendering stuff
"""
debugMsg("Called ContourPlot.render()")
self.renderer.runString("# ContourPlot.render()")
self.renderer.runString("_gnuplot('set contour base')")
self.renderer.runString("_gnuplot('set view 0, 0, 1, 1')")
self.renderer.runString("_gnuplot('set nosurface')") # gnuplot 3.7
# if a title is set, put it here
if self.title is not None:
evalString = "_gnuplot.title(\'%s\')" % self.title
self.renderer.runString(evalString)
# if an xlabel is set, add it
if self.xlabel is not None:
evalString = "_gnuplot.xlabel(\'%s\')" % self.xlabel
self.renderer.runString(evalString)
# if a ylabel is set, add it
if self.ylabel is not None:
evalString = "_gnuplot.ylabel(\'%s\')" % self.ylabel
self.renderer.runString(evalString)
self.renderer.runString("_gnuplot('set pm3d')")
# set up the evalString to use for plotting
evalString = "_gnuplot.splot(_data)"
self.renderer.runString(evalString)
return
示例8: getAzimuth
def getAzimuth(self):
"""
Get the azimuthal angle (in degrees) of the Camera
"""
debugMsg("Called Camera.getAzimuth()")
return self.azimuth
示例9: render
def render(self):
"""
Does JpegImage object specific (pre)rendering stuff
"""
debugMsg("Called JpegImage.render()")
return
示例10: __init__
def __init__(self, scene):
"""
Initialisation of the Camera object
@param scene: The Scene object to add the Camera object to
"""
debugMsg("Called Camera.__init__()")
Item.__init__(self)
# default x,y,z positions of Camera (specific to vtk)
self.xPos = 0.0
self.yPos = 0.0
self.zPos = 3.0
# default x,y,z positions of the Camers's focal point (specific to vtk)
self.xFocalPoint = 0.0
self.yFocalPoint = 0.0
self.zFocalPoint = 0.0
# default elevation and azimuth
# these need to be set to the matlab defaults
self.elevation = 30
self.azimuth = 30
# keep a reference to the renderer so we can send stuff to it
self.renderer = scene.renderer
# initialise the position of the Camera
self.setPosition(self.xPos, self.yPos, self.zPos)
self.setFocalPoint(self.xFocalPoint, self.yFocalPoint, self.zFocalPoint)
示例11: render
def render(self):
"""
Does LinePlot object specific rendering stuff
"""
debugMsg("Called LinePlot.render()")
self.renderer.runString("# LinePlot.render()")
# if a title is set, put it here
if self.title is not None:
evalString = "_gnuplot.title(\'%s\')" % self.title
self.renderer.runString(evalString)
# if an xlabel is set, add it
if self.xlabel is not None:
evalString = "_gnuplot.xlabel(\'%s\')" % self.xlabel
self.renderer.runString(evalString)
# if a ylabel is set, add it
if self.ylabel is not None:
evalString = "_gnuplot.ylabel(\'%s\')" % self.ylabel
self.renderer.runString(evalString)
# set up the evalString to use for plotting
evalString = "_gnuplot.plot("
for i in range(self.renderer.numDataObjects-1):
evalString += "_data%d, " % i
evalString += "_data%d)" % (self.renderer.numDataObjects-1,)
self.renderer.runString(evalString)
return
示例12: __init__
def __init__(self):
"""
Initialisation of the Text object
"""
debugMsg("Called Text.__init__()")
Item.__init__(self)
self.font = "Times"
示例13: getLineStyle
def getLineStyle(self):
"""
Gets the current linestyle of the LinePlot
@return: the linestyle as a string
"""
debugMsg("Called LinePlot.getLineStyle()")
return self.linestyle
示例14: getPosition
def getPosition(self):
"""
Get the position of Camera within Scene
Returns the position in a tuple of form (xPos, yPos, zPos)
"""
debugMsg("Called Camera.getPosition()")
return (self.xPos, self.yPos, self.zPos)
示例15: load
def load(self, fname):
"""
Loads image data from file.
@param fname: The filename from which to load image data
@type fname: string
"""
debugMsg("Called Image.load()")
fileCheck(fname)
return