Add arbitrary identifier for labels and subpattern/repetition
This commit is contained in:
parent
703c1aa6d8
commit
0b962999b2
@ -24,6 +24,9 @@ class Label:
|
||||
# Label string
|
||||
_string = None # type: str
|
||||
|
||||
# Arbitrary identifier tuple
|
||||
identifier: Tuple
|
||||
|
||||
# ---- Properties
|
||||
# offset property
|
||||
@property
|
||||
@ -76,6 +79,7 @@ class Label:
|
||||
string: str,
|
||||
offset: vector2=(0.0, 0.0),
|
||||
layer: int=0):
|
||||
self.identifier = ()
|
||||
self.string = string
|
||||
self.offset = numpy.array(offset, dtype=float)
|
||||
self.layer = layer
|
||||
|
@ -3,7 +3,7 @@
|
||||
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 numpy
|
||||
@ -37,6 +37,8 @@ class GridRepetition:
|
||||
a_count = None # type: int
|
||||
b_count = 1 # type: int
|
||||
|
||||
identifier: Tuple
|
||||
|
||||
def __init__(self,
|
||||
pattern: 'Pattern',
|
||||
a_vector: numpy.ndarray,
|
||||
@ -77,6 +79,7 @@ class GridRepetition:
|
||||
self.a_count = a_count
|
||||
self.b_count = b_count
|
||||
|
||||
self.identifier = ()
|
||||
self.pattern = pattern
|
||||
self.offset = offset
|
||||
self.rotation = rotation
|
||||
|
@ -3,7 +3,7 @@
|
||||
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 numpy
|
||||
@ -28,6 +28,7 @@ class SubPattern:
|
||||
_dose = 1.0 # type: float
|
||||
_scale = 1.0 # type: float
|
||||
_mirrored = None # type: List[bool]
|
||||
identifier: Tuple
|
||||
|
||||
def __init__(self,
|
||||
pattern: 'Pattern',
|
||||
@ -36,6 +37,7 @@ class SubPattern:
|
||||
mirrored: List[bool]=None,
|
||||
dose: float=1.0,
|
||||
scale: float=1.0):
|
||||
self.identifier = ()
|
||||
self.pattern = pattern
|
||||
self.offset = offset
|
||||
self.rotation = rotation
|
||||
|
Loading…
Reference in New Issue
Block a user