| 1026 | } |
| 1027 | |
| 1028 | DeepLayer 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 | |
| 1071 | DeepLayer DeepShapeStore::create_custom_layer (const db::RecursiveShapeIterator &si, HierarchyBuilderShapeReceiver *pipe, const db::ICplxTrans &trans) |
| 1072 | { |
no test coverage detected