[mapguide-commits] r8232 - in branches/2.6/MgDev: . Server/src/Services/Rendering
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon Jun 16 19:58:28 PDT 2014
Author: jng
Date: 2014-06-16 19:58:27 -0700 (Mon, 16 Jun 2014)
New Revision: 8232
Modified:
branches/2.6/MgDev/
branches/2.6/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.cpp
branches/2.6/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.h
branches/2.6/MgDev/Server/src/Services/Rendering/FeaturePropRenderer.cpp
branches/2.6/MgDev/Server/src/Services/Rendering/FeaturePropRenderer.h
branches/2.6/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
Log:
Merged revision(s) 8230 from trunk/MgDev:
#2458: Fix FeaturePropRenderer not transforming bounding box data. Before layer stylization, pass in the current layer to map transform so the FeaturePropRenderer can perform the necessary transformations on any bounding boxes it encounters.
........
Property changes on: branches/2.6/MgDev
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/2.4/MgDev:6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006
/sandbox/jng/createruntimemap:7486-7555
/sandbox/rfc94:5099-5163
/trunk/MgDev:8210
+ /branches/2.4/MgDev:6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006
/sandbox/jng/createruntimemap:7486-7555
/sandbox/rfc94:5099-5163
/trunk/MgDev:8210,8230
Modified: branches/2.6/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.cpp
===================================================================
--- branches/2.6/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.cpp 2014-06-17 02:54:48 UTC (rev 8231)
+++ branches/2.6/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.cpp 2014-06-17 02:58:27 UTC (rev 8232)
@@ -37,7 +37,8 @@
m_layerInfo(NULL),
m_fcInfo(NULL),
m_pointTest(false),
- m_impRenderer(impRenderer)
+ m_impRenderer(impRenderer),
+ m_currentTransform(NULL)
{
m_selection = SAFE_ADDREF(selection);
m_keyEncode = new KeyEncode();
@@ -56,7 +57,7 @@
{
SAFE_RELEASE(m_props);
SAFE_RELEASE(m_selection);
-
+ m_currentTransform = NULL;
delete m_keyEncode;
}
@@ -184,6 +185,8 @@
void FeatureInfoRenderer::StartLayer(RS_LayerUIInfo* layerInfo,
RS_FeatureClassInfo* classInfo)
{
+ m_currentTransform = NULL;
+
// remember the layer/feature info
m_layerInfo = layerInfo;
m_fcInfo = classInfo;
Modified: branches/2.6/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.h
===================================================================
--- branches/2.6/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.h 2014-06-17 02:54:48 UTC (rev 8231)
+++ branches/2.6/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.h 2014-06-17 02:58:27 UTC (rev 8232)
@@ -237,6 +237,11 @@
void SetSelected();
+ void SetLayerToMapTransform(CSysTransformer* tx)
+ {
+ m_currentTransform = tx;
+ }
+
protected:
//common to FeaturePropRenderer and FeatureInfoRenderer
RS_String m_layerId;
@@ -260,6 +265,7 @@
double m_dpi;
double m_scale;
+ CSysTransformer* m_currentTransform; //From stack-allocated TransformCacheMap. DO NOT FREE
private:
//specific to FeatureInfoRenderer
RS_String m_url;
Modified: branches/2.6/MgDev/Server/src/Services/Rendering/FeaturePropRenderer.cpp
===================================================================
--- branches/2.6/MgDev/Server/src/Services/Rendering/FeaturePropRenderer.cpp 2014-06-17 02:54:48 UTC (rev 8231)
+++ branches/2.6/MgDev/Server/src/Services/Rendering/FeaturePropRenderer.cpp 2014-06-17 02:58:27 UTC (rev 8232)
@@ -128,52 +128,75 @@
return false;
}
-void FeaturePropRenderer::ProcessPolygon(LineBuffer* lb,
- RS_FillStyle& fill)
+void FeaturePropRenderer::GetGeometryBounds(const LineBuffer* lb, RS_Bounds& bounds)
{
- if (!m_bIncludeFeatureBBOX)
- return;
-
const RS_Bounds& featBounds = lb->bounds();
- Ptr<MgStringProperty> bbox = dynamic_cast<MgStringProperty*>(m_currentFeature->GetItem(SPECIAL_PROP_BOUNDING_BOX));
+
+ bounds.minx = featBounds.minx;
+ bounds.miny = featBounds.miny;
+ bounds.maxx = featBounds.maxx;
+ bounds.maxy = featBounds.maxy;
+
+ //printf("Current bounds: [%f, %f, %f, %f]\n", bounds.minx, bounds.miny, bounds.maxx, bounds.maxy);
+
+ if (m_currentTransform)
+ {
+ double minx = bounds.minx;
+ double miny = bounds.miny;
+ double maxx = bounds.maxx;
+ double maxy = bounds.maxy;
+
+ m_currentTransform->TransformExtent(minx, miny, maxx, maxy);
+
+ bounds.minx = minx;
+ bounds.miny = miny;
+ bounds.maxx = maxx;
+ bounds.maxy = maxy;
+
+ //printf("Transformed bounds: [%f, %f, %f, %f]\n", bounds.minx, bounds.miny, bounds.maxx, bounds.maxy);
+ }
+}
+
+void FeaturePropRenderer::SetBBOXProperty(const RS_Bounds& bounds, MgStringProperty* bbox)
+{
STRING val;
STRING buf;
- MgUtil::DoubleToString(featBounds.minx, buf);
+ MgUtil::DoubleToString(bounds.minx, buf);
val += buf;
- MgUtil::DoubleToString(featBounds.miny, buf);
+ MgUtil::DoubleToString(bounds.miny, buf);
val += L" ";
val += buf;
- MgUtil::DoubleToString(featBounds.maxx, buf);
+ MgUtil::DoubleToString(bounds.maxx, buf);
val += L" ";
val += buf;
- MgUtil::DoubleToString(featBounds.maxy, buf);
+ MgUtil::DoubleToString(bounds.maxy, buf);
val += L" ";
val += buf;
bbox->SetValue(val);
}
+void FeaturePropRenderer::ProcessPolygon(LineBuffer* lb,
+ RS_FillStyle& fill)
+{
+ if (!m_bIncludeFeatureBBOX)
+ return;
+
+ RS_Bounds fbounds(0.0, 0.0, 0.0, 0.0);
+ GetGeometryBounds(lb, fbounds);
+ Ptr<MgStringProperty> bbox = dynamic_cast<MgStringProperty*>(m_currentFeature->GetItem(SPECIAL_PROP_BOUNDING_BOX));
+ SetBBOXProperty(fbounds, bbox);
+}
+
void FeaturePropRenderer::ProcessPolyline(LineBuffer* lb,
RS_LineStroke& lsym)
{
if (!m_bIncludeFeatureBBOX)
return;
- const RS_Bounds& featBounds = lb->bounds();
+ RS_Bounds fbounds(0.0, 0.0, 0.0, 0.0);
+ GetGeometryBounds(lb, fbounds);
Ptr<MgStringProperty> bbox = dynamic_cast<MgStringProperty*>(m_currentFeature->GetItem(SPECIAL_PROP_BOUNDING_BOX));
- STRING val;
- STRING buf;
- MgUtil::DoubleToString(featBounds.minx, buf);
- val += buf;
- MgUtil::DoubleToString(featBounds.miny, buf);
- val += L" ";
- val += buf;
- MgUtil::DoubleToString(featBounds.maxx, buf);
- val += L" ";
- val += buf;
- MgUtil::DoubleToString(featBounds.maxy, buf);
- val += L" ";
- val += buf;
- bbox->SetValue(val);
+ SetBBOXProperty(fbounds, bbox);
}
void FeaturePropRenderer::ProcessMarker(LineBuffer* lb,
@@ -185,22 +208,10 @@
return;
//Should we inflate this a bit to represent an actual box?
- const RS_Bounds& featBounds = lb->bounds();
+ RS_Bounds fbounds(0.0, 0.0, 0.0, 0.0);
+ GetGeometryBounds(lb, fbounds);
Ptr<MgStringProperty> bbox = dynamic_cast<MgStringProperty*>(m_currentFeature->GetItem(SPECIAL_PROP_BOUNDING_BOX));
- STRING val;
- STRING buf;
- MgUtil::DoubleToString(featBounds.minx, buf);
- val += buf;
- MgUtil::DoubleToString(featBounds.miny, buf);
- val += L" ";
- val += buf;
- MgUtil::DoubleToString(featBounds.maxx, buf);
- val += L" ";
- val += buf;
- MgUtil::DoubleToString(featBounds.maxy, buf);
- val += L" ";
- val += buf;
- bbox->SetValue(val);
+ SetBBOXProperty(fbounds, bbox);
}
void FeaturePropRenderer::ProcessPoint(SE_ApplyContext* ctx,
@@ -211,22 +222,10 @@
return;
//Should we inflate this a bit to represent an actual box?
- const RS_Bounds& featBounds = ctx->geometry->bounds();
+ RS_Bounds fbounds(0.0, 0.0, 0.0, 0.0);
+ GetGeometryBounds(ctx->geometry, fbounds);
Ptr<MgStringProperty> bbox = dynamic_cast<MgStringProperty*>(m_currentFeature->GetItem(SPECIAL_PROP_BOUNDING_BOX));
- STRING val;
- STRING buf;
- MgUtil::DoubleToString(featBounds.minx, buf);
- val += buf;
- MgUtil::DoubleToString(featBounds.miny, buf);
- val += L" ";
- val += buf;
- MgUtil::DoubleToString(featBounds.maxx, buf);
- val += L" ";
- val += buf;
- MgUtil::DoubleToString(featBounds.maxy, buf);
- val += L" ";
- val += buf;
- bbox->SetValue(val);
+ SetBBOXProperty(fbounds, bbox);
}
void FeaturePropRenderer::ProcessLine(SE_ApplyContext* ctx,
@@ -236,22 +235,10 @@
return;
//Should we inflate this a bit to represent an actual box?
- const RS_Bounds& featBounds = ctx->geometry->bounds();
+ RS_Bounds fbounds(0.0, 0.0, 0.0, 0.0);
+ GetGeometryBounds(ctx->geometry, fbounds);
Ptr<MgStringProperty> bbox = dynamic_cast<MgStringProperty*>(m_currentFeature->GetItem(SPECIAL_PROP_BOUNDING_BOX));
- STRING val;
- STRING buf;
- MgUtil::DoubleToString(featBounds.minx, buf);
- val += buf;
- MgUtil::DoubleToString(featBounds.miny, buf);
- val += L" ";
- val += buf;
- MgUtil::DoubleToString(featBounds.maxx, buf);
- val += L" ";
- val += buf;
- MgUtil::DoubleToString(featBounds.maxy, buf);
- val += L" ";
- val += buf;
- bbox->SetValue(val);
+ SetBBOXProperty(fbounds, bbox);
}
void FeaturePropRenderer::ProcessArea(SE_ApplyContext* ctx,
@@ -261,20 +248,8 @@
return;
//Should we inflate this a bit to represent an actual box?
- const RS_Bounds& featBounds = ctx->geometry->bounds();
+ RS_Bounds fbounds(0.0, 0.0, 0.0, 0.0);
+ GetGeometryBounds(ctx->geometry, fbounds);
Ptr<MgStringProperty> bbox = dynamic_cast<MgStringProperty*>(m_currentFeature->GetItem(SPECIAL_PROP_BOUNDING_BOX));
- STRING val;
- STRING buf;
- MgUtil::DoubleToString(featBounds.minx, buf);
- val += buf;
- MgUtil::DoubleToString(featBounds.miny, buf);
- val += L" ";
- val += buf;
- MgUtil::DoubleToString(featBounds.maxx, buf);
- val += L" ";
- val += buf;
- MgUtil::DoubleToString(featBounds.maxy, buf);
- val += L" ";
- val += buf;
- bbox->SetValue(val);
+ SetBBOXProperty(fbounds, bbox);
}
Modified: branches/2.6/MgDev/Server/src/Services/Rendering/FeaturePropRenderer.h
===================================================================
--- branches/2.6/MgDev/Server/src/Services/Rendering/FeaturePropRenderer.h 2014-06-17 02:54:48 UTC (rev 8231)
+++ branches/2.6/MgDev/Server/src/Services/Rendering/FeaturePropRenderer.h 2014-06-17 02:58:27 UTC (rev 8232)
@@ -71,6 +71,9 @@
virtual void ProcessArea(SE_ApplyContext* ctx,
SE_RenderAreaStyle* style);
+ void GetGeometryBounds(const LineBuffer* lb, RS_Bounds& bounds);
+ void SetBBOXProperty(const RS_Bounds& bounds, MgStringProperty* bbox);
+
MgBatchPropertyCollection* GetProperties()
{
return SAFE_ADDREF(m_featprops);
Modified: branches/2.6/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
===================================================================
--- branches/2.6/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp 2014-06-17 02:54:48 UTC (rev 8231)
+++ branches/2.6/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp 2014-06-17 02:58:27 UTC (rev 8232)
@@ -1432,6 +1432,8 @@
}
selRenderer->StartLayer(&layerinfo, &fcinfo);
+ //Pass current layer xformer to renderer so it can transform any bbox data
+ selRenderer->SetLayerToMapTransform(xformer);
ds.StylizeVectorLayer(vl, selRenderer, rsrdr.get(), NULL, scale, StylizeThatMany, selRenderer);
// Clear the readers in case they are reused below
More information about the mapguide-commits
mailing list