def getLocation(self): ''' Returns the location of this object as a GPoint. @rtype: GPoint ''' return gtypes.GPoint(self.x, self.y)
def getStartPoint(self): ''' Returns the point at which the line starts. @rtype: GPoint ''' return gtypes.GPoint(self.x, self.y)
def getEndPoint(self): ''' Returns the point at which the line ends. @rtype: GPoint ''' return gtypes.GPoint(self.x + self.dx, self.y + self.dy)
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))
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)