예제 #1
0
    def __appendOglBase(self, oglObject: OglObject, root: Element) -> Element:
        """
        Saves the position and size of the OGL object in XML node.

        Args:
            oglObject:  OGL Object
            root:      XML node to update

        Returns:
            The updated element
        """
        # Saving size
        w, h = oglObject.GetModel().GetSize()
        root.setAttribute(PyutXmlConstants.ATTR_WIDTH, str(float(w)))
        root.setAttribute(PyutXmlConstants.ATTR_HEIGHT, str(float(h)))

        # Saving position
        x, y = oglObject.GetModel().GetPosition()
        root.setAttribute(PyutXmlConstants.ATTR_X, str(x))
        root.setAttribute(PyutXmlConstants.ATTR_Y, str(y))

        return root
예제 #2
0
    def __appendOglBase(self, oglObject: OglObject, root: Element) -> Element:
        """
        Saves the position and size of the OGL object in XML node.

        Args:
            oglObject:  OGL Object
            root:      XML node to update

        Returns:
            The updated element
        """
        # Saving size
        w, h = oglObject.GetModel().GetSize()
        simpleW, simpleH = self.__getSimpleDimensions(w, h)
        root.setAttribute(PyutXmlConstants.ATTR_WIDTH, simpleW)
        root.setAttribute(PyutXmlConstants.ATTR_HEIGHT, simpleH)

        # Saving position
        x, y = oglObject.GetModel().GetPosition()
        simpleX, simpleY = self.__getSimpleCoordinates(x, y)
        root.setAttribute(PyutXmlConstants.ATTR_X, simpleX)
        root.setAttribute(PyutXmlConstants.ATTR_Y, simpleY)

        return root