- Add visitor support to content rectangle - Refactor box unpacking to happen by applying visitor pattern
15 lines
414 B
Python
15 lines
414 B
Python
from synthesis.segment.content_rectangle import ContentRectangle
|
|
|
|
|
|
class RecursiveContentRectangle(ContentRectangle):
|
|
def __init__(self, x1, y1, x2, y2, content=None):
|
|
super().__init__(x1, y1, x2, y2)
|
|
self.content = content
|
|
|
|
@property
|
|
def children(self):
|
|
raise NotImplementedError()
|
|
|
|
def accept(self, visitor):
|
|
return visitor.visit_recursive_content_rectangle(self)
|