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

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Mar 16 12:49:15 EDT 2007


Author: traianstanev
Date: 2007-03-16 12:49:15 -0400 (Fri, 16 Mar 2007)
New Revision: 1253

Modified:
   trunk/MgDev/Common/Stylization/LabelRenderer.cpp
   trunk/MgDev/Common/Stylization/SE_ExpressionBase.h
   trunk/MgDev/Common/Stylization/SE_Include.h
   trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp
   trunk/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp
   trunk/MgDev/Common/Stylization/SE_Renderer.cpp
   trunk/MgDev/Common/Stylization/SE_Renderer.h
   trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp
   trunk/MgDev/Common/Stylization/SE_StyleVisitor.h
   trunk/MgDev/Common/Stylization/Stylization.h
   trunk/MgDev/Common/Stylization/Stylization.vcproj
   trunk/MgDev/Common/Stylization/StylizationEngine.cpp
   trunk/MgDev/Common/Stylization/StylizationEngine.h
Log:
Header file cleanup. Split the two sets of proxy objects (symbol definition proxies and rendering proxies into two separate headers).

Modified: trunk/MgDev/Common/Stylization/LabelRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/LabelRenderer.cpp	2007-03-16 15:06:30 UTC (rev 1252)
+++ trunk/MgDev/Common/Stylization/LabelRenderer.cpp	2007-03-16 16:49:15 UTC (rev 1253)
@@ -21,7 +21,7 @@
 #include "GDRenderer.h"
 #include "GDUtils.h"
 #include "RS_Font.h"
-#include "SE_Include.h"
+#include "SE_RenderProxies.h"
 #include "SE_Bounds.h"
 #include "SE_Renderer.h"
 

Modified: trunk/MgDev/Common/Stylization/SE_ExpressionBase.h
===================================================================
--- trunk/MgDev/Common/Stylization/SE_ExpressionBase.h	2007-03-16 15:06:30 UTC (rev 1252)
+++ trunk/MgDev/Common/Stylization/SE_ExpressionBase.h	2007-03-16 16:49:15 UTC (rev 1253)
@@ -20,16 +20,225 @@
 
 #include <map>
 #include <string>
+#include "FilterExecutor.h"
 
-#include "SimpleSymbolDefinition.h"
-#include "CompositeSymbolization.h"
+struct SE_Color
+{
+    unsigned char b, g, r, a; // argb, but little endian
+    FdoExpression* expression;
 
-struct SE_Double;
-struct SE_Integer;
-struct SE_Boolean;
-struct SE_String;
-struct SE_Color;
+    SE_INLINE SE_Color() : expression(NULL) { *((unsigned int*)this) = 0; }
+    ~SE_Color() { if (expression) expression->Release(); }
 
+    // Retrieve argb color
+    SE_INLINE unsigned int evaluate(RS_FilterExecutor* processor)
+    {
+        if (expression)
+        {
+            try
+            {
+                expression->Process(processor);
+                *((unsigned int*)this) = (unsigned int)processor->GetInt64Result();
+            }
+            catch (FdoException* e)
+            {
+                e->Release();
+                processor->Reset();
+
+                // set a default
+                *((unsigned int*)this) = 0xff000000;
+            }
+        }
+        
+        return *((unsigned int*)this);
+    }
+
+    SE_INLINE void operator=(unsigned int val) { *((unsigned int*)this) = val; }
+    SE_INLINE bool empty() { return (*(unsigned int*)this) == 0 && expression == NULL; }
+    SE_INLINE unsigned int& argb() { return (*(unsigned int*)this); }
+};
+
+struct SE_Double
+{
+    double value;
+    FdoExpression* expression;
+
+    SE_INLINE SE_Double() : expression(NULL),value(0.0)  {  }
+    SE_INLINE SE_Double(double d) : value(d), expression(NULL) { }
+    ~SE_Double() { if (expression) expression->Release(); }
+
+    SE_INLINE double evaluate(RS_FilterExecutor* processor)
+    {
+        if (expression)
+        {
+            try
+            {
+                expression->Process(processor);
+                value = processor->GetDoubleResult();
+            }
+            catch (FdoException* e)
+            {
+                e->Release();
+                processor->Reset();
+
+                // set a default
+                value = 0.0;
+            }
+        }
+
+        return value;
+    }
+
+    SE_INLINE void operator=(double d)  { value = d; }
+};
+
+struct SE_Integer
+{
+    int value;
+    FdoExpression* expression;
+
+    SE_INLINE SE_Integer() : expression(NULL), value(0) { }
+    SE_INLINE SE_Integer(int i) : value(i), expression(NULL) { }
+    ~SE_Integer() { if (expression) expression->Release(); }
+
+    SE_INLINE int evaluate(RS_FilterExecutor* processor)
+    {
+        if (expression)
+        {
+            try
+            {
+                expression->Process(processor);
+                value = (int)processor->GetInt64Result();
+            }
+            catch (FdoException* e)
+            {
+                e->Release();
+                processor->Reset();
+
+                // set a default
+                value = 0;
+            }
+        }
+
+        return value;
+    }
+
+    SE_INLINE void operator=(int i)  { value = i; }
+};
+
+struct SE_Boolean
+{
+    bool value;
+    FdoExpression* expression;
+
+    SE_INLINE SE_Boolean() : expression(NULL), value(false) { }
+    SE_INLINE SE_Boolean(bool b) : value(b), expression(NULL) { }
+    ~SE_Boolean() { if (expression) expression->Release(); }
+
+    SE_INLINE bool evaluate(RS_FilterExecutor* processor)
+    {
+        if (expression)
+        {
+            try
+            {
+                expression->Process(processor);
+                value = (bool)processor->GetBooleanResult();
+            }
+            catch (FdoException* e)
+            {
+                e->Release();
+                processor->Reset();
+
+                // set a default
+                value = false;
+            }
+        }
+
+        return value;
+    }
+
+    SE_INLINE void operator=(bool b) { value = b; }
+};
+
+struct SE_String
+{
+    const wchar_t* value;
+    FdoExpression* expression;
+
+    SE_INLINE SE_String() : expression(NULL), value(NULL)
+    {}
+    SE_INLINE SE_String(const wchar_t* s) : expression(NULL)
+    {
+        if (s)
+        {
+            size_t len = wcslen(s) + 1;
+            wchar_t* copy = new wchar_t[len];
+            value = wcscpy(copy, s);
+        }
+        else
+            value = NULL;
+    }
+
+    ~SE_String() 
+    {
+        if (value)
+            delete[] value;
+        if (expression) 
+            expression->Release(); 
+    }
+
+    SE_INLINE const wchar_t* evaluate(RS_FilterExecutor* processor)
+    {
+        if (expression)
+        {
+            if (value)
+            {
+                delete[] value;
+                value = NULL;
+            }
+
+            wchar_t* newValue = NULL;
+
+            try
+            {
+                expression->Process(processor);
+                newValue = processor->GetStringResult();
+            }
+            catch (FdoException* e)
+            {
+                e->Release();
+                processor->Reset();
+
+                // just return the stored expression
+                FdoString* exprValue = expression->ToString();
+                size_t len = wcslen(exprValue) + 1;
+                newValue = new wchar_t[len];
+                wcscpy(newValue, exprValue);
+            }
+
+            value = newValue;
+        }
+
+        return value;
+    }
+
+    SE_INLINE void operator=(const wchar_t* s)
+    {
+        if (value)
+            delete[] value;
+
+        if (s)
+        {
+            size_t len = wcslen(s) + 1;
+            wchar_t* copy = new wchar_t[len];
+            value = wcscpy(copy, s);
+        }
+        else
+            value = NULL;
+    }
+};
+
+
 typedef std::pair<const wchar_t*, const wchar_t*> ParamId;
 
 struct ParamCmpLess : std::binary_function<ParamId&, ParamId&, bool>
@@ -37,9 +246,9 @@
 public:
     bool operator( ) (const ParamId& a, const ParamId& b) const
     {
-        int symcmp = _wcsicmp(a.first, b.first);
+        int symcmp = wcscmp(a.first, b.first);
         if (symcmp == 0)
-            return _wcsicmp(a.second, b.second) < 0;
+            return wcscmp(a.second, b.second) < 0;
         
         return symcmp < 0;
     }
@@ -50,7 +259,7 @@
 public:
     bool operator( ) (const wchar_t* a, const wchar_t* b) const
     {
-        return _wcsicmp(a, b) < 0;
+        return wcscmp(a, b) < 0;
     }
 };
 

Modified: trunk/MgDev/Common/Stylization/SE_Include.h
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Include.h	2007-03-16 15:06:30 UTC (rev 1252)
+++ trunk/MgDev/Common/Stylization/SE_Include.h	2007-03-16 16:49:15 UTC (rev 1253)
@@ -16,590 +16,4 @@
 //
 
 #ifndef SE_INCLUDE_H
-#define SE_INCLUDE_H
-
-#include <math.h>
-#include <map>
-
-#include "FilterExecutor.h"
-#include "SE_Matrix.h"
-#include "SE_LineBuffer.h"
-#include "SE_Bounds.h"
-
-using namespace MDFMODEL_NAMESPACE;
-
-#define SE_INLINE inline
-
-enum SE_PrimitiveType
-{
-    SE_PolylinePrimitive,
-    SE_PolygonPrimitive,
-    SE_TextPrimitive,
-    SE_RasterPrimitive
-};
-
-enum SE_StyleType
-{
-    SE_PointStyleType,
-    SE_LineStyleType,
-    SE_AreaStyleType
-};
-
-struct SE_Color
-{
-    unsigned char b, g, r, a; // argb, but little endian
-    FdoExpression* expression;
-
-    SE_INLINE SE_Color() : expression(NULL) { *((unsigned int*)this) = 0; }
-    ~SE_Color() { if (expression) expression->Release(); }
-
-    // Retrieve argb color
-    SE_INLINE unsigned int evaluate(RS_FilterExecutor* processor)
-    {
-        if (expression)
-        {
-            // we need to try-catch the expression evaluation
-            try
-            {
-                expression->Process(processor);
-                *((unsigned int*)this) = (unsigned int)processor->GetInt64Result();
-            }
-            catch (FdoException* e)
-            {
-                e->Release();
-                processor->Reset();
-
-                // set a default
-                *((unsigned int*)this) = 0;
-            }
-        }
-        
-        return *((unsigned int*)this);
-    }
-
-    SE_INLINE void operator=(unsigned int val) { *((unsigned int*)this) = val; }
-    SE_INLINE bool empty() { return (*(unsigned int*)this) == 0 && expression == NULL; }
-    SE_INLINE unsigned int& argb() { return (*(unsigned int*)this); }
-};
-
-struct SE_Double
-{
-    double value;
-    FdoExpression* expression;
-
-    SE_INLINE SE_Double() : expression(NULL),value(0.0)  {  }
-    SE_INLINE SE_Double(double d) : value(d), expression(NULL) { }
-    ~SE_Double() { if (expression) expression->Release(); }
-
-    SE_INLINE double evaluate(RS_FilterExecutor* processor)
-    {
-        if (expression)
-        {
-            // we need to try-catch the expression evaluation
-            try
-            {
-                expression->Process(processor);
-                value = processor->GetDoubleResult();
-            }
-            catch (FdoException* e)
-            {
-                e->Release();
-                processor->Reset();
-
-                // set a default
-                value = 0.0;
-            }
-        }
-
-        return value;
-    }
-
-    SE_INLINE void operator=(double d)  { value = d; }
-};
-
-struct SE_Integer
-{
-    int value;
-    FdoExpression* expression;
-
-    SE_INLINE SE_Integer() : expression(NULL), value(0) { }
-    SE_INLINE SE_Integer(int i) : value(i), expression(NULL) { }
-    ~SE_Integer() { if (expression) expression->Release(); }
-
-    SE_INLINE int evaluate(RS_FilterExecutor* processor)
-    {
-        if (expression)
-        {
-            // we need to try-catch the expression evaluation
-            try
-            {
-                expression->Process(processor);
-                value = (int)processor->GetInt64Result();
-            }
-            catch (FdoException* e)
-            {
-                e->Release();
-                processor->Reset();
-
-                // set a default
-                value = 0;
-            }
-        }
-
-        return value;
-    }
-
-    SE_INLINE void operator=(int i)  { value = i; }
-};
-
-struct SE_Boolean
-{
-    bool value;
-    FdoExpression* expression;
-
-    SE_INLINE SE_Boolean() : expression(NULL), value(false) { }
-    SE_INLINE SE_Boolean(bool b) : value(b), expression(NULL) { }
-    ~SE_Boolean() { if (expression) expression->Release(); }
-
-    SE_INLINE bool evaluate(RS_FilterExecutor* processor)
-    {
-        if (expression)
-        {
-            // we need to try-catch the expression evaluation
-            try
-            {
-                expression->Process(processor);
-                value = (bool)processor->GetBooleanResult();
-            }
-            catch (FdoException* e)
-            {
-                e->Release();
-                processor->Reset();
-
-                // set a default
-                value = false;
-            }
-        }
-
-        return value;
-    }
-
-    SE_INLINE void operator=(bool b) { value = b; }
-};
-
-struct SE_String
-{
-    const wchar_t* value;
-    FdoExpression* expression;
-
-    SE_INLINE SE_String() : expression(NULL), value(NULL)
-    {}
-    SE_INLINE SE_String(const wchar_t* s) : expression(NULL)
-    {
-        if (s)
-        {
-            size_t len = wcslen(s) + 1;
-            wchar_t* copy = new wchar_t[len];
-            value = wcscpy(copy, s);
-        }
-        else
-            value = NULL;
-    }
-
-    ~SE_String() 
-    {
-        if (value)
-            delete[] value;
-        if (expression) 
-            expression->Release(); 
-    }
-
-    SE_INLINE const wchar_t* evaluate(RS_FilterExecutor* processor)
-    {
-        if (expression)
-        {
-            if (value)
-            {
-                delete[] value;
-                value = NULL;
-            }
-
-            wchar_t* newValue = NULL;
-
-            // we need to try-catch the expression evaluation
-            try
-            {
-                expression->Process(processor);
-                newValue = processor->GetStringResult();
-            }
-            catch (FdoException* e)
-            {
-                e->Release();
-                processor->Reset();
-
-                // just return the stored expression
-                FdoString* exprValue = expression->ToString();
-                size_t len = wcslen(exprValue) + 1;
-                newValue = new wchar_t[len];
-                wcscpy(newValue, exprValue);
-            }
-
-            value = newValue;
-        }
-
-        return value;
-    }
-
-    SE_INLINE void operator=(const wchar_t* s)
-    {
-        if (value)
-            delete[] value;
-
-        if (s)
-        {
-            size_t len = wcslen(s) + 1;
-            wchar_t* copy = new wchar_t[len];
-            value = wcscpy(copy, s);
-        }
-        else
-            value = NULL;
-    }
-};
-
-//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-//
-//        SE_Primitives
-//
-//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-struct SE_Primitive
-{
-    SE_PrimitiveType type;
-    GraphicElement::ResizeControl resize;
-    bool cacheable;
-};
-
-struct SE_Polyline : public SE_Primitive
-{
-    SE_LineBuffer* geometry;
-    SE_Double weight;
-    SE_Color color;
-    SE_Boolean weightScalable;
-
-    SE_INLINE SE_Polyline() : weight(0.0) { type = SE_PolylinePrimitive; }
-    ~SE_Polyline() { geometry->Free(); }
-};
-
-struct SE_Polygon : public SE_Polyline
-{
-    SE_Color fill;
-
-    SE_INLINE SE_Polygon() { type = SE_PolygonPrimitive; weight = 0.0; } 
-    ~SE_Polygon() { geometry->Free(); }
-};
-
-/* Font/properties caching is left to the implementor of SE_Renderer */
-struct SE_Text : public SE_Primitive
-{
-    SE_String textExpr;
-    SE_String fontExpr;
-    SE_Double position[2];
-    SE_Double size; // pt
-    SE_Double angle;
-    SE_Boolean underlined;
-    SE_Boolean italic;
-    SE_Boolean bold;
-    SE_Double lineSpacing;
-    SE_String hAlignment;
-    SE_String vAlignment;
-    SE_String justification;
-    SE_Color textColor;
-    SE_Color ghostColor;
-
-    SE_INLINE SE_Text() { type = SE_TextPrimitive;  }
-};
-
-struct SE_Raster : public SE_Primitive
-{
-    SE_String pngPath;
-    const unsigned char* pngPtr;
-    int pngSize;
-    SE_Double position[2];
-    SE_Double extent[2];
-    SE_Double angle;
-
-    SE_INLINE SE_Raster() { type = SE_RasterPrimitive; }
-};
-
-
-//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-//
-//        SE_RenderPrimitives
-//
-//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-struct SE_RenderPrimitive
-{
-    SE_PrimitiveType type;
-    bool resize;
-    SE_Bounds* bounds;
-};
-
-struct SE_RenderPolyline : public SE_RenderPrimitive
-{
-    SE_LineBuffer* geometry;
-    double weight;
-    unsigned int color;
-
-    SE_INLINE SE_RenderPolyline() { type = SE_PolylinePrimitive; }
-    ~SE_RenderPolyline() { if (geometry) geometry->Free(); }
-};
-
-struct SE_RenderPolygon : public SE_RenderPolyline
-{
-    unsigned int fill;
-
-    SE_INLINE SE_RenderPolygon() { type = SE_PolygonPrimitive; }
-    ~SE_RenderPolygon() {  }
-};
-
-struct SE_RenderText : public SE_RenderPrimitive
-{
-    std::wstring text;
-    double position[2];
-
-    RS_TextDef tdef;
-
-    SE_INLINE SE_RenderText() { type = SE_TextPrimitive; }
-};
-
-/* Caching, if any, is left to the implementor of SE_Renderer */
-struct SE_RenderRaster : public SE_RenderPrimitive
-{
-    const unsigned char* pngPtr;
-    int pngSize;
-    double position[2];
-    double extent[2];
-    double angle;
-
-    SE_INLINE SE_RenderRaster() : pngPtr(0), pngSize(0) { type = SE_RasterPrimitive; }
-};
-
-typedef std::vector<SE_Primitive*> SE_PrimitiveList;
-typedef std::vector<SE_RenderPrimitive*> SE_RenderPrimitiveList;
-
-//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-//
-//        SE_Styles
-//
-//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-struct SE_Style
-{
-    SE_StyleType type;
-    SE_PrimitiveList symbol;
-    SE_Integer renderPass;
-
-    bool useBox;
-    SE_Double resizePosition[2];
-    SE_Double resizeSize[2];
-    ResizeBox::GrowControl resize;
-
-    SE_INLINE SE_Style(SE_StyleType stype) : type(stype) { }
-
-    ~SE_Style()
-    {
-        for (SE_PrimitiveList::iterator iter = symbol.begin(); iter != symbol.end(); iter++)
-            delete *iter;
-    }
-};
-
-struct SE_PointStyle : public SE_Style
-{
-    SE_INLINE SE_PointStyle() : SE_Style(SE_PointStyleType) { }
-
-    SE_String angleControl;
-    SE_Double angle;
-    SE_Double originOffset[2];
-};
-
-struct SE_LineStyle : public SE_Style
-{
-    SE_INLINE SE_LineStyle() : SE_Style(SE_LineStyleType) { }
-
-    SE_String angleControl;
-    SE_String unitsControl;
-    SE_String vertexControl;
-//  SE_String join;
-
-    SE_Double angle;
-    SE_Double startOffset;
-    SE_Double endOffset;
-    SE_Double repeat;
-    SE_Double vertexAngleLimit;
-};
-
-struct SE_AreaStyle : public SE_Style
-{
-    SE_INLINE SE_AreaStyle() : SE_Style(SE_AreaStyleType) { }
-
-    SE_String angleControl;
-    SE_String originControl;
-    SE_String clippingControl;
-
-    SE_Double angle;
-    SE_Double origin[2];
-    SE_Double repeat[2];
-    SE_Double bufferWidth;
-};
-
-//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-//
-//        SE_RenderStyles
-//
-//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-struct SE_RenderStyle
-{
-    SE_INLINE SE_RenderStyle(SE_StyleType stype) 
-        : type(stype),
-          drawLast(false),
-          checkExclusionRegions(false),
-          addToExclusionRegions(false),
-          bounds(NULL)
-    { }
-
-    ~SE_RenderStyle()
-    {
-        for (SE_RenderPrimitiveList::iterator iter = symbol.begin(); iter != symbol.end(); iter++)
-        {
-            //necessary since destructor of SE_RenderPrimitive is not virtual
-            //we may want to figure out a better scheme to manage render primitives
-            switch ((*iter)->type)
-            {
-            case SE_PolylinePrimitive: delete (SE_RenderPolyline*)(*iter);break;
-            case SE_PolygonPrimitive: delete (SE_RenderPolygon*)(*iter);break;
-            case SE_RasterPrimitive: delete (SE_RenderRaster*)(*iter);break;
-            case SE_TextPrimitive: delete (SE_RenderText*)(*iter);break;
-            default: throw; //means there is a bug
-            }
-        }
-
-        if (bounds) bounds->Free();
-    }
-
-    SE_StyleType type;
-    SE_RenderPrimitiveList symbol;
-    SE_Bounds* bounds;
-
-    int renderPass;
-
-    bool drawLast;
-    bool checkExclusionRegions;
-    bool addToExclusionRegions;
-};
-
-struct SE_RenderPointStyle : public SE_RenderStyle
-{
-    SE_INLINE SE_RenderPointStyle() : SE_RenderStyle(SE_PointStyleType) { }
-};
-
-struct SE_RenderLineStyle : public SE_RenderStyle
-{
-    SE_INLINE SE_RenderLineStyle() : SE_RenderStyle(SE_LineStyleType) { }
-
-    const wchar_t* angleControl;
-    const wchar_t* unitsControl;
-    const wchar_t* vertexControl;
-//  const wchar_t* join;
-
-    double angle;
-    double startOffset;
-    double endOffset;
-    double repeat;
-    double vertexAngleLimit;
-};
-
-struct SE_RenderAreaStyle : public SE_RenderStyle
-{
-    SE_INLINE SE_RenderAreaStyle() : SE_RenderStyle(SE_AreaStyleType) { }
-
-    const wchar_t* angleControl;
-    const wchar_t* originControl;
-    const wchar_t* clippingControl;
-
-    double angle;
-    double origin[2];
-    double repeat[2];
-    double bufferWidth;
-};
-
-
-class SE_LabelInfo
-{
-public:
-    SE_RenderStyle* symbol;
-    double x;
-    double y;
-    double dx;
-    double dy;
-    double anglerad;
-    RS_Units dunits;    
-    
-    SE_INLINE SE_LabelInfo() :
-        x(0.0),
-        y(0.0),
-        dx(0.0),
-        dy(0.0),
-        anglerad(0.0),
-        symbol(NULL)
-    { }
-
-    SE_INLINE SE_LabelInfo (double _x, double _y, double _dx, double _dy, RS_Units _dunits, double _anglerad, SE_RenderStyle* _symbol)
-                 : x(_x), y(_y), dx(_dx), dy(_dy), dunits(_dunits), anglerad(_anglerad), symbol(_symbol)
-    { }
-};
-
-
-struct SE_Symbolization
-{
-    std::vector<SE_Style*> styles;
-
-    SE_Double scale[2];
-    SE_Double absOffset[2];
-    MdfModel::SizeContext context;
-    SE_Boolean drawLast;
-    SE_Boolean checkExclusionRegions;
-    SE_Boolean addToExclusionRegions;
-    std::wstring positioningAlgorithm;
-
-    ~SE_Symbolization()
-    {
-        for (std::vector<SE_Style*>::iterator iter = styles.begin(); iter != styles.end(); iter++)
-            //TODO: SE_Styles have no virtual destructor but they don't seem to need
-            //to free stuff specific to the derived classes
-            delete *iter;
-
-        styles.clear();
-    }
-};
-
-struct SE_Rule
-{
-    std::vector<SE_Symbolization*> symbolization;
-    RS_String legendLabel;  // no expressions on this guy
-    FdoFilter* filter;
-    
-    ~SE_Rule()
-    {
-        if (filter) filter->Release();
-
-        for (std::vector<SE_Symbolization*>::iterator iter = symbolization.begin(); iter != symbolization.end(); iter++)
-            delete *iter;
-
-        symbolization.clear();
-    }
-};
-
-
-#endif // SE_INCLUDE_H
+#define SE_INCLUDE_H
\ No newline at end of file

Modified: trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp	2007-03-16 15:06:30 UTC (rev 1252)
+++ trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp	2007-03-16 16:49:15 UTC (rev 1253)
@@ -582,7 +582,7 @@
                     c2x = ex + cw*alpha*rx*esin;
                     c2y = ey - cw*alpha*ry*ecos;
 
-                    /* Here, we fine the maximum 2nd derivative over the interval in question, and
+                    /* Here, we find the maximum 2nd derivative over the interval in question, and
                        calculate the number of segments, assuming a deviation of the segment length *
                        the second derivative must be within the tolerance */
                     double mx, my;

Modified: trunk/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp	2007-03-16 15:06:30 UTC (rev 1252)
+++ trunk/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp	2007-03-16 16:49:15 UTC (rev 1253)
@@ -1,6 +1,6 @@
 
 #include "stdafx.h"
-#include "SE_Include.h"
+#include "SE_RenderProxies.h"
 #include "SE_PositioningAlgorithms.h"
 #include "SE_Renderer.h"
 #include "Renderer.h"
@@ -107,7 +107,7 @@
     
     for (SE_RenderPrimitiveList::iterator iter = rstyle->symbol.begin(); iter != rstyle->symbol.end(); iter++)
     {
-        if ((*iter)->type == SE_TextPrimitive)
+        if ((*iter)->type == SE_RenderTextPrimitive)
         {
             SE_RenderText* rt = (SE_RenderText*)(*iter);
 

Modified: trunk/MgDev/Common/Stylization/SE_Renderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Renderer.cpp	2007-03-16 15:06:30 UTC (rev 1252)
+++ trunk/MgDev/Common/Stylization/SE_Renderer.cpp	2007-03-16 16:49:15 UTC (rev 1253)
@@ -32,13 +32,13 @@
     //style specific properties
     switch (symbol->type)
     {
-    case SE_PointStyleType:
+    case SE_RenderPointStyleType:
         {
         SE_RenderPointStyle* dps = new SE_RenderPointStyle();
         ret = dps;
         }
         break;
-    case SE_LineStyleType:
+    case SE_RenderLineStyleType:
         {
             SE_RenderLineStyle* dls = new SE_RenderLineStyle();
             SE_RenderLineStyle* sls = (SE_RenderLineStyle*)symbol;
@@ -53,7 +53,7 @@
             dls->vertexControl = sls->vertexControl;
         }
         break;
-    case SE_AreaStyleType:
+    case SE_RenderAreaStyleType:
         {
             SE_RenderAreaStyle* das = new SE_RenderAreaStyle();
             SE_RenderAreaStyle* sas = (SE_RenderAreaStyle*)symbol;
@@ -87,10 +87,10 @@
 
         switch (rp->type)
         {
-        case SE_PolygonPrimitive:
+        case SE_RenderPolygonPrimitive:
             rpc = new SE_RenderPolygon();
             ((SE_RenderPolygon*)rpc)->fill = ((SE_RenderPolygon*)rp)->fill;
-        case SE_PolylinePrimitive:
+        case SE_RenderPolylinePrimitive:
             {
                 if (!rpc) rpc = new SE_RenderPolyline();
                 SE_RenderPolyline* drp = (SE_RenderPolyline*)rpc;
@@ -102,7 +102,7 @@
                 drp->geometry = srp->geometry->Clone();
             }
             break;
-        case SE_TextPrimitive:
+        case SE_RenderTextPrimitive:
             {
                 rpc = new SE_RenderText();
                 SE_RenderText* st = (SE_RenderText*)rp;
@@ -116,7 +116,7 @@
                 dt->text = st->text;
             }
             break;
-        case SE_RasterPrimitive:
+        case SE_RenderRasterPrimitive:
             {
                 rpc = new SE_RenderRaster();
                 SE_RenderRaster* sr = (SE_RenderRaster*)rp;
@@ -214,7 +214,7 @@
 
     //check if it is a single symbol that is not a label participant
     if (rs.size() == 1 
-        && rs[0]->type == SE_PolylinePrimitive 
+        && rs[0]->type == SE_RenderPolylinePrimitive 
         && !style->drawLast 
         && !style->addToExclusionRegions)
     {
@@ -339,7 +339,7 @@
     {
         SE_RenderPrimitive* primitive = symbol[i];
 
-        if (primitive->type == SE_PolygonPrimitive || primitive->type == SE_PolylinePrimitive)
+        if (primitive->type == SE_RenderPolygonPrimitive || primitive->type == SE_RenderPolylinePrimitive)
         {
             SE_RenderPolyline* pl = (SE_RenderPolyline*)primitive;
 
@@ -347,20 +347,20 @@
 
             if (m_bSelectionMode)
             {
-                if (primitive->type == SE_PolygonPrimitive)
+                if (primitive->type == SE_RenderPolygonPrimitive)
                     DrawScreenPolygon( geometry, &posxform, m_selFill);
 
                 DrawScreenPolyline( geometry, &posxform, m_selColor, m_selWeight );
             }
             else
             {
-                if (primitive->type == SE_PolygonPrimitive)
+                if (primitive->type == SE_RenderPolygonPrimitive)
                     DrawScreenPolygon( geometry, &posxform, ((SE_RenderPolygon*)primitive)->fill );
 
                 DrawScreenPolyline( geometry, &posxform, pl->color, pl->weight );
             }
         }
-        else if (primitive->type == SE_TextPrimitive)
+        else if (primitive->type == SE_RenderTextPrimitive)
         {
             SE_RenderText* tp = (SE_RenderText*)primitive;
 
@@ -389,7 +389,7 @@
                 DrawScreenText(tp->text, tp->tdef, x, y, NULL, 0, 0.0);
             }
         }
-        else if (primitive->type == SE_RasterPrimitive)
+        else if (primitive->type == SE_RenderRasterPrimitive)
         {
             SE_RenderRaster* rp = (SE_RenderRaster*)primitive;
 

Modified: trunk/MgDev/Common/Stylization/SE_Renderer.h
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Renderer.h	2007-03-16 15:06:30 UTC (rev 1252)
+++ trunk/MgDev/Common/Stylization/SE_Renderer.h	2007-03-16 16:49:15 UTC (rev 1253)
@@ -18,7 +18,7 @@
 #ifndef SE_RENDERER_H
 #define SE_RENDERER_H
 
-#include "SE_Include.h"
+#include "SE_RenderProxies.h"
 
 class RS_FontEngine;
 

Modified: trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp	2007-03-16 15:06:30 UTC (rev 1252)
+++ trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp	2007-03-16 16:49:15 UTC (rev 1253)
@@ -20,6 +20,7 @@
 #include "SE_StyleVisitor.h"
 #include "SE_SymbolManager.h"
 #include "SE_LineBuffer.h"
+#include "SE_SymbolDefProxies.h"
 
 #include <wctype.h>
 

Modified: trunk/MgDev/Common/Stylization/SE_StyleVisitor.h
===================================================================
--- trunk/MgDev/Common/Stylization/SE_StyleVisitor.h	2007-03-16 15:06:30 UTC (rev 1252)
+++ trunk/MgDev/Common/Stylization/SE_StyleVisitor.h	2007-03-16 16:49:15 UTC (rev 1253)
@@ -19,17 +19,11 @@
 #define SE_STYLEVISITOR_H
 
 #include "SE_ExpressionBase.h"
-#include "IGraphicElementVisitor.h"
-#include "ISymbolDefinitionVisitor.h"
+#include "SE_SymbolDefProxies.h"
 
 class SE_SymbolManager;
 class SE_LineBuffer;
 class SE_LineBufferPool;
-struct SE_Style;
-struct SE_RenderStyle;
-struct SE_Primitive;
-struct SE_RenderPrimitive;
-struct SE_Symbolization;
 struct SE_Matrix;
 
 namespace MDFMODEL_NAMESPACE
@@ -60,7 +54,6 @@
     void Convert(std::vector<SE_Symbolization*>& styles, MdfModel::CompositeSymbolization* symbolization);
 private:
     SE_Style* ParseSymbol(MdfModel::CompoundSymbolDefinition* symbol);
-    void ParseSymbol(SimpleSymbolDefinition* symbol, SE_Matrix& xform, SE_PrimitiveList* primitives, SE_RenderPrimitiveList* renderPrimitives);
     bool ParseDouble(const wchar_t*& str, double& val);
     bool ParseDoublePair(const wchar_t*& str, double& x, double& y);
     bool ParseGeometry(const MdfModel::MdfString& geometry, SE_LineBuffer& buffer);

Modified: trunk/MgDev/Common/Stylization/Stylization.h
===================================================================
--- trunk/MgDev/Common/Stylization/Stylization.h	2007-03-16 15:06:30 UTC (rev 1252)
+++ trunk/MgDev/Common/Stylization/Stylization.h	2007-03-16 16:49:15 UTC (rev 1253)
@@ -98,4 +98,6 @@
 #define RESTRICT __restrict__
 #endif
 
+#define SE_INLINE inline
+
 #endif

Modified: trunk/MgDev/Common/Stylization/Stylization.vcproj
===================================================================
--- trunk/MgDev/Common/Stylization/Stylization.vcproj	2007-03-16 15:06:30 UTC (rev 1252)
+++ trunk/MgDev/Common/Stylization/Stylization.vcproj	2007-03-16 16:49:15 UTC (rev 1253)
@@ -677,10 +677,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\SE_Include.h"
-				>
-			</File>
-			<File
 				RelativePath=".\SE_LineBuffer.cpp"
 				>
 			</File>
@@ -709,6 +705,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\SE_RenderProxies.h"
+				>
+			</File>
+			<File
 				RelativePath=".\SE_StyleVisitor.cpp"
 				>
 			</File>
@@ -717,6 +717,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\SE_SymbolDefProxies.h"
+				>
+			</File>
+			<File
 				RelativePath=".\SE_SymbolManager.h"
 				>
 			</File>

Modified: trunk/MgDev/Common/Stylization/StylizationEngine.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/StylizationEngine.cpp	2007-03-16 15:06:30 UTC (rev 1252)
+++ trunk/MgDev/Common/Stylization/StylizationEngine.cpp	2007-03-16 16:49:15 UTC (rev 1253)
@@ -28,6 +28,7 @@
 #include "FeatureTypeStyleVisitor.h"
 #include "LineBuffer.h"
 #include "Renderer.h"
+#include "SE_SymbolDefProxies.h"
 
 #include <algorithm>
 #include <functional>

Modified: trunk/MgDev/Common/Stylization/StylizationEngine.h
===================================================================
--- trunk/MgDev/Common/Stylization/StylizationEngine.h	2007-03-16 15:06:30 UTC (rev 1252)
+++ trunk/MgDev/Common/Stylization/StylizationEngine.h	2007-03-16 16:49:15 UTC (rev 1253)
@@ -20,7 +20,6 @@
 
 #include "Stylizer.h"
 #include "SE_Matrix.h"
-#include "SE_Include.h"
 
 class SE_SymbolManager;
 class RS_FeatureReader;
@@ -38,6 +37,17 @@
     class CompositeTypeStyle;
 }
 
+struct SE_Style;
+struct SE_PointStyle;
+struct SE_LineStyle;
+struct SE_AreaStyle;
+struct SE_Rule;
+struct SE_String;
+struct SE_RenderPointStyle;
+struct SE_RenderLineStyle;
+struct SE_RenderAreaStyle;
+struct SE_RenderStyle;
+
 using namespace MDFMODEL_NAMESPACE;
 
 class StylizationEngine



More information about the mapguide-commits mailing list