mirror of https://github.com/KLayout/klayout.git
WIP: more consistent handling of polygon splitting parameters.
This commit is contained in:
parent
12aaa2db20
commit
29264013b0
|
|
@ -163,7 +163,8 @@ SOURCES = \
|
|||
dbLayoutToNetlistWriter.cc \
|
||||
dbLayoutToNetlistFormatDefs.cc \
|
||||
dbDeviceAbstract.cc \
|
||||
dbLocalOperationUtils.cc
|
||||
dbLocalOperationUtils.cc \
|
||||
gsiDeclDbDeepShapeStore.cc
|
||||
|
||||
HEADERS = \
|
||||
dbArray.h \
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ DeepRegion::and_or_not_with (const DeepRegion *other, bool and_op) const
|
|||
|
||||
db::LocalProcessor proc (const_cast<db::Layout *> (&m_deep_layer.layout ()), const_cast<db::Cell *> (&m_deep_layer.initial_cell ()), &other->deep_layer ().layout (), &other->deep_layer ().initial_cell ());
|
||||
proc.set_threads (m_deep_layer.store ()->threads ());
|
||||
proc.set_area_ratio(m_deep_layer.store ()->max_area_ratio ());
|
||||
proc.set_area_ratio (m_deep_layer.store ()->max_area_ratio ());
|
||||
proc.set_max_vertex_count (m_deep_layer.store ()->max_vertex_count ());
|
||||
|
||||
proc.run (&op, m_deep_layer.layer (), other->deep_layer ().layer (), dl_out.layer ());
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ public:
|
|||
typedef polygon_layer_type::iterator polygon_iterator_type;
|
||||
|
||||
DeepRegion ();
|
||||
DeepRegion (const RecursiveShapeIterator &si, DeepShapeStore &dss, double area_ratio = 3.0, size_t max_vertex_count = 16);
|
||||
DeepRegion (const RecursiveShapeIterator &si, DeepShapeStore &dss, const db::ICplxTrans &trans, bool merged_semantics = true, double area_ratio = 3.0, size_t max_vertex_count = 16);
|
||||
DeepRegion (const RecursiveShapeIterator &si, DeepShapeStore &dss, double area_ratio = 0.0, size_t max_vertex_count = 0);
|
||||
DeepRegion (const RecursiveShapeIterator &si, DeepShapeStore &dss, const db::ICplxTrans &trans, bool merged_semantics = true, double area_ratio = 0.0, size_t max_vertex_count = 0);
|
||||
|
||||
DeepRegion (const DeepRegion &other);
|
||||
DeepRegion (const DeepLayer &dl);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,101 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2019 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#include "gsiDecl.h"
|
||||
#include "dbDeepShapeStore.h"
|
||||
|
||||
namespace gsi
|
||||
{
|
||||
|
||||
Class<db::DeepShapeStore> decl_dbDeepShapeStore ("db", "DeepShapeStore",
|
||||
gsi::method ("instance_count", &db::DeepShapeStore::instance_count,
|
||||
"@hide\n"
|
||||
) +
|
||||
gsi::method ("threads=", &db::DeepShapeStore::set_threads, gsi::arg ("n"),
|
||||
"@brief Sets the number of threads to allocate for the hierarchical processor\n"
|
||||
) +
|
||||
gsi::method ("threads", &db::DeepShapeStore::threads,
|
||||
"@brief Gets the number of threads.\n"
|
||||
) +
|
||||
gsi::method ("max_vertex_count=", &db::DeepShapeStore::set_max_vertex_count, gsi::arg ("count"),
|
||||
"@brief Sets the maximum vertex count default value\n"
|
||||
"\n"
|
||||
"This parameter is used to simplify complex polygons. It is used by\n"
|
||||
"create_polygon_layer with the default parameters. It's also used by\n"
|
||||
"boolean operations when they deliver their output.\n"
|
||||
) +
|
||||
gsi::method ("max_vertex_count", &db::DeepShapeStore::max_vertex_count,
|
||||
"@brief Gets the maximum vertex count.\n"
|
||||
) +
|
||||
gsi::method ("max_area_ratio=", &db::DeepShapeStore::set_max_area_ratio, gsi::arg ("ratio"),
|
||||
"@brief Sets the max. area ratio for bounding box vs. polygon area\n"
|
||||
"\n"
|
||||
"This parameter is used to simplify complex polygons. It is used by\n"
|
||||
"create_polygon_layer with the default parameters. It's also used by\n"
|
||||
"boolean operations when they deliver their output.\n"
|
||||
) +
|
||||
gsi::method ("max_area_ratio", &db::DeepShapeStore::max_area_ratio,
|
||||
"@brief Gets the max. area ratio.\n"
|
||||
) +
|
||||
gsi::method ("text_property_name=", &db::DeepShapeStore::set_text_property_name, gsi::arg ("name"),
|
||||
"@brief Sets the text property name.\n"
|
||||
"\n"
|
||||
"If set to a non-null variant, text strings are attached to the generated boxes\n"
|
||||
"as properties with this particular name. This option has an effect only if the\n"
|
||||
"text_enlargement property is not negative.\n"
|
||||
"By default, the name is empty.\n"
|
||||
) +
|
||||
gsi::method ("text_property_name", &db::DeepShapeStore::text_property_name,
|
||||
"@brief Gets the text property name.\n"
|
||||
) +
|
||||
gsi::method ("text_enlargement=", &db::DeepShapeStore::set_text_enlargement, gsi::arg ("value"),
|
||||
"@brief Sets the text enlargement value\n"
|
||||
"\n"
|
||||
"If set to a non-negative value, text objects are converted to boxes with the\n"
|
||||
"given enlargement (width = 2 * enlargement). The box centers are identical\n"
|
||||
"to the original location of the text.\n"
|
||||
"If this value is negative (the default), texts are ignored.\n"
|
||||
) +
|
||||
gsi::method ("text_enlargement", &db::DeepShapeStore::text_enlargement,
|
||||
"@brief Gets the text enlargement value.\n"
|
||||
),
|
||||
"@brief An opaque layout heap for the deep region processor\n"
|
||||
"\n"
|
||||
"This class is used for keeping intermediate, hierarchical data for the "
|
||||
"deep region processor. It is used in conjunction with the region "
|
||||
"constructor to create a deep (hierarchical) region."
|
||||
"\n"
|
||||
"@code\n"
|
||||
"layout = ... # a layout\n"
|
||||
"layer = ... # a layer\n"
|
||||
"cell = ... # a cell (initial cell for the deep region)\n"
|
||||
"dss = RBA::DeepShapeStore::new\n"
|
||||
"region = RBA::Region::new(cell.begin(layer), dss)\n"
|
||||
"@/code\n"
|
||||
"\n"
|
||||
"The DeepShapeStore object also supplies some configuration options "
|
||||
"for the operations acting on the deep regions. See for example \\threads=.\n"
|
||||
"\n"
|
||||
"This class has been introduced in version 0.26.\n"
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ Class<db::Connectivity> decl_dbConnectivity ("db", "Connectivity",
|
|||
gsi::method ("global_net_id", &db::Connectivity::global_net_id, gsi::arg ("global_net_name"),
|
||||
"@brief Gets the ID for a given global net name.\n"
|
||||
),
|
||||
"@brief This class specifies connections between different layers."
|
||||
"@brief This class specifies connections between different layers.\n"
|
||||
"Connections are build using \\connect. There are basically two flavours of connections: intra-layer and inter-layer.\n"
|
||||
"\n"
|
||||
"Intra-layer connections make nets begin propagated along different shapes on the same net. Without the "
|
||||
|
|
|
|||
|
|
@ -719,34 +719,6 @@ static Container *decompose_trapezoids (const db::Region *r, int mode)
|
|||
int td_simple ();
|
||||
int po_any ();
|
||||
|
||||
Class<db::DeepShapeStore> decl_DeepShapeStore ("db", "DeepShapeStore",
|
||||
method ("threads=", &db::DeepShapeStore::set_threads, gsi::arg ("threads"),
|
||||
"@brief Sets the number of threads for use for operations acting on this heap\n"
|
||||
) +
|
||||
method ("threads", &db::DeepShapeStore::threads,
|
||||
"@brief Gets the number of threads for use for operations acting on this heap\n"
|
||||
) +
|
||||
method ("instance_count", db::DeepShapeStore::instance_count, "@hide"),
|
||||
"@brief An opaque layout heap for the deep region processor\n"
|
||||
"\n"
|
||||
"This class is used for keeping intermediate, hierarchical data for the "
|
||||
"deep region processor. It is used in conjunction with the region "
|
||||
"constructor to create a deep (hierarchical) region."
|
||||
"\n"
|
||||
"@code\n"
|
||||
"layout = ... # a layout\n"
|
||||
"layer = ... # a layer\n"
|
||||
"cell = ... # a cell (initial cell for the deep region)\n"
|
||||
"dss = RBA::DeepShapeStore::new\n"
|
||||
"region = RBA::Region::new(cell.begin(layer), dss)\n"
|
||||
"@/code\n"
|
||||
"\n"
|
||||
"The DeepShapeStore object also supplies some configuration options "
|
||||
"for the operations acting on the deep regions. See for example \\threads=.\n"
|
||||
"\n"
|
||||
"This class has been introduced in version 0.26.\n"
|
||||
);
|
||||
|
||||
Class<db::Region> decl_Region ("db", "Region",
|
||||
constructor ("new", &new_v,
|
||||
"@brief Default constructor\n"
|
||||
|
|
@ -824,7 +796,7 @@ Class<db::Region> decl_Region ("db", "Region",
|
|||
"r = RBA::Region::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu))\n"
|
||||
"@/code\n"
|
||||
) +
|
||||
constructor ("new", &new_sid, gsi::arg ("shape_iterator"), gsi::arg ("deep_shape_store"), gsi::arg ("area_ratio", 3.0), gsi::arg ("max_vertex_count", size_t (16)),
|
||||
constructor ("new", &new_sid, gsi::arg ("shape_iterator"), gsi::arg ("deep_shape_store"), gsi::arg ("area_ratio", 0.0), gsi::arg ("max_vertex_count", size_t (0)),
|
||||
"@brief Constructor for a deep region from a hierarchical shape set\n"
|
||||
"\n"
|
||||
"This constructor creates a hierarchical region. Use a \\DeepShapeStore object to "
|
||||
|
|
|
|||
|
|
@ -226,6 +226,8 @@ static void run_test_bool_gen (tl::TestBase *_this, const char *file, TestMode m
|
|||
|
||||
db::LocalProcessor proc (&layout_org, &layout_org.cell (*layout_org.begin_top_down ()));
|
||||
proc.set_threads (nthreads);
|
||||
proc.set_area_ratio (3.0);
|
||||
proc.set_max_vertex_count (16);
|
||||
|
||||
if (! context_doc) {
|
||||
proc.run (lop, l1, l2, lout);
|
||||
|
|
@ -242,6 +244,8 @@ static void run_test_bool_gen (tl::TestBase *_this, const char *file, TestMode m
|
|||
|
||||
db::LocalProcessor proc (&layout_org, &layout_org.cell (*layout_org.begin_top_down ()), &layout_org2, &layout_org2.cell (*layout_org2.begin_top_down ()));
|
||||
proc.set_threads (nthreads);
|
||||
proc.set_area_ratio (3.0);
|
||||
proc.set_max_vertex_count (16);
|
||||
|
||||
if (! context_doc) {
|
||||
proc.run (lop, l1, l2, lout);
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue