[mapguide-commits] r1159 - trunk/MgDev/Common/Stylization
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Mar 6 19:08:16 EST 2007
Author: waltweltonlair
Date: 2007-03-06 19:08:14 -0500 (Tue, 06 Mar 2007)
New Revision: 1159
Modified:
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_Include.h
trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp
trunk/MgDev/Common/Stylization/SE_LineBuffer.h
trunk/MgDev/Common/Stylization/StylizationEngine.h
Log:
A Linux build fix...
Modified: trunk/MgDev/Common/Stylization/SE_Bounds.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Bounds.cpp 2007-03-06 23:31:17 UTC (rev 1158)
+++ trunk/MgDev/Common/Stylization/SE_Bounds.cpp 2007-03-07 00:08:14 UTC (rev 1159)
@@ -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
@@ -43,7 +43,7 @@
{
double *last = hull + 2*size;
double *cur = hull;
-
+
while (cur < last)
xform.transform(*cur++, *cur++);
}
@@ -93,7 +93,7 @@
void SE_Bounds::Contained(double minx, double miny, double maxx, double maxy, double &growx, double &growy)
{
double sx, sy;
-
+
if (min[0] < minx)
{
sx = (minx - min[0])/(maxx - minx);
@@ -127,7 +127,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 +169,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-06 23:31:17 UTC (rev 1158)
+++ trunk/MgDev/Common/Stylization/SE_Bounds.h 2007-03-07 00:08:14 UTC (rev 1159)
@@ -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
@@ -46,4 +46,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-06 23:31:17 UTC (rev 1158)
+++ trunk/MgDev/Common/Stylization/SE_ConvexHull.h 2007-03-07 00:08:14 UTC (rev 1159)
@@ -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
@@ -44,10 +44,10 @@
template<class ITER, class POINT> SE_Bounds* AndrewHull(ITER spoints, ITER epoints, int npoints, SE_LineBufferPool* pool)
{
POINT pnt;
- ITER minxminy, minxmaxy, maxxminy, maxxmaxy;
+ ITER minxminy, minxmaxy, maxxminy, maxxmaxy;
ITER iter = spoints;
-
+
minxminy = iter++;
while ((iter != epoints) && (pnt.x(iter) == pnt.x(minxminy)))
iter++;
@@ -89,7 +89,7 @@
if (PointLeft(pnt.x(minxminy), pnt.y(minxminy), pnt.x(maxxminy), pnt.y(maxxminy), pnt.x(iter), pnt.y(iter)) && iter != maxxminy)
/* this point is trivially above the lower bounding line, and cannot be in the lower hull */
continue;
-
+
while ((stack - buffer) > 2) /* we have to have at least 2 points before this is defined */
{
if (PointLeft(*(stack - 4), *(stack - 3), *(stack - 2), *(stack - 1), pnt.x(iter), pnt.y(iter)))
@@ -116,7 +116,7 @@
if (PointLeft(pnt.x(maxxmaxy), pnt.y(maxxmaxy), pnt.x(minxmaxy), pnt.y(minxmaxy), pnt.x(iter), pnt.y(iter)) && iter != minxmaxy)
/* this point is trivially below the upper bounding line, and cannot be in the upper hull */
continue;
-
+
while ((stack - ubuf) > 2) /* we have to have at least 2 points before this is defined */
{
if (PointLeft(*(stack - 4), *(stack - 3), *(stack - 2), *(stack - 1), pnt.x(iter), pnt.y(iter)))
@@ -151,4 +151,4 @@
return bounds;
}
-#endif // SE_CONVEXHULL_H
\ No newline at end of file
+#endif // SE_CONVEXHULL_H
Modified: trunk/MgDev/Common/Stylization/SE_Include.h
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Include.h 2007-03-06 23:31:17 UTC (rev 1158)
+++ trunk/MgDev/Common/Stylization/SE_Include.h 2007-03-07 00:08:14 UTC (rev 1159)
@@ -60,7 +60,7 @@
expression->Process(processor);
*((unsigned int*)this) = (unsigned int)processor->GetInt64Result();
}
-
+
return *((unsigned int*)this);
}
@@ -187,7 +187,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,7 +223,6 @@
SE_INLINE SE_Raster() { type = SE_RasterPrimitive; }
};
-
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//
// SE_RenderPrimitives
@@ -351,7 +350,7 @@
struct SE_RenderStyle
{
- SE_INLINE SE_RenderStyle(SE_StyleType stype)
+ SE_INLINE SE_RenderStyle(SE_StyleType stype)
: type(stype),
drawLast(false),
checkExclusionRegions(false),
@@ -422,8 +421,8 @@
double dx;
double dy;
double anglerad;
- RS_Units dunits;
-
+ RS_Units dunits;
+
SE_INLINE SE_LabelInfo() :
x(0.0),
y(0.0),
@@ -464,7 +463,7 @@
{
std::vector<SE_Symbolization*> symbolization;
FdoFilter* filter;
-
+
~SE_Rule()
{
if (filter) filter->Release();
@@ -476,5 +475,4 @@
}
};
-
#endif // SE_INCLUDE_H
Modified: trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp 2007-03-06 23:31:17 UTC (rev 1158)
+++ trunk/MgDev/Common/Stylization/SE_LineBuffer.cpp 2007-03-07 00:08:14 UTC (rev 1159)
@@ -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
@@ -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)
@@ -310,7 +310,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;
@@ -371,11 +371,11 @@
/* 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}.
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 rcos = cos(rot), rsin = sin(rot);
-
+
double ex, ey, sx, sy;
double scos, ssin, ecos, esin;
double sa, ea;
@@ -614,7 +614,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 +679,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-06 23:31:17 UTC (rev 1158)
+++ trunk/MgDev/Common/Stylization/SE_LineBuffer.h 2007-03-07 00:08:14 UTC (rev 1159)
@@ -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
@@ -41,6 +41,7 @@
};
struct SE_Bounds;
+class SE_LineBufferPool;
class SE_LineBuffer
{
@@ -54,8 +55,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);
@@ -80,7 +81,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;
@@ -99,7 +100,7 @@
SE_Bounds* m_inst_bounds;
double m_xf_tol;
double m_xf_weight;
-
+
double m_start[2];
int m_npts;
@@ -131,4 +132,4 @@
DataValueStack<SE_Bounds> m_bnd_pool;
};
-#endif // SE_LINEBUFFER_H
\ No newline at end of file
+#endif // SE_LINEBUFFER_H
Modified: trunk/MgDev/Common/Stylization/StylizationEngine.h
===================================================================
--- trunk/MgDev/Common/Stylization/StylizationEngine.h 2007-03-06 23:31:17 UTC (rev 1158)
+++ trunk/MgDev/Common/Stylization/StylizationEngine.h 2007-03-07 00:08:14 UTC (rev 1159)
@@ -53,13 +53,12 @@
CompositeTypeStyle* style);
void ClearCache();
-private:
+private:
SE_RenderPointStyle* EvaluatePointStyle(SE_LineBuffer* geometry, SE_Matrix& xform, SE_PointStyle* style, double mm2px);
SE_RenderAreaStyle* EvaluateAreaStyle(SE_Matrix& xform, SE_AreaStyle* style);
SE_RenderLineStyle* EvaluateLineStyle(SE_Matrix& xform, SE_LineStyle* style);
-
void LayoutCustomLabel(SE_LineBuffer* geometry, SE_Matrix& xform, SE_Style* style, SE_RenderStyle* rstyle, double mm2px);
void EvaluateSymbols(SE_Matrix& xform, SE_Style* style, SE_RenderStyle* renderStyle, double mm2px);
SE_Renderer* m_renderer;
More information about the mapguide-commits
mailing list