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

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Apr 14 15:46:19 EDT 2010


Author: waltweltonlair
Date: 2010-04-14 15:46:18 -0400 (Wed, 14 Apr 2010)
New Revision: 4798

Modified:
   trunk/MgDev/Common/Stylization/LineBuffer.h
   trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp
Log:
This submission is a follow-up for r3271.

In r3271 we added functionality to the LineBuffer class to allow LineBuffer clients to detect the location of tessellated arc segments in the LineBuffer vertex data.  This is done via a list of arc segment point indices.  This submission updates SE_LineBuffer to also set these indices when it populates a LineBuffer with a tessellated arc.

The following APIs have been added to LineBuffer: 

inline void StoreArcStartIndex();
inline void StoreArcEndIndex();


Modified: trunk/MgDev/Common/Stylization/LineBuffer.h
===================================================================
--- trunk/MgDev/Common/Stylization/LineBuffer.h	2010-04-14 17:52:58 UTC (rev 4797)
+++ trunk/MgDev/Common/Stylization/LineBuffer.h	2010-04-14 19:46:18 UTC (rev 4798)
@@ -161,6 +161,8 @@
     inline void EnsureContours(int n);
     inline void EnsureArcsSpArray(int n);
     inline void EnsureCloseSegArray(int n);
+    inline void StoreArcStartIndex();
+    inline void StoreArcEndIndex();
     inline int contour_start_point(int contour) const;
     inline int contour_end_point(int contour) const;
     inline int arcs_sp_length() const;
@@ -383,6 +385,23 @@
 }
 
 
+// Store off arc start point index, consistent with ArcTo().
+void LineBuffer::StoreArcStartIndex()
+{
+    EnsureArcsSpArray(1);
+    m_arcs_sp[++m_cur_arcs_sp] = m_cur_types - 1;
+}
+
+
+// Store off arc end point index (want index of start point of last segment),
+// consistent with ArcTo().
+void LineBuffer::StoreArcEndIndex()
+{
+    EnsureArcsSpArray(1);
+    m_arcs_sp[++m_cur_arcs_sp] = m_cur_types - 2;
+}
+
+
 void LineBuffer::append_segment(SegType type, const double& x, const double& y, const double& z)
 {
     m_pts[m_cur_types][0] = x;

Modified: trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp	2010-04-14 17:52:58 UTC (rev 4797)
+++ trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp	2010-04-14 19:46:18 UTC (rev 4798)
@@ -275,6 +275,10 @@
 
                 // add the segments
                 m_xf_buf->EnsurePoints(nSegs);
+
+                // store off arc start point index
+                m_xf_buf->StoreArcStartIndex();
+
                 for (int i=1; i<=nSegs; ++i)
                 {
                     double ang = sAng + i*dAng;
@@ -289,6 +293,9 @@
                     m_xf_buf->UnsafeLineTo(x, y);
                 }
 
+                // store off arc end point index
+                m_xf_buf->StoreArcEndIndex();
+
                 break;
             }
         }



More information about the mapguide-commits mailing list