mirror of https://github.com/KLayout/klayout.git
Fixing 'tap' feature
After introducing the "do not select shapes or instances if they overlap the viewport entirely" feature, 'tap' was not finding shapes which extended beyond the view's borders. This got fixed and for 'tap', such shapes are considered again.
This commit is contained in:
parent
1dc0a56633
commit
e6fa072bee
|
|
@ -2364,7 +2364,7 @@ MainService::cm_tap ()
|
|||
return;
|
||||
}
|
||||
|
||||
lay::ShapeFinder finder (true /*point mode*/, false /*all hierarchy levels*/, db::ShapeIterator::All, 0);
|
||||
lay::ShapeFinder finder (true /*point mode*/, false /*all hierarchy levels*/, db::ShapeIterator::All, 0, true /*capture all shapes*/);
|
||||
|
||||
// capture all objects in point mode (default: capture one only)
|
||||
finder.set_catch_all (true);
|
||||
|
|
|
|||
|
|
@ -256,12 +256,13 @@ Finder::do_find (const db::Cell &cell, int level, const db::DCplxTrans &vp, cons
|
|||
// -------------------------------------------------------------
|
||||
// ShapeFinder implementation
|
||||
|
||||
ShapeFinder::ShapeFinder (bool point_mode, bool top_level_sel, db::ShapeIterator::flags_type flags, const std::set<lay::ObjectInstPath> *excludes)
|
||||
ShapeFinder::ShapeFinder (bool point_mode, bool top_level_sel, db::ShapeIterator::flags_type flags, const std::set<lay::ObjectInstPath> *excludes, bool capture_all_shapes)
|
||||
: Finder (point_mode, top_level_sel),
|
||||
mp_excludes ((excludes && !excludes->empty ()) ? excludes : 0),
|
||||
m_flags (flags), m_cv_index (0), m_topcell (0),
|
||||
mp_text_info (0),
|
||||
mp_prop_sel (0), m_inv_prop_sel (false), mp_progress (0)
|
||||
mp_prop_sel (0), m_inv_prop_sel (false), mp_progress (0),
|
||||
m_capture_all_shapes (capture_all_shapes)
|
||||
{
|
||||
m_tries = point_sel_tests;
|
||||
}
|
||||
|
|
@ -579,7 +580,7 @@ ShapeFinder::visit_cell (const db::Cell &cell, const db::Box &hit_box, const db:
|
|||
// in point mode, test the edges and use a "closest" criterion
|
||||
if (shape->is_polygon ()) {
|
||||
|
||||
bool any_valid_edge = false;
|
||||
bool any_valid_edge = m_capture_all_shapes;
|
||||
for (db::Shape::polygon_edge_iterator e = shape->begin_edge (); ! e.at_end (); ++e) {
|
||||
if ((*e).clipped (viewport_box).first) {
|
||||
any_valid_edge = true;
|
||||
|
|
@ -595,7 +596,7 @@ ShapeFinder::visit_cell (const db::Cell &cell, const db::Box &hit_box, const db:
|
|||
|
||||
} else if (shape->is_path ()) {
|
||||
|
||||
bool any_valid_edge = false;
|
||||
bool any_valid_edge = m_capture_all_shapes;
|
||||
|
||||
// test the "spine"
|
||||
db::Shape::point_iterator pt = shape->begin_point ();
|
||||
|
|
@ -644,7 +645,7 @@ ShapeFinder::visit_cell (const db::Cell &cell, const db::Box &hit_box, const db:
|
|||
match = true;
|
||||
} else {
|
||||
|
||||
bool any_valid_edge = false;
|
||||
bool any_valid_edge = m_capture_all_shapes;
|
||||
|
||||
// convert to polygon and test those edges
|
||||
db::Polygon poly (box);
|
||||
|
|
|
|||
|
|
@ -236,7 +236,16 @@ public:
|
|||
typedef std::vector<lay::ObjectInstPath> founds_vector_type;
|
||||
typedef founds_vector_type::const_iterator iterator;
|
||||
|
||||
ShapeFinder (bool point_mode, bool top_level_sel, db::ShapeIterator::flags_type flags, const std::set<lay::ObjectInstPath> *excludes = 0);
|
||||
/**
|
||||
* @brief Creates a shape finder object
|
||||
*
|
||||
* @param point_mode If true, selects "point mode", where shapes are found relative to the (point-like) bounding box
|
||||
* @param top_level_sel If true, selects only top level objects
|
||||
* @param flags The shape types to look for
|
||||
* @param excludes Objects (by instance path) to exclude
|
||||
* @param capture_all_shapes Only valid in point mode. If true, all shapes are found. Otherwise only those which are not overlapping the view port entirely.
|
||||
*/
|
||||
ShapeFinder (bool point_mode, bool top_level_sel, db::ShapeIterator::flags_type flags, const std::set<lay::ObjectInstPath> *excludes = 0, bool capture_all_shapes = false);
|
||||
|
||||
bool find (LayoutViewBase *view, const lay::LayerProperties &lprops, const db::DBox ®ion_mu);
|
||||
bool find (LayoutViewBase *view, const db::DBox ®ion_mu);
|
||||
|
|
@ -313,6 +322,7 @@ private:
|
|||
tl::AbsoluteProgress *mp_progress;
|
||||
std::vector<int> m_context_layers;
|
||||
std::map<db::cell_index_type, bool> m_cells_with_context;
|
||||
bool m_capture_all_shapes;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue