from abc import ABC from typing import List import core from entity import Node from entity.Line import Line, Plg class Entity(ABC): def __init__(self, id_, layer_id, name, center: Node, middle_line: Line, width, color, from_tun_id=None): self.id = id_ self.from_tun_id = from_tun_id self.name = name self.layer_id = layer_id self.center = center self.width = width self.color = color self.middle_line = middle_line class Tun2d(Entity): def __init__(self, id_, layer_id, name, center: Node, middle_line: Line, vec_list: List[Line], layer_vec_list: List[Line] , fq, color, width, arrow_show, air_type): self.layer_vec_list = layer_vec_list self.vec_list = vec_list self.air_type = air_type self.fq = fq self.arrow_show = arrow_show super().__init__(id_, layer_id, name, center, middle_line, width, color) class Tun3d(Entity): def __init__(self, id_, layer_id, name, center: Node, middle_line: Line, plg_l: Plg, plg_r: Plg, plg_b: Plg , fq, color, width, arrow_show, air_type): self.plg_r = plg_r self.plg_l = plg_l self.plg_b = plg_b self.air_type = air_type self.fq = fq self.arrow_show = arrow_show super().__init__(id_, layer_id, name, center, middle_line, width, color) class Window(Entity): def __init__(self, id_, layer_id, name, center: Node, middle_line: Line, width, color): super().__init__(id_, layer_id, name, center, middle_line, width, color) class Gate(Entity): def __init__(self, id_, layer_id, name, center: Node, middle_line: Line, width, color): super().__init__(id_, layer_id, name, center, middle_line, width, color) class Sealed(Entity): def __init__(self, id_, layer_id, name, center: Node, middle_line: Line, width, color, from_tun_id): super().__init__(id_, layer_id, name, center, middle_line, width, color, from_tun_id) class WindBridge(Entity): def __init__(self, id_, layer_id, name, center: Node, middle_line: Line, width, color): super().__init__(id_, layer_id, name, center, middle_line, width, color) class TunText(Entity): def __init__(self, id_, layer_id, name, center: Node, middle_line: Line, width, color, value): self.value = value super().__init__(id_, layer_id, name, center, middle_line, width, color) class AirFlow(Entity): def __init__(self, id_, layer_id, name, center: Node, middle_line: Line, width, color, air_type): self.air_type = air_type super().__init__(id_, layer_id, name, center, middle_line, width, color) class Shaft(Entity): def __init__(self, id_, layer_id, name, center: Node, middle_line: Line, width, color): super().__init__(id_, layer_id, name, center, middle_line, width, color) class Fan(Entity): def __init__(self, id_, layer_id, name, center: Node, middle_line: Line, width, color, fan_type): self.fan_type = fan_type super().__init__(id_, layer_id, name, center, middle_line, width, color) class AirDuct(Entity): def __init__(self, id_, layer_id, name, center: Node, middle_line: Line, width, color, path_list: List[Line]): self.path_list = path_list super().__init__(id_, layer_id, name, center, middle_line, width, color) class TunGap: def __init__(self, plg: Plg, color=(0, 0, 0)): self.plg = plg self.color = color class Drill: def __init__(self, id_, layer_id, line_list: List, color): self.id_ = id_ self.layer_id = layer_id self.line_list = line_list self.color = color class Face: def __init__(self, layer_id, node_list: List, color): self.layer_id = layer_id self.node_list = node_list self.color = color class Empty: def __init__(self, layer_id, node_list: List, color): self.layer_id = layer_id self.node_list = node_list self.color = color