Example #1
0
    def __init__(self, hs_group, open_fence_symbol, close_fence_symbol=None):
        """

        :param hs_group:
        :type hs_group: me_group.internal_me_group.MEHorSupOrSubGroup
        :param open_fence_symbo:
        :type open_fence_symbo: MESymbol
        :param close_fence_symbol:
        :type close_fence_symbol: MESymbol
        """
        MEGroup.__init__(self)
        MEObject.__init__(self)
        self.hs_group = hs_group
        self.open_fence_symbol = open_fence_symbol
        self.close_fence_symbol = close_fence_symbol

        tight_bbox_list = [
            hs_group.get_tight_bbox(),
            open_fence_symbol.get_tight_bbox(),
        ]
        if close_fence_symbol is not None:
            tight_bbox_list.append(close_fence_symbol.get_tight_bbox())
        merged_tight_bbox = merge_bbox_list(tight_bbox_list)
        self.set_tight_bbox(merged_tight_bbox)
        self.set_adjusted_bbox(hs_group.get_adjusted_bbox())
Example #2
0
 def __init__(self, me_groups):
     MEGroup.__init__(self)
     MEObject.__init__(self)
     self.me_groups = me_groups
     self.set_tight_bbox(
         merge_bbox_list(
             [me_group.get_tight_bbox() for me_group in self.me_groups]))
     self.set_adjusted_bbox(
         merge_bbox_list(
             [me_group.get_adjusted_bbox() for me_group in self.me_groups]))
Example #3
0
 def __init__(self, base_me_group, upper_me_group):
     MEGroup.__init__(self)
     MEObject.__init__(self)
     self.base_me_group = base_me_group
     self.upper_me_group = upper_me_group
     self.set_adjusted_bbox(self.base_me_group.get_adjusted_bbox())
     self.set_tight_bbox(
         merge_bbox_list([
             self.base_me_group.get_tight_bbox(),
             self.upper_me_group.get_tight_bbox()
         ]))
Example #4
0
    def __init__(self, me_symbol):
        """

        :param me_symbol:
        :type me_symbol: MESymbol
        """
        assert isinstance(me_symbol, MESymbol)

        MEGroup.__init__(self)
        MEObject.__init__(self)
        self.me_symbol = me_symbol
        self.set_adjusted_bbox(me_symbol.get_adjusted_bbox())
        self.set_tight_bbox(me_symbol.get_tight_bbox())
Example #5
0
    def __init__(self, mg_mat):
        MEGroup.__init__(self)
        MEObject.__init__(self)
        self.mg_mat = mg_mat

        # tight bbox
        tmp_mg_list = []
        for r, mg_list in enumerate(self.mg_mat):
            for c, mg in enumerate(mg_list):
                tmp_mg_list.append(mg)
        merged_bbox = merge_bbox_list(
            [mg.get_tight_bbox() for mg in tmp_mg_list])
        self.set_tight_bbox(merged_bbox)

        # TODO, adjust bbox
        self.set_adjusted_bbox(merged_bbox)
Example #6
0
    def __init__(self, base_me_group, sup_me_group):
        """

        :param base_me_group: Base
        :param sup_me_group: sup part
        """
        MEGroup.__init__(self)
        MEObject.__init__(self)  # the bbox function
        self.base_me_group = base_me_group
        self.sup_me_group = sup_me_group
        self.set_adjusted_bbox(self.base_me_group.get_adjusted_bbox()
                               )  # based on the base me group
        self.set_tight_bbox(
            merge_bbox_list([
                self.base_me_group.get_tight_bbox(),
                self.sup_me_group.get_tight_bbox()
            ]))
Example #7
0
    def __init__(self, base_me_group, under_me_group):
        """

        :param base_me_group:
        :param under_me_group:
        """
        MEGroup.__init__(self)
        MEObject.__init__(self)
        self.base_me_group = base_me_group
        self.under_me_group = under_me_group
        # the adjusted is to calculate the relative relationship between groups
        self.set_adjusted_bbox(self.base_me_group.get_adjusted_bbox())
        # the tight bbox is for the assessment of the relationship of overlapping
        self.set_tight_bbox(
            merge_bbox_list([
                self.base_me_group.get_tight_bbox(),
                self.under_me_group.get_tight_bbox()
            ]))
Example #8
0
    def __init__(self, bind_var_symbol, up_me_group, down_me_group):
        """

        :param bind_var_symbol:
        :type bind_var_symbol: MESymbolGroup
        :param up_me_group:
        :type up_me_group: MEGroup
        :param down_me_group:
        :type down_me_group: MEGroup
        """
        MEGroup.__init__(self)
        MEObject.__init__(self)

        self.bind_var_symbol = bind_var_symbol
        if up_me_group is None:
            self.up_me_group = EmptyGroup()
        else:
            self.up_me_group = up_me_group
        if down_me_group is None:
            self.down_me_group = EmptyGroup()
        else:
            self.down_me_group = down_me_group

        tight_bbox = bind_var_symbol.get_tight_bbox()
        if not isinstance(up_me_group, EmptyGroup):
            # TODO, NOTE, commented out, the assertion might be related with the layout analysis sequence
            # might only for debugging purpose
            #assert isinstance(up_me_group, UnorganizedGroupPath)
            if len(up_me_group.me_groups) != 0:
                tight_bbox = merge_bbox(tight_bbox,
                                        up_me_group.get_tight_bbox())

        if not isinstance(down_me_group, EmptyGroup):
            # TODO, NOTE, commented out, the assertion might be related with the layout analysis sequence
            # might only for debugging purpose
            #assert isinstance(down_me_group, UnorganizedGroupPath)
            if len(down_me_group.me_groups) != 0:
                tight_bbox = merge_bbox(tight_bbox,
                                        down_me_group.get_tight_bbox())
        self.set_tight_bbox(tight_bbox)

        self.set_adjusted_bbox(self.bind_var_symbol.get_adjusted_bbox())