Example #1
0
    def __init__(self, pyutObject=None, width: float = 0, height: float = 0):
        """
        Constructor

        @param PyutObject pyutObject : Associated PyutObject
        @param int width  : Initial width
        @param int height : Initial height
        @since 1.0
        @author Philippe Waelti <*****@*****.**>
        """
        RectangleShape.__init__(self, 0, 0, width, height)

        self.logger: Logger = getLogger(__name__)
        self._pyutObject = pyutObject
        """
        Associated PyutObject
        """
        # Default font
        self._defaultFont: Font = Font(DEFAULT_FONT_SIZE, FONTFAMILY_SWISS,
                                       FONTSTYLE_NORMAL, FONTWEIGHT_NORMAL)

        # Connected links
        self._oglLinks = []
        # added by P.Dabrowski 20051202 : it's the command to undo/redo a modification on this object.
        self._modifyCommand = None
Example #2
0
    def __init__(self, x=0.0, y=0.0, width=0.0, height=0.0, parent=None):
        """
        Constructor.

        @param double x, y : position of the point
        @param double width, height : size of the rectangle
        @param Shape parent : parent shape
        """
        RectangleShape.__init__(self, x, y, width, height, parent)
        # this is the definition of the shape
        self._defineShape()
        self._angle = 0                                 # angle is in [0..3], by steps of 90 degrees
        self._vShapes = self._SHAPES[0]                 # currently used list of shapes
        self._InitRotations()                           # create the other rotations if necessary
        self._scale = 1.0                               # scale of the shape
        self._sox, self._soy = self._ox, self._oy       # ox, oy with scale == 1
        self._sw, self._sh = self._width, self._height  # width and height with scale == 1