• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python common.debugMsg函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyvisi.renderers.vtk.common.debugMsg函数的典型用法代码示例。如果您正苦于以下问题:Python debugMsg函数的具体用法?Python debugMsg怎么用?Python debugMsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了debugMsg函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: setDepth

    def setDepth(self, depth):
        """
        Set the box depth
        """
        debugMsg("Called Box.setDepth()")
        # get the current depth
        oldDepth = self.getDepth()

        # get the current bounds
        (xmin, xmax, ymin, ymax, zmin, zmax) = self.getBounds()

        # add half the difference between the new depth and the old depth
        # to the zmin and zmax variables
        halfDiff = (depth - oldDepth)/2.0

        zminNew = zmin - halfDiff
        zmaxNew = zmax + halfDiff

        # reset the bounds
        self.setBounds(xmin, xmax, ymin, ymax, zminNew, zmaxNew)

        # set the depth
        self.depth = zmaxNew - zminNew

        # do a check to make sure the calculated depth is what was asked
        # for
        if __debug__:
            newDepth = self.getDepth()
            assert abs(newDepth - depth) < self.tolerance, \
                    "Depth not set to within tolerance"

        return
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:32,代码来源:box.py


示例2: setBLF

    def setBLF(self, bottom, left, front):
        """
        Set the position of the bottom, left, front corner
        """
        debugMsg("Called Box.setBLF()")
        # get the current bounds
        (xmin, xmax, ymin, ymax, zmin, zmax) = self.getBounds()

        # make sure that the bounds aren't silly
        if bottom > xmax:
            warnString = "bottom set too large for maximum x dimension."
            warnString += "  Resetting to xMin."
            warnings.warn(warnString)
            bottom = xmin

        if left > ymax:
            warnString = "left set too large for maximum y dimension."
            warnString += "  Resetting to yMin."
            warnings.warn(warnString)
            left = ymin

        if front > zmax:
            warnString = "front set too large for maximum z dimension."
            warnString += "  Resetting to zMin."
            warnings.warn(warnString)
            front = zmin

        # set the new bounds
        self.setBounds(bottom, xmax, left, ymax, front, zmax)

        # set the blf variable
        self.blf = (bottom, left, front)
        return
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:33,代码来源:box.py


示例3: setWidth

    def setWidth(self, width):
        """
        Set the width of the box
        """
        debugMsg("Called Box.setWidth()")
        # get the current width
        oldWidth = self.getWidth()

        # get the current bounds
        (xmin, xmax, ymin, ymax, zmin, zmax) = self.getBounds()

        # add half the difference between the new width and the old width
        # to the xmin and xmax variables
        halfDiff = (width - oldWidth)/2.0

        xminNew = xmin - halfDiff
        xmaxNew = xmax + halfDiff

        # reset the bounds
        self.setBounds(xminNew, xmaxNew, ymin, ymax, zmin, zmax)

        # set the width
        self.width = xmaxNew - xminNew

        # do a check to make sure the calculated width is what was asked for
        if __debug__:
            newWidth = self.getWidth()
            assert abs(newWidth - width) < self.tolerance, \
                    "Width not set to within tolerance"

        return
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:31,代码来源:box.py


示例4: setHeight

    def setHeight(self, height):
        """
        Set the box height
        """
        debugMsg("Called Box.setHeight()")
        # get the current height
        oldHeight = self.getHeight()

        # get the current bounds
        (xmin, xmax, ymin, ymax, zmin, zmax) = self.getBounds()

        # add half the difference between the new height and the old height
        # to the ymin and ymax variables
        halfDiff = (height - oldHeight)/2.0

        yminNew = ymin - halfDiff
        ymaxNew = ymax + halfDiff

        # reset the bounds
        self.setBounds(xmin, xmax, yminNew, ymaxNew, zmin, zmax)

        # set the height
        self.height = ymaxNew - yminNew

        # do a check to make sure the calculated height is what was asked
        # for
        if __debug__:
            newHeight = self.getHeight()
            assert abs(newHeight - height) < self.tolerance, \
                    "Height not set to within tolerance"

        return
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:32,代码来源:box.py


示例5: __init__

    def __init__(self, scene):
        """
        Initialisation of the OffsetPlot class
        
        @param scene: The Scene to render the plot in
        @type scene: Scene object
        """
        debugMsg("Called OffsetPlot.__init__()")
        Plot.__init__(self, scene)

        self.renderer = scene.renderer
        self.renderer.addToInitStack("# OffsetPlot.__init__()")
        self.renderer.addToInitStack("_plot = vtk.vtkXYPlotActor()")

        self.title = None
        self.xlabel = None
        self.ylabel = None

        # the extra separation between curves (user set)
        self.sep = None

        # the default values for shared info
        self.fname = None
        self.format = None
        self.scalars = None

        # add the plot to the scene
        scene.add(self)
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:28,代码来源:offset_plot.py


示例6: render

    def render(self):
        """
        Does OffsetPlot object specific (pre)rendering stuff
        """
        debugMsg("Called OffsetPlot.render()")

        self.renderer.runString("# OffsetPlot.render()")
        self.renderer.runString("_renderer.AddActor2D(_plot)")

        # set the title if set
        if self.title is not None:
            evalString = "_plot.SetTitle(\'%s\')" % self.title
            self.renderer.runString(evalString)

        # if an xlabel is set, add it
        if self.xlabel is not None:
            evalString = "_plot.SetXTitle(\'%s\')" % self.xlabel
            self.renderer.runString(evalString)

        # if an ylabel is set, add it
        if self.ylabel is not None:
            evalString = "_plot.SetYTitle(\'%s\')" % self.ylabel
            self.renderer.runString(evalString)

        return
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:25,代码来源:offset_plot.py


示例7: __init__

    def __init__(self, scene):
        """
        Initialisation of the IsosurfacePlot class
        
        @param scene: The Scene to render the plot in
        @type scene: Scene object
        """
        debugMsg("Called IsosurfacePlot.__init__()")
        Plot.__init__(self, scene)

        self.renderer = scene.renderer
        self.renderer.addToInitStack("# IsosurfacePlot.__init__()")

        # labels and stuff
        self.title = None
        self.xlabel = None
        self.ylabel = None
        self.zlabel = None

        # how many contours?
        self.numContours = 5

        # contour range
        self.contMin = None
        self.contMax = None

        # default values for fname, format and scalars
        self.fname = None
        self.format = None
        self.scalars = None

        # add the plot to the scene
        scene.add(self)
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:33,代码来源:isosurface_plot.py


示例8: setTRB

    def setTRB(self, top, right, back):
        """
        Set the position of the top, right, back corner
        """
        debugMsg("Called Box.setTRB()")
        # get the current bounds
        (xmin, xmax, ymin, ymax, zmin, zmax) = self.getBounds()

        # make sure that the bounds aren't silly
        if top < xmin:
            warnString = "top set too small for minimum x dimension."
            warnString += "  Resetting to xMax."
            warnings.warn(warnString)
            top = xmax

        if right < ymin:
            warnString = "right set too small for minimum y dimension."
            warnString += "  Resetting to yMax."
            warnings.warn(warnString)
            right = ymax

        if back < zmin:
            warnString = "back set too small for minimum z dimension."
            warnString += "  Resetting to zMax."
            warnings.warn(warnString)
            back = zmax

        # set the new bounds
        self.setBounds(xmin, top, ymin, right, zmin, back)

        # set the trb variable
        self.trb = (top, right, back)
        return
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:33,代码来源:box.py


示例9: getInsideOut

 def getInsideOut(self):
     """
     Get the current value of the inside out flag
     """
     debugMsg("Called ClipBox.getInsideOut()")
     self.plot.renderer.runString("# ClipBox.getInsideOut()")
     return self.insideOut
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:7,代码来源:box.py


示例10: getAzimuth

    def getAzimuth(self):
        """
        Get the azimuthal angle (in degrees) of the Camera
        """
        debugMsg("Called Camera.getAzimuth()")

        return self.azimuth
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:7,代码来源:camera.py


示例11: _setDataFromFile

    def _setDataFromFile(self):
        """
        Set data to plot using an input file
        """
        debugMsg("Called _setDataFromFile() in Plot()")

        return
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:7,代码来源:plot.py


示例12: _setPlainData

    def _setPlainData(self):
        """
        Set data to plot using numpy objects
        """
        debugMsg("Called _setPlainData() in Plot()")

        return
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:7,代码来源:plot.py


示例13: render

    def render(self):
        """
        Does PdfImage object specific (pre)rendering stuff
        """
        debugMsg("Called PdfImage.render()")

        return
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:7,代码来源:image.py


示例14: render

    def render(self):
        """
        Render the Plot object
        """
        debugMsg("Called Plot.render()")

        return
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:7,代码来源:plot.py


示例15: __init__

    def __init__(self, scene):
        """
        Initialisation of the EllipsoidPlot class

        @param scene: The Scene to render the plot in
        @type scene: Scene object
        """
        debugMsg("Called EllipsoidPlot.__init__()")
        Plot.__init__(self, scene)

        self.renderer = scene.renderer
        self.renderer.addToInitStack("# EllipsoidPlot.__init__()")

        # labels and stuff
        self.title = None
        self.xlabel = None
        self.ylabel = None
        self.zlabel = None
        
        # default values for fname, format and tensors
        self.fname = None
        self.format = None
        self.tensors = None

        # add the plot to the scene
        scene.add(self)
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:26,代码来源:ellipsoid_plot.py


示例16: __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

        # the namespace to run the exec code
        self.renderDict = {}

        # initialise the evalstack
        self._evalStack = ""

        # keep the initial setup of the module for later reuse
        self._initStack = ""

        # initialise the renderer module
        self.runString("# Renderer._initRendererModule")
        self.addToInitStack("import vtk")
        self.addToInitStack("from numpy import *")
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:27,代码来源:renderer.py


示例17: setOrigin

    def setOrigin(self, xo, yo, zo):
        """
        Set the origin of the box
        """
        debugMsg("Called Box.setOrigin()")
        # get the current origin
        (xi, yi, zi) = self.getOrigin()

        # get the current bounds
        (xmin, xmax, ymin, ymax, zmin, zmax) = self.getBounds()

        # get the difference between the two origins
        (xd, yd, zd) = (xo-xi, yo-yi, zo-zi)

        # move the bounds accordingly
        self.setBounds(xmin+xd, xmax+xd, ymin+yd, ymax+yd, zmin+zd, zmax+zd)

        # the calculated origin should be the same as the one desired to be
        # set by the user
        (xmin, xmax, ymin, ymax, zmin, zmax) = self.getBounds()
        self.origin = ((xmin + xmax)/2.0,
                (ymin + ymax)/2.0,
                (zmin + zmax)/2.0)
        
        # do a check to see if calculated origin is close enough to that
        # desired by the user (to within the tolerance)
        if __debug__:
            (xi, yi, zi) = self.getOrigin()
            originDiff = (xo-xi, yo-yi, zo-zi)
            for i in range(3):
                assert abs(originDiff[i]) < self.tolerance, \
                        "Origin not set to within tolerance"

        return
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:34,代码来源:box.py


示例18: __init__

    def __init__(self):
        """
        Initialisation of the Box object
        """
        debugMsg("Called Box.__init__()")
        Item.__init__(self)

        # define a box in many ways, either by its centre and width, height
        # and depth, or by its bounds, xmin, xmax, ymin, ymax, zmin, zmax,
        # or by its bottom left front and top right back points.

        # set the default bounds
        self.xmin = -0.5
        self.xmax = 0.5
        self.ymin = -0.5
        self.ymax = 0.5
        self.zmin = -0.5
        self.zmax = 0.5

        # set the default origin (the centre of the box)
        self.origin = ((self.xmin + self.xmax)/2.0, 
                (self.ymin + self.ymax)/2.0, 
                (self.zmin + self.zmax)/2.0)

        # set the default dimensions
        self.width = self.xmax - self.xmin
        self.height = self.ymax - self.ymin
        self.depth = self.zmax - self.zmin

        # set the default blf and trb points
        self.blf = (self.xmin, self.ymin, self.zmin)
        self.trb = (self.xmax, self.ymax, self.zmax)

        # tolerance for calculated variables checking purposes
        self.tolerance = 1e-8
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:35,代码来源:box.py


示例19: getElevation

    def getElevation(self):
        """
        Gets the elevation angle (in degrees) of the Camera
        """
        debugMsg("Called Camera.getElevation()")

        return self.elevation
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:7,代码来源:camera.py


示例20: __init__

    def __init__(self, scene):
        """
        Initialisation of the Plane object
        """
        debugMsg("Called Plane.__init__()")
        Item.__init__(self)

        self.renderer = scene.renderer
开发者ID:paultcochrane,项目名称:pyvisi,代码行数:8,代码来源:plane.py



注:本文中的pyvisi.renderers.vtk.common.debugMsg函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python query.votableparse函数代码示例发布时间:2022-05-27
下一篇:
Python common.debugMsg函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap