コード例 #1
0
 def _bounding_box(self, pspict):
     from yanntricks.src.BoundingBox import BoundingBox
     from yanntricks.src.conversion_angles import simplify_degree
     a = simplify_degree(self.angleI, keep_max=True, number=True)
     b = simplify_degree(self.angleF, keep_max=True, number=True)
     if self.angleI < self.angleF:
         angleI = min(a, b)
         angleF = max(a, b)
     else:
         angleI = max(a, b)
         angleF = min(a, b) + 360
     pI = self.get_point(angleI)
     pF = self.get_point(angleF)
     bb = BoundingBox(self.center, self.center)
     bb.append(pI, pspict)
     bb.append(pF, pspict)
     if angleI == 0:
         bb.addX(self.center.x + self.radius)
     if angleI < 90 and angleF > 90:
         bb.addY(self.center.y + self.radius)
     if angleI < 180 and angleF > 180:
         bb.addX(self.center.x - self.radius)
     if angleI < 270 and angleF > 270:
         bb.addY(self.center.y - self.radius)
     return bb
コード例 #2
0
 def _bounding_box(self, pspict):
     from yanntricks.src.BoundingBox import BoundingBox
     bb = BoundingBox()
     bb.addX(self.minimum)
     bb.addX(self.maximum)
     bb.addY(self.delta_y - self.h / 2)
     bb.addY(self.delta_y + self.h / 2)
     return bb
コード例 #3
0
 def _math_bounding_box(self, pspict):
     # pylint: disable=unused-argument
     # The math_bounding box does not take into account the things
     # that are inside the picture (not even if this are default axes)
     from yanntricks.src.BoundingBox import BoundingBox
     bb = BoundingBox()
     for x, _ in self.axes_unit.place_list(self.mx,
                                           self.Mx,
                                           self.Dx,
                                           self.mark_origin):
         P = (x*self.base).F
         bb.addX(P.x)
         bb.addY(P.y)
     return bb