개정판 af3f3166
cad
Change-Id: Idc81e75295784f0b0c4643e161b546ef348a9286
DTI_PID/DTI_PID/ImportTextFromCADDialog.py | ||
---|---|---|
290 | 290 |
self.id2_bbox = None |
291 | 291 |
self.scales = None |
292 | 292 |
self.offsets = None |
293 |
self.areas = None |
|
293 | 294 |
|
294 | 295 |
self.isAccepted = False |
295 | 296 |
|
... | ... | |
1034 | 1035 |
(os.path.splitext(f)[1].upper() == '.XML')] |
1035 | 1036 |
|
1036 | 1037 |
self.text_scale = self.ui.doubleSpinBoxScale.value() |
1038 |
self.areas = app_doc_data.getAreaList() |
|
1037 | 1039 |
|
1038 | 1040 |
"""get exclude layers mapping""" |
1039 | 1041 |
exclude_layers = [] |
... | ... | |
1515 | 1517 |
item.size = (_width, _height) |
1516 | 1518 |
item.angle = angle |
1517 | 1519 |
|
1518 |
app_doc_data = AppDocData.instance() |
|
1519 |
for area in app_doc_data.getAreaList(): |
|
1520 |
for area in self.areas: |
|
1520 | 1521 |
if area.contains([loc[0], loc[1]]): |
1521 | 1522 |
item.area = area.name |
1522 | 1523 |
break |
DTI_PID/DTI_PID/LineDetector.py | ||
---|---|---|
497 | 497 |
|
498 | 498 |
def connectLineToSymbol(self, line, symbol, toler): |
499 | 499 |
try: |
500 |
''' |
|
500 | 501 |
start_pt = list(line.start_point()) |
501 | 502 |
distStart = [(self.distanceTo(start_pt, (connector.center()[0], connector.center()[1])), |
502 | 503 |
(connector.center()[0], connector.center()[1])) for connector in |
... | ... | |
512 | 513 |
# there is no connectors |
513 | 514 |
if not (distStart and distEnd): |
514 | 515 |
return |
516 |
''' |
|
515 | 517 |
|
516 | 518 |
res = line.connect_if_possible(symbol, toler) |
517 | 519 |
if res: |
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
505 | 505 |
rhs = [item.dir().x(), item.dir().y()] |
506 | 506 |
dot = sum([lhs[i] * rhs[i] for i in range(len(lhs))]) |
507 | 507 |
angle = math.degrees(math.acos(dot / length)) |
508 |
if (abs(angle) < 10) or (abs(angle - 180) < 10): |
|
508 |
if (abs(angle) < 10) or (abs(angle - 180) < 10) or len(item.parent.connectors) == 1:
|
|
509 | 509 |
_center = item.center() |
510 | 510 |
dx = [start_pt[0] - _center[0], end_pt[0] - _center[0]] |
511 | 511 |
dy = [start_pt[1] - _center[1], end_pt[1] - _center[1]] |
내보내기 Unified diff