Ejemplo n.º 1
0
    def getAzimuth(self):
        """
        Get the azimuthal angle (in degrees) of the Camera
        """
        debugMsg("Called Camera.getAzimuth()")

        return self.azimuth
Ejemplo n.º 2
0
    def __init__(self, scene):
        """
        Initialisation of the Camera object

        @param scene: The Scene object to add the Camera object to
        @type scene: Scene object
        """
        Item.__init__(self)
        debugMsg("Called Camera.__init__()")

        # 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
        self.elevation = 30  ####### we should try for matlab defaults
        self.azimuth = 30

        # keep a reference to the renderer so we can send stuff to it
        self.renderer = scene.renderer

        # some vtk initialisation commands
        self.renderer.runString("# Camera.__init__()\n")

        # initialise the position of the Camera
        self.setPosition(self.xPos, self.yPos, self.zPos)
        self.setFocalPoint(self.xFocalPoint, self.yFocalPoint, self.zFocalPoint)
Ejemplo n.º 3
0
    def save(self, fname, format):
        """
        Save the scene to a file

        @param fname: The name of the file to save the scene to
        @type fname: string

        @param format: The format in which to save the scene
        @type format: Image object or string
        """
        debugMsg("Called Scene.save()")

        if fname is None or fname == "":
            raise ValueError, "You must specify an output filename"

        if format is None or format == "":
            raise ValueError, "You must specify an image format"

        # now check the type of arguments sent in
        if __debug__:
            assert isinstance(fname, str),  "Incorrect data type; expected str"
            assert isinstance(format, str), "Incorrect data type; expected str"

        # do a check to see if the file exists
        fileCheck(fname)

        # print a warning message if get to here
        overrideWarning("Scene.save")

        return
Ejemplo n.º 4
0
 def getElevation(self):
     """
     Gets the elevation angle (in degrees) of the Camera
     """
     debugMsg("Called Camera.getElevation()")
     
     return self.elevation
Ejemplo n.º 5
0
 def resetInitStack(self):
     """
     Reset/flush the initialisation stack
     """
     debugMsg("Called Renderer.resetInitStack()")
     self._initStack = ""
     return
Ejemplo n.º 6
0
    def getName(self):
        """
        Return the name of the item
        """
        debugMsg("Called Item.getName()")

        return self.name
Ejemplo n.º 7
0
    def render(self):
        """
        Does PdfImage object specific (pre)rendering stuff
        """
        debugMsg("Called PdfImage.render()")

        return
Ejemplo n.º 8
0
    def setLineStyle(self, linestyle):
        """
        Sets the linestyle of the LinePlot

        Linestyles may be either a word in the Gnuplot style, or a symbol 
        shortcut in the Matlab style.  Some of the options do not have a
        Matlab equivalent but do have a Gnuplot equivalent, or vice versa.

        What this method does, is take the linestyles possible as defined by
        PyVisi, and then does some conversion as best it can to get the
        relevant output from (in this case) gnuplot.  

        Possible linestyles are:
            1. lines ('-')
            2. points ('o')
            3. linespoints ('-o')
            4. dots ('.')
            5. dotted (':')
            6. dashes ('--')
            7. dotdashes ('-.')

        @param linestyle: the style to use for the lines
        @type linestyle: string
        """
        debugMsg("Called LinePlot.setLineStyle()")

        self.linestyle = linestyle

        # print a warning if get to here
        overrideWarning("LinePlot.setLineStyle")

        return
Ejemplo n.º 9
0
 def resetEvalStack(self):
     """
     Reset/flush the evaluation stack
     """
     debugMsg("Called Renderer.resetEvalStack()")
     self._evalStack = ""
     return
Ejemplo n.º 10
0
    def getRenderWindowDimensions(self):
        """
        Gets the render window dimensions

        @return: tuple of window width and window height, respectively
        """
        debugMsg("Called Renderer.getRenderWindowDimensions()")
        return (self.renderWindowWidth, self.renderWindowHeight)
Ejemplo n.º 11
0
    def __init__(self):
        """
        Initialisation
        """
        object.__init__(self)
        debugMsg("Called Item.__init__()")

        self.name = None
Ejemplo n.º 12
0
    def getLineStyle(self):
        """
        Gets the current linestyle of the LinePlot

        @return: the linestyle as a string
        """
        debugMsg("Called LinePlot.getLineStyle()")

        return self.linestyle
Ejemplo n.º 13
0
    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)
Ejemplo n.º 14
0
    def setName(self, name):
        """
        Set the name of the item
        """
        debugMsg("Called Item.setName()")

        self.name = name

        return
Ejemplo n.º 15
0
    def render(self):
        """
        Render the object
        """
        debugMsg("Called Item.render()")

        # print a warning if get to here
        overrideWarning("Item.render")

        return
Ejemplo n.º 16
0
    def render(self):
        """
        Perform ScatterPlot3D specific rendering stuff
        """
        debugMsg("Called ScatterPlot3D.render()")

        # print a warning message if get to here
        overrideWarning("ScatterPlot3D.render")

        return
Ejemplo n.º 17
0
    def render(self):
        """
        Perform SurfacePlot specific rendering stuff
        """
        debugMsg("Called SurfacePlot.render()")

        # print a warning message if get to here
        overrideWarning("SurfacePlot.render")

        return
Ejemplo n.º 18
0
    def render(self):
        """
        Does PbmImage object specific (pre)rendering stuff
        """
        debugMsg("Called PbmImage.render()")

        # print a warning message if get to here
        overrideWarning("PbmImage.render")

        return
Ejemplo n.º 19
0
    def getSize(self):
        """
        Gets the current size of the scene

        This size is effectively the renderer window size.  Returns a tuple
        of the x and y dimensions respectively, in pixel units(??).
        """
        debugMsg("Called Scene.getSize()")

        return (self.xSize, self.ySize)
Ejemplo n.º 20
0
    def render(self):
        """
        Perform Plane object specific (pre)rendering tasks
        """
        debugMsg("Called Plane.mapImageToPlane()")

        # print a warning message if get to here
        overrideWarning("Plane.render")

        return
Ejemplo n.º 21
0
    def getBackgroundColor(self):
        """
        Gets the current background color setting of the Scene
        """
        debugMsg("Called Scene.getBackgroundColor()")

        # print a warning message if get to here
        overrideWarning("Scene.getBackgroundColor")

        return
Ejemplo n.º 22
0
    def render(self):
        """
        Does LinePlot object specific (pre) rendering stuff
        """
        debugMsg("Called LinePlot.render()")

        # print a warning message if get to here
        overrideWarning("LinePlot.render")

        return
Ejemplo n.º 23
0
    def getFocalPoint(self):
        """
        Get the position of the focal point of the Camera

        Returns the position of the focal point in a tuple of form 
        (xPos, yPos, zPos)
        """
        debugMsg("Called Camera.getFocalPoint()")

        return (self.xFocalPoint, self.yFocalPoint, self.zFocalPoint)
Ejemplo n.º 24
0
    def __init__(self, scene):
        """
        Initialisation of the Plane object

        @param scene: the scene object within which the plane is
        @type scene: Scene object
        """
        Item.__init__(self)
        debugMsg("Called Plane.__init__()")

        self.renderer = scene.renderer
Ejemplo n.º 25
0
    def __init__(self):
        """
        The init function
        """
        object.__init__(self)
        debugMsg("Called Scene.__init__()")

        self.renderer = Renderer()

        self.xSize = 640
        self.ySize = 480
Ejemplo n.º 26
0
    def __init__(self, scene):
        """
        Initialisation of EllipsoidPlot class

        @param scene: the scene with which to associate the EllipsoidPlot
        @type scene: Scene object
        """
        Plot.__init__(self, scene)
        debugMsg("Called EllipsoidPlot.__init__()")

        if scene is None:
            raise ValueError, "You must specify a scene object"
Ejemplo n.º 27
0
    def __init__(self, scene):
        """
        Intialisation 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)

        if scene is None:
            raise ValueError, "You must specify a scene object"
Ejemplo n.º 28
0
    def __init__(self, scene=None):
        """
        Initialises the Image class object
        
        @param scene: The Scene object to add to
        @type scene: Scene object
        """
        Item.__init__(self)
        debugMsg("Called Image.__init__()")

        if scene is not None:
            self.renderer = scene.renderer
Ejemplo n.º 29
0
    def setTitle(self, title):
        """
        Set the plot title

        @param title: the string holding the title to the plot
        @type title: string
        """
        debugMsg("Called Plot.setTitle()")

        self.title = title

        return
Ejemplo n.º 30
0
    def setYLabel(self, label):
        """
        Set the label of the y-axis

        @param label: the string holding the label of the y-axis
        @type label: string
        """
        debugMsg("Called Plot.setYLabel()")

        self.ylabel = label

        return