[mapguide-commits] r4523 - trunk/MgDev/Common/Stylization
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Jan 12 15:45:38 EST 2010
Author: traianstanev
Date: 2010-01-12 15:45:35 -0500 (Tue, 12 Jan 2010)
New Revision: 4523
Modified:
trunk/MgDev/Common/Stylization/LineBuffer.cpp
trunk/MgDev/Common/Stylization/LineBuffer.h
Log:
Ticket 1240. Made some useful functions public. Fixed the fix for multipoint serialization, since my previous submission didn't quite get it right.
Modified: trunk/MgDev/Common/Stylization/LineBuffer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/LineBuffer.cpp 2010-01-12 17:35:08 UTC (rev 4522)
+++ trunk/MgDev/Common/Stylization/LineBuffer.cpp 2010-01-12 20:45:35 UTC (rev 4523)
@@ -1203,13 +1203,24 @@
int num_geoms = m_cur_geom + 1;
if (is_multi)
{
- //write number of geometries
- WRITE_INT(os, num_geoms);
+ if (m_geom_type == FdoGeometryType_MultiPoint)
+ {
+ //write number of geometries -- for multipoint the
+ //number of contours (i.e. MoveTos) is equal to the
+ //number of point geometries in the multipoint
+ WRITE_INT(os, m_num_geomcntrs[0]);
+ num_geoms = m_num_geomcntrs[0];
+ }
+ else
+ {
+ //write number of geometries
+ WRITE_INT(os, num_geoms);
+ }
}
for (int q=0; q<num_geoms; ++q)
{
- // skip past geometry type of subgeometry
+ // write geometry type of subgeometry
// we know it is LineString or Polygon or Point respectively
if (is_multi)
{
@@ -1244,8 +1255,7 @@
int contour_count = 1; //for linestrings
if (m_geom_type == FdoGeometryType_MultiPolygon ||
- m_geom_type == FdoGeometryType_Polygon ||
- m_geom_type == FdoGeometryType_MultiPoint)
+ m_geom_type == FdoGeometryType_Polygon )
{
contour_count = m_num_geomcntrs[q];
WRITE_INT(os, contour_count);
Modified: trunk/MgDev/Common/Stylization/LineBuffer.h
===================================================================
--- trunk/MgDev/Common/Stylization/LineBuffer.h 2010-01-12 17:35:08 UTC (rev 4522)
+++ trunk/MgDev/Common/Stylization/LineBuffer.h 2010-01-12 20:45:35 UTC (rev 4523)
@@ -136,10 +136,15 @@
// checks for a point in any contour
STYLIZATION_API bool PointInPolygon(double& x, double& y) const;
+ STYLIZATION_API bool PointInPolygon(int cntr, double& x, double& y) const; // point in specific contour
// sets the drawing scale (used for arc tessellation)
STYLIZATION_API void SetDrawingScale(double drawingScale);
+ STYLIZATION_API double PolygonArea(int cntr) const;
+ STYLIZATION_API double PolylineLength(int cntr) const;
+ STYLIZATION_API double PolylineLengthSqr(int cntr) const;
+
// the inline stuff
inline unsigned char point_type(int n) const;
inline int point_count() const; // number of points in buffer
@@ -240,10 +245,7 @@
void MultiPointCentroid(double* cx, double* cy) const;
void MultiPolygonCentroid(double* cx, double* cy) const;
void MultiPolylineCentroid(double* cx, double* cy, double* slope) const;
- bool PointInPolygon(int cntr, double& x, double& y) const; // point in specific contour
- double PolygonArea(int cntr) const;
- double PolylineLength(int cntr) const;
- double PolylineLengthSqr(int cntr) const;
+
void ResizePoints(int n); // new size of array # of points
void ResizeContours(int n);
More information about the mapguide-commits
mailing list