개정판 6642ad5b
issue #1445: support text element
Change-Id: If61c57741e84986caa47f60c2a531b2abe87c370
DTI_PID/DTI_PID/DEXPI/Shape.py | ||
---|---|---|
2 | 2 |
""" This is Shape module """ |
3 | 3 |
|
4 | 4 |
from xml.etree.ElementTree import Element, SubElement, dump, ElementTree, parse, tostring |
5 |
from PyQt5.QtCore import * |
|
5 | 6 |
from .Presentation import Presentation |
6 | 7 |
|
7 | 8 |
|
... | ... | |
26 | 27 |
self.start = start |
27 | 28 |
self.end = end |
28 | 29 |
|
29 |
def to_xml(self): |
|
30 |
def to_xml(self, rect: QRectF):
|
|
30 | 31 |
node = Element('Line') |
31 | 32 |
Presentation.to_xml(node, layer='125', color='0', line_type='1', line_weight=0.35, r=0, g=0, b=0) |
32 | 33 |
extent_node = SubElement(node, 'Extent') |
... | ... | |
40 | 41 |
max_node.attrib['Z'] = '0' |
41 | 42 |
coordinate_node = SubElement(node, 'Coordinate') |
42 | 43 |
coordinate_node.attrib['X'] = str(self.start.real) |
43 |
coordinate_node.attrib['Y'] = str(self.start.imag) |
|
44 |
coordinate_node.attrib['Y'] = str(rect.height() - self.start.imag)
|
|
44 | 45 |
coordinate_node.attrib['Z'] = '0' |
45 | 46 |
coordinate_node = SubElement(node, 'Coordinate') |
46 | 47 |
coordinate_node.attrib['X'] = str(self.end.real) |
47 |
coordinate_node.attrib['Y'] = str(self.end.imag) |
|
48 |
coordinate_node.attrib['Y'] = str(rect.height() - self.end.imag)
|
|
48 | 49 |
coordinate_node.attrib['Z'] = '0' |
49 | 50 |
|
50 | 51 |
return node |
내보내기 Unified diff