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

Method polygon

src/db/db/dbShape.cc:395–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395bool Shape::polygon (Shape::polygon_type &p) const
396{
397 if (m_type == Polygon) {
398 p = polygon ();
399 return true;
400 } else if (m_type == PolygonRef || m_type == PolygonPtrArrayMember) {
401 polygon_ref ().instantiate (p);
402 return true;
403 } else if (m_type == SimplePolygon) {
404 p.clear ();
405 const simple_polygon_type &sp = simple_polygon ();
406 p.assign_hull (sp.hull ());
407 return true;
408 } else if (m_type == SimplePolygonRef || m_type == SimplePolygonPtrArrayMember) {
409 p.clear ();
410 const simple_polygon_ref_type &sp = simple_polygon_ref ();
411 p.assign_hull (sp.obj ().begin_hull (), sp.obj ().end_hull (), sp.trans (), false /*no additional compression*/);
412 return true;
413 } else if (m_type == Path) {
414 p = path ().polygon ();
415 return true;
416 } else if (m_type == PathRef || m_type == PathPtrArrayMember) {
417 p = path_ref ().obj ().polygon ();
418 p.transform (path_ref ().trans (), false /*no additional compression*/);
419 return true;
420 } else if (is_box ()) {
421 p = Shape::polygon_type (box ());
422 return true;
423 } else {
424 return false;
425 }
426}
427
428bool Shape::simple_polygon (Shape::simple_polygon_type &p) const
429{

Callers

nothing calls this directly

Calls 14

polygon_refClass · 0.85
path_refClass · 0.85
polygonFunction · 0.70
simple_polygonFunction · 0.70
pathFunction · 0.70
is_boxFunction · 0.70
boxFunction · 0.70
instantiateMethod · 0.45
clearMethod · 0.45
begin_hullMethod · 0.45
objMethod · 0.45
end_hullMethod · 0.45

Tested by

no test coverage detected