diff --git a/src/db/dbShape.cc b/src/db/dbShape.cc
index cc576e5bc..07116486d 100644
--- a/src/db/dbShape.cc
+++ b/src/db/dbShape.cc
@@ -566,6 +566,58 @@ Shape::perimeter_type Shape::perimeter () const
}
}
+size_t Shape::array_size () const
+{
+ switch (m_type) {
+ case Null:
+ return 0;
+ case Polygon:
+ case PolygonRef:
+ case PolygonPtrArrayMember:
+ return 1;
+ case PolygonPtrArray:
+ {
+ const polygon_ptr_array_type *arr = basic_ptr (polygon_ptr_array_type::tag ());
+ return arr->size ();
+ }
+ case SimplePolygon:
+ case SimplePolygonRef:
+ case SimplePolygonPtrArrayMember:
+ return 1;
+ case SimplePolygonPtrArray:
+ {
+ const simple_polygon_ptr_array_type *arr = basic_ptr (simple_polygon_ptr_array_type::tag ());
+ return arr->size ();
+ }
+ case Path:
+ case PathRef:
+ case PathPtrArrayMember:
+ return 1;
+ case PathPtrArray:
+ {
+ const path_ptr_array_type *arr = basic_ptr (path_ptr_array_type::tag ());
+ return arr->size ();
+ }
+ case BoxArray:
+ {
+ const box_array_type *arr = basic_ptr (box_array_type::tag ());
+ return arr->size ();
+ }
+ case ShortBoxArray:
+ {
+ const short_box_array_type *arr = basic_ptr (short_box_array_type::tag ());
+ return arr->size ();
+ }
+ case Box:
+ case ShortBox:
+ case BoxArrayMember:
+ case ShortBoxArrayMember:
+ return 1;
+ default:
+ return 1;
+ }
+}
+
Shape::area_type Shape::area () const
{
switch (m_type) {
diff --git a/src/db/dbShape.h b/src/db/dbShape.h
index ff3a324eb..0593f0dfa 100644
--- a/src/db/dbShape.h
+++ b/src/db/dbShape.h
@@ -2419,6 +2419,11 @@ public:
m_type == TextPtrArrayMember;
}
+ /**
+ * @brief Returns the array size if the shape references an array
+ */
+ size_t array_size () const;
+
/**
* @brief Array instance member transformation
*
diff --git a/src/lay/layLayoutStatisticsForm.cc b/src/lay/layLayoutStatisticsForm.cc
index a95e0da92..21cce432e 100644
--- a/src/lay/layLayoutStatisticsForm.cc
+++ b/src/lay/layLayoutStatisticsForm.cc
@@ -28,6 +28,7 @@
#include "tlExpression.h"
#include "tlTimer.h"
#include "dbLayoutQuery.h"
+#include "dbCellGraphUtils.h"
#include " << std::endl
+ << "" << tl::to_string (QObject::tr ("Detailed Layer Statistics for '")) << m_h->name () << "'
" << std::endl
+
+ << "" << std::endl
+
+ << "
" << std::endl
+ << "" << std::endl
+ << " " << std::endl
+
+ << "" << tl::to_string (QObject::tr ("Layer")) << " " << std::endl
+ << "" << tl::to_string (QObject::tr ("Boxes")) << " " << std::endl
+ << "" << tl::to_string (QObject::tr ("Polygons")) << " " << std::endl
+ << "" << tl::to_string (QObject::tr ("Paths")) << " " << std::endl
+ << "" << tl::to_string (QObject::tr ("Texts")) << " " << std::endl
+ << "" << tl::to_string (QObject::tr ("Edges")) << " " << std::endl
+ << "" << tl::to_string (QObject::tr ("User objects")) << " " << std::endl
+ << "" << std::endl
+ << " " << std::endl
+ ;
+
+ db::CellCounter cc (&layout);
+
+ tl::RelativeProgress progress (tl::to_string (QObject::tr ("Collecting statistics")), layers.size () * layout.cells (), 100000);
+ for (std::vector " << std::endl
+ << " " << tl::to_string (QObject::tr ("(total)")) << " " << tl::to_string (QObject::tr ("(single)")) << " " << tl::to_string (QObject::tr ("(arrays)")) << " " << std::endl
+ << "" << tl::to_string (QObject::tr ("(total)")) << " " << tl::to_string (QObject::tr ("(single)")) << " " << tl::to_string (QObject::tr ("(arrays)")) << " " << std::endl
+ << "" << tl::to_string (QObject::tr ("(total)")) << " " << tl::to_string (QObject::tr ("(single)")) << " " << tl::to_string (QObject::tr ("(arrays)")) << " " << std::endl
+ << "" << tl::to_string (QObject::tr ("(total)")) << " " << tl::to_string (QObject::tr ("(single)")) << " " << tl::to_string (QObject::tr ("(arrays)")) << " " << std::endl
+ << "" << tl::to_string (QObject::tr ("(total)")) << " " << std::endl
+ << "" << tl::to_string (QObject::tr ("(total)")) << " " << std::endl
+ << "" << std::endl
+ << " " << std::endl
+ ;
+
+ }
+
+ os << "" << layout.get_properties (*l).to_string () << " " << std::endl
+ // Boxes (total, single, array)
+ << "" << st_hier.box_total () << " " << std::endl
+ << "
" << st_flat.box_total () << "" << st_hier.box_single () << " " << std::endl
+ << "
" << st_flat.box_single () << "" << st_hier.box_array () << " " << std::endl
+ // Polygons (total, single, array)
+ << "
" << st_flat.box_array () << "" << st_hier.polygon_total () << " " << std::endl
+ << "
" << st_flat.polygon_total () << "" << st_hier.polygon_single () << " " << std::endl
+ << "
" << st_flat.polygon_single () << "" << st_hier.polygon_array () << " " << std::endl
+ // Paths (total, single, array)
+ << "
" << st_flat.polygon_array () << "" << st_hier.path_total () << " " << std::endl
+ << "
" << st_flat.path_total () << "" << st_hier.path_single () << " " << std::endl
+ << "
" << st_flat.path_single () << "" << st_hier.path_array () << " " << std::endl
+ // Texts (total, single, array)
+ << "
" << st_flat.path_array () << "" << st_hier.text_total () << " " << std::endl
+ << "
" << st_flat.text_total () << "" << st_hier.text_single () << " " << std::endl
+ << "
" << st_flat.text_single () << "" << st_hier.text_array () << " " << std::endl
+ // Edges (total)
+ << "
" << st_flat.text_array () << "" << st_hier.edge_total () << " " << std::endl
+ // User objects (total)
+ << "
" << st_flat.edge_total () << "" << st_hier.user_total () << " " << std::endl
+ // ...
+ << "
" << st_flat.user_total () << "" << tl::to_string (QObject::tr ("(hier)")) << " " << std::endl
+ << "
" << tl::to_string (QObject::tr ("(flat)")) << "
" + "\"(hier)\" is the object count where each cell counts once. " + "\"(flat)\" is the \"as if flat\" count where the cells count as many times as they are seen from the top cells." + "
" + "" + "\"(total)\" is the effective number of shapes. \"(single)\" are the single shapes. " + "\"(arrays)\" is the number of shape arrays where each array counts as one, but contributes many individual shapes to \"(total)\"." + "
" + )) + << "" << std::endl + << ""; + + return os.str (); + } else { // This is the default top level page @@ -428,6 +673,7 @@ StatisticsSource::get (const std::string &url) os << "" << std::endl << "" << std::endl << "" << std::endl << "
| " << tl::to_string (QObject::tr ("Path")) << ": | " << m_h->filename () << " | " @@ -454,49 +700,61 @@ StatisticsSource::get (const std::string &url) os << "
| " << layout.cell_name (*tc) << " |
| " << tl::to_string (QObject::tr ("Layer/Datatype")) << " | "; - if (! layers_with_oasis_names.empty ()) { - os << "" << tl::to_string (QObject::tr ("OASIS layer name")) << " | "; - } - os << "
| " << tl::sprintf ("%d/%d", lp.layer, lp.datatype) << " | "; - if (! layers_with_oasis_names.empty ()) { - os << "" << lp.name << " | "; - } - os << "
" << std::endl << "
| " << tl::to_string (QObject::tr ("OASIS layer name")) << " | " << tl::to_string (QObject::tr ("Layer/Datatype")) << " |
| " << tl::to_string (QObject::tr ("Layer/Datatype")) << " | "; + if (! layers_with_oasis_names.empty ()) { + os << "" << tl::to_string (QObject::tr ("Layer name")) << " | "; + } + os << "
| " << tl::sprintf ("%d/%d", lp.layer, lp.datatype) << " | "; + if (! layers_with_oasis_names.empty ()) { + os << "" << lp.name << " | "; + } + os << "
" << std::endl + << "
| " << tl::to_string (QObject::tr ("Layer name")) << " | " << tl::to_string (QObject::tr ("Layer/Datatype")) << " |