blender-gdsimporter/gds/elements.py

90 lines
1.6 KiB
Python
Raw Normal View History

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):
2019-07-01 13:07:38 +02:00
position = (0,0)
structure = ""
transformation = Transformation()
# tree
2019-07-01 13:07:38 +02:00
parent = None
2019-07-01 14:21:45 +02:00
class ARef(Element):
position = (0,0)
# positions of last instance in X and Y direction
bounds = [(0,0), (0,0)]
# number of instances in X and Y direction
size = (0,0)
structure = ""
transformation = Transformation()
# tree
parent = None