blender-gdsimporter/gds/elements.py

76 lines
1.3 KiB
Python

from enum import Enum
class Transformation(object):
mirror_x = 0
absolute_rotation = 0
absolute_magnification = 0
zoom = 1
rotation = 0
class Element(object):
elflags = 0
plex = 0
datatype = 0
class Drawable(object):
layer = 0
class Boundary(Element, Drawable):
points = []
class Path(Element, Drawable):
class Styles(Enum):
SQUARE_ENDS = 0
ROUNDED_ENDS = 1
OFFSET_ENDS = 2
CUSTOM_END = 4
extendEnd = [0,0] # extend past start and end
width = 0
pathStyle = Styles.SQUARE_ENDS
points = []
class Text(Element, Drawable):
class VJust(Enum):
Top = 0
Middle = 1
Bottom = 2
class HJust(Enum):
Left = 0
Center = 1
Right = 2
# text info
string = ""
position = (0,0)
# presentation
fontnumber = 0
verticalJustification = VJust.Top
horizontalJustification = HJust.Left
# optional path info
pathStype = Path.Styles.SQUARE_ENDS
pathWidth = 0
transformation = Transformation()
class Box(Element, Drawable):
points = []
class SRef(Element):
position = (0,0)
structure = ""
transformation = Transformation()
# tree
parent = None