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

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Mar 24 22:55:10 EDT 2007


Author: waltweltonlair
Date: 2007-03-24 22:55:09 -0400 (Sat, 24 Mar 2007)
New Revision: 1369

Modified:
   trunk/MgDev/Common/Stylization/LabelRenderer.cpp
   trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp
   trunk/MgDev/Common/Stylization/SE_ExpressionBase.h
   trunk/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp
   trunk/MgDev/Common/Stylization/SE_RenderProxies.h
   trunk/MgDev/Common/Stylization/SE_Renderer.cpp
   trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp
   trunk/MgDev/Common/Stylization/SE_SymbolDefProxies.cpp
   trunk/MgDev/Common/Stylization/SE_SymbolDefProxies.h
   trunk/MgDev/Common/Stylization/StylizationEngine.cpp
Log:
Fixed some symbolization bugs:
- The SE_RenderStyle bounds was being initialized to all zero instead
  of -/+DBL_MAX.  In the case where all the render style's graphics were
  offset from the origin you would therefore end up with an incorrect
  overall bounds for the render style.  I noticed this problem in the
  case where I had set the symbol instance insertion offset to non-zero
  values.  The bounds are now correctly initialized.
- If a resize box is not defined but the primitive's ResizeControl is
  set to AddToResizeBox, we now treat this as ResizeNone.
- GrowControl now defaults to GrowInXYMaintainAspect.

Cleaned up some code:
- No need to call SE_Matrix::setIdentity right after creating an SE_Matrix.
- SE_String::evaluate now always returns a non-NULL pointer to a string.
  This lets us remove NULL checks in places that call this method.
- Got rid of the SE_EvalContext::useBox variable.  Bounds for primitives
  are now simply always computed when they're evaluated.


Modified: trunk/MgDev/Common/Stylization/LabelRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/LabelRenderer.cpp	2007-03-25 00:15:18 UTC (rev 1368)
+++ trunk/MgDev/Common/Stylization/LabelRenderer.cpp	2007-03-25 02:55:09 UTC (rev 1369)
@@ -452,7 +452,6 @@
     //apply position and rotation to the native bounds of the symbol
     double angle = m_serenderer->GetFontEngine()->_Yup() ? info.m_tdef.rotation() : -info.m_tdef.rotation();
     SE_Matrix m;
-    m.setIdentity();
     m.rotate(angle); //it is already in radians in there
     m.translate(info.m_x, info.m_y);
 
@@ -494,7 +493,8 @@
         lb.LineTo(fpts[2].x, fpts[2].y);
         lb.LineTo(fpts[3].x, fpts[3].y);
         lb.Close();
-        m_serenderer->DrawScreenPolyline(&lb, 0xff000000, 0.0);
+        SE_Matrix xform;
+        m_serenderer->DrawScreenPolyline(&lb, &xform, 0xff000000, 0.0);
 #endif
     }
 

Modified: trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp	2007-03-25 00:15:18 UTC (rev 1368)
+++ trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp	2007-03-25 02:55:09 UTC (rev 1369)
@@ -988,7 +988,6 @@
     //apply position and rotation to the native bounds of the symbol
     double angle = m_serenderer->GetFontEngine()->_Yup() ? info.m_tdef.rotation() : -info.m_tdef.rotation();
     SE_Matrix m;
-    m.setIdentity();
     m.rotate(angle); //it is already in radians in there
     m.translate(info.m_x, info.m_y);
 
@@ -1145,7 +1144,6 @@
             //apply position and rotation to the native bounds of the symbol
             double angle = m_serenderer->GetFontEngine()->_Yup() ? info.m_tdef.rotation() : -info.m_tdef.rotation();
             SE_Matrix m;
-            m.setIdentity();
             m.rotate(angle); //it is already in radians in there
             m.translate(info.m_x, info.m_y);
 

Modified: trunk/MgDev/Common/Stylization/SE_ExpressionBase.h
===================================================================
--- trunk/MgDev/Common/Stylization/SE_ExpressionBase.h	2007-03-25 00:15:18 UTC (rev 1368)
+++ trunk/MgDev/Common/Stylization/SE_ExpressionBase.h	2007-03-25 02:55:09 UTC (rev 1369)
@@ -204,6 +204,7 @@
 
     SE_INLINE const wchar_t* evaluate(RS_FilterExecutor* processor)
     {
+        static const wchar_t* sEmpty = L"";
         if (expression)
         {
             delete[] value;
@@ -227,7 +228,7 @@
             }
         }
 
-        return value;
+        return value? value : sEmpty;
     }
 
     SE_INLINE void operator=(const wchar_t* s)

Modified: trunk/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp	2007-03-25 00:15:18 UTC (rev 1368)
+++ trunk/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp	2007-03-25 02:55:09 UTC (rev 1369)
@@ -153,7 +153,6 @@
     double box_angle_rad = atan2(dy, dx);
 
     SE_Matrix ixform;
-    ixform.setIdentity();
     ixform.translate(-cx, -cy); //factor out point position
     ixform.rotate(-box_angle_rad); //factor out rotation
     //double pixelToMeter = 0.001 / renderer->GetPixelsPerMillimeterScreen();

Modified: trunk/MgDev/Common/Stylization/SE_RenderProxies.h
===================================================================
--- trunk/MgDev/Common/Stylization/SE_RenderProxies.h	2007-03-25 00:15:18 UTC (rev 1368)
+++ trunk/MgDev/Common/Stylization/SE_RenderProxies.h	2007-03-25 02:55:09 UTC (rev 1369)
@@ -114,7 +114,12 @@
           drawLast(false),
           checkExclusionRegions(false),
           addToExclusionRegions(false)
-    { memset (&bounds, 0, sizeof(bounds));}
+    {
+        bounds[0].x = bounds[3].x = +DBL_MAX;
+        bounds[1].x = bounds[2].x = -DBL_MAX;
+        bounds[0].y = bounds[1].y = +DBL_MAX;
+        bounds[2].y = bounds[3].y = -DBL_MAX;
+    }
 
     ~SE_RenderStyle()
     {

Modified: trunk/MgDev/Common/Stylization/SE_Renderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Renderer.cpp	2007-03-25 00:15:18 UTC (rev 1368)
+++ trunk/MgDev/Common/Stylization/SE_Renderer.cpp	2007-03-25 02:55:09 UTC (rev 1369)
@@ -419,7 +419,6 @@
 void SE_Renderer::AddExclusionRegion(SE_RenderStyle* rstyle, SE_Matrix& xform, double angle)
 {
     SE_Matrix xform2;
-    xform2.setIdentity();
     xform2.rotate(angle);
     xform2.translate(xform.x2, xform.y2);
 

Modified: trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp	2007-03-25 00:15:18 UTC (rev 1368)
+++ trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp	2007-03-25 02:55:09 UTC (rev 1369)
@@ -588,7 +588,7 @@
     }
 
     ResizeBox* box = simpleSymbol.GetResizeBox();
-    m_style->useBox = box != NULL;
+    m_style->useBox = (box != NULL);
     if (m_style->useBox)
     {
         ParseDoubleExpression(box->GetSizeX(), m_style->resizeSize[0]);

Modified: trunk/MgDev/Common/Stylization/SE_SymbolDefProxies.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_SymbolDefProxies.cpp	2007-03-25 00:15:18 UTC (rev 1368)
+++ trunk/MgDev/Common/Stylization/SE_SymbolDefProxies.cpp	2007-03-25 02:55:09 UTC (rev 1369)
@@ -27,15 +27,6 @@
 #include <functional>
 
 
-//assumes axis aligned
-static void SetUndefinedBounds(RS_F_Point* pts)
-{
-    pts[0].x = pts[3].x = DBL_MAX;
-    pts[1].x = pts[2].x = -DBL_MAX;
-    pts[0].y = pts[1].y = DBL_MAX;
-    pts[2].y = pts[3].y = -DBL_MAX;
-}
-
 //assumes axis aligned bounds stored in src and dst
 static void BoundsUnion(RS_F_Point* dst, RS_F_Point* src)
 {
@@ -45,11 +36,12 @@
     dst[2].y = dst[3].y = rs_max(dst[2].y, src[2].y);
 }
 
+
 static void ComputeGrowAmount(RS_F_Point* bounds, double minx, double miny, double maxx, double maxy, double &growx, double &growy)
 {
     double sx, sy;
-    double cx = (minx + maxx)/2.0;
-    double cy = (miny + maxy)/2.0;
+    double cx = 0.5*(minx + maxx);
+    double cy = 0.5*(miny + maxy);
     minx -= cx;
     maxx -= cx;
     miny -= cy;
@@ -96,72 +88,63 @@
 {
     SE_RenderPolyline* ret = new SE_RenderPolyline();
     const wchar_t* sResizeCtrl = resizeControl.evaluate(cxt->exec);
-    ret->resize = (sResizeCtrl && wcscmp(sResizeCtrl, L"AdjustToResizeBox") == 0);
+    ret->resize = (wcscmp(sResizeCtrl, L"AdjustToResizeBox") == 0);
 
-    double wx =     weightScalable.evaluate(cxt->exec)? cxt->mm2pxw : cxt->mm2pxs;
-    ret->weight =   weight.evaluate(cxt->exec) * wx;
+    double wx     = weightScalable.evaluate(cxt->exec)? cxt->mm2pxw : cxt->mm2pxs;
+    ret->weight   = weight.evaluate(cxt->exec) * wx;
     ret->geometry = geometry->Clone();
-    ret->color =    color.evaluate(cxt->exec);
+    ret->color    = color.evaluate(cxt->exec);
 
-    if (!cxt->useBox)
-    {
-        ret->geometry->Transform(*cxt->xform, ret->weight);
+    ret->geometry->Transform(*cxt->xform, ret->weight);
 
-        SE_Bounds* seb = ret->geometry->xf_bounds();
+    SE_Bounds* seb = ret->geometry->xf_bounds();
 
-        //TODO: here we would implement rotating calipers algorithm to get
-        //a tighter oriented box, but for now we just get the axis aligned bounds of the path
-        ret->bounds[0].x = seb->min[0];
-        ret->bounds[0].y = seb->min[1];
-        ret->bounds[1].x = seb->max[0];
-        ret->bounds[1].y = seb->min[1];
-        ret->bounds[2].x = seb->max[0];
-        ret->bounds[2].y = seb->max[1];
-        ret->bounds[3].x = seb->min[0];
-        ret->bounds[3].y = seb->max[1];
-    }
-    else
-        SetUndefinedBounds(ret->bounds);
+    //TODO: here we would implement a rotating calipers algorithm to get a tighter
+    //      oriented box, but for now just get the axis-aligned bounds of the path
+    ret->bounds[0].x = seb->min[0];
+    ret->bounds[0].y = seb->min[1];
+    ret->bounds[1].x = seb->max[0];
+    ret->bounds[1].y = seb->min[1];
+    ret->bounds[2].x = seb->max[0];
+    ret->bounds[2].y = seb->max[1];
+    ret->bounds[3].x = seb->min[0];
+    ret->bounds[3].y = seb->max[1];
 
     return ret;
 }
 
+
 SE_RenderPrimitive* SE_Polygon::evaluate(SE_EvalContext* cxt)
 {
     SE_RenderPolygon* ret = new SE_RenderPolygon();
     const wchar_t* sResizeCtrl = resizeControl.evaluate(cxt->exec);
     ret->resize = (sResizeCtrl && wcscmp(sResizeCtrl, L"AdjustToResizeBox") == 0);
 
-    ret->fill = fill.evaluate(cxt->exec);
-
-    double wx =     weightScalable.evaluate(cxt->exec)? cxt->mm2pxw : cxt->mm2pxs;
-    ret->weight =   weight.evaluate(cxt->exec) * wx;
+    double wx     = weightScalable.evaluate(cxt->exec)? cxt->mm2pxw : cxt->mm2pxs;
+    ret->weight   = weight.evaluate(cxt->exec) * wx;
     ret->geometry = geometry->Clone();
-    ret->color =    color.evaluate(cxt->exec);
+    ret->color    = color.evaluate(cxt->exec);
+    ret->fill     = fill.evaluate(cxt->exec);
 
-    if (!cxt->useBox)
-    {
-        ret->geometry->Transform(*cxt->xform, ret->weight);
+    ret->geometry->Transform(*cxt->xform, ret->weight);
 
-        SE_Bounds* seb = ret->geometry->xf_bounds();
+    SE_Bounds* seb = ret->geometry->xf_bounds();
 
-        //TODO: here we would implement rotating calipers algorithm to get
-        //a tighter oriented box, but for now we just get the axis aligned bounds of the path
-        ret->bounds[0].x = seb->min[0];
-        ret->bounds[0].y = seb->min[1];
-        ret->bounds[1].x = seb->max[0];
-        ret->bounds[1].y = seb->min[1];
-        ret->bounds[2].x = seb->max[0];
-        ret->bounds[2].y = seb->max[1];
-        ret->bounds[3].x = seb->min[0];
-        ret->bounds[3].y = seb->max[1];
-    }
-    else
-        SetUndefinedBounds(ret->bounds);
+    //TODO: here we would implement a rotating calipers algorithm to get a tighter
+    //      oriented box, but for now just get the axis-aligned bounds of the path
+    ret->bounds[0].x = seb->min[0];
+    ret->bounds[0].y = seb->min[1];
+    ret->bounds[1].x = seb->max[0];
+    ret->bounds[1].y = seb->min[1];
+    ret->bounds[2].x = seb->max[0];
+    ret->bounds[2].y = seb->max[1];
+    ret->bounds[3].x = seb->min[0];
+    ret->bounds[3].y = seb->max[1];
 
     return ret;
 }
 
+
 SE_RenderPrimitive* SE_Text::evaluate(SE_EvalContext* cxt)
 {
     if (cxt->fonte == NULL)
@@ -169,7 +152,7 @@
 
     SE_RenderText* ret = new SE_RenderText();
     const wchar_t* sResizeCtrl = resizeControl.evaluate(cxt->exec);
-    ret->resize = (sResizeCtrl && wcscmp(sResizeCtrl, L"AdjustToResizeBox") == 0);
+    ret->resize = (wcscmp(sResizeCtrl, L"AdjustToResizeBox") == 0);
 
     ret->text = textExpr.evaluate(cxt->exec);
     ret->position[0] = position[0].evaluate(cxt->exec);
@@ -198,30 +181,24 @@
     ret->tdef.bgcolor() = RS_Color::FromARGB(ghostColor.evaluate(cxt->exec));
 
     const wchar_t* hAlign = hAlignment.evaluate(cxt->exec);
-    if (hAlign)
-    {
-        if (wcscmp(hAlign, L"Left") == 0)
-            ret->tdef.halign() = RS_HAlignment_Left;
-        else if (wcscmp(hAlign, L"Center") == 0)
-            ret->tdef.halign() = RS_HAlignment_Center;
-        else if (wcscmp(hAlign, L"Right") == 0)
-            ret->tdef.halign() = RS_HAlignment_Right;
-    }
+    if (wcscmp(hAlign, L"Left") == 0)
+        ret->tdef.halign() = RS_HAlignment_Left;
+    else if (wcscmp(hAlign, L"Right") == 0)
+        ret->tdef.halign() = RS_HAlignment_Right;
+    else // default is Center
+        ret->tdef.halign() = RS_HAlignment_Center;
 
     const wchar_t* vAlign = vAlignment.evaluate(cxt->exec);
-    if (vAlign)
-    {
-        if (wcscmp(vAlign, L"Bottom") == 0)
-            ret->tdef.valign() = RS_VAlignment_Descent;
-        else if (wcscmp(vAlign, L"Baseline") == 0)
-            ret->tdef.valign() = RS_VAlignment_Base;
-        else if (wcscmp(vAlign, L"Halfline") == 0)
-            ret->tdef.valign() = RS_VAlignment_Half;
-        else if (wcscmp(vAlign, L"Capline") == 0)
-            ret->tdef.valign() = RS_VAlignment_Cap;
-        else if (wcscmp(vAlign, L"Top") == 0)
-            ret->tdef.valign() = RS_VAlignment_Ascent;
-    }
+    if (wcscmp(vAlign, L"Bottom") == 0)
+        ret->tdef.valign() = RS_VAlignment_Descent;
+    else if (wcscmp(vAlign, L"Halfline") == 0)
+        ret->tdef.valign() = RS_VAlignment_Half;
+    else if (wcscmp(vAlign, L"Capline") == 0)
+        ret->tdef.valign() = RS_VAlignment_Cap;
+    else if (wcscmp(vAlign, L"Top") == 0)
+        ret->tdef.valign() = RS_VAlignment_Ascent;
+    else // default is Baseline
+        ret->tdef.valign() = RS_VAlignment_Base;
 
     RS_TextMetrics tm;
     SE_Matrix txf;
@@ -229,7 +206,7 @@
     txf.rotate(ret->tdef.rotation() * M_PI180);
     txf.translate(ret->position[0], ret->position[1]);
 
-    //compute axis aligned boudns of the text primitive
+    //compute axis aligned bounds of the text primitive
     RS_F_Point fpts[4];
     RS_Bounds xformBounds(+DBL_MAX, +DBL_MAX, -DBL_MAX, -DBL_MAX);
 
@@ -254,11 +231,12 @@
     return ret;
 }
 
+
 SE_RenderPrimitive* SE_Raster::evaluate(SE_EvalContext* cxt)
 {
     SE_RenderRaster* ret = new SE_RenderRaster();
     const wchar_t* sResizeCtrl = resizeControl.evaluate(cxt->exec);
-    ret->resize = (sResizeCtrl && wcscmp(sResizeCtrl, L"AdjustToResizeBox") == 0);
+    ret->resize = (wcscmp(sResizeCtrl, L"AdjustToResizeBox") == 0);
 
     if (!pngPtr)
     {
@@ -291,8 +269,8 @@
     rxf.rotate(ret->angle);
     rxf.translate(ret->position[0], ret->position[1]);
 
-    double w = 0.5 * ret->extent[0];
-    double h = 0.5 * ret->extent[1];
+    double w = 0.5*ret->extent[0];
+    double h = 0.5*ret->extent[1];
 
     RS_F_Point pts[4];
     rxf.transform( w,  h, pts[0].x, pts[0].y);
@@ -305,6 +283,7 @@
     return ret;
 }
 
+
 void SE_Style::evaluate(SE_EvalContext* cxt)
 {
     //evaluate values that are common to all styles
@@ -323,8 +302,8 @@
     {
         dx = resizePosition[0].evaluate(cxt->exec);
         dy = resizePosition[1].evaluate(cxt->exec);
-        sx = resizeSize[0].evaluate(cxt->exec)/2.0;
-        sy = resizeSize[1].evaluate(cxt->exec)/2.0;
+        sx = 0.5*fabs(resizeSize[0].evaluate(cxt->exec));
+        sy = 0.5*fabs(resizeSize[1].evaluate(cxt->exec));
 
         cxt->xform->transform(dx - sx, dy - sy, minx, miny);
         cxt->xform->transform(dx + sx, dy + sy, maxx, maxy);
@@ -332,12 +311,7 @@
 
         growx = 0.0;
         growy = 0.0;
-
-        //TODO: find a way to reorg the size box code to get rid of this flag
-        cxt->useBox = true;
     }
-    else
-        cxt->useBox = false;
 
     for (SE_PrimitiveList::const_iterator src = symbol.begin(); src != symbol.end(); src++)
     {
@@ -345,53 +319,50 @@
 
         //evaluate the render primitive
         SE_RenderPrimitive* rsym = sym->evaluate(cxt);
+        if (!rsym)
+            continue;
 
+        rstyle->symbol.push_back(rsym);
+
         //add the primitive bounds to the overall render style bounds
-        if (rsym)
+        if (!rsym->resize || !useBox)
+            BoundsUnion(rstyle->bounds, rsym->bounds);
+
+        //add the primitive bounds to the resize box, if necessary
+        if (useBox)
         {
-            if (!rsym->resize)
+            const wchar_t* sResizeCtrl = sym->resizeControl.evaluate(cxt->exec);
+            if (wcscmp(sResizeCtrl, L"AddToResizeBox") == 0)
             {
-                BoundsUnion(rstyle->bounds, rsym->bounds);
+                // TODO - rework how resize box growth is done
+                ComputeGrowAmount(rstyle->bounds, minx, miny, maxx, maxy, growx, growy);
             }
-
-            rstyle->symbol.push_back(rsym);
-
-            if (useBox)
-            {
-                const wchar_t* sResizeCtrl = sym->resizeControl.evaluate(cxt->exec);
-
-                if (wcscmp(sResizeCtrl, L"AddToResizeBox") == 0)
-                    ComputeGrowAmount(rstyle->bounds, minx, miny, maxx, maxy, growx, growy);
-            }
         }
     }
 
+    // update all primitive which need to adjust to the resize box
     if (useBox)
     {
         const wchar_t* sGrowCtrl = growControl.evaluate(cxt->exec);
-        // TODO - if the string is empty we need to use the default
-        if (sGrowCtrl)
+        if (wcscmp(sGrowCtrl, L"GrowInX") == 0)
         {
-            if (wcscmp(sGrowCtrl, L"GrowInX") == 0)
-            {
-                growy = 0.0;
-            }
-            else if (wcscmp(sGrowCtrl, L"GrowInY") == 0)
-            {
-                growx = 0.0;
-            }
-            else if (wcscmp(sGrowCtrl, L"GrowInXY") == 0)
-            {
-                // TODO
-            }
-            else if (wcscmp(sGrowCtrl, L"GrowInXYMaintainAspect") == 0)
-            {
-                if (growy > growx)
-                    growx = growy;
-                else if (growx > growy)
-                    growy = growx;
-            }
+            growy = 0.0;
         }
+        else if (wcscmp(sGrowCtrl, L"GrowInY") == 0)
+        {
+            growx = 0.0;
+        }
+//      else if (wcscmp(sGrowCtrl, L"GrowInXY") == 0)
+//      {
+//          // nothing to do
+//      }
+        else // default is GrowInXYMaintainAspect
+        {
+            if (growy > growx)
+                growx = growy;
+            else if (growx > growy)
+                growy = growx;
+        }
 
         SE_Matrix totalxf(*cxt->xform);
         SE_Matrix growxf;
@@ -427,7 +398,7 @@
                     {
                         SE_RenderText* rt = (SE_RenderText*)rsym;
                         growxf.transform(rt->position[0], rt->position[1]);
-                        rt->tdef.font().height() *= growxf.y1;
+                        rt->tdef.font().height() *= growxf.y1;  // TODO: should this only be done if HeightScalable is true?
                         for (int j=0; j<4; j++)
                             growxf.transform(rt->bounds[j].x, rt->bounds[j].y);
                         break;
@@ -436,7 +407,7 @@
                     {
                         SE_RenderRaster* rr = (SE_RenderRaster*)rsym;
                         growxf.transform(rr->position[0], rr->position[1]);
-                        rr->extent[0] *= growxf.x0;
+                        rr->extent[0] *= growxf.x0; // TODO: should this only be done if SizeScalable is true?
                         rr->extent[1] *= growxf.y1;
                         for (int j=0; j<4; j++)
                             growxf.transform(rr->bounds[j].x, rr->bounds[j].y);
@@ -488,8 +459,8 @@
     }
 
     double angle = 0.0;
-    const wchar_t* angleControl = this->angleControl.evaluate(cxt->exec);
-    if (wcscmp(L"FromGeometry", angleControl) == 0)
+    const wchar_t* sAngleControl = angleControl.evaluate(cxt->exec);
+    if (wcscmp(L"FromGeometry", sAngleControl) == 0)
     {
         if (type == LineBuffer::ctLine || type == LineBuffer::ctArea)
         {
@@ -520,6 +491,7 @@
     SE_Style::evaluate(cxt);
 }
 
+
 void SE_LineStyle::evaluate(SE_EvalContext* cxt)
 {
     SE_RenderLineStyle* render;
@@ -551,6 +523,7 @@
     SE_Style::evaluate(cxt);
 }
 
+
 void SE_AreaStyle::evaluate(SE_EvalContext* cxt)
 {
     SE_RenderAreaStyle* render;
@@ -581,16 +554,19 @@
     SE_Style::evaluate(cxt);
 }
 
+
 void SE_PointStyle::apply(LineBuffer* geometry, SE_Renderer* renderer)
 {
     renderer->ProcessPoint(geometry, (SE_RenderPointStyle*)rstyle);
 }
 
+
 void SE_LineStyle::apply(LineBuffer* geometry, SE_Renderer* renderer)
 {
     renderer->ProcessLine(geometry, (SE_RenderLineStyle*)rstyle);
 }
 
+
 void SE_AreaStyle::apply(LineBuffer* geometry, SE_Renderer* renderer)
 {
     renderer->ProcessArea(geometry, (SE_RenderAreaStyle*)rstyle);

Modified: trunk/MgDev/Common/Stylization/SE_SymbolDefProxies.h
===================================================================
--- trunk/MgDev/Common/Stylization/SE_SymbolDefProxies.h	2007-03-25 00:15:18 UTC (rev 1368)
+++ trunk/MgDev/Common/Stylization/SE_SymbolDefProxies.h	2007-03-25 02:55:09 UTC (rev 1369)
@@ -46,7 +46,6 @@
     double mm2pxs;
     double mm2px;
     SE_LineBufferPool* pool;
-    bool useBox;
     LineBuffer* geometry; //only used for SE_PointStyles -- get rid of it if possible
 };
 

Modified: trunk/MgDev/Common/Stylization/StylizationEngine.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/StylizationEngine.cpp	2007-03-25 00:15:18 UTC (rev 1368)
+++ trunk/MgDev/Common/Stylization/StylizationEngine.cpp	2007-03-25 02:55:09 UTC (rev 1369)
@@ -256,10 +256,8 @@
     // only call StartFeature for the initial rendering pass
     if (renderingPass == 0)
     {
-        const wchar_t* strTip = seTip->evaluate(executor);
-        const wchar_t* strUrl = seUrl->evaluate(executor);
-        RS_String rs_tip = strTip? strTip : L"";
-        RS_String rs_url = strUrl? strUrl : L"";
+        RS_String rs_tip = seTip->evaluate(executor);
+        RS_String rs_url = seUrl->evaluate(executor);
         RS_String& rs_thm = rule->legendLabel;
 
         m_renderer->StartFeature(reader, rs_tip.empty()? NULL : &rs_tip, rs_url.empty()? NULL : &rs_url, rs_thm.empty()? NULL : &rs_thm);
@@ -340,7 +338,7 @@
             style->rstyle->drawLast = sym->drawLast.evaluate(executor);
 
             const wchar_t* positioningAlgo = sym->positioningAlgorithm.evaluate(executor);
-            if (positioningAlgo && wcslen(positioningAlgo) > 0 && wcscmp(positioningAlgo, L"Default") != 0)
+            if (wcslen(positioningAlgo) > 0 && wcscmp(positioningAlgo, L"Default") != 0)
             {
                 LayoutCustomLabel(positioningAlgo, geometry, tmpxform, style, style->rstyle, mm2px);
             }



More information about the mapguide-commits mailing list