Exemplo n.º 1
0
 def polygon(self):
     w = 20 * self.factor
     h = 10 * self.factor
     polygon = QtGui.QPolygon()
     polygon.append(QtCore.QPoint(-w, -h))
     polygon.append(QtCore.QPoint(-w, +h))
     polygon.append(QtCore.QPoint(+w, +h))
     polygon.append(QtCore.QPoint(+w, -h))
     polygon.append(QtCore.QPoint(-w, -h))
     polygon = rotatePolygon(polygon, theta=self.angle * math.pi / 180.)
     polygon = translatePolygon(polygon, tx=self.xPos, ty=self.yPos)
     return polygon
Exemplo n.º 2
0
 def polygon(self):
     #w = 20
     #h = 20
     polygon = QtGui.QPolygon()
     polygon.append(QtCore.QPoint(-self.w, -self.h))
     polygon.append(QtCore.QPoint(-self.w, +self.h))
     polygon.append(QtCore.QPoint(+self.w, +self.h))
     polygon.append(QtCore.QPoint(+self.w, -self.h))
     polygon.append(QtCore.QPoint(-self.w, -self.h))
     polygon = rotatePolygon(polygon, theta=self.angle * math.pi / 180.)
     polygon = translatePolygon(polygon, tx=self.xPos, ty=self.yPos)
     return polygon