[mapguide-commits] r9183 - sandbox/jng/utfgrid/Common/Renderers
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon May 1 09:17:05 PDT 2017
Author: jng
Date: 2017-05-01 09:17:05 -0700 (Mon, 01 May 2017)
New Revision: 9183
Modified:
sandbox/jng/utfgrid/Common/Renderers/MapUTFGrid.h
sandbox/jng/utfgrid/Common/Renderers/UTFGridRenderer.cpp
sandbox/jng/utfgrid/Common/Renderers/UTFGridRenderer.h
Log:
Add UTFGridRenderer overview. Also fix up some compiler warnings.
Modified: sandbox/jng/utfgrid/Common/Renderers/MapUTFGrid.h
===================================================================
--- sandbox/jng/utfgrid/Common/Renderers/MapUTFGrid.h 2017-05-01 15:51:03 UTC (rev 9182)
+++ sandbox/jng/utfgrid/Common/Renderers/MapUTFGrid.h 2017-05-01 16:17:05 UTC (rev 9183)
@@ -213,7 +213,7 @@
void blend_hline(int x, int y,
unsigned len,
const color_type& c,
- agg::int8u cover)
+ agg::int8u /*cover*/)
{
value_type* p = (value_type*)
m_rbuf->row_ptr(x, y, len) + x * Step + Offset;
@@ -230,7 +230,7 @@
void blend_vline(int x, int y,
unsigned len,
const color_type& c,
- agg::int8u cover)
+ agg::int8u /*cover*/)
{
do
{
Modified: sandbox/jng/utfgrid/Common/Renderers/UTFGridRenderer.cpp
===================================================================
--- sandbox/jng/utfgrid/Common/Renderers/UTFGridRenderer.cpp 2017-05-01 15:51:03 UTC (rev 9182)
+++ sandbox/jng/utfgrid/Common/Renderers/UTFGridRenderer.cpp 2017-05-01 16:17:05 UTC (rev 9183)
@@ -4,13 +4,55 @@
#include "SymbolTrans.h"
#include "agg_utfgrid_context.h"
+// =========================== UTFGridRenderer overview =============================== //
+//
+// At a high-level, you can think of UTFGridRenderer as a hybrid of the AGGRenderer and KmlRenderer
+//
+// * Like AGGRenderer, it writes to an AGG backend using mostly the same marker/polyline/polygon rendering
+// logic in the AGGRenderer
+// * Unlike the AGGRenderer, we don't have to concern ourselves with:
+// * Labeling and exclusion region management
+// * Rendering of rasters, symbols and text
+// * Style settings (basic or advanced) when rendering points/lines/polygons
+// * Font Management
+// * Size. Our back buffer is fixed at 256x256
+// * We don't render to an agg_context, we instead render to an agg_utfgrid_context, which does not have:
+// * Polyclip mask rendering
+// * Alpha masking
+// * Font engine state caching/tracking
+// * The underlying primitives is agg::int32u instead of agg:int8u
+// * Pixel format is re-used from mapserver (see MapUTFGrid.h)
+// * For the most part, we solely focus on the actual LineBuffer geometries given to us by the Stylizer
+// and rendering that directly to the agg_utfgrid_context
+// * Like KmlRenderer, the renderered "pixels" are encoded into a UTFGrid tile, that is the responsibility
+// of the UTFGridContent class (just like KmlContent is for KmlRenderer). Initial rendering of the
+// "pixels" is handled by UTFGridRenderer. Encoding is handed off to UTFGridContent.
+//
+// =================================================================================== //
+
+// ======================== Rendering Process ======================================== //
+//
+// StartMap
+// StartLayer
+// StartFeature
+// - Allocate a "color" (an incrementing unsigned int)
+// - Encode current feature attributes to UTFGridContent and associate it with the color
+// Service ProcessXXX calls from the Stylizer
+// - Render each geometry into the agg_utfgrid_context
+// EndLayer
+// EndMap
+// - Transfer back buffer to UTFGridContent for encoding
+// - UTFGridContent will use the color of each pixel to marry up with the encoded feature attributes when assembling the UTFGrid tile
+//
+// =================================================================================== //
+
UTFGridRenderer::UTFGridRenderer(UTFGridContent* utfGrid)
: m_currentColor(0),
m_content(utfGrid)
{
// allocate back buffer
int len = UTF_GRID_WIDTH * UTF_GRID_HEIGHT;
- m_rows = new unsigned int[len];
+ m_rows = new utfgrid_band_type[len];
// get the agg context going
m_context = new agg_utfgrid_context(m_rows, UTF_GRID_WIDTH, UTF_GRID_HEIGHT);
Modified: sandbox/jng/utfgrid/Common/Renderers/UTFGridRenderer.h
===================================================================
--- sandbox/jng/utfgrid/Common/Renderers/UTFGridRenderer.h 2017-05-01 15:51:03 UTC (rev 9182)
+++ sandbox/jng/utfgrid/Common/Renderers/UTFGridRenderer.h 2017-05-01 16:17:05 UTC (rev 9183)
@@ -100,7 +100,7 @@
agg_utfgrid_context* m_context;
//screen buffer
- unsigned int* m_rows;
+ utfgrid_band_type* m_rows;
//Not used, just passed around to satisfy required func signatures
SE_LineStroke m_lineStroke;
More information about the mapguide-commits
mailing list