Add arbitrary identifier for labels and subpattern/repetition

lethe/HEAD
Jan Petykiewicz 5 years ago
parent 703c1aa6d8
commit 0b962999b2

@ -24,6 +24,9 @@ class Label:
# Label string # Label string
_string = None # type: str _string = None # type: str
# Arbitrary identifier tuple
identifier: Tuple
# ---- Properties # ---- Properties
# offset property # offset property
@property @property
@ -76,6 +79,7 @@ class Label:
string: str, string: str,
offset: vector2=(0.0, 0.0), offset: vector2=(0.0, 0.0),
layer: int=0): layer: int=0):
self.identifier = ()
self.string = string self.string = string
self.offset = numpy.array(offset, dtype=float) self.offset = numpy.array(offset, dtype=float)
self.layer = layer self.layer = layer

@ -3,7 +3,7 @@
instances of a Pattern in the same parent Pattern. instances of a Pattern in the same parent Pattern.
""" """
from typing import Union, List, Dict from typing import Union, List, Dict, Tuple
import copy import copy
import numpy import numpy
@ -37,6 +37,8 @@ class GridRepetition:
a_count = None # type: int a_count = None # type: int
b_count = 1 # type: int b_count = 1 # type: int
identifier: Tuple
def __init__(self, def __init__(self,
pattern: 'Pattern', pattern: 'Pattern',
a_vector: numpy.ndarray, a_vector: numpy.ndarray,
@ -77,6 +79,7 @@ class GridRepetition:
self.a_count = a_count self.a_count = a_count
self.b_count = b_count self.b_count = b_count
self.identifier = ()
self.pattern = pattern self.pattern = pattern
self.offset = offset self.offset = offset
self.rotation = rotation self.rotation = rotation

@ -3,7 +3,7 @@
offset, rotation, scaling, and other such properties to the reference. offset, rotation, scaling, and other such properties to the reference.
""" """
from typing import Union, List, Dict from typing import Union, List, Dict, Tuple
import copy import copy
import numpy import numpy
@ -28,6 +28,7 @@ class SubPattern:
_dose = 1.0 # type: float _dose = 1.0 # type: float
_scale = 1.0 # type: float _scale = 1.0 # type: float
_mirrored = None # type: List[bool] _mirrored = None # type: List[bool]
identifier: Tuple
def __init__(self, def __init__(self,
pattern: 'Pattern', pattern: 'Pattern',
@ -36,6 +37,7 @@ class SubPattern:
mirrored: List[bool]=None, mirrored: List[bool]=None,
dose: float=1.0, dose: float=1.0,
scale: float=1.0): scale: float=1.0):
self.identifier = ()
self.pattern = pattern self.pattern = pattern
self.offset = offset self.offset = offset
self.rotation = rotation self.rotation = rotation

Loading…
Cancel
Save