[mapguide-commits] r1306 - trunk/MgDev/Common/Stylization

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Mar 20 17:06:33 EDT 2007


Author: waltweltonlair
Date: 2007-03-20 17:06:33 -0400 (Tue, 20 Mar 2007)
New Revision: 1306

Modified:
   trunk/MgDev/Common/Stylization/KmlRenderer.cpp
Log:
Fix the Linux build

Modified: trunk/MgDev/Common/Stylization/KmlRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/KmlRenderer.cpp	2007-03-20 20:51:33 UTC (rev 1305)
+++ trunk/MgDev/Common/Stylization/KmlRenderer.cpp	2007-03-20 21:06:33 UTC (rev 1306)
@@ -29,7 +29,7 @@
 const double ELEV_FACTOR = 0.1;
 
 //default constructor
-KmlRenderer::KmlRenderer(KmlContent* kmlContent, RS_Bounds& extents, 
+KmlRenderer::KmlRenderer(KmlContent* kmlContent, RS_Bounds& extents,
         double scale, double dpi, double metersPerUnit, int drawOrder) :
     m_mainContent(kmlContent),
     m_kmlContent(kmlContent),
@@ -74,7 +74,7 @@
 }
 
 
-void KmlRenderer::StartLayer(RS_LayerUIInfo*      legendInfo,
+void KmlRenderer::StartLayer(RS_LayerUIInfo*     legendInfo,
                             RS_FeatureClassInfo* classInfo)
 {
     m_featureCount = 0;
@@ -111,17 +111,16 @@
     {
         m_kmlContent->WriteString(m_styleContent->GetString());
     }
-
 }
 
 
 void KmlRenderer::StartFeature(RS_FeatureReader* /*feature*/,
-                              const RS_String* tooltip,
-                              const RS_String* url, 
-                              const RS_String* theme,
-                              double zOffset,
-                              double zExtrusion,
-                              RS_ElevationType zOffsetType)
+                               const RS_String* tooltip,
+                               const RS_String* url,
+                               const RS_String* theme,
+                               double zOffset,
+                               double zExtrusion,
+                               RS_ElevationType zOffsetType)
 {
     if(m_featureCount > 0)
     {
@@ -146,7 +145,7 @@
         }
     }
     m_kmlContent->WriteString("<Placemark>");
-    if((tooltip != NULL && tooltip->length() > 0) || 
+    if((tooltip != NULL && tooltip->length() > 0) ||
         (url != NULL && url->length() > 0))
     {
         m_kmlContent->WriteString("<description>");
@@ -214,7 +213,7 @@
 {
     //write style
     WriteStyle(fill);
-        
+
     if(lb != NULL)
     {
         if(lb->cntr_count() == 1)
@@ -321,7 +320,7 @@
 void KmlRenderer::ProcessRaster(unsigned char* /*data*/,
                                int /*length*/,
                                RS_ImageFormat /*format*/,
-                               int /*width*/, 
+                               int /*width*/,
                                int /*height*/,
                                RS_Bounds /*extents*/)
 {
@@ -475,7 +474,7 @@
     {
         m_styleContent = new KmlContent();
     }
-    
+
     char buffer[256];
 
     int thisStyleId;
@@ -520,12 +519,12 @@
 //        m_styleContent->WriteString("<href>");
 //        m_styleContent->WriteString("http://callt83-le:8008/mapguide/mapagent/mapagent.fcgi?OPERATION=GetLegendImage&amp;LAYERDEFINITION=Library://Samples/Sheboygan/Layers/Parcels.LayerDefinition&amp;WIDTH=32&amp;HEIGHT=32&amp;SCALE=4950&amp;FORMAT=PNG&amp;THEMECATEGORY=3&amp;TYPE=-1&amp;VERSION=1");
 //        m_styleContent->WriteString("http://callt83-le:8008/mapguide/mapagent/icon.png");
-//        m_styleContent->WriteString("</href>");        
+//        m_styleContent->WriteString("</href>");
 //        m_styleContent->WriteString("</Icon></IconStyle>");
-       
+
         m_styleContent->WriteString("</Style>");
     }
-        
+
     //write a style reference into the main document
     sprintf(buffer, "<styleUrl>#%d</styleUrl>", thisStyleId);
     m_kmlContent->WriteString(buffer);
@@ -550,7 +549,7 @@
     else
     {
         thisStyleId = m_lineStyleMap[key] = m_styleId;
-        
+
         //write the style definitions into the style storage
         sprintf(buffer, "<Style id=\"%d\">", m_styleId++);
         m_styleContent->WriteString(buffer);
@@ -567,7 +566,7 @@
         m_styleContent->WriteString(buffer);
         m_styleContent->WriteString("</width>");
         m_styleContent->WriteString("</LineStyle>");
-        
+
         m_styleContent->WriteString("</Style>");
     }
 
@@ -655,14 +654,7 @@
 {
 }
 
-void KmlRenderer::ProcessPoint(LineBuffer* geometry, SE_RenderPointStyle* style)
-{
-    RS_FillStyle fs;
-    RS_MarkerDef mdef(1.0, 1.0, 0.5, 0.5, 0.0, RS_Units_Device, L"", L"", fs);
 
-    ProcessMarker(geometry, mdef, !style->addToExclusionRegions, NULL);
-}
-
 /////////////////////////////////////////////////////////////////////////////
 // TODO: If we want true composite styles generated by the SE_Renderer
 // these 3 functions need to be removed and instead the above DrawScreen*
@@ -671,12 +663,22 @@
 // right now is to just pipe all features that come from the SE_Renderer
 // directly into the old Renderer APIs using arbitrary styles based on
 // information obtained from cursory examination of the SE composite style.
-//
 
+
+void KmlRenderer::ProcessPoint(LineBuffer* geometry, SE_RenderPointStyle* style)
+{
+    RS_FillStyle fs;
+    RS_MarkerDef mdef(1.0, 1.0, 0.5, 0.5, 0.0, RS_Units_Device, L"", L"", fs);
+
+    ProcessMarker(geometry, mdef, !style->addToExclusionRegions, NULL);
+}
+
+
 void KmlRenderer::ProcessLine(LineBuffer* geometry, SE_RenderLineStyle* style)
 {
-    RS_LineStroke ls(RS_Color(0,0,0,255), 0.0, L"Solid", RS_Units_Device);
-    
+    RS_Color black(0,0,0,255);
+    RS_LineStroke ls(black, 0.0, L"Solid", RS_Units_Device);
+
     //try to get some line style information from the SE symbol
     if (style->symbol.size())
     {
@@ -694,9 +696,9 @@
 
     //forward the feature to the regular ProcessPolyline API
     ProcessPolyline(geometry, ls);
-        
 }
 
+
 void KmlRenderer::ProcessArea(LineBuffer* geometry, SE_RenderAreaStyle* style)
 {
     //not implemented upstream yet, but let's do something anyway
@@ -719,5 +721,5 @@
         }
     }
 
-    ProcessPolygon(geometry, fs);   
+    ProcessPolygon(geometry, fs);
 }



More information about the mapguide-commits mailing list