Skip to content

Verify and document complex polygon rendering - #71

Open
pmeems wants to merge 3 commits into
polygon-triangulation-openglfrom
polygon-triangulation-verification
Open

pmeems wants to merge 3 commits into
polygon-triangulation-openglfrom
polygon-triangulation-verification

Conversation

@pmeems

@pmeems pmeems commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Phase 3 of the polygon triangulation plan: verify the complete rendering pipeline, measure triangulation cost and mesh storage, and bring the documentation in line with the implementation.

Depends on #66 (Core triangulation) and #68 (OpenGL mesh rendering); stacked on the #68 branch.

What changed

  • Lifecycle verification (Core): MapViewTest.ComplexSceneMeshesSurviveViewportChanges proves the triangulated fill meshes of a concave, holed multipart scene survive viewport resize, zoom in/out, anchored zoom, and pan without the scene being rebuilt or re-triangulated, and that layer add/remove rebuilds the scene with fresh meshes while keeping the original rings.
  • GDI fallback verification (ActiveX): VectorLayerRenderer.GdiFallbackRendersConcaveHoledPolygonFromRings proves a polygon without a fill mesh is rendered by GDI from its original rings — concave indentation and interior ring stay unfilled — and that the coordinator recovers to OpenGL for a later mesh-complete frame.
  • Performance baseline: RenderingBaseline.MeasuresComplexPolygonCosts (opt-in, same env vars as the existing baseline) generates 50k concave L-shapes, 50k holed two-component multipolygons, and 12.5k 32-vertex star polygons across three layers, and reports scene-preparation time, mesh vertex/index storage, memory growth, and GDI/OpenGL frame costs.
  • Documentation: docs/ARCHITECTURE.md, docs/PORTING.md, and docs/TESTING.md no longer claim OpenGL supports only convex single-ring polygons; the measured baseline numbers (including the ~15 µs per polygon triangulation cost that now dominates scene preparation) are recorded in docs/TESTING.md.

Measured (Release, x64, one workstation)

  • Complex mix: scene preparation 2,733.7 ms for 162,500 triangulated meshes; mesh storage 32.1 MiB; OpenGL median frame 42.2 ms; GDI median frame 168.6 ms.
  • Triangulation runs once per polygon during scene preparation and is reused on redraw; per-frame times are unaffected.

Validation

  • msbuild MapWinGIS6.slnx -restore -p:Configuration=Debug -p:Platform=x64 -m — clean (warnings are errors in this configuration).
  • MapWinGIS.Core.Tests.exe: 312 passed, 1 skipped (network).
  • MapWinGIS.ActiveX.Tests.exe: 67 passed, 3 skipped (interactive host + two opt-in baselines); both baselines pass in Release when opted in.

No memory changes were needed: the measured numbers live in docs/TESTING.md, and no new reusable pitfalls or tooling knowledge surfaced.

@pmeems
pmeems added this pull request to stack #69 November 13, 2026 13:46
@pmeems
pmeems requested a balanced review from Copilot November 13, 2026 13:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The tests can miss a permanent OpenGL fallback regression, and the rendering baseline uses invalid overlapping MultiPolygons, requiring fixture corrections and refreshed measurements.

2 open issues
What changed in this PR

This PR adds verification and performance documentation for the complex-polygon rendering pipeline introduced by Core triangulation in #66 and OpenGL mesh rendering in #68.

Changes:

  • Adds tests for mesh retention across viewport changes and ring-based GDI fallback.
  • Adds an opt-in complex-polygon benchmark covering scene preparation, mesh storage, memory growth, and backend frame costs.
  • Updates rendering documentation to describe mesh-based OpenGL support and record performance measurements.

Builds and tests were not run during this review.

File Description
tests/​MapWinGIS.Core.Tests/​MapViewTests.cpp Adds complex-scene mesh lifecycle coverage.
tests/​MapWinGIS.ActiveX.Tests/​VectorLayerRendererTests.cpp Adds concave and holed polygon fallback coverage.
tests/​MapWinGIS.ActiveX.Tests/​RenderingBaselineTests.cpp Adds complex geometry fixtures and performance measurements.
docs/​TESTING.md Documents benchmark workloads, usage, and recorded results.
docs/​PORTING.md Updates supported polygon rendering and fallback behavior.
docs/​ARCHITECTURE.md Describes retained meshes, backend responsibilities, and rendering costs.

Review effort: Balanced

@pmeems
pmeems force-pushed the polygon-triangulation-verification branch from 76da6b5 to 8eaea31 Compare November 13, 2026 14:54

Copy link
Copy Markdown

I reviewed the latest changes and did not find anything new to report.

@pmeems
pmeems force-pushed the polygon-triangulation-verification branch from 815c01d to 7f5e1fc Compare November 13, 2026 16:14
…e complex polygons

- add a MapView lifecycle test proving concave and holed fill meshes survive resize, zoom, and pan without re-triangulation and that map changes rebuild meshes
- add a coordinator fallback test proving GDI renders a mesh-less concave holed polygon from its original rings and recovers to OpenGL afterwards
- add an opt-in complex-geometry rendering baseline (concave L-shapes, holed multipart features, 32-vertex stars) reporting triangulation and mesh-storage costs
- update architecture, porting, and testing docs to drop the convex single-ring restriction and record the measured baseline numbers
- Move the holed-baseline satellite into the gap between bodies so the
  multipart components stay disjoint, and validate the complete
  multipart geometry while building the fixture
- Probe OpenGL availability independently in
  GdiFallbackRendersConcaveHoledPolygonFromRings and require the second
  coordinator draw to select OpenGL when the probe succeeds
- Refresh the recorded rendering baseline measurements in docs/TESTING.md
@pmeems
pmeems force-pushed the polygon-triangulation-verification branch from 7f5e1fc to ec5380b Compare November 13, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants