This commit is contained in:
Matthias Koefferlein 2025-08-10 13:43:19 +02:00
parent 29cc603466
commit b4bbc26d6a
6 changed files with 16 additions and 15 deletions

View File

@ -85,7 +85,8 @@ struct DB_PUBLIC InstElement
*
* @param bc The bounding box converter for the cell instance (db::box_convert<db::CellInst>)
*/
db::Box bbox (const db::box_convert<db::CellInst> &bc) const
template <class BoxConvert>
db::Box bbox (const BoxConvert &bc) const
{
if (whole_array ()) {
// this is the whole array

View File

@ -627,7 +627,7 @@ Service::selection_bbox ()
db::CplxTrans ctx_trans = db::CplxTrans (layout.dbu ()) * cv.context_trans () * r->trans ();
db::box_convert<db::CellInst> bc (layout);
db::box_convert<db::CellInst, false> bc (layout);
if (! r->is_cell_inst ()) {
const std::vector<db::DCplxTrans> *tv_list = tv.per_cv_and_layer (r->cv_index (), r->layer ());

View File

@ -1686,7 +1686,7 @@ InstService::do_begin_edit (const db::DPoint &p)
std::pair<bool, db::cell_index_type> ci = make_cell (cv);
if (ci.first) {
// use the snapped lower left corner of the bbox unless the origin is inside the bbox
db::Box cell_bbox = cv->layout ().cell (ci.second).bbox ();
db::Box cell_bbox = cv->layout ().cell (ci.second).bbox_with_empty ();
if (! m_place_origin && ! cell_bbox.contains (db::Point ())) {
db::CplxTrans ct (1.0, m_angle, m_mirror, db::DVector ());
m_disp = db::DPoint () + (m_disp - snap (cell_bbox.transformed (ct).lower_left () * cv->layout ().dbu ()));
@ -1830,7 +1830,7 @@ InstService::do_mouse_move (const db::DPoint &p)
std::pair<bool, db::cell_index_type> ci = make_cell (cv);
if (ci.first) {
// use the snapped lower left corner of the bbox unless the origin is inside the bbox
db::Box cell_bbox = cv->layout ().cell (ci.second).bbox ();
db::Box cell_bbox = cv->layout ().cell (ci.second).bbox_with_empty ();
if (! m_place_origin && ! cell_bbox.contains (db::Point ())) {
db::CplxTrans ct (1.0, m_angle, m_mirror, db::DVector ());
m_disp = db::DPoint () + (m_disp - snap (cell_bbox.transformed (ct).lower_left () * cv->layout ().dbu ()));

View File

@ -100,13 +100,13 @@ Finder::start (lay::LayoutViewBase *view, unsigned int cv_index, const std::vect
if (layers.size () == 1) {
m_box_convert = db::box_convert <db::CellInst> (*mp_layout, (unsigned int) layers [0]);
m_cell_box_convert = db::box_convert <db::Cell> ((unsigned int) layers [0]);
m_box_convert = db::box_convert <db::CellInst, false> (*mp_layout, (unsigned int) layers [0]);
m_cell_box_convert = db::box_convert <db::Cell, false> ((unsigned int) layers [0]);
} else {
m_box_convert = db::box_convert <db::CellInst> (*mp_layout);
m_cell_box_convert = db::box_convert <db::Cell> ();
m_box_convert = db::box_convert <db::CellInst, false> (*mp_layout);
m_cell_box_convert = db::box_convert <db::Cell, false> ();
}
@ -836,10 +836,10 @@ InstFinder::visit_cell (const db::Cell &cell, const db::Box &search_box, const d
++*mp_progress;
db::Box ibox;
if (inst_cell.bbox ().empty ()) {
if (inst_cell.bbox_with_empty ().empty ()) {
ibox = db::Box (db::Point (0, 0), db::Point (0, 0));
} else if (! m_visible_layers || level == mp_view->get_max_hier_levels () - 1 || mp_view->is_cell_hidden (inst_cell.cell_index (), m_cv_index)) {
ibox = inst_cell.bbox ();
ibox = inst_cell.bbox_with_empty ();
} else {
for (std::vector<int>::const_iterator l = m_visible_layer_indexes.begin (); l != m_visible_layer_indexes.end (); ++l) {
ibox += inst_cell.bbox (*l);
@ -914,10 +914,10 @@ InstFinder::visit_cell (const db::Cell &cell, const db::Box &search_box, const d
double d = std::numeric_limits<double>::max ();
db::Box ibox;
if (inst_cell.bbox ().empty ()) {
if (inst_cell.bbox_with_empty ().empty ()) {
ibox = db::Box (db::Point (0, 0), db::Point (0, 0));
} else if (! m_visible_layers || level == mp_view->get_max_hier_levels () - 1 || mp_view->is_cell_hidden (inst_cell.cell_index (), m_cv_index)) {
ibox = inst_cell.bbox ();
ibox = inst_cell.bbox_with_empty ();
} else {
for (std::vector<int>::const_iterator l = m_visible_layer_indexes.begin (); l != m_visible_layer_indexes.end (); ++l) {
ibox += inst_cell.bbox (*l);

View File

@ -218,8 +218,8 @@ private:
bool m_point_mode;
bool m_catch_all;
bool m_top_level_sel;
db::box_convert <db::CellInst> m_box_convert;
db::box_convert <db::Cell> m_cell_box_convert;
db::box_convert <db::CellInst, false> m_box_convert;
db::box_convert <db::Cell, false> m_cell_box_convert;
};
/**

View File

@ -2282,7 +2282,7 @@ RedrawThreadWorker::iterate_variants_rec (const std::vector <db::Box> &redraw_re
db::Coord lim = std::numeric_limits<db::Coord>::max ();
db::DBox world (trans * db::Box (db::Point (-lim, -lim), db::Point (lim, lim)));
db::Box vp = db::Box (trans.inverted () * (world & db::DBox (*rr)));
vp &= mp_layout->cell (ci).bbox (); // this avoids problems when accessing designs through very large viewports
vp &= mp_layout->cell (ci).bbox_with_empty (); // this avoids problems when accessing designs through very large viewports
if (! vp.empty ()) {
actual_regions.push_back (vp);
}