Exemplo n.º 1
0
    def getLocation(self):
        '''
		Returns the location of this object as a GPoint.
		
		@rtype: GPoint
		'''
        return gtypes.GPoint(self.x, self.y)
Exemplo n.º 2
0
    def getStartPoint(self):
        '''
		Returns the point at which the line starts.
		
		@rtype: GPoint
		'''
        return gtypes.GPoint(self.x, self.y)
Exemplo n.º 3
0
    def getEndPoint(self):
        '''
		Returns the point at which the line ends.
		
		@rtype: GPoint
		'''
        return gtypes.GPoint(self.x + self.dx, self.y + self.dy)
Exemplo n.º 4
0
    def getArcPoint(self, theta):
        '''
		Internal method
		'''
        rx = self.frameWidth / 2
        ry = self.frameHeight / 2
        cx = self.x + rx
        cy = self.y + ry
        radians = theta * gmath.PI / 180
        return gtypes.GPoint(cx + rx * math.cos(radians),
                             cy - ry * math.sin(radians))
Exemplo n.º 5
0
    def addVertex(self, x, y):
        '''
		Adds a vertex at (x, y) relative to the polygon
		origin.
		
		@type x: float
		@type y: float
		@rtype: void
		'''
        self.cx = x
        self.cy = y
        self.vertices.append(gtypes.GPoint(x, y))
        platform.Platform().addVertex(self, x, y)