def bound_box(self) -> BBox: """BBox: Returns the overall bounding box of this instance.""" barr = BBoxArray(self._master.bound_box, nx=self.nx, ny=self.ny, spx=self.spx, spy=self.spy) return barr.transform(self.transformation).get_overall_bbox()
def fill_box(self) -> BBox: """Returns the fill box of this instance.""" master_box = getattr(self._master, 'fill_box', None) # type: BBox if master_box is None: raise ValueError('Master template fill box is not defined.') barr = BBoxArray(master_box, nx=self.nx, ny=self.ny, spx=self.spx, spy=self.spy) return barr.transform(self.transformation).get_overall_bbox()
def array_box(self) -> BBox: """Returns the array box of this instance.""" master_box: BBox = getattr(self._master, 'array_box', None) if master_box is None: raise ValueError('Master template array box is not defined.') barr = BBoxArray(master_box, nx=self.nx, ny=self.ny, spx=self.spx, spy=self.spy) return barr.transform(self.transformation).bound_box
def test_constructor(box_data, nx, ny, spx, spy): base = BBox(*box_data) ref = BBoxArray(base, nx, ny, spx, spy) assert ref.base == base assert ref.nx == nx assert ref.ny == ny assert ref.spx == spx assert ref.spy == spy a1 = BBoxArray(base, Orient2D.x, nx, spx, ny, spy) a2 = BBoxArray(base, Orient2D.y, ny, spy, nx, spx) assert a1 == ref assert a2 == ref
def make_bbox_array(barr_info): base = BBox(barr_info[0][0], barr_info[0][1], barr_info[0][2], barr_info[0][3]) return BBoxArray(base, barr_info[1], barr_info[2], barr_info[3], barr_info[4])