[mapguide-commits] r1163 - in trunk/MgDev/Common: MdfModel MdfParser Stylization

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Mar 7 00:23:04 EST 2007


Author: jasonnogar
Date: 2007-03-07 00:23:02 -0500 (Wed, 07 Mar 2007)
New Revision: 1163

Added:
   trunk/MgDev/Common/MdfModel/Usage.cpp
Modified:
   trunk/MgDev/Common/MdfModel/AreaUsage.cpp
   trunk/MgDev/Common/MdfModel/AreaUsage.h
   trunk/MgDev/Common/MdfModel/LineUsage.cpp
   trunk/MgDev/Common/MdfModel/LineUsage.h
   trunk/MgDev/Common/MdfModel/MdfModel.vcproj
   trunk/MgDev/Common/MdfModel/PointUsage.cpp
   trunk/MgDev/Common/MdfModel/PointUsage.h
   trunk/MgDev/Common/MdfModel/Usage.h
   trunk/MgDev/Common/MdfParser/IOAreaUsage.cpp
   trunk/MgDev/Common/MdfParser/IOLineUsage.cpp
   trunk/MgDev/Common/MdfParser/IOPointUsage.cpp
   trunk/MgDev/Common/Stylization/SE_Bounds.cpp
   trunk/MgDev/Common/Stylization/SE_Bounds.h
   trunk/MgDev/Common/Stylization/SE_ExpressionBase.cpp
   trunk/MgDev/Common/Stylization/SE_Include.h
   trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp
   trunk/MgDev/Common/Stylization/SE_LineBuffer.h
   trunk/MgDev/Common/Stylization/SE_Renderer.cpp
   trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp
   trunk/MgDev/Common/Stylization/StylizationEngine.cpp
Log:
MdfModel: Changed Usage enumerations to string properties (expressions).
MdfParser: Changed Usage enumerations to string properties

Stylization: 
* Updated StylizationEngine to use expressions for the enumerations in the Usage classes.
* Fixed arc tessellation in SE_LineBuffer (including the issue with the previous implementation where a circle would have a line through the center).
* Fixed ResizeBox computation.

Modified: trunk/MgDev/Common/MdfModel/AreaUsage.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/AreaUsage.cpp	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/MdfModel/AreaUsage.cpp	2007-03-07 05:23:02 UTC (rev 1163)
@@ -31,9 +31,6 @@
 {
     // NOTE: if you change any defaults then you must also update
     //       IOAreaUsage::Write to use the correct default values.
-    this->m_eOriginControl = Global;
-    this->m_eAngleControl = FromAngle;
-    this->m_eClippingControl = Clip;
 }
 
 //-------------------------------------------------------------------------
@@ -48,60 +45,42 @@
 // PURPOSE:
 // PARAMETERS:
 //-------------------------------------------------------------------------
-AreaUsage::OriginControl AreaUsage::GetOriginControl() const
+const MdfString& AreaUsage::GetOriginControl() const
 {
-    return this->m_eOriginControl;
+    return this->m_sOriginControl;
 }
 
 //-------------------------------------------------------------------------
 // PURPOSE:
 // PARAMETERS:
 //-------------------------------------------------------------------------
-void AreaUsage::SetOriginControl(const OriginControl originControl)
+void AreaUsage::SetOriginControl(const MdfString& originControl)
 {
-    this->m_eOriginControl = originControl;
+    this->m_sOriginControl = originControl;
 }
 
 //-------------------------------------------------------------------------
 // PURPOSE:
 // PARAMETERS:
 //-------------------------------------------------------------------------
-Usage::AngleControl AreaUsage::GetAngleControl() const
+const MdfString& AreaUsage::GetClippingControl() const
 {
-    return this->m_eAngleControl;
+    return this->m_sClippingControl;
 }
 
 //-------------------------------------------------------------------------
 // PURPOSE:
 // PARAMETERS:
 //-------------------------------------------------------------------------
-void AreaUsage::SetAngleControl(AngleControl angleControl)
+void AreaUsage::SetClippingControl(const MdfString& clippingControl)
 {
-    this->m_eAngleControl = angleControl;
+    this->m_sClippingControl = clippingControl;
 }
 
 //-------------------------------------------------------------------------
 // PURPOSE:
 // PARAMETERS:
 //-------------------------------------------------------------------------
-AreaUsage::ClippingControl AreaUsage::GetClippingControl() const
-{
-    return this->m_eClippingControl;
-}
-
-//-------------------------------------------------------------------------
-// PURPOSE:
-// PARAMETERS:
-//-------------------------------------------------------------------------
-void AreaUsage::SetClippingControl(const ClippingControl clippingControl)
-{
-    this->m_eClippingControl = clippingControl;
-}
-
-//-------------------------------------------------------------------------
-// PURPOSE:
-// PARAMETERS:
-//-------------------------------------------------------------------------
 const MdfString& AreaUsage::GetOriginX() const
 {
     return this->m_sOriginX;

Modified: trunk/MgDev/Common/MdfModel/AreaUsage.h
===================================================================
--- trunk/MgDev/Common/MdfModel/AreaUsage.h	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/MdfModel/AreaUsage.h	2007-03-07 05:23:02 UTC (rev 1163)
@@ -29,33 +29,16 @@
     class MDFMODEL_API AreaUsage : public Usage
     {
     public:
-        enum OriginControl
-        {
-            Global,
-            Local,
-            Centroid
-        };
-
-        enum ClippingControl
-        {
-            Clip,
-            Inside,
-            Overlap
-        };
-
         // Construction, destruction, initialization
         AreaUsage();
         virtual ~AreaUsage();
 
-        OriginControl GetOriginControl() const;
-        void SetOriginControl(OriginControl originControl);
+        const MdfString& GetOriginControl() const;
+        void SetOriginControl(const MdfString& originControl);
 
-        AngleControl GetAngleControl() const;
-        void SetAngleControl(AngleControl angleControl);
+        const MdfString& GetClippingControl() const;
+        void SetClippingControl(const MdfString& clippingControl);
 
-        ClippingControl GetClippingControl() const;
-        void SetClippingControl(ClippingControl clippingControl);
-
         const MdfString& GetOriginX() const;
         void SetOriginX(const MdfString& originX);
 
@@ -82,10 +65,8 @@
         AreaUsage& operator=(const AreaUsage&);
 
         // Data members
-        OriginControl m_eOriginControl;
-        AngleControl m_eAngleControl;
-        ClippingControl m_eClippingControl;
-
+        MdfString m_sOriginControl;
+        MdfString m_sClippingControl;
         MdfString m_sOriginX;
         MdfString m_sOriginY;
         MdfString m_sAngle;

Modified: trunk/MgDev/Common/MdfModel/LineUsage.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/LineUsage.cpp	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/MdfModel/LineUsage.cpp	2007-03-07 05:23:02 UTC (rev 1163)
@@ -32,9 +32,6 @@
 {
     // NOTE: if you change any defaults then you must also update
     //       IOLineUsage::Write to use the correct default values.
-    this->m_eAngleControl = FromAngle;
-    this->m_eUnitsControl = Absolute;
-    this->m_eVertexControl = OverlapWrap;
     this->m_pDefaultPath = NULL;
 }
 
@@ -52,60 +49,42 @@
 // PURPOSE:
 // PARAMETERS:
 //-------------------------------------------------------------------------
-Usage::AngleControl LineUsage::GetAngleControl() const
+const MdfString& LineUsage::GetUnitsControl() const
 {
-    return this->m_eAngleControl;
+    return this->m_sUnitsControl;
 }
 
 //-------------------------------------------------------------------------
 // PURPOSE:
 // PARAMETERS:
 //-------------------------------------------------------------------------
-void LineUsage::SetAngleControl(AngleControl angleControl)
+void LineUsage::SetUnitsControl(const MdfString& unitsControl)
 {
-    this->m_eAngleControl = angleControl;
+    this->m_sUnitsControl = unitsControl;
 }
 
 //-------------------------------------------------------------------------
 // PURPOSE:
 // PARAMETERS:
 //-------------------------------------------------------------------------
-LineUsage::UnitsControl LineUsage::GetUnitsControl() const
+const MdfString& LineUsage::GetVertexControl() const
 {
-    return this->m_eUnitsControl;
+    return this->m_sVertexControl;
 }
 
 //-------------------------------------------------------------------------
 // PURPOSE:
 // PARAMETERS:
 //-------------------------------------------------------------------------
-void LineUsage::SetUnitsControl(UnitsControl unitsControl)
+void LineUsage::SetVertexControl(const MdfString& vertexControl)
 {
-    this->m_eUnitsControl = unitsControl;
+    this->m_sVertexControl = vertexControl;
 }
 
 //-------------------------------------------------------------------------
 // PURPOSE:
 // PARAMETERS:
 //-------------------------------------------------------------------------
-LineUsage::VertexControl LineUsage::GetVertexControl() const
-{
-    return this->m_eVertexControl;
-}
-
-//-------------------------------------------------------------------------
-// PURPOSE:
-// PARAMETERS:
-//-------------------------------------------------------------------------
-void LineUsage::SetVertexControl(VertexControl vertexControl)
-{
-    this->m_eVertexControl = vertexControl;
-}
-
-//-------------------------------------------------------------------------
-// PURPOSE:
-// PARAMETERS:
-//-------------------------------------------------------------------------
 const MdfString& LineUsage::GetAngle() const
 {
     return this->m_sAngle;

Modified: trunk/MgDev/Common/MdfModel/LineUsage.h
===================================================================
--- trunk/MgDev/Common/MdfModel/LineUsage.h	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/MdfModel/LineUsage.h	2007-03-07 05:23:02 UTC (rev 1163)
@@ -30,33 +30,17 @@
     class MDFMODEL_API LineUsage : public Usage
     {
     public:
-        enum UnitsControl
-        {
-            Absolute,
-            Parametric
-        };
 
-        enum VertexControl
-        {
-            NoOverlap,
-            OverlapDirect,
-            OverlapNoWrap,
-            OverlapWrap
-        };
-
         // Construction, destruction, initialization
         LineUsage();
         virtual ~LineUsage();
 
-        AngleControl GetAngleControl() const;
-        void SetAngleControl(AngleControl angleControl);
+        const MdfString& GetUnitsControl() const;
+        void SetUnitsControl(const MdfString& unitsControl);
 
-        UnitsControl GetUnitsControl() const;
-        void SetUnitsControl(UnitsControl unitsControl);
+        const MdfString& GetVertexControl() const;
+        void SetVertexControl(const MdfString& vertexControl);
 
-        VertexControl GetVertexControl() const;
-        void SetVertexControl(VertexControl vertexControl);
-
         const MdfString& GetAngle() const;
         void SetAngle(const MdfString& angle);
 
@@ -84,10 +68,8 @@
         LineUsage& operator=(const LineUsage&);
 
         // Data members
-        AngleControl m_eAngleControl;
-        UnitsControl m_eUnitsControl;
-        VertexControl m_eVertexControl;
-
+        MdfString m_sUnitsControl;
+        MdfString m_sVertexControl;
         MdfString m_sAngle;
         MdfString m_sStartOffset;
         MdfString m_sEndOffset;

Modified: trunk/MgDev/Common/MdfModel/MdfModel.vcproj
===================================================================
--- trunk/MgDev/Common/MdfModel/MdfModel.vcproj	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/MdfModel/MdfModel.vcproj	2007-03-07 05:23:02 UTC (rev 1163)
@@ -327,6 +327,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\Usage.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\Usage.h"
 				>
 			</File>

Modified: trunk/MgDev/Common/MdfModel/PointUsage.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/PointUsage.cpp	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/MdfModel/PointUsage.cpp	2007-03-07 05:23:02 UTC (rev 1163)
@@ -31,7 +31,6 @@
 {
     // NOTE: if you change any defaults then you must also update
     //       IOPointUsage::Write to use the correct default values.
-    this->m_eAngleControl = FromAngle;
 }
 
 //-------------------------------------------------------------------------
@@ -46,24 +45,6 @@
 // PURPOSE:
 // PARAMETERS:
 //-------------------------------------------------------------------------
-Usage::AngleControl PointUsage::GetAngleControl() const
-{
-    return this->m_eAngleControl;
-}
-
-//-------------------------------------------------------------------------
-// PURPOSE:
-// PARAMETERS:
-//-------------------------------------------------------------------------
-void PointUsage::SetAngleControl(AngleControl angleControl)
-{
-    this->m_eAngleControl = angleControl;
-}
-
-//-------------------------------------------------------------------------
-// PURPOSE:
-// PARAMETERS:
-//-------------------------------------------------------------------------
 const MdfString& PointUsage::GetAngle() const
 {
     return this->m_sAngle;

Modified: trunk/MgDev/Common/MdfModel/PointUsage.h
===================================================================
--- trunk/MgDev/Common/MdfModel/PointUsage.h	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/MdfModel/PointUsage.h	2007-03-07 05:23:02 UTC (rev 1163)
@@ -33,9 +33,6 @@
         PointUsage();
         virtual ~PointUsage();
 
-        AngleControl GetAngleControl() const;
-        void SetAngleControl(AngleControl angleControl);
-
         const MdfString& GetAngle() const;
         void SetAngle(const MdfString& angle);
 
@@ -53,7 +50,6 @@
         PointUsage& operator=(const PointUsage&);
 
         // Data members
-        AngleControl m_eAngleControl;
         MdfString m_sAngle;
         MdfString m_sOriginOffsetX;
         MdfString m_sOriginOffsetY;

Added: trunk/MgDev/Common/MdfModel/Usage.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/Usage.cpp	                        (rev 0)
+++ trunk/MgDev/Common/MdfModel/Usage.cpp	2007-03-07 05:23:02 UTC (rev 1163)
@@ -0,0 +1,54 @@
+//
+//  Copyright (C) 2007 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#include "Usage.h"
+
+using namespace MDFMODEL_NAMESPACE;
+
+//-------------------------------------------------------------------------
+// PURPOSE:
+// PARAMETERS:
+//-------------------------------------------------------------------------
+Usage::Usage()
+{
+}
+
+//-------------------------------------------------------------------------
+// PURPOSE:
+// PARAMETERS:
+//-------------------------------------------------------------------------
+Usage::~Usage()
+{
+}
+
+//-------------------------------------------------------------------------
+// PURPOSE:
+// PARAMETERS:
+//-------------------------------------------------------------------------
+const MdfString& Usage::GetAngleControl() const
+{
+    return m_sAngleControl;
+}
+
+//-------------------------------------------------------------------------
+// PURPOSE:
+// PARAMETERS:
+//-------------------------------------------------------------------------
+void Usage::SetAngleControl(const MdfString& sControl)
+{
+    m_sAngleControl = sControl;
+}

Modified: trunk/MgDev/Common/MdfModel/Usage.h
===================================================================
--- trunk/MgDev/Common/MdfModel/Usage.h	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/MdfModel/Usage.h	2007-03-07 05:23:02 UTC (rev 1163)
@@ -30,26 +30,21 @@
     class MDFMODEL_API Usage : public MdfRootObject
     {
     public:
-        enum AngleControl
-        {
-            FromAngle,
-            FromGeometry
-        };
-
         // Destruction
-        virtual ~Usage()
-        {
-        }
+        virtual ~Usage();
 
+        const MdfString& GetAngleControl() const;
+        void SetAngleControl(const MdfString& sControl);
+
         // Visitor Pattern method defined in Usage.
         virtual void AcceptVisitor(IUsageVisitor& iuVisitor) = 0;
 
     protected:
         // Construction, initialization
         // Default constructor is protected to make this class abstract.
-        Usage()
-        {
-        }
+        Usage();
+
+        MdfString m_sAngleControl;
     };
 
 END_NAMESPACE_MDFMODEL

Modified: trunk/MgDev/Common/MdfParser/IOAreaUsage.cpp
===================================================================
--- trunk/MgDev/Common/MdfParser/IOAreaUsage.cpp	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/MdfParser/IOAreaUsage.cpp	2007-03-07 05:23:02 UTC (rev 1163)
@@ -40,9 +40,9 @@
 
 void IOAreaUsage::ElementChars(const wchar_t *ch)
 {
-         IF_ENUM_2(m_currElemName, this->_areaUsage, AreaUsage, OriginControl, ch, Global, Centroid)
-    else IF_ENUM_2(m_currElemName, this->_areaUsage, Usage, AngleControl, ch, FromAngle, FromGeometry)
-    else IF_ENUM_2(m_currElemName, this->_areaUsage, AreaUsage, ClippingControl, ch, Clip, Overlap)
+         IF_STRING_PROPERTY(m_currElemName, this->_areaUsage, OriginControl, ch)
+    else IF_STRING_PROPERTY(m_currElemName, this->_areaUsage, AngleControl, ch)
+    else IF_STRING_PROPERTY(m_currElemName, this->_areaUsage, ClippingControl, ch)
     else IF_STRING_PROPERTY(m_currElemName, this->_areaUsage, OriginX, ch)
     else IF_STRING_PROPERTY(m_currElemName, this->_areaUsage, OriginY, ch)
     else IF_STRING_PROPERTY(m_currElemName, this->_areaUsage, Angle, ch)
@@ -69,9 +69,9 @@
     fd << tab() << "<AreaUsage>" << std::endl; // NOXLATE
     inctab();
 
-    EMIT_ENUM_2(fd, usage, AreaUsage, OriginControl, Global, Centroid, 1)   // Global is default
-    EMIT_ENUM_2(fd, usage, Usage, AngleControl, FromAngle, FromGeometry, 1) // FromAngle is default
-    EMIT_ENUM_2(fd, usage, AreaUsage, ClippingControl, Clip, Overlap, 1)    // Clip is default
+    EMIT_STRING_PROPERTY(fd, usage, OriginControl, true);
+    EMIT_STRING_PROPERTY(fd, usage, AngleControl, true);
+    EMIT_STRING_PROPERTY(fd, usage, ClippingControl, true);
     EMIT_STRING_PROPERTY(fd, usage, OriginX, true)
     EMIT_STRING_PROPERTY(fd, usage, OriginY, true)
     EMIT_STRING_PROPERTY(fd, usage, Angle, true)

Modified: trunk/MgDev/Common/MdfParser/IOLineUsage.cpp
===================================================================
--- trunk/MgDev/Common/MdfParser/IOLineUsage.cpp	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/MdfParser/IOLineUsage.cpp	2007-03-07 05:23:02 UTC (rev 1163)
@@ -49,9 +49,9 @@
 
 void IOLineUsage::ElementChars(const wchar_t *ch)
 {
-         IF_ENUM_2(m_currElemName, this->_lineUsage, Usage, AngleControl, ch, FromAngle, FromGeometry)
-    else IF_ENUM_2(m_currElemName, this->_lineUsage, LineUsage, UnitsControl, ch, Absolute, Parametric)
-    else IF_ENUM_4(m_currElemName, this->_lineUsage, LineUsage, VertexControl, ch, NoOverlap, OverlapDirect, OverlapNoWrap, OverlapWrap)
+         IF_STRING_PROPERTY(m_currElemName, this->_lineUsage, AngleControl, ch)
+    else IF_STRING_PROPERTY(m_currElemName, this->_lineUsage, UnitsControl, ch)
+    else IF_STRING_PROPERTY(m_currElemName, this->_lineUsage, VertexControl, ch)
     else IF_STRING_PROPERTY(m_currElemName, this->_lineUsage, Angle, ch)
     else IF_STRING_PROPERTY(m_currElemName, this->_lineUsage, StartOffset, ch)
     else IF_STRING_PROPERTY(m_currElemName, this->_lineUsage, EndOffset, ch)
@@ -77,9 +77,9 @@
     fd << tab() << "<LineUsage>" << std::endl; // NOXLATE
     inctab();
 
-    EMIT_ENUM_2(fd, lineUsage, Usage, AngleControl, FromAngle, FromGeometry, 1)  // FromAngle is default
-    EMIT_ENUM_2(fd, lineUsage, LineUsage, UnitsControl, Absolute, Parametric, 1) // Absolute is default
-    EMIT_ENUM_4(fd, lineUsage, LineUsage, VertexControl, NoOverlap, OverlapDirect, OverlapNoWrap, OverlapWrap, 4) // OverlapWrap is default
+    EMIT_STRING_PROPERTY(fd, lineUsage, AngleControl, true)
+    EMIT_STRING_PROPERTY(fd, lineUsage, UnitsControl, true)
+    EMIT_STRING_PROPERTY(fd, lineUsage, VertexControl, true)
     EMIT_STRING_PROPERTY(fd, lineUsage, Angle, true)
     EMIT_STRING_PROPERTY(fd, lineUsage, StartOffset, true)
     EMIT_STRING_PROPERTY(fd, lineUsage, EndOffset, true)

Modified: trunk/MgDev/Common/MdfParser/IOPointUsage.cpp
===================================================================
--- trunk/MgDev/Common/MdfParser/IOPointUsage.cpp	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/MdfParser/IOPointUsage.cpp	2007-03-07 05:23:02 UTC (rev 1163)
@@ -40,7 +40,7 @@
 
 void IOPointUsage::ElementChars(const wchar_t *ch)
 {
-         IF_ENUM_2(m_currElemName, this->_pointUsage, Usage, AngleControl, ch, FromAngle, FromGeometry)
+         IF_STRING_PROPERTY(m_currElemName, this->_pointUsage, AngleControl, ch)
     else IF_STRING_PROPERTY(m_currElemName, this->_pointUsage, Angle, ch)
     else IF_STRING_PROPERTY(m_currElemName, this->_pointUsage, OriginOffsetX, ch)
     else IF_STRING_PROPERTY(m_currElemName, this->_pointUsage, OriginOffsetY, ch)
@@ -64,7 +64,7 @@
     fd << tab() << "<PointUsage>" << std::endl; // NOXLATE
     inctab();
 
-    EMIT_ENUM_2(fd, pointUsage, Usage, AngleControl, FromAngle, FromGeometry, 1)    // FromAngle is default
+    EMIT_STRING_PROPERTY(fd, pointUsage, AngleControl, true)
     EMIT_STRING_PROPERTY(fd, pointUsage, Angle, true)
     EMIT_STRING_PROPERTY(fd, pointUsage, OriginOffsetX, true)
     EMIT_STRING_PROPERTY(fd, pointUsage, OriginOffsetY, true)

Modified: trunk/MgDev/Common/Stylization/SE_Bounds.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Bounds.cpp	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/Stylization/SE_Bounds.cpp	2007-03-07 05:23:02 UTC (rev 1163)
@@ -1,5 +1,5 @@
 //
-//  Copyright (C) 2007 by Autodesk, Inc.
+//  Copyright (C) 2007 Autodesk, Inc.
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of version 2.1 of the GNU Lesser
@@ -20,6 +20,14 @@
 #include "SE_ConvexHull.h"
 #include <float.h>
 
+SE_Bounds::SE_Bounds()
+{
+}
+
+SE_Bounds::~SE_Bounds()
+{
+}
+
 void SE_Bounds::Add(double x, double y)
 {
     if (size >= capacity)
@@ -43,7 +51,7 @@
 {
     double *last = hull + 2*size;
     double *cur = hull;
-
+    
     while (cur < last)
         xform.transform(*cur++, *cur++);
 }
@@ -93,25 +101,36 @@
 void SE_Bounds::Contained(double minx, double miny, double maxx, double maxy, double &growx, double &growy)
 {
     double sx, sy;
-
-    if (min[0] < minx)
+    double cx = (minx + maxx)/2.0;
+    double cy = (miny + maxy)/2.0;
+    minx -= cx;
+    maxx -= cx;
+    miny -= cy;
+    maxy -= cy;
+    double xfminx, xfminy, xfmaxx, xfmaxy;
+    xfminx = min[0] - cx;
+    xfminy = min[1] - cy;
+    xfmaxx = max[0] - cx;
+    xfmaxy = max[1] - cy;
+    
+    if (xfminx < minx) // minx always negative
     {
-        sx = (minx - min[0])/(maxx - minx);
+        sx = xfminx/minx - 1.0;
         growx = (growx > sx) ? growx : sx;
     }
-    if (max[0] > maxx)
+    if (xfmaxx > maxx) // maxx always positive
     {
-        sx = (max[0] - maxx)/(maxx - minx);
+        sx = xfmaxx/maxx - 1.0;
         growx = (growx > sx) ? growx : sx;
     }
-    if (min[1] < miny)
+    if (xfminy < miny)
     {
-        sy = (miny - min[1])/(maxy - miny);
+        sy = xfminy/miny - 1.0;
         growy = (growy > sy) ? growy : sy;
     }
-    if (max[1] < maxy)
+    if (xfmaxy > maxy)
     {
-        sy = (max[1] - maxy)/(maxy - miny);
+        sy = xfmaxy/maxy - 1.0;
         growy = (growy > sy) ? growy : sy;
     }
 }
@@ -127,7 +146,7 @@
         vec = new double[2*usize];
     else
         vec = (double*)alloca(sizeof(double)*2*usize);
-
+        
     double* start[4] = {hull, hull + 2*size - 2, bounds->hull, bounds->hull + 2*bounds->size - 2};
     double* end[4] = {hull + 2*pivot, hull + 2*pivot - 2, bounds->hull + 2*bounds->pivot, bounds->hull + 2*bounds->pivot - 2};
 
@@ -169,10 +188,10 @@
     double* last = vec + pnts - 2;
     double* first = vec;
 
-    SE_Bounds* ubounds = AndrewHull<SimplePoint*, SimplePointUtil>((SimplePoint*)first, (SimplePoint*)last, pnts/2, pool);
+    SE_Bounds* ubounds = AndrewHull<SimplePoint*, SimplePointUtil>((SimplePoint*)first, (SimplePoint*)last, pnts/2, pool);    
 
     if (usize > 4096)
         delete[] vec;
 
     return ubounds;
-}
+}
\ No newline at end of file

Modified: trunk/MgDev/Common/Stylization/SE_Bounds.h
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Bounds.h	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/Stylization/SE_Bounds.h	2007-03-07 05:23:02 UTC (rev 1163)
@@ -1,5 +1,5 @@
 //
-//  Copyright (C) 2007 by Autodesk, Inc.
+//  Copyright (C) 2007 Autodesk, Inc.
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of version 2.1 of the GNU Lesser
@@ -27,6 +27,7 @@
 friend class SE_LineBufferPool;
 private:
     SE_Bounds();
+    ~SE_Bounds();
     int capacity;
     SE_LineBufferPool* pool;
 
@@ -46,4 +47,4 @@
     STYLIZATION_API SE_Bounds* Union(SE_Bounds* bounds);
 };
 
-#endif // SE_BOUNDS_H
+#endif // SE_BOUNDS_H
\ No newline at end of file

Modified: trunk/MgDev/Common/Stylization/SE_ExpressionBase.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_ExpressionBase.cpp	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/Stylization/SE_ExpressionBase.cpp	2007-03-07 05:23:02 UTC (rev 1163)
@@ -196,7 +196,33 @@
         val.value = L"";
     }
     else
-        val.expression = FdoExpression::Parse(m_buffer.c_str());
+    {
+        const wchar_t* str = m_buffer.c_str();
+        while (isspace(*str)) 
+            str++;
+        if (*str++ != '\'')
+        {
+            val.expression = FdoExpression::Parse(m_buffer.c_str());
+            return;
+        }
+
+        const wchar_t* begin = str;
+
+        while(*str != NULL && *str != '\'')
+            str++;
+
+        if (*str == NULL)
+        {
+            val.expression = FdoExpression::Parse(m_buffer.c_str());
+            return;
+        }
+
+        size_t len = str - begin;
+        wchar_t* copy = new wchar_t[len + 1];
+        memcpy(copy, begin, sizeof(wchar_t)*len);
+        copy[len] = L'\0';
+        val.value = copy;
+    }
 }
 
 void SE_ExpressionBase::ParseColorExpression(const MdfModel::MdfString& exprstr, SE_Color& val)

Modified: trunk/MgDev/Common/Stylization/SE_Include.h
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Include.h	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/Stylization/SE_Include.h	2007-03-07 05:23:02 UTC (rev 1163)
@@ -60,7 +60,7 @@
             expression->Process(processor);
             *((unsigned int*)this) = (unsigned int)processor->GetInt64Result();
         }
-
+        
         return *((unsigned int*)this);
     }
 
@@ -145,12 +145,20 @@
 
     SE_INLINE SE_String() : expression(NULL), value(NULL) { }
     SE_INLINE SE_String(const wchar_t* s) : value(s), expression(NULL) { }
-    ~SE_String() { if (expression) expression->Release(); }
+    ~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;
             expression->Process(processor);
             value = processor->GetStringResult();
         }
@@ -187,7 +195,7 @@
 {
     SE_Color fill;
 
-    SE_INLINE SE_Polygon() { type = SE_PolygonPrimitive; weight = 0.0; }
+    SE_INLINE SE_Polygon() { type = SE_PolygonPrimitive; weight = 0.0; } 
 };
 
 /* Font/properties caching is left to the implementor of SE_Renderer */
@@ -223,6 +231,7 @@
     SE_INLINE SE_Raster() { type = SE_RasterPrimitive; }
 };
 
+
 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 //
 //        SE_RenderPrimitives
@@ -307,7 +316,7 @@
 {
     SE_INLINE SE_PointStyle() : SE_Style(SE_PointStyleType) { }
 
-    Usage::AngleControl orientation;
+    SE_String orientation;
     SE_Double angle;
     SE_Double offset[2];
 };
@@ -316,10 +325,10 @@
 {
     SE_INLINE SE_LineStyle() : SE_Style(SE_LineStyleType) { }
 
-    Usage::AngleControl orientation;
-    LineUsage::UnitsControl units;
-    LineUsage::VertexControl overlap;
-    Path::LineJoin join;
+    SE_String orientation;
+    SE_String units;
+    SE_String overlap;
+    SE_String join;
 
     SE_Double startOffset;
     SE_Double endOffset;
@@ -332,9 +341,9 @@
 {
     SE_INLINE SE_AreaStyle() : SE_Style(SE_AreaStyleType) { }
 
-    Usage::AngleControl orientation;
-    AreaUsage::OriginControl origincontrol;
-    AreaUsage::ClippingControl clipping;
+    SE_String orientation;
+    SE_String origincontrol;
+    SE_String clipping;
 
     SE_Double origin[2];
     SE_Double repeat[2];
@@ -350,7 +359,7 @@
 
 struct SE_RenderStyle
 {
-    SE_INLINE SE_RenderStyle(SE_StyleType stype)
+    SE_INLINE SE_RenderStyle(SE_StyleType stype) 
         : type(stype),
           drawLast(false),
           checkExclusionRegions(false),
@@ -384,10 +393,10 @@
 {
     SE_INLINE SE_RenderLineStyle() : SE_RenderStyle(SE_LineStyleType) { }
 
-    Usage::AngleControl orientation;
-    LineUsage::UnitsControl units;
-    LineUsage::VertexControl overlap;
-    Path::LineJoin join;
+    const wchar_t* orientation;
+    const wchar_t* units;
+    const wchar_t* overlap;
+    const wchar_t* join;
 
     double startOffset;
     double endOffset;
@@ -400,9 +409,9 @@
 {
     SE_INLINE SE_RenderAreaStyle() : SE_RenderStyle(SE_AreaStyleType) { }
 
-    AreaUsage::OriginControl origincontrol;
-    AreaUsage::AngleControl orientation;
-    AreaUsage::ClippingControl clipping;
+    const wchar_t* origincontrol;
+    const wchar_t* orientation;
+    const wchar_t* clipping;
 
     unsigned int background;
     double origin[2];
@@ -421,8 +430,8 @@
     double dx;
     double dy;
     double anglerad;
-    RS_Units dunits;
-
+    RS_Units dunits;    
+    
     SE_INLINE SE_LabelInfo() :
         x(0.0),
         y(0.0),
@@ -463,7 +472,7 @@
 {
     std::vector<SE_Symbolization*> symbolization;
     FdoFilter* filter;
-
+    
     ~SE_Rule()
     {
         if (filter) filter->Release();
@@ -475,4 +484,5 @@
     }
 };
 
+
 #endif // SE_INCLUDE_H

Modified: trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp	2007-03-07 05:23:02 UTC (rev 1163)
@@ -1,5 +1,5 @@
 //
-//  Copyright (C) 2007 by Autodesk, Inc.
+//  Copyright (C) 2007 Autodesk, Inc.
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of version 2.1 of the GNU Lesser
@@ -27,7 +27,7 @@
 
 #define ENSURE_POINT_BUFFER(points) \
     if ((m_npts + (points)) > m_max_pts) \
-        ResizeBuffer((void**)&m_pts, 2*sizeof(double), (points), m_npts, m_max_pts);
+        ResizeBuffer((void**)&m_pts, sizeof(double), (points), m_npts, m_max_pts);
 
 #define ENSURE_XF_POINT_BUFFER(points) \
     if ((m_xf_npts + (points)) > m_max_xf_pts) \
@@ -165,7 +165,7 @@
                however, appear to be using round joins at the moment. */
             m_ch_ptbuf.insert(std::pair<double,double>(x + vx, y + vy));
             m_ch_ptbuf.insert(std::pair<double,double>(x - vx, y - vy));
-            m_ch_ptbuf.insert(std::pair<double,double>(lx + vx, ly + vy));
+            m_ch_ptbuf.insert(std::pair<double,double>(lx + vx, ly + vy));        
             m_ch_ptbuf.insert(std::pair<double,double>(lx - vx, ly - vy));
 
             while(cur < last)
@@ -211,7 +211,7 @@
     m_max_inst_pts(size),
     m_max_xf_cntrs(size),
     m_max_inst_cntrs(size),
-    m_max_pts(size),
+    m_max_pts(2*size),
     m_max_segs(size),
     m_xf_tol(-1.0),
     m_xf_weight(-1.0),
@@ -239,28 +239,33 @@
 
 void SE_LineBuffer::MoveTo(double x, double y)
 {
-    ENSURE_POINT_BUFFER(1);
+    ENSURE_POINT_BUFFER(2);
     ENSURE_SEG_BUFFER(1);
 
-    double* cur_pt = m_pts + 2*m_npts++;
+    double* cur_pt = m_pts + m_npts;
     *cur_pt++ = x;
     *cur_pt = y;
 
-    m_start[0] = x;
-    m_start[1] = y;
+    m_start[0] = m_last[0] = x;
+    m_start[1] = m_last[1] = y;
 
+    m_npts += 2;
     m_segs[m_nsegs++] = SegType_MoveTo;
 }
 
 void SE_LineBuffer::LineTo(double x, double y)
 {
-    ENSURE_POINT_BUFFER(1);
+    ENSURE_POINT_BUFFER(2);
     ENSURE_SEG_BUFFER(1);
 
-    double* cur_pt = m_pts + 2*m_npts++;
+    double* cur_pt = m_pts + m_npts;
     *cur_pt++ = x;
     *cur_pt = y;
 
+    m_last[0] = x;
+    m_last[1] = y;
+
+    m_npts += 2;
     m_segs[m_nsegs++] = SegType_LineTo;
 }
 
@@ -269,7 +274,47 @@
     ENSURE_POINT_BUFFER(7);
     ENSURE_SEG_BUFFER(1);
 
-    double* cur_pt = m_pts + 2*m_npts;
+    double* cur_pt = m_pts + m_npts;
+    double sx, sy, ex, ey, dsx, dsy, dex, dey;
+
+    sx = cx + rx*cos(sAng);
+    sy = cy + ry*sin(sAng);
+    ex = cx + rx*cos(eAng);
+    ey = cy + ry*sin(eAng);
+
+    if (rotation != 0)
+    {
+        double rs = sin(rotation);
+        double rc = cos(rotation);
+        double tx, ty;
+        tx = sx; ty = sy;
+        sx = rc*sx + rs*sy;
+        sy = rc*sy - rs*sx;
+        tx = ex; ty = ey;
+        ex = rc*ex + rs*ey;
+        ey = rc*ey - rs*ex;
+    }
+
+    dsx = m_last[0] - sx;
+    dsy = m_last[1] - sy;
+    dex = m_last[0] - ex;
+    dey = m_last[1] - ey;
+
+    /* End angle is actually the current line position */
+    if (dsx*dsx + dsy*dsy > dex*dex + dey*dey)
+    {
+        double t = sAng;
+        sAng = eAng;
+        eAng = t;
+        m_last[0] = sx;
+        m_last[1] = sy;
+    }
+    else
+    {
+        m_last[0] = ex;
+        m_last[1] = ey;
+    }
+
     *cur_pt++ = cx;
     *cur_pt++ = cy;
     *cur_pt++ = rx;
@@ -310,7 +355,7 @@
     int max_newpts = (int)(max_pts*GROWTH_FACTOR) + 1;
     if (max_newpts - max_pts < mininc)
         max_newpts += mininc;
-
+     
     void* newbuf = new char[unitsize*max_newpts];
     memcpy(newbuf, *buffer, cur_pts*unitsize);
     delete[] *buffer;
@@ -368,14 +413,15 @@
                 double eAng = m_pts[src_idx++];
                 double rot = m_pts[src_idx++];
 
-                /* TODO: change the # of segments based on the tolerance?...up to 4 for now */
-                int nsegs = (int)(4.0*(eAng - sAng)/(2*M_PI)) + 1; // eAng - sAng is (0, 2pi), so this is {1,2,3,4}.
+                /* TODO: change the # of segments based on the tolerance?...up to 6 for now */
+                int nsegs = (int)(4.0*fabs(eAng - sAng)/(2*M_PI)) + 1; // eAng - sAng is (0, 2pi), so this is {1,2,3,4}.
                 double span = (eAng - sAng)/(double)nsegs;
-
-                double sec = 1.0/cos(span/2.0);
-                double alpha = sin(span)*(sqrt(1.0 + 3.0/sec/sec) - 1)/3.0;
+                double aspan = fabs(span);
+                
+                double sec = 1.0/cos(aspan/2.0);
+                double alpha = sin(aspan)*(sqrt(1.0 + 3.0/sec/sec) - 1)/3.0;
                 double rcos = cos(rot), rsin = sin(rot);
-
+                
                 double ex, ey, sx, sy;
                 double scos, ssin, ecos, esin;
                 double sa, ea;
@@ -386,6 +432,8 @@
                 ey = ry*esin;
                 ea = sAng;
 
+                double cw = sAng > eAng ? -1.0 : 1.0;
+
                 for (int i = 0; i < nsegs; i++)
                 {
                     sa = ea;
@@ -401,11 +449,13 @@
                     ex = rx*ecos;
                     ey = ry*esin;
 
-                    double c1x = sx - alpha*rx*ssin;
-                    double c1y = sy + alpha*ry*scos;
-                    double c2x = ex + alpha*rx*esin;
-                    double c2y = ey - alpha*ry*ecos;
+                    double c1x, c1y, c2x, c2y;
 
+                    c1x = sx - cw*alpha*rx*ssin;
+                    c1y = sy + cw*alpha*ry*scos;
+                    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
                        calculate the number of segments, assuming a deviation of the segment length *
                        the second derivative must be within the tolerance */
@@ -413,7 +463,7 @@
                     SineCosineMax(sa, ssin, scos, ea, esin, ecos, my, mx);
                     mx *= rx;
                     my *= ry;
-                    int steps = (int)((span/tolerance)*sqrt(mx*mx + my*my)) + 1;
+                    int steps = (int)((aspan/tolerance)*sqrt(mx*mx + my*my)) + 1;
                     ENSURE_XF_POINT_BUFFER(steps + 1);
                     m_xf_cntrs[m_xf_ncntrs-1] += steps + 1;
                     m_xf_npts += steps + 1;
@@ -433,15 +483,13 @@
                         tx = mx, ty = my;
                     }
 
-                    ex += cx;
-                    ey += cy;
                     c1x += cx;
                     c1y += cy;
                     c2x += cx;
                     c2y += cy;
 
-                    TessellateCubicTo(m_xf_pts + dst_idx, c1x, c1y, c2x, c2y, ex, ey, steps);
-                    dst_idx += steps + 1;
+                    TessellateCubicTo(m_xf_pts + dst_idx, c1x, c1y, c2x, c2y, ex + cx, ey + cy, steps);
+                    dst_idx += 2*steps + 2;
                 }
 
                 break;
@@ -504,6 +552,10 @@
     double px1 = pts[-2];
     double py1 = pts[-1];
 
+    m_xf.transform(px2, py2);
+    m_xf.transform(px3, py3);
+    m_xf.transform(px4, py4);
+
     double dt = 1.0/(double)steps;
 
     double dt3 = dt * dt * dt;
@@ -537,8 +589,8 @@
         ddfy += dddfy;
         ddfx += dddfx;
 
-        m_xf.transform(fx, fy, pts[0], pts[1]);
-        pts += 2;
+        *pts++ = fx;
+        *pts++ = fy;
     }
 
     *pts++ = px4;
@@ -614,7 +666,7 @@
 
     m_xf_ncntrs = lb->cntr_count();
     memcpy(m_xf_cntrs, lb->cntrs(), sizeof(int)*m_xf_ncntrs);
-
+    
     m_xf_npts = lb->point_count();
     double *srcpts = lb->points();
 
@@ -679,4 +731,4 @@
 void SE_LineBufferPool::FreeBounds(SE_Bounds* bounds)
 {
     m_bnd_pool.push(bounds);
-}
+}
\ No newline at end of file

Modified: trunk/MgDev/Common/Stylization/SE_LineBuffer.h
===================================================================
--- trunk/MgDev/Common/Stylization/SE_LineBuffer.h	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/Stylization/SE_LineBuffer.h	2007-03-07 05:23:02 UTC (rev 1163)
@@ -1,5 +1,5 @@
 //
-//  Copyright (C) 2007 by Autodesk, Inc.
+//  Copyright (C) 2007 Autodesk, Inc.
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of version 2.1 of the GNU Lesser
@@ -33,6 +33,23 @@
 
 struct SE_Geometry
 {
+    SE_INLINE SE_Geometry() :
+        points(NULL),
+        n_pts(0),
+        contours(NULL),
+        n_cntrs(0),
+        geom_type(0)
+    { 
+    }
+    SE_INLINE SE_Geometry(LineBuffer* srclb)
+    {
+        points = srclb->points();
+        n_pts = srclb->point_count();
+        contours = srclb->cntrs();
+        n_cntrs = srclb->cntr_count();
+        geom_type = srclb->geom_type();
+    }
+
     double* points;
     int n_pts;
     int* contours;
@@ -41,7 +58,6 @@
 };
 
 struct SE_Bounds;
-class SE_LineBufferPool;
 
 class SE_LineBuffer
 {
@@ -55,8 +71,8 @@
         SegType_MoveTo,
         SegType_LineTo,
         SegType_EllipticalArc
-    };
-
+    };    
+    
     STYLIZATION_API void SetToTransform(LineBuffer* lb, const SE_Matrix& xform);
 
     STYLIZATION_API void MoveTo(double x, double y);
@@ -81,7 +97,7 @@
     void ResizeBuffer(void** buffer, int unitsize, int mininc, int cur_pts, int& max_pts);
     void TessellateCubicTo(double* pts, double px2, double py2, double px3, double py3, double px4, double py4, int steps);
     SE_Bounds* ComputeConvexHull(double* pnts, int* cntrs, int ncntrs, double weight);
-
+    
     SE_LineBufferPool* m_pool;
     LineBuffer* m_src_lb;
 
@@ -100,8 +116,9 @@
     SE_Bounds* m_inst_bounds;
     double m_xf_tol;
     double m_xf_weight;
-
+    
     double m_start[2];
+    double m_last[2];
 
     int m_npts;
     int m_xf_npts;
@@ -132,4 +149,4 @@
     DataValueStack<SE_Bounds> m_bnd_pool;
 };
 
-#endif // SE_LINEBUFFER_H
+#endif // SE_LINEBUFFER_H
\ No newline at end of file

Modified: trunk/MgDev/Common/Stylization/SE_Renderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Renderer.cpp	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/Stylization/SE_Renderer.cpp	2007-03-07 05:23:02 UTC (rev 1163)
@@ -53,6 +53,7 @@
 void SE_Renderer::ProcessLine(SE_LineBuffer* geometry, SE_RenderLineStyle* style)
 {
     SE_Matrix xform;
+    SE_Matrix symxf;
     SE_Geometry geom;
     geom.points = geometry->xf_points();
     geom.n_pts = geometry->xf_point_cnt();
@@ -60,7 +61,7 @@
     geom.n_cntrs = geometry->xf_cntr_cnt();
     geom.geom_type = geometry->xf_geom_type();
 
-    bool yUp = GetFontEngine()->_Yup();
+    double yUp = GetFontEngine()->_Yup() ? 1.0 : -1.0;
     
     int ptindex = 0;
 
@@ -83,6 +84,7 @@
         while (cur_seg < ptcount - 1)
         {
             xform.setIdentity();
+            symxf.setIdentity();
 
             //current line segment
             double* seg = pts + cur_seg * 2;
@@ -106,8 +108,13 @@
                 dx_incr = cos(slope);
                 dy_incr = sin(slope);
 
-                xform.rotate(yUp ? slope : -slope); // negative for y-inversion
-                xform.translate(seg[0] + dx_incr * drawpos, seg[1] + dy_incr * drawpos);
+                double symrot = wcscmp(L"FromAngle", style->orientation) == 0 ? style->angle : slope*yUp;
+                xform.rotate(slope*yUp); // negative for y-inversion
+                symxf.rotate(symrot);
+                double tx = seg[0] + dx_incr * drawpos;
+                double ty = seg[1] + dy_incr * drawpos;
+                xform.translate(tx, ty);
+                symxf.translate(tx, ty);
                 dx_incr *= increment;
                 dy_incr *= increment;
 
@@ -116,11 +123,12 @@
                 while (drawpos < len)
                 {                    
                     if (style->drawLast)
-                        AddLabel(&geom, style, xform, style->orientation == LineUsage::FromGeometry ? slope : style->angle);
+                        AddLabel(&geom, style, symxf, symrot);
                     else
-                        DrawSymbol(style->symbol, xform, style->orientation == LineUsage::FromGeometry ? slope : style->angle);
+                        DrawSymbol(style->symbol, symxf, symrot);
 
                     xform.translate(dx_incr, dy_incr);
+                    symxf.translate(dx_incr, dy_incr);
                     drawpos += increment; 
                 }
             }

Modified: trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp	2007-03-07 05:23:02 UTC (rev 1163)
@@ -41,7 +41,6 @@
 {
     double cx, cy;
     double startAng, endAng;
-    double rotation;
 };
 
 bool ParseArc(ArcDefinition& def, ArcData& data);
@@ -60,7 +59,7 @@
     ParseDoubleExpression(pntRpt.GetAngle(), style->angle);
     ParseDoubleExpression(pntRpt.GetOriginOffsetX(), style->offset[0]);
     ParseDoubleExpression(pntRpt.GetOriginOffsetY(), style->offset[1]);
-    style->orientation = pntRpt.GetAngleControl();
+    ParseStringExpression(pntRpt.GetAngleControl(), style->orientation);
 }
 
 void SE_StyleVisitor::VisitLineUsage(LineUsage& lnRpt)
@@ -72,6 +71,10 @@
     ParseDoubleExpression(lnRpt.GetRepeat(), style->repeat);
     ParseDoubleExpression(lnRpt.GetAngle(), style->angle);
     ParseDoubleExpression(lnRpt.GetVertexAngleLimit(), style->angleLimit);
+    ParseStringExpression(lnRpt.GetUnitsControl(), style->units);
+    ParseStringExpression(lnRpt.GetAngleControl(), style->orientation);
+    ParseStringExpression(lnRpt.GetVertexControl(), style->overlap);
+    //ParseStringExpression(lnRpt.GetLineJoin(), style->join);
 }
 
 void SE_StyleVisitor::VisitAreaUsage(AreaUsage& areaRpt)
@@ -84,6 +87,9 @@
     ParseDoubleExpression(areaRpt.GetRepeatX(), style->repeat[0]);
     ParseDoubleExpression(areaRpt.GetRepeatY(), style->repeat[1]);
     ParseDoubleExpression(areaRpt.GetBufferWidth(), style->bufferWidth);
+    ParseStringExpression(areaRpt.GetAngleControl(), style->orientation);
+    ParseStringExpression(areaRpt.GetClippingControl(), style->clipping);
+    ParseStringExpression(areaRpt.GetOriginControl(), style->origincontrol);
 }
 
 bool SE_StyleVisitor::ParseDouble(const wchar_t*& str, double& val)
@@ -219,7 +225,7 @@
             if (!ParseArc(arcdef, arcdata))
                 return false;
 
-            lb->EllipticalArcTo(arcdata.cx, arcdata.cy, arcdef.rx, arcdef.ry, arcdata.startAng, arcdata.endAng, arcdata.rotation);
+            lb->EllipticalArcTo(arcdata.cx, arcdata.cy, arcdef.rx, arcdef.ry, arcdata.startAng, arcdata.endAng, arcdef.rotation);
             break;
         case L'z': // Line segment to start point of figure
         case L'Z':

Modified: trunk/MgDev/Common/Stylization/StylizationEngine.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/StylizationEngine.cpp	2007-03-07 04:47:30 UTC (rev 1162)
+++ trunk/MgDev/Common/Stylization/StylizationEngine.cpp	2007-03-07 05:23:02 UTC (rev 1163)
@@ -224,7 +224,8 @@
         break;
     }
 
-    if (style->orientation == PointUsage::FromGeometry)
+    const wchar_t* orientation = style->orientation.evaluate(m_exec);
+    if (wcscmp(L"FromGeometry", orientation) == 0)
     {
         if (type == LineBuffer::ctLine || type == LineBuffer::ctArea)
         {
@@ -262,10 +263,9 @@
     render->repeat = style->repeat.evaluate(m_exec)*xform.x0;
     render->startOffset = style->startOffset.evaluate(m_exec)*xform.x0;
 
-    render->units = style->units;
-    render->orientation = style->orientation;
-    render->overlap = style->overlap;
-    render->join = style->join;
+    render->units = style->units.evaluate(m_exec);
+    render->orientation = style->orientation.evaluate(m_exec);
+    render->overlap = style->overlap.evaluate(m_exec);
 
     return render;
 }
@@ -274,9 +274,9 @@
 {
     SE_RenderAreaStyle* render = new SE_RenderAreaStyle();
 
-    render->orientation = style->orientation;
-    render->clipping = style->clipping;
-    render->origincontrol = style->origincontrol;
+    render->orientation = style->orientation.evaluate(m_exec);
+    render->clipping = style->clipping.evaluate(m_exec);
+    render->origincontrol = style->origincontrol.evaluate(m_exec);
 
     return render;
 }
@@ -452,17 +452,16 @@
             if (renderStyle->bounds)
             {
                 SE_Bounds* bounds = renderStyle->bounds;
-                renderStyle->bounds = renderStyle->bounds->Union(rsym->bounds);
-                
-                if (style->useBox && sym->resize == GraphicElement::AddToResizeBox)
-                    bounds->Contained(minx, miny, maxx, maxy, growx, growy);
-
+                renderStyle->bounds = bounds->Union(rsym->bounds);
                 bounds->Free();
             }
             else
                 renderStyle->bounds = rsym->bounds->Clone();
             rsym->resize = sym->resize == GraphicElement::AdjustToResizeBox;
             renderStyle->symbol.push_back(rsym);
+
+            if (style->useBox && sym->resize == GraphicElement::AddToResizeBox)
+                rsym->bounds->Contained(minx, miny, maxx, maxy, growx, growy);
         }
     }
 



More information about the mapguide-commits mailing list