BaseDrawer.py 932 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. from abc import ABC, abstractmethod
  2. class BaseDrawer(ABC):
  3. def __init__(self, obj, msp, style):
  4. self.obj = obj
  5. self.msp = msp
  6. self.style = style
  7. @abstractmethod
  8. def initialize_data(self):
  9. pass
  10. @abstractmethod
  11. def draw_agg(self):
  12. pass
  13. @abstractmethod
  14. def draw_div(self):
  15. pass
  16. def draw(self):
  17. self.initialize_data()
  18. self.draw_agg()
  19. self.draw_div()
  20. class VentGraphDrawer(BaseDrawer, ABC):
  21. def __init__(self, obj, msp, style):
  22. super().__init__(obj, msp, style)
  23. @abstractmethod
  24. def initialize_data(self):
  25. pass
  26. def draw_agg(self):
  27. self.draw_obj(self.obj.center.agg_point, self.obj.middle_line.agg_route)
  28. def draw_div(self):
  29. self.draw_obj(self.obj.center.div_point, self.obj.middle_line.div_route)
  30. @abstractmethod
  31. def draw_obj(self, center, route):
  32. pass