diff --git a/src/db/db/dbLayoutQuery.cc b/src/db/db/dbLayoutQuery.cc
index 02ab78dd1..901e615ca 100644
--- a/src/db/db/dbLayoutQuery.cc
+++ b/src/db/db/dbLayoutQuery.cc
@@ -42,10 +42,69 @@ namespace db
// --------------------------------------------------------------------------------
// Some utilities
-bool check_trailing_reserved_word (const tl::Extractor &ex0)
+static const char *s_select = "select";
+static const char *s_delete = "delete";
+static const char *s_or = "or";
+static const char *s_of = "of";
+static const char *s_on = "on";
+static const char *s_do = "do";
+static const char *s_from = "from";
+static const char *s_layer = "layer";
+static const char *s_layers = "layers";
+static const char *s_cell = "cell";
+static const char *s_cells = "cells";
+static const char *s_where = "where";
+static const char *s_shapes = "shapes";
+static const char *s_polygons = "polygons";
+static const char *s_boxes = "boxes";
+static const char *s_edges = "edges";
+static const char *s_paths = "paths";
+static const char *s_texts = "texts";
+static const char *s_instances = "instances";
+static const char *s_arrays = "arrays";
+static const char *s_sorted = "sorted";
+static const char *s_unique = "unique";
+static const char *s_by = "by";
+static const char *s_with = "with";
+static const char *s_pass = "pass";
+
+const char *s_reserved_words[] = {
+ s_select,
+ s_delete,
+ s_or,
+ s_of,
+ s_on,
+ s_do,
+ s_from,
+ s_layer,
+ s_layers,
+ s_cell,
+ s_cells,
+ s_where,
+ s_shapes,
+ s_polygons,
+ s_boxes,
+ s_edges,
+ s_paths,
+ s_texts,
+ s_instances,
+ s_arrays,
+ s_sorted,
+ s_unique,
+ s_by,
+ s_with,
+ s_pass
+};
+
+bool check_trailing_reserved_word (const tl::Extractor &ex0)
{
tl::Extractor ex = ex0;
- return (ex.test ("do") || ex.test ("sorted") || ex.test ("pass") || ex.test ("where"));
+ for (size_t i = 0; i < sizeof (s_reserved_words) / sizeof (s_reserved_words[0]); ++i) {
+ if (ex.test (s_reserved_words[i])) {
+ return true;
+ }
+ }
+ return false;
}
// --------------------------------------------------------------------------------
@@ -202,7 +261,9 @@ struct ShapeFilterPropertyIDs
ShapeFilterPropertyIDs (LayoutQuery *q)
{
bbox = q->register_property ("bbox", LQ_box);
+ dbbox = q->register_property ("dbbox", LQ_dbox);
shape_bbox = q->register_property ("shape_bbox", LQ_box);
+ shape_dbbox = q->register_property ("shape_dbbox", LQ_dbox);
shape = q->register_property ("shape", LQ_shape);
layer_info = q->register_property ("layer_info", LQ_layer);
layer_index = q->register_property ("layer_index", LQ_variant);
@@ -211,7 +272,9 @@ struct ShapeFilterPropertyIDs
}
unsigned int bbox; // bbox -> The shape's bounding box
+ unsigned int dbbox; // dbbox -> The shape's bounding box in micrometer units
unsigned int shape_bbox; // shape_bbox -> == box
+ unsigned int shape_dbbox; // shape_dbbox -> == dbox
unsigned int shape; // shape -> The shape object
unsigned int layer_info; // layer_info -> The layer (a LayerInfo object)
unsigned int layer_index; // layer_index -> The layer index
@@ -309,6 +372,12 @@ public:
v = tl::Variant::make_variant (m_shape->bbox ());
return true;
+ } else if (id == m_pids.dbbox || id == m_pids.shape_dbbox) {
+
+ tl_assert (mp_parent->layout ());
+ v = tl::Variant::make_variant (db::CplxTrans (mp_parent->layout ()->dbu ()) * m_shape->bbox ());
+ return true;
+
} else if (id == m_pids.shape) {
if (m_reading) {
@@ -418,7 +487,9 @@ struct ChildCellFilterPropertyIDs
parent_cell_name = q->register_property ("parent_cell_name", LQ_variant);
hier_levels = q->register_property ("hier_levels", LQ_variant);
bbox = q->register_property ("bbox", LQ_box);
+ dbbox = q->register_property ("dbbox", LQ_dbox);
cell_bbox = q->register_property ("cell_bbox", LQ_box);
+ cell_dbbox = q->register_property ("cell_dbbox", LQ_dbox);
// with instance_mode == NoInstances:
if (instance_mode == NoInstances) {
@@ -434,21 +505,31 @@ struct ChildCellFilterPropertyIDs
// with instance_mode != NoInstances:
if (instance_mode != NoInstances) {
path_trans = q->register_property ("path_trans", LQ_trans);
+ path_dtrans = q->register_property ("path_dtrans", LQ_dtrans);
trans = q->register_property ("trans", LQ_trans);
+ dtrans = q->register_property ("dtrans", LQ_dtrans);
inst_bbox = q->register_property ("inst_bbox", LQ_box);
+ inst_dbbox = q->register_property ("inst_dbbox", LQ_box);
inst = q->register_property ("inst", LQ_instance);
array_a = q->register_property ("array_a", LQ_point);
+ array_da = q->register_property ("array_da", LQ_dpoint);
array_na = q->register_property ("array_na", LQ_variant);
array_b = q->register_property ("array_b", LQ_point);
+ array_db = q->register_property ("array_db", LQ_dpoint);
array_nb = q->register_property ("array_nb", LQ_variant);
} else {
path_trans = std::numeric_limits::max ();
+ path_dtrans = std::numeric_limits::max ();
trans = std::numeric_limits::max ();
+ dtrans = std::numeric_limits::max ();
inst_bbox = std::numeric_limits::max ();
+ inst_dbbox = std::numeric_limits::max ();
inst = std::numeric_limits::max ();
array_a = std::numeric_limits::max ();
+ array_da = std::numeric_limits::max ();
array_na = std::numeric_limits::max ();
array_b = std::numeric_limits::max ();
+ array_db = std::numeric_limits::max ();
array_nb = std::numeric_limits::max ();
}
@@ -475,7 +556,9 @@ struct ChildCellFilterPropertyIDs
unsigned int parent_cell_name; // parent_cell_name -> Name of parent cell (next in path) or nil
unsigned int hier_levels; // hier_levels -> Number of hierarchy levels in path (length of path - 1)
unsigned int bbox; // bbox -> Cell bounding box
+ unsigned int dbbox; // dbbox -> Cell bounding box in micrometer units
unsigned int cell_bbox; // cell_bbox -> == bbox
+ unsigned int cell_dbbox; // cell_dbbox -> == dbbox
// with instance_mode == NoInstances:
unsigned int references; // references -> The number of instances (arefs count as 1) of this cell in the parent cell
@@ -484,17 +567,22 @@ struct ChildCellFilterPropertyIDs
// with instance_mode != NoInstances:
unsigned int path_trans; // path_trans -> The transformation of that instance into the top cell
+ unsigned int path_dtrans; // path_dtrans -> The transformation of that instance into the top cell in micrometer units
unsigned int trans; // trans -> The transformation of that instance (first instance if an array)
+ unsigned int dtrans; // dtrans -> The transformation of that instance (first instance if an array) in micrometer units
unsigned int inst_bbox; // inst_bbox -> The instance bounding box in the top cell
+ unsigned int inst_dbbox; // inst_dbbox -> The instance bounding box in the top cell in micrometer units
unsigned int inst; // inst -> The instance object
unsigned int array_a; // array_a -> The a vector for an array instance
+ unsigned int array_da; // array_da -> The a vector for an array instance in micrometer units
unsigned int array_na; // array_na -> The a axis array dimension
unsigned int array_b; // array_b -> The b vector for an array instance
+ unsigned int array_db; // array_db -> The b vector for an array instance in micrometer units
unsigned int array_nb; // array_nb -> The b axis array dimension
// with instance_mode == ExplodedInstances:
unsigned int array_ia; // array_ia -> The a index when an array is iterated
- unsigned int array_ib; // array_ib -> The b index when an array is iterated
+ unsigned int array_ib; // array_ib -> The b index when an array is iterated
};
class DB_PUBLIC ChildCellFilterState
@@ -764,6 +852,15 @@ public:
}
return true;
+ } else if (id == m_pids.dbbox || id == m_pids.cell_dbbox) {
+
+ if (! layout ()->is_valid_cell_index (cell_index ())) {
+ v = tl::Variant ();
+ } else {
+ v = tl::Variant::make_variant (db::CplxTrans (layout ()->dbu ()) * layout ()->cell (cell_index ()).bbox ());
+ }
+ return true;
+
} else if (id == m_pids.cell_name) {
if (! layout ()->is_valid_cell_index (cell_index ())) {
@@ -983,6 +1080,35 @@ public:
return false;
}
+ } else if (id == m_pids.inst_dbbox) {
+
+ if (mp_parent) {
+
+ if (m_instance_mode == ExplodedInstances) {
+
+ db::ICplxTrans t = m_parent_trans;
+ t *= (*m_inst)->complex_trans (*m_array_iter);
+ db::DBox box (db::CplxTrans (layout ()->dbu ()) * t * layout ()->cell ((*m_inst)->object ().cell_index ()).bbox ());
+ v = tl::Variant::make_variant (box);
+ return true;
+
+ } else if (m_instance_mode == ArrayInstances) {
+
+ db::ICplxTrans t = m_parent_trans;
+ t *= (*m_inst)->complex_trans ();
+ db::box_convert bc (*layout ());
+ db::DBox box (db::CplxTrans (layout ()->dbu ()) * t * (*m_inst)->bbox (bc));
+ v = tl::Variant::make_variant (box);
+ return true;
+
+ } else {
+ return false;
+ }
+
+ } else {
+ return false;
+ }
+
} else if (id == m_pids.path_trans) {
if (mp_parent) {
@@ -1011,6 +1137,36 @@ public:
return true;
}
+ } else if (id == m_pids.path_dtrans) {
+
+ if (mp_parent) {
+
+ if (m_instance_mode == ExplodedInstances) {
+
+ db::ICplxTrans t = m_parent_trans;
+ t *= (*m_inst)->complex_trans (*m_array_iter);
+ db::CplxTrans tdbu (layout ()->dbu ());
+ v = tl::Variant::make_variant (tdbu * t * tdbu.inverted ());
+ return true;
+
+ } else if (m_instance_mode == ArrayInstances) {
+
+ db::ICplxTrans t = m_parent_trans;
+ t *= (*m_inst)->complex_trans ();
+ db::CplxTrans tdbu (layout ()->dbu ());
+ v = tl::Variant::make_variant (tdbu * t * tdbu.inverted ());
+ return true;
+
+ } else {
+ v = tl::Variant::make_variant (db::ICplxTrans ());
+ return true;
+ }
+
+ } else {
+ v = tl::Variant::make_variant (db::ICplxTrans ());
+ return true;
+ }
+
} else if (id == m_pids.trans) {
if (mp_parent) {
@@ -1033,6 +1189,30 @@ public:
return false;
}
+ } else if (id == m_pids.dtrans) {
+
+ if (mp_parent) {
+
+ if (m_instance_mode == ExplodedInstances) {
+
+ db::CplxTrans tdbu (layout ()->dbu ());
+ v = tl::Variant::make_variant (tdbu * (*m_inst)->complex_trans (*m_array_iter) * tdbu.inverted ());
+ return true;
+
+ } else if (m_instance_mode == ArrayInstances) {
+
+ db::CplxTrans tdbu (layout ()->dbu ());
+ v = tl::Variant::make_variant (tdbu * (*m_inst)->complex_trans () * tdbu.inverted ());
+ return true;
+
+ } else {
+ return false;
+ }
+
+ } else {
+ return false;
+ }
+
} else if (id == m_pids.inst) {
if (! mp_parent || m_instance_mode == NoInstances) {
@@ -1064,7 +1244,7 @@ public:
return true;
}
- } else if (id == m_pids.array_a || id == m_pids.array_b || id == m_pids.array_na || id == m_pids.array_nb) {
+ } else if (id == m_pids.array_a || id == m_pids.array_b || id == m_pids.array_da || id == m_pids.array_db || id == m_pids.array_na || id == m_pids.array_nb) {
if (! mp_parent || m_instance_mode == NoInstances) {
return false;
@@ -1074,8 +1254,12 @@ public:
if ((*m_inst)->is_regular_array (a, b, na, nb)) {
if (id == m_pids.array_a) {
v = tl::Variant::make_variant (a);
+ } else if (id == m_pids.array_da) {
+ v = tl::Variant::make_variant (db::CplxTrans (layout ()->dbu ()) * a);
} else if (id == m_pids.array_b) {
v = tl::Variant::make_variant (b);
+ } else if (id == m_pids.array_db) {
+ v = tl::Variant::make_variant (db::CplxTrans (layout ()->dbu ()) * b);
} else if (id == m_pids.array_na) {
v = na;
} else if (id == m_pids.array_nb) {
@@ -1178,8 +1362,11 @@ struct CellFilterPropertyIDs
tot_weight = q->register_property ("tot_weight", LQ_variant);
instances = q->register_property ("instances", LQ_variant);
bbox = q->register_property ("bbox", LQ_box);
+ dbbox = q->register_property ("dbbox", LQ_dbox);
cell_bbox = q->register_property ("cell_bbox", LQ_box);
+ cell_dbbox = q->register_property ("cell_dbbox", LQ_dbox);
path_trans = q->register_property ("path_trans", LQ_trans);
+ path_dtrans = q->register_property ("path_dtrans", LQ_dtrans);
}
unsigned int path; // path -> Variant array with the indexes of the cells in that path
@@ -1200,8 +1387,11 @@ struct CellFilterPropertyIDs
unsigned int tot_weight; // tot_weight -> The number of instances of this cell in the initial cell along the given path
unsigned int instances; // instances -> The number of instances of this cell in the previous cell (or over all if there is no previous cell)
unsigned int bbox; // bbox -> Cell bounding box
+ unsigned int dbbox; // dbbox -> Cell bounding box in micrometer units
unsigned int cell_bbox; // cell_bbox -> == bbox
+ unsigned int cell_dbbox; // cell_dbbox -> == dbbox
unsigned int path_trans; // parent_trans -> transformation to initial cell
+ unsigned int path_dtrans; // parent_dtrans -> transformation to initial cell in micrometer units
};
class DB_PUBLIC CellFilterState
@@ -1283,6 +1473,15 @@ public:
}
return true;
+ } else if (id == m_pids.dbbox || id == m_pids.cell_dbbox) {
+
+ if (! layout ()->is_valid_cell_index (*m_cell)) {
+ v = tl::Variant ();
+ } else {
+ v = tl::Variant::make_variant (db::CplxTrans (layout ()->dbu ()) * layout ()->cell (*m_cell).bbox ());
+ }
+ return true;
+
} else if (id == m_pids.cell_name || id == m_pids.initial_cell_name) {
if (! layout ()->is_valid_cell_index (*m_cell)) {
@@ -1363,6 +1562,11 @@ public:
v = tl::Variant::make_variant (db::ICplxTrans ());
return true;
+ } else if (id == m_pids.path_dtrans) {
+
+ v = tl::Variant::make_variant (db::DCplxTrans ());
+ return true;
+
} else {
return FilterStateBase::get_property (id, v);
}
@@ -2225,7 +2429,7 @@ parse_cell_name_filter_element (tl::Extractor &ex, LayoutQuery *q, ChildCellFilt
std::unique_ptr b (new FilterBracket (q));
do {
parse_cell_name_filter_seq (ex, q, b.get (), instance_mode, reading);
- } while (ex.test (",") || ex.test ("or"));
+ } while (ex.test (",") || ex.test (s_or));
// TODO: do this in the optimization
if (b->children ().size () == 1 && dynamic_cast (b->children ()[0])) {
@@ -2362,21 +2566,21 @@ parse_cell_filter (tl::Extractor &ex, LayoutQuery *q, FilterBracket *bracket, bo
std::unique_ptr b (new FilterBracket (q));
- if (ex.test ("instances")) {
- (ex.test ("of") || ex.test ("from")) && (ex.test ("cells") || ex.test ("cell"));
+ if (ex.test (s_instances)) {
+ (ex.test (s_of) || ex.test (s_from)) && (ex.test (s_cells) || ex.test (s_cell));
// Because an array member cannot be modified we use ArrayInstances in the modification case always
parse_cell_name_filter_seq (ex, q, b.get (), reading ? ExplodedInstances : ArrayInstances, reading);
- } else if (ex.test ("arrays")) {
- (ex.test ("of") || ex.test ("from")) && (ex.test ("cells") || ex.test ("cell"));
+ } else if (ex.test (s_arrays)) {
+ (ex.test (s_of) || ex.test (s_from)) && (ex.test (s_cells) || ex.test (s_cell));
parse_cell_name_filter_seq (ex, q, b.get (), ArrayInstances, reading);
} else {
- ex.test ("cells") || ex.test ("cell");
+ ex.test (s_cells) || ex.test (s_cell);
parse_cell_name_filter_seq (ex, q, b.get (), NoInstances, reading);
}
FilterBase *fl = 0, *f = 0;
- if (with_where_clause && ex.test ("where")) {
+ if (with_where_clause && ex.test (s_where)) {
std::string expr = tl::Eval::parse_expr (ex, true);
@@ -2407,22 +2611,22 @@ parse_filter (tl::Extractor &ex, LayoutQuery *q, FilterBracket *bracket, bool re
{
unsigned int sf = (unsigned int) db::ShapeIterator::Nothing;
do {
- if (ex.test ("shapes")) {
+ if (ex.test (s_shapes)) {
sf |= (unsigned int) db::ShapeIterator::All;
- } else if (ex.test ("polygons")) {
+ } else if (ex.test (s_polygons)) {
sf |= (unsigned int) db::ShapeIterator::Polygons;
- } else if (ex.test ("boxes")) {
+ } else if (ex.test (s_boxes)) {
sf |= (unsigned int) db::ShapeIterator::Boxes;
- } else if (ex.test ("edges")) {
+ } else if (ex.test (s_edges)) {
sf |= (unsigned int) db::ShapeIterator::Edges;
- } else if (ex.test ("paths")) {
+ } else if (ex.test (s_paths)) {
sf |= (unsigned int) db::ShapeIterator::Paths;
- } else if (ex.test ("texts")) {
+ } else if (ex.test (s_texts)) {
sf |= (unsigned int) db::ShapeIterator::Texts;
} else {
break;
}
- } while (ex.test (",") || ex.test ("or"));
+ } while (ex.test (",") || ex.test (s_or));
db::ShapeIterator::flags_type shapes = (db::ShapeIterator::flags_type) sf;
@@ -2430,12 +2634,12 @@ parse_filter (tl::Extractor &ex, LayoutQuery *q, FilterBracket *bracket, bool re
db::LayerMap lm;
- if (ex.test ("on")) {
- ex.test ("layer") || ex.test ("layers");
+ if (ex.test (s_on)) {
+ ex.test (s_layer) || ex.test (s_layers);
lm.map_expr (ex, 0);
}
- ex.test ("of") || ex.test ("from");
+ ex.test (s_of) || ex.test (s_from);
std::unique_ptr b (new FilterBracket (q));
parse_cell_filter (ex, q, b.get (), false, reading);
@@ -2451,7 +2655,7 @@ parse_filter (tl::Extractor &ex, LayoutQuery *q, FilterBracket *bracket, bool re
bracket->add_child (f);
fl->connect (f);
- if (ex.test ("where")) {
+ if (ex.test (s_where)) {
std::string expr = tl::Eval::parse_expr (ex, true);
@@ -2472,7 +2676,7 @@ parse_filter (tl::Extractor &ex, LayoutQuery *q, FilterBracket *bracket, bool re
void
parse_statement (tl::Extractor &ex, LayoutQuery *q, FilterBracket *bracket, bool reading)
{
- if (ex.test ("select")) {
+ if (ex.test (s_select)) {
std::vector expressions;
@@ -2480,7 +2684,7 @@ parse_statement (tl::Extractor &ex, LayoutQuery *q, FilterBracket *bracket, bool
expressions.push_back (tl::Eval::parse_expr (ex, true));
} while (ex.test (","));
- ex.expect ("from");
+ ex.expect (s_from);
std::unique_ptr b (new FilterBracket (q));
parse_filter (ex, q, b.get (), true);
@@ -2488,10 +2692,10 @@ parse_statement (tl::Extractor &ex, LayoutQuery *q, FilterBracket *bracket, bool
bool unique = false;
std::string sort_expression;
- if (ex.test ("sorted")) {
- ex.test ("by");
+ if (ex.test (s_sorted)) {
+ ex.test (s_by);
sort_expression = tl::Eval::parse_expr (ex, true);
- unique = ex.test ("unique");
+ unique = ex.test (s_unique);
}
FilterBase *f = b.release ();
@@ -2504,16 +2708,16 @@ parse_statement (tl::Extractor &ex, LayoutQuery *q, FilterBracket *bracket, bool
bracket->connect_exit (ff);
- } else if (! reading && ex.test ("with")) {
+ } else if (! reading && ex.test (s_with)) {
std::unique_ptr b (new FilterBracket (q));
parse_filter (ex, q, b.get (), false);
- ex.expect ("do");
+ ex.expect (s_do);
std::string expression = tl::Eval::parse_expr (ex, true);
- bool transparent = ex.test ("pass");
+ bool transparent = ex.test (s_pass);
FilterBase *f = b.release ();
bracket->add_child (f);
@@ -2525,12 +2729,12 @@ parse_statement (tl::Extractor &ex, LayoutQuery *q, FilterBracket *bracket, bool
bracket->connect_exit (ff);
- } else if (! reading && ex.test ("delete")) {
+ } else if (! reading && ex.test (s_delete)) {
std::unique_ptr b (new FilterBracket (q));
parse_filter (ex, q, b.get (), false);
- bool transparent = ex.test ("pass");
+ bool transparent = ex.test (s_pass);
FilterBase *f = b.release ();
bracket->add_child (f);
@@ -2554,7 +2758,10 @@ LayoutQuery::LayoutQuery (const std::string &query)
tl::Extractor ex (query.c_str ());
parse_statement (ex, this, r.get (), false);
- ex.expect_end ();
+
+ if (! ex.at_end ()) {
+ ex.error (tl::to_string (tr ("Unexpected text")));
+ }
r->optimize ();
mp_root = r.release ();
diff --git a/src/db/db/dbLayoutQuery.h b/src/db/db/dbLayoutQuery.h
index ac9a04d32..8fff4c492 100644
--- a/src/db/db/dbLayoutQuery.h
+++ b/src/db/db/dbLayoutQuery.h
@@ -51,11 +51,14 @@ enum LayoutQueryPropertyType
LQ_variant,
LQ_shape,
LQ_trans,
+ LQ_dtrans,
LQ_layer,
LQ_instance,
LQ_cell,
LQ_point,
+ LQ_dpoint,
LQ_box,
+ LQ_dbox,
LQ_polygon,
LQ_path,
LQ_edge,
diff --git a/src/db/db/dbRecursiveInstanceIterator.cc b/src/db/db/dbRecursiveInstanceIterator.cc
index 257d49550..60577cf67 100644
--- a/src/db/db/dbRecursiveInstanceIterator.cc
+++ b/src/db/db/dbRecursiveInstanceIterator.cc
@@ -83,7 +83,6 @@ RecursiveInstanceIterator &RecursiveInstanceIterator::operator= (const Recursive
RecursiveInstanceIterator::RecursiveInstanceIterator ()
{
// anything. Not necessary reasonable.
- mp_layout = 0;
mp_top_cell = 0;
mp_cell = 0;
m_overlapping = false;
@@ -97,7 +96,7 @@ RecursiveInstanceIterator::RecursiveInstanceIterator ()
RecursiveInstanceIterator::RecursiveInstanceIterator (const layout_type &layout, const cell_type &cell, const box_type ®ion, bool overlapping)
: m_box_convert (layout)
{
- mp_layout = &layout;
+ mp_layout = const_cast (&layout);
mp_top_cell = &cell;
m_overlapping = overlapping;
init ();
@@ -107,7 +106,7 @@ RecursiveInstanceIterator::RecursiveInstanceIterator (const layout_type &layout,
RecursiveInstanceIterator::RecursiveInstanceIterator (const layout_type &layout, const cell_type &cell, const region_type ®ion, bool overlapping)
: m_box_convert (layout)
{
- mp_layout = &layout;
+ mp_layout = const_cast (&layout);
mp_top_cell = &cell;
m_overlapping = overlapping;
init ();
@@ -117,7 +116,7 @@ RecursiveInstanceIterator::RecursiveInstanceIterator (const layout_type &layout,
RecursiveInstanceIterator::RecursiveInstanceIterator (const layout_type &layout, const cell_type &cell)
: m_box_convert (layout)
{
- mp_layout = &layout;
+ mp_layout = const_cast (&layout);
mp_top_cell = &cell;
m_overlapping = false;
init ();
@@ -272,6 +271,7 @@ RecursiveInstanceIterator::validate (RecursiveInstanceReceiver *receiver) const
m_inst_array_iterators.clear ();
m_cells.clear ();
m_trans = cplx_trans_type ();
+ m_target_tree.clear ();
m_local_region_stack.clear ();
m_local_region_stack.push_back (m_region);
@@ -300,10 +300,9 @@ RecursiveInstanceIterator::validate (RecursiveInstanceReceiver *receiver) const
}
- if (mp_top_cell) {
+ if (mp_top_cell && mp_layout) {
if (! m_all_targets) {
- m_target_tree.clear ();
mp_top_cell->collect_called_cells (m_target_tree);
}
@@ -501,6 +500,8 @@ RecursiveInstanceIterator::next_instance (RecursiveInstanceReceiver *receiver) c
void
RecursiveInstanceIterator::down (RecursiveInstanceReceiver *receiver) const
{
+ tl_assert (mp_layout);
+
m_trans_stack.push_back (m_trans);
m_cells.push_back (mp_cell);
diff --git a/src/db/db/dbRecursiveInstanceIterator.h b/src/db/db/dbRecursiveInstanceIterator.h
index 7f1f671b3..29fafcdda 100644
--- a/src/db/db/dbRecursiveInstanceIterator.h
+++ b/src/db/db/dbRecursiveInstanceIterator.h
@@ -29,6 +29,7 @@
#include "dbLayout.h"
#include "dbInstElement.h"
#include "tlAssert.h"
+#include "tlObject.h"
#include
@@ -603,10 +603,20 @@ delete shapes on layer 6 of cell TOP
|
The cell's bounding box. |
+
+ | dbbox |
+ |
+ The cell's bounding box in micrometer units. |
+
| cell_bbox |
|
- Same as "bbox" (disambiguator for shape and instance bounding boxes). |
+ Same as "bbox" (disambiguator from shape and instance bounding boxes). |
+
+
+ | cell_dbbox |
+ |
+ Same as "dbbox" (disambiguator from shape and instance bounding boxes). |
@@ -631,16 +641,32 @@ delete shapes on layer 6 of cell TOP
The transformation of that instance into the top cell.
For a plain cell that is a unit transformation. |
+
+ | path_dtrans |
+ |
+ The transformation of that instance into the top cell in micrometer units.
+ For a plain cell that is a unit transformation. |
+
| trans |
|
The transformation of that instance (first instance if an array). |
+
+ | dtrans |
+ |
+ The transformation of that instance (first instance if an array) in micrometer units. |
+
| inst_bbox |
|
The instance bounding box in the initial cell. |
+
+ | inst_dbbox |
+ |
+ The instance bounding box in the initial cell in micrometer units. |
+
| inst |
|
@@ -648,9 +674,14 @@ delete shapes on layer 6 of cell TOP
| array_a |
- |
+ |
The a vector for an array instance or nil if the instance is not an array. |
+
+ | array_da |
+ |
+ The a vector for an array instance in micrometer units or nil if the instance is not an array. |
+
| array_na |
Integer |
@@ -658,9 +689,14 @@ delete shapes on layer 6 of cell TOP
| array_b |
- |
+ |
The b vector for an array instance or nil if the instance is not an array. |
+
+ | array_db |
+ |
+ The b vector for an array instance in micrometer units or nil if the instance is not an array. |
+
| array_nb |
Integer |
@@ -689,14 +725,24 @@ delete shapes on layer 6 of cell TOP
| Name | Value type | Description |
| bbox |
- |
+ |
The shape's bounding box |
+
+ | dbbox |
+ |
+ The shape's bounding box in micrometer units |
+
| shape_bbox |
|
Same as "bbox" (disambiguator for cell or instance bounding boxes) |
+
+ | shape_dbbox |
+ |
+ Same as "dbbox" (disambiguator for cell or instance bounding boxes) |
+
| shape |
|
diff --git a/src/lay/lay/laySearchReplaceDialog.cc b/src/lay/lay/laySearchReplaceDialog.cc
index 701c9094e..f2f46bdb2 100644
--- a/src/lay/lay/laySearchReplaceDialog.cc
+++ b/src/lay/lay/laySearchReplaceDialog.cc
@@ -1699,6 +1699,55 @@ SearchReplaceDialog::result_selection_changed ()
}
+ } else if (index < int (m_model.data ().size ())) {
+
+ db::DCplxTrans as_dbu = db::DCplxTrans (layout.dbu ()).inverted ();
+
+ const tl::Variant &dr = m_model.data () [index];
+ for (tl::Variant::const_iterator v = dr.begin (); v != dr.end (); ++v) {
+
+ lay::Marker *marker = new lay::Marker (view (), cv_index);
+
+ if (v->is_user ()) {
+ marker->set (v->to_user (), as_dbu, global_trans);
+ } else if (v->is_user ()) {
+ marker->set (v->to_user (), db::ICplxTrans (), global_trans);
+ } else if (v->is_user ()) {
+ marker->set (v->to_user (), as_dbu, global_trans);
+ } else if (v->is_user ()) {
+ marker->set (v->to_user (), db::ICplxTrans (), global_trans);
+ } else if (v->is_user ()) {
+ marker->set (v->to_user (), as_dbu, global_trans);
+ } else if (v->is_user ()) {
+ marker->set (v->to_user (), db::ICplxTrans (), global_trans);
+ } else if (v->is_user ()) {
+ marker->set (v->to_user (), as_dbu, global_trans);
+ } else if (v->is_user ()) {
+ marker->set (v->to_user (), db::ICplxTrans (), global_trans);
+ } else if (v->is_user ()) {
+ db::DPoint p = v->to_user ();
+ marker->set (db::DBox (p, p), as_dbu, global_trans);
+ } else if (v->is_user ()) {
+ db::Point p = v->to_user ();
+ marker->set (db::Box (p, p), db::ICplxTrans (), global_trans);
+ } else if (v->is_user ()) {
+ db::DPoint p = db::DPoint () + v->to_user ();
+ marker->set (db::DBox (p, p), as_dbu, global_trans);
+ } else if (v->is_user ()) {
+ db::Point p = db::Point () + v->to_user ();
+ marker->set (db::Box (p, p), db::ICplxTrans (), global_trans);
+ } else {
+ delete marker;
+ marker = 0;
+ }
+
+ if (marker) {
+ mp_markers.push_back (marker);
+ dbox += marker->bbox ();
+ }
+
+ }
+
}
}
diff --git a/testdata/ruby/dbBoxTest.rb b/testdata/ruby/dbBoxTest.rb
index 92e56dab9..4f6c1de10 100644
--- a/testdata/ruby/dbBoxTest.rb
+++ b/testdata/ruby/dbBoxTest.rb
@@ -106,6 +106,13 @@ class DBBox_TestClass < TestBase
a = RBA::DBox.new
assert_equal( a.empty?, true )
+ a = RBA::DBox::world
+ b = RBA::DBox::new(1, 2, 3, 4)
+ assert_equal( a.empty?, false )
+ assert_equal( a == RBA::DBox::world, true )
+ assert_equal( (a + b) == RBA::DBox::world, true )
+ assert_equal( (a & b) == b, true )
+
end
# DBox basics
@@ -303,6 +310,13 @@ class DBBox_TestClass < TestBase
a = RBA::Box.new
assert_equal( a.empty?, true )
+ a = RBA::Box::world
+ b = RBA::Box::new(1, 2, 3, 4)
+ assert_equal( a.empty?, false )
+ assert_equal( a == RBA::Box::world, true )
+ assert_equal( (a + b) == RBA::Box::world, true )
+ assert_equal( (a & b) == b, true )
+
end
# Box basics
diff --git a/testdata/ruby/dbCellInstArrayTest.rb b/testdata/ruby/dbCellInstArrayTest.rb
index c57252a0d..c8beacd24 100644
--- a/testdata/ruby/dbCellInstArrayTest.rb
+++ b/testdata/ruby/dbCellInstArrayTest.rb
@@ -49,6 +49,11 @@ class DBCellInst_TestClass < TestBase
assert_equal(a.trans.to_s, "r90 0,0")
assert_equal(a.cplx_trans.to_s, "r90 *1 0,0")
+ a = RBA::CellInstArray::new(0, RBA::Vector::new(42, -17))
+ assert_equal(a.is_complex?, false)
+ assert_equal(a.trans.to_s, "r0 42,-17")
+ assert_equal(a.cplx_trans.to_s, "r0 *1 42,-17")
+
a = RBA::CellInstArray::new(0, RBA::ICplxTrans::new(1.5))
assert_equal(a.is_complex?, true)
assert_equal(a.trans.to_s, "r0 0,0")
@@ -106,6 +111,12 @@ class DBCellInst_TestClass < TestBase
assert_equal(a.cplx_trans.to_s, "r90 *1 0,0")
assert_equal(a.to_s, "#0 r90 0,0 [10,20*3;30,40*5]")
+ a = RBA::CellInstArray::new(0, RBA::Vector::new(42, -17), RBA::Vector::new(10, 20), RBA::Vector::new(30, 40), 3, 5)
+ assert_equal(a.is_complex?, false)
+ assert_equal(a.trans.to_s, "r0 42,-17")
+ assert_equal(a.cplx_trans.to_s, "r0 *1 42,-17")
+ assert_equal(a.to_s, "#0 r0 42,-17 [10,20*3;30,40*5]")
+
a = RBA::CellInstArray::new(0, RBA::ICplxTrans::new(1.5), RBA::Vector::new(10, 20), RBA::Vector::new(30, 40), 3, 5)
assert_equal(a.is_complex?, true)
assert_equal(a.trans.to_s, "r0 0,0")
@@ -178,6 +189,11 @@ class DBCellInst_TestClass < TestBase
assert_equal(a.trans.to_s, "r90 0,0")
assert_equal(a.cplx_trans.to_s, "r90 *1 0,0")
+ a = RBA::DCellInstArray::new(0, RBA::DVector::new(42, -17))
+ assert_equal(a.is_complex?, false)
+ assert_equal(a.trans.to_s, "r0 42,-17")
+ assert_equal(a.cplx_trans.to_s, "r0 *1 42,-17")
+
a = RBA::DCellInstArray::new(0, RBA::DCplxTrans::new(1.5))
assert_equal(a.is_complex?, true)
assert_equal(a.trans.to_s, "r0 0,0")
@@ -235,6 +251,12 @@ class DBCellInst_TestClass < TestBase
assert_equal(a.cplx_trans.to_s, "r90 *1 0,0")
assert_equal(a.to_s, "#0 r90 0,0 [10,20*3;30,40*5]")
+ a = RBA::DCellInstArray::new(0, RBA::DVector::new(42, -17), RBA::DVector::new(10, 20), RBA::DVector::new(30, 40), 3, 5)
+ assert_equal(a.is_complex?, false)
+ assert_equal(a.trans.to_s, "r0 42,-17")
+ assert_equal(a.cplx_trans.to_s, "r0 *1 42,-17")
+ assert_equal(a.to_s, "#0 r0 42,-17 [10,20*3;30,40*5]")
+
a = RBA::DCellInstArray::new(0, RBA::DCplxTrans::new(1.5), RBA::DVector::new(10, 20), RBA::DVector::new(30, 40), 3, 5)
assert_equal(a.is_complex?, true)
assert_equal(a.trans.to_s, "r0 0,0")
diff --git a/testdata/ruby/dbLayout.rb b/testdata/ruby/dbLayout.rb
index 968515c32..92ca43de9 100644
--- a/testdata/ruby/dbLayout.rb
+++ b/testdata/ruby/dbLayout.rb
@@ -1043,10 +1043,31 @@ class DBLayout_TestClass < TestBase
ci = l.clip(c0.cell_index, RBA::Box.new(0, 0, 200, 200))
assert_equal(dump_layer_i(l, 0, ci), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
+ cic = l.clip(c0, RBA::Box.new(0, 0, 200, 200))
+ assert_equal(dump_layer_i(l, 0, cic.cell_index), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
+
+ cid = l.clip(c0.cell_index, RBA::DBox.new(0, 0, 0.2, 0.2))
+ assert_equal(dump_layer_i(l, 0, cid), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
+
+ cicd = l.clip(c0, RBA::DBox.new(0, 0, 0.2, 0.2))
+ assert_equal(dump_layer_i(l, 0, cicd.cell_index), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
+
ci = l.multi_clip(c0.cell_index, [RBA::Box.new(0, 0, 200, 200),RBA::Box.new(1000, 0, 1300, 200)])
assert_equal(dump_layer_i(l, 0, ci[0]), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
assert_equal(dump_layer_i(l, 0, ci[1]), "(1000,0;1100,200); (1200,0;1300,200)")
+ cic = l.multi_clip(c0, [RBA::Box.new(0, 0, 200, 200),RBA::Box.new(1000, 0, 1300, 200)])
+ assert_equal(dump_layer_i(l, 0, cic[0].cell_index), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
+ assert_equal(dump_layer_i(l, 0, cic[1].cell_index), "(1000,0;1100,200); (1200,0;1300,200)")
+
+ cid = l.multi_clip(c0.cell_index, [RBA::DBox.new(0, 0, 0.2, 0.2),RBA::DBox.new(1.0, 0, 1.3, 0.2)])
+ assert_equal(dump_layer_i(l, 0, cid[0]), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
+ assert_equal(dump_layer_i(l, 0, cid[1]), "(1000,0;1100,200); (1200,0;1300,200)")
+
+ cidc = l.multi_clip(c0, [RBA::DBox.new(0, 0, 0.2, 0.2),RBA::DBox.new(1.0, 0, 1.3, 0.2)])
+ assert_equal(dump_layer_i(l, 0, cidc[0].cell_index), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
+ assert_equal(dump_layer_i(l, 0, cidc[1].cell_index), "(1000,0;1100,200); (1200,0;1300,200)")
+
ll = RBA::Layout.new
ll.dbu = l.dbu
ll.insert_layer_at(0, RBA::LayerInfo.new(2, 0))
@@ -1054,10 +1075,31 @@ class DBLayout_TestClass < TestBase
ci = l.clip_into(c0.cell_index, ll, RBA::Box.new(0, 0, 200, 200))
assert_equal(dump_layer_i(ll, 0, ci), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
+ cic = l.clip_into(c0, ll, RBA::Box.new(0, 0, 200, 200))
+ assert_equal(dump_layer_i(ll, 0, cic.cell_index), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
+
+ cid = l.clip_into(c0.cell_index, ll, RBA::DBox.new(0, 0, 0.2, 0.2))
+ assert_equal(dump_layer_i(ll, 0, cid), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
+
+ cicd = l.clip_into(c0, ll, RBA::DBox.new(0, 0, 0.2, 0.2))
+ assert_equal(dump_layer_i(ll, 0, cicd.cell_index), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
+
ci = l.multi_clip_into(c0.cell_index, ll, [RBA::Box.new(0, 0, 200, 200),RBA::Box.new(1000, 0, 1300, 200)])
assert_equal(dump_layer_i(ll, 0, ci[0]), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
assert_equal(dump_layer_i(ll, 0, ci[1]), "(1000,0;1100,200); (1200,0;1300,200)")
+ cic = l.multi_clip_into(c0, ll, [RBA::Box.new(0, 0, 200, 200),RBA::Box.new(1000, 0, 1300, 200)])
+ assert_equal(dump_layer_i(ll, 0, cic[0]), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
+ assert_equal(dump_layer_i(ll, 0, cic[1]), "(1000,0;1100,200); (1200,0;1300,200)")
+
+ cid = l.multi_clip_into(c0.cell_index, ll, [RBA::DBox.new(0, 0, 0.2, 0.2),RBA::DBox.new(1.0, 0, 1.3, 0.2)])
+ assert_equal(dump_layer_i(ll, 0, cid[0]), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
+ assert_equal(dump_layer_i(ll, 0, cid[1]), "(1000,0;1100,200); (1200,0;1300,200)")
+
+ cicd = l.multi_clip_into(c0, ll, [RBA::DBox.new(0, 0, 0.2, 0.2),RBA::DBox.new(1.0, 0, 1.3, 0.2)])
+ assert_equal(dump_layer_i(ll, 0, cicd[0]), "(0,100;200,200); (0,100;200,200); (100,0;200,200)")
+ assert_equal(dump_layer_i(ll, 0, cicd[1]), "(1000,0;1100,200); (1200,0;1300,200)")
+
end
def test_8
diff --git a/testdata/ruby/dbLayoutTest.rb b/testdata/ruby/dbLayoutTest.rb
index dd6fa5735..29a7f3dc2 100644
--- a/testdata/ruby/dbLayoutTest.rb
+++ b/testdata/ruby/dbLayoutTest.rb
@@ -23,10 +23,10 @@ end
load("test_prologue.rb")
-class DBLayout_TestClass < TestBase
+class DBLayoutTest_TestClass < TestBase
# LayerInfo
- def _test_1_Layout
+ def test_1_Layout
lp = RBA::LayerInfo::new
@@ -62,7 +62,7 @@ class DBLayout_TestClass < TestBase
end
# Basics: cells and instances
- def _test_2_Layout
+ def test_2_Layout
ly = RBA::Layout::new
@@ -182,7 +182,7 @@ class DBLayout_TestClass < TestBase
end
# Instances and bboxes
- def _test_5_Layout
+ def test_5_Layout
ly = RBA::Layout::new
@@ -223,10 +223,13 @@ class DBLayout_TestClass < TestBase
assert_equal( c1.bbox_per_layer( lindex ).to_s, "()" )
assert_equal( c1.bbox_per_layer( ldummy ).to_s, "()" )
+ assert_equal( ly.unique_cell_name("c3"), "c3" )
+ assert_equal( ly.unique_cell_name("c1"), "c1$1" )
+
end
# Instances and bboxes
- def _test_6_Layout
+ def test_6_Layout
ly = RBA::Layout::new
@@ -398,7 +401,7 @@ class DBLayout_TestClass < TestBase
end
# Instances and editable mode
- def _test_6_EditableLayout
+ def test_6_EditableLayout
ly = RBA::Layout::new( true )
assert_equal( ly.is_editable?, true )
@@ -470,7 +473,7 @@ class DBLayout_TestClass < TestBase
end
# Instances and bboxes
- def _test_6_Layout_props
+ def test_6_Layout_props
ly = RBA::Layout::new
pid = ly.properties_id( { 17 => "a", "b" => [ 1, 5, 7 ] }.to_a )
@@ -648,7 +651,7 @@ class DBLayout_TestClass < TestBase
end
# Properties
- def _test_6_Layout_props2
+ def test_6_Layout_props2
ly = RBA::Layout::new(true)
pid = ly.properties_id( { 17 => "a", "b" => [ 1, 5, 7 ] }.to_a )
@@ -697,7 +700,7 @@ class DBLayout_TestClass < TestBase
end
# Instances and bboxes (editable mode)
- def _test_6_Layout_new
+ def test_6_Layout_new
if( RBA::Application::instance.is_editable? )
@@ -805,7 +808,7 @@ class DBLayout_TestClass < TestBase
end
# Copy/move between cells
- def _test_7_cells_copy_move
+ def test_7_cells_copy_move
# because of set_property ...
if !RBA::Application::instance.is_editable?
@@ -879,7 +882,7 @@ class DBLayout_TestClass < TestBase
end
# top cells
- def _test_8
+ def test_8
l = RBA::Layout.new
tc = []
@@ -916,7 +919,7 @@ class DBLayout_TestClass < TestBase
end
# under construction and update
- def _test_9
+ def test_9
ly = RBA::Layout::new
l1 = ly.insert_layer(RBA::LayerInfo::new(1, 0))
@@ -946,7 +949,7 @@ class DBLayout_TestClass < TestBase
end
# Instance editing
- def _test_10
+ def test_10
ly = RBA::Layout::new
@@ -1025,7 +1028,7 @@ class DBLayout_TestClass < TestBase
end
# User properties
- def _test_11
+ def test_11
ly = RBA::Layout::new
@@ -1049,7 +1052,7 @@ class DBLayout_TestClass < TestBase
end
# Meta information
- def _test_12
+ def test_12
mi = RBA::LayoutMetaInfo::new("myinfo", "a")
diff --git a/testdata/ruby/dbPolygonTest.rb b/testdata/ruby/dbPolygonTest.rb
index ac2d7c037..3f30f0cf4 100644
--- a/testdata/ruby/dbPolygonTest.rb
+++ b/testdata/ruby/dbPolygonTest.rb
@@ -277,8 +277,19 @@ class DBPolygon_TestClass < TestBase
a = RBA::Polygon::new( [ RBA::Point::new( 0, 1 ), RBA::Point::new( 1, 5 ), RBA::Point::new( 5, 5 ) ] )
assert_equal( a.to_s, "(0,1;1,5;5,5)" )
assert_equal( a.sized(2, 0, 2).to_s, "(-2,1;-1,5;7,5;2,1)" )
+ assert_equal( a.sized(RBA::Vector::new(2, 0), 2).to_s, "(-2,1;-1,5;7,5;2,1)" )
+ assert_equal( a.sized(RBA::Vector::new(2, 0)).to_s, "(-2,1;-1,5;7,5;2,1)" )
+ aa = a.dup
a.size(2, 0, 2);
assert_equal( a.to_s, "(-2,1;-1,5;7,5;2,1)" )
+ a = aa
+ aa = a.dup
+ a.size(RBA::Vector::new(2, 0), 2);
+ assert_equal( a.to_s, "(-2,1;-1,5;7,5;2,1)" )
+ a = aa
+ aa = a.dup
+ a.size(RBA::Vector::new(2, 0));
+ assert_equal( a.to_s, "(-2,1;-1,5;7,5;2,1)" )
a = RBA::Polygon::new
assert_equal( a.to_s, "()" )
diff --git a/testdata/ruby/dbRecursiveInstanceIterator.rb b/testdata/ruby/dbRecursiveInstanceIterator.rb
index 9448d147d..4d9aefa2b 100644
--- a/testdata/ruby/dbRecursiveInstanceIterator.rb
+++ b/testdata/ruby/dbRecursiveInstanceIterator.rb
@@ -27,7 +27,16 @@ class DBLayout_TestClass < TestBase
def collect(s, l)
+ # check native iteration here too ..
+ res2 = []
+ s.each do |s|
+ r = "[#{s.inst_cell.name}]"
+ r += (s.trans * s.inst_trans).to_s
+ res2.push(r)
+ end
+
res = []
+ s.reset
while !s.at_end?
r = "[#{s.inst_cell.name}]"
r += (s.trans * s.inst_trans).to_s
@@ -35,6 +44,8 @@ class DBLayout_TestClass < TestBase
s.next
end
+ assert_equal(res, res2)
+
return res.join("/")
end
diff --git a/testdata/ruby/dbRecursiveShapeIterator.rb b/testdata/ruby/dbRecursiveShapeIterator.rb
index 2f46a306b..82d4b47b6 100644
--- a/testdata/ruby/dbRecursiveShapeIterator.rb
+++ b/testdata/ruby/dbRecursiveShapeIterator.rb
@@ -27,7 +27,21 @@ class DBRecursiveShapeIterator_TestClass < TestBase
def collect(s, l)
+ # check native iteration here too ..
+ res2 = []
+ s.each do |s|
+ r = "[#{l.cell_name(s.cell_index)}]"
+ if s.shape.is_box?
+ box = s.shape.box
+ r += box.transformed(s.trans).to_s
+ else
+ r += "X";
+ end
+ res2.push(r)
+ end
+
res = []
+ s.reset
while !s.at_end?
r = "[#{l.cell_name(s.cell_index)}]"
if s.shape.is_box?
@@ -40,6 +54,8 @@ class DBRecursiveShapeIterator_TestClass < TestBase
res.push(r)
end
+ assert_equal(res, res2)
+
return res.join("/")
end
diff --git a/testdata/ruby/dbRegionTest.rb b/testdata/ruby/dbRegionTest.rb
index 47b5808eb..be086fd1c 100644
--- a/testdata/ruby/dbRegionTest.rb
+++ b/testdata/ruby/dbRegionTest.rb
@@ -318,6 +318,16 @@ class DBRegion_TestClass < TestBase
rr.size(10, 20, 2)
assert_equal(rr.to_s, "(-20,-40;-20,180;0,180;0,220;110,220;110,0;90,0;90,-40)")
+ assert_equal((r1 | r2).sized(RBA::Vector::new(10, 20)).to_s, "(-20,-40;-20,180;0,180;0,220;110,220;110,0;90,0;90,-40)")
+ rr = (r1 | r2).dup
+ rr.size(10, 20, 2)
+ assert_equal(rr.to_s, "(-20,-40;-20,180;0,180;0,220;110,220;110,0;90,0;90,-40)")
+
+ assert_equal((r1 | r2).sized(RBA::Vector::new(10, 20), 2).to_s, "(-20,-40;-20,180;0,180;0,220;110,220;110,0;90,0;90,-40)")
+ rr = (r1 | r2).dup
+ rr.size(10, 20, 2)
+ assert_equal(rr.to_s, "(-20,-40;-20,180;0,180;0,220;110,220;110,0;90,0;90,-40)")
+
r1.merged_semantics = false
assert_equal((r1 | r2).sized(10, 2).to_s, "(-20,-30;-20,170;0,170;0,210;110,210;110,10;90,10;90,-30)")
diff --git a/testdata/ruby/dbTextTest.rb b/testdata/ruby/dbTextTest.rb
index 75eedbf76..fff844660 100644
--- a/testdata/ruby/dbTextTest.rb
+++ b/testdata/ruby/dbTextTest.rb
@@ -69,12 +69,34 @@ class DBText_TestClass < TestBase
a = RBA::DText::new( "hallo", a.trans, 22.0, 7 )
assert_equal( a.string, "hallo" )
assert_equal( a.trans.to_s, "m45 5,7" )
+ assert_equal( a.position.to_s, "5,7" )
+ assert_equal( a.bbox.to_s, "(5,7;5,7)" )
assert_equal( a.font, 7 )
assert_equal( a.size, 22.0 )
a.font = 8
assert_equal( a.font, 8 )
+ a.halign = 1
+ assert_equal( a.halign.to_i, 1 )
+ assert_equal( a.halign, RBA::DText::HAlignCenter )
+ assert_equal( a.halign.to_s, "HAlignCenter" )
+
+ a.halign = RBA::DText::HAlignRight
+ assert_equal( a.halign.to_i, 2 )
+ assert_equal( a.halign, RBA::DText::HAlignRight )
+ assert_equal( a.halign.to_s, "HAlignRight" )
+
+ a.valign = 1
+ assert_equal( a.valign.to_i, 1 )
+ assert_equal( a.valign, RBA::DText::VAlignCenter )
+ assert_equal( a.valign.to_s, "VAlignCenter" )
+
+ a.valign = RBA::DText::VAlignBottom
+ assert_equal( a.valign.to_i, 2 )
+ assert_equal( a.valign, RBA::DText::VAlignBottom )
+ assert_equal( a.valign.to_s, "VAlignBottom" )
+
a.size = 23.0
assert_equal( a.size, 23.0 )
@@ -141,12 +163,34 @@ class DBText_TestClass < TestBase
a = RBA::Text::new( "hallo", a.trans, 22, 7 )
assert_equal( a.string, "hallo" )
assert_equal( a.trans.to_s, "m45 5,7" )
+ assert_equal( a.position.to_s, "5,7" )
+ assert_equal( a.bbox.to_s, "(5,7;5,7)" )
assert_equal( a.font, 7 )
assert_equal( a.size, 22.0 )
a.font = 8
assert_equal( a.font, 8 )
+ a.halign = 1
+ assert_equal( a.halign.to_i, 1 )
+ assert_equal( a.halign, RBA::Text::HAlignCenter )
+ assert_equal( a.halign.to_s, "HAlignCenter" )
+
+ a.halign = RBA::Text::HAlignLeft
+ assert_equal( a.halign.to_i, 0 )
+ assert_equal( a.halign, RBA::Text::HAlignLeft )
+ assert_equal( a.halign.to_s, "HAlignLeft" )
+
+ a.valign = 1
+ assert_equal( a.valign.to_i, 1 )
+ assert_equal( a.valign, RBA::Text::VAlignCenter )
+ assert_equal( a.valign.to_s, "VAlignCenter" )
+
+ a.valign = RBA::Text::VAlignTop
+ assert_equal( a.valign.to_i, 0 )
+ assert_equal( a.valign, RBA::Text::VAlignTop )
+ assert_equal( a.valign.to_s, "VAlignTop" )
+
a.size = 23
assert_equal( a.size, 23 )
diff --git a/testdata/ruby/dbTransTest.rb b/testdata/ruby/dbTransTest.rb
index 7fca57d7a..df24c8716 100644
--- a/testdata/ruby/dbTransTest.rb
+++ b/testdata/ruby/dbTransTest.rb
@@ -80,6 +80,8 @@ class DBTrans_TestClass < TestBase
assert_equal( RBA::Trans::new(RBA::Trans::R180, RBA::DVector::new(5,-7)).to_s, "r180 5,-7" )
assert_equal( RBA::Trans::new(RBA::Trans::R180).to_s, "r180 0,0" )
+ assert_equal( e.trans( 2.0 ).to_s, "2" )
+ assert_equal( (e * 2.0).to_s, "2" )
assert_equal( e.trans( RBA::Edge::new(0, 1, 2, 3) ).to_s, "(-3,-2;-1,0)" )
assert_equal( ( e * RBA::Edge::new(0, 1, 2, 3) ).to_s, "(-3,-2;-1,0)" )
assert_equal( e.trans( RBA::Box::new(0, 1, 2, 3) ).to_s, "(-3,-2;-1,0)" )
@@ -140,7 +142,9 @@ class DBTrans_TestClass < TestBase
assert_equal( mb.trans( RBA::DPoint::new( 1, 0 )).to_s, "17,3" )
assert_equal( mb.ctrans(2).to_s, "4.0" )
+ assert_equal( (mb * 2).to_s, "4.0" )
assert_equal( i.ctrans(2).to_s, "1.0" )
+ assert_equal( (i * 2).to_s, "1.0" )
end
@@ -199,6 +203,7 @@ class DBTrans_TestClass < TestBase
assert_equal( (c.angle - 45).abs < 1e-10, true )
assert_equal( c.ctrans( 5 ).to_s, "3.75" )
+ assert_equal( (c * 5).to_s, "3.75" )
assert_equal( c.trans( RBA::DPoint::new( 12, 16 ) ).to_s, "17.3492424049,-14.6213203436" )
assert_equal( RBA::DCplxTrans::new.to_s, "r0 *1 0,0" )
@@ -306,7 +311,9 @@ class DBTrans_TestClass < TestBase
assert_equal( mb.trans( RBA::Point::new( 1, 0 )).to_s, "17,3" )
assert_equal( mb.ctrans(2).to_s, "4.0" )
+ assert_equal( (mb * 2).to_s, "4.0" )
assert_equal( i.ctrans(2).to_s, "1.0" )
+ assert_equal( (i * 2).to_s, "1.0" )
end
@@ -353,6 +360,7 @@ class DBTrans_TestClass < TestBase
assert_equal( (c.angle - 45).abs < 1e-10, true )
assert_equal( c.ctrans( 5 ).to_s, "3.75" )
+ assert_equal( (c * 5).to_s, "3.75" )
assert_equal( c.trans( RBA::Point::new( 12, 16 ) ).to_s, "17.3492424049,-14.6213203436" )
assert_equal( RBA::CplxTrans::new.to_s, "r0 *1 0,0" )