[mapguide-commits] r7745 - in sandbox/jng/stylization_refactor: Common/Renderers Common/Stylization Server/src/Services/Mapping
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Aug 8 06:46:08 PDT 2013
Author: jng
Date: 2013-08-08 06:46:08 -0700 (Thu, 08 Aug 2013)
New Revision: 7745
Added:
sandbox/jng/stylization_refactor/Common/Stylization/FdoStylizationCommon.h
Modified:
sandbox/jng/stylization_refactor/Common/Renderers/AGGRenderer.cpp
sandbox/jng/stylization_refactor/Common/Renderers/GDRenderer.cpp
sandbox/jng/stylization_refactor/Common/Stylization/DefaultStylizer.cpp
sandbox/jng/stylization_refactor/Common/Stylization/DefaultStylizer.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionArgb.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionDecap.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionFeatureClass.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionFeatureId.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionFeatureSource.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionHtmlColor.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionIf.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionLayerDefinition.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionLayerId.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionLookup.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapCenterX.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapCenterY.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapName.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapScale.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionRange.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionSession.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionUrlEncode.h
sandbox/jng/stylization_refactor/Common/Stylization/ExpressionHelper.h
sandbox/jng/stylization_refactor/Common/Stylization/FdoEvaluator.cpp
sandbox/jng/stylization_refactor/Common/Stylization/FdoEvaluator.h
sandbox/jng/stylization_refactor/Common/Stylization/GeometryAdapter.cpp
sandbox/jng/stylization_refactor/Common/Stylization/GridData.h
sandbox/jng/stylization_refactor/Common/Stylization/KeyEncode.h
sandbox/jng/stylization_refactor/Common/Stylization/LabelRenderer.cpp
sandbox/jng/stylization_refactor/Common/Stylization/LabelRendererLocal.cpp
sandbox/jng/stylization_refactor/Common/Stylization/LineBuffer.h
sandbox/jng/stylization_refactor/Common/Stylization/SE_ExpressionBase.cpp
sandbox/jng/stylization_refactor/Common/Stylization/SE_LineBuffer.cpp
sandbox/jng/stylization_refactor/Common/Stylization/SE_LineRenderer.cpp
sandbox/jng/stylization_refactor/Common/Stylization/SE_Renderer.cpp
sandbox/jng/stylization_refactor/Common/Stylization/Stylization.h
sandbox/jng/stylization_refactor/Common/Stylization/Stylization.vcxproj
sandbox/jng/stylization_refactor/Common/Stylization/Stylization.vcxproj.filters
sandbox/jng/stylization_refactor/Common/Stylization/StylizationDefs.h
sandbox/jng/stylization_refactor/Common/Stylization/StylizationEngine.cpp
sandbox/jng/stylization_refactor/Common/Stylization/StylizationUtil.cpp
sandbox/jng/stylization_refactor/Common/Stylization/Stylizer.cpp
sandbox/jng/stylization_refactor/Common/Stylization/Stylizer.h
sandbox/jng/stylization_refactor/Common/Stylization/ThemeParameters.cpp
sandbox/jng/stylization_refactor/Common/Stylization/ThemeParameters.h
sandbox/jng/stylization_refactor/Server/src/Services/Mapping/MappingUtil.cpp
Log:
This submission includes the following changes:
- Move geometry enums in LineBuffer to StylizationDefs.h
- Move FDO #includes to a new FdoStylizationCommon.h. Anything using FDO types will include this header.
- Remove use of FDO geometry enums in AGGRenderer and GDRenderer as we already have equivalent enums already defined in the Stylization library with the same values.
- Replace usage of FDO geometry enums with their stylization equivalents
- Re-scope the global stylization exception callback to be a static member of the FdoEvaluator class. This also inclues a STYLIZATION_TRY() and STYLIZATION_CATCH() macro to simplify stylization exception handling.
- Re-define the StylizerExceptionCallback to include an extra parameter (the method name). This gives greater context to the stylization exception handler in MgMappingUtil
Modified: sandbox/jng/stylization_refactor/Common/Renderers/AGGRenderer.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Renderers/AGGRenderer.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Renderers/AGGRenderer.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -1762,12 +1762,12 @@
// sanity check - cannot clip against these types
switch (polygon->geom_type())
{
- case FdoGeometryType_Point:
- case FdoGeometryType_MultiPoint:
- case FdoGeometryType_LineString:
- case FdoGeometryType_MultiLineString:
- case FdoGeometryType_CurveString:
- case FdoGeometryType_MultiCurveString:
+ case GeometryType_Point:
+ case GeometryType_MultiPoint:
+ case GeometryType_LineString:
+ case GeometryType_MultiLineString:
+ case GeometryType_CurveString:
+ case GeometryType_MultiCurveString:
return;
}
c()->bPolyClip = true;
@@ -1906,12 +1906,12 @@
// can't apply an area style to point and linestring geometry types
switch (featGeom->geom_type())
{
- case FdoGeometryType_Point:
- case FdoGeometryType_MultiPoint:
- case FdoGeometryType_LineString:
- case FdoGeometryType_MultiLineString:
- case FdoGeometryType_CurveString:
- case FdoGeometryType_MultiCurveString:
+ case GeometryType_Point:
+ case GeometryType_MultiPoint:
+ case GeometryType_LineString:
+ case GeometryType_MultiLineString:
+ case GeometryType_CurveString:
+ case GeometryType_MultiCurveString:
return;
}
Modified: sandbox/jng/stylization_refactor/Common/Renderers/GDRenderer.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Renderers/GDRenderer.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Renderers/GDRenderer.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -1751,12 +1751,12 @@
// can't apply an area style to point and linestring geometry types
switch (featGeom->geom_type())
{
- case FdoGeometryType_Point:
- case FdoGeometryType_MultiPoint:
- case FdoGeometryType_LineString:
- case FdoGeometryType_MultiLineString:
- case FdoGeometryType_CurveString:
- case FdoGeometryType_MultiCurveString:
+ case GeometryType_Point:
+ case GeometryType_MultiPoint:
+ case GeometryType_LineString:
+ case GeometryType_MultiLineString:
+ case GeometryType_CurveString:
+ case GeometryType_MultiCurveString:
return;
}
Modified: sandbox/jng/stylization_refactor/Common/Stylization/DefaultStylizer.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/DefaultStylizer.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/DefaultStylizer.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -466,7 +466,7 @@
//////////////////////////////////////////////////////////////////////////////
// WARNING: given pointer to the new stylizer will be destroyed
// by the stylizer (in its destructor)
-void DefaultStylizer::SetGeometryAdapter(LineBuffer::GeometryType type, GeometryAdapter* stylizer)
+void DefaultStylizer::SetGeometryAdapter(GeometryType type, GeometryAdapter* stylizer)
{
GeometryAdapter* old = (GeometryAdapter*)m_hGeomStylizers[type];
delete old;
Modified: sandbox/jng/stylization_refactor/Common/Stylization/DefaultStylizer.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/DefaultStylizer.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/DefaultStylizer.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -66,7 +66,7 @@
int saveWidth,
int saveHeight);
- STYLIZATION_API virtual void SetGeometryAdapter(LineBuffer::GeometryType type, GeometryAdapter* stylizer);
+ STYLIZATION_API virtual void SetGeometryAdapter(GeometryType type, GeometryAdapter* stylizer);
STYLIZATION_API virtual bool HasValidScaleRange(MdfModel::VectorLayerDefinition* layer,
double mapScale);
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionArgb.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionArgb.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionArgb.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_ARGB_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionArgb : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionDecap.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionDecap.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionDecap.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_DECAP_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionDecap : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionFeatureClass.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionFeatureClass.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionFeatureClass.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_FEATURECLASS_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionFeatureClass : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionFeatureId.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionFeatureId.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionFeatureId.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -20,6 +20,7 @@
#include "Stylization.h"
#include "KeyEncode.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionFeatureId : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionFeatureSource.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionFeatureSource.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionFeatureSource.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_FEATURESOURCE_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionFeatureSource : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionHtmlColor.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionHtmlColor.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionHtmlColor.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_HTMLCOLOR_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionHtmlColor : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionIf.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionIf.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionIf.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_IF_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionIf : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionLayerDefinition.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionLayerDefinition.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionLayerDefinition.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_LAYERDEFINITION_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionLayerDefinition : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionLayerId.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionLayerId.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionLayerId.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_LAYERID_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionLayerId : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionLookup.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionLookup.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionLookup.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_LOOKUP_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionLookup : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapCenterX.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapCenterX.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapCenterX.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_MAPCENTERX_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionMapCenterX : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapCenterY.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapCenterY.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapCenterY.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_MAPCENTERY_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionMapCenterY : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapName.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapName.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapName.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_MAPNAME_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionMapName : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapScale.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapScale.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionMapScale.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_MAPCENTERSCALE_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionMapScale : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionRange.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionRange.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionRange.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_RANGE_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionRange : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionSession.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionSession.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionSession.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -20,6 +20,7 @@
#define EXPRESSION_FUNCTION_SESSION_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionSession : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionUrlEncode.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionUrlEncode.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionFunctionUrlEncode.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_URLENCODE_H_
#include "Stylization.h"
+#include "FdoStylizationCommon.h"
class ExpressionFunctionUrlEncode : public FdoExpressionEngineINonAggregateFunction
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ExpressionHelper.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ExpressionHelper.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ExpressionHelper.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -20,6 +20,7 @@
#include "Stylization.h"
#include "Renderer.h"
+#include "FdoStylizationCommon.h"
class ExpressionHelper
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/FdoEvaluator.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/FdoEvaluator.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/FdoEvaluator.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -20,6 +20,9 @@
#include "FdoEvaluator.h"
#include "ExpressionHelper.h"
+// Non-fatal stylizer exception logging mechanism.
+StylizerExceptionCallback FdoEvaluator::sm_stylizerExceptionCallback = NULL;
+
FdoEvaluator::FdoEvaluator(Renderer* renderer, RS_FeatureReader* reader)
{
m_exec = ExpressionHelper::GetExpressionEngine(renderer, reader);
@@ -79,7 +82,7 @@
if (bSuppressErrors)
e->Release();
else
- ProcessStylizerException(e, __LINE__, __WFILE__);
+ ProcessStylizerException(e, __LINE__, __WFILE__, L"FdoEvaluator.EvalInt32");
}
catch (...)
{
@@ -135,7 +138,7 @@
if (bSuppressErrors)
e->Release();
else
- ProcessStylizerException(e, __LINE__, __WFILE__);
+ ProcessStylizerException(e, __LINE__, __WFILE__, L"FdoEvaluator.EvalBoolean");
}
catch (...)
{
@@ -196,7 +199,7 @@
if (bSuppressErrors)
e->Release();
else
- ProcessStylizerException(e, __LINE__, __WFILE__);
+ ProcessStylizerException(e, __LINE__, __WFILE__, L"FdoEvaluator.EvalDouble");
}
catch (...)
{
@@ -240,7 +243,7 @@
if (bSuppressErrors)
e->Release();
else
- ProcessStylizerException(e, __LINE__, __WFILE__);
+ ProcessStylizerException(e, __LINE__, __WFILE__, L"FdoEvaluator.EvalString");
}
catch (...)
{
@@ -312,7 +315,7 @@
if (bSuppressErrors)
e->Release();
else
- ProcessStylizerException(e, __LINE__, __WFILE__);
+ ProcessStylizerException(e, __LINE__, __WFILE__, L"FdoEvaluator.EvalColor");
rscolor = RS_Color(0x000000FF);
return false;
}
@@ -364,7 +367,7 @@
if (bSuppressErrors)
e->Release();
else
- ProcessStylizerException(e, __LINE__, __WFILE__);
+ ProcessStylizerException(e, __LINE__, __WFILE__, L"FdoEvaluator.ExecFilter");
filter = NULL;
}
}
@@ -387,17 +390,12 @@
if (bSuppressErrors)
e->Release();
else
- ProcessStylizerException(e, __LINE__, __WFILE__);
+ ProcessStylizerException(e, __LINE__, __WFILE__, L"FdoEvaluator.ExecFilter");
}
return res;
}
-void FdoEvaluator::ProcessStylizerException(FdoException* exception, int line, wchar_t* file)
-{
-
-}
-
//////////////////////////////////////////////////////////////////////////////
// parses and caches an FDO filter from a pointer to an MDF string.
// Once cached, the filter will be reused next time the same expression
@@ -429,9 +427,23 @@
}
catch (FdoException* e)
{
- ProcessStylizerException(e, __LINE__, __WFILE__);
+ ProcessStylizerException(e, __LINE__, __WFILE__, L"FdoEvaluator.ObtainFdoExpression");
expr = NULL;
}
return expr;
+}
+
+void FdoEvaluator::SetStylizerExceptionCallback(StylizerExceptionCallback callbackFunction)
+{
+ sm_stylizerExceptionCallback = callbackFunction;
+}
+
+void FdoEvaluator::ProcessStylizerException(FdoException* exception, int line, wchar_t* file, wchar_t* methodName)
+{
+ if (NULL != sm_stylizerExceptionCallback)
+ {
+ (*sm_stylizerExceptionCallback)(exception, line, file, methodName);
+ }
+ exception->Release();
}
\ No newline at end of file
Modified: sandbox/jng/stylization_refactor/Common/Stylization/FdoEvaluator.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/FdoEvaluator.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/FdoEvaluator.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -24,6 +24,10 @@
#include "Renderer.h"
#include <map>
+#include "FdoStylizationCommon.h"
+
+typedef void (*StylizerExceptionCallback)(FdoException* exception, int line, wchar_t* file, wchar_t* methodName);
+
//-------------------------------------------------------------
// Provides services for evaluating FDO expressions and filters
//-------------------------------------------------------------
@@ -40,9 +44,12 @@
STYLIZATION_API virtual bool EvalString(const MdfModel::MdfString& exprstr, RS_String& res, bool bSuppressErrors);
STYLIZATION_API virtual bool EvalColor(const MdfModel::MdfString& exprstr, RS_Color& color, bool bSuppressErrors);
STYLIZATION_API virtual bool ExecFilter(const MdfModel::MdfString* pExprstr, bool bSuppressErrors);
+
+ //Non-fatal FDO exception logging mechanism
+ STYLIZATION_API static void ProcessStylizerException(FdoException* exception, int line, wchar_t* file, wchar_t* methodName);
+ STYLIZATION_API static void SetStylizerExceptionCallback(StylizerExceptionCallback callbackFunction);
private:
FdoExpression* ObtainFdoExpression(const MdfModel::MdfString* pExprstr);
- void ProcessStylizerException(FdoException* exception, int line, wchar_t* file);
FdoPtr<FdoExpressionEngine> m_exec;
@@ -56,6 +63,21 @@
std::map<const void*, FdoFilter*> m_hFilterCache;
// FdoExpression cache
std::map<const void*, FdoExpression*> m_hExpressionCache;
+
+ static StylizerExceptionCallback sm_stylizerExceptionCallback;
};
+#define STYLIZATION_TRY() \
+ try \
+ {
+
+#define STYLIZATION_CATCH(methodName) \
+ } \
+ catch (FdoException* e) \
+ { \
+ FdoEvaluator::ProcessStylizerException(e, __LINE__, __WFILE__, methodName); \
+ } \
+ catch (...) \
+ { }
+
#endif
\ No newline at end of file
Added: sandbox/jng/stylization_refactor/Common/Stylization/FdoStylizationCommon.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/FdoStylizationCommon.h (rev 0)
+++ sandbox/jng/stylization_refactor/Common/Stylization/FdoStylizationCommon.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -0,0 +1,30 @@
+//
+// Copyright (C) 2007-2013 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
+//
+
+#ifndef FDO_STYLIZATION_COMMON_H_
+#define FDO_STYLIZATION_COMMON_H_
+
+// Common FDO headers
+#pragma warning(push)
+#pragma warning(disable: 4201)
+#include "Fdo.h"
+#include "FdoExpressionEngine.h"
+#include "FdoExpressionEngineFunctionCollection.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
+#pragma warning(pop)
+
+#endif
\ No newline at end of file
Modified: sandbox/jng/stylization_refactor/Common/Stylization/GeometryAdapter.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/GeometryAdapter.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/GeometryAdapter.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -22,8 +22,6 @@
#include "SLDSymbols.h"
#include "SE_Evaluator.h"
-extern void ProcessStylizerException(FdoException* exception, int line, wchar_t* file);
-
//////////////////////////////////////////////////////////////////////////////
GeometryAdapter::GeometryAdapter(LineBufferPool* lbp)
{
Modified: sandbox/jng/stylization_refactor/Common/Stylization/GridData.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/GridData.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/GridData.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -21,6 +21,7 @@
#include "MdfModel.h"
#include "Band.h"
#include "HillShade.h"
+#include "FdoStylizationCommon.h"
///<summary>
/// This class keep a set of Band.
Modified: sandbox/jng/stylization_refactor/Common/Stylization/KeyEncode.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/KeyEncode.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/KeyEncode.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -20,6 +20,7 @@
#include "Stylization.h"
#include "RS_BufferOutputStream.h"
+#include "FdoStylizationCommon.h"
//forward declare
class RS_FeatureReader;
Modified: sandbox/jng/stylization_refactor/Common/Stylization/LabelRenderer.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/LabelRenderer.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/LabelRenderer.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -18,12 +18,10 @@
#include "stdafx.h"
#include "LabelRenderer.h"
#include "SE_Renderer.h"
+#include "FdoEvaluator.h"
//#define DEBUG_LABELS
-extern void ProcessStylizerException(FdoException* exception, int line, wchar_t* file);
-
-
//////////////////////////////////////////////////////////////////////////////
LabelRenderer::LabelRenderer(SE_Renderer* se_renderer)
: LabelRendererBase(se_renderer)
@@ -230,8 +228,8 @@
//////////////////////////////////////////////////////////////////////////////
void LabelRenderer::BlastLabels()
{
- try
- {
+ STYLIZATION_TRY()
+
//-------------------------------------------------------
// step 1 - perform stitching
//-------------------------------------------------------
@@ -293,14 +291,8 @@
//-------------------------------------------------------
Cleanup();
- }
- catch (FdoException* e)
- {
- ProcessStylizerException(e, __LINE__, __WFILE__);
- }
- catch (...)
- {
- }
+
+ STYLIZATION_CATCH(L"LabelRenderer.BlastLabels")
}
Modified: sandbox/jng/stylization_refactor/Common/Stylization/LabelRendererLocal.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/LabelRendererLocal.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/LabelRendererLocal.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -18,12 +18,10 @@
#include "stdafx.h"
#include "LabelRendererLocal.h"
#include "SE_Renderer.h"
+#include "FdoEvaluator.h"
//#define DEBUG_LABELS
-extern void ProcessStylizerException(FdoException* exception, int line, wchar_t* file);
-
-
//////////////////////////////////////////////////////////////////////////////
LabelRendererLocal::LabelRendererLocal(SE_Renderer* se_renderer, double tileExtentOffset)
: LabelRendererBase(se_renderer)
@@ -95,11 +93,11 @@
BeginOverpostGroup(type, true, exclude);
// get the geometry type
- int geomType = (path != NULL)? path->geom_type() : FdoGeometryType_None;
+ int geomType = (path != NULL)? path->geom_type() : GeometryType_None;
// in the case of linear geometry we'll label along the path, so prepare
// for that (transform to screen space, group into stitch groups)
- if (geomType == FdoGeometryType_LineString || geomType == FdoGeometryType_MultiLineString)
+ if (geomType == GeometryType_LineString || geomType == GeometryType_MultiLineString)
{
// indicate that the current group will be labeled along the path
m_labelGroups.back().m_algo = laCurve;
@@ -821,14 +819,8 @@
finalGroups.clear();
m_hStitchTable.clear();
m_overpost.Clear();
- }
- catch (FdoException* e)
- {
- ProcessStylizerException(e, __LINE__, __WFILE__);
- }
- catch (...)
- {
- }
+
+ STYLIZATION_CATCH(L"LabelRendererLocal.BlastLabels")
}
Modified: sandbox/jng/stylization_refactor/Common/Stylization/LineBuffer.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/LineBuffer.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/LineBuffer.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -18,6 +18,7 @@
#ifndef LINEBUFFER_H_
#define LINEBUFFER_H_
+#include "Stylization.h"
#include "StylizationAPI.h"
#include "StylizationDefs.h"
#include "Bounds.h"
@@ -86,43 +87,6 @@
ctAGF = 4
};
- //Matches the FGF enumeration FdoDimensionality
- enum Dimensionality
- {
- /// X and Y dimensions are present.
- Dimensionality_XY = 0,
- /// Z dimension is present.
- Dimensionality_Z = 1,
- /// M ('measure') dimension is present.
- Dimensionality_M = 2
- };
-
- //Matches the FGF enumeration FdoGeometryType
- enum GeometryType
- {
- GeometryType_None = 0,
- GeometryType_Point = 1,
- GeometryType_LineString = 2,
- GeometryType_Polygon = 3,
- GeometryType_MultiPoint = 4,
- GeometryType_MultiLineString = 5,
- GeometryType_MultiPolygon = 6,
- GeometryType_MultiGeometry = 7,
- GeometryType_CurveString = 10,
- GeometryType_CurvePolygon = 11,
- GeometryType_MultiCurveString = 12,
- GeometryType_MultiCurvePolygon = 13
- };
-
- //Matches FdoGeometryComponentType
- enum GeometryComponentType
- {
- GeometryComponentType_LinearRing = 129,
- GeometryComponentType_CircularArcSegment = 130,
- GeometryComponentType_LineStringSegment = 131,
- GeometryComponentType_Ring = 132
- };
-
STYLIZATION_API LineBuffer(int size, int dimensionality = Dimensionality_XY, bool bIgnoreZ = true);
STYLIZATION_API virtual ~LineBuffer();
@@ -300,7 +264,7 @@
STYLIZATION_API LineBufferPool();
STYLIZATION_API virtual ~LineBufferPool();
- STYLIZATION_API static LineBuffer* NewLineBuffer(LineBufferPool* pool, int requestSize, int dimensionality = LineBuffer::Dimensionality_XY, bool bIgnoreZ = true);
+ STYLIZATION_API static LineBuffer* NewLineBuffer(LineBufferPool* pool, int requestSize, int dimensionality = Dimensionality_XY, bool bIgnoreZ = true);
STYLIZATION_API static void FreeLineBuffer(LineBufferPool* pool, LineBuffer* lb);
private:
Modified: sandbox/jng/stylization_refactor/Common/Stylization/SE_ExpressionBase.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/SE_ExpressionBase.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/SE_ExpressionBase.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -23,8 +23,6 @@
using namespace MDFMODEL_NAMESPACE;
-extern void ProcessStylizerException(FdoException* exception, int line, wchar_t* file);
-
void SE_ExpressionBase::SetParameterValues(OverrideCollection* overrides)
{
m_parameters.clear();
Modified: sandbox/jng/stylization_refactor/Common/Stylization/SE_LineBuffer.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/SE_LineBuffer.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/SE_LineBuffer.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -301,7 +301,7 @@
}
}
- m_xf_buf->SetGeometryType(LineBuffer::GeometryType_LineString);
+ m_xf_buf->SetGeometryType(GeometryType_LineString);
}
Modified: sandbox/jng/stylization_refactor/Common/Stylization/SE_LineRenderer.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/SE_LineRenderer.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/SE_LineRenderer.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -269,7 +269,7 @@
SE_RenderPolyline* pl = (SE_RenderPolyline*)primitive;
// create the chopped up LineBuffer for this primitive
- choppedBuffers[cur_prim] = LineBufferPool::NewLineBuffer(lbp, 128, FdoDimensionality_XY, true);
+ choppedBuffers[cur_prim] = LineBufferPool::NewLineBuffer(lbp, 128, Dimensionality_XY, true);
ChopLineBuffer(pl->geometry->xf_buffer(), choppedBuffers[cur_prim]);
// update rendering attributes to account for the selection mode - it's
@@ -291,7 +291,7 @@
SE_RenderText* tp = (SE_RenderText*)primitive;
// create the chopped up LineBuffer for this primitive
- choppedBuffers[cur_prim] = LineBufferPool::NewLineBuffer(lbp, 1, FdoDimensionality_XY, true);
+ choppedBuffers[cur_prim] = LineBufferPool::NewLineBuffer(lbp, 1, Dimensionality_XY, true);
choppedBuffers[cur_prim]->MoveTo(tp->position[0], tp->position[1]);
// update rendering attributes to account for the selection mode - it's
@@ -309,7 +309,7 @@
SE_RenderRaster* rp = (SE_RenderRaster*)primitive;
// create the chopped up LineBuffer for this primitive
- choppedBuffers[cur_prim] = LineBufferPool::NewLineBuffer(lbp, 1, FdoDimensionality_XY, true);
+ choppedBuffers[cur_prim] = LineBufferPool::NewLineBuffer(lbp, 1, Dimensionality_XY, true);
choppedBuffers[cur_prim]->MoveTo(rp->position[0], rp->position[1]);
// raster primitive don't have any rendering attributes that need to be
@@ -323,7 +323,7 @@
}
// this will be our work buffer
- LineBuffer geom(maxChoppedSize, FdoDimensionality_XY, true);
+ LineBuffer geom(maxChoppedSize, Dimensionality_XY, true);
// for each contour
for (int cur_contour=0; cur_contour<geometry->cntr_count(); ++cur_contour)
@@ -1643,7 +1643,7 @@
if (geometry.point_type(0) != (unsigned char)LineBuffer::stMoveTo)
return NULL;
- LineBuffer* ret = LineBufferPool::NewLineBuffer(lbp, geometry.point_count(), FdoDimensionality_XY, true);
+ LineBuffer* ret = LineBufferPool::NewLineBuffer(lbp, geometry.point_count(), Dimensionality_XY, true);
std::auto_ptr<LineBuffer> spRetLB(ret);
ret->SetGeometryType(geometry.geom_type());
@@ -1713,7 +1713,7 @@
if (geometry.point_type(0) != (unsigned char)LineBuffer::stMoveTo)
return NULL;
- LineBuffer* ret = LineBufferPool::NewLineBuffer(lbp, geometry.point_count(), FdoDimensionality_XY, true);
+ LineBuffer* ret = LineBufferPool::NewLineBuffer(lbp, geometry.point_count(), Dimensionality_XY, true);
std::auto_ptr<LineBuffer> spRetLB(ret);
ret->SetGeometryType(geometry.geom_type());
Modified: sandbox/jng/stylization_refactor/Common/Stylization/SE_Renderer.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/SE_Renderer.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/SE_Renderer.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -196,10 +196,10 @@
{
switch (featGeom->geom_type())
{
- case FdoGeometryType_LineString:
- case FdoGeometryType_MultiLineString:
- case FdoGeometryType_Polygon:
- case FdoGeometryType_MultiPolygon:
+ case GeometryType_LineString:
+ case GeometryType_MultiLineString:
+ case GeometryType_Polygon:
+ case GeometryType_MultiPolygon:
{
double x0, y0;
featGeom->Centroid(LineBuffer::ctLine, &x0, &y0, &angleRad);
@@ -266,8 +266,8 @@
// can't apply a line style to point geometry types
switch (featGeom->geom_type())
{
- case FdoGeometryType_Point:
- case FdoGeometryType_MultiPoint:
+ case GeometryType_Point:
+ case GeometryType_MultiPoint:
return;
}
@@ -339,12 +339,12 @@
// can't apply an area style to point and linestring geometry types
switch (featGeom->geom_type())
{
- case FdoGeometryType_Point:
- case FdoGeometryType_MultiPoint:
- case FdoGeometryType_LineString:
- case FdoGeometryType_MultiLineString:
- case FdoGeometryType_CurveString:
- case FdoGeometryType_MultiCurveString:
+ case GeometryType_Point:
+ case GeometryType_MultiPoint:
+ case GeometryType_LineString:
+ case GeometryType_MultiLineString:
+ case GeometryType_CurveString:
+ case GeometryType_MultiCurveString:
return;
}
Modified: sandbox/jng/stylization_refactor/Common/Stylization/Stylization.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/Stylization.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/Stylization.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -81,16 +81,6 @@
#include "Base64.h"
-// FDO headers
-#pragma warning(push)
-#pragma warning(disable: 4201)
-#include "Fdo.h"
-#include "FdoExpressionEngine.h"
-#include "FdoExpressionEngineFunctionCollection.h"
-#include "FdoExpressionEngineINonAggregateFunction.h"
-#pragma warning(pop)
-
-
#ifndef __WFILE__
// Wide character version of __FILE__ macro
#define WIDEN2(x) L ## x
@@ -98,12 +88,6 @@
#define __WFILE__ WIDEN(__FILE__)
#endif
-//Non-fatal FDO exception logging mechanism
-//Implementation is defined in Stylizer.cpp
-typedef void (*StylizerExceptionCallback)(FdoException* exception, int line, wchar_t* file);
-void ProcessStylizerException(FdoException* exception);
-STYLIZATION_API void SetStylizerExceptionCallback(StylizerExceptionCallback callbackFunction);
-
// avoid linux warnings
#ifndef _WIN32
static const void* avoid_warning1 = (void*)FDO_ACTIVELONGTRANSACTION;
Modified: sandbox/jng/stylization_refactor/Common/Stylization/Stylization.vcxproj
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/Stylization.vcxproj 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/Stylization.vcxproj 2013-08-08 13:46:08 UTC (rev 7745)
@@ -328,6 +328,7 @@
<ClInclude Include="Bounds.h" />
<ClInclude Include="DataValueStack.h" />
<ClInclude Include="FdoEvaluator.h" />
+ <ClInclude Include="FdoStylizationCommon.h" />
<ClInclude Include="LineBuffer.h" />
<ClInclude Include="Matrix3D.h" />
<ClInclude Include="Point2D.h" />
Modified: sandbox/jng/stylization_refactor/Common/Stylization/Stylization.vcxproj.filters
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/Stylization.vcxproj.filters 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/Stylization.vcxproj.filters 2013-08-08 13:46:08 UTC (rev 7745)
@@ -620,6 +620,9 @@
<ClInclude Include="FdoEvaluator.h">
<Filter>ExpressionEngine</Filter>
</ClInclude>
+ <ClInclude Include="FdoStylizationCommon.h">
+ <Filter>ExpressionEngine</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Stylization.rc" />
Modified: sandbox/jng/stylization_refactor/Common/Stylization/StylizationDefs.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/StylizationDefs.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/StylizationDefs.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -30,6 +30,43 @@
#include <limits>
#include <climits>
+//Matches the FGF enumeration FdoDimensionality
+enum Dimensionality
+{
+ /// X and Y dimensions are present.
+ Dimensionality_XY = 0,
+ /// Z dimension is present.
+ Dimensionality_Z = 1,
+ /// M ('measure') dimension is present.
+ Dimensionality_M = 2
+};
+
+//Matches the FGF enumeration FdoGeometryType
+enum GeometryType
+{
+ GeometryType_None = 0,
+ GeometryType_Point = 1,
+ GeometryType_LineString = 2,
+ GeometryType_Polygon = 3,
+ GeometryType_MultiPoint = 4,
+ GeometryType_MultiLineString = 5,
+ GeometryType_MultiPolygon = 6,
+ GeometryType_MultiGeometry = 7,
+ GeometryType_CurveString = 10,
+ GeometryType_CurvePolygon = 11,
+ GeometryType_MultiCurveString = 12,
+ GeometryType_MultiCurvePolygon = 13
+};
+
+//Matches FdoGeometryComponentType
+enum GeometryComponentType
+{
+ GeometryComponentType_LinearRing = 129,
+ GeometryComponentType_CircularArcSegment = 130,
+ GeometryComponentType_LineStringSegment = 131,
+ GeometryComponentType_Ring = 132
+};
+
// frequently used constants
const double M_PI180 = (M_PI / 180.0);
const double M_180PI = (180.0 / M_PI);
Modified: sandbox/jng/stylization_refactor/Common/Stylization/StylizationEngine.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/StylizationEngine.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/StylizationEngine.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -35,8 +35,6 @@
using namespace MDFMODEL_NAMESPACE;
-extern void ProcessStylizerException(FdoException* exception, int line, wchar_t* file);
-
StylizationEngine::StylizationEngine(SE_SymbolManager* resources, SE_BufferPool* pool) :
m_resources(resources),
m_pool(pool),
@@ -797,14 +795,9 @@
if (!match)
{
- try
- {
+ STYLIZATION_TRY()
match = eval->ExecFilter(&rules[i].filter);
- }
- catch (FdoException* e)
- {
- ProcessStylizerException(e, __LINE__, __WFILE__);
- }
+ STYLIZATION_CATCH(L"StylizationEngine.Stylize")
}
if (match)
Modified: sandbox/jng/stylization_refactor/Common/Stylization/StylizationUtil.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/StylizationUtil.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/StylizationUtil.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -26,8 +26,6 @@
#include "FdoEvaluator.h"
#include <cmath>
-extern void ProcessStylizerException(FdoException* exception, int line, wchar_t* file);
-
///////////////////////////////////////////////////////////////////////////////
void StylizationUtil::ParseColor(const MdfString& colorstr, RS_Color& rscol)
{
@@ -125,8 +123,8 @@
pSERenderer->StartLayer(NULL, NULL);
- try
- {
+ STYLIZATION_TRY()
+
int type = FeatureTypeStyleVisitor::DetermineFeatureTypeStyle(fts);
switch (type)
{
@@ -188,15 +186,9 @@
default:
break;
}
- }
- catch (FdoException* e)
- {
- ProcessStylizerException(e, __LINE__, __WFILE__);
- }
- catch (...)
- {
- }
+ STYLIZATION_CATCH(L"StylizationUtil.DrawStylePreview")
+
pSERenderer->EndLayer();
pSERenderer->EndMap();
}
Modified: sandbox/jng/stylization_refactor/Common/Stylization/Stylizer.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/Stylizer.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/Stylizer.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -52,21 +52,3 @@
return NULL;
}
-// Non-fatal stylizer exception logging mechanism.
-static StylizerExceptionCallback g_stylizerExceptionCallback = NULL;
-
-void SetStylizerExceptionCallback(StylizerExceptionCallback callbackFunction)
-{
- g_stylizerExceptionCallback = callbackFunction;
-}
-
-void ProcessStylizerException(FdoException* exception, int line, wchar_t* file)
-{
- if (NULL != g_stylizerExceptionCallback)
- {
- (*g_stylizerExceptionCallback)(exception, line, file);
- }
- exception->Release();
-}
-
-
Modified: sandbox/jng/stylization_refactor/Common/Stylization/Stylizer.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/Stylizer.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/Stylizer.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -88,7 +88,7 @@
///<summary>
/// Allows a user to set a custom stylization object for a given geometry type.
///</summary>
- virtual void SetGeometryAdapter(LineBuffer::GeometryType type, GeometryAdapter* stylizer) = 0;
+ virtual void SetGeometryAdapter(GeometryType type, GeometryAdapter* stylizer) = 0;
STYLIZATION_API static MdfModel::VectorScaleRange* FindScaleRange(MdfModel::VectorScaleRangeCollection& src, double mapScale);
STYLIZATION_API static MdfModel::GridScaleRange* FindScaleRange(MdfModel::GridScaleRangeCollection& src, double mapScale);
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ThemeParameters.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ThemeParameters.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ThemeParameters.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -17,25 +17,19 @@
#include "stdafx.h"
#include "ThemeParameters.h"
+#include "FdoEvaluator.h"
static const wchar_t* sEmpty = L"";
-extern void ProcessStylizerException(FdoException* exception, int line, wchar_t* file);
-
//////////////////////////////////////////////////////////////////////////////
ThemeParameters* ThemeParameters::Parse(const wchar_t* expressionString)
{
// parse the expression and see if it consists of one of our theming functions
FdoPtr<FdoExpression> expression;
- try
- {
+ STYLIZATION_TRY()
expression = FdoExpression::Parse(expressionString);
- }
- catch (FdoException* e)
- {
- ProcessStylizerException(e, __LINE__, __WFILE__);
- }
+ STYLIZATION_CATCH(L"ThemeParameters.Parse")
FdoFunction* function = dynamic_cast<FdoFunction*>(expression.p);
if (function != NULL)
Modified: sandbox/jng/stylization_refactor/Common/Stylization/ThemeParameters.h
===================================================================
--- sandbox/jng/stylization_refactor/Common/Stylization/ThemeParameters.h 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Common/Stylization/ThemeParameters.h 2013-08-08 13:46:08 UTC (rev 7745)
@@ -20,8 +20,8 @@
#include "Stylization.h"
#include "RendererStyles.h"
+#include "FdoStylizationCommon.h"
-
//////////////////////////////////////////////////////////////////////////////
class ThemeParameters
{
Modified: sandbox/jng/stylization_refactor/Server/src/Services/Mapping/MappingUtil.cpp
===================================================================
--- sandbox/jng/stylization_refactor/Server/src/Services/Mapping/MappingUtil.cpp 2013-08-07 16:29:48 UTC (rev 7744)
+++ sandbox/jng/stylization_refactor/Server/src/Services/Mapping/MappingUtil.cpp 2013-08-08 13:46:08 UTC (rev 7745)
@@ -20,6 +20,7 @@
#include "AGGRenderer.h"
#include "Bounds.h"
#include "DefaultStylizer.h"
+#include "FdoEvaluator.h"
#include "Fdo.h"
#include "Renderer.h"
#include "SAX2Parser.h"
@@ -1275,7 +1276,7 @@
///////////////////////////////////////////////////////////////////////////////
-void MgMappingUtilExceptionTrap(FdoException* except, int line, wchar_t* file)
+void MgMappingUtilExceptionTrap(FdoException* except, int line, wchar_t* file, wchar_t* methodName)
{
MG_TRY()
@@ -1290,9 +1291,11 @@
arguments.Add(buf);
}
- mgException = new MgFdoException(L"MgStylizationUtil.ExceptionTrap", line, file, NULL, messageId, &arguments, nativeErrorCode);
+ mgException = new MgFdoException(methodName, line, file, NULL, messageId, &arguments, nativeErrorCode);
+ //Throw it to record this method in the stack trace
+ MG_THROW()
- MG_CATCH(L"MgStylizationUtil.ExceptionTrap")
+ MG_CATCH(L"MgMappingUtilExceptionTrap")
MgServerManager* serverManager = MgServerManager::GetInstance();
STRING locale = (NULL == serverManager) ?
@@ -1308,7 +1311,7 @@
///////////////////////////////////////////////////////////////////////////////
void MgMappingUtil::InitializeStylizerCallback()
{
- SetStylizerExceptionCallback(&MgMappingUtilExceptionTrap);
+ FdoEvaluator::SetStylizerExceptionCallback(&MgMappingUtilExceptionTrap);
}
More information about the mapguide-commits
mailing list