MCPcopy Create free account
hub / github.com/KLayout/klayout / create_polygon_layer

Method create_polygon_layer

src/db/db/dbDeepShapeStore.cc:1028–1069  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1026}
1027
1028DeepLayer DeepShapeStore::create_polygon_layer (const db::RecursiveShapeIterator &si, double max_area_ratio, size_t max_vertex_count, const db::ICplxTrans &trans)
1029{
1030 if (max_area_ratio == 0.0) {
1031 max_area_ratio = m_state.max_area_ratio ();
1032 }
1033 if (max_vertex_count == 0) {
1034 max_vertex_count = m_state.max_vertex_count ();
1035 }
1036
1037 unsigned int layout_index = layout_for_iter (si, trans);
1038
1039 db::Layout &layout = m_layouts[layout_index]->layout;
1040 db::HierarchyBuilder &builder = m_layouts[layout_index]->builder;
1041
1042 builder.set_wants_all_cells (m_wants_all_cells);
1043 builder.set_sparse_array_limit (m_sparse_array_limit);
1044
1045 unsigned int layer_index = init_layer (layout, si);
1046 builder.set_target_layer (layer_index);
1047
1048 // The chain of operators for producing clipped and reduced polygon references
1049 db::PolygonReferenceHierarchyBuilderShapeReceiver refs (&layout, text_enlargement (), text_property_name ());
1050 db::ReducingHierarchyBuilderShapeReceiver red (&refs, max_area_ratio, max_vertex_count, m_state.reject_odd_polygons ());
1051 db::ClippingHierarchyBuilderShapeReceiver clip (&red);
1052
1053 // Build the working hierarchy from the recursive shape iterator
1054 try {
1055
1056 tl::SelfTimer timer (tl::verbosity () >= 41, tl::to_string (tr ("Building working hierarchy")));
1057 db::LayoutLocker ll (&layout, true /*no update*/);
1058
1059 builder.set_shape_receiver (&clip);
1060 db::RecursiveShapeIterator (si).push (& builder);
1061 builder.set_shape_receiver (0);
1062
1063 } catch (...) {
1064 builder.set_shape_receiver (0);
1065 throw;
1066 }
1067
1068 return DeepLayer (this, layout_index, layer_index);
1069}
1070
1071DeepLayer DeepShapeStore::create_custom_layer (const db::RecursiveShapeIterator &si, HierarchyBuilderShapeReceiver *pipe, const db::ICplxTrans &trans)
1072{

Callers 3

DeepRegionMethod · 0.80
LayoutToNetlistMethod · 0.80

Calls 13

init_layerFunction · 0.85
verbosityFunction · 0.85
DeepLayerClass · 0.85
reject_odd_polygonsMethod · 0.80
set_shape_receiverMethod · 0.80
to_stringFunction · 0.70
trFunction · 0.50
max_area_ratioMethod · 0.45
max_vertex_countMethod · 0.45
set_wants_all_cellsMethod · 0.45

Tested by

no test coverage detected