[mapguide-commits] r1218 - in trunk/MgDev: Common/Stylization
Server/src/Services/Mapping Server/src/Services/Rendering
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Wed Mar 14 07:23:34 EDT 2007
Author: waltweltonlair
Date: 2007-03-14 07:23:33 -0400 (Wed, 14 Mar 2007)
New Revision: 1218
Modified:
trunk/MgDev/Common/Stylization/DWFRenderer.cpp
trunk/MgDev/Common/Stylization/DWFRenderer.h
trunk/MgDev/Common/Stylization/GDRenderer.cpp
trunk/MgDev/Common/Stylization/GDRenderer.h
trunk/MgDev/Common/Stylization/KmlRenderer.cpp
trunk/MgDev/Common/Stylization/KmlRenderer.h
trunk/MgDev/Common/Stylization/LabelRenderer.cpp
trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp
trunk/MgDev/Common/Stylization/Renderer.h
trunk/MgDev/Server/src/Services/Mapping/SEMgSymbolManager.cpp
trunk/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.h
Log:
Got rid of the UseLocalOverposting property on Renderer. It's not needed.
Modified: trunk/MgDev/Common/Stylization/DWFRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/DWFRenderer.cpp 2007-03-13 22:58:29 UTC (rev 1217)
+++ trunk/MgDev/Common/Stylization/DWFRenderer.cpp 2007-03-14 11:23:33 UTC (rev 1218)
@@ -1954,11 +1954,6 @@
return true;
}
-bool DWFRenderer::UseLocalOverposting()
-{
- return false; // not applicable
-}
-
void DWFRenderer::EnsureBufferSize(int len)
{
if (!m_wtPointBuffer)
Modified: trunk/MgDev/Common/Stylization/DWFRenderer.h
===================================================================
--- trunk/MgDev/Common/Stylization/DWFRenderer.h 2007-03-13 22:58:29 UTC (rev 1217)
+++ trunk/MgDev/Common/Stylization/DWFRenderer.h 2007-03-14 11:23:33 UTC (rev 1218)
@@ -111,7 +111,7 @@
const RS_String& text, RS_TextDef& tdef);
STYLIZATION_API virtual void ProcessLabelGroup( RS_LabelInfo* labels,
- int nalabels,
+ int nlabels,
const RS_String& text,
RS_OverpostType type,
bool exclude,
@@ -143,8 +143,6 @@
STYLIZATION_API virtual bool RequiresClipping();
- STYLIZATION_API virtual bool UseLocalOverposting();
-
STYLIZATION_API void StartLayout(RS_Bounds& extents);
STYLIZATION_API void EndLayout();
Modified: trunk/MgDev/Common/Stylization/GDRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/GDRenderer.cpp 2007-03-13 22:58:29 UTC (rev 1217)
+++ trunk/MgDev/Common/Stylization/GDRenderer.cpp 2007-03-14 11:23:33 UTC (rev 1218)
@@ -127,7 +127,6 @@
m_layerInfo(NULL),
m_fcInfo(NULL),
m_bRequiresClipping(requiresClipping),
-m_bLocalOverposting(localOverposting),
m_bIsSymbolW2D(false),
m_bHaveViewport(false),
m_imsym(NULL),
@@ -155,7 +154,7 @@
if (bgColor.alpha() != 255)
gdImageColorTransparent(img, bgc);
- if (!m_bLocalOverposting)
+ if (!localOverposting)
m_labeler = new LabelRenderer(this);
else
m_labeler = new LabelRendererLocal(this, tileExtentOffset);
@@ -1135,12 +1134,6 @@
}
-bool GDRenderer::UseLocalOverposting()
-{
- return m_bLocalOverposting;
-}
-
-
void GDRenderer::WritePolylines(LineBuffer* srclb, RS_LineStroke& stroke, bool aa)
{
//apply the stroke first
Modified: trunk/MgDev/Common/Stylization/GDRenderer.h
===================================================================
--- trunk/MgDev/Common/Stylization/GDRenderer.h 2007-03-13 22:58:29 UTC (rev 1217)
+++ trunk/MgDev/Common/Stylization/GDRenderer.h 2007-03-14 11:23:33 UTC (rev 1218)
@@ -133,8 +133,6 @@
STYLIZATION_API virtual bool RequiresClipping();
- STYLIZATION_API virtual bool UseLocalOverposting();
-
/////////////////////////////////////////////
// GDRenderer specific
//
@@ -223,7 +221,6 @@
int m_height;
double m_drawingScale;
bool m_bRequiresClipping;
- bool m_bLocalOverposting;
RS_SymbolManager* m_symbolManager;
Modified: trunk/MgDev/Common/Stylization/KmlRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/KmlRenderer.cpp 2007-03-13 22:58:29 UTC (rev 1217)
+++ trunk/MgDev/Common/Stylization/KmlRenderer.cpp 2007-03-14 11:23:33 UTC (rev 1218)
@@ -435,11 +435,6 @@
}
-bool KmlRenderer::UseLocalOverposting()
-{
- return false;
-}
-
//Inserts the contents of a given DWF input stream
//into the current output W2D. The given coord sys
//transformation is applied and geometry will be clipped
Modified: trunk/MgDev/Common/Stylization/KmlRenderer.h
===================================================================
--- trunk/MgDev/Common/Stylization/KmlRenderer.h 2007-03-13 22:58:29 UTC (rev 1217)
+++ trunk/MgDev/Common/Stylization/KmlRenderer.h 2007-03-14 11:23:33 UTC (rev 1218)
@@ -119,8 +119,6 @@
STYLIZATION_API virtual bool RequiresClipping();
- STYLIZATION_API virtual bool UseLocalOverposting();
-
private:
// Unimplemented Constructors/Methods
Modified: trunk/MgDev/Common/Stylization/LabelRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/LabelRenderer.cpp 2007-03-13 22:58:29 UTC (rev 1217)
+++ trunk/MgDev/Common/Stylization/LabelRenderer.cpp 2007-03-14 11:23:33 UTC (rev 1218)
@@ -77,6 +77,8 @@
{
BeginOverpostGroup(type, true, exclude);
+ RS_FontEngine* fe = m_serenderer->GetFontEngine();
+
// get the geometry type
_ASSERT(path != NULL);
int geomType = (path != NULL)? path->geom_type() : FdoGeometryType_None;
@@ -91,35 +93,9 @@
// indicate that the current group will be labeled along the path
m_labelGroups.back().m_algo = laCurve;
- // If we are in tiled mode, we cannot stitch features which span
- // more than one tile because labels will not be continuous across
- // tiles -- i.e. computed label positions will be different since
- // some features will not come in with the spatial query for some
- // far away tiles, even though they should for labeling purposes.
- // This does not affect stitching of multi-linestring features which
- // we can always stitch without worrying about parts of them not
- // coming in on some tiles.
+ // use the label string as the stitch key
RS_String stitch_key = text;
- if (false /*m_renderer->UseLocalOverposting()*/) //LabelRenderer is not used in tiled mode so this is not needed
- {
- // TODO: stitch in subregions of tile
-// const RS_Bounds& tileBounds = m_renderer->GetBounds();
-// const RS_Bounds& featBounds = path->bounds();
-// if (featBounds.minx < tileBounds.minx ||
-// featBounds.maxx > tileBounds.maxx ||
-// featBounds.miny < tileBounds.miny ||
-// featBounds.maxy > tileBounds.maxy)
- {
- // If we don't want to stitch separate line features, mangle
- // the stitch table key to make it unique across features, but
- // keep it the same when we stitch the parts of a linestring.
- wchar_t tmp[32];
- swprintf(tmp, 32, L"%d", m_labelGroups.size());
- stitch_key += tmp;
- }
- }
-
// If it's a multi-linestring, we will add each separate linestring
// piece for labeling. Some of these will get stitched together
// later, but if they are far away we will essentially label each
@@ -168,8 +144,6 @@
}
else
{
- RS_FontEngine* fe = m_serenderer->GetFontEngine();
-
// case of a simple label
for (int i=0; i<nlabels; i++)
{
@@ -195,12 +169,12 @@
int nlabels,
RS_OverpostType type,
bool exclude,
- LineBuffer* path)
+ LineBuffer* /*path*/)
{
BeginOverpostGroup(type, true, exclude);
//Add a new style SE label to the overpost groups.
- //here we are processing the simlpe case (like labels at a given points,
+ //Here we are processing the simple case (like labels at given points
//rather than labels along a line). The hard case is //TODO
m_labelGroups.back().m_algo = laSESymbol;
RS_FontEngine* fe = m_serenderer->GetFontEngine();
@@ -523,7 +497,7 @@
//-------------------------------------------------------
if (render)
- {
+ {
m_serenderer->DrawSymbol(info.m_sestyle->symbol, m, angle);
#ifdef DEBUG_LABELS
@@ -587,7 +561,7 @@
double param_position = ((double)i + 0.5) / (double)numreps;
//compute position and angle along the path for each character
- bool success = fe->LayoutPathText(tm, info.m_pts, info.m_numpts, seglens, param_position, info.m_tdef.valign(), 0);
+ fe->LayoutPathText(tm, info.m_pts, info.m_numpts, seglens, param_position, info.m_tdef.valign(), 0);
//once we have position and angle for each character
//compute oriented bounding box for each character
Modified: trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp 2007-03-13 22:58:29 UTC (rev 1217)
+++ trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp 2007-03-14 11:23:33 UTC (rev 1218)
@@ -87,7 +87,7 @@
// indicate that the current group will be labeled along the path
m_labelGroups.back().m_algo = laCurve;
- // If we are in tiled mode, we cannot stitch features which span
+ // Since we're in tiled mode, we cannot stitch features which span
// more than one tile because labels will not be continuous across
// tiles -- i.e. computed label positions will be different since
// some features will not come in with the spatial query for some
@@ -97,23 +97,20 @@
// coming in on some tiles.
RS_String stitch_key = text;
- if (true /*m_renderer->UseLocalOverposting()*/) //Local label renderer is only used for tiled mode
+ // TODO: stitch in subregions of tile
+// const RS_Bounds& tileBounds = m_renderer->GetBounds();
+// const RS_Bounds& featBounds = path->bounds();
+// if (featBounds.minx < tileBounds.minx ||
+// featBounds.maxx > tileBounds.maxx ||
+// featBounds.miny < tileBounds.miny ||
+// featBounds.maxy > tileBounds.maxy)
{
- // TODO: stitch in subregions of tile
-// const RS_Bounds& tileBounds = m_renderer->GetBounds();
-// const RS_Bounds& featBounds = path->bounds();
-// if (featBounds.minx < tileBounds.minx ||
-// featBounds.maxx > tileBounds.maxx ||
-// featBounds.miny < tileBounds.miny ||
-// featBounds.maxy > tileBounds.maxy)
- {
- // If we don't want to stitch separate line features, mangle
- // the stitch table key to make it unique across features, but
- // keep it the same when we stitch the parts of a linestring.
- wchar_t tmp[32];
- swprintf(tmp, 32, L"%d", m_labelGroups.size());
- stitch_key += tmp;
- }
+ // If we don't want to stitch separate line features, mangle
+ // the stitch table key to make it unique across features, but
+ // keep it the same when we stitch the parts of a linestring.
+ wchar_t tmp[32];
+ swprintf(tmp, 32, L"%d", m_labelGroups.size());
+ stitch_key += tmp;
}
// If it's a multi-linestring, we will add each separate linestring
@@ -309,6 +306,7 @@
bool exclude,
LineBuffer* path)
{
+ //TODO
}
@@ -747,8 +745,10 @@
//////////////////////////////////////////////////////////////////////////////
bool LabelRendererLocal::ComputeSimpleLabelBounds(LR_LabelInfoLocal& info)
{
+ RS_FontEngine* fe = m_serenderer->GetFontEngine();
+
//match the font and measure the sizes of the characters
- if (!m_serenderer->GetFontEngine()->GetTextMetrics(info.m_text, info.m_tdef, info.m_tm, false))
+ if (!fe->GetTextMetrics(info.m_text, info.m_tdef, info.m_tm, false))
return false;
//radian CCW rotation
@@ -886,7 +886,7 @@
double param_position = ((double)i + 0.5) / (double)numreps;
//compute position and angle along the path for each character
- bool ret = fe->LayoutPathText(copy_info.m_tm, info.m_pts, info.m_numpts, seglens, param_position, info.m_tdef.valign(), 0);
+ fe->LayoutPathText(copy_info.m_tm, info.m_pts, info.m_numpts, seglens, param_position, info.m_tdef.valign(), 0);
//once we have position and angle for each character
//compute oriented bounding box for each character
Modified: trunk/MgDev/Common/Stylization/Renderer.h
===================================================================
--- trunk/MgDev/Common/Stylization/Renderer.h 2007-03-13 22:58:29 UTC (rev 1217)
+++ trunk/MgDev/Common/Stylization/Renderer.h 2007-03-14 11:23:33 UTC (rev 1218)
@@ -36,114 +36,106 @@
class Renderer
{
public:
-
///<summary>
/// Initializes the Renderer with mapping context information
/// for generating a view of a map
///</summary>
- virtual void StartMap ( RS_MapUIInfo* mapInfo,
- RS_Bounds& extents,
- double mapScale,
- double dpi,
- double metersPerUnit,
- CSysTransformer* xformToLL
- ) = 0;
+ virtual void StartMap(RS_MapUIInfo* mapInfo,
+ RS_Bounds& extents,
+ double mapScale,
+ double dpi,
+ double metersPerUnit,
+ CSysTransformer* xformToLL) = 0;
///<summary>
/// Finalizes map generation. Typically the output for a map
/// generation (DWF, JPEG, ...) will be ready after calling this function.
///</summary>
- virtual void EndMap () = 0;
+ virtual void EndMap() = 0;
///<summary>
/// Indicates the renderer should process all subsequent geometry
/// in a new graphical layer.
///</summary>
- virtual void StartLayer (RS_LayerUIInfo* legendInfo,
- RS_FeatureClassInfo* classInfo
- ) = 0;
+ virtual void StartLayer(RS_LayerUIInfo* legendInfo,
+ RS_FeatureClassInfo* classInfo) = 0;
///<summary>
/// Indicates all features for a layer are processed. At this point
/// on overloading class can do post processing like creating
/// EPlot resources from a layer's W2D file
///</summary>
- virtual void EndLayer () = 0;
+ virtual void EndLayer() = 0;
///<summary>
/// Indicates the renderer should process all subsequent geometry
/// as part of a single logical feature.
///</summary>
- virtual void StartFeature (RS_FeatureReader* feature,
- const RS_String* tooltip = NULL,
- const RS_String* url = NULL,
- const RS_String* theme = NULL,
- double zOffset = 0,
- double zExtrusion = 0,
- RS_ElevationType zOffsetType = RS_ElevationType_RelativeToGround) = 0;
+ virtual void StartFeature(RS_FeatureReader* feature,
+ const RS_String* tooltip = NULL,
+ const RS_String* url = NULL,
+ const RS_String* theme = NULL,
+ double zOffset = 0,
+ double zExtrusion = 0,
+ RS_ElevationType zOffsetType = RS_ElevationType_RelativeToGround) = 0;
///<summary>
/// Done processing current feature.
///</summary>
//TODO: is it needed -- next call to StartFeature can just imply
//previous feature is done
- //virtual void EndFeature () = 0;
+ //virtual void EndFeature() = 0;
-
///<summary>
/// Polygon features. Transformation to W2D space is done here. Also handles
/// holes etc.
///</summary>
- virtual void ProcessPolygon (LineBuffer* lb,
- RS_FillStyle& fill
- ) = 0;
+ virtual void ProcessPolygon(LineBuffer* lb,
+ RS_FillStyle& fill) = 0;
///<summary>
/// Polyline features. Transformation to W2D space is done here.
///</summary>
- virtual void ProcessPolyline(LineBuffer* lb,
- RS_LineStroke& lsym
- ) = 0;
+ virtual void ProcessPolyline(LineBuffer* lb,
+ RS_LineStroke& lsym) = 0;
+
///<summary>
/// Raster serialization.
///</summary>
- virtual void ProcessRaster (unsigned char* data,
- int length,
- RS_ImageFormat format,
- int width,
- int height,
- RS_Bounds extents
- ) = 0;
+ virtual void ProcessRaster(unsigned char* data,
+ int length,
+ RS_ImageFormat format,
+ int width,
+ int height,
+ RS_Bounds extents) = 0;
+
///<summary>
/// Feature Marker Symbols -- added to feature W2D and should also
/// support selection
///</summary>
- virtual void ProcessMarker(LineBuffer* lb,
- RS_MarkerDef& mdef,
- bool allowOverpost,
- RS_Bounds* bounds = NULL
- ) = 0;
+ virtual void ProcessMarker(LineBuffer* lb,
+ RS_MarkerDef& mdef,
+ bool allowOverpost,
+ RS_Bounds* bounds = NULL) = 0;
- //TODO: DEPRECATED! Use PrcessLabelGroup() instead
+ //TODO: DEPRECATED! Use ProcessLabelGroup() instead
///<summary>
/// Text labels
///</summary>
virtual void ProcessLabel(double x,
double y,
const RS_String& text,
- RS_TextDef& tdef
- ) = 0;
+ RS_TextDef& tdef) = 0;
///<summary>
/// Text label group --
///</summary>
- virtual void ProcessLabelGroup( RS_LabelInfo* labels,
- int nlabels,
- const RS_String& text,
- RS_OverpostType type,
- bool exclude,
- LineBuffer* path
- ) = 0;
+ virtual void ProcessLabelGroup(RS_LabelInfo* labels,
+ int nlabels,
+ const RS_String& text,
+ RS_OverpostType type,
+ bool exclude,
+ LineBuffer* path) = 0;
///<summary>
///Inserts the contents of a given DWF input stream
@@ -155,8 +147,7 @@
CSysTransformer* xformer,
const RS_String& section,
const RS_String& passwd,
- const RS_String& w2dfilter
- ) = 0;
+ const RS_String& w2dfilter) = 0;
///<summary>
///Provides an instance of an RS_Symbol manager which will be used
@@ -189,13 +180,6 @@
//------------------------------------------------------
virtual bool RequiresClipping() = 0;
-
- //------------------------------------------------------
- // Local overposting label renderer option
- //------------------------------------------------------
-
- virtual bool UseLocalOverposting() = 0;
-
};
#endif
Modified: trunk/MgDev/Server/src/Services/Mapping/SEMgSymbolManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/SEMgSymbolManager.cpp 2007-03-13 22:58:29 UTC (rev 1217)
+++ trunk/MgDev/Server/src/Services/Mapping/SEMgSymbolManager.cpp 2007-03-14 11:23:33 UTC (rev 1218)
@@ -138,8 +138,8 @@
INT64 len = sdReader->GetLength();
if (len > 0 && len < 16*1024*1024) // draw the line at 16 MB
{
- ret = new unsigned char[len];
length = (int)len;
+ ret = new unsigned char[length];
sdReader->Read(ret, length);
m_mImageCache[uniqueName] = ret;
}
Modified: trunk/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.h
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.h 2007-03-13 22:58:29 UTC (rev 1217)
+++ trunk/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.h 2007-03-14 11:23:33 UTC (rev 1218)
@@ -144,12 +144,6 @@
return false;
}
- // not applicable
- virtual bool UseLocalOverposting()
- {
- return false;
- }
-
///////////////////////////////////
// SE_Renderer implementation
More information about the mapguide-commits
mailing list