[mapguide-commits] r1165 - trunk/MgDev/Common/Stylization
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Wed Mar 7 09:06:01 EST 2007
Author: waltweltonlair
Date: 2007-03-07 09:06:01 -0500 (Wed, 07 Mar 2007)
New Revision: 1165
Modified:
trunk/MgDev/Common/Stylization/Makefile.am
trunk/MgDev/Common/Stylization/SE_Bounds.cpp
trunk/MgDev/Common/Stylization/SE_Bounds.h
trunk/MgDev/Common/Stylization/SE_ConvexHull.h
trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp
trunk/MgDev/Common/Stylization/SE_LineBuffer.h
Log:
Really fix the Linux build. The problem was forward declaring a struct
being used in a template class. GCC doesn't seem to like that.
Modified: trunk/MgDev/Common/Stylization/Makefile.am
===================================================================
--- trunk/MgDev/Common/Stylization/Makefile.am 2007-03-07 12:17:53 UTC (rev 1164)
+++ trunk/MgDev/Common/Stylization/Makefile.am 2007-03-07 14:06:01 UTC (rev 1165)
@@ -14,6 +14,14 @@
lib_LTLIBRARIES = libMgStylization.la
libMgStylization_la_SOURCES = \
+ RS_FontEngine.cpp \
+ SE_Bounds.cpp \
+ SE_ExpressionBase.cpp \
+ SE_LineBuffer.cpp \
+ SE_PositioningAlgorithms.cpp \
+ SE_Renderer.cpp \
+ SE_StyleVisitor.cpp \
+ StylizationEngine.cpp \
LineBuffer.cpp \
LineStyleDef.cpp \
DefaultStylizer.cpp \
@@ -54,17 +62,21 @@
SimpleOverpost.cpp \
RS_ByteData.cpp \
FontManager.cpp \
- complex_polygon_gd.cpp \
- RS_FontEngine.cpp \
- SE_Bounds.cpp \
- SE_ExpressionBase.cpp \
- SE_LineBuffer.cpp \
- SE_PositioningAlgorithms.cpp \
- SE_Renderer.cpp \
- SE_StyleVisitor.cpp \
- StylizationEngine.cpp
+ complex_polygon_gd.cpp
noinst_HEADERS = \
+ RS_FontEngine.h \
+ SE_Bounds.h \
+ SE_ConvexHull.h \
+ SE_ExpressionBase.h \
+ SE_Include.h \
+ SE_LineBuffer.h \
+ SE_Matrix.h \
+ SE_PositioningAlgorithms.h \
+ SE_Renderer.h \
+ SE_StyleVisitor.h \
+ SE_SymbolManager.h \
+ StylizationEngine.h \
Bounds.h \
LineBuffer.h \
LineStyle.h \
@@ -129,19 +141,7 @@
FontManager.h \
SymbolVisitor.h \
SLDSymbols.h \
- complex_polygon_gd.h \
- RS_FontEngine.h \
- SE_Bounds.h \
- SE_ConvexHull.h \
- SE_ExpressionBase.h \
- SE_Include.h \
- SE_LineBuffer.h \
- SE_Matrix.h \
- SE_PositioningAlgorithms.h \
- SE_Renderer.h \
- SE_StyleVisitor.h \
- SE_SymbolManager.h \
- StylizationEngine.h
+ complex_polygon_gd.h
AM_CXXFLAGS = @CXXFLAGS@ -DDWFTK_BUILD_EXPAT
Modified: trunk/MgDev/Common/Stylization/SE_Bounds.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Bounds.cpp 2007-03-07 12:17:53 UTC (rev 1164)
+++ trunk/MgDev/Common/Stylization/SE_Bounds.cpp 2007-03-07 14:06:01 UTC (rev 1165)
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2007 Autodesk, Inc.
+// 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
@@ -51,7 +51,7 @@
{
double *last = hull + 2*size;
double *cur = hull;
-
+
while (cur < last)
xform.transform(*cur++, *cur++);
}
@@ -112,7 +112,7 @@
xfminy = min[1] - cy;
xfmaxx = max[0] - cx;
xfmaxy = max[1] - cy;
-
+
if (xfminx < minx) // minx always negative
{
sx = xfminx/minx - 1.0;
@@ -146,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};
@@ -188,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 12:17:53 UTC (rev 1164)
+++ trunk/MgDev/Common/Stylization/SE_Bounds.h 2007-03-07 14:06:01 UTC (rev 1165)
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2007 Autodesk, Inc.
+// 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
@@ -21,9 +21,10 @@
#include "Stylization.h"
#include "SE_Matrix.h"
+class SE_LineBufferPool;
+
struct SE_Bounds
{
-friend class SE_LineBuffer;
friend class SE_LineBufferPool;
private:
SE_Bounds();
@@ -47,4 +48,4 @@
STYLIZATION_API SE_Bounds* Union(SE_Bounds* bounds);
};
-#endif // SE_BOUNDS_H
\ No newline at end of file
+#endif // SE_BOUNDS_H
Modified: trunk/MgDev/Common/Stylization/SE_ConvexHull.h
===================================================================
--- trunk/MgDev/Common/Stylization/SE_ConvexHull.h 2007-03-07 12:17:53 UTC (rev 1164)
+++ trunk/MgDev/Common/Stylization/SE_ConvexHull.h 2007-03-07 14:06:01 UTC (rev 1165)
@@ -18,11 +18,17 @@
#ifndef SE_CONVEXHULL_H
#define SE_CONVEXHULL_H
-#include "SE_LineBuffer.h"
+// can't forward declare a struct used in a template class
+//struct SE_Bounds;
+//class SE_LineBufferPool;
+#include "SE_Bounds.h"
#define PointLeft(pt0x, pt0y, pt1x, pt1y, pt2x, pt2y) \
(((pt1x - pt0x)*(pt2y - pt0y) - (pt2x - pt0x)*(pt1y - pt0y)) > 0)
+//---------------------------------------------
+//---------------------------------------------
+
struct SimplePOINT
{
SE_INLINE double x(void* point)
@@ -41,6 +47,9 @@
}
};
+//---------------------------------------------
+//---------------------------------------------
+
template<class ITER, class POINT> SE_Bounds* AndrewHull(ITER spoints, ITER epoints, int npoints, SE_LineBufferPool* pool)
{
POINT pnt;
Modified: trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp 2007-03-07 12:17:53 UTC (rev 1164)
+++ trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp 2007-03-07 14:06:01 UTC (rev 1165)
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2007 Autodesk, Inc.
+// 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
@@ -731,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 12:17:53 UTC (rev 1164)
+++ trunk/MgDev/Common/Stylization/SE_LineBuffer.h 2007-03-07 14:06:01 UTC (rev 1165)
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2007 Autodesk, Inc.
+// 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
@@ -22,6 +22,9 @@
#include "SE_Matrix.h"
#include <set>
+struct SE_Bounds;
+class SE_LineBufferPool;
+
struct PointLess : std::binary_function<std::pair<double, double>&, std::pair<double, double>&, bool>
{
public:
@@ -31,6 +34,9 @@
}
};
+//---------------------------------------------
+//---------------------------------------------
+
struct SE_Geometry
{
SE_INLINE SE_Geometry() :
@@ -39,8 +45,9 @@
contours(NULL),
n_cntrs(0),
geom_type(0)
- {
+ {
}
+
SE_INLINE SE_Geometry(LineBuffer* srclb)
{
points = srclb->points();
@@ -57,22 +64,24 @@
int geom_type;
};
-struct SE_Bounds;
+//---------------------------------------------
+//---------------------------------------------
class SE_LineBuffer
{
friend class SE_LineBufferPool;
private:
- SE_LineBuffer(int size);
- ~SE_LineBuffer();
+ SE_LineBuffer(int size);
+ ~SE_LineBuffer();
+
public:
enum SE_LB_SegType
{
SegType_MoveTo,
SegType_LineTo,
SegType_EllipticalArc
- };
-
+ };
+
STYLIZATION_API void SetToTransform(LineBuffer* lb, const SE_Matrix& xform);
STYLIZATION_API void MoveTo(double x, double y);
@@ -97,7 +106,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;
@@ -116,7 +125,7 @@
SE_Bounds* m_inst_bounds;
double m_xf_tol;
double m_xf_weight;
-
+
double m_start[2];
double m_last[2];
@@ -135,6 +144,10 @@
int m_max_segs;
};
+//---------------------------------------------
+// Object pool for line buffers
+//---------------------------------------------
+
class SE_LineBufferPool
{
public:
@@ -149,4 +162,4 @@
DataValueStack<SE_Bounds> m_bnd_pool;
};
-#endif // SE_LINEBUFFER_H
\ No newline at end of file
+#endif // SE_LINEBUFFER_H
More information about the mapguide-commits
mailing list