[mapguide-commits] r5390 - in sandbox/rfc90/MgDev/Common: .
CoordinateSystem Foundation Foundation/Data Foundation/System
Geometry Geometry/Buffer Geometry/CoordinateSystem
Geometry/GeometryConsoleTest Geometry/Parse Geometry/Spatial
MapGuideCommon MapGuideCommon/MapLayer
MapGuideCommon/Resources MapGuideCommon/Services
MapGuideCommon/System MdfModel MdfParser PlatformBase
PlatformBase/Data PlatformBase/MapLayer PlatformBase/Services
Renderers Schema Stylization
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Sat Nov 13 13:14:36 EST 2010
Author: uvlite
Date: 2010-11-13 10:14:35 -0800 (Sat, 13 Nov 2010)
New Revision: 5390
Removed:
sandbox/rfc90/MgDev/Common/Stylization/SE_LineRenderer.h
Modified:
sandbox/rfc90/MgDev/Common/
sandbox/rfc90/MgDev/Common/Common.sln
sandbox/rfc90/MgDev/Common/CoordinateSystem/ArbitraryCoordsys.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSys.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSys.h
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysCatalog.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysCatalog.h
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysCategory.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDatum.h
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDatumDictionary.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDictionary.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.h
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEllipsoidDictionary.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnum.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumCategory.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumCoordinateSystemInCategory.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumDatum.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumEllipsoid.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysFormatConverter.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.h
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysGridGeneric.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysMathComparator.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysMgrs.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysProjectionInformation.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysTransform.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysUnitInformation.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysUtil.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/CriticalSection.h
sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorDictionary.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorDictionary.h
sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorUtil.cpp
sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorUtil.h
sandbox/rfc90/MgDev/Common/CoordinateSystem/namestruct.h
sandbox/rfc90/MgDev/Common/Foundation/Data/MimeType.cpp
sandbox/rfc90/MgDev/Common/Foundation/Data/MimeType.h
sandbox/rfc90/MgDev/Common/Foundation/Data/NamedCollection.cpp
sandbox/rfc90/MgDev/Common/Foundation/Data/StringProperty.cpp
sandbox/rfc90/MgDev/Common/Foundation/Foundation.rc
sandbox/rfc90/MgDev/Common/Foundation/Foundation.vcproj
sandbox/rfc90/MgDev/Common/Foundation/Makefile.am
sandbox/rfc90/MgDev/Common/Foundation/System/ArgumentPacket.h
sandbox/rfc90/MgDev/Common/Foundation/System/BasicPacket.h
sandbox/rfc90/MgDev/Common/Foundation/System/BinaryStreamArgumentPacket.h
sandbox/rfc90/MgDev/Common/Foundation/System/CollectionPacket.h
sandbox/rfc90/MgDev/Common/Foundation/System/Configuration.cpp
sandbox/rfc90/MgDev/Common/Foundation/System/ControlPacket.h
sandbox/rfc90/MgDev/Common/Foundation/System/Disposable.h
sandbox/rfc90/MgDev/Common/Foundation/System/GuardDisposable.cpp
sandbox/rfc90/MgDev/Common/Foundation/System/GuardDisposable.h
sandbox/rfc90/MgDev/Common/Foundation/System/OperationResponsePacket.h
sandbox/rfc90/MgDev/Common/Foundation/System/StreamReader.cpp
sandbox/rfc90/MgDev/Common/Foundation/System/XmlDefs.h
sandbox/rfc90/MgDev/Common/Foundation/System/XmlUtil.cpp
sandbox/rfc90/MgDev/Common/Geometry/Buffer/GreatCircleBufferUtil.cpp
sandbox/rfc90/MgDev/Common/Geometry/Buffer/MgBuffer.cpp
sandbox/rfc90/MgDev/Common/Geometry/Buffer/MgBuffer.h
sandbox/rfc90/MgDev/Common/Geometry/Buffer/bufrutil.cpp
sandbox/rfc90/MgDev/Common/Geometry/Buffer/planeswp.cpp
sandbox/rfc90/MgDev/Common/Geometry/CoordinateCollection.h
sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystem.h
sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemCatalog.h
sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemDatum.h
sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemEllipsoid.h
sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp
sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGeodeticTransformation.h
sandbox/rfc90/MgDev/Common/Geometry/Geometry.rc
sandbox/rfc90/MgDev/Common/Geometry/Geometry.vcproj
sandbox/rfc90/MgDev/Common/Geometry/GeometryClassId.h
sandbox/rfc90/MgDev/Common/Geometry/GeometryCommon.h
sandbox/rfc90/MgDev/Common/Geometry/GeometryConsoleTest/GeometryConsoleTest.cpp
sandbox/rfc90/MgDev/Common/Geometry/GeometryConsoleTest/GeometryConsoleTest.vcproj
sandbox/rfc90/MgDev/Common/Geometry/Makefile.am
sandbox/rfc90/MgDev/Common/Geometry/Parse/StringUtility.cpp
sandbox/rfc90/MgDev/Common/Geometry/Spatial/MathUtility.cpp
sandbox/rfc90/MgDev/Common/Geometry/Spatial/SpatialUtility.cpp
sandbox/rfc90/MgDev/Common/Geometry/Spatial/SpatialUtility.h
sandbox/rfc90/MgDev/Common/MapGuideCommon/Makefile.am
sandbox/rfc90/MgDev/Common/MapGuideCommon/MapGuideCommon.rc
sandbox/rfc90/MgDev/Common/MapGuideCommon/MapGuideCommon.vcproj
sandbox/rfc90/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp
sandbox/rfc90/MgDev/Common/MapGuideCommon/MapLayer/Map.h
sandbox/rfc90/MgDev/Common/MapGuideCommon/Resources/mapguide_en.res
sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/FeatureInformation.h
sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ImageFormats.cpp
sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ImageFormats.h
sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp
sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.h
sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp
sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ServerConnectionPool.cpp
sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ServerConnectionStack.cpp
sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/TileService.h
sandbox/rfc90/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp
sandbox/rfc90/MgDev/Common/MapGuideCommon/System/ConfigProperties.h
sandbox/rfc90/MgDev/Common/MapGuideCommon/System/UserInformation.cpp
sandbox/rfc90/MgDev/Common/MdfModel/AreaRule.cpp
sandbox/rfc90/MgDev/Common/MdfModel/AreaSymbolization2D.cpp
sandbox/rfc90/MgDev/Common/MdfModel/CompositeRule.cpp
sandbox/rfc90/MgDev/Common/MdfModel/Label.cpp
sandbox/rfc90/MgDev/Common/MdfModel/LayerDefinition.cpp
sandbox/rfc90/MgDev/Common/MdfModel/LayerDefinition.h
sandbox/rfc90/MgDev/Common/MdfModel/LengthConverter.h
sandbox/rfc90/MgDev/Common/MdfModel/LineSymbolization2D.cpp
sandbox/rfc90/MgDev/Common/MdfModel/LineUsage.cpp
sandbox/rfc90/MgDev/Common/MdfModel/Makefile.am
sandbox/rfc90/MgDev/Common/MdfModel/MapDefinition.cpp
sandbox/rfc90/MgDev/Common/MdfModel/MapDefinition.h
sandbox/rfc90/MgDev/Common/MdfModel/MarkSymbol.cpp
sandbox/rfc90/MgDev/Common/MdfModel/MdfModel.rc
sandbox/rfc90/MgDev/Common/MdfModel/MdfModel.vcproj
sandbox/rfc90/MgDev/Common/MdfModel/MdfOwnerCollection.h
sandbox/rfc90/MgDev/Common/MdfModel/Override.cpp
sandbox/rfc90/MgDev/Common/MdfModel/PointRule.cpp
sandbox/rfc90/MgDev/Common/MdfModel/PointSymbolization2D.cpp
sandbox/rfc90/MgDev/Common/MdfModel/Rule.cpp
sandbox/rfc90/MgDev/Common/MdfModel/SimpleSymbol.cpp
sandbox/rfc90/MgDev/Common/MdfModel/SimpleSymbolDefinition.cpp
sandbox/rfc90/MgDev/Common/MdfModel/SymbolInstance.cpp
sandbox/rfc90/MgDev/Common/MdfModel/Text.cpp
sandbox/rfc90/MgDev/Common/MdfModel/VectorLayerDefinition.h
sandbox/rfc90/MgDev/Common/MdfModel/VectorScaleRange.cpp
sandbox/rfc90/MgDev/Common/MdfParser/FSDSAX2Parser.cpp
sandbox/rfc90/MgDev/Common/MdfParser/FSDSAX2Parser.h
sandbox/rfc90/MgDev/Common/MdfParser/IOAreaTypeStyle.cpp
sandbox/rfc90/MgDev/Common/MdfParser/IOCompositeTypeStyle.cpp
sandbox/rfc90/MgDev/Common/MdfParser/IOCompoundSymbolDefinition.cpp
sandbox/rfc90/MgDev/Common/MdfParser/IODrawingLayerDefinition.cpp
sandbox/rfc90/MgDev/Common/MdfParser/IODrawingLayerDefinition.h
sandbox/rfc90/MgDev/Common/MdfParser/IOGridLayerDefinition.cpp
sandbox/rfc90/MgDev/Common/MdfParser/IOGridLayerDefinition.h
sandbox/rfc90/MgDev/Common/MdfParser/IOLabel.cpp
sandbox/rfc90/MgDev/Common/MdfParser/IOLineRule.cpp
sandbox/rfc90/MgDev/Common/MdfParser/IOLineTypeStyle.cpp
sandbox/rfc90/MgDev/Common/MdfParser/IOMapDefinition.cpp
sandbox/rfc90/MgDev/Common/MdfParser/IOMapDefinition.h
sandbox/rfc90/MgDev/Common/MdfParser/IOMapLayerGroupCommon.cpp
sandbox/rfc90/MgDev/Common/MdfParser/IOMapLayerGroupCommon.h
sandbox/rfc90/MgDev/Common/MdfParser/IOPointTypeStyle.cpp
sandbox/rfc90/MgDev/Common/MdfParser/IOSimpleSymbolDefinition.cpp
sandbox/rfc90/MgDev/Common/MdfParser/IOSymbolInstance.cpp
sandbox/rfc90/MgDev/Common/MdfParser/IOVectorLayerDefinition.cpp
sandbox/rfc90/MgDev/Common/MdfParser/IOVectorLayerDefinition.h
sandbox/rfc90/MgDev/Common/MdfParser/Makefile.am
sandbox/rfc90/MgDev/Common/MdfParser/MdfParser.rc
sandbox/rfc90/MgDev/Common/MdfParser/MdfParser.vcproj
sandbox/rfc90/MgDev/Common/MdfParser/SAX2Parser.cpp
sandbox/rfc90/MgDev/Common/MdfParser/SAX2Parser.h
sandbox/rfc90/MgDev/Common/PlatformBase/Data/BlobProperty.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Data/BooleanProperty.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Data/ByteProperty.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Data/ClobProperty.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Data/DateTimeProperty.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Data/DoubleProperty.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Data/Int16Property.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Data/Int32Property.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Data/Int64Property.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Data/SingleProperty.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Makefile.am
sandbox/rfc90/MgDev/Common/PlatformBase/MapLayer/MapBase.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/MapLayer/MapBase.h
sandbox/rfc90/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBase.h
sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBase.rc
sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBase.vcproj
sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBaseBuild.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureAggregateOptions.h
sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureProperty.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureQueryOptions.h
sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureService.h
sandbox/rfc90/MgDev/Common/PlatformBase/Services/GeometryProperty.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Services/PlatformBaseClassId.h
sandbox/rfc90/MgDev/Common/PlatformBase/Services/RasterProperty.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Services/ResourceDefs.cpp
sandbox/rfc90/MgDev/Common/PlatformBase/Services/ResourceDefs.h
sandbox/rfc90/MgDev/Common/Renderers/AGGImageIO.cpp
sandbox/rfc90/MgDev/Common/Renderers/AGGImageIO.h
sandbox/rfc90/MgDev/Common/Renderers/AGGRenderer.cpp
sandbox/rfc90/MgDev/Common/Renderers/AGGRenderer.h
sandbox/rfc90/MgDev/Common/Renderers/AGGW2DRewriter.cpp
sandbox/rfc90/MgDev/Common/Renderers/DWFRenderer.cpp
sandbox/rfc90/MgDev/Common/Renderers/DWFRenderer.h
sandbox/rfc90/MgDev/Common/Renderers/EMapRenderer.cpp
sandbox/rfc90/MgDev/Common/Renderers/EPlotRenderer.cpp
sandbox/rfc90/MgDev/Common/Renderers/FontManager.cpp
sandbox/rfc90/MgDev/Common/Renderers/FontManager.h
sandbox/rfc90/MgDev/Common/Renderers/GDRenderer.cpp
sandbox/rfc90/MgDev/Common/Renderers/GDRenderer.h
sandbox/rfc90/MgDev/Common/Renderers/GDW2DRewriter.cpp
sandbox/rfc90/MgDev/Common/Renderers/KmlRenderer.cpp
sandbox/rfc90/MgDev/Common/Renderers/KmlRenderer.h
sandbox/rfc90/MgDev/Common/Renderers/Makefile.am
sandbox/rfc90/MgDev/Common/Renderers/RS_ByteData.cpp
sandbox/rfc90/MgDev/Common/Renderers/Renderers.rc
sandbox/rfc90/MgDev/Common/Renderers/Renderers.vcproj
sandbox/rfc90/MgDev/Common/Schema/BatchPropertyCollection-1.0.0.xsd
sandbox/rfc90/MgDev/Common/Stylization/Band.cpp
sandbox/rfc90/MgDev/Common/Stylization/BandData.cpp
sandbox/rfc90/MgDev/Common/Stylization/DataValueStack.h
sandbox/rfc90/MgDev/Common/Stylization/DefaultStylizer.cpp
sandbox/rfc90/MgDev/Common/Stylization/DefaultStylizer.h
sandbox/rfc90/MgDev/Common/Stylization/ExpressionHelper.cpp
sandbox/rfc90/MgDev/Common/Stylization/GeometryAdapter.cpp
sandbox/rfc90/MgDev/Common/Stylization/GridData.cpp
sandbox/rfc90/MgDev/Common/Stylization/GridThemeParser.cpp
sandbox/rfc90/MgDev/Common/Stylization/LabelRenderer.cpp
sandbox/rfc90/MgDev/Common/Stylization/LabelRendererLocal.cpp
sandbox/rfc90/MgDev/Common/Stylization/LineBuffer.cpp
sandbox/rfc90/MgDev/Common/Stylization/LineBuffer.h
sandbox/rfc90/MgDev/Common/Stylization/Makefile.am
sandbox/rfc90/MgDev/Common/Stylization/PointAdapter.cpp
sandbox/rfc90/MgDev/Common/Stylization/PolygonAdapter.cpp
sandbox/rfc90/MgDev/Common/Stylization/PolylineAdapter.cpp
sandbox/rfc90/MgDev/Common/Stylization/RS_FontEngine.cpp
sandbox/rfc90/MgDev/Common/Stylization/RasterAdapter.cpp
sandbox/rfc90/MgDev/Common/Stylization/Renderer.h
sandbox/rfc90/MgDev/Common/Stylization/RichTextEngine.cpp
sandbox/rfc90/MgDev/Common/Stylization/SE_AreaPositioning.cpp
sandbox/rfc90/MgDev/Common/Stylization/SE_ExpressionBase.cpp
sandbox/rfc90/MgDev/Common/Stylization/SE_LineBuffer.cpp
sandbox/rfc90/MgDev/Common/Stylization/SE_LineBuffer.h
sandbox/rfc90/MgDev/Common/Stylization/SE_LineRenderer.cpp
sandbox/rfc90/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp
sandbox/rfc90/MgDev/Common/Stylization/SE_RenderProxies.h
sandbox/rfc90/MgDev/Common/Stylization/SE_Renderer.cpp
sandbox/rfc90/MgDev/Common/Stylization/SE_Renderer.h
sandbox/rfc90/MgDev/Common/Stylization/SE_StyleVisitor.cpp
sandbox/rfc90/MgDev/Common/Stylization/SE_SymbolDefProxies.cpp
sandbox/rfc90/MgDev/Common/Stylization/SE_SymbolDefProxies.h
sandbox/rfc90/MgDev/Common/Stylization/Stylization.h
sandbox/rfc90/MgDev/Common/Stylization/Stylization.rc
sandbox/rfc90/MgDev/Common/Stylization/Stylization.vcproj
sandbox/rfc90/MgDev/Common/Stylization/StylizationEngine.cpp
sandbox/rfc90/MgDev/Common/Stylization/StylizationEngine.h
sandbox/rfc90/MgDev/Common/Stylization/StylizationUtil.cpp
sandbox/rfc90/MgDev/Common/Stylization/Stylizer.h
sandbox/rfc90/MgDev/Common/Stylization/ThemeParameters.cpp
sandbox/rfc90/MgDev/Common/Stylization/atom.h
sandbox/rfc90/MgDev/Common/Stylization/atom_element_style.cpp
sandbox/rfc90/MgDev/Common/Stylization/mtext_parser.cpp
sandbox/rfc90/MgDev/Common/Stylization/stdafx.h
Log:
rfc90 merge trunk
Property changes on: sandbox/rfc90/MgDev/Common
___________________________________________________________________
Added: svn:mergeinfo
+ /trunk/MgDev/Common:4715-5096
Modified: sandbox/rfc90/MgDev/Common/Common.sln
===================================================================
--- sandbox/rfc90/MgDev/Common/Common.sln 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Common.sln 2010-11-13 18:14:35 UTC (rev 5390)
@@ -49,6 +49,11 @@
{C50254F2-654A-48DE-AF5B-20605AEF8D10} = {C50254F2-654A-48DE-AF5B-20605AEF8D10}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GeometryConsoleTest", "Geometry\GeometryConsoleTest\GeometryConsoleTest.vcproj", "{F1285F4D-3CB7-427A-A2E8-43A575932C9F}"
+ ProjectSection(ProjectDependencies) = postProject
+ {D954DAAC-E305-40CE-B3F3-C229A0BEF4F0} = {D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -125,6 +130,12 @@
{96CA495A-2450-4F27-B318-E95D24268AAE}.Debug|x64.ActiveCfg = Debug|x64
{96CA495A-2450-4F27-B318-E95D24268AAE}.Release|Win32.ActiveCfg = Release|Win32
{96CA495A-2450-4F27-B318-E95D24268AAE}.Release|x64.ActiveCfg = Release|x64
+ {F1285F4D-3CB7-427A-A2E8-43A575932C9F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F1285F4D-3CB7-427A-A2E8-43A575932C9F}.Debug|Win32.Build.0 = Debug|Win32
+ {F1285F4D-3CB7-427A-A2E8-43A575932C9F}.Debug|x64.ActiveCfg = Debug|Win32
+ {F1285F4D-3CB7-427A-A2E8-43A575932C9F}.Release|Win32.ActiveCfg = Release|Win32
+ {F1285F4D-3CB7-427A-A2E8-43A575932C9F}.Release|Win32.Build.0 = Release|Win32
+ {F1285F4D-3CB7-427A-A2E8-43A575932C9F}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/ArbitraryCoordsys.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/ArbitraryCoordsys.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/ArbitraryCoordsys.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -92,7 +92,7 @@
{
return NULL;
}
- if (ProjectionFromString(pcsDefPtr->prj_knm)!=MgCoordinateSystemProjectionCode::Nerth)
+ if (!ProjectionIsNerthType (pcsDefPtr->prj_knm))
{
return NULL;
}
@@ -529,7 +529,7 @@
}
- if(szComponent) delete [] szComponent;
+ delete [] szComponent;
return bOK;
}
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSys.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSys.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSys.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -81,7 +81,7 @@
{
//if an arbitrary coordinate system it has to DT and no EL
//it uses the NERTH projection
- if (ProjectionFromString(csprm.csdef.prj_knm)==MgCoordinateSystemProjectionCode::Nerth)
+ if (ProjectionIsNerthType (csprm.csdef.prj_knm))
{
//Everything worked okay! Copy the data into our member variables.
Uninitialize();
@@ -108,7 +108,7 @@
//if an arbitrary coordinate system it has to DT and no EL
//it uses the NERTH projection
- if (ProjectionFromString(csdef.prj_knm)==MgCoordinateSystemProjectionCode::Nerth)
+ if (ProjectionIsNerthType (csdef.prj_knm))
{
//Everything worked okay! Copy the data into our member variables.
Uninitialize();
@@ -202,7 +202,7 @@
nCoordinateSystemType=MgCoordinateSystemType::Unknown;
}
//arbitrary systems, the one that use the NERTH projection
- else if(ProjectionFromString(m_csprm.csdef.prj_knm)==MgCoordinateSystemProjectionCode::Nerth)
+ else if(ProjectionIsNerthType (m_csprm.csdef.prj_knm))
{
nCoordinateSystemType = MgCoordinateSystemType::Arbitrary;
}
@@ -1120,7 +1120,7 @@
}
//in case of NERTH we have no datum and no ellipsoid
- if (MgCoordinateSystemProjectionCode::Nerth==prjType)
+ if (ProjectionIsNerthType (prjType))
{
memset(m_csprm.csdef.dat_knm, 0, sizeof(m_csprm.csdef.dat_knm));
memset(m_csprm.csdef.elp_knm, 0, sizeof(m_csprm.csdef.elp_knm));
@@ -1149,7 +1149,7 @@
MG_TRY()
- if (ProjectionFromString(m_csprm.csdef.prj_knm)==MgCoordinateSystemProjectionCode::Nerth)
+ if (ProjectionIsNerthType (m_csprm.csdef.prj_knm))
{
//It's an arbitrary system.
assert(NULL==m_pDatum);
@@ -1207,7 +1207,7 @@
MG_TRY()
- if (ProjectionFromString(m_csprm.csdef.prj_knm)==MgCoordinateSystemProjectionCode::Nerth)
+ if (ProjectionIsNerthType (m_csprm.csdef.prj_knm))
{
//It's an arbitrary system.
assert(NULL==m_pDatum);
@@ -1268,7 +1268,37 @@
}
return m_pEllipsoid->GetDescription();
}
-
+/////////////////////////////////////////////////////////////////
+/// <summary>
+/// Returns the EPSG code for this system, else zero.
+/// </summary>
+INT32 CCoordinateSystem::GetEpsgCode (void)
+{
+ return static_cast<INT32>(m_csprm.csdef.epsgNbr);
+}
+/////////////////////////////////////////////////////////////////
+/// <summary>
+/// Returns the Oracle SRID code for this system, else zero.
+/// </summary>
+INT32 CCoordinateSystem::GetSridCode (void)
+{
+ return static_cast<INT32>(m_csprm.csdef.srid);
+}
+/////////////////////////////////////////////////////////////////
+/// <summary>
+/// Returns the quadrant specification in the EPSG data set for
+/// this definition. The returned value is zero if the system
+/// does not have an EPSG equivalent. The format of the
+/// returned value is in the same form as the CS-MAP quad value,
+/// but the value may be different. CS-MAP definitions often
+/// ignore the swapping of axes as is indicated in the EPSG
+/// database. Not doing so produces rotated and mirroed displays
+/// which are _NOT_ what the customer desires or expects.
+/// </summary>
+INT16 CCoordinateSystem::GetEpsgQuadrant (void)
+{
+ return static_cast<INT16>(m_csprm.csdef.epsg_qd);
+}
///////////////////////////////////////////////////////////////////////////
MgStringCollection* CCoordinateSystem::GetCategories()
{
@@ -1342,7 +1372,7 @@
MG_TRY()
- if (ProjectionFromString(m_csprm.csdef.prj_knm)==MgCoordinateSystemProjectionCode::Nerth)
+ if (ProjectionIsNerthType (m_csprm.csdef.prj_knm))
{
return true;
}
@@ -1416,7 +1446,7 @@
}
//no DT or EL reference for NERTH
- if (ProjectionFromString(m_csprm.csdef.prj_knm)==MgCoordinateSystemProjectionCode::Nerth)
+ if (ProjectionIsNerthType (m_csprm.csdef.prj_knm))
{
return true;
}
@@ -1620,6 +1650,10 @@
pNew->m_csprm = m_csprm;
pNew->m_bEncrypted = m_bEncrypted;
+ //unset the EPSG code; we've an editable instance now where we neither can guarantee the correctness of the EPSG code
+ //nor is it currently supported by CsMap's NameMapper anyway
+ pNew->m_csprm.csdef.epsgNbr = 0;
+
if (m_pDatum)
{
Ptr<MgCoordinateSystemDatum> pDtClone=m_pDatum->CreateClone();
@@ -2421,7 +2455,7 @@
throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
}
//no DT or EL if NERTH projection is used
- if (MgCoordinateSystemProjectionCode::Nerth==GetProjectionCode())
+ if (ProjectionIsNerthType (GetProjectionCode()))
{
throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumIfArbitraryException", NULL);
}
@@ -2450,7 +2484,7 @@
throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoid", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
}
//no DT or EL if NERTH projection is used
- if (MgCoordinateSystemProjectionCode::Nerth==GetProjectionCode())
+ if (ProjectionIsNerthType (GetProjectionCode()))
{
throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoid", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumIfArbitraryException", NULL);
}
@@ -2504,7 +2538,7 @@
*/
//no DT or EL if NERTH projection is used
- if (MgCoordinateSystemProjectionCode::Nerth==GetProjectionCode())
+ if (ProjectionIsNerthType (GetProjectionCode()))
{
throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumIfArbitraryException", NULL);
}
@@ -2657,7 +2691,7 @@
*/
//no DT or EL if NERTH projection is used
- if (MgCoordinateSystemProjectionCode::Nerth==GetProjectionCode())
+ if (ProjectionIsNerthType (GetProjectionCode()))
{
throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoEllipsoidIfArbitraryException", NULL);
}
@@ -3025,7 +3059,7 @@
}
m_csprm.csdef.quad = 1;
m_csprm.csdef.order = m_csprm.csdef.zones = 0;
- m_csprm.csdef.auto_geoid = m_csprm.csdef.elev_tech = 0;
+ m_csprm.csdef.epsgNbr = m_csprm.csdef.srid = m_csprm.csdef.epsg_qd = 0;
//Set defaults specifically according to the current projection
//type. If the current projection type is undefined, set to zero.
@@ -3379,5 +3413,3 @@
size_t size=sizeof(m_csprm.csdef)+sizeof(UINT8);
return static_cast<UINT32>(size);
}
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSys.h
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSys.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSys.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -72,6 +72,10 @@
virtual STRING GetEllipsoid(); /// __get
virtual STRING GetEllipsoidDescription(); /// __get
+ virtual INT32 GetEpsgCode (void); /// __get
+ virtual INT32 GetSridCode (void); /// __get
+ virtual INT16 GetEpsgQuadrant (void); /// __get
+
virtual MgCoordinateSystemMeasure* GetMeasure();
virtual MgStringCollection* GetCategories();
virtual MgCoordinateSystemCatalog* GetCatalog();
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysCatalog.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysCatalog.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysCatalog.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -18,6 +18,7 @@
#include "GeometryCommon.h"
#include "CoordSysCommon.h"
#include "CriticalSection.h"
+#include "CoordSysUtil.h" //for Convert_Wide_To_Ascii, CsDictionaryOpenMode
#include "CoordSysCategory.h" //for CCategoryName
#include "CoordSysTransform.h" //for CCoordinateSystemTransform
@@ -25,9 +26,18 @@
#include "CoordSysDictionary.h" //for CCoordinateSystemDictionary
#include "CoordSysEnumDatum.h" //for CCoordinateSystemEnumDatum
#include "CoordSysEnumEllipsoid.h" //for CCoordinateSystemEnumEllipsoid
+#include "CoordSysDictionaryBase.h" //for CCoordinateSystemDictionaryBase
+#include "CoordSysGeodeticPath.h" //for CCoordinateSystemGeodeticPath
+#include "CoordSysGeodeticTransformDefParams.h" //for CCoordinateSystemGeodeticTransformDefParams
+#include "CoordSysGeodeticAnalyticalTransformDefParams.h"
+#include "CoordSysGeodeticInterpolationTransformDefParams.h"
+#include "CoordSysGeodeticMultipleRegressionTransformDefParams.h"
+#include "CoordSysGeodeticTransformGridFile.h"
+#include "CoordSysGeodeticTransformDef.h" //for CCoordinateSystemGeodeticTransformDef
#include "CoordSysDatumDictionary.h" //for CCoordinateSystemDatumDictionary
#include "CoordSysEllipsoidDictionary.h" //for CCoordinateSystemEllipsoidDictionary
-#include "CoordSysUtil.h" //for Convert_Wide_To_Ascii, CsDictionaryOpenMode
+#include "CoordSysGeodeticPathDictionary.h" //for CCoordinateSystemGeodeticPathDictionary
+#include "CoordSysGeodeticTransformDefDictionary.h" //for CCoordinateSystemGeodeticTransformDefDictionary
#include "CoordSysCategoryDictionary.h" //for CCoordinateSystemCategoryDictionary
#include "CoordSysMathComparator.h" //for CCoordinateSystemMathComparator
#include "CoordSysFormatConverter.h" //for CCoordinateSystemFormatConverter
@@ -40,10 +50,9 @@
#include "CoordSysGeodeticTransformation.h" //for CCoordinateSystemGeodeticTransformation
#include "csNameMapper.hpp" //for csReleaseNameMapper
+#include "cs_map.h"
#ifdef _WIN32
-#include <atlbase.h>
-#include <atlconv.h>
#include <tchar.h> //for _tsplitpath
#include <shlobj.h> //for SHGetFolderPath
#endif
@@ -67,8 +76,10 @@
m_pDtDict = new CCoordinateSystemDatumDictionary(this);
m_pElDict = new CCoordinateSystemEllipsoidDictionary(this);
m_pCtDict = new CCoordinateSystemCategoryDictionary(this);
+ m_pGpDict = new CCoordinateSystemGeodeticPathDictionary(this);
+ m_pGxDict = new CCoordinateSystemGeodeticTransformDefDictionary(this);
- if (!m_pCsDict || !m_pDtDict || !m_pElDict || !m_pCtDict)
+ if (!m_pCsDict || !m_pDtDict || !m_pElDict || !m_pCtDict || !m_pGpDict || !m_pGxDict)
{
throw new MgOutOfMemoryException(L"MgCoordinateSystemCatalog.MgCoordinateSystemCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
}
@@ -112,6 +123,8 @@
m_pDtDict = NULL;
m_pElDict = NULL;
m_pCtDict = NULL;
+ m_pGpDict = NULL;
+ m_pGxDict = NULL;
//NOTE: the following behavior happens only in DEBUG if we do not reset the countFlag
//If an exception is thrown from within the constructor of this MgDisposable derived class
@@ -144,6 +157,8 @@
m_pDtDict = NULL;
m_pElDict = NULL;
m_pCtDict = NULL;
+ m_pGpDict = NULL;
+ m_pGxDict = NULL;
}
//-----------------------------------------------------------------------------------
@@ -171,6 +186,18 @@
}
//-----------------------------------------------------------------------------------
+MgCoordinateSystemGeodeticPathDictionary* CCoordinateSystemCatalog::GetGeodeticPathDictionary()
+{
+ return SAFE_ADDREF(m_pGpDict.p);
+}
+
+//-----------------------------------------------------------------------------------
+MgCoordinateSystemGeodeticTransformDefDictionary* CCoordinateSystemCatalog::GetGeodeticTransformDefDictionary()
+{
+ return SAFE_ADDREF(m_pGxDict.p);
+}
+
+//-----------------------------------------------------------------------------------
STRING CCoordinateSystemCatalog::GetDefaultDictionaryDir()
{
STRING sDir;
@@ -279,6 +306,11 @@
wchar_t* pNewDir=NULL;
if ((_tcslen(szFname) > 0) || (_tcslen(szExt) > 0))
{
+ //ABA: don't understand: if a filename or an extension has been found,
+ //we concatenate the filename to the directory + then the extension;
+ //Then, we call makepath() what will give us a full path information incl.
+ //the file name;
+ //
//Nope, not properly terminated, need to fix it.
assert(_tcslen(szDir) + _tcslen(szFname) + _tcslen(szExt) < _MAX_DIR);
_tcscat(szDir, szFname);
@@ -327,6 +359,8 @@
STRING sDt=m_pDtDict->GetFileName();
STRING sEl=m_pElDict->GetFileName();
STRING sCt=m_pCtDict->GetFileName();
+ STRING sGp=m_pGpDict->GetFileName();
+ STRING sGx=m_pGxDict->GetFileName();
//Set the dictionary file names
//this will perform a validation of the existence of the files inside the directory
@@ -334,6 +368,8 @@
m_pDtDict->SetFileName(sDt);
m_pElDict->SetFileName(sEl);
m_pCtDict->SetFileName(sCt);
+ m_pGpDict->SetFileName(sGp);
+ m_pGxDict->SetFileName(sGx);
MG_CATCH_AND_THROW(L"MgCoordinateSystemCatalog.SetDictionaryDir")
}
@@ -351,7 +387,9 @@
|| !m_pCsDict || m_pCsDict->GetFileName().empty()
|| !m_pDtDict || m_pDtDict->GetFileName().empty()
|| !m_pElDict || m_pElDict->GetFileName().empty()
- || !m_pCtDict || m_pCtDict->GetFileName().empty())
+ || !m_pCtDict || m_pCtDict->GetFileName().empty()
+ || !m_pGpDict || m_pGpDict->GetFileName().empty()
+ || !m_pGxDict || m_pGxDict->GetFileName().empty())
{
//Directory hasn't been specified yet.
throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemCatalog.AreDictionaryFilesWritable", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
@@ -402,6 +440,28 @@
return false;
}
+ sPath=m_pGpDict->GetPath();
+ if (!ValidateFile(
+ sPath.c_str(), //file name
+ true, //must exist
+ false, //mustn't be directory
+ true, //neeed write access?
+ &reason))
+ {
+ return false;
+ }
+
+ sPath=m_pGxDict->GetPath();
+ if (!ValidateFile(
+ sPath.c_str(), //file name
+ true, //must exist
+ false, //mustn't be directory
+ true, //neeed write access?
+ &reason))
+ {
+ return false;
+ }
+
MG_CATCH_AND_THROW(L"MgCoordinateSystemCatalog.AreDictionaryFilesWritable")
return true;
}
@@ -422,6 +482,8 @@
STRING sDt=m_pDtDict->GetDefaultFileName();
STRING sEl=m_pElDict->GetDefaultFileName();
STRING sCt=m_pCtDict->GetDefaultFileName();
+ STRING sGp=m_pGpDict->GetDefaultFileName();
+ STRING sGx=m_pGxDict->GetDefaultFileName();
//sets the path to the dictionaries
//this will perform a validation of the existence of the directory
@@ -433,6 +495,8 @@
m_pDtDict->SetFileName(sDt);
m_pElDict->SetFileName(sEl);
m_pCtDict->SetFileName(sCt);
+ m_pGpDict->SetFileName(sGp);
+ m_pGxDict->SetFileName(sGx);
m_libraryStatus=lsInitialized;
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysCatalog.h
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysCatalog.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysCatalog.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -21,6 +21,14 @@
namespace CSLibrary
{
+ class CCoordinateSystemGeodeticTransformDefDictionary;
+ class CCoordinateSystemDictionary;
+ class CCoordinateSystemDatumDictionary;
+ class CCoordinateSystemEllipsoidDictionary;
+ class CCoordinateSystemCategoryDictionary;
+ class CCoordinateSystemGeodeticPathDictionary;
+ class CCoordinateSystemGeodeticTransformDefDictionary;
+
class CCoordinateSystemCatalog : public MgCoordinateSystemCatalog
{
EXTERNAL_API:
@@ -39,6 +47,8 @@
virtual MgCoordinateSystemDictionary* GetCoordinateSystemDictionary();
virtual MgCoordinateSystemDatumDictionary* GetDatumDictionary();
virtual MgCoordinateSystemEllipsoidDictionary* GetEllipsoidDictionary();
+ virtual MgCoordinateSystemGeodeticPathDictionary* GetGeodeticPathDictionary();
+ virtual MgCoordinateSystemGeodeticTransformDefDictionary* GetGeodeticTransformDefDictionary();
virtual MgDisposableCollection* GetGeodeticTransformations(MgCoordinateSystemDatum* pSource, MgCoordinateSystemDatum *pTarget);
virtual MgCoordinateSystemMathComparator* GetMathComparator();
virtual MgCoordinateSystemFormatConverter* GetFormatConverter();
@@ -71,6 +81,8 @@
Ptr<CCoordinateSystemDatumDictionary> m_pDtDict;
Ptr<CCoordinateSystemEllipsoidDictionary> m_pElDict;
Ptr<CCoordinateSystemCategoryDictionary> m_pCtDict;
+ Ptr<CCoordinateSystemGeodeticPathDictionary> m_pGpDict;
+ Ptr<CCoordinateSystemGeodeticTransformDefDictionary> m_pGxDict;
LibraryStatus m_libraryStatus;
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysCategory.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysCategory.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysCategory.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -46,7 +46,7 @@
//
char * CCoordinateSystemCategory::Name()
{
- return m_categoryName.name;
+ return const_cast<char*>(m_categoryName.Name());
}
//Saves the object to a file. Purpose of the ulMinSize parameter:
@@ -102,7 +102,7 @@
// 5. Blank space (if ulMinSize > size)
//Name.
- CS_fwrite(m_categoryName.name, sizeof(m_categoryName.name), 1, pFile);
+ CS_fwrite(m_categoryName.Name(), sizeof(char), knMaxCategoryNameLen, pFile);
//Size.
CS_fwrite(reinterpret_cast<char *>(&ulSize), sizeof(ulSize), 1, pFile);
@@ -114,7 +114,7 @@
CSystemNameList::const_iterator iter;
for (iter=m_listCoordinateSystemNames.begin(); iter!=m_listCoordinateSystemNames.end(); iter++)
{
- CS_fwrite((*iter).name, sizeof((*iter).name), 1, pFile);
+ CS_fwrite((*iter).Name(), sizeof(char), cs_KEYNM_DEF, pFile);
}
//Blank space, if needed
@@ -131,7 +131,7 @@
CSystemName dummy(/*NOXLATE*/"fnord");
for (UINT32 i=0; i<ulDiff; i++)
{
- CS_fwrite(dummy.name, sizeof(dummy.name), 1, pFile);
+ CS_fwrite(dummy.Name(), sizeof(char), cs_KEYNM_DEF, pFile);
}
}
@@ -185,13 +185,20 @@
// 5. Blank space (if ulMinSize > size)
//Name.
- size_t nRead=CS_fread(m_categoryName.name, sizeof(m_categoryName.name), 1, pFile);
- if (1!=nRead)
+ char tempCharBuffer[knMaxCategoryNameLen] = { '\0' };
+ const size_t expectedReadCount = sizeof(tempCharBuffer) / sizeof(char);
+ size_t nRead=CS_fread(tempCharBuffer, sizeof(char), expectedReadCount, pFile);
+ if (expectedReadCount != nRead)
{
+ _ASSERT(0 == nRead); //otherwise something else is going on here...
+
//we reached the end of the file
throw new MgFileIoException(L"MgCoordinateSystemCategory.LoadFromFstream", __LINE__, __WFILE__, NULL, L"", NULL);
}
+ //copy the category name into our [m_categoryName] TNameStruct
+ m_categoryName = tempCharBuffer;
+
//Size.
UINT32 ulSize;
nRead=CS_fread(reinterpret_cast<char *>(&ulSize), sizeof(ulSize), 1, pFile);
@@ -213,18 +220,23 @@
throw new MgFileIoException(L"MgCoordinateSystemCategory.LoadFromFstream", __LINE__, __WFILE__, NULL, L"", NULL);
}
+ char keyNameBuffer[cs_KEYNM_DEF] = { '\0' };
+ const size_t expectedBufferCountRead = sizeof(keyNameBuffer) / sizeof(char);
//Coordinate system names.
for (UINT32 i=0; i<ulSize; i++)
{
- nRead=CS_fread(member.name, sizeof(member.name), 1, pFile);
- if (1!=nRead)
+ keyNameBuffer[0] = '\0';
+ nRead=CS_fread(keyNameBuffer, sizeof(char), expectedBufferCountRead, pFile);
+ if (expectedBufferCountRead != nRead)
{
throw new MgFileIoException(L"MgCoordinateSystemCategory.LoadFromFstream", __LINE__, __WFILE__, NULL, L"", NULL);
}
+ member = keyNameBuffer;
+
// TODO - WORKAROUND TO SKIP BAD COORDINATE SYSTEMS IN CURRENT DICTIONARIES
- if((strcmp(member.name, "IGN63/Hiva") != 0) &&
- (strcmp(member.name, "Phoenix") != 0))
+ if((strcmp(member.Name(), "IGN63/Hiva") != 0) &&
+ (strcmp(member.Name(), "Phoenix") != 0))
{
m_listCoordinateSystemNames.push_back(member);
}
@@ -235,7 +247,7 @@
ulDiff = ulMinSize - ulSize;
if (ulDiff > 0)
{
- CS_fseek(pFile, CS_ftell(pFile) + ulDiff * sizeof(member.name), SEEK_SET);
+ CS_fseek(pFile, CS_ftell(pFile) + ulDiff * (sizeof(keyNameBuffer) / sizeof(char)), SEEK_SET);
}
if (ferror(pFile))
{
@@ -297,7 +309,7 @@
STRING sName;
MG_TRY()
- wchar_t *pName = Convert_Ascii_To_Wide(m_categoryName.name);
+ wchar_t *pName = Convert_Ascii_To_Wide(m_categoryName.Name());
if (!pName)
{
throw new MgOutOfMemoryException(L"MgCoordinateSystemCategory.GetName", __LINE__, __WFILE__, NULL, L"", NULL);
@@ -326,7 +338,10 @@
{
throw new MgOutOfMemoryException(L"MgCoordinateSystemCategory.SetName", __LINE__, __WFILE__, NULL, L"", NULL);
}
- strcpy(m_categoryName.name, pName);
+
+ //assign the name to our internal [TNameStruct]
+ m_categoryName = pName;
+
delete [] pName;
MG_CATCH_AND_THROW(L"MgCoordinateSystemCategory.SetName")
}
@@ -346,7 +361,7 @@
//
bool CCoordinateSystemCategory::IsValid()
{
- return IsLegalName(m_categoryName.name);
+ return IsLegalName(m_categoryName.Name());
}
//Private member function which returns whether the specified string
@@ -546,7 +561,7 @@
CSystemNameList::const_iterator iter;
for (iter=m_listCoordinateSystemNames.begin(); iter!=m_listCoordinateSystemNames.end(); iter++)
{
- wchar_t *pName = Convert_Ascii_To_Wide((*iter).name); //need to delete [] pName
+ wchar_t *pName = Convert_Ascii_To_Wide((*iter).Name()); //need to delete [] pName
if (NULL == pName)
{
throw new MgOutOfMemoryException(L"MgCoordinateSystemCategory.GetCoordinateSystems", __LINE__, __WFILE__, NULL, L"", NULL);
@@ -670,7 +685,7 @@
//
void CCoordinateSystemCategory::Clear()
{
- memset(m_categoryName.name, 0, knMaxCategoryNameLen);
+ m_categoryName = "\0";
m_listCoordinateSystemNames.clear();
}
@@ -679,5 +694,3 @@
{
return SAFE_ADDREF(m_pCatalog.p);
}
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -15,6 +15,8 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
+#include "CoordSysMacro.h"
+
#include "GeometryCommon.h"
#include "CoordSysCommon.h"
#include "CriticalSection.h"
@@ -252,7 +254,7 @@
strncpy(m_DtDef.key_nm, pStr, cs_KEYNM_MAX);
//Free the converted string
- delete [] pStr;
+ delete[] pStr;
//And we're done!
MG_CATCH_AND_THROW(L"MgCoordinateSystemDatum.SetDtCode")
@@ -448,7 +450,14 @@
//
pNew->m_datum = m_datum;
pNew->m_DtDef = m_DtDef;
+
+ //unset the EPSG code; we've an editable instance now where we neither can guarantee the correctness of the EPSG code
+ //nor is it currently supported by CsMap's NameMapper anyway
+ pNew->m_DtDef.epsgNbr = 0;
+
pNew->m_ElDef = m_ElDef;
+ //don't unset the EPSG code of the ellipsoid this datum refers to
+
pNew->m_bEncrypted = m_bEncrypted;
MG_CATCH_AND_THROW(L"MgCoordinateSystemDatum.CreateClone")
@@ -562,6 +571,10 @@
SetString(sSource, &m_DtDef.source[0], sizeof(m_DtDef.source));
}
+//Gets/Sets the EPSG code
+//
+DEFINE_GET_SET_NUMERIC(CCoordinateSystemDatum,EpsgCode,INT16,this->m_DtDef.epsgNbr)
+
//Returns whether the specified string is a legal source string
//
bool CCoordinateSystemDatum::IsLegalSource(CREFSTRING sSource)
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDatum.h
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDatum.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDatum.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -44,6 +44,8 @@
virtual bool IsLegalGroup(CREFSTRING sGroup);
virtual STRING GetSource();
virtual void SetSource(CREFSTRING sSource);
+ virtual INT16 GetEpsgCode();
+ virtual void SetEpsgCode(INT16 epsgCode);
virtual bool IsLegalSource(CREFSTRING sSource);
virtual bool IsProtected();
virtual INT16 GetAge();
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDatumDictionary.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDatumDictionary.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDatumDictionary.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -50,7 +50,6 @@
#undef cs_Dtdef07_
#undef cs_Dtdef08_
-
//Externs from Mentor
extern "C"
{
@@ -104,7 +103,6 @@
}
-
//Function which returns whether the specified "magic number" is
//a valid one for a Mentor datum dictionary. The returned value
//indicates the highest access level allowed: CsDictionaryOpenMode::Write if current
@@ -249,8 +247,11 @@
return CS_dtdef(kpName);
}
+ throw new MgInvalidOperationException(L"CCoordinateSystemDatumDictionary.dtdef", __LINE__, __WFILE__, NULL, L"", NULL);
+
//It's an old version. We need to do a special search
//in the file, and then, if found, update it to a current struct.
+
UINT32 nStructSize, nNameSize;
GetDatumSizeInfo(m_lMagic, nStructSize, nNameSize);
if (strlen(kpName) > nNameSize-1) return NULL;
@@ -448,7 +449,9 @@
MentorDictionary::UpdateDef<cs_Dtdef_, MgCoordinateSystemDatum>(
m_pmapSystemNameDescription,
+ DtKey,
DtDesc,
+ &MgCoordinateSystemDatum::IsValid,
CS_dtdef,
CS_dtupd,
BuildDtDefFromInterface,
@@ -496,7 +499,9 @@
MentorDictionary::UpdateDef<cs_Dtdef_, MgCoordinateSystemDatum>(
m_pmapSystemNameDescription,
+ DtKey,
DtDesc,
+ &MgCoordinateSystemDatum::IsValid,
CS_dtdef,
CS_dtupd,
BuildDtDefFromInterface,
@@ -648,6 +653,7 @@
//Generate summary for version 5 datum file.
m_pmapSystemNameDescription = MentorDictionary::GenerateSystemNameDescriptionMap<cs_Dtdef05_>(
pFile,
+ DtKey05,
DtDesc05,
CS_dtrd05);
break;
@@ -655,14 +661,16 @@
//Generate summary for version 6 datum file.
m_pmapSystemNameDescription = MentorDictionary::GenerateSystemNameDescriptionMap<cs_Dtdef06_>(
pFile,
+ DtKey06,
DtDesc06,
CS_dtrd06);
- break;
+ break;
case 7:
case 8:
//Generate summary for version 7 or 8 datum file.
m_pmapSystemNameDescription = MentorDictionary::GenerateSystemNameDescriptionMap<cs_Dtdef_>(
pFile,
+ DtKey,
DtDesc,
CS_dtrd);
break;
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDictionary.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDictionary.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysDictionary.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -57,8 +57,6 @@
int CScsrupRead06 (csFILE *oldStrm,struct csCsrup_ *csrup);
}
-
-
//Function which works like CS_csrd(), except that it reads version
//5 coordsys structs.
//
@@ -79,8 +77,6 @@
return nStatus;
}
-
-
//Function which works like CS_csrd(), except that it reads version
//6 coordsys structs.
//
@@ -101,8 +97,6 @@
return nStatus;
}
-
-
//Function which returns whether the specified "magic number" is
//a valid one for a Mentor coordsys dictionary. The returned value
//indicates the highest access level allowed: CsDictionaryOpenMode::Write if current
@@ -260,6 +254,8 @@
return pDef;
}
+ throw new MgInvalidOperationException(L"CCoordinateSystemDictionary.csdef", __LINE__, __WFILE__, NULL, L"", NULL);
+
//It's an old version. We need to do a special search
//in the file, and then, if found, update it to a current struct.
UINT32 nStructSize, nNameSize;
@@ -380,11 +376,11 @@
//Okay, everybody opened all right, so update Mentor's global
//variables appropriately.
- char* szCs=Convert_Wide_To_Ascii(sFileName.c_str());
+ char* szCs=Convert_Wide_To_Ascii(sFileName.c_str()); //ABA: why use sFileName here?
CriticalClass.Enter();
CS_csfnm(szCs);
CriticalClass.Leave();
- delete[] szCs;
+ delete[] szCs; //ABA: where is that deleted in case of an exception
if (m_pmapSystemNameDescription)
{
@@ -470,7 +466,9 @@
MentorDictionary::UpdateDef<cs_Csdef_, MgCoordinateSystem>(
m_pmapSystemNameDescription,
+ CsKey,
CsDesc,
+ &MgCoordinateSystem::IsValid,
CS_csdef,
CS_csupd,
BuildCsDefFromInterface,
@@ -518,7 +516,9 @@
MentorDictionary::UpdateDef<cs_Csdef_, MgCoordinateSystem>(
m_pmapSystemNameDescription,
+ CsKey,
CsDesc,
+ &MgCoordinateSystem::IsValid,
CS_csdef,
CS_csupd,
BuildCsDefFromInterface,
@@ -668,6 +668,7 @@
//Generate summary for version 5 coordsys file.
m_pmapSystemNameDescription = MentorDictionary::GenerateSystemNameDescriptionMap<cs_Csdef05_>(
pFile,
+ CsKey05,
CsDesc05,
CS_csrd05);
break;
@@ -675,6 +676,7 @@
//Generate summary for version 6 coordsys file.
m_pmapSystemNameDescription = MentorDictionary::GenerateSystemNameDescriptionMap<cs_Csdef06_>(
pFile,
+ CsKey06,
CsDesc06,
CS_csrd06);
break;
@@ -683,6 +685,7 @@
//Generate summary for version 7 or 8 coordsys file.
m_pmapSystemNameDescription = MentorDictionary::GenerateSystemNameDescriptionMap<cs_Csdef_>(
pFile,
+ CsKey,
CsDesc,
CS_csrd);
break;
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -15,6 +15,8 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
+#include "CoordSysMacro.h"
+
#include "GeometryCommon.h"
#include "CoordSysCommon.h"
@@ -304,6 +306,10 @@
//data members are added to CCoordinateSystemEllipsoid, this will
//need to be updated.
pDef->m_def = m_def;
+
+ //unset the EPSG code; we've an editable instance now where we neither can guarantee the correctness of the EPSG code
+ //nor is it currently supported by CsMap's NameMapper anyway
+ pDef->m_def.epsgNbr = 0;
pDef->m_bEncrypted = m_bEncrypted;
MG_CATCH_AND_THROW(L"MgCoordinateSystemEllipsoid.CreateClone")
@@ -416,6 +422,10 @@
SetString(sSource, &m_def.source[0], sizeof(m_def.source));
}
+//Gets/Sets the EPSG code
+//
+DEFINE_GET_SET_NUMERIC(CCoordinateSystemEllipsoid,EpsgCode,INT16,this->m_def.epsgNbr)
+
//Returns whether the specified string is a legal source string
//
bool CCoordinateSystemEllipsoid::IsLegalSource(CREFSTRING sSource)
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.h
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -45,6 +45,8 @@
virtual bool IsLegalGroup(CREFSTRING sGroup);
virtual STRING GetSource();
virtual void SetSource(CREFSTRING sSource);
+ virtual INT16 GetEpsgCode();
+ virtual void SetEpsgCode(INT16 epsgCode);
virtual bool IsLegalSource(CREFSTRING sSource);
virtual bool IsProtected();
virtual INT16 GetAge();
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEllipsoidDictionary.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEllipsoidDictionary.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEllipsoidDictionary.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -58,8 +58,6 @@
int CSelrupReadOld (csFILE *oldStrm,struct csElrup_ *elrup,int old_lvl);
}
-
-
//Function which returns whether the specified "magic number" is
//a valid one for a Mentor ellipsoid dictionary. The returned value
//indicates the highest access level allowed: CsDictionaryOpenMode::Write if current
@@ -190,8 +188,10 @@
return CS_eldef(kpName);
}
+ throw new MgInvalidOperationException(L"CCoordinateSystemEllipsoidDictionary.eldef", __LINE__, __WFILE__, NULL, L"", NULL);
+
//It's an old version. We need to do a special search
- //in the file, and then, if found, update it to a current struct.
+ //in the file, and then, if found, update it to a current struct.
UINT32 nStructSize, nNameSize;
GetEllipsoidSizeInfo(m_lMagic, nStructSize, nNameSize);
if (strlen(kpName) > nNameSize-1) return NULL;
@@ -388,7 +388,9 @@
MentorDictionary::UpdateDef<cs_Eldef_, MgCoordinateSystemEllipsoid>(
m_pmapSystemNameDescription,
+ ElKey,
ElDesc,
+ &MgCoordinateSystemEllipsoid::IsValid,
CS_eldef,
CS_elupd,
BuildElDefFromInterface,
@@ -439,7 +441,9 @@
MentorDictionary::UpdateDef<cs_Eldef_, MgCoordinateSystemEllipsoid>(
m_pmapSystemNameDescription,
+ ElKey,
ElDesc,
+ &MgCoordinateSystemEllipsoid::IsValid,
CS_eldef,
CS_elupd,
BuildElDefFromInterface,
@@ -572,6 +576,7 @@
{
m_pmapSystemNameDescription = MentorDictionary::GenerateSystemNameDescriptionMap<cs_Eldef_>(
pFile,
+ ElKey,
ElDesc,
CS_elrd);
if (NULL == m_pmapSystemNameDescription)
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnum.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnum.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnum.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -110,7 +110,7 @@
//success
return pOutput.Detach();
}
- const char *kpName = (*m_iter).first.name;
+ const char *kpName = (*m_iter).first.Name();
wchar_t* pStr = Convert_Ascii_To_Wide(kpName);
if (NULL == pStr)
{
@@ -160,7 +160,7 @@
//success
return pOutput.Detach();
}
- const char *kpName = (*m_iter).first.name;
+ const char *kpName = (*m_iter).first.Name();
if (IsFilteredOut(kpName))
{
continue;
@@ -195,11 +195,11 @@
//success
return pOutput.Detach();
}
- if (IsFilteredOut((*m_iter).first.name))
+ if (IsFilteredOut((*m_iter).first.Name()))
{
continue;
}
- const char *kpDecsription = (*m_iter).second.name;
+ const char *kpDecsription = (*m_iter).second.Name();
wchar_t *pwDecsription = Convert_Ascii_To_Wide(kpDecsription);
if (NULL == pwDecsription)
{
@@ -229,7 +229,7 @@
//success
return;
}
- const char *kpName = (*m_iter).first.name;
+ const char *kpName = (*m_iter).first.Name();
if (IsFilteredOut(kpName))
{
continue;
@@ -362,5 +362,3 @@
return pNew.Detach();
}
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumCategory.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumCategory.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumCategory.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -176,7 +176,7 @@
}
//get the category definition for the next name in the list
- const char *kpName = (*(m_iter)).name;
+ const char *kpName = (*(m_iter)).Name();
pStr = Convert_Ascii_To_Wide(kpName);
if (NULL == pStr)
{
@@ -229,7 +229,7 @@
return pOutput.Detach();
}
- const char *kpName = (*m_iter).name;
+ const char *kpName = (*m_iter).Name();
if (IsFilteredOut(kpName))
{
continue;
@@ -270,7 +270,7 @@
//success
return;
}
- const char *kpName = (*m_iter).name;
+ const char *kpName = (*m_iter).Name();
if (IsFilteredOut(kpName))
{
continue;
@@ -328,6 +328,3 @@
return pNew.Detach();
}
-
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumCoordinateSystemInCategory.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumCoordinateSystemInCategory.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumCoordinateSystemInCategory.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -111,7 +111,7 @@
}
//get the coordinate system name from the category
- const char *kpName = (*m_iter).name;
+ const char *kpName = (*m_iter).Name();
assert(IsLegalMentorName(kpName));
pstr = Convert_Ascii_To_Wide(kpName);
@@ -163,7 +163,7 @@
//success
return pOutput.Detach();
}
- const char *kpName = (*m_iter).name;
+ const char *kpName = (*m_iter).Name();
if (IsFilteredOut(kpName))
{
@@ -213,7 +213,7 @@
return pOutput.Detach();
}
//get the coordinate system name from the category
- const char *kpName = (*m_iter).name;
+ const char *kpName = (*m_iter).Name();
assert(IsLegalMentorName(kpName));
pstr = Convert_Ascii_To_Wide(kpName);
@@ -264,7 +264,7 @@
return;
}
//get the coordinate system name from the category
- const char *kpName = (*m_iter).name;
+ const char *kpName = (*m_iter).Name();
if (IsFilteredOut(kpName))
{
continue;
@@ -424,6 +424,3 @@
//And we're done! Return success.
return pNew.Detach();
}
-
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumDatum.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumDatum.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumDatum.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -67,5 +67,3 @@
return pNew.Detach();
}
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumEllipsoid.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumEllipsoid.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumEllipsoid.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -67,5 +67,3 @@
return pNew.Detach();
}
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -57,11 +57,9 @@
throw new MgNullArgumentException(L"MgCoordinateSystemEnumInteger32.SetList", __LINE__, __WFILE__, NULL, L"", NULL);
}
- if (m_pnValues)
- {
- delete [] m_pnValues;
- m_pnValues = NULL;
- }
+ delete [] m_pnValues;
+ m_pnValues = NULL;
+
m_ulPos = 0;
m_ulSize = 0;
@@ -267,5 +265,3 @@
return pNew.Detach();
}
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysFormatConverter.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysFormatConverter.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysFormatConverter.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -74,7 +74,7 @@
throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFormatConverter.DefinitionToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
}
- if (ProjectionFromString(pCsDef->prj_knm)==MgCoordinateSystemProjectionCode::Nerth)
+ if (ProjectionIsNerthType (pCsDef->prj_knm))
{
//Get the coordinate system definition.
ConvertArbitraryToWkt(pSource, sWkt);
@@ -315,18 +315,9 @@
//the dictionary we will fail because it is protected
//in the dictionary file
pCsFromDict->SetProtectMode(false);
- if (pswCsName)
- {
- delete[] pswCsName;
- }
- if (pswDtName)
- {
- delete[] pswDtName;
- }
- if (pswElName)
- {
- delete[] pswElName;
- }
+ delete[] pswCsName;
+ delete[] pswDtName;
+ delete[] pswElName;
delete[] pszWkt;
@@ -343,19 +334,11 @@
//text information parameters
pEFromDict->Release();
}
- if (pswCsName)
- {
- delete[] pswCsName;
- }
- if (pswDtName)
- {
- delete[] pswDtName;
- }
- if (pswElName)
- {
- delete[] pswElName;
- }
+ delete[] pswCsName;
+ delete[] pswDtName;
+ delete[] pswElName;
+
//creates the coordsys defintion
//don't ask the function to load the datum from the catalog, we'll set it later
pCsDef=BuildInterfaceFromCsDef(csDef, NULL);
@@ -533,7 +516,7 @@
}
INT32 prj=pCsCoordinateSystemDef->GetProjectionCode();
- if (MgCoordinateSystemProjectionCode::Nerth==prj)
+ if (ProjectionIsNerthType (prj))
{
ConvertArbitraryToWkt(pCsCoordinateSystemDef, sWkt);
}
@@ -1184,5 +1167,3 @@
}
}
}
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -18,19 +18,12 @@
#include "GeometryCommon.h"
#include "CoordSysCommon.h"
#include "CriticalSection.h"
+#include "CoordSysUtil.h" //for Convert_Wide_To_Ascii, CsDictionaryOpenMode
+#include "MentorUtil.h" //for BuildDtDefFromInterface + various utilities
-#include "CoordSysEnum.h" //for CCoordinateSystemEnum
-#include "CoordSysEnumDatum.h" //for CCoordinateSystemEnumDatum
-#include "CoordSysEnumEllipsoid.h" //for CCoordinateSystemEnumEllipsoid
-#include "CoordSysDictionary.h" //for CCoordinateSystemDictionary
-#include "CoordSysDatumDictionary.h" //for CCoordinateSystemDatumDictionary
-#include "CoordSysEllipsoidDictionary.h" //for CCoordinateSystemEllipsoidDictionary
-#include "CoordSysUtil.h" //for Convert_Wide_To_Ascii, CsDictionaryOpenMode
-#include "CoordSysCategoryDictionary.h" //for CCoordinateSystemCategoryDictionary
-#include "CoordSysCatalog.h" //for CCoordinateSystemCatalog
+#include "CoordSysGeodeticTransformDef.h" //for CCoordinateSystemGeodeticTransformDef
+#include "CoordSysDatum.h" //for CCoordinateSystemDatum
#include "CoordSysGeodeticTransformation.h" //for CCoordinateSystemGeodeticTransformation
-#include "CoordSysDatum.h" //for CCoordinateSystemDatum
-#include "MentorUtil.h" //for BuildDtDefFromInterface
using namespace CSLibrary;
@@ -48,6 +41,25 @@
}
//-----------------------------------------------------------------------------
+CCoordinateSystemGeodeticTransformation::CCoordinateSystemGeodeticTransformation(MgCoordinateSystemCatalog* pCatalog,
+ MgCoordinateSystemGeodeticTransformDef* transformationDef,
+ bool createInversed)
+: m_pDtcprm(NULL), m_pDtSource(NULL), m_pDtTarget(NULL)
+{
+ if (NULL == pCatalog || NULL == transformationDef)
+ throw new MgNullArgumentException(L"CCoordinateSystemGeodeticTransformation.ctor", __LINE__, __WFILE__, NULL, L"", NULL);
+
+ //this->Uninitialize(); //not needed - this does release the resourced held by this instance; we haven't set anything yet
+
+ this->SetCatalog(pCatalog);
+
+ //now - setup ourselves from the [MgCoordinateSystemGeodeticTransformDef] we've been passed
+ //we'll not pass a source and a target datum to CS Map so it constructs the cs_Dtcprm_ struct
+ //but we'll do that because we already have a transformation
+ this->SetupFromTransformationDef(transformationDef, createInversed);
+}
+
+//-----------------------------------------------------------------------------
CCoordinateSystemGeodeticTransformation::~CCoordinateSystemGeodeticTransformation()
{
Uninitialize();
@@ -345,6 +357,52 @@
assert(!IsInitialized());
}
+//Initializes this transformation instance from an [MgCoordinateSystemGeodeticTransformDef] object;
+//That is, we don't let CS Map find the appropriate transformation based on a source and a target
+//datum but will instruct CS Map to use the transformation defition we pass to it
+//
+void CCoordinateSystemGeodeticTransformation::SetupFromTransformationDef(MgCoordinateSystemGeodeticTransformDef* transformationDef, bool createInversed)
+{
+ cs_Dtcprm_* datumTransform = NULL;
+
+ MG_TRY()
+
+ //protect the call to the lib files; the calls to the [datumDictionary] below
+ //we also enter the critical section but on the same thread - i.e. no problem;
+ //putting the check here saves us from [enter, leave, enter leave]
+ SmartCriticalClass criticalSection(true);
+
+ CCoordinateSystemGeodeticTransformDef* transformDefImpl = dynamic_cast<CCoordinateSystemGeodeticTransformDef*>(transformationDef);
+ if (NULL == transformDefImpl)
+ throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticTransformation.SetupFromTransformationDef", __LINE__, __WFILE__, NULL, L"", NULL);
+
+ cs_GeodeticTransform_ csMapTransformDef;
+ transformDefImpl->CopyTo(csMapTransformDef);
+
+ //ask CS_Map for the transformation
+ datumTransform = CSdtcsu2(&csMapTransformDef, createInversed ? cs_DTCDIR_INV : cs_DTCDIR_FWD, cs_DTCFLG_BLK_W);
+
+ if (NULL == datumTransform)
+ throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticTransformation.SetupFromTransformationDef", __LINE__, __WFILE__, NULL, L"", NULL);
+
+ Ptr<MgCoordinateSystemDatumDictionary> datumDictionary = this->m_pCatalog->GetDatumDictionary();
+ Ptr<MgCoordinateSystemDatum> srcDatum = datumDictionary->GetDatum(transformationDef->GetSourceDatum());
+ Ptr<MgCoordinateSystemDatum> trgDatum = datumDictionary->GetDatum(transformationDef->GetTargetDatum());
+
+ this->m_pDtcprm = datumTransform;
+ datumTransform = NULL; //make sure, it's not being released below
+
+ this->m_pDtSource = srcDatum.Detach(); //m_pDtSource is no auto pointer
+ this->m_pDtTarget = trgDatum.Detach(); //m_pDtTarget is no auto pointer
+
+ MG_CATCH(L"CCoordinateSystemGeodeticTransformation.SetupFromTransformationDef")
+
+ if (NULL != datumTransform) //has been set to NULL after assignment
+ CS_free(datumTransform);
+
+ MG_THROW()
+}
+
//-----------------------------------------------------------------------------
MgCoordinateSystemDatum* CCoordinateSystemGeodeticTransformation::GetWGS84()
{
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.h
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -25,6 +25,7 @@
{
public:
CCoordinateSystemGeodeticTransformation(MgCoordinateSystemCatalog* pCatalog, MgCoordinateSystemDatum* pSource, MgCoordinateSystemDatum *pTarget);
+ CCoordinateSystemGeodeticTransformation(MgCoordinateSystemCatalog* pCatalog, MgCoordinateSystemGeodeticTransformDef* transformationDef, bool createInversed);
virtual ~CCoordinateSystemGeodeticTransformation();
virtual void SetSourceAndTarget(MgCoordinateSystemDatum *pSource, MgCoordinateSystemDatum *pTarget);
@@ -66,6 +67,7 @@
void SetCatalog(MgCoordinateSystemCatalog* pCatalog);
bool GetDefinitionForGeodeticTransformationParameter(cs_Dtdef_& def);
MgCoordinateSystemDatum* GetWGS84();
+ void SetupFromTransformationDef(MgCoordinateSystemGeodeticTransformDef* transformationDef, bool createInversed);
protected:
//Data members
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysGridGeneric.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysGridGeneric.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysGridGeneric.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -229,5 +229,3 @@
{
delete this;
}
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysMathComparator.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysMathComparator.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysMathComparator.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -22,6 +22,8 @@
#include "CoordSysUtil.h" //for FloatEqual
#include "MentorUtil.h" //for IsLegalMentorName
+#include <cs_Legacy.h>
+
using namespace CSLibrary;
const double CCoordinateSystemMathComparator::kdEpsilonGeographic = 1.0E-12; // latitude & longitude
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysMgrs.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysMgrs.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysMgrs.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -1489,4 +1489,3 @@
}
return canDoPoles;
}
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysProjectionInformation.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysProjectionInformation.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysProjectionInformation.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -573,5 +573,3 @@
return str;
}
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysTransform.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysTransform.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysTransform.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -441,11 +441,11 @@
double tmpDbl;
double magnitude;
- double xMax = -HUGE_VAL;
- double yMax = -HUGE_VAL;
+ double xMax = -HUGE_VAL;
+ double yMax = -HUGE_VAL;
double zMax = -HUGE_VAL;
- double xMin = HUGE_VAL;
- double yMin = HUGE_VAL;
+ double xMin = HUGE_VAL;
+ double yMin = HUGE_VAL;
double zMin = HUGE_VAL;
Ptr<MgEnvelope> pEnvelope;
@@ -460,19 +460,19 @@
MG_TRY()
if(NULL == envelope)
- {
+ {
throw new MgNullArgumentException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"", NULL);
- }
+ }
// Extract the two defining corners of this envelope.
Ptr<MgCoordinate> lowerLeft = envelope->GetLowerLeftCoordinate();
Ptr<MgCoordinate> upperRight = envelope->GetUpperRightCoordinate();
-
+
// Determine if this is a 3D envelope. Don't know that this is possible,
// but the code I modified handles 3D envelopes, so I will too.
dimension = upperRight->GetDimension();
if (dimension == MgCoordinateDimension::XYZ)
- {
+ {
// Extract the Z minimum and maximum.
tmpDbl = lowerLeft->GetZ ();
if (tmpDbl < zMin) zMin = tmpDbl;
@@ -481,7 +481,7 @@
tmpDbl = upperRight->GetZ ();
if (tmpDbl < zMin) zMin = tmpDbl;
if (tmpDbl > zMax) zMax = tmpDbl;
- }
+ }
// Determine a value which represents a good tolerance value for the
// GridLine function. A smaller value will provide greater accuracy
@@ -510,35 +510,35 @@
lineString = GridLine (lowerLeft,lowerRight,magnitude,maxPoints);
stringItr = lineString->GetCoordinates ();
while (stringItr->MoveNext ())
- {
+ {
xyPoint = stringItr->GetCurrent ();
if (xyPoint->GetX () < xMin) xMin = xyPoint->GetX ();
if (xyPoint->GetX () > xMax) xMax = xyPoint->GetX ();
if (xyPoint->GetY () < yMin) yMin = xyPoint->GetY ();
if (xyPoint->GetY () > yMax) yMax = xyPoint->GetY ();
- }
+ }
lineString = GridLine (lowerRight,upperRight,magnitude,maxPoints);
stringItr = lineString->GetCoordinates ();
while (stringItr->MoveNext ())
- {
+ {
xyPoint = stringItr->GetCurrent ();
if (xyPoint->GetX () < xMin) xMin = xyPoint->GetX ();
if (xyPoint->GetX () > xMax) xMax = xyPoint->GetX ();
if (xyPoint->GetY () < yMin) yMin = xyPoint->GetY ();
if (xyPoint->GetY () > yMax) yMax = xyPoint->GetY ();
- }
+ }
lineString = GridLine (upperRight,upperLeft,magnitude,maxPoints);
stringItr = lineString->GetCoordinates ();
while (stringItr->MoveNext ())
- {
+ {
xyPoint = stringItr->GetCurrent ();
if (xyPoint->GetX () < xMin) xMin = xyPoint->GetX ();
if (xyPoint->GetX () > xMax) xMax = xyPoint->GetX ();
if (xyPoint->GetY () < yMin) yMin = xyPoint->GetY ();
if (xyPoint->GetY () > yMax) yMax = xyPoint->GetY ();
- }
+ }
lineString = GridLine (upperLeft,lowerLeft,magnitude,maxPoints);
stringItr = lineString->GetCoordinates ();
@@ -549,7 +549,7 @@
if (xyPoint->GetX () > xMax) xMax = xyPoint->GetX ();
if (xyPoint->GetY () < yMin) yMin = xyPoint->GetY ();
if (xyPoint->GetY () > yMax) yMax = xyPoint->GetY ();
- }
+ }
// Construct an evelope of the appropriate dimensions.
if (dimension != MgCoordinateDimension::XYZ) // 2D
@@ -570,13 +570,13 @@
// Leave commented except for temporary debugging. The printf output gets
// sent to stdout and ends up being included in the web-tier HTTP response.
/*
- Ptr<MgCoordinate> ll = envelope->GetLowerLeftCoordinate();
- Ptr<MgCoordinate> ur = envelope->GetUpperRightCoordinate();
- printf("Transform(envelope) -- Source: %f,%f to %f,%f\n", ll->GetX(), ll->GetY(), ur->GetX(), ur->GetY());
+ Ptr<MgCoordinate> ll = envelope->GetLowerLeftCoordinate();
+ Ptr<MgCoordinate> ur = envelope->GetUpperRightCoordinate();
+ printf("Transform(envelope) -- Source: %f,%f to %f,%f\n", ll->GetX(), ll->GetY(), ur->GetX(), ur->GetY());
- ll = pEnvelope->GetLowerLeftCoordinate();
- ur = pEnvelope->GetUpperRightCoordinate();
- printf("Transform(envelope) -- Dest : %f,%f to %f,%f\n", ll->GetX(), ll->GetY(), ur->GetX(), ur->GetY());
+ ll = pEnvelope->GetLowerLeftCoordinate();
+ ur = pEnvelope->GetUpperRightCoordinate();
+ printf("Transform(envelope) -- Dest : %f,%f to %f,%f\n", ll->GetX(), ll->GetY(), ur->GetX(), ur->GetY());
*/
// Return the computed envelope.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysUnitInformation.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysUnitInformation.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysUnitInformation.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -312,5 +312,3 @@
assert(0);
return L"";
}
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysUtil.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysUtil.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CoordSysUtil.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -700,4 +700,3 @@
throw new MgNotImplementedException(L"GetAvailableMemory", __LINE__, __WFILE__, NULL, L"", NULL);
#endif
}
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/CriticalSection.h
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/CriticalSection.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/CriticalSection.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -18,120 +18,24 @@
#ifndef CRITICALSECTION_H_
#define CRITICALSECTION_H_
-#ifndef _WIN32
-# include <pthread.h>
-# ifndef __bsdi__
-# include <semaphore.h>
-# endif
-#endif
+#include "SmartCriticalClass.h"
-// Critical Section Class
class CustomCriticalSection
{
public:
+ CustomCriticalSection();
+ ~CustomCriticalSection();
- CustomCriticalSection()
- {
- m_bInitialized = false;
- Initialize();
- }
+ void Initialize();
-#ifdef _WIN32
+ void Enter();
+ void Leave();
- ~CustomCriticalSection()
- {
- ::DeleteCriticalSection(&m_CritSect);
- }
-
- void Initialize()
- {
- if(!m_bInitialized)
- {
- m_bInitialized = true;
- ::InitializeCriticalSection(&m_CritSect);
- }
- }
-
- void Enter()
- {
- ::EnterCriticalSection(&m_CritSect);
- }
-
- void Leave()
- {
- ::LeaveCriticalSection(&m_CritSect);
- }
-
private:
- CRITICAL_SECTION m_CritSect;
-
-#else //LINUX
-
- ~CustomCriticalSection()
- {
- pthread_mutex_destroy(&m_CritSect);
- }
-
- void Initialize()
- {
- if(!m_bInitialized)
- {
- m_bInitialized = true;
- pthread_mutexattr_init(&m_attributes);
- pthread_mutexattr_settype(&m_attributes, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&m_CritSect, &m_attributes);
- pthread_mutexattr_destroy(&m_attributes);
- }
- }
-
- void Enter()
- {
- pthread_mutex_lock(&m_CritSect);
- }
-
- void Leave()
- {
- pthread_mutex_unlock(&m_CritSect);
- }
-
-private:
- pthread_mutex_t m_CritSect;
- pthread_mutexattr_t m_attributes;
-
-#endif //_WIN32
-
-private:
bool m_bInitialized;
};
-// This is used to protect library calls
-static CustomCriticalSection CriticalClass;
+//This is used to protect *all* library calls - make sure, all comilation units refer to the same instance
+extern CustomCriticalSection CriticalClass;
-class SmartCriticalClass
-{
-public:
- SmartCriticalClass(bool bEnter):m_bEntered(bEnter)
- {
- if (bEnter)
- {
- CriticalClass.Enter();
- }
- }
- void Enter()
- {
- m_bEntered=true;
- CriticalClass.Enter();
- }
- ~SmartCriticalClass()
- {
- if (m_bEntered)
- {
- CriticalClass.Leave();
- }
- }
-private:
- SmartCriticalClass();
- bool m_bEntered;
-};
-
-#endif
+#endif //CRITICALSECTION_H_
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorDictionary.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorDictionary.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorDictionary.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -147,12 +147,15 @@
/*[in]*/ CsDictionaryOpenMode (*ValidMagic)(long),
/*[in]*/ CREFSTRING sDirectory,
/*[in]*/ CREFSTRING sFileName,
- /*[in]*/ REFSTRING sFileNameSet,
+ /*[IN/OUT]*/ REFSTRING sFileNameSet,
/*[in]*/ const wchar_t* kpMethodName)
{
MG_TRY()
- if (!sFileName.empty())
+ _ASSERT(!sFileName.empty());
+
+ //ABA: don't understand the rational behind the logic here - if the file name is empty we're doing nothing?
+ if (!sFileName.empty()) //ABA: should it be rather [sDirectory]; if filename is given, also a path must have been given?
{
if (sDirectory.empty())
{
@@ -182,9 +185,9 @@
}//if dictionary is specified
//ok, so, save the file name
+ //ABA: sFileName is never touched - same with sFileNameSet; why would a caller wanted us to that
+ //is it rather [sFileNameSet = sPath]?
sFileNameSet=sFileName;
MG_CATCH_AND_THROW(kpMethodName)
}
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorDictionary.h
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorDictionary.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorDictionary.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -32,6 +32,8 @@
#include "MentorUtil.h"
#include "Foundation.h"
+#define DICTIONARY_SYS_DEF 1
+
namespace MentorDictionary
{
void SetFileName(INT32& lMagic, CsDictionaryOpenMode (*ValidMagic)(long), CREFSTRING sDirectory, CREFSTRING sFileName, REFSTRING sFileNameSet, const wchar_t* kpMethodName);
@@ -49,6 +51,7 @@
CSystemNameDescriptionMap *
GenerateSystemNameDescriptionMap(
csFILE *pFile,
+ const char* (*CS_Tkey)(const T&),
const char * (*description)(const T&),
int (*CS_Trd)(csFILE*, T *, int *))
{
@@ -72,9 +75,11 @@
{
while ((nResult = CS_Trd(pFile, &def, &nCrypt)) > 0)
{
+ const char* keyName = CS_Tkey(def);
+
pmapSystemNameDescription->insert(
CSystemNameDescriptionPair(
- CSystemName(def.key_nm),
+ CSystemName(keyName),
CSystemDescription(description(def))
)
);
@@ -96,8 +101,8 @@
return pmapSystemNameDescription;
}
+ #define CALL_MEMBER_FN(object,ptrToMember) ((object)->*(ptrToMember))
-
//Template function for updating a def in a dictionary.
//Works for ellipsoids, datums, and coordinate systems.
//The bAlreadyExists parameter specifies whether there
@@ -106,15 +111,19 @@
//is the corresponding public API interface (MgCoordinateSystem
//et al).
//
+
template <class T, class Tinterface>
void UpdateDef(
CSystemNameDescriptionMap *pmapSystemNameDescription,
+ const char * (*key)(const T&),
const char * (*description)(const T&),
+ bool (Tinterface::*isValid)(),
T * (*CS_Tdef)(const char *),
int (*CS_Tupd)(T *, int),
bool (*BuildDefFromInterface)(Tinterface *, T&),
Tinterface *kpDef,
- bool bAlreadyExists)
+ bool bAlreadyExists,
+ bool verifyNotProtected)
{
assert(NULL != kpDef);
if (NULL == kpDef)
@@ -123,7 +132,7 @@
}
//Make sure the def they've given us is valid
- if (!kpDef->IsValid())
+ if (NULL != isValid && !CALL_MEMBER_FN(kpDef, isValid)())
{
throw new MgInvalidArgumentException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"", NULL);
}
@@ -136,11 +145,16 @@
throw new MgCoordinateSystemInitializationFailedException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"", NULL);
}
+ const char* keyName = key(def);
+
//Look in the dictionary
bool bActuallyExists = false;
INT16 sProtect = 0;
+
+ //make sure, we've exclusive access to the file(s)
SmartCriticalClass critical(true);
- T *pDef = CS_Tdef(def.key_nm);
+
+ T *pDef = CS_Tdef(keyName);
if (NULL != pDef)
{
bActuallyExists = true;
@@ -153,7 +167,7 @@
CSystemNameDescriptionMap::iterator iter;
if (NULL != pmapSystemNameDescription)
{
- iter = pmapSystemNameDescription->find(CSystemName(def.key_nm));
+ iter = pmapSystemNameDescription->find(CSystemName(keyName));
assert(bActuallyExists == (iter != pmapSystemNameDescription->end()));
}
@@ -167,16 +181,19 @@
else if (!bActuallyExists && bAlreadyExists)
{
//It doesn't exist, but it's supposed to.
- STRING message = MgUtil::MultiByteToWideChar(string(def.key_nm));
+ STRING message = MgUtil::MultiByteToWideChar(string(keyName));
MgStringCollection arguments;
arguments.Add(message);
throw new MgCoordinateSystemLoadFailedException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, &arguments, L"", NULL);
}
- //If it already exists, make sure it's not protected.
- if ((bAlreadyExists) && (IsReallyProtected(sProtect)))
+ if (verifyNotProtected)
{
- throw new MgCoordinateSystemInitializationFailedException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ //If it already exists, make sure it's not protected.
+ if ((bAlreadyExists) && (IsReallyProtected(sProtect)))
+ {
+ throw new MgCoordinateSystemInitializationFailedException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ }
}
//Find out whether it's encrypted
@@ -203,7 +220,7 @@
{
pmapSystemNameDescription->insert(
CSystemNameDescriptionPair(
- CSystemName(def.key_nm),
+ CSystemName(keyName),
CSystemDescription(description(def))
)
);
@@ -232,7 +249,7 @@
//it. (We can't just change the key in-place by
//modifying (*iter).first, since the key in a std::map
//pair is a const object.)
- if (0 == strcmp(def.key_nm, (*iter).first.name))
+ if (0 == strcmp(keyName, (*iter).first.Name()))
{
//The key name is unchanged; we can just update
//the summary.
@@ -242,13 +259,13 @@
{
//The name changed (case changed only). We need
//to delete the item and re-insert it.
- assert(0 == CS_stricmp(def.key_nm, (*iter).first.name));
+ assert(0 == CS_stricmp(keyName, (*iter).first.Name()));
try
{
pmapSystemNameDescription->erase(iter);
pmapSystemNameDescription->insert(
CSystemNameDescriptionPair(
- CSystemName(def.key_nm),
+ CSystemName(keyName),
CSystemDescription(description(def))
)
);
@@ -267,6 +284,20 @@
} //for each possible result of the update
}
+ template <class T, class Tinterface>
+ void UpdateDef(
+ CSystemNameDescriptionMap *pmapSystemNameDescription,
+ const char * (*key)(const T&),
+ const char * (*description)(const T&),
+ bool (Tinterface::*isValid)(),
+ T * (*CS_Tdef)(const char *),
+ int (*CS_Tupd)(T *, int),
+ bool (*BuildDefFromInterface)(Tinterface *, T&),
+ Tinterface *kpDef,
+ bool bAlreadyExists)
+ {
+ UpdateDef<T, Tinterface>(pmapSystemNameDescription, key, description, isValid, CS_Tdef, CS_Tupd, BuildDefFromInterface, kpDef, bAlreadyExists, true);
+ }
//Template function for removing a def from a dictionary.
//Works for ellipsoids, datums, and coordinate systems.
@@ -347,5 +378,3 @@
#endif //MG_MENTORDICTIONARY_H
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorUtil.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorUtil.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorUtil.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -26,7 +26,7 @@
#include "CoordSysCommon.h"
#include "CriticalSection.h"
#include "CoordSysUtil.h" //for Convert_Wide_To_Ascii, CsDictionaryOpenMode
-#include "MentorUtil.h"
+#include "MentorDictionary.h"
#ifdef _WIN32
#include <io.h> //for _dup()
#endif
@@ -37,6 +37,8 @@
#include "CoordSysEnum.h" //for CCoordinateSystemEnum
#include "CoordSysDictionary.h" //for CCoordinateSystemDictionary
+#include <cs_Legacy.h>
+
using namespace CSLibrary;
//Externs from Mentor
@@ -72,10 +74,14 @@
const char * CsDesc05(const struct cs_Csdef05_& def) { return def.desc_nm; }
const char * CsDesc06(const struct cs_Csdef06_& def) { return def.desc_nm; }
+const char * DtKey(const cs_Dtdef_& def) { return def.key_nm; }
+const char * DtKey05(const cs_Dtdef05_& def) { return def.key_nm; }
+const char * DtKey06(const cs_Dtdef06_& def) { return def.key_nm; }
+const char * CsKey(const cs_Csdef_& def) { return def.key_nm; }
+const char * CsKey05(const cs_Csdef05_& def) { return def.key_nm; }
+const char * CsKey06(const cs_Csdef06_& def) { return def.key_nm; }
+const char * ElKey(const cs_Eldef_& def) { return def.key_nm; }
-
-
-
//MENTOR_MAINTENANCE
//The public API needs a programmatic way for clients to ask whether a
//particular projection uses any or all of the following:
@@ -582,6 +588,20 @@
return NULL;
}
+// Returns true if th indictaed project, via projection key name
+// or projection code, is of the non-earth referenced type. That
+// is, the projection type is either NERTH or NRTHSRT.
+bool ProjectionIsNerthType (const char *kpStr)
+{
+ INT32 prjCode = ProjectionFromString (kpStr);
+ return ProjectionIsNerthType (prjCode);
+}
+bool ProjectionIsNerthType (INT32 prjCode)
+{
+ bool isNerth = (prjCode == cs_PRJCOD_NERTH) || (prjCode == cs_PRJCOD_NRTHSRT);
+ return isNerth;
+}
+
struct UnitStrPair
{
INT32 unit;
@@ -1101,7 +1121,7 @@
//Builds a cs_Csprm_ struct from a cs_Csdef_ structure.
bool BuildCsprmFromArbitraryDef(const cs_Csdef_& csdef, cs_Csprm_& csprm)
{
- if (MgCoordinateSystemProjectionCode::Nerth!=ProjectionFromString(csdef.prj_knm))
+ if (!ProjectionIsNerthType (csdef.prj_knm))
{
return false;
}
@@ -1131,7 +1151,7 @@
if (!bResult) return bResult;
struct cs_Csprm_ *pCsprm = NULL;
- if (MgCoordinateSystemProjectionCode::Nerth==ProjectionFromString(csdef.prj_knm))
+ if (ProjectionIsNerthType (csdef.prj_knm))
{
pCsprm = (struct cs_Csprm_ *)CS_malc (sizeof(struct cs_Csprm_));
if (NULL == pCsprm) return false; //E_OUTOFMEMORY;
@@ -1226,7 +1246,7 @@
return bResult;
}
- if (MgCoordinateSystemProjectionCode::Nerth!=ProjectionFromString(pCsDef->prj_knm))
+ if (!ProjectionIsNerthType (pCsDef->prj_knm))
{
//Try to get a datum from the coordsys.
Ptr<MgCoordinateSystemDatum> pDatum = pSrc->GetDatumDefinition();
@@ -1351,41 +1371,108 @@
{
assert(NULL != pDtcprm);
- INT32 nResult = 0;
+ //Skip datum transformation if we have a null transformation
+ //That is, if [pDtcprm->xfrmCount] is 0 or the transformation at index 0 is [cs_DTCMTH_NULLX];
+ //in either case, the entry at index 0 must never be NULL, if [xfrmCount] is not 0
+ assert(0 == pDtcprm->xfrmCount || NULL != pDtcprm->xforms[0]);
+
+ bool isNullTransform = (0 == pDtcprm->xfrmCount || //is there a transformation entry at all?
+ (1 == pDtcprm->xfrmCount && NULL != pDtcprm->xforms[0] && cs_DTCMTH_NULLX == pDtcprm->xforms[0]->methodCode)); //if so, check, whether we've [cs_DTCMTH_NULLX] at index 0
- // Skip datum transformation if we have a null transformation
- // We have a null transform if the first transform type is dtcTypNone
- if (dtcTypNone != pDtcprm->xforms[0].xfrmType)
+ if (isNullTransform)
+ return 0;
+
+ double dZ=0.;
+ if (pdZ)
{
- double dZ=0.;
- if (pdZ)
- {
- dZ=*pdZ;
- }
+ dZ=*pdZ;
+ }
- CriticalClass.Enter();
- double dLonLat[3] = { dLongitude, dLatitude, dZ };
- INT32 nResult;
- if (!pdZ)
- {
- nResult = CS_dtcvt(pDtcprm, dLonLat, dLonLat);
- }
- else
- {
- nResult = CS_dtcvt3D(pDtcprm, dLonLat, dLonLat);
- }
- CriticalClass.Leave();
+ CriticalClass.Enter();
+ double dLonLat[3] = { dLongitude, dLatitude, dZ };
+ INT32 nResult;
+ if (!pdZ)
+ {
+ nResult = CS_dtcvt(pDtcprm, dLonLat, dLonLat);
+ }
+ else
+ {
+ nResult = CS_dtcvt3D(pDtcprm, dLonLat, dLonLat);
+ }
+ CriticalClass.Leave();
- dLongitude = dLonLat[0];
- dLatitude = dLonLat[1];
- if (pdZ)
- {
- *pdZ=dLonLat[2];
- }
+ dLongitude = dLonLat[0];
+ dLatitude = dLonLat[1];
+ if (pdZ)
+ {
+ *pdZ=dLonLat[2];
}
+
return nResult;
}
+//method that set the current file name of a dictionary in CS Map
+void SetDictionaryFileName(CREFSTRING sFileName /* no directory information must be included */,
+ CREFSTRING dictionaryPath, /* the directory; no file information */
+ INT32& magicNumber, /* will be set */
+ CsDictionaryOpenMode (*MagicNumberCallback)(long),
+ void (*FileNameTarget)(const char* newFileName),
+ const wchar_t* context)
+{
+ if (NULL == MagicNumberCallback || NULL == FileNameTarget)
+ throw new MgNullArgumentException(L"MentorUtil.SetDictionaryFileName", __LINE__, __WFILE__, NULL, L"", NULL);
+
+ if (sFileName.empty() || dictionaryPath.empty())
+ {
+ MgStringCollection arguments;
+ arguments.Add(sFileName);
+
+ throw new MgArgumentOutOfRangeException(L"MentorUtil.SetDictionaryFileName", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ char* szCs = NULL;
+ bool entered = false;
+
+ MG_TRY()
+
+ //Make local variables to hold converted strings
+ bool bResult = IsValidDictionaryName(sFileName);
+ if (!bResult)
+ {
+ MgStringCollection arguments;
+ arguments.Add(sFileName);
+ throw new MgFileIoException(/*context */ L"MentorUtil.SetDictionaryFileName", __LINE__, __WFILE__, &arguments, L"MgInvalidArgumentException", NULL);
+ }
+
+ STRING fileNameSet;
+ MentorDictionary::SetFileName(
+ magicNumber,
+ MagicNumberCallback,
+ dictionaryPath,
+ sFileName,
+ fileNameSet,
+ L"MentorUtil.SetDictionaryFileName");
+
+ //Okay, everybody opened all right, so update Mentor's global
+ //variables appropriately.
+ szCs = Convert_Wide_To_Ascii(fileNameSet.c_str());
+
+ CriticalClass.Enter();
+ entered = true;
+
+ //the target function in CS map that sets the current active dictionary file name
+ FileNameTarget(szCs);
+
+ MG_CATCH(L"MentorUtil.SetDictionaryFileName")
+
+ if (entered)
+ CriticalClass.Leave();
+
+ delete[] szCs;
+
+ MG_THROW()
+}
+
//Opens a Mentor dictionary, verifies magic value, and positions read
//pointer at start of first record. Returns true for success, false
//for failure.
@@ -1545,4 +1632,67 @@
return wcsncmp(sBuf1.c_str(), sBuf2.c_str(), nLen);
}
-//End of file.
+//reads a const char* and returns the STRING class object for it
+STRING MentorReadString(const char* mentorString)
+{
+ if (NULL == mentorString)
+ return L"";
+
+ STRING readString;
+ wchar_t* pString = NULL;
+
+ MG_TRY()
+
+ pString = Convert_Ascii_To_Wide(mentorString);
+ if (NULL == pString) //ABA: this cannot be null, can it?
+ throw new MgOutOfMemoryException(L"MentorUtil.ReadString", __LINE__, __WFILE__, NULL, L"", NULL);
+
+ MG_CATCH(L"MentorUtil.ReadString")
+
+ readString = pString;
+ delete[] pString;
+
+ MG_THROW()
+
+ return readString;
+}
+
+void MentorSetString(CREFSTRING sSrc, char *pDest, UINT32 nMaxSize)
+{
+ //make sure to have checked the Protection level before calling this method
+
+ char *pStr = NULL;
+
+ MG_TRY()
+
+ assert(NULL != pDest);
+
+ if (NULL==pDest)
+ {
+ throw new MgNullArgumentException(L"MentorSetString", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ if (!IsLegalString(sSrc.c_str(), nMaxSize))
+ {
+ //Can't set string, caller gave us an illegal value
+ throw new MgInvalidArgumentException(L"MentorSetString", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ //Convert to a C++ string, for Mentor's sake
+ pStr = Convert_Wide_To_Ascii(sSrc.c_str()); //need to delete[] pStr
+ if (NULL == pStr)
+ {
+ throw new MgOutOfMemoryException(L"MentorSetString", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ //Copy it in
+ memset(pDest, 0, nMaxSize);
+ strncpy(pDest, pStr, nMaxSize);
+
+ MG_CATCH(L"MentorSetString")
+
+ //Clean up and return success.
+ delete [] pStr;
+
+ MG_THROW()
+}
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorUtil.h
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorUtil.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/MentorUtil.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -69,8 +69,14 @@
const char * CsDesc05(const struct cs_Csdef05_& def);
const char * CsDesc06(const struct cs_Csdef06_& def);
+const char * DtKey(const cs_Dtdef_& def);
+const char * DtKey05(const cs_Dtdef05_& def);
+const char * DtKey06(const cs_Dtdef06_& def);
+const char * CsKey(const cs_Csdef_& def);
+const char * CsKey05(const cs_Csdef05_& def);
+const char * CsKey06(const cs_Csdef06_& def);
+const char * ElKey(const cs_Eldef_& def);
-
//Returns whether the specified string is legal as a Mentor
//key name (for coordinate system, datum, or ellipsoid).
bool IsLegalMentorName(const wchar_t* kpStr);
@@ -95,7 +101,13 @@
//INT32 value.
const char * StringFromProjection(INT32 prj);
+// Returns true if th indictaed project, via projection key name
+// or projection code, is of the non-earth referenced type. That
+// is, the projection type is either NERTH or NRTHSRT.
+bool ProjectionIsNerthType (const char *kpStr);
+bool ProjectionIsNerthType (INT32 prjCode);
+
//Returns the MgCoordinateSystemUnitCode value associated with a given unit
//key name. Returns MgCoordinateSystemUnitCode::Unknown if it's not a recognized string.
INT32 UnitFromString(const char *kpStr);
@@ -203,6 +215,12 @@
//for success, eError for total failure, or eWarning for partial success.
INT32 GeodeticTransformationPoint(cs_Dtcprm_ *pDtcprm, double& dLongitude, double& dLatitude, double *pZ);
+//utility method to be used by any CS dictionary implementation that has a SetFileName() method in it
+void SetDictionaryFileName(CREFSTRING sFileName, CREFSTRING dictionaryPath, INT32& magicNumber,
+ CsDictionaryOpenMode (*MagicNumberCallback)(long),
+ void (*FileNameTarget)(const char* newTargetName),
+ const wchar_t* context);
+
//Opens a Mentor dictionary, verifies magic value, and positions read
//pointer at start of first record. Returns true for success, false
//for failure.
@@ -236,7 +254,14 @@
//(i.e. '_' > letters). Note: may modify input buffers.
int Mentor6Strnicmp(char *pBuf1, char *pBuf2, INT32 nLen);
+//reads a const char* and returns the STRING class object for it
+STRING MentorReadString(const char* mentorString = NULL);
+//writes a string into the destination char buffer specified through pDest; this method has no idea
+//where the target buffer is, i.e. the caller must have checked the target item's protection
+//level first; usually [Mg*Item::IsProtected()]
+void MentorSetString(CREFSTRING sSrc, char *pDest, UINT32 nMaxSize);
+
//Macro which defines comparison function, suitable for use with CS_bins,
//which compares two Mentor structs a la CS_cscmp() et al.
//Doing this as a macro is incredibly lame, and I really *really* would
@@ -350,6 +375,3 @@
//refer to the class MgCoordinateSystemProjectionParameterType for the values
#endif //MG_MENTORUTIL_H
-
-//End of file.
-
Modified: sandbox/rfc90/MgDev/Common/CoordinateSystem/namestruct.h
===================================================================
--- sandbox/rfc90/MgDev/Common/CoordinateSystem/namestruct.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/CoordinateSystem/namestruct.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -57,17 +57,41 @@
#endif
#endif
-template<int nSize>
+#define MAX_STRING_LENGTH 256
+
struct TNameStruct
{
- //data members
- char name[nSize];
- //member functions
+public:
+ // construction / destruction
TNameStruct(const char *kpName = NULL);
+ TNameStruct(const TNameStruct& other);
+
+ ~TNameStruct();
+
+ //comparison
bool operator<(const TNameStruct& other) const;
bool operator>(const TNameStruct& other) const;
bool operator==(const TNameStruct&) const;
bool operator!=(const TNameStruct&) const;
+
+ //assignment
+ TNameStruct& operator=(const TNameStruct&);
+
+ //assignment
+ TNameStruct& operator=(const char* newName);
+
+ //misc. methods
+ const char* Name() const;
+ void Reset();
+
+private:
+ //methods
+ void Init(const char *kpName = NULL);
+ void Release();
+
+private:
+ //data members
+ char* name;
};
//This struct holds a summary of a definition (just name and description,
@@ -79,8 +103,8 @@
//coordinate system dictionary shows that that wouldn't save much space;
//description strings take up, on average, around 2/3 of the space available
//for them, so the savings wouldn't be much.
-typedef TNameStruct<cs_KEYNM_DEF> CSystemName;
-typedef TNameStruct<64> CSystemDescription;
+typedef TNameStruct CSystemName;
+typedef TNameStruct CSystemDescription;
//Handy typedef for working with sets of CSystemName objects.
typedef std::list<CSystemName> CSystemNameList;
@@ -100,68 +124,8 @@
//which were created using a different number.
const int knMaxCategoryNameLen = 128;
-typedef TNameStruct<knMaxCategoryNameLen> CCategoryName;
+typedef TNameStruct CCategoryName;
typedef std::map<CCategoryName, long> CCategoryNameIndexMap;
typedef std::list<CCategoryName> CCategoryNameList;
-//Constructor. Initializes to a specified string
-//(if one is provided) or to all zeroes (if not).
-//
-template<int nSize>
-TNameStruct<nSize>::TNameStruct(const char *kpName)
-{
- if (NULL == kpName)
- {
- memset(name, 0, sizeof(name));
- }
- else
- {
- strncpy(name, kpName, nSize);
- name[nSize-1] = '\0';
- }
-}
-
-
-//Comparison operator (alphabetic, case-insensitive).
-//
-template<int nSize>
-bool
-TNameStruct<nSize>::operator<(const TNameStruct& other) const
-{
- return (_stricmp(name, other.name) < 0);
-}
-
-
-//Comparison operator (alphabetic, case-insensitive).
-//
-template<int nSize>
-bool
-TNameStruct<nSize>::operator>(const TNameStruct& other) const
-{
- return (_stricmp(name, other.name) > 0);
-}
-
-
-//Equality operator (alphabetic, case-insensitive).
-//
-template<int nSize>
-bool
-TNameStruct<nSize>::operator==(const TNameStruct& other) const
-{
- return (_stricmp(name, other.name) == 0);
-}
-
-
-//Inequality operator (alphabetic, case-insensitive).
-//
-template<int nSize>
-bool
-TNameStruct<nSize>::operator!=(const TNameStruct& other) const
-{
- return (_stricmp(name, other.name) != 0);
-}
-
#endif //MG_NAMESTRUCT_H
-
-
-//End of file.
Modified: sandbox/rfc90/MgDev/Common/Foundation/Data/MimeType.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/Data/MimeType.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/Data/MimeType.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -36,4 +36,5 @@
const STRING MgMimeType::Json = L"application/json";
const STRING MgMimeType::Kml = L"application/vnd.google-earth.kml+xml";
const STRING MgMimeType::Kmz = L"application/vnd.google-earth.kmz";
+const STRING MgMimeType::Meta = L"application/metatile";
Modified: sandbox/rfc90/MgDev/Common/Foundation/Data/MimeType.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/Data/MimeType.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/Data/MimeType.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -68,8 +68,11 @@
/// application/vnd.google-earth.kml+xml
static const STRING Kml; ///\if INTERNAL value("application/vnd.google-earth.kml+xml") \endif
- /// application/vnd.google-earth.kmz
+ /// application/vnd.google-eart.kmz
static const STRING Kmz; ///\if INTERNAL value("application/vnd.google-earth.kmz") \endif
+
+ /// application/metatile
+ static const STRING Meta; ///\if INTERNAL value("application/metatile") \endif
};
/// \}
Modified: sandbox/rfc90/MgDev/Common/Foundation/Data/NamedCollection.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/Data/NamedCollection.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/Data/NamedCollection.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -59,11 +59,8 @@
/// </summary>
MgNamedCollection::~MgNamedCollection()
{
- if (m_pNameMap)
- {
- delete m_pNameMap;
- m_pNameMap = NULL;
- }
+ delete m_pNameMap;
+ m_pNameMap = NULL;
}
@@ -263,11 +260,8 @@
void MgNamedCollection::Clear()
{
// Clear the map
- if (m_pNameMap)
- {
- delete m_pNameMap;
- m_pNameMap = NULL;
- }
+ delete m_pNameMap;
+ m_pNameMap = NULL;
// Clear the list
m_dCollection->Clear();
Modified: sandbox/rfc90/MgDev/Common/Foundation/Data/StringProperty.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/Data/StringProperty.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/Data/StringProperty.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -127,7 +127,14 @@
{
str += "<Type>string</Type>";
}
- str += "<Value>" + MgUtil::WideCharToMultiByte(MgUtil::ReplaceEscapeCharInXml(this->GetValue())) + "</Value>";
+
+ if (!this->IsNull())
+ {
+ str += "<Value>";
+ str += MgUtil::WideCharToMultiByte(MgUtil::ReplaceEscapeCharInXml(this->GetValue()));
+ str += "</Value>";
+ }
+
str += "</" + rootElmName + ">";
}
else
Modified: sandbox/rfc90/MgDev/Common/Foundation/Foundation.rc
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/Foundation.rc 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/Foundation.rc 2010-11-13 18:14:35 UTC (rev 5390)
@@ -6,7 +6,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
+#include "winresrc.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
1 TEXTINCLUDE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#include ""winresrc.h""\r\n"
"\0"
END
Modified: sandbox/rfc90/MgDev/Common/Foundation/Foundation.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/Foundation.vcproj 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/Foundation.vcproj 2010-11-13 18:14:35 UTC (rev 5390)
@@ -44,7 +44,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\MdfModel;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\dbxml-2.3.10\xerces-c-src\src"
+ AdditionalIncludeDirectories="..\MdfModel;..\..\Oem\ACE\ACE_wrappers;"..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FOUNDATION_EXPORTS"
MinimalRebuild="true"
ExceptionHandling="2"
@@ -64,10 +64,10 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ACEd.lib xerces-c_2D.lib"
+ AdditionalDependencies="ACEd.lib xerces-c_3mgD.lib"
OutputFile="$(OutDir)\MgFoundationd.dll"
LinkIncremental="2"
- AdditionalLibraryDirectories="..\..\Oem\ACE\ACE_wrappers\lib;..\..\Oem\dbxml-2.3.10\lib"
+ AdditionalLibraryDirectories="..\..\Oem\ACE\ACE_wrappers\lib;..\..\Oem\dbxml\lib"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\MgFoundationd.pdb"
SubSystem="2"
@@ -123,7 +123,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\MdfModel;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\dbxml-2.3.10\xerces-c-src\src"
+ AdditionalIncludeDirectories="..\MdfModel;..\..\Oem\ACE\ACE_wrappers;"..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FOUNDATION_EXPORTS;__LITTLE_ENDIAN__"
MinimalRebuild="true"
ExceptionHandling="2"
@@ -143,10 +143,10 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ACEd.lib xerces-c_2D.lib"
+ AdditionalDependencies="ACEd.lib xerces-c_3mgD.lib"
OutputFile="$(OutDir)\MgFoundationd.dll"
LinkIncremental="2"
- AdditionalLibraryDirectories="..\..\Oem\ACE\ACE_wrappers\lib64;..\..\Oem\dbxml-2.3.10\lib64"
+ AdditionalLibraryDirectories="..\..\Oem\ACE\ACE_wrappers\lib64;..\..\Oem\dbxml\lib64"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\MgFoundationd.pdb"
SubSystem="2"
@@ -200,7 +200,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- AdditionalIncludeDirectories="..\MdfModel;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\dbxml-2.3.10\xerces-c-src\src"
+ AdditionalIncludeDirectories="..\MdfModel;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\dbxml\xerces-c-src\src"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FOUNDATION_EXPORTS"
ExceptionHandling="2"
RuntimeLibrary="2"
@@ -218,10 +218,10 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ACE.lib xerces-c_2.lib"
+ AdditionalDependencies="ACE.lib xerces-c_3mg.lib"
OutputFile="$(OutDir)\MgFoundation.dll"
LinkIncremental="1"
- AdditionalLibraryDirectories="..\..\Oem\ACE\ACE_wrappers\lib;..\..\Oem\dbxml-2.3.10\lib"
+ AdditionalLibraryDirectories="..\..\Oem\ACE\ACE_wrappers\lib;..\..\Oem\dbxml\lib"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\MgFoundation.pdb"
SubSystem="2"
@@ -279,7 +279,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- AdditionalIncludeDirectories="..\MdfModel;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\dbxml-2.3.10\xerces-c-src\src"
+ AdditionalIncludeDirectories="..\MdfModel;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\dbxml\xerces-c-src\src"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FOUNDATION_EXPORTS;__LITTLE_ENDIAN__"
ExceptionHandling="2"
RuntimeLibrary="2"
@@ -297,10 +297,10 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ACE.lib xerces-c_2.lib"
+ AdditionalDependencies="ACE.lib xerces-c_3mg.lib"
OutputFile="$(OutDir)\MgFoundation.dll"
LinkIncremental="1"
- AdditionalLibraryDirectories="..\..\Oem\ACE\ACE_wrappers\lib64;..\..\Oem\dbxml-2.3.10\lib64"
+ AdditionalLibraryDirectories="..\..\Oem\ACE\ACE_wrappers\lib64;..\..\Oem\dbxml\lib64"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\MgFoundation.pdb"
SubSystem="2"
Modified: sandbox/rfc90/MgDev/Common/Foundation/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/Makefile.am 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/Makefile.am 2010-11-13 18:14:35 UTC (rev 5390)
@@ -231,7 +231,7 @@
-I../Security \
-I../MdfModel \
-I../../Oem/ACE/ACE_wrappers \
- -I../../Oem/dbxml-2.3.10/xerces-c-src/src
+ -I../../Oem/dbxml/xerces-c-src/src
libMgFoundation_la_LIBADD = \
-lACE \
@@ -241,6 +241,6 @@
libMgFoundation_la_LDFLAGS = -release $(PACKAGE_VERSION) \
-L../../Oem/ACE/ACE_wrappers/ace \
- -L../../Oem/dbxml-2.3.10/install/lib \
+ -L../../Oem/dbxml/install/lib \
-L../MdfParser \
-L../MdfModel
Modified: sandbox/rfc90/MgDev/Common/Foundation/System/ArgumentPacket.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/System/ArgumentPacket.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/System/ArgumentPacket.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -25,9 +25,19 @@
// Argument Packet Wrapper Structure
struct MgArgumentPacket : public MgBasicPacket
{
- MgArgumentPacket() : m_pData( NULL ) { };
+ MgArgumentPacket()
+ :
+ m_ArgumentType(0),
+ m_pData(NULL),
+ m_Length(0)
+ {
+ }
- virtual ~MgArgumentPacket() { delete[] m_pData; };
+ virtual ~MgArgumentPacket()
+ {
+ delete[] m_pData;
+ m_pData = NULL;
+ }
UINT32 m_ArgumentType;
UINT8* m_pData;
Modified: sandbox/rfc90/MgDev/Common/Foundation/System/BasicPacket.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/System/BasicPacket.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/System/BasicPacket.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -22,6 +22,12 @@
// Basic Packet Wrapper Structure
struct MgBasicPacket
{
+ MgBasicPacket()
+ :
+ m_PacketHeader(0)
+ {
+ }
+
UINT32 m_PacketHeader;
};
/// \endcond
Modified: sandbox/rfc90/MgDev/Common/Foundation/System/BinaryStreamArgumentPacket.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/System/BinaryStreamArgumentPacket.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/System/BinaryStreamArgumentPacket.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -25,6 +25,12 @@
// Binary Stream Argument Packet Wrapper Structure
struct MgBinaryStreamArgumentPacket : public MgArgumentPacket
{
+ MgBinaryStreamArgumentPacket()
+ :
+ m_Version(0)
+ {
+ }
+
UINT32 m_Version;
};
/// \endcond
Modified: sandbox/rfc90/MgDev/Common/Foundation/System/CollectionPacket.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/System/CollectionPacket.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/System/CollectionPacket.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -25,6 +25,12 @@
// Collection Packet Wrapper Structure
struct MgCollectionPacket : public MgArgumentPacket
{
+ MgCollectionPacket()
+ :
+ m_NumElements(0)
+ {
+ }
+
UINT32 m_NumElements;
};
/// \endcond
Modified: sandbox/rfc90/MgDev/Common/Foundation/System/Configuration.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/System/Configuration.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/System/Configuration.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -91,29 +91,33 @@
MG_CONFIGURATION_TRY()
- m_fileLoaded = false;
- m_fileName = fileName;
+ // We need to ensure that the configuration file is loaded only once from this configuration object
+ // ACE returns an EBUSY error if the Open() method of ACE_Configuration_Heap is called more than once.
+ if(!m_fileLoaded)
+ {
+ m_fileName = fileName;
- if(m_config.Open())
- {
- if(m_config.ImportConfig(fileName))
+ if(m_config.Open())
{
- m_fileLoaded = true;
+ if(m_config.ImportConfig(fileName))
+ {
+ m_fileLoaded = true;
+ }
+ else
+ {
+ MgStringCollection arguments;
+ arguments.Add(fileName);
+
+ throw new MgConfigurationLoadFailedException(
+ L"MgConfiguration.LoadConfiguration",
+ __LINE__, __WFILE__, &arguments, L"", NULL);
+ }
}
else
{
- MgStringCollection arguments;
- arguments.Add(fileName);
-
- throw new MgConfigurationLoadFailedException(
- L"MgConfiguration.LoadConfiguration",
- __LINE__, __WFILE__, &arguments, L"", NULL);
+ ACE_ERROR((LM_ERROR, ACE_TEXT("%p\n"), ACE_TEXT("MgConfiguration::LoadConfiguration()")));
}
}
- else
- {
- ACE_ERROR((LM_ERROR, ACE_TEXT("%p\n"), ACE_TEXT("MgConfiguration::LoadConfiguration()")));
- }
MG_CONFIGURATION_CATCH_AND_THROW(L"MgConfiguration.LoadConfiguration")
}
Modified: sandbox/rfc90/MgDev/Common/Foundation/System/ControlPacket.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/System/ControlPacket.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/System/ControlPacket.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -24,6 +24,13 @@
// Control Packet Wrapper Structure
struct MgControlPacket : public MgBasicPacket
{
+ MgControlPacket()
+ :
+ m_PacketVersion(0),
+ m_ControlID(0)
+ {
+ }
+
UINT32 m_PacketVersion;
UINT32 m_ControlID;
};
Modified: sandbox/rfc90/MgDev/Common/Foundation/System/Disposable.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/System/Disposable.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/System/Disposable.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -79,7 +79,7 @@
/// \return
/// Returns nothing
///
- void SetRefCountFlag();
+ virtual void SetRefCountFlag();
protected:
Modified: sandbox/rfc90/MgDev/Common/Foundation/System/GuardDisposable.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/System/GuardDisposable.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/System/GuardDisposable.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -79,6 +79,13 @@
//////////////////////////////////////////////////////////////
+void MgGuardDisposable::SetRefCountFlag()
+{
+ ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex));
+ m_refCountFlag = true;
+}
+
+//////////////////////////////////////////////////////////////
MgGuardDisposable::MgGuardDisposable()
{
}
Modified: sandbox/rfc90/MgDev/Common/Foundation/System/GuardDisposable.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/System/GuardDisposable.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/System/GuardDisposable.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -67,6 +67,15 @@
///
virtual INT32 Release();
+ //////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Sets the refcount flag for this object to true
+ ///
+ /// \return
+ /// Returns nothing
+ ///
+ void SetRefCountFlag();
+
protected:
//////////////////////////////////////////////////////////////////
Modified: sandbox/rfc90/MgDev/Common/Foundation/System/OperationResponsePacket.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/System/OperationResponsePacket.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/System/OperationResponsePacket.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -24,6 +24,14 @@
// Operation Response Packet Wrapper Structure
struct MgOperationResponsePacket : public MgBasicPacket
{
+ MgOperationResponsePacket()
+ :
+ m_PacketVersion(0),
+ m_ECode(0),
+ m_NumReturnValues(0)
+ {
+ }
+
UINT32 m_PacketVersion;
UINT32 m_ECode;
UINT32 m_NumReturnValues;
Modified: sandbox/rfc90/MgDev/Common/Foundation/System/StreamReader.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/System/StreamReader.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/System/StreamReader.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -440,11 +440,7 @@
{
if (len > allocLen)
{
- if (NULL != temp)
- {
- delete [] temp;
- }
-
+ delete [] temp;
temp = new char[len];
allocLen = len;
}
@@ -487,10 +483,7 @@
MG_CATCH(L"MgStreamReader.GetStream")
- if (NULL != temp)
- {
- delete [] temp;
- }
+ delete [] temp;
MG_THROW()
Modified: sandbox/rfc90/MgDev/Common/Foundation/System/XmlDefs.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/System/XmlDefs.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/System/XmlDefs.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -30,13 +30,16 @@
#include <xercesc/dom/DOMImplementation.hpp>
#include <xercesc/dom/DOMImplementationLS.hpp>
-#include <xercesc/dom/DOMWriter.hpp>
#include <xercesc/framework/StdOutFormatTarget.hpp>
#include <xercesc/framework/MemBufFormatTarget.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/util/XMLUni.hpp>
#include <xercesc/framework/MemBufInputSource.hpp>
+#include <xercesc/dom/DOMLSSerializer.hpp>
+#include <xercesc/dom/DOMConfiguration.hpp>
+#include <xercesc/dom/DOMLSOutput.hpp>
+#include <xercesc/framework/XMLFormatter.hpp>
#pragma warning(pop)
Modified: sandbox/rfc90/MgDev/Common/Foundation/System/XmlUtil.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Foundation/System/XmlUtil.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Foundation/System/XmlUtil.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -87,24 +87,16 @@
MgXmlUtil::~MgXmlUtil()
{
- if (NULL != m_parser)
- {
- delete m_parser;
- m_parser = NULL;
- }
+ delete m_parser;
+ m_parser = NULL;
- if (NULL != m_bis)
- {
- delete m_bis;
- m_bis = NULL;
- }
+ delete m_bis;
+ m_bis = NULL;
if (NULL != m_doc)
{
if (m_ownDomDoc)
- {
m_doc->release();
- }
m_doc = NULL;
}
@@ -731,8 +723,10 @@
MgByte* MgXmlUtil::ToBytes()
{
Ptr<MgByte> bytes;
- DOMWriter* theSerializer = NULL;
- MemBufFormatTarget* memTarget = NULL;
+ DOMLSSerializer* theSerializer = NULL;
+ DOMLSOutput* theOutputDesc = NULL;
+ DOMConfiguration* theDC = NULL;
+ XMLFormatTarget* memTarget = NULL;
MG_XML_TRY()
@@ -745,32 +739,37 @@
DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr);
CHECKNULL(impl, L"MgXmlUtil.ToBytes");
- theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
+ theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+ theOutputDesc = ((DOMImplementationLS*)impl)->createLSOutput();
CHECKNULL(theSerializer, L"MgXmlUtil.ToBytes");
+ CHECKNULL(theOutputDesc, L"MgXmlUtil.ToBytes");
+ theDC = theSerializer->getDomConfig();
// set user specified output encoding
XMLCh encodeStr[100];
XMLString::transcode("UTF-8", encodeStr, 99);
- theSerializer->setEncoding(encodeStr);
+ theOutputDesc->setEncoding(encodeStr);
// set feature if the serializer supports the feature/mode
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTSplitCdataSections, gSplitCdataSections))
- theSerializer->setFeature(XMLUni::fgDOMWRTSplitCdataSections, gSplitCdataSections);
+ if (theDC->canSetParameter(XMLUni::fgDOMWRTSplitCdataSections, gSplitCdataSections))
+ theDC->setParameter(XMLUni::fgDOMWRTSplitCdataSections, gSplitCdataSections);
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTDiscardDefaultContent, gDiscardDefaultContent))
- theSerializer->setFeature(XMLUni::fgDOMWRTDiscardDefaultContent, gDiscardDefaultContent);
+ if (theDC->canSetParameter(XMLUni::fgDOMWRTDiscardDefaultContent, gDiscardDefaultContent))
+ theDC->setParameter(XMLUni::fgDOMWRTDiscardDefaultContent, gDiscardDefaultContent);
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, gFormatPrettyPrint))
- theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, gFormatPrettyPrint);
+ if (theDC->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint, gFormatPrettyPrint))
+ theDC->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, gFormatPrettyPrint);
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTBOM, gWriteBOM))
- theSerializer->setFeature(XMLUni::fgDOMWRTBOM, gWriteBOM);
+ if (theDC->canSetParameter(XMLUni::fgDOMWRTBOM, gWriteBOM))
+ theDC->setParameter(XMLUni::fgDOMWRTBOM, gWriteBOM);
memTarget = new MemBufFormatTarget();
- theSerializer->writeNode(memTarget, *m_doc);
+ theOutputDesc->setByteStream(memTarget);
- INT32 bytesLen = (INT32)memTarget->getLen();
- BYTE_ARRAY_IN rawBytes = (BYTE_ARRAY_IN)(memTarget->getRawBuffer());
+ theSerializer->write(m_doc, theOutputDesc);
+
+ INT32 bytesLen = (INT32)((MemBufFormatTarget*)memTarget)->getLen();
+ BYTE_ARRAY_IN rawBytes = (BYTE_ARRAY_IN)((MemBufFormatTarget*)memTarget)->getRawBuffer();
bytes->Append(rawBytes, bytesLen);
MG_XML_CATCH(L"MgXmlUtil.ToBytes")
Modified: sandbox/rfc90/MgDev/Common/Geometry/Buffer/GreatCircleBufferUtil.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/Buffer/GreatCircleBufferUtil.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/Buffer/GreatCircleBufferUtil.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -174,10 +174,7 @@
void GreatCircleBufferUtil::InitPolyObject()
{
- if (m_pfBufferVerts != NULL)
- {
- delete [] m_pfBufferVerts;
- }
+ delete [] m_pfBufferVerts;
// allocate the buffer used by CreateConvexOffsetChains() - note that the
// buffer is given an "overrun" area at the end - this helps simplify the
Modified: sandbox/rfc90/MgDev/Common/Geometry/Buffer/MgBuffer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/Buffer/MgBuffer.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/Buffer/MgBuffer.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -254,12 +254,9 @@
else
delete bufferPolygon;
- if (bufferUtil != NULL)
- delete bufferUtil;
+ delete bufferUtil;
+ delete borderWalker;
- if (borderWalker)
- delete borderWalker;
-
return;
}
@@ -311,12 +308,9 @@
else
delete bufferPolygon;
- if (bufferUtil != NULL)
- delete bufferUtil;
+ delete bufferUtil;
+ delete borderWalker;
- if (borderWalker)
- delete borderWalker;
-
return;
}
@@ -378,12 +372,9 @@
else
delete bufferPolygon;
- if (bufferUtil != NULL)
- delete bufferUtil;
+ delete bufferUtil;
+ delete borderWalker;
- if (borderWalker)
- delete borderWalker;
-
return;
}
@@ -461,11 +452,8 @@
else
delete bufferPolygon;
- if (bufferUtil != NULL)
- delete bufferUtil;
-
- if (borderWalker)
- delete borderWalker;
+ delete bufferUtil;
+ delete borderWalker;
}
return;
@@ -542,12 +530,9 @@
else
delete bufferPolygon;
- if (bufferUtil != NULL)
- delete bufferUtil;
+ delete bufferUtil;
+ delete borderWalker;
- if (borderWalker)
- delete borderWalker;
-
if (topoError)
throw new PlaneSweepException(PlaneSweepException::TopologicalError);
}
@@ -627,11 +612,8 @@
else
delete bufferPolygon;
- if (bufferUtil != NULL)
- delete bufferUtil;
-
- if (borderWalker)
- delete borderWalker;
+ delete bufferUtil;
+ delete borderWalker;
}
return;
@@ -719,11 +701,8 @@
else
delete bufferPolygon;
- if (bufferUtil != NULL)
- delete bufferUtil;
-
- if (borderWalker)
- delete borderWalker;
+ delete bufferUtil;
+ delete borderWalker;
}
return;
Modified: sandbox/rfc90/MgDev/Common/Geometry/Buffer/MgBuffer.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/Buffer/MgBuffer.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/Buffer/MgBuffer.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -44,10 +44,8 @@
~BufferParams()
{
- if (progressCallback != NULL)
- delete progressCallback;
- if (transform != NULL)
- delete transform;
+ delete progressCallback;
+ delete transform;
}
ProgressCallback* progressCallback;
Modified: sandbox/rfc90/MgDev/Common/Geometry/Buffer/bufrutil.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/Buffer/bufrutil.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/Buffer/bufrutil.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -110,10 +110,7 @@
BufferUtility::~BufferUtility()
{
- if (m_pfBufferVerts != NULL)
- {
- delete [] m_pfBufferVerts;
- }
+ delete [] m_pfBufferVerts;
} // end: destructor
@@ -188,10 +185,7 @@
void BufferUtility::InitPointLine()
{
- if (m_pfBufferVerts != NULL)
- {
- delete [] m_pfBufferVerts;
- }
+ delete [] m_pfBufferVerts;
// allocate a buffer used to generate point/line segment buffers
@@ -222,10 +216,7 @@
void BufferUtility::InitPolyObject()
{
- if (m_pfBufferVerts != NULL)
- {
- delete [] m_pfBufferVerts;
- }
+ delete [] m_pfBufferVerts;
// allocate the buffer used by CreateConvexOffsetChains() - note that the
// buffer is given an "overrun" area at the end - this helps simplify the
Modified: sandbox/rfc90/MgDev/Common/Geometry/Buffer/planeswp.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/Buffer/planeswp.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/Buffer/planeswp.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -332,10 +332,6 @@
void PlaneSweep::DoPlaneSweep(ProgressCallback &callback,
OrientedPolyPolygon &outputPolygon)
{
-
-
-
-
// check if there is anything to do
if (m_nEdgesAdded == 0)
@@ -353,7 +349,6 @@
if (callback.IsCanceled())
return;
-
// initialize pointers to data structures
EventIntervalArray *eventIntArray = NULL;
@@ -495,12 +490,6 @@
callback.AdvanceOneSubInterval();
}
-
-
-
-
-
-
// clean up data structures that are no longer required, and the
// progress interval for the sweep part
@@ -541,21 +530,12 @@
MG_THROW()
}
-
-
-
-
-
-
delete intersectList;
// extract the output poly-polygon from the graph of WingedEdges
-
-
-
-
if (!callback.IsCanceled())
+ {
try
{
GetOutputPolygon(callback, outputPolygon);
@@ -566,14 +546,8 @@
callback.EndProgressInterval();
throw(ex);
}
+ }
-
-
-
-
-
-
-
// end the progress interval started above
callback.EndProgressInterval();
@@ -680,7 +654,8 @@
void PlaneSweep::AddEdge(OpsDoublePoint *vertices[2])
{
- if (*vertices[0] != *vertices[1]) {
+ if (*vertices[0] != *vertices[1])
+ {
WingedEdge *wEdge = m_wingedEdgeAlloc->Allocate(vertices);
m_tupleArray->AddSweepTuples(m_sweepEdgeAlloc->Allocate(wEdge));
m_nEdgesAdded++;
@@ -735,7 +710,8 @@
double ordinate;
SweepEdge *edge2 = xOrdTree->Below(edge);
- while (edge2 != NULL) {
+ while (edge2 != NULL)
+ {
ordinate = edge2->Ordinate(x);
if (y != ordinate)
break;
@@ -746,7 +722,8 @@
// walk up the X-Order looking for intersecting edges
edge2 = xOrdTree->Above(edge);
- while (edge2 != NULL) {
+ while (edge2 != NULL)
+ {
ordinate = edge2->Ordinate(x);
if (y != ordinate)
break;
@@ -795,12 +772,10 @@
OpsDoublePoint *intersectPt = edge1->MinVert();
-
if ( !intersectList->Add(*intersectPt, edge1->GetWingedEdge(),
edge2->GetWingedEdge()))
return;
-
// if the edges have the same slope, and the start point of edge1 is not
// the end point of edge2 then the two edges overlap - add the appropriate
// edge endpoint to the intersection list
@@ -1279,10 +1254,6 @@
void PlaneSweep::GetOutputPolygon(ProgressCallback &callback,
OrientedPolyPolygon &outputPolygon)
{
-
-
-
-
// open boundary traversal trace file if necessary (debug mode only)
#if defined _DEBUG
@@ -1318,13 +1289,6 @@
(float)wEdge->m_vert[1]->x, (float)wEdge->m_vert[1]->y);
}
MgDumpFFGF::closeFile(ffgfFile);
-
-
-
-
-
-
-
#endif
for (int i = 0; i < totalEdges; i++) {
@@ -1394,12 +1358,6 @@
}
#endif
-
-
-
-
-
-
// if no points in the output polygon and no cancelation was signalled,
// then some sort of topological error must have occurred - throw a Plane-
// SweepException to indicate the error
@@ -1477,9 +1435,6 @@
::fprintf(boundaryTraversalTraceFile, "id: %d - already visited\n", wEdge->m_id);
#endif
-
-
-
abandonBoundary = TRUE;
break;
}
@@ -1509,7 +1464,6 @@
} while ( wEdge != startEdge || side != startSide);
-
// if no interior edges were encountered, then close the boundary and
// call internal AcceptBoundary() method to determine whether or not to
// accept the boundary
@@ -1674,11 +1628,13 @@
void PlaneSweep::ResizeBoundaryArray()
{
- if (m_nBoundaryVertices + 1 > m_boundaryArraySize) {
+ if (m_nBoundaryVertices + 1 > m_boundaryArraySize)
+ {
size_t newSize = m_boundaryArraySize + BoundaryArraySize;
OpsFloatPoint *tmp = new OpsFloatPoint[newSize];
- if (m_nBoundaryVertices > 0) {
+ if (m_nBoundaryVertices > 0)
+ {
size_t nBytesToCopy = m_nBoundaryVertices * sizeof(OpsFloatPoint);
::memcpy(tmp, m_boundaryVertices, nBytesToCopy);
}
@@ -1915,7 +1871,6 @@
}
}
-
if (yCross[0] == HUGE_VAL || yCross[1] == HUGE_VAL)
return FALSE;
Modified: sandbox/rfc90/MgDev/Common/Geometry/CoordinateCollection.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/CoordinateCollection.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/CoordinateCollection.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -316,7 +316,10 @@
virtual void ToAwkt(REFSTRING awktStr, REFSTRING coordDim, bool is2dOnly);
protected:
- void Dispose() { delete this; }
+ void Dispose()
+ {
+ delete this;
+ }
private:
Modified: sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystem.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystem.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystem.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -58,6 +58,10 @@
virtual STRING GetEllipsoid()=0; /// __get
virtual STRING GetEllipsoidDescription()=0; /// __get
+ virtual INT32 GetEpsgCode (void)=0; /// __get
+ virtual INT32 GetSridCode (void)=0; /// __get
+ virtual INT16 GetEpsgQuadrant (void)=0; /// __get
+
virtual MgCoordinateSystemMeasure* GetMeasure()=0;
virtual MgStringCollection* GetCategories()=0;
virtual MgCoordinateSystemCatalog* GetCatalog()=0;
Modified: sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemCatalog.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemCatalog.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemCatalog.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -23,6 +23,8 @@
class MgCoordinateSystemEllipsoidDictionary;
class MgCoordinateSystemCategoryDictionary;
class MgCoordinateSystemGeodeticTransformation;
+class MgCoordinateSystemGeodeticPathDictionary;
+class MgCoordinateSystemGeodeticTransformDefDictionary;
class MgCoordinateSystemMathComparator;
class MgCoordinateSystemFormatConverter;
class MgCoordinateSystemProjectionInformation;
@@ -53,6 +55,8 @@
virtual MgCoordinateSystemDictionary* GetCoordinateSystemDictionary()=0;
virtual MgCoordinateSystemDatumDictionary* GetDatumDictionary()=0;
virtual MgCoordinateSystemEllipsoidDictionary* GetEllipsoidDictionary()=0;
+ virtual MgCoordinateSystemGeodeticPathDictionary* GetGeodeticPathDictionary()=0;
+ virtual MgCoordinateSystemGeodeticTransformDefDictionary* GetGeodeticTransformDefDictionary()=0;
virtual MgDisposableCollection* GetGeodeticTransformations(MgCoordinateSystemDatum* pSource, MgCoordinateSystemDatum *pTarget)=0;
virtual MgCoordinateSystemMathComparator* GetMathComparator()=0;
virtual MgCoordinateSystemFormatConverter* GetFormatConverter()=0;
Modified: sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemDatum.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemDatum.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemDatum.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -40,6 +40,8 @@
virtual bool IsLegalGroup(CREFSTRING sGroup)=0;
virtual STRING GetSource()=0;
virtual void SetSource(CREFSTRING sSource)=0;
+ virtual INT16 GetEpsgCode()=0;
+ virtual void SetEpsgCode(INT16 epsgCode)=0;
virtual bool IsLegalSource(CREFSTRING sSource)=0;
virtual bool IsProtected()=0;
virtual INT16 GetAge()=0;
Modified: sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemEllipsoid.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemEllipsoid.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemEllipsoid.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -38,6 +38,8 @@
virtual bool IsLegalGroup(CREFSTRING sGroup)=0;
virtual STRING GetSource()=0;
virtual void SetSource(CREFSTRING sSource)=0;
+ virtual INT16 GetEpsgCode()=0;
+ virtual void SetEpsgCode(INT16 epsgCode)=0;
virtual bool IsLegalSource(CREFSTRING sSource)=0;
virtual bool IsProtected()=0;
virtual INT16 GetAge()=0;
Modified: sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -17,16 +17,18 @@
#include "GeometryCommon.h"
#include "CoordSysCommon.h" //for COORDINATE_SYSTEM_API
+#include "CoordSysUtil.h" //for Convert_Wide_To_Ascii, CsDictionaryOpenMode
#include "CoordinateSystem.h" //for MgCoordinateSystem
#include "CoordSys.h" //for CCoordinateSystem
#include "CoordSysEnum.h" //for CCoordinateSystemEnum
-#include "CoordSysEnum.h" //for CCoordinateSystemEnum
#include "CoordSysEnumDatum.h" //for CCoordinateSystemEnumDatum
+#include "CoordSysGeodeticPath.h" //for CCoordinateSystemGeodeticPath
#include "CoordSysEnumEllipsoid.h" //for CCoordinateSystemEnumEllipsoid
+#include "CoordSysDictionaryBase.h" //for CCoordinateSystemDictionaryBase
#include "CoordSysDictionary.h" //for CCoordinateSystemDictionary
#include "CoordSysDatumDictionary.h" //for CCoordinateSystemDatumDictionary
#include "CoordSysEllipsoidDictionary.h"//for CCoordinateSystemEllipsoidDictionary
-#include "CoordSysUtil.h" //for Convert_Wide_To_Ascii, CsDictionaryOpenMode
+#include "CoordSysGeodeticPathDictionary.h" //for CCoordinateSystemGeodeticPathDictionary
#include "CoordSysCategoryDictionary.h" //for CCoordinateSystemCategoryDictionary
#include "CoordSysCatalog.h" //for CCoordinateSystemCatalog
#include "CoordSysTransform.h" //for CCoordinateSystemTransform
@@ -507,7 +509,7 @@
{
throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.ConvertWktToEpsgCode", __LINE__, __WFILE__, NULL, L"", NULL);
}
- STRING strEpsgCode=pConverter->WktToCode(MgCoordinateSystemWktFlavor::Ogc, wkt, MgCoordinateSystemCodeFormat::Epsg);
+ STRING strEpsgCode=pConverter->WktToCode(MgCoordinateSystemWktFlavor::Unknown, wkt, MgCoordinateSystemCodeFormat::Epsg);
nEpsg = (INT32)wcstol(strEpsgCode.c_str(), NULL, 10);
MG_CATCH_AND_THROW(L"MgCoordinateSystemFactory.ConvertWktToEpsgCode")
Modified: sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGeodeticTransformation.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGeodeticTransformation.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGeodeticTransformation.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -18,6 +18,16 @@
#ifndef _MGCOORDINATESYSTEMGEODETICTRANSFORMATION_H_
#define _MGCOORDINATESYSTEMGEODETICTRANSFORMATION_H_
+/// \defgroup MgCoordinateSystemGeodeticTransformation MgCoordinateSystemGeodeticTransformation
+/// \ingroup Coordinate_System_classes
+/// \{
+
+////////////////////////////////////////////////////////////////
+/// \brief
+/// An instance of this class allow a caller do perform a geodetic transformation (datum shift).
+/// That is, this class does not operate on coordinate system level, but rather on
+/// datum level.
+///
class MgCoordinateSystemGeodeticTransformation : public MgGuardDisposable
{
DECLARE_CLASSNAME(MgCoordinateSystemGeodeticTransformation)
@@ -31,23 +41,95 @@
virtual MgCoordinate* Shift(double dLongitude, double dLatitude)=0;
virtual MgCoordinate* Shift(double dLongitude, double dLatitude, double dZ)=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual double GetOffsetX()=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual double GetOffsetY()=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual double GetOffsetZ()=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual void SetOffset(double x, double y, double z)=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual double GetBursaWolfeTransformRotationX()=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual double GetBursaWolfeTransformRotationY()=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual double GetBursaWolfeTransformRotationZ()=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual double GetBursaWolfeTransformBwScale()=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual void SetBursaWolfeTransform(double dRotationX, double dRotationY, double dRotationZ, double dBwScale)=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual INT32 GetGeodeticTransformationMethod()=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual void SetGeodeticTransformationMethod(INT32 nGeodeticTransformationMethod)=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual double GetMaxOffset()=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual bool IsLegalOffset(double dOffset)=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual double GetMaxRotation()=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual bool IsLegalRotation(double dRotation)=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual double GetBwScaleMin()=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual double GetBwScaleMax()=0;
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Obsolete. Use MgCoordinateSystemGeodeticTransformDef and
+ /// MgCoordinateSystemGeodeticTransformDefParams (plus derived classes) instead.
virtual bool IsLegalBwScale(double dBwScale)=0;
protected:
@@ -64,4 +146,6 @@
static const INT32 m_cls_id = CoordinateSystem_CoordinateSystemGeodeticTransformation;
};
+/// \}
+
#endif //_MGCOORDINATESYSTEMGEODETICTRANSFORMATION_H_
Modified: sandbox/rfc90/MgDev/Common/Geometry/Geometry.rc
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/Geometry.rc 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/Geometry.rc 2010-11-13 18:14:35 UTC (rev 5390)
@@ -6,7 +6,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
+#include "winresrc.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
1 TEXTINCLUDE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#include ""winresrc.h""\r\n"
"\0"
END
Modified: sandbox/rfc90/MgDev/Common/Geometry/Geometry.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/Geometry.vcproj 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/Geometry.vcproj 2010-11-13 18:14:35 UTC (rev 5390)
@@ -126,8 +126,6 @@
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- PrecompiledHeaderThrough=""
WarningLevel="3"
DebugInformationFormat="3"
/>
@@ -278,8 +276,6 @@
AdditionalIncludeDirectories="..\CoordinateSystem;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;"..\..\Oem\geos-2.2.0\source\headers";..\..\Oem\CsMap\Include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GEOMETRY_EXPORTS"
RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- PrecompiledHeaderThrough=""
WarningLevel="3"
DebugInformationFormat="3"
/>
@@ -2643,6 +2639,38 @@
>
</File>
<File
+ RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticAnalyticalTransformationMethod.h"
+ >
+ </File>
+ <File
+ RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticAnalyticalTransformDefParams.h"
+ >
+ </File>
+ <File
+ RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticInterpolationTransformDefParams.h"
+ >
+ </File>
+ <File
+ RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticMultipleRegressionTransformationMethod.h"
+ >
+ </File>
+ <File
+ RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticMultipleRegressionTransformDefParams.h"
+ >
+ </File>
+ <File
+ RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticPath.h"
+ >
+ </File>
+ <File
+ RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticPathDictionary.h"
+ >
+ </File>
+ <File
+ RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticPathElement.h"
+ >
+ </File>
+ <File
RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticTransformation.h"
>
</File>
@@ -2651,6 +2679,30 @@
>
</File>
<File
+ RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticTransformDef.h"
+ >
+ </File>
+ <File
+ RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticTransformDefDictionary.h"
+ >
+ </File>
+ <File
+ RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticTransformDefParams.h"
+ >
+ </File>
+ <File
+ RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticTransformDefType.h"
+ >
+ </File>
+ <File
+ RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticTransformGridFile.h"
+ >
+ </File>
+ <File
+ RelativePath=".\CoordinateSystem\CoordinateSystemGeodeticTransformGridFileFormat.h"
+ >
+ </File>
+ <File
RelativePath=".\CoordinateSystem\CoordinateSystemGridGeneric.h"
>
</File>
@@ -2807,6 +2859,14 @@
>
</File>
<File
+ RelativePath="..\CoordinateSystem\CoordSysDictionaryBase.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysDictionaryBase.h"
+ >
+ </File>
+ <File
RelativePath="..\CoordinateSystem\CoordSysDictionaryUtility.cpp"
>
</File>
@@ -2887,6 +2947,54 @@
>
</File>
<File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticAnalyticalTransformDefParams.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticAnalyticalTransformDefParams.h"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticInterpolationTransformDefParams.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticInterpolationTransformDefParams.h"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticMultipleRegressionTransformDefParams.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticMultipleRegressionTransformDefParams.h"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticPath.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticPath.h"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticPathDictionary.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticPathDictionary.h"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticPathElement.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticPathElement.h"
+ >
+ </File>
+ <File
RelativePath="..\CoordinateSystem\CoordSysGeodeticTransformation.cpp"
>
</File>
@@ -2895,6 +3003,38 @@
>
</File>
<File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticTransformDef.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticTransformDef.h"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticTransformDefDictionary.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticTransformDefDictionary.h"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticTransformDefParams.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticTransformDefParams.h"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticTransformGridFile.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\CoordSysGeodeticTransformGridFile.h"
+ >
+ </File>
+ <File
RelativePath="..\CoordinateSystem\CoordSysGridGeneric.cpp"
>
</File>
@@ -2911,6 +3051,10 @@
>
</File>
<File
+ RelativePath="..\CoordinateSystem\CoordSysMacro.h"
+ >
+ </File>
+ <File
RelativePath="..\CoordinateSystem\CoordSysMathComparator.cpp"
>
</File>
@@ -2987,6 +3131,10 @@
>
</File>
<File
+ RelativePath="..\CoordinateSystem\CriticalSection.cpp"
+ >
+ </File>
+ <File
RelativePath="..\CoordinateSystem\CriticalSection.h"
>
</File>
@@ -3011,9 +3159,21 @@
>
</File>
<File
+ RelativePath="..\CoordinateSystem\namestruct.cpp"
+ >
+ </File>
+ <File
RelativePath="..\CoordinateSystem\namestruct.h"
>
</File>
+ <File
+ RelativePath="..\CoordinateSystem\SmartCriticalClass.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\CoordinateSystem\SmartCriticalClass.h"
+ >
+ </File>
</Filter>
<File
RelativePath=".\AgfReaderWriter.cpp"
Modified: sandbox/rfc90/MgDev/Common/Geometry/GeometryClassId.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/GeometryClassId.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/GeometryClassId.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -112,6 +112,22 @@
#define CoordinateSystem_CoordinateSystemGridTick GEOMETRY_COORDINATE_SYSTEM_ID+31
#define CoordinateSystem_CoordinateSystemGridBase GEOMETRY_COORDINATE_SYSTEM_ID+32
+#define CoordinateSystem_CoordinateSystemGeodeticPath GEOMETRY_COORDINATE_SYSTEM_ID+33
+#define CoordinateSystem_CoordinateSystemGeodeticPathElement GEOMETRY_COORDINATE_SYSTEM_ID+34
+#define CoordinateSystem_CoordinateSystemGeodeticPathDictionary GEOMETRY_COORDINATE_SYSTEM_ID+35
+
+#define CoordinateSystem_CoordinateSystemGeodeticTransformDef GEOMETRY_COORDINATE_SYSTEM_ID+36
+#define CoordinateSystem_CoordinateSystemGeodeticAnalyticalTransformDef GEOMETRY_COORDINATE_SYSTEM_ID+37
+#define CoordinateSystem_CoordinateSystemGeodeticInterpolationTransformDef GEOMETRY_COORDINATE_SYSTEM_ID+38
+#define CoordinateSystem_CoordinateSystemGeodeticMultipleRegressionTransformDef GEOMETRY_COORDINATE_SYSTEM_ID+39
+#define CoordinateSystem_CoordinateSystemGeodeticTransformDefDictionary GEOMETRY_COORDINATE_SYSTEM_ID+40
+
+#define CoordinateSystem_CoordinateSystemGeodeticTransformDefParams GEOMETRY_COORDINATE_SYSTEM_ID+41
+#define CoordinateSystem_CoordinateSystemGeodeticAnalyticalTransformDefParams GEOMETRY_COORDINATE_SYSTEM_ID+42
+#define CoordinateSystem_CoordinateSystemGeodeticInterpolationTransformDefParams GEOMETRY_COORDINATE_SYSTEM_ID+43
+#define CoordinateSystem_CoordinateSystemGeodeticMultipleRegressionTransformDefParams GEOMETRY_COORDINATE_SYSTEM_ID+44
+#define CoordinateSystem_CoordinateSystemGeodeticTransformGridFile GEOMETRY_COORDINATE_SYSTEM_ID+45
+
// Exceptions
#define Geometry_Exception_MgCoordinateSystemComputationFailedException GEOMETRY_EXCEPTION_ID+0
#define Geometry_Exception_MgCoordinateSystemConversionFailedException GEOMETRY_EXCEPTION_ID+1
Modified: sandbox/rfc90/MgDev/Common/Geometry/GeometryCommon.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/GeometryCommon.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/GeometryCommon.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -108,6 +108,17 @@
#include "CoordinateSystem/CoordinateSystem.h"
#include "CoordinateSystem/CoordinateSystemDatum.h"
+#include "CoordinateSystem/CoordinateSystemGeodeticTransformGridFile.h"
+#include "CoordinateSystem/CoordinateSystemGeodeticTransformDefParams.h"
+#include "CoordinateSystem/CoordinateSystemGeodeticInterpolationTransformDefParams.h"
+#include "CoordinateSystem/CoordinateSystemGeodeticMultipleRegressionTransformDefParams.h"
+#include "CoordinateSystem/CoordinateSystemGeodeticAnalyticalTransformDefParams.h"
+#include "CoordinateSystem/CoordinateSystemGeodeticTransformDefType.h"
+#include "CoordinateSystem/CoordinateSystemGeodeticAnalyticalTransformationMethod.h"
+#include "CoordinateSystem/CoordinateSystemGeodeticMultipleRegressionTransformationMethod.h"
+#include "CoordinateSystem/CoordinateSystemGeodeticTransformDef.h"
+#include "CoordinateSystem/CoordinateSystemGeodeticPathElement.h"
+#include "CoordinateSystem/CoordinateSystemGeodeticPath.h"
#include "CoordinateSystem/CoordinateSystemGeodeticTransformation.h"
#include "CoordinateSystem/CoordinateSystemEllipsoid.h"
#include "CoordinateSystem/CoordinateSystemCategory.h"
@@ -119,6 +130,8 @@
#include "CoordinateSystem/CoordinateSystemDatumDictionary.h" //for MgCoordinateSystemDatumDictionary
#include "CoordinateSystem/CoordinateSystemEllipsoidDictionary.h" //for MgCoordinateSystemEllipsoidDictionary
#include "CoordinateSystem/CoordinateSystemCategoryDictionary.h" //for MgCoordinateSystemCategoryDictionary
+#include "CoordinateSystem/CoordinateSystemGeodeticTransformDefDictionary.h" //for MgCoordinateSystemGeodeticTransformDefDictionary
+#include "CoordinateSystem/CoordinateSystemGeodeticPathDictionary.h" //for MgCoordinateSystemGeodeticPathDictionary
#include "CoordinateSystem/CoordinateSystemDictionaryUtility.h" //for MgCoordinateSystemDictionaryUtility
#include "CoordinateSystem/CoordinateSystemCatalog.h"
#include "CoordinateSystem/CoordinateSystemFilter.h" //for MgCoordinateSystemFilter
Modified: sandbox/rfc90/MgDev/Common/Geometry/GeometryConsoleTest/GeometryConsoleTest.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/GeometryConsoleTest/GeometryConsoleTest.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/GeometryConsoleTest/GeometryConsoleTest.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -11,6 +11,89 @@
int _tmain(int argc, _TCHAR* argv[])
{
+#ifndef __SKIP__
+ // Some Catalog/Dictionary testing and timing.
+ clock_t startTime;
+ clock_t endTime;
+
+ MgCoordinateSystemFactory factory;
+ MgCoordinateSystemCatalog* catalog;
+
+ MgCoordinateSystemCategoryDictionary* categoryDict;
+ MgCoordinateSystemEllipsoidDictionary* ellipsoidDict;
+ MgCoordinateSystemDatumDictionary* datumDict;
+ MgCoordinateSystemDictionary* coordsysDict;
+ MgCoordinateSystemGeodeticTransformDefDictionary* xformDict;
+ MgCoordinateSystemGeodeticPathDictionary* pathDict;
+
+ MgCoordinateSystemEnum* categoryEnum;
+ MgCoordinateSystemEnum* ellipsoidEnum;
+ MgCoordinateSystemEnum* datumEnum;
+ MgCoordinateSystemEnum* coordsysEnum;
+ MgCoordinateSystemEnum* xformEnum;
+ MgCoordinateSystemEnum* pathEnum;
+
+ MgStringCollection* stringCollection;
+
+ startTime = clock ();
+ catalog = factory.GetCatalog ();
+ categoryDict = catalog->GetCategoryDictionary ();
+ ellipsoidDict = catalog->GetEllipsoidDictionary ();
+ datumDict = catalog->GetDatumDictionary ();
+ coordsysDict = catalog->GetCoordinateSystemDictionary ();
+ xformDict = catalog->GetGeodeticTransformDefDictionary ();
+ pathDict = catalog->GetGeodeticPathDictionary ();
+
+ categoryEnum = categoryDict->GetEnum ();
+ ellipsoidEnum = ellipsoidDict->GetEnum ();
+ datumEnum = datumDict->GetEnum ();
+ coordsysEnum = coordsysDict->GetEnum ();
+ xformEnum = xformDict->GetEnum ();
+ pathEnum = pathDict->GetEnum ();
+
+ do
+ {
+ stringCollection = coordsysEnum->NextName (1);
+ if (stringCollection->GetCount () > 0)
+ {
+ STRING code = stringCollection->GetItem (0);
+ Ptr<MgCoordinateSystem> coordSysPtr = factory.CreateFromCode (code);
+ }
+ } while (stringCollection->GetCount () > 0);
+
+ Ptr<MgCoordinateSystemGeodeticTransformDef> xformDef;
+ xformDef = xformDict->GetGeodeticTransformationDef (L"NAD83_to_HPGN");
+ Ptr<MgCoordinateSystemGeodeticInterpolationTransformDefParams>interpParms;
+ interpParms = static_cast<MgCoordinateSystemGeodeticInterpolationTransformDefParams*>(xformDef->GetParameters ());
+ Ptr<MgDisposableCollection>gridFiles = interpParms->GetGridFiles ();
+ Ptr<MgCoordinateSystemGeodeticTransformGridFile>gridFile;
+ for (INT32 idx = 0;idx < gridFiles->GetCount ();idx += 1)
+ {
+ gridFile = static_cast<MgCoordinateSystemGeodeticTransformGridFile*>(gridFiles->GetItem (idx));
+ }
+
+ endTime = clock ();
+ printf ("Dictionary enumeration time = %ld milliseconds.\n",endTime - startTime);
+#endif
+
+#ifdef __SKIP__
+ // testing a special WKT string for proer operation.
+ clock_t startTime;
+ clock_t endTime;
+
+ MgCoordinateSystemFactory factory;
+
+ wchar_t wktTest [2048] = L"PROJCS[\"UTM83-10F\",GEOGCS[\"LL83\",DATUM[\"NAD83\",SPHEROID[\"GRS1980\",6378137.000,298.25722210]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"false_easting\",1640416.667],PARAMETER[\"false_northing\",0.000],PARAMETER[\"central_meridian\",-123.00000000000000],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"latitude_of_origin\",0.000],UNIT[\"Foot_US\",0.30480060960122]]";
+ //wchar_t wktTest [2048] = L"PROJCS[\"WGS84.PseudoMercator\",GEOGCS[\"LL84\",DATUM[\"WGS84\",SPHEROID[\"WGS84\",6378137.000,298.25722293]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Popular Visualisation Pseudo Mercator\"],PARAMETER[\"false_easting\",0.000],PARAMETER[\"false_northing\",0.000],PARAMETER[\"central_meridian\",0.00000000000000],UNIT[\"Meter\",1.00000000000000]]";
+ startTime = clock ();
+ INT32 epsgCode = factory.ConvertWktToEpsgCode (wktTest);
+ endTime = clock ();
+ printf ("ConvertWktToEpsgCode time = %ld milliseconds.\n",endTime - startTime);
+#endif
+
+#ifdef __SKIP__
+ // Test/Debug bed for the MGRS Grid functionality.
+
INT32 index1;
INT32 index2;
INT32 index3;
@@ -50,6 +133,21 @@
pGridSpecification->SetUnits (MgCoordinateSystemUnitCode::Degree,MgCoordinateSystemUnitType::Angular);
pGridSpecification->SetCurvePrecision (1.0E-05);
+ {
+ MgCoordinateSystem* pTestSource = factory.CreateFromCode(L"CA83-IIF");
+ MgCoordinateSystem* pTestTarget = factory.CreateFromCode(L"LL84");
+ MgCoordinateSystemTransform* pTestTransform = factory.GetTransform(pTestSource,pTestTarget);
+ MgCoordinate* southWestXYZ = new MgCoordinateXYZ (6.49E+06,1.99E+06,300.0);
+ MgCoordinate* northEastXYZ = new MgCoordinateXYZ (6.61E+06,2.11E+06,100.0);
+ MgEnvelope* pTestEnvelopeSource = new MgEnvelope (northEastXYZ,southWestXYZ);
+ MgEnvelope* pTestEnvelopeTarget = pTestEnvelopeSource->Transform (pTestTransform);
+ pTestTransform->Release ();
+ pTestSource->Release ();
+ pTestTarget->Release ();
+ pTestEnvelopeSource->Release ();
+ pTestEnvelopeTarget->Release ();
+ }
+
pGenericGrid = factory.GenericGrid (L"LL84",L"CA83-IIF",true);
MgCoordinate* southWestXY = new MgCoordinateXY (6.49E+06,1.99E+06);
@@ -184,6 +282,7 @@
pMgrs->Release ();
pGridSpecification->Release ();
+#endif
return 0;
}
Modified: sandbox/rfc90/MgDev/Common/Geometry/GeometryConsoleTest/GeometryConsoleTest.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/GeometryConsoleTest/GeometryConsoleTest.vcproj 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/GeometryConsoleTest/GeometryConsoleTest.vcproj 2010-11-13 18:14:35 UTC (rev 5390)
@@ -18,8 +18,8 @@
<Configurations>
<Configuration
Name="Debug|Win32"
- OutputDirectory="$(GISPLATFORMROOTDIR)\OS\Common\bin\$(ConfigurationName)"
- IntermediateDirectory="$(ProjectDir)$(COnfigurationName)"
+ OutputDirectory="..\..\..\Common\bin\$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
DeleteExtensionsOnClean="*.obj;*.pch;*.sbr;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
@@ -42,12 +42,11 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories=""$(GISPLATFORMROOTDIR)\OS\Common\Geometry";"$(GISPLATFORMROOTDIR)\OS\Common\Foundation";"$(GISPLATFORMROOTDIR)\OS\CommonGeometry\CoordinateSystem";"$(GISPLATFORMROOTDIR)\OS\Oem\ACE\ACE_wrappers""
+ AdditionalIncludeDirectories=""..\..\..\Common\Geometry";"..\..\..\Common\Foundation";"..\..\..\CommonGeometry\CoordinateSystem";"..\..\..\Oem\ACE\ACE_wrappers""
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="false"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
- UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
@@ -64,7 +63,7 @@
Name="VCLinkerTool"
AdditionalDependencies="MgGeometryd.lib MgFoundationd.lib CsMapd.lib ACEd.lib"
LinkIncremental="1"
- AdditionalLibraryDirectories=""$(ProjectDir)$(ConfigurationName)";"$(GISPLATFORMROOTDIR)\OS\Common\lib\$(ConfigurationName)";"$(GISPLATFORMROOTDIR)\OS\Oem\CsMap\lib80\$(ConfigurationName)";"$(GISPLATFORMROOTDIR)\OS\Oem\ACE\ACE_wrappers\lib""
+ AdditionalLibraryDirectories=""$(ProjectDir)$(ConfigurationName)";"..\..\..\Common\lib\$(ConfigurationName)";"..\..\..\Oem\CsMap\lib80\$(ConfigurationName)";"..\..\..\Oem\ACE\ACE_wrappers\lib""
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
@@ -93,8 +92,8 @@
</Configuration>
<Configuration
Name="Release|Win32"
- OutputDirectory="$(GISPLATFORMROOTDIR)\OS\Common\bin\$(ConfigurationName)"
- IntermediateDirectory="$(ProjectDir)$(COnfigurationName)"
+ OutputDirectory="..\..\..\Common\bin\$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
@@ -118,11 +117,10 @@
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
- AdditionalIncludeDirectories=""$(GISPLATFORMROOTDIR)\OS\Common\Geometry";"$(GISPLATFORMROOTDIR)\OS\Common\Foundation";"$(GISPLATFORMROOTDIR)\OS\CommonGeometry\CoordinateSystem";"$(GISPLATFORMROOTDIR)\OS\Oem\ACE\ACE_wrappers""
+ AdditionalIncludeDirectories=""..\..\..\Common\Geometry";"..\..\..\Common\Foundation";"..\..\..\CommonGeometry\CoordinateSystem";"..\..\..\Oem\ACE\ACE_wrappers""
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
@@ -139,7 +137,7 @@
Name="VCLinkerTool"
AdditionalDependencies="MgGeometry.lib MgFoundation.lib CsMap.lib ACE.lib"
LinkIncremental="1"
- AdditionalLibraryDirectories=""$(ProjectDir)$(ConfigurationName)";"$(GISPLATFORMROOTDIR)\OS\Common\lib\$(ConfigurationName)";"$(GISPLATFORMROOTDIR)\OS\Oem\CsMap\lib80\$(ConfigurationName)";"$(GISPLATFORMROOTDIR)\OS\Oem\ACE\ACE_wrappers\lib""
+ AdditionalLibraryDirectories=""$(ProjectDir)$(ConfigurationName)";"..\..\..\Common\lib\$(ConfigurationName)";"..\..\..\Oem\CsMap\lib80\$(ConfigurationName)";"..\..\..\Oem\ACE\ACE_wrappers\lib""
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
Modified: sandbox/rfc90/MgDev/Common/Geometry/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/Makefile.am 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/Makefile.am 2010-11-13 18:14:35 UTC (rev 5390)
@@ -7,6 +7,7 @@
libMgGeometry_la_SOURCES = \
GeometryBuild.cpp \
../CoordinateSystem/ArbitraryCoordsys.cpp \
+ ../CoordinateSystem/CoordSysDictionaryBase.cpp \
../CoordinateSystem/CoordSys.cpp \
../CoordinateSystem/CoordSysCatalog.cpp \
../CoordinateSystem/CoordSysCategory.cpp \
@@ -22,7 +23,17 @@
../CoordinateSystem/CoordSysEnumDatum.cpp \
../CoordinateSystem/CoordSysEnumEllipsoid.cpp \
../CoordinateSystem/CoordSysFormatConverter.cpp \
- ../CoordinateSystem/CoordSysGeodeticTransformation.cpp \
+ ../CoordinateSystem/CoordSysGeodeticAnalyticalTransformDefParams.cpp\
+ ../CoordinateSystem/CoordSysGeodeticInterpolationTransformDefParams.cpp\
+ ../CoordinateSystem/CoordSysGeodeticMultipleRegressionTransformDefParams.cpp\
+ ../CoordinateSystem/CoordSysGeodeticPath.cpp\
+ ../CoordinateSystem/CoordSysGeodeticPathDictionary.cpp\
+ ../CoordinateSystem/CoordSysGeodeticPathElement.cpp\
+ ../CoordinateSystem/CoordSysGeodeticTransformation.cpp\
+ ../CoordinateSystem/CoordSysGeodeticTransformDef.cpp\
+ ../CoordinateSystem/CoordSysGeodeticTransformDefDictionary.cpp\
+ ../CoordinateSystem/CoordSysGeodeticTransformDefParams.cpp\
+ ../CoordinateSystem/CoordSysGeodeticTransformGridFile.cpp\
../CoordinateSystem/CoordSysMeasure.cpp \
../CoordinateSystem/CoordSysTransform.cpp \
../CoordinateSystem/CoordSysDictionaryUtility.cpp \
@@ -39,7 +50,10 @@
../CoordinateSystem/CoordSysMgrsZone.cpp \
../CoordinateSystem/CoordSysMgrs.cpp \
../CoordinateSystem/CoordSysMgrsMajorRegion.cpp \
- ../CoordinateSystem/CoordSysOneGrid.cpp
+ ../CoordinateSystem/CoordSysOneGrid.cpp \
+ ../CoordinateSystem/namestruct.cpp \
+ ../CoordinateSystem/CriticalSection.cpp \
+ ../CoordinateSystem/SmartCriticalClass.cpp
include_SOURCES = \
AgfReaderWriter.cpp \
@@ -158,7 +172,17 @@
../CoordinateSystem/CoordSysEnumDatum.cpp \
../CoordinateSystem/CoordSysEnumEllipsoid.cpp \
../CoordinateSystem/CoordSysFormatConverter.cpp \
- ../CoordinateSystem/CoordSysGeodeticTransformation.cpp \
+ ../CoordinateSystem/CoordSysGeodeticAnalyticalTransformDefParams.cpp\
+ ../CoordinateSystem/CoordSysGeodeticInterpolationTransformDefParams.cpp\
+ ../CoordinateSystem/CoordSysGeodeticMultipleRegressionTransformDefParams.cpp\
+ ../CoordinateSystem/CoordSysGeodeticPath.cpp\
+ ../CoordinateSystem/CoordSysGeodeticPathDictionary.cpp\
+ ../CoordinateSystem/CoordSysGeodeticPathElement.cpp\
+ ../CoordinateSystem/CoordSysGeodeticTransformation.cpp\
+ ../CoordinateSystem/CoordSysGeodeticTransformDef.cpp\
+ ../CoordinateSystem/CoordSysGeodeticTransformDefDictionary.cpp\
+ ../CoordinateSystem/CoordSysGeodeticTransformDefParams.cpp\
+ ../CoordinateSystem/CoordSysGeodeticTransformGridFile.cpp\
../CoordinateSystem/CoordSysMeasure.cpp \
../CoordinateSystem/CoordSysTransform.cpp \
../CoordinateSystem/CoordSysDictionaryUtility.cpp \
@@ -175,7 +199,9 @@
../CoordinateSystem/CoordSysMgrsZone.cpp \
../CoordinateSystem/CoordSysMgrs.cpp \
../CoordinateSystem/CoordSysMgrsMajorRegion.cpp \
- ../CoordinateSystem/CoordSysOneGrid.cpp
+ ../CoordinateSystem/CoordSysOneGrid.cpp \
+ ../CoordinateSystem/CriticalSection.cpp \
+ ../CoordinateSystem/SmartCriticalClass.cpp
noinst_HEADERS = $(include_SOURCES) \
AgfReaderWriter.h \
@@ -354,6 +380,7 @@
Spatial/SpatialUtilityVectorAngle.h \
../CoordinateSystem/ArbitraryCoordsys.h \
../CoordinateSystem/CoordSys.h \
+ ../CoordinateSystem/CoordSysDictionaryBase.h \
../CoordinateSystem/CoordSysCatalog.h \
../CoordinateSystem/CoordSysCategory.h \
../CoordinateSystem/CoordSysCategoryDictionary.h \
@@ -369,15 +396,27 @@
../CoordinateSystem/CoordSysEnumDatum.h \
../CoordinateSystem/CoordSysEnumEllipsoid.h \
../CoordinateSystem/CoordSysFormatConverter.h \
- ../CoordinateSystem/CoordSysGeodeticTransformation.h \
+ ../CoordinateSystem/CoordSysGeodeticAnalyticalTransformDefParams.h\
+ ../CoordinateSystem/CoordSysGeodeticInterpolationTransformDefParams.h\
+ ../CoordinateSystem/CoordSysGeodeticMultipleRegressionTransformDefParams.h\
+ ../CoordinateSystem/CoordSysGeodeticPath.h\
+ ../CoordinateSystem/CoordSysGeodeticPathDictionary.h\
+ ../CoordinateSystem/CoordSysGeodeticPathElement.h\
+ ../CoordinateSystem/CoordSysGeodeticTransformation.h\
+ ../CoordinateSystem/CoordSysGeodeticTransformDef.h\
+ ../CoordinateSystem/CoordSysGeodeticTransformDefDictionary.h\
+ ../CoordinateSystem/CoordSysGeodeticTransformDefParams.h\
+ ../CoordinateSystem/CoordSysGeodeticTransformGridFile.h\
../CoordinateSystem/CoordSysMeasure.h \
../CoordinateSystem/CoordSysTransform.h \
../CoordinateSystem/CoordSysType.h \
../CoordinateSystem/CoordSysUtil.h \
../CoordinateSystem/CriticalSection.h \
+ ../CoordinateSystem/SmartCriticalClass.h \
../CoordinateSystem/CoordSysDictionaryUtility.h \
../CoordinateSystem/CoordSysEnumInteger32.h \
../CoordinateSystem/CoordSysMathComparator.h \
+ ../CoordinateSystem/CoordSysMacro.h\
../CoordinateSystem/CoordSysProjectionInformation.h \
../CoordinateSystem/CoordSysUnitInformation.h \
../CoordinateSystem/CsmapVersion.h \
@@ -400,7 +439,7 @@
-I../Geometry \
-I../../Oem/ACE/ACE_wrappers \
-I../../Oem/geos-2.2.0/source/headers \
- -I../../Oem/dbxml-2.3.10/xerces-c-src/src \
+ -I../../Oem/dbxml/xerces-c-src/src \
-I../../Oem/CsMap/Include \
-I../../Common/CoordinateSystem
@@ -415,3 +454,4 @@
-L../Foundation \
-L../../Oem/CsMap \
-L../../Common/CoordinateSystem
+
Modified: sandbox/rfc90/MgDev/Common/Geometry/Parse/StringUtility.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/Parse/StringUtility.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/Parse/StringUtility.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -25,8 +25,7 @@
void GisStringUtility::ClearString(wchar_t*& psz)
{
- if (psz != NULL)
- delete [] psz;
+ delete [] psz;
psz = NULL;
}
Modified: sandbox/rfc90/MgDev/Common/Geometry/Spatial/MathUtility.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/Spatial/MathUtility.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/Spatial/MathUtility.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -260,7 +260,7 @@
bool MgMathUtility::DblCmp (double first,double second,double tolerance)
{
bool equal;
-
+
equal = (fabs (first - second) < tolerance);
return equal;
}
Modified: sandbox/rfc90/MgDev/Common/Geometry/Spatial/SpatialUtility.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/Spatial/SpatialUtility.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/Spatial/SpatialUtility.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -575,7 +575,7 @@
// Until we know different.
status = 0;
-
+
// Compute the denominator which also tells us if the lines are collinear.
delX1 = seg1To->GetX () - seg1From->GetX ();
delY1 = seg1To->GetY () - seg1From->GetY ();
@@ -1073,7 +1073,7 @@
// It will tell us if we are on the polygon or not.
lastIntersection = dynamic_cast<MgCoordinateXYM*>(intersectionCollection->GetItem (count-1));
INT32 status = static_cast<INT32>(lastIntersection->GetM ());
-
+
// If the point is on the polygon, the status of the last intersection will
// have the IntersectIsSeg2End bit set.
if ((status & MgSpatialUtilityStatus::IntersectIsSeg2End) != 0)
@@ -1130,7 +1130,7 @@
static const INT32 StringPointOutside = 1;
static const INT32 StringPointOnBoundary = 2;
static const INT32 StringPointInside = 3;
-//
+//
// Values which are stored in the Z member of the internally used point
// collection; i.e. the status of each segment relative to the clip
// ploygon. The value stored refers to the segment which starts at
@@ -1150,7 +1150,7 @@
Ptr<MgCoordinateCollection> pointCollection;
Ptr<MgCoordinateIterator> pointIterator;
Ptr<MgLineStringCollection> lineCollection;
-
+
// Phase One: Expand the line string with all implied transition points,
// i.e. intersection with the polygon.
pointCollection = StringClipPhaseOne (lineItr,polyItr);
@@ -1270,7 +1270,7 @@
while (itrPolygon->MoveNext ())
{
// We need a place for SegementIntersection to place the
- // calculated intersection. We can't add the transition
+ // calculated intersection. We can't add the transition
// points directly to the xyzmCollection object as in the
// case of more than one transition point for a segment,
// there is no guarantee that this algorithm will find them
@@ -1294,11 +1294,11 @@
// Determine the end points of the polygon segment.
plyFromPoint = plyToPoint;
plyToPoint = itrPolygon->GetCurrent ();
-
+
// Determine the relationship of the current line string segment
// with the current polygon segment.
status = SegmentIntersection (intersection,plyFromPoint,plyToPoint,segFromPoint,segToPoint,magnitude);
-
+
// Disect the large amount of information embedded in the
// status return.
segmentStatus = status & MgSpatialUtilityStatus::SegmentStatusMask;
@@ -1355,7 +1355,7 @@
// We need to do something with collinear lines, sometimes. The rather
// verbose comments were necessary for the author to keep track of what
// can/might/could happen and what to do about each possible situation.
-
+
// The sixteen cases are:
// 0000 -> DO NOTHING!! There is no overlap, the segments are disjoint.
// 0001 -> DO NOTHING!! Not possible.
@@ -1367,7 +1367,7 @@
// 0111 -> Insert segment 1 end point, overlap ends at segment 1 end point.
// 1000 -> DO NOTHING!! Not possible.
// 1001 -> Insert segment 1 start point, overlap beginns in the middle of segment 2.
- // 1010 -> DO NOTHING!! Segment 2 is the overlap segment.
+ // 1010 -> DO NOTHING!! Segment 2 is the overlap segment.
// 1011 -> DO NOTHING!! Segment 2 is the overlap segment.
// 1100 -> DO NOTHING!! End to end continuous, but no overlap.
// 1101 -> Insert segment 1 start point, overlap begins in the middle of segment 2.
@@ -1424,7 +1424,7 @@
rStringPointNotDetermined,
rStringSegNotDetermined);
xyzmCollection->Add (xyzmPoint);
-
+
// The xyzmTemporary collection should go out of scope and be deleted
// here.
}
@@ -1443,19 +1443,19 @@
MgCoordinateIterator* itrPolygon)
{
INT32 pointStatus;
-
+
double rPointStatus;
Ptr<MgCoordinate> outPoint;
Ptr<MgCoordinate> xyzmPoint;
-
+
MgGeometryFactory mgFactory;
-
+
Ptr<MgCoordinateXY> xyPoint = new MgCoordinateXY ();
-
+
// Compute an outpoint.
- outPoint = MgSpatialUtility::PointOutsidePolygon (itrPolygon);
-
+ outPoint = MgSpatialUtility::PointOutsidePolygon (itrPolygon);
+
lineString->Reset ();
while (lineString->MoveNext ())
{
@@ -1512,7 +1512,7 @@
Ptr<MgCoordinate> nextPoint;
xyPoint = new MgCoordinateXY ();
-
+
lineString->Reset ();
lineString->MoveNext ();
nextPoint = lineString->GetCurrent ();
@@ -1520,7 +1520,7 @@
{
currentPoint = nextPoint;
nextPoint = lineString->GetCurrent ();
-
+
currentStatus = static_cast<INT32>(currentPoint->GetM());
nextStatus = static_cast<INT32>(nextPoint->GetM());
@@ -1575,7 +1575,7 @@
}
}
rSegStatus = static_cast<double>(segStatus) + 0.01;
- currentPoint->SetZ (rSegStatus);
+ currentPoint->SetZ (rSegStatus);
}
}
@@ -1603,7 +1603,7 @@
Ptr<MgCoordinate> nextPoint;
Ptr<MgCoordinateCollection> curCollection;
Ptr<MgLineStringCollection> lineCollection;
-
+
MgGeometryFactory mgFactory;
curCollection = new MgCoordinateCollection ();
Modified: sandbox/rfc90/MgDev/Common/Geometry/Spatial/SpatialUtility.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Geometry/Spatial/SpatialUtility.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Geometry/Spatial/SpatialUtility.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -355,7 +355,7 @@
static const INT32 StringPointIsOutside = 1;
static const INT32 StringPointIsOnBoundary = 2;
static const INT32 StringPointIsInside = 3;
-
+
// Values which are stored in the Z member of the internally used point
// collection; i.e. the status of each segment relative to the clip
// ploygon. The value stored refers to the segment which starts at
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/Makefile.am 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/Makefile.am 2010-11-13 18:14:35 UTC (rev 5390)
@@ -262,7 +262,7 @@
-I../Geometry \
-I../../Oem/ACE/ACE_wrappers \
-I../../Oem/geos-2.2.0/source/headers \
- -I../../Oem/dbxml-2.3.10/xerces-c-src/src
+ -I../../Oem/dbxml/xerces-c-src/src
libMgMapGuideCommon_la_LIBADD = \
-lACE \
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/MapGuideCommon.rc
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/MapGuideCommon.rc 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/MapGuideCommon.rc 2010-11-13 18:14:35 UTC (rev 5390)
@@ -6,7 +6,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
+#include "winresrc.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
1 TEXTINCLUDE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#include ""winresrc.h""\r\n"
"\0"
END
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/MapGuideCommon.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/MapGuideCommon.vcproj 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/MapGuideCommon.vcproj 2010-11-13 18:14:35 UTC (rev 5390)
@@ -44,7 +44,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\Foundation;..\PlatformBase;..\Geometry;..\Security;..\MdfModel;..\MdfParser;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\dbxml-2.3.10\xerces-c-src\src"
+ AdditionalIncludeDirectories="..\Foundation;..\PlatformBase;..\Geometry;..\Security;..\MdfModel;..\MdfParser;..\..\Oem\ACE\ACE_wrappers;"..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MAPGUIDECOMMON_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -121,7 +121,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\Foundation;..\PlatformBase;..\Geometry;..\Security;..\MdfModel;..\MdfParser;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\dbxml-2.3.10\xerces-c-src\src"
+ AdditionalIncludeDirectories="..\Foundation;..\PlatformBase;..\Geometry;..\Security;..\MdfModel;..\MdfParser;..\..\Oem\ACE\ACE_wrappers;"..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MAPGUIDECOMMON_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -198,7 +198,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- AdditionalIncludeDirectories="..\Foundation;..\PlatformBase;..\Geometry;..\Security;..\MdfModel;..\MdfParser;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\dbxml-2.3.10\xerces-c-src\src"
+ AdditionalIncludeDirectories="..\Foundation;..\PlatformBase;..\Geometry;..\Security;..\MdfModel;..\MdfParser;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\dbxml\xerces-c-src\src"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MAPGUIDECOMMON_EXPORTS"
RuntimeLibrary="2"
WarningLevel="3"
@@ -275,7 +275,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- AdditionalIncludeDirectories="..\Foundation;..\PlatformBase;..\Geometry;..\Security;..\MdfModel;..\MdfParser;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\dbxml-2.3.10\xerces-c-src\src"
+ AdditionalIncludeDirectories="..\Foundation;..\PlatformBase;..\Geometry;..\Security;..\MdfModel;..\MdfParser;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\dbxml\xerces-c-src\src"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MAPGUIDECOMMON_EXPORTS"
RuntimeLibrary="2"
WarningLevel="3"
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -20,6 +20,12 @@
#include "SAX2Parser.h"
#include <map>
+/// rfc90 instead of a dependency on Common/Stylization/Bounds.h
+#define rs_max(a,b) (((a) > (b)) ? (a) : (b))
+#define rs_min(a,b) (((a) < (b)) ? (a) : (b))
+/// rfc90 instead of a dependency on Common/Stylization/StylizationDefs.h
+#define _METERS_PER_INCH 0.0254
+
using namespace std;
MG_IMPL_DYNCREATE(MgMap)
@@ -35,7 +41,8 @@
: MgMapBase(),
m_inSave(false),
m_unpackedLayersGroups(false),
- m_colorPalette(NULL) // lazy instantiation
+ m_colorPalette(NULL), // lazy instantiation
+ m_watermarkUsage(Viewer)
{
}
@@ -47,7 +54,8 @@
: MgMapBase(),
m_inSave(false),
m_unpackedLayersGroups(false),
- m_colorPalette(NULL) // lazy instantiation
+ m_colorPalette(NULL), // lazy instantiation
+ m_watermarkUsage(Viewer)
{
if (NULL == siteConnection)
{
@@ -396,8 +404,8 @@
}
// Now that we've added all the layers (dynamic and base map) to the m_layers collection,
- // bulk load the identity properties for all layers
- Ptr<MgSiteConnection> siteConn;
+ // bulk load the identity properties for all layers
+ Ptr<MgSiteConnection> siteConn;
if (m_siteConnection.p != NULL)
{
siteConn = SAFE_ADDREF((MgSiteConnection*)m_siteConnection);
@@ -891,6 +899,9 @@
}
}
+ //watermark usage
+ stream->WriteInt32(m_watermarkUsage);
+
// Serialize Layers and Groups as a blob.
if (m_inSave)
{
@@ -1009,6 +1020,9 @@
m_changeLists->SetCheckForDuplicates(true);
+ //watermark usage
+ streamReader->GetInt32(m_watermarkUsage);
+
//blob for layers and groups
INT32 nBytes = 0;
streamReader->GetInt32(nBytes);
@@ -1151,3 +1165,37 @@
}
}
}
+
+INT32 MgMap::GetWatermarkUsage()
+{
+ return m_watermarkUsage;
+}
+
+void MgMap::SetWatermarkUsage(INT32 watermarkUsage)
+{
+ m_watermarkUsage = watermarkUsage;
+}
+
+/////////////////////////////////////////////////////////////////////
+void MgMap::GetTileCoords(int metaTileFactor, int tileColumn, int tileRow,
+ double &tileMinX, double &tileMaxX , double &tileMinY ,double & tileMaxY)
+{
+ Ptr<MgEnvelope> mapExtent = this->GetMapExtent();
+ Ptr<MgCoordinate> pt00 = mapExtent->GetLowerLeftCoordinate();
+ Ptr<MgCoordinate> pt11 = mapExtent->GetUpperRightCoordinate();
+ double mapMinX = rs_min(pt00->GetX(), pt11->GetX());
+ double mapMaxX = rs_max(pt00->GetX(), pt11->GetX());
+ double mapMinY = rs_min(pt00->GetY(), pt11->GetY());
+ double mapMaxY = rs_max(pt00->GetY(), pt11->GetY());
+
+ double scale = this->GetViewScale();
+ double metersPerUnit = this->GetMetersPerUnit();
+ double metersPerPixel = _METERS_PER_INCH / MgTileParameters::tileDPI;
+ double tileWidthMCS = (double)MgTileParameters::tileWidth * metersPerPixel * scale / metersPerUnit;
+ double tileHeightMCS = (double)MgTileParameters::tileHeight * metersPerPixel * scale / metersPerUnit;
+
+ tileMinX = mapMinX + (double)(tileColumn ) * tileWidthMCS; // left edge
+ tileMaxX = mapMinX + (double)(tileColumn+ metaTileFactor) * tileWidthMCS; // right edge
+ tileMinY = mapMaxY - (double)(tileRow + metaTileFactor) * tileHeightMCS; // bottom edge
+ tileMaxY = mapMaxY - (double)(tileRow ) * tileHeightMCS; // top edge
+}
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/MapLayer/Map.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/MapLayer/Map.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/MapLayer/Map.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -224,6 +224,20 @@
PUBLISHED_API:
+ /////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Watermark usage environment.
+ /// \n
+ /// \c WMS - Usage WMS watermark.
+ /// \n
+ /// \c Viewer - Use Viewer watermark.
+ ///
+ enum WatermarkUsageType
+ {
+ WMS = 1,
+ Viewer = 2
+ };
+
//////////////////////////////////////////////////////////////////
/// \brief
/// Constructs an empty un-initialized MgMap object.
@@ -518,6 +532,15 @@
///
void Save();
+ /////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Get the watermark usage
+ ///
+ /// \return
+ /// The integer value
+ ///
+ INT32 GetWatermarkUsage();
+
INTERNAL_API:
/// \brief
@@ -582,6 +605,24 @@
///
void BulkLoadIdentityProperties(MgFeatureService* featureService);
+ /// \brief
+ /// Sets the watermark usage
+ ///
+ /// \param dpi
+ /// Watermark usage
+ ///
+ virtual void SetWatermarkUsage(INT32 watermarkUsage);
+
+ /// \brief
+ /// compute the coordinates of a tile, increase size by meta tiling Factor sm_useMetaTiles
+ ///
+ /// \param in metaTileFactor, tileColumn, tileRow
+ /// \param out tileMinX,tileMinY. tileMaxX , tileMaxY
+ /// min,max corners of the tile
+ ///
+ virtual void GetTileCoords(int metaTileFactor, int tileColumn, int tileRow,
+ double &tileMinX, double &tileMaxX , double &tileMinY ,double & tileMaxY);
+
protected:
//////////////////////////////////////////////////////////////////
@@ -635,6 +676,8 @@
bool m_inSave;
bool m_unpackedLayersGroups;
ColorStringList* m_colorPalette;
+
+ INT32 m_watermarkUsage;
};
/// \}
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/Resources/mapguide_en.res
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/Resources/mapguide_en.res 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/Resources/mapguide_en.res 2010-11-13 18:14:35 UTC (rev 5390)
@@ -268,7 +268,7 @@
MgInvalidPropertyType = The property type is invalid because it is not recognized.
MgInvalidPropertyTypeForCommand = The property type is invalid for the command because it was of a different type then expected.
MgInvalidResourceCannotBeRoot = The resource is invalid because it cannot be the root.
-MgInvalidScaleIndex = Scale index %1 is out of range.
+MgInvalidScaleIndex = Scale index is out of range.
MgInvalidSecond = The second is invalid because it must be between 0 and 59.
MgInvalidServiceType = The service type is invalid because it is not recognized.
MgInvalidSessionsId = The session ID is invalid because the session separator character was not found.
@@ -309,7 +309,6 @@
MgStringEmpty = The string cannot be empty.
MgStringTooLong = The string is too long.
MgTagFieldNotFound = The tag contained no fields.
-MgTooLargeMetaTilingFactor = The metatile factor must be smaller than the given MAX.
MgUnableToLockTileFile = Unable to lock the tile file.
MgUnableToOpenLockFile = Unable to open the tile lock file.
MgUnableToOpenTileFile = Unable to open the tile file.
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/FeatureInformation.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/FeatureInformation.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/FeatureInformation.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -178,7 +178,10 @@
/////////////////////////////////////////
/// Dispose the object
///
- virtual void Dispose() { delete this; }
+ virtual void Dispose()
+ {
+ delete this;
+ }
private:
Ptr<MgSelection> m_selection;
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ImageFormats.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ImageFormats.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ImageFormats.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -30,3 +30,4 @@
const STRING MgImageFormats::Png8 = L"PNG8";
const STRING MgImageFormats::Tiff = L"TIF";
const STRING MgImageFormats::Raw = L"RAW";
+const STRING MgImageFormats::Meta = L"META";
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ImageFormats.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ImageFormats.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ImageFormats.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -47,6 +47,9 @@
/// Raw format
static const STRING Raw; /// \if INTERNAL value("RAW") \endif
+
+ /// Meta format for rfc90 meta tiling
+ static const STRING Meta; /// \if INTERNAL value("META") \endif
};
#endif
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -277,16 +277,25 @@
/// Subject to change with FDO R2
MgByteReader* MgProxyFeatureService::GetCapabilities(CREFSTRING providerName)
{
+ STRING connectionString = L"";
+ return GetCapabilities(providerName, connectionString);
+}
+
+
+//////////////////////////////////////////////////////////////////
+MgByteReader* MgProxyFeatureService::GetCapabilities(CREFSTRING providerName, CREFSTRING connectionString)
+{
Ptr<MgUserInformation> userInfo = m_connProp->GetUserInfo();
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knObject, // Return type expected
MgFeatureServiceOpId::GetCapabilities_Id, // Command Code
- 1, // No of arguments
+ 2, // No of arguments
Feature_Service, // Service Id
userInfo->GetApiVersion(), // Operation version
MgCommand::knString, &providerName, // Argument#1
+ MgCommand::knString, &connectionString, // Argument#2
MgCommand::knNone); // End of argument
SetWarning(cmd.GetWarningObject());
@@ -294,6 +303,7 @@
return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
+
//////////////////////////////////////////////////////////////////
/// <summary>
/// Creates or updates a feature schema within the specified feature source.
@@ -310,7 +320,6 @@
void MgProxyFeatureService::ApplySchema(MgResourceIdentifier* resource, MgFeatureSchema* schema)
{
MgCommand cmd;
-
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knVoid, // Return type expected
MgFeatureServiceOpId::ApplySchema_Id, // Command Code
@@ -324,6 +333,7 @@
SetWarning(cmd.GetWarningObject());
}
+
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Gets the definitions of one or more schemas contained in the
@@ -331,10 +341,10 @@
/// a class name does not exist, this method will throw an exception.
///
MgFeatureSchemaCollection* MgProxyFeatureService::DescribeSchema(MgResourceIdentifier* resource,
- CREFSTRING schemaName, MgStringCollection* classNames)
+ CREFSTRING schemaName,
+ MgStringCollection* classNames)
{
MgCommand cmd;
-
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knObject, // Return type expected
MgFeatureServiceOpId::DescribeSchema_Id, // Command Code
@@ -351,15 +361,17 @@
return (MgFeatureSchemaCollection*)cmd.GetReturnValue().val.m_obj;
}
+
///////////////////////////////////////////////////////////////////////////////
/// This method has been deprecated. Use the above method.
///
MgFeatureSchemaCollection* MgProxyFeatureService::DescribeSchema(MgResourceIdentifier* resource,
- CREFSTRING schemaName)
+ CREFSTRING schemaName)
{
return DescribeSchema(resource, schemaName, NULL);
}
+
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Gets the definitions in XML format of one or more schemas contained in the
@@ -367,10 +379,10 @@
/// a class name does not exist, this method will throw an exception.
///
STRING MgProxyFeatureService::DescribeSchemaAsXml(MgResourceIdentifier* resource,
- CREFSTRING schemaName, MgStringCollection* classNames)
+ CREFSTRING schemaName,
+ MgStringCollection* classNames)
{
MgCommand cmd;
-
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knString, // Return type expected
MgFeatureServiceOpId::DescribeSchemaAsXml_Id,// Command Code
@@ -390,15 +402,17 @@
return retVal;
}
+
///////////////////////////////////////////////////////////////////////////////
/// This method has been deprecated. Use the above method.
///
STRING MgProxyFeatureService::DescribeSchemaAsXml(MgResourceIdentifier* resource,
- CREFSTRING schemaName)
+ CREFSTRING schemaName)
{
return DescribeSchemaAsXml(resource, schemaName, NULL);
}
+
//////////////////////////////////////////////////////////////////
/// <summary>
/// This method returns the Fdo schema information in XML format
@@ -501,9 +515,9 @@
/// filter text.
/// 2. Interrogation of class definition would allow to determine properties of classes
/// which can be used for filter text.
-MgFeatureReader* MgProxyFeatureService::SelectFeatures(MgResourceIdentifier* resource,
- CREFSTRING className,
- MgFeatureQueryOptions* options)
+MgFeatureReader* MgProxyFeatureService::SelectFeatures(MgResourceIdentifier* resource,
+ CREFSTRING className,
+ MgFeatureQueryOptions* options)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
@@ -565,10 +579,10 @@
/// filter text.
/// 2. Interrogation of class definition would allow to determine properties of classes
/// which can be used for filter text.
-MgFeatureReader* MgProxyFeatureService::SelectFeatures(MgResourceIdentifier* resource,
- CREFSTRING className,
- MgFeatureQueryOptions* options,
- CREFSTRING coordinateSystem)
+MgFeatureReader* MgProxyFeatureService::SelectFeatures(MgResourceIdentifier* resource,
+ CREFSTRING className,
+ MgFeatureQueryOptions* options,
+ CREFSTRING coordinateSystem)
{
throw new MgNotImplementedException(
L"MgProxyFeatureService::SelectFeatures",
@@ -602,7 +616,7 @@
/// </param>
/// <returns>
/// MgDataReader pointer which operates on the instance of actual reader returned from the
-/// FdoProvider ( OR NULL ).
+/// FdoProvider (OR NULL).
/// </returns>
/// EXCEPTIONS:
/// MgFeatureSourceException
@@ -705,6 +719,7 @@
return SAFE_ADDREF((MgPropertyCollection*)propCol);
}
+
//////////////////////////////////////////////////////////////////
/// <summary>
/// It executes all the commands specified in command collection
@@ -775,6 +790,7 @@
return SAFE_ADDREF((MgPropertyCollection*)propCol);
}
+
////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets the locked features
@@ -799,9 +815,9 @@
/// EXCEPTIONS:
/// MgFeatureServiceException
/// MgInvalidArgumentException
-MgFeatureReader* MgProxyFeatureService::GetLockedFeatures( MgResourceIdentifier* resource,
- CREFSTRING className,
- MgFeatureQueryOptions* options )
+MgFeatureReader* MgProxyFeatureService::GetLockedFeatures(MgResourceIdentifier* resource,
+ CREFSTRING className,
+ MgFeatureQueryOptions* options)
{
throw new MgNotImplementedException(
L"MgProxyFeatureService::GetLockedFeatures",
@@ -810,6 +826,7 @@
return NULL; // to make some compiler happy
}
+
////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Starts a transaction on the specified feature source
@@ -830,7 +847,7 @@
/// MgInvalidArgumentException
/// MgInvalidOperationException
/// MgFdoException
-MgTransaction* MgProxyFeatureService::BeginTransaction( MgResourceIdentifier* resource )
+MgTransaction* MgProxyFeatureService::BeginTransaction(MgResourceIdentifier* resource)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
@@ -851,6 +868,7 @@
return SAFE_ADDREF((MgProxyFeatureTransaction*)featTransaction);
}
+
//////////////////////////////////////////////////////////////////
/// <summary>
/// This method executes the SELECT SQL statement specified and returns a pointer to
@@ -903,6 +921,7 @@
return SAFE_ADDREF((MgProxySqlDataReader*)sqlReader);
}
+
//////////////////////////////////////////////////////////////////
/// <summary>
/// This method executes the SELECT SQL statement specified within a given transaction
@@ -941,7 +960,7 @@
MgSqlDataReader* MgProxyFeatureService::ExecuteSqlQuery(MgResourceIdentifier* resource,
CREFSTRING sqlStatement,
MgParameterCollection* params,
- MgTransaction* transaction )
+ MgTransaction* transaction)
{
STRING transactionId = L"";
MgProxyFeatureTransaction* proxyTransaction = dynamic_cast<MgProxyFeatureTransaction*>(transaction);
@@ -972,6 +991,7 @@
return SAFE_ADDREF((MgProxySqlDataReader*)sqlReader);
}
+
//////////////////////////////////////////////////////////////////
/// <summary>
/// This method executes the SELECT SQL statement specified within a given transaction
@@ -1060,6 +1080,7 @@
return SAFE_ADDREF((MgProxySqlDataReader*)sqlReader);
}
+
//////////////////////////////////////////////////////////////////
/// <summary>
/// This method executes all SQL statements supported by providers except SELECT.
@@ -1098,6 +1119,7 @@
return cmd.GetReturnValue().val.m_i32;
}
+
//////////////////////////////////////////////////////////////////
/// <summary>
/// This method executes all SQL statements supported by providers except SELECT
@@ -1256,7 +1278,8 @@
/// MgInvalidResourceIdentifer
/// NOTE:
/// Subject to change in FDO R2
-MgLongTransactionReader* MgProxyFeatureService::GetLongTransactions(MgResourceIdentifier* resource, bool bActiveOnly)
+MgLongTransactionReader* MgProxyFeatureService::GetLongTransactions(MgResourceIdentifier* resource,
+ bool bActiveOnly)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
@@ -1297,8 +1320,8 @@
/// MgNullArgumentException
/// MgInvalidResourceTypeException
/// MgSessionNotFoundException
-bool MgProxyFeatureService::SetLongTransaction( MgResourceIdentifier* featureSourceId,
- CREFSTRING longTransactionName)
+bool MgProxyFeatureService::SetLongTransaction(MgResourceIdentifier* featureSourceId,
+ CREFSTRING longTransactionName)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
@@ -1340,6 +1363,30 @@
//////////////////////////////////////////////////////////////////
+// Retrieves WFS schema information for the specified feature classes with specified format
+MgByteReader* MgProxyFeatureService::DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId,
+ MgStringCollection* featureClasses,
+ CREFSTRING outputFormat)
+{
+ MgCommand cmd;
+ cmd.ExecuteCommand(m_connProp, // Connection
+ MgCommand::knObject, // Return type expected
+ MgFeatureServiceOpId::DescribeWfsFeatureType_Id, // Command Code
+ 3, // No of arguments
+ Feature_Service, // Service Id
+ BUILD_VERSION(2,3,0), // Operation version
+ MgCommand::knObject, featureSourceId, // Argument#1
+ MgCommand::knObject, featureClasses, // Argument#2
+ MgCommand::knString, &outputFormat, // Argument#3
+ MgCommand::knNone); // End of argument
+
+ SetWarning(cmd.GetWarningObject());
+
+ return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
+}
+
+
+//////////////////////////////////////////////////////////////////
// Retrieves feature information in WFS format, based on the specified criteria
MgByteReader* MgProxyFeatureService::GetWfsFeature(MgResourceIdentifier* featureSourceId,
CREFSTRING featureClass,
@@ -1370,6 +1417,46 @@
//////////////////////////////////////////////////////////////////
+// Retrieves feature information in with specified WFS format, based on the specified criteria
+MgByteReader* MgProxyFeatureService::GetWfsFeature(MgResourceIdentifier* featureSourceId,
+ CREFSTRING featureClass,
+ MgStringCollection* requiredProperties,
+ CREFSTRING srs,
+ CREFSTRING filter,
+ INT32 maxFeatures,
+ CREFSTRING wfsVersion,
+ CREFSTRING outputFormat,
+ CREFSTRING sortCriteria,
+ CREFSTRING namespacePrefix,
+ CREFSTRING namespaceUrl)
+{
+ MgCommand cmd;
+ cmd.ExecuteCommand(m_connProp, // Connection
+ MgCommand::knObject, // Return type expected
+ MgFeatureServiceOpId::GetWfsFeature_Id, // Command Code
+ 11, // No of arguments
+ Feature_Service, // Service Id
+ BUILD_VERSION(2,3,0), // Operation version
+ MgCommand::knObject, featureSourceId, // Argument#1
+ MgCommand::knString, &featureClass, // Argument#2
+ MgCommand::knObject, requiredProperties, // Argument#3
+ MgCommand::knString, &srs, // Argument#4
+ MgCommand::knString, &filter, // Argument#5
+ MgCommand::knInt32, maxFeatures, // Argument#6
+ MgCommand::knString, &wfsVersion, // Argument#7
+ MgCommand::knString, &outputFormat, // Argument#8
+ MgCommand::knString, &sortCriteria, // Argument#9
+ MgCommand::knString, &namespacePrefix, // Argument#10
+ MgCommand::knString, &namespaceUrl, // Argument#11
+ MgCommand::knNone); // End of argument
+
+ SetWarning(cmd.GetWarningObject());
+
+ return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
+}
+
+
+//////////////////////////////////////////////////////////////////
MgBatchPropertyCollection* MgProxyFeatureService::GetFeatures(CREFSTRING featureReader)
{
MgCommand cmd;
@@ -1589,8 +1676,8 @@
// Returns the collection of identity properties for the specified class.
// If schemaName is empty, then className needs to be fully qualified.
MgClassDefinitionCollection* MgProxyFeatureService::GetIdentityProperties(MgResourceIdentifier* resource,
- CREFSTRING schemaName,
- MgStringCollection* classNames)
+ CREFSTRING schemaName,
+ MgStringCollection* classNames)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
@@ -1628,6 +1715,7 @@
return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
+
MgByteReader* MgProxyFeatureService::GetSchemaMapping(CREFSTRING providerName,
CREFSTRING partialConnString)
{
@@ -1647,6 +1735,7 @@
return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
+
//////////////////////////////////////////////////////////////////
/// \brief
/// Sets the connection properties for the Proxy Service. This
@@ -1660,6 +1749,7 @@
m_connProp = SAFE_ADDREF(connProp);
}
+
//////////////////////////////////////////////////////////////////
/// <summary>
/// Get the FDO cache information.
@@ -1686,6 +1776,7 @@
return retVal;
}
+
//////////////////////////////////////////////////////////////////
MgClassDefinition* MgProxyFeatureService::GetClassDefinition(MgResourceIdentifier* resource,
CREFSTRING schemaName,
@@ -1710,6 +1801,8 @@
return (MgClassDefinition*)cmd.GetReturnValue().val.m_obj;
}
+
+//////////////////////////////////////////////////////////////////
bool MgProxyFeatureService::CommitTransaction(CREFSTRING transactionId)
{
MgCommand cmd;
@@ -1727,6 +1820,8 @@
return (bool)cmd.GetReturnValue().val.m_i8;
}
+
+//////////////////////////////////////////////////////////////////
bool MgProxyFeatureService::RollbackTransaction(CREFSTRING transactionId)
{
MgCommand cmd;
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -147,9 +147,9 @@
/// \return
/// String Collection or NULL if nothing is found
///
- MgStringCollection* GetConnectionPropertyValues( CREFSTRING providerName,
- CREFSTRING propertyName,
- CREFSTRING partialConnString );
+ MgStringCollection* GetConnectionPropertyValues(CREFSTRING providerName,
+ CREFSTRING propertyName,
+ CREFSTRING partialConnString);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -207,6 +207,39 @@
/////////////////////////////////////////////////////////////////
/// \brief
+ /// This method returns capabilities of the provider applicable for the
+ /// specified connection string.
+ ///
+ /// \remarks
+ /// This would provide details on the following
+ /// capabilities:
+ /// <ol>
+ /// <li>Connection</li>
+ /// <li>Schema</li>
+ /// <li>Command</li>
+ /// <li>Filter</li>
+ /// <li>Expression</li>
+ /// </ol>
+ /// \n
+ /// Schema Definition: FeatureProviderCapabilities.xsd
+ /// Sample XML: FeatureProviderCapabilities.xml
+ ///
+ /// \param providerName
+ /// Input
+ /// Name of provider for which capabilities are requested
+ /// \param connectionString
+ /// Input
+ /// The connection string to use
+ ///
+ /// \return
+ /// Byte array representing XML (or NULL)
+ ///
+ /// \exception MgInvalidProviderNameException
+ ///
+ MgByteReader* GetCapabilities(CREFSTRING providerName, CREFSTRING connectionString);
+
+ /////////////////////////////////////////////////////////////////
+ /// \brief
/// This method returns list of ALL schemas names available with
/// with the provider
///
@@ -219,7 +252,7 @@
///
/// \exception MgInvalidResourceIdentifier
///
- MgStringCollection* GetSchemas( MgResourceIdentifier* resource );
+ MgStringCollection* GetSchemas(MgResourceIdentifier* resource);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -238,7 +271,7 @@
///
/// \exception MgInvalidResourceIdentifier
///
- MgStringCollection* GetClasses( MgResourceIdentifier* resource, CREFSTRING schemaName );
+ MgStringCollection* GetClasses(MgResourceIdentifier* resource, CREFSTRING schemaName);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -259,9 +292,9 @@
///
/// \exception MgInvalidResourceIdentifier
///
- MgClassDefinition* GetClassDefinition( MgResourceIdentifier* resource,
- CREFSTRING schemaName,
- CREFSTRING className);
+ MgClassDefinition* GetClassDefinition(MgResourceIdentifier* resource,
+ CREFSTRING schemaName,
+ CREFSTRING className);
/////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -337,13 +370,14 @@
/// schema and classes.
///
MgFeatureSchemaCollection* DescribeSchema(MgResourceIdentifier* resource,
- CREFSTRING schemaName, MgStringCollection* classNames);
+ CREFSTRING schemaName,
+ MgStringCollection* classNames);
///////////////////////////////////////////////////////////////////////////
/// This method has been deprecated. Use the above method.
///
MgFeatureSchemaCollection* DescribeSchema(MgResourceIdentifier* resource,
- CREFSTRING schemaName);
+ CREFSTRING schemaName);
///////////////////////////////////////////////////////////////////////////
/// \brief
@@ -394,13 +428,14 @@
/// \exception MgFdoException
///
STRING DescribeSchemaAsXml(MgResourceIdentifier* resource,
- CREFSTRING schemaName, MgStringCollection* classNames);
+ CREFSTRING schemaName,
+ MgStringCollection* classNames);
///////////////////////////////////////////////////////////////////////////
/// This method has been deprecated. Use the above method.
///
STRING DescribeSchemaAsXml(MgResourceIdentifier* resource,
- CREFSTRING schemaName);
+ CREFSTRING schemaName);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -470,9 +505,9 @@
/// 2. Interrogation of class definition would allow to determine properties of classes
/// which can be used for filter text.
///
- MgFeatureReader* SelectFeatures( MgResourceIdentifier* resource,
- CREFSTRING className,
- MgFeatureQueryOptions* options );
+ MgFeatureReader* SelectFeatures(MgResourceIdentifier* resource,
+ CREFSTRING className,
+ MgFeatureQueryOptions* options);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -517,10 +552,10 @@
/// \exception MgInvalidArgumentException
/// \exception MgFdoException
///
- virtual MgFeatureReader* SelectFeatures( MgResourceIdentifier* resource,
- CREFSTRING className,
- MgFeatureQueryOptions* options,
- CREFSTRING coordinateSystem );
+ virtual MgFeatureReader* SelectFeatures(MgResourceIdentifier* resource,
+ CREFSTRING className,
+ MgFeatureQueryOptions* options,
+ CREFSTRING coordinateSystem);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -547,7 +582,7 @@
///
/// \return
/// MgDataReader pointer which operates on the instance of actual reader returned from the
- /// FdoProvider ( OR NULL ).
+ /// FdoProvider (OR NULL).
///
/// \exception MgFeatureServiceException
/// \exception MgInvalidArgumentException
@@ -565,9 +600,9 @@
/// 4. Interrogation of class definition would allow to determine properties of classes
/// which can be used for filter text.
///
- MgDataReader* SelectAggregate( MgResourceIdentifier* resource,
- CREFSTRING className,
- MgFeatureAggregateOptions* options );
+ MgDataReader* SelectAggregate(MgResourceIdentifier* resource,
+ CREFSTRING className,
+ MgFeatureAggregateOptions* options);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -591,9 +626,9 @@
///
/// \exception MgInvalidResourceIdentifier
///
- MgPropertyCollection* UpdateFeatures( MgResourceIdentifier* resource,
- MgFeatureCommandCollection* commands,
- bool useTransaction );
+ MgPropertyCollection* UpdateFeatures(MgResourceIdentifier* resource,
+ MgFeatureCommandCollection* commands,
+ bool useTransaction);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -620,9 +655,9 @@
/// Index of commandCollection and index of IntCollection would match the result.
///
/// \exception MgInvalidResourceIdentifier
- MgPropertyCollection* UpdateFeatures( MgResourceIdentifier* resource,
- MgFeatureCommandCollection* commands,
- MgTransaction* transaction );
+ MgPropertyCollection* UpdateFeatures(MgResourceIdentifier* resource,
+ MgFeatureCommandCollection* commands,
+ MgTransaction* transaction);
////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -659,9 +694,9 @@
/// \exception MgInvalidArgumentException
/// \exception ...
///
- virtual MgFeatureReader* GetLockedFeatures( MgResourceIdentifier* resource,
- CREFSTRING className,
- MgFeatureQueryOptions* options );
+ virtual MgFeatureReader* GetLockedFeatures(MgResourceIdentifier* resource,
+ CREFSTRING className,
+ MgFeatureQueryOptions* options);
////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
@@ -683,7 +718,7 @@
/// MgInvalidArgumentException
/// MgInvalidOperationException
/// MgFdoException
- MgTransaction* BeginTransaction( MgResourceIdentifier* resource );
+ MgTransaction* BeginTransaction(MgResourceIdentifier* resource);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -713,8 +748,8 @@
/// \exception MgInvalidSqlStatement
/// \exception MgSqlNotSupported
///
- MgSqlDataReader* ExecuteSqlQuery( MgResourceIdentifier* resource,
- CREFSTRING sqlStatement );
+ MgSqlDataReader* ExecuteSqlQuery(MgResourceIdentifier* resource,
+ CREFSTRING sqlStatement);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -750,10 +785,10 @@
/// \exception MgInvalidSqlStatement
/// \exception MgSqlNotSupported
///
- MgSqlDataReader* ExecuteSqlQuery( MgResourceIdentifier* resource,
- CREFSTRING sqlStatement,
- MgParameterCollection* params,
- MgTransaction* transaction );
+ MgSqlDataReader* ExecuteSqlQuery(MgResourceIdentifier* resource,
+ CREFSTRING sqlStatement,
+ MgParameterCollection* params,
+ MgTransaction* transaction);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -793,11 +828,11 @@
/// \exception MgInvalidSqlStatement
/// \exception MgSqlNotSupported
///
- MgSqlDataReader* ExecuteSqlQuery( MgResourceIdentifier* resource,
- CREFSTRING sqlStatement,
- MgParameterCollection* params,
- MgTransaction* transaction,
- INT32 fetchSize);
+ MgSqlDataReader* ExecuteSqlQuery(MgResourceIdentifier* resource,
+ CREFSTRING sqlStatement,
+ MgParameterCollection* params,
+ MgTransaction* transaction,
+ INT32 fetchSize);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -820,8 +855,8 @@
///
/// \exception MgInvalidResourceIdentifier
///
- INT32 ExecuteSqlNonQuery( MgResourceIdentifier* resource,
- CREFSTRING sqlNonSelectStatement );
+ INT32 ExecuteSqlNonQuery(MgResourceIdentifier* resource,
+ CREFSTRING sqlNonSelectStatement);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -850,10 +885,10 @@
///
/// \exception MgInvalidResourceIdentifier
///
- INT32 ExecuteSqlNonQuery( MgResourceIdentifier* resource,
- CREFSTRING sqlNonSelectStatement,
- MgParameterCollection* params,
- MgTransaction* transaction );
+ INT32 ExecuteSqlNonQuery(MgResourceIdentifier* resource,
+ CREFSTRING sqlNonSelectStatement,
+ MgParameterCollection* params,
+ MgTransaction* transaction);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -893,8 +928,8 @@
/// \note
/// Subject to change in FDO R2
///
- MgSpatialContextReader* GetSpatialContexts( MgResourceIdentifier* resource,
- bool bActiveOnly);
+ MgSpatialContextReader* GetSpatialContexts(MgResourceIdentifier* resource,
+ bool bActiveOnly);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -932,8 +967,8 @@
/// \note
/// Subject to change in FDO R2
///
- MgLongTransactionReader* GetLongTransactions( MgResourceIdentifier* resource,
- bool bActiveOnly);
+ MgLongTransactionReader* GetLongTransactions(MgResourceIdentifier* resource,
+ bool bActiveOnly);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -956,8 +991,8 @@
/// \exception MgInvalidResourceTypeException
/// \exception MgSessionNotFoundException
///
- bool SetLongTransaction( MgResourceIdentifier* featureSourceId,
- CREFSTRING longTransactionName);
+ bool SetLongTransaction(MgResourceIdentifier* featureSourceId,
+ CREFSTRING longTransactionName);
/////////////////////////////////////////////////////////////////
/// \brief
@@ -972,13 +1007,13 @@
///
/// <!-- Syntax in .Net, Java, and PHP -->
/// \htmlinclude DotNetSyntaxTop.html
- /// virtual MgByteReader CreateFeatureSource(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses);
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses);
/// \htmlinclude SyntaxBottom.html
/// \htmlinclude JavaSyntaxTop.html
- /// virtual MgByteReader CreateFeatureSource(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses);
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses);
/// \htmlinclude SyntaxBottom.html
/// \htmlinclude PHPSyntaxTop.html
- /// virtual MgByteReader CreateFeatureSource(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses);
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses);
/// \htmlinclude SyntaxBottom.html
///
/// \param featureSourceId (MgResourceIdentifier)
@@ -993,10 +1028,47 @@
/// \return
/// Returns an MgByteReader containing the XML schema.
///
- MgByteReader* DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId, MgStringCollection* featureClasses);
+ MgByteReader* DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId,
+ MgStringCollection* featureClasses);
////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
+ /// Retrieves schema informationabout a set of feature classes for a given feature source with specified format.
+ ///
+ /// <!-- Syntax in .Net, Java, and PHP -->
+ /// \htmlinclude DotNetSyntaxTop.html
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string outputFormat);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude JavaSyntaxTop.html
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string outputFormat);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude PHPSyntaxTop.html
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasse, string outputFormats);
+ /// \htmlinclude SyntaxBottom.html
+ ///
+ /// \param featureSourceId (MgResourceIdentifier)
+ /// The resource identifier defining the
+ /// location of the feature source in
+ /// the repository.
+ /// \param featureClasses (MgStringCollection)
+ /// A collection of strings identifying the feature classes for which to
+ /// retrieve schema information. If this collection is null or empty, information
+ /// is returned for all feature classes.
+ /// \param outputFormat (String/string)
+ /// A string identifying the output format of
+ /// the retrieved schema information.
+ /// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 8.2
+ /// http://portal.opengeospatial.org/files/?artifact_id=8339
+ ///
+ /// \return
+ /// Returns an MgByteReader containing the XML schema.
+ ///
+ virtual MgByteReader* DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId,
+ MgStringCollection* featureClasses,
+ CREFSTRING outputFormat);
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////
+ /// \brief
/// Retrieves feature information based on the supplied criteria.
///
/// <!-- Syntax in .Net, Java, and PHP -->
@@ -1030,9 +1102,76 @@
/// \return
/// Returns an MgByteReader containing the requested feature information.
///
- MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId, CREFSTRING featureClass,
- MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures);
+ MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId,
+ CREFSTRING featureClass,
+ MgStringCollection* requiredProperties,
+ CREFSTRING srs,
+ CREFSTRING filter,
+ INT32 maxFeatures);
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Retrieves feature information based on the supplied criteria with specified format.
+ ///
+ /// <!-- Syntax in .Net, Java, and PHP -->
+ /// \htmlinclude DotNetSyntaxTop.html
+ /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat, string sortCriteria, string namespacePrefix, string namespaceUrl);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude JavaSyntaxTop.html
+ /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat, string sortCriteria, string namespacePrefix, string namespaceUrl);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude PHPSyntaxTop.html
+ /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat, string sortCriteria, string namespacePrefix, string namespaceUrl);
+ /// \htmlinclude SyntaxBottom.html
+ ///
+ /// \param featureSourceId (MgResourceIdentifier)
+ /// The resource identifier defining the
+ /// location of the feature source in
+ /// the repository.
+ /// \param featureClass (String/string)
+ /// The feature class containing the features to retrieve.
+ /// \param requiredProperties (MgStringCollection)
+ /// The collection of properties to retrieve for each feature. If the
+ /// collection is null or empty, all properties will be retrieved.
+ /// \param srs (String/string)
+ /// The spatial reference system in which to return feature geometries
+ /// \param filter (String/string)
+ /// An XML string containing the definition for an OGC filter
+ /// \param maxFeatures (int)
+ /// The maximum number of features to retrieve. If the value is less
+ /// than or equal to zero, all features will be retrieved.
+ /// \param wfsVersion (String/string)
+ /// A string identifying the wfs version
+ /// \param outputFormat (String/string)
+ /// A string identifying the output format of
+ /// the retrieved feature information.
+ /// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 9.2
+ /// http://portal.opengeospatial.org/files/?artifact_id=8339
+ /// \param sortCriteria (String/string)
+ /// A string identifying the sort criteria
+ /// \param namespacePrefix (String/string)
+ /// A string identifying the namespace prefix in the output xml
+ /// \param namespaceUrl (String/string)
+ /// A string idenyifying the namespace url in the output xml
+ ///
+ /// \return
+ /// Returns an MgByteReader containing the requested feature information.
+ ///
+ ///
+ /// \exception MgInvalidArgumentException
+ ///
+ MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId,
+ CREFSTRING featureClass,
+ MgStringCollection* requiredProperties,
+ CREFSTRING srs,
+ CREFSTRING filter,
+ INT32 maxFeatures,
+ CREFSTRING wfsVersion,
+ CREFSTRING outputFormat,
+ CREFSTRING sortCriteria,
+ CREFSTRING namespacePrefix,
+ CREFSTRING namespaceUrl);
+
////////////////////////////////////////////////////////////////////////////////
/// \brief
/// This method enumerates all the providers and if they are FDO enabled for
@@ -1135,10 +1274,10 @@
///
/// \exception MgInvalidResourceIdentifier
///
- MgClassDefinition* GetClassDefinition( MgResourceIdentifier* resource,
- CREFSTRING schemaName,
- CREFSTRING className,
- bool serialize);
+ MgClassDefinition* GetClassDefinition(MgResourceIdentifier* resource,
+ CREFSTRING schemaName,
+ CREFSTRING className,
+ bool serialize);
// Commit the transaction specified by the transaction id.
bool CommitTransaction(CREFSTRING transactionId);
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -55,14 +55,12 @@
{
assert( 0 == this->GetRefCount() );
- if (NULL != m_lastUsed)
- delete m_lastUsed;
-
- if (NULL != m_serverConnImp)
- delete m_serverConnImp;
-
+ delete m_lastUsed;
m_lastUsed = NULL;
+
+ delete m_serverConnImp;
m_serverConnImp = NULL;
+
m_stack = NULL;
}
@@ -195,7 +193,7 @@
/// </returns>
void MgServerConnection::Dispose()
{
- delete this;
+ delete this;
}
/////////////////////////////////////////////////////////////////
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ServerConnectionPool.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ServerConnectionPool.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ServerConnectionPool.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -19,7 +19,7 @@
#include "ServerConnectionPool.h"
#include "ServerConnectionStack.h"
#include "ServerConnectionEventHandler.h"
-
+
MgServerConnectionPool* MgServerConnectionPool::sm_pool = NULL;
/// <summary>
@@ -57,11 +57,9 @@
ConnectionPool::iterator iter = pool.begin();
while (iter != pool.end())
{
- if (NULL != iter->second)
- {
- delete iter->second;
- iter->second = NULL;
- }
+ delete iter->second;
+ iter->second = NULL;
+
iter++;
}
@@ -91,10 +89,10 @@
// To avoid overheads and maintain thread safety,
// do not assign this returned static singleton to a Ptr object.
- return MgServerConnectionPool::sm_pool;
+ return MgServerConnectionPool::sm_pool;
}
-void MgServerConnectionPool::CloseStaleConnections(ACE_Time_Value* timeValue)
+void MgServerConnectionPool::CloseStaleConnections(ACE_Time_Value* timeValue)
{
ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, *ACE_Static_Object_Lock::instance ()));
MG_TRY()
@@ -116,10 +114,9 @@
{
ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, *ACE_Static_Object_Lock::instance ()));
MG_TRY()
- if (MgServerConnectionPool::sm_pool != NULL)
- {
- delete MgServerConnectionPool::sm_pool;
- MgServerConnectionPool::sm_pool = NULL;
- }
- MG_CATCH_AND_RELEASE()
+
+ delete MgServerConnectionPool::sm_pool;
+ MgServerConnectionPool::sm_pool = NULL;
+
+ MG_CATCH_AND_RELEASE()
}
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ServerConnectionStack.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ServerConnectionStack.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/ServerConnectionStack.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -43,7 +43,7 @@
MgConfigProperties::DefaultSiteConnectionPropertyPort);
// Note: The comment below only applies if using the ACE WFMO reactor on Windows.
- // The ACE config.h file has been updated to use the ACE SELECT reactor on
+ // The ACE config.h file has been updated to use the ACE SELECT reactor on
// Windows which is the default reactor used on Linux.
// ie: #define ACE_USE_SELECT_REACTOR_FOR_REACTOR_IMPL
//
@@ -202,7 +202,7 @@
m_inUse->push_back(connection);
}
-void MgServerConnectionStack::CloseStaleConnections(ACE_Time_Value* timeValue)
+void MgServerConnectionStack::CloseStaleConnections(ACE_Time_Value* timeValue)
{
ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex));
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/TileService.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/TileService.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/Services/TileService.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -154,7 +154,7 @@
INT32 tileColumn,
INT32 tileRow) = 0;
- //////////////////////////////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////
/// \brief
/// Construct an MgTileService object.
///
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -110,6 +110,8 @@
#define MG_CONFIG_MIN_FS_CP_EXCLUDED_LENGTH 0
#define MG_CONFIG_MAX_FS_CP_EXCLUDED_LENGTH 1024
+#define MG_CONFIG_MAX_METATILE_DIM 8
+
// Default configuration filenames
const STRING MgConfigProperties::DefaultConfigurationFilename = L"webconfig.ini";
const STRING MgConfigProperties::ServerConfigurationFilename = L"serverconfig.ini";
@@ -134,6 +136,8 @@
const STRING MgConfigProperties::DefaultGeneralPropertyFdoPath = L"";
const STRING MgConfigProperties::GeneralPropertyLicenseServerPath = L"LicenseServerPath";
const STRING MgConfigProperties::DefaultGeneralPropertyLicenseServerPath = L"";
+const STRING MgConfigProperties::GeneralPropertyLinuxMemDebug = L"LinuxMemDebug";
+const bool MgConfigProperties::DefaultGeneralPropertyLinuxMemDebug = false;
const STRING MgConfigProperties::GeneralPropertyLogsDelimiter = L"LogsDelimiter";
const STRING MgConfigProperties::DefaultGeneralPropertyLogsDelimiter = L"\t";
const STRING MgConfigProperties::GeneralPropertyLogsDetail = L"LogsDetail";
@@ -301,6 +305,10 @@
const bool MgConfigProperties::DefaultRenderingServicePropertyClampPoints = false;
const STRING MgConfigProperties::RenderingServicePropertyGeneralizeData = L"GeneralizeData";
const bool MgConfigProperties::DefaultRenderingServicePropertyGeneralizeData = false;
+const STRING MgConfigProperties::RenderingServicePropertyMaxRasterImageWidth = L"MaxRasterImageWidth";
+const INT32 MgConfigProperties::DefaultRenderingServicePropertyMaxRasterImageWidth = 2048;
+const STRING MgConfigProperties::RenderingServicePropertyMaxRasterImageHeight = L"MaxRasterImageHeight";
+const INT32 MgConfigProperties::DefaultRenderingServicePropertyMaxRasterImageHeight = 2048;
// ******************************************************************
// Font Alias Mappings section
@@ -341,9 +349,9 @@
const STRING MgConfigProperties::ResourceServicePropertyResourceValidationEnabled = L"ResourceValidationEnabled"; // for internal use only
const bool MgConfigProperties::DefaultResourceServicePropertyResourceValidationEnabled = true;
const STRING MgConfigProperties::ResourceServicePropertyRetryAttempts = L"RetryAttempts"; // for internal use only
-const INT32 MgConfigProperties::DefaultResourceServicePropertyRetryAttempts = 10;
+const INT32 MgConfigProperties::DefaultResourceServicePropertyRetryAttempts = 50;
const STRING MgConfigProperties::ResourceServicePropertyRetryInterval = L"RetryInterval"; // for internal use only
-const INT32 MgConfigProperties::DefaultResourceServicePropertyRetryInterval = 10;
+const INT32 MgConfigProperties::DefaultResourceServicePropertyRetryInterval = 25;
// ******************************************************************
// Site Service Properties
@@ -485,6 +493,14 @@
const STRING MgConfigProperties::AgentDisableAuthoring = L"DisableAuthoring";
const STRING MgConfigProperties::AgentDisableWfs = L"DisableWfs";
const STRING MgConfigProperties::AgentDisableWms = L"DisableWms";
+const STRING MgConfigProperties::AgentErrorLogEnabled = L"ErrorLogEnabled";
+const bool MgConfigProperties::DefaultAgentErrorLogEnabled = false;
+const STRING MgConfigProperties::AgentErrorLogFilename = L"ErrorLogFilename";
+const STRING MgConfigProperties::DefaultAgentErrorLogFilename = L"Error.log";
+const STRING MgConfigProperties::AgentRequestLogEnabled = L"RequestLogEnabled";
+const bool MgConfigProperties::DefaultAgentRequestLogEnabled = false;
+const STRING MgConfigProperties::AgentRequestLogFilename = L"RequestLogFilename";
+const STRING MgConfigProperties::DefaultAgentRequestLogFilename = L"Request.log";
// ******************************************************************
// OGC Properties
@@ -492,6 +508,10 @@
const STRING MgConfigProperties::OgcPropertiesSection = L"OgcProperties";
const STRING MgConfigProperties::WfsPassword = L"WfsPassword";
const STRING MgConfigProperties::WmsPassword = L"WmsPassword";
+const STRING MgConfigProperties::CITEWfsEnabled = L"CITEWfsEnabled";
+const bool MgConfigProperties::DefaultCITEWfsEnabled = false;
+const STRING MgConfigProperties::CITEWmsEnabled = L"CITEWmsEnabled";
+const bool MgConfigProperties::DefaultCITEWmsEnabled = false;
// ******************************************************************
// Web Application Properties
@@ -513,6 +533,7 @@
{ MgConfigProperties::GeneralPropertyDisplayName , MgPropertyType::String , MG_CONFIG_MIN_OPTIONAL_STRING_LENGTH , MG_CONFIG_MAX_OPTIONAL_STRING_LENGTH , MG_CONFIG_FILE_NAME_RESERVED_CHARACTERS },
{ MgConfigProperties::GeneralPropertyFdoPath , MgPropertyType::String , MG_CONFIG_MIN_PATH_LENGTH , MG_CONFIG_MAX_PATH_LENGTH , MG_CONFIG_PATH_RESERVED_CHARACTERS },
{ MgConfigProperties::GeneralPropertyLicenseServerPath , MgPropertyType::String , MG_CONFIG_MIN_OPTIONAL_STRING_LENGTH , MG_CONFIG_MAX_OPTIONAL_STRING_LENGTH , L"" },
+ { MgConfigProperties::GeneralPropertyLinuxMemDebug , MgPropertyType::Boolean , 0 , 1 , L"" },
{ MgConfigProperties::GeneralPropertyLogsDelimiter , MgPropertyType::String , 1 , 128 , L"" },
{ MgConfigProperties::GeneralPropertyLogsDetail , MgPropertyType::String , MG_CONFIG_MIN_OPTIONAL_STRING_LENGTH , MG_CONFIG_MAX_OPTIONAL_STRING_LENGTH , L"" },
{ MgConfigProperties::GeneralPropertyLogsPath , MgPropertyType::String , MG_CONFIG_MIN_PATH_LENGTH , MG_CONFIG_MAX_PATH_LENGTH , MG_CONFIG_PATH_RESERVED_CHARACTERS },
@@ -616,7 +637,9 @@
{ MgConfigProperties::RenderingServicePropertyRasterGridSizeForPlot , MgPropertyType::Int32 , 1 , MG_CONFIG_MAX_INT32 , L"" },
{ MgConfigProperties::RenderingServicePropertyMinRasterGridSizeForPlot , MgPropertyType::Int32 , 1 , MG_CONFIG_MAX_INT32 , L"" },
{ MgConfigProperties::RenderingServicePropertyRasterGridSizeOverrideRatioForPlot, MgPropertyType::Double , 0.0 , 1.0 , L"" },
- { MgConfigProperties::RenderingServicePropertyRenderSelectionBatchSize , MgPropertyType::Int32 , MG_CONFIG_MIN_RENDER_SELECTION_SIZE , MG_CONFIG_MAX_RENDER_SELECTION_SIZE , L"" },
+ { MgConfigProperties::RenderingServicePropertyRenderSelectionBatchSize , MgPropertyType::Int32 , MG_CONFIG_MIN_RENDER_SELECTION_SIZE , MG_CONFIG_MAX_RENDER_SELECTION_SIZE , L"" },
+ { MgConfigProperties::RenderingServicePropertyMaxRasterImageWidth , MgPropertyType::Int32 , 1 , MG_CONFIG_MAX_INT32 , L"" },
+ { MgConfigProperties::RenderingServicePropertyMaxRasterImageHeight , MgPropertyType::Int32 , 1 , MG_CONFIG_MAX_INT32 , L"" },
{ L"" , 0 , 0.0 , 0.0 , L"" }
};
@@ -658,6 +681,8 @@
{ MgConfigProperties::TileServicePropertyTileSizeX , MgPropertyType::Int32 , 50 , 10000 , L"" },
{ MgConfigProperties::TileServicePropertyTileSizeY , MgPropertyType::Int32 , 50 , 10000 , L"" },
{ MgConfigProperties::TileServicePropertyImageFormat , MgPropertyType::String , 2 , 4 , L"" },
+ { MgConfigProperties::TileServicePropertyUseMetaTiles , MgPropertyType::Int32 , 0 , MG_CONFIG_MAX_METATILE_DIM , L"" },
+ { MgConfigProperties::TileServicePropertyLockMethod , MgPropertyType::Int32 , 1 , 3 , L"" },
{ L"" , 0 , 0.0 , 0.0 , L"" }
};
@@ -727,6 +752,10 @@
{ MgConfigProperties::AgentDisableAuthoring , MgPropertyType::Boolean , 0 , 1 , L"" },
{ MgConfigProperties::AgentDisableWfs , MgPropertyType::Boolean , 0 , 1 , L"" },
{ MgConfigProperties::AgentDisableWms , MgPropertyType::Boolean , 0 , 1 , L"" },
+ { MgConfigProperties::AgentErrorLogEnabled , MgPropertyType::Boolean , 0 , 1 , L"" },
+ { MgConfigProperties::AgentErrorLogFilename , MgPropertyType::String , MG_CONFIG_MIN_FILE_NAME_LENGTH , MG_CONFIG_MAX_FILE_NAME_LENGTH , MG_CONFIG_FILE_NAME_RESERVED_CHARACTERS },
+ { MgConfigProperties::AgentRequestLogEnabled , MgPropertyType::Boolean , 0 , 1 , L"" },
+ { MgConfigProperties::AgentRequestLogFilename , MgPropertyType::String , MG_CONFIG_MIN_FILE_NAME_LENGTH , MG_CONFIG_MAX_FILE_NAME_LENGTH , MG_CONFIG_FILE_NAME_RESERVED_CHARACTERS },
{ L"" , 0 , 0.0 , 0.0 , L"" }
};
@@ -734,5 +763,7 @@
{
{ MgConfigProperties::WfsPassword , MgPropertyType::String , MG_CONFIG_MIN_PASSWORD_LENGTH , MG_CONFIG_MAX_PASSWORD_LENGTH , MG_CONFIG_PASSWORD_RESERVED_CHARACTERS },
{ MgConfigProperties::WmsPassword , MgPropertyType::String , MG_CONFIG_MIN_PASSWORD_LENGTH , MG_CONFIG_MAX_PASSWORD_LENGTH , MG_CONFIG_PASSWORD_RESERVED_CHARACTERS },
+ { MgConfigProperties::CITEWfsEnabled , MgPropertyType::Boolean , 0 , 1 , L"" },
+ { MgConfigProperties::CITEWmsEnabled , MgPropertyType::Boolean , 0 , 1 , L"" },
{ L"" , 0 , 0.0 , 0.0 , L"" }
};
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/System/ConfigProperties.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/System/ConfigProperties.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/System/ConfigProperties.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -74,6 +74,10 @@
static const STRING GeneralPropertyLicenseServerPath; /// value("LicenseServerPath")
static const STRING DefaultGeneralPropertyLicenseServerPath; /// value("");
+ /// Memory allocator debugging for Linux
+ static const STRING GeneralPropertyLinuxMemDebug; /// value("LinuxMemDebug")
+ static const bool DefaultGeneralPropertyLinuxMemDebug; /// value(false);
+
/// Sets the field delimiter in the logs
static const STRING GeneralPropertyLogsDelimiter; /// value("LogsDelimiter")
static const STRING DefaultGeneralPropertyLogsDelimiter; /// value("\t")
@@ -381,6 +385,15 @@
static const STRING RenderingServicePropertyGeneralizeData; /// value("GeneralizeData")
static const bool DefaultRenderingServicePropertyGeneralizeData; /// value(false)
+ /// Sets the max width for raster image
+ static const STRING RenderingServicePropertyMaxRasterImageWidth; /// value("MaxRasterImageWidth")
+ static const INT32 DefaultRenderingServicePropertyMaxRasterImageWidth; /// value(2048)
+
+ /// Sets the max height for raster image
+ static const STRING RenderingServicePropertyMaxRasterImageHeight; /// value("MaxRasterImageHeight")
+ static const INT32 DefaultRenderingServicePropertyMaxRasterImageHeight; /// value(2048)
+
+
/// FONT ALIASES SECTION -----------------------------------------------------------------------------
/// font alias mappings
@@ -434,11 +447,11 @@
/// Sets the number of retry attempts per operation
static const STRING ResourceServicePropertyRetryAttempts; /// value("RetryAttempts")
- static const INT32 DefaultResourceServicePropertyRetryAttempts; /// value(10)
+ static const INT32 DefaultResourceServicePropertyRetryAttempts; /// value(50)
/// Sets the time duration (in milliseconds) between retry attempts
static const STRING ResourceServicePropertyRetryInterval; /// value("RetryInterval")
- static const INT32 DefaultResourceServicePropertyRetryInterval; /// value(10)
+ static const INT32 DefaultResourceServicePropertyRetryInterval; /// value(25)
EXTERNAL_API:
@@ -836,6 +849,22 @@
/// Disables Http operations used for OGC Wms
static const STRING AgentDisableWms; /// value("DisableWms")
+ /// Agent error log enabled
+ static const STRING AgentErrorLogEnabled; /// value("ErrorLogEnabled")
+ static const bool DefaultAgentErrorLogEnabled; /// value(false)
+
+ /// Agent error log filename
+ static const STRING AgentErrorLogFilename; /// value("ErrorLogFilename")
+ static const STRING DefaultAgentErrorLogFilename; /// value("Error.log")
+
+ /// Agent request log enabled
+ static const STRING AgentRequestLogEnabled; /// value("RequestLogEnabled")
+ static const bool DefaultAgentRequestLogEnabled; /// value(false)
+
+ /// Agent error log filename
+ static const STRING AgentRequestLogFilename; /// value("RequestLogFilename")
+ static const STRING DefaultAgentRequestLogFilename; /// value("Request.log")
+
/// OGC PROPERTIES SECTION -------------------------------------------------------------------------------------------
/// Ogc properties
@@ -847,7 +876,14 @@
/// Password for Wms requests
static const STRING WmsPassword; /// value("WmsPassword")
+ /// Enable OGC CITE Test for WFS
+ static const STRING CITEWfsEnabled; /// value("CITEWfsEnabled")
+ static const bool DefaultCITEWfsEnabled; /// value(false)
+ /// Enable OGC CITE Test for WMS
+ static const STRING CITEWmsEnabled; /// value("CITEWmsEnabled")
+ static const bool DefaultCITEWmsEnabled; /// value(false)
+
/// WEB APPLICATION PROPERTIES SECTION -------------------------------------------------------------------------------------------
/// Viewer framework properties
Modified: sandbox/rfc90/MgDev/Common/MapGuideCommon/System/UserInformation.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MapGuideCommon/System/UserInformation.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MapGuideCommon/System/UserInformation.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -47,7 +47,7 @@
///</summary>
MgUserInformation::MgUserInformation(CREFSTRING sessionId)
{
- SetMgSessionId(sessionId);
+ SetMgSessionId(sessionId.c_str());
m_type = uitMgSession;
m_apiVersion = MG_API_VERSION(1,0,0);
}
@@ -69,8 +69,8 @@
{
MgUtil::CheckXss(userName);
- m_username = userName;
- m_password = password;
+ m_username = userName.c_str();
+ m_password = password.c_str();
m_type = uitMg;
m_apiVersion = MG_API_VERSION(1,0,0);
}
@@ -103,13 +103,13 @@
{
if (&userInfo != this)
{
- m_username = userInfo.m_username;
- m_password = userInfo.m_password;
- m_sessionId = userInfo.m_sessionId;
- m_locale = userInfo.m_locale;
+ m_username = userInfo.m_username.c_str();
+ m_password = userInfo.m_password.c_str();
+ m_sessionId = userInfo.m_sessionId.c_str();
+ m_locale = userInfo.m_locale.c_str();
m_type = userInfo.m_type;
- m_clientAgent = userInfo.m_clientAgent;
- m_clientIp = userInfo.m_clientIp;
+ m_clientAgent = userInfo.m_clientAgent.c_str();
+ m_clientIp = userInfo.m_clientIp.c_str();
m_apiVersion = userInfo.m_apiVersion;
}
@@ -134,8 +134,8 @@
{
MgUtil::CheckXss(userName);
- m_username = userName;
- m_password = password;
+ m_username = userName.c_str();
+ m_password = password.c_str();
m_type = uitMg;
}
@@ -156,7 +156,7 @@
///<returns>
/// Username stored
///</returns>
-STRING MgUserInformation::GetUserName() { return m_username; }
+STRING MgUserInformation::GetUserName() { return (STRING)m_username.c_str(); }
///////////////////////////////
///<summary>
@@ -165,7 +165,7 @@
///<returns>
/// password stored
///</returns>
-STRING MgUserInformation::GetPassword() { return m_password; }
+STRING MgUserInformation::GetPassword() { return (STRING)m_password.c_str(); }
///////////////////////////////
///<summary>
@@ -173,7 +173,7 @@
///</summary>
STRING MgUserInformation::GetMgSessionId()
{
- return m_sessionId;
+ return (STRING)m_sessionId.c_str();
}
///////////////////////////////
@@ -200,7 +200,7 @@
{
SetLocale(sessionId.substr(sepChar+1, MG_LOCALE_LENGTH));
}
- m_sessionId = sessionId;
+ m_sessionId = sessionId.c_str();
}
else
{
@@ -245,7 +245,7 @@
else
{
// two-character locales remain case insensitive for legacy behavior
- m_locale = locale;
+ m_locale = locale.c_str();
}
}
@@ -256,17 +256,17 @@
///</summary>
STRING MgUserInformation::GetLocale()
{
- return m_locale;
+ return (STRING)m_locale.c_str();
}
void MgUserInformation::SetClientAgent(CREFSTRING agent)
{
- m_clientAgent = agent;
+ m_clientAgent = agent.c_str();
}
STRING MgUserInformation::GetClientAgent()
{
- return m_clientAgent;
+ return (STRING)m_clientAgent.c_str();
}
void MgUserInformation::SetClientIp(CREFSTRING ip)
@@ -275,12 +275,12 @@
// Note that MgIpUtil::ValidateAddress is not used here because
// an IP look up will affect peformance.
MgUtil::CheckXss(ip);
- m_clientIp = ip;
+ m_clientIp = ip.c_str();
}
STRING MgUserInformation::GetClientIp()
{
- return m_clientIp;
+ return (STRING)m_clientIp.c_str();
}
///////////////////////////////
@@ -338,13 +338,19 @@
/// </summary>
/// <returns> Nothing
/// </returns>
-void MgUserInformation::Dispose() { delete this; }
+void MgUserInformation::Dispose()
+{
+ delete this;
+}
/////////////////////////////////////////////////////////////////
/// <summary>
/// Returns the classId.
/// </summary>
-INT32 MgUserInformation::GetClassId() { return m_cls_id; }
+INT32 MgUserInformation::GetClassId()
+{
+ return m_cls_id;
+}
MgByteReader* MgUserInformation::GetReader()
{
@@ -377,20 +383,13 @@
if (0 != g_threadLocalUserInformation)
{
+ // Clean up old one if applicable
MgUserInformation* oldInfo = NULL;
ACE_OS::thr_getspecific(g_threadLocalUserInformation, (void**) &oldInfo);
+ SAFE_RELEASE(oldInfo);
- // Allocate a new MgUserInformation
- MgUserInformation* tempUserInformation = NULL;
- if(userInformation != NULL)
- {
- tempUserInformation = new MgUserInformation(*userInformation);
- }
-
- ACE_OS::thr_setspecific(g_threadLocalUserInformation, tempUserInformation);
-
- // Clean up old one if applicable
- SAFE_RELEASE(oldInfo);
+ SAFE_ADDREF(userInformation);
+ ACE_OS::thr_setspecific(g_threadLocalUserInformation, userInformation);
}
}
@@ -414,6 +413,8 @@
throw new MgConnectionNotOpenException(L"MgSiteConnection.GetCurrentUserInfo", __LINE__, __WFILE__, NULL, L"", NULL);
}
+ SAFE_ADDREF(userInfo);
+
return userInfo;
}
@@ -488,8 +489,8 @@
MgCryptographyUtil cryptoUtil;
string username, password;
- cryptoUtil.DecryptCredentials(MgUtil::WideCharToMultiByte(credentials),
- username, password);
+ string cred = MgUtil::WideCharToMultiByte(credentials);
+ cryptoUtil.DecryptCredentials(cred, username, password);
MgUtil::MultiByteToWideChar(username, m_username);
MgUtil::MultiByteToWideChar(password, m_password);
Modified: sandbox/rfc90/MgDev/Common/MdfModel/AreaRule.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/AreaRule.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/AreaRule.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -39,8 +39,7 @@
//-------------------------------------------------------------------------
AreaRule::~AreaRule()
{
- if (this->m_Symbolization != NULL)
- delete this->m_Symbolization;
+ delete this->m_Symbolization;
}
//-------------------------------------------------------------------------
@@ -67,8 +66,7 @@
{
if (this->m_Symbolization != pflAdoptedSymbolization)
{
- if (this->m_Symbolization != NULL)
- delete this->m_Symbolization;
+ delete this->m_Symbolization;
this->m_Symbolization = pflAdoptedSymbolization;
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/AreaSymbolization2D.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/AreaSymbolization2D.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/AreaSymbolization2D.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -72,8 +72,7 @@
{
if (this->m_pflFill != pflAdoptedFill)
{
- if (this->m_pflFill != NULL)
- delete this->m_pflFill;
+ delete this->m_pflFill;
this->m_pflFill = pflAdoptedFill;
}
}
@@ -120,8 +119,7 @@
{
if (this->m_pstkEdge != pstkAdoptedEdge)
{
- if (this->m_pstkEdge != NULL)
- delete this->m_pstkEdge;
+ delete this->m_pstkEdge;
this->m_pstkEdge = pstkAdoptedEdge;
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/CompositeRule.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/CompositeRule.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/CompositeRule.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -40,8 +40,7 @@
//-------------------------------------------------------------------------
CompositeRule::~CompositeRule()
{
- if (this->m_pSymbolization != NULL)
- delete this->m_pSymbolization;
+ delete this->m_pSymbolization;
}
//-------------------------------------------------------------------------
@@ -68,8 +67,7 @@
{
if (this->m_pSymbolization != compositeSymbolization)
{
- if (this->m_pSymbolization != NULL)
- delete this->m_pSymbolization;
+ delete this->m_pSymbolization;
this->m_pSymbolization = compositeSymbolization;
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/Label.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/Label.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/Label.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -39,8 +39,7 @@
//-------------------------------------------------------------------------
Label::~Label()
{
- if (this->m_Symbol != NULL)
- delete this->m_Symbol;
+ delete this->m_Symbol;
}
//-------------------------------------------------------------------------
@@ -67,8 +66,7 @@
{
if (this->m_Symbol != pflAdoptedSymbol)
{
- if (this->m_Symbol != NULL)
- delete this->m_Symbol;
+ delete this->m_Symbol;
this->m_Symbol = pflAdoptedSymbol;
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/LayerDefinition.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/LayerDefinition.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/LayerDefinition.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -99,3 +99,13 @@
{
this->m_opacity = opacity;
}
+
+//-------------------------------------------------------------------------
+// PURPOSE: Accessor method for a list of WatermarkInstance objects that represent
+// the Watermarks property.
+// RETURNS: A pointer to a modifiable WatermarkInstanceCollection.
+//-------------------------------------------------------------------------
+WatermarkInstanceCollection* LayerDefinition::GetWatermarks()
+{
+ return &this->m_listWatermarks;
+}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/LayerDefinition.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/LayerDefinition.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/LayerDefinition.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -20,6 +20,7 @@
#include "MdfModel.h"
#include "MdfRootObject.h"
+#include "WatermarkInstance.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -48,6 +49,10 @@
const double GetOpacity() const;
void SetOpacity(const double opacity);
+ // Property : Watermarks
+ // The List of watermark instance in this layer.
+ WatermarkInstanceCollection* GetWatermarks();
+
private:
// Data members
// The ID of the DataSource used by this layer
@@ -58,6 +63,8 @@
// The opacity value
double m_opacity;
+
+ WatermarkInstanceCollection m_listWatermarks;
};
END_NAMESPACE_MDFMODEL
Modified: sandbox/rfc90/MgDev/Common/MdfModel/LengthConverter.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/LengthConverter.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/LengthConverter.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -33,7 +33,7 @@
Feet,
Yards,
Miles,
- Points,
+ Points
};
class MDFMODEL_API LengthConverter
Modified: sandbox/rfc90/MgDev/Common/MdfModel/LineSymbolization2D.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/LineSymbolization2D.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/LineSymbolization2D.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -70,8 +70,7 @@
{
if (this->m_pstkStroke != pstkAdoptedStroke)
{
- if (this->m_pstkStroke != NULL)
- delete this->m_pstkStroke;
+ delete this->m_pstkStroke;
this->m_pstkStroke = pstkAdoptedStroke;
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/LineUsage.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/LineUsage.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/LineUsage.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -64,8 +64,7 @@
//-------------------------------------------------------------------------
LineUsage::~LineUsage()
{
- if (this->m_pDefaultPath != NULL)
- delete this->m_pDefaultPath;
+ delete this->m_pDefaultPath;
}
//-------------------------------------------------------------------------
@@ -265,8 +264,7 @@
{
if (this->m_pDefaultPath != defaultPath)
{
- if (this->m_pDefaultPath != NULL)
- delete this->m_pDefaultPath;
+ delete this->m_pDefaultPath;
this->m_pDefaultPath = defaultPath;
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/Makefile.am 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/Makefile.am 2010-11-13 18:14:35 UTC (rev 5390)
@@ -92,11 +92,19 @@
TextFrame.cpp \
TextSymbol.cpp \
ThemeLabel.cpp \
+ TileWatermarkPosition.cpp \
UnicodeString.cpp \
VectorLayerDefinition.cpp \
VectorScaleRange.cpp \
Version.cpp \
- W2DSymbol.cpp
+ W2DSymbol.cpp \
+ WatermarkAppearance.cpp \
+ WatermarkDefinition.cpp \
+ WatermarkInstance.cpp \
+ WatermarkPosition.cpp \
+ WatermarkXOffset.cpp \
+ WatermarkYOffset.cpp \
+ XYWatermarkPosition.cpp
noinst_HEADERS = \
Common/Color.h \
@@ -194,11 +202,20 @@
TextFrame.h \
TextSymbol.h \
ThemeLabel.h \
+ TileWatermarkPosition.h \
UnicodeString.h \
VectorLayerDefinition.h \
VectorScaleRange.h \
Version.h \
W2DSymbol.h \
+ WatermarkAppearance.h \
+ WatermarkDefinition.h \
+ WatermarkInstance.h \
+ WatermarkOffsetUnit.h \
+ WatermarkPosition.h \
+ WatermarkXOffset.h \
+ WatermarkYOffset.h \
+ XYWatermarkPosition.h \
stdafx.h
libMgMdfModel_la_LDFLAGS = -release $(PACKAGE_VERSION)
Modified: sandbox/rfc90/MgDev/Common/MdfModel/MapDefinition.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/MapDefinition.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/MapDefinition.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -190,6 +190,16 @@
}
//-------------------------------------------------------------------------
+// PURPOSE: Accessor method for a list of WatermarkInstance objects that represent
+// the Watermarks property.
+// RETURNS: A pointer to a modifiable WatermarkInstanceCollection.
+//-------------------------------------------------------------------------
+WatermarkInstanceCollection* MapDefinition::GetWatermarks()
+{
+ return &this->m_listWatermarks;
+}
+
+//-------------------------------------------------------------------------
// PURPOSE: Accessor method for a collection of doubles that
// represent the scales that the base map tiles can be displayed at.
// RETURNS: A pointer to a modifiable LayerGroupCollection.
Modified: sandbox/rfc90/MgDev/Common/MdfModel/MapDefinition.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/MapDefinition.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/MapDefinition.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -23,6 +23,7 @@
#include "MapLayer.h"
#include "MapLayerGroup.h"
#include "BaseMapLayerGroup.h"
+#include "WatermarkInstance.h"
#include "DisplayScale.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -73,6 +74,10 @@
// The collection of LayerGroups.
MapLayerGroupCollection* GetLayerGroups();
+ // Property : MapWatermarks
+ // The List of watermark instances.
+ WatermarkInstanceCollection* GetWatermarks();
+
// Property : FiniteDisplayScales
// The scales that the base map tiles can be displayed at
DisplayScaleCollection* GetFiniteDisplayScales();
@@ -98,6 +103,7 @@
MdfString m_strBkGrnd;
MapLayerCollection m_listLayers;
MapLayerGroupCollection m_collLayerGroups;
+ WatermarkInstanceCollection m_listWatermarks;
MdfString m_strName;
MdfString m_strMetadata;
MdfString m_strCoordSys;
Modified: sandbox/rfc90/MgDev/Common/MdfModel/MarkSymbol.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/MarkSymbol.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/MarkSymbol.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -95,8 +95,7 @@
{
if (this->m_pflFill != pflAdoptedFill)
{
- if (this->m_pflFill != NULL)
- delete this->m_pflFill;
+ delete this->m_pflFill;
this->m_pflFill = pflAdoptedFill;
}
}
@@ -143,8 +142,7 @@
{
if (this->m_pstkEdge != pstkAdoptedEdge)
{
- if (this->m_pstkEdge != NULL)
- delete this->m_pstkEdge;
+ delete this->m_pstkEdge;
this->m_pstkEdge = pstkAdoptedEdge;
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/MdfModel.rc
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/MdfModel.rc 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/MdfModel.rc 2010-11-13 18:14:35 UTC (rev 5390)
@@ -7,7 +7,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
+#include "winresrc.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -29,7 +29,7 @@
1 TEXTINCLUDE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#include ""winresrc.h""\r\n"
"\0"
END
Modified: sandbox/rfc90/MgDev/Common/MdfModel/MdfModel.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/MdfModel.vcproj 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/MdfModel.vcproj 2010-11-13 18:14:35 UTC (rev 5390)
@@ -45,7 +45,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="$(USRCFLAGS)"
Optimization="0"
- AdditionalIncludeDirectories=""..\..\Oem\dbxml-2.3.10\xerces-c-src\src""
+ AdditionalIncludeDirectories=""..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MDFMODEL_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
ExceptionHandling="2"
@@ -124,7 +124,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="$(USRCFLAGS)"
Optimization="0"
- AdditionalIncludeDirectories=""..\..\Oem\dbxml-2.3.10\xerces-c-src\src""
+ AdditionalIncludeDirectories=""..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MDFMODEL_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
ExceptionHandling="2"
@@ -203,7 +203,7 @@
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
- AdditionalIncludeDirectories=""..\..\Oem\dbxml-2.3.10\xerces-c-src\src""
+ AdditionalIncludeDirectories=""..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MDFMODEL_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
ExceptionHandling="2"
@@ -285,7 +285,7 @@
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
- AdditionalIncludeDirectories=""..\..\Oem\dbxml-2.3.10\xerces-c-src\src""
+ AdditionalIncludeDirectories=""..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MDFMODEL_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
ExceptionHandling="2"
@@ -1103,6 +1103,78 @@
>
</File>
</Filter>
+ <Filter
+ Name="WatermarkDefinition"
+ >
+ <File
+ RelativePath=".\TileWatermarkPosition.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\TileWatermarkPosition.h"
+ >
+ </File>
+ <File
+ RelativePath=".\WatermarkAppearance.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\WatermarkAppearance.h"
+ >
+ </File>
+ <File
+ RelativePath=".\WatermarkDefinition.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\WatermarkDefinition.h"
+ >
+ </File>
+ <File
+ RelativePath=".\WatermarkInstance.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\WatermarkInstance.h"
+ >
+ </File>
+ <File
+ RelativePath=".\WatermarkOffsetUnit.h"
+ >
+ </File>
+ <File
+ RelativePath=".\WatermarkPosition.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\WatermarkPosition.h"
+ >
+ </File>
+ <File
+ RelativePath=".\WatermarkXOffset.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\WatermarkXOffset.h"
+ >
+ </File>
+ <File
+ RelativePath=".\WatermarkYOffset.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\WatermarkYOffset.h"
+ >
+ </File>
+ <File
+ RelativePath=".\XYWatermarkPosition.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\XYWatermarkPosition.h"
+ >
+ </File>
+ </Filter>
<File
RelativePath=".\Base64.h"
>
Modified: sandbox/rfc90/MgDev/Common/MdfModel/MdfOwnerCollection.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/MdfOwnerCollection.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/MdfOwnerCollection.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -51,10 +51,8 @@
{
// delete all members
for(int i = 0; i < m_nSize; i++)
- {
- if (m_objArray[i] != NULL) //redundant check.
- delete m_objArray[i];
- }
+ delete m_objArray[i];
+
// delete allocated memory
delete[] m_objArray;
}
@@ -79,9 +77,8 @@
{
OBJ* pRetValue = NULL;
if (nIndex < m_nSize && nIndex >= 0)
- {
- pRetValue = m_objArray[nIndex];
- }
+ pRetValue = m_objArray[nIndex];
+
return pRetValue;
}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/Override.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/Override.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/Override.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -45,8 +45,7 @@
//-------------------------------------------------------------------------
Override::~Override()
{
- if (this->m_pThemeLabel != NULL)
- delete this->m_pThemeLabel;
+ delete this->m_pThemeLabel;
}
//-------------------------------------------------------------------------
@@ -120,8 +119,7 @@
{
if (this->m_pThemeLabel != themeLabel)
{
- if (this->m_pThemeLabel != NULL)
- delete this->m_pThemeLabel;
+ delete this->m_pThemeLabel;
this->m_pThemeLabel = themeLabel;
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/PointRule.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/PointRule.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/PointRule.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -40,8 +40,7 @@
//-------------------------------------------------------------------------
PointRule::~PointRule()
{
- if (this->m_Symbolization != NULL)
- delete this->m_Symbolization;
+ delete this->m_Symbolization;
}
//-------------------------------------------------------------------------
@@ -68,8 +67,7 @@
{
if (this->m_Symbolization != pflAdoptedSymbolization)
{
- if (this->m_Symbolization != NULL)
- delete this->m_Symbolization;
+ delete this->m_Symbolization;
this->m_Symbolization = pflAdoptedSymbolization;
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/PointSymbolization2D.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/PointSymbolization2D.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/PointSymbolization2D.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -76,8 +76,7 @@
{
if (this->m_psymSymbol != psymAdoptedSymbol)
{
- if (this->m_psymSymbol != NULL)
- delete this->m_psymSymbol;
+ delete this->m_psymSymbol;
this->m_psymSymbol = psymAdoptedSymbol;
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/Rule.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/Rule.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/Rule.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -124,8 +124,7 @@
{
if (this->m_pLabel != pLabel)
{
- if (this->m_pLabel != NULL)
- delete this->m_pLabel;
+ delete this->m_pLabel;
this->m_pLabel = pLabel;
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/SimpleSymbol.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/SimpleSymbol.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/SimpleSymbol.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -44,8 +44,7 @@
//-------------------------------------------------------------------------
SimpleSymbol::~SimpleSymbol()
{
- if (this->m_pSymbolDefinition != NULL)
- delete this->m_pSymbolDefinition;
+ delete this->m_pSymbolDefinition;
}
//-------------------------------------------------------------------------
@@ -65,8 +64,7 @@
{
if (this->m_pSymbolDefinition != symbolDefinition)
{
- if (this->m_pSymbolDefinition != NULL)
- delete this->m_pSymbolDefinition;
+ delete this->m_pSymbolDefinition;
this->m_pSymbolDefinition = symbolDefinition;
// Definition and Reference are mutually exclusive. Setting one
@@ -107,11 +105,8 @@
// Definition and Reference are mutually exclusive. Setting one
// clears the other.
- if (this->m_pSymbolDefinition != NULL)
- {
- delete this->m_pSymbolDefinition;
- this->m_pSymbolDefinition = NULL;
- }
+ delete this->m_pSymbolDefinition;
+ this->m_pSymbolDefinition = NULL;
}
//-------------------------------------------------------------------------
Modified: sandbox/rfc90/MgDev/Common/MdfModel/SimpleSymbolDefinition.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/SimpleSymbolDefinition.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/SimpleSymbolDefinition.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -42,14 +42,10 @@
//-------------------------------------------------------------------------
SimpleSymbolDefinition::~SimpleSymbolDefinition()
{
- if (this->m_pResizeBox != NULL)
- delete this->m_pResizeBox;
- if (this->m_pPointUsage != NULL)
- delete this->m_pPointUsage;
- if (this->m_pLineUsage != NULL)
- delete this->m_pLineUsage;
- if (this->m_pAreaUsage != NULL)
- delete this->m_pAreaUsage;
+ delete this->m_pResizeBox;
+ delete this->m_pPointUsage;
+ delete this->m_pLineUsage;
+ delete this->m_pAreaUsage;
}
//-------------------------------------------------------------------------
@@ -78,8 +74,7 @@
{
if (this->m_pResizeBox != resizeBox)
{
- if (this->m_pResizeBox != NULL)
- delete this->m_pResizeBox;
+ delete this->m_pResizeBox;
this->m_pResizeBox = resizeBox;
}
}
@@ -112,8 +107,7 @@
{
if (this->m_pPointUsage != pointUsage)
{
- if (this->m_pPointUsage != NULL)
- delete this->m_pPointUsage;
+ delete this->m_pPointUsage;
this->m_pPointUsage = pointUsage;
}
}
@@ -146,8 +140,7 @@
{
if (this->m_pLineUsage != lineUsage)
{
- if (this->m_pLineUsage != NULL)
- delete this->m_pLineUsage;
+ delete this->m_pLineUsage;
this->m_pLineUsage = lineUsage;
}
}
@@ -180,8 +173,7 @@
{
if (this->m_pAreaUsage != areaUsage)
{
- if (this->m_pAreaUsage != NULL)
- delete this->m_pAreaUsage;
+ delete this->m_pAreaUsage;
this->m_pAreaUsage = areaUsage;
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/SymbolInstance.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/SymbolInstance.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/SymbolInstance.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -60,8 +60,7 @@
//-------------------------------------------------------------------------
SymbolInstance::~SymbolInstance()
{
- if (this->m_pSymbolDefinition != NULL)
- delete this->m_pSymbolDefinition;
+ delete this->m_pSymbolDefinition;
}
//-------------------------------------------------------------------------
@@ -85,11 +84,8 @@
// Definition and Reference are mutually exclusive. Setting one
// clears the other.
- if (this->m_pSymbolDefinition != NULL)
- {
- delete this->m_pSymbolDefinition;
- this->m_pSymbolDefinition = NULL;
- }
+ delete this->m_pSymbolDefinition;
+ this->m_pSymbolDefinition = NULL;
}
//-------------------------------------------------------------------------
@@ -109,8 +105,7 @@
{
if (this->m_pSymbolDefinition != symbolDefinition)
{
- if (this->m_pSymbolDefinition != NULL)
- delete this->m_pSymbolDefinition;
+ delete this->m_pSymbolDefinition;
this->m_pSymbolDefinition = symbolDefinition;
// Definition and Reference are mutually exclusive. Setting one
Modified: sandbox/rfc90/MgDev/Common/MdfModel/Text.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/Text.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/Text.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -76,8 +76,7 @@
//-------------------------------------------------------------------------
Text::~Text()
{
- if (this->m_pFrame != NULL)
- delete this->m_pFrame;
+ delete this->m_pFrame;
}
//-------------------------------------------------------------------------
@@ -457,8 +456,7 @@
{
if (this->m_pFrame != frame)
{
- if (this->m_pFrame != NULL)
- delete this->m_pFrame;
+ delete this->m_pFrame;
this->m_pFrame = frame;
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfModel/VectorLayerDefinition.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/VectorLayerDefinition.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/VectorLayerDefinition.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -29,7 +29,7 @@
// Layer that specifies a wholly encapsulated data source of stylizable
// geometric features and their associated data attributes.
//-------------------------------------------------------------------------
- class MDFMODEL_API VectorLayerDefinition :public LayerDefinition
+ class MDFMODEL_API VectorLayerDefinition : public LayerDefinition
{
public:
Modified: sandbox/rfc90/MgDev/Common/MdfModel/VectorScaleRange.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfModel/VectorScaleRange.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfModel/VectorScaleRange.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -51,8 +51,7 @@
//-------------------------------------------------------------------------
VectorScaleRange::~VectorScaleRange()
{
- if (this->m_elevationSettings != NULL)
- delete this->m_elevationSettings;
+ delete this->m_elevationSettings;
}
//-------------------------------------------------------------------------
@@ -136,8 +135,7 @@
{
if (this->m_elevationSettings != elevationSettings)
{
- if (this->m_elevationSettings != NULL)
- delete this->m_elevationSettings;
+ delete this->m_elevationSettings;
this->m_elevationSettings = elevationSettings;
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfParser/FSDSAX2Parser.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/FSDSAX2Parser.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/FSDSAX2Parser.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -38,12 +38,9 @@
FSDSAX2Parser::~FSDSAX2Parser()
{
- if (m_handlerStack != NULL)
- delete m_handlerStack;
- if (m_parser != NULL)
- delete m_parser;
- if (m_featureSource)
- delete m_featureSource;
+ delete m_handlerStack;
+ delete m_parser;
+ delete m_featureSource;
}
@@ -207,7 +204,7 @@
const XMLCh* const qname,
const Attributes& attributes)
{
- std::wstring str = X2W(localname);
+ std::wstring str = X2W(qname);
m_strbuffer = L""; // discard any text between start tags
m_tagOpen = true;
@@ -240,7 +237,7 @@
void FSDSAX2Parser::characters(const XMLCh* const chars,
- const unsigned int length)
+ const XMLSize_t length)
{
// The character data may be split into multiple calls, so just store it for now.
// Also, do not record text outside of start/end tags
@@ -263,7 +260,7 @@
m_strbuffer = L"";
}
- (m_handlerStack->top())->EndElement(X2W(localname), m_handlerStack);
+ (m_handlerStack->top())->EndElement(X2W(qname), m_handlerStack);
}
}
Modified: sandbox/rfc90/MgDev/Common/MdfParser/FSDSAX2Parser.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/FSDSAX2Parser.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/FSDSAX2Parser.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -89,7 +89,7 @@
const XMLCh* const qname);
// Occurs when characters in between XML tags are encountered.
- void characters(const XMLCh* const chars, const unsigned int length);
+ void characters(const XMLCh* const chars, const XMLSize_t length);
// get error info
const MdfString& GetErrorMessage();
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOAreaTypeStyle.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOAreaTypeStyle.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOAreaTypeStyle.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -127,10 +127,10 @@
fd << BoolToStr(areaTypeStyle->IsShowInLegend());
fd << endStr(sShowInLegend) << std::endl;
}
- else
+ else if (*version >= Version(1, 0, 0))
{
+ // save ShowInLegend as extended data for LDF versions 1.0.0, 1.1.0, and 1.2.0
inctab();
- // earlier version - save ShowInLegend to ExtendedData1
fdExtData << tab() << startStr(sShowInLegend);
fdExtData << BoolToStr(areaTypeStyle->IsShowInLegend());
fdExtData << endStr(sShowInLegend) << std::endl;
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOCompositeTypeStyle.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOCompositeTypeStyle.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOCompositeTypeStyle.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -131,10 +131,10 @@
fd << BoolToStr(compositeTypeStyle->IsShowInLegend());
fd << endStr(sShowInLegend) << std::endl;
}
- else
+ else if (*version >= Version(1, 0, 0))
{
+ // save ShowInLegend as extended data for LDF versions 1.0.0, 1.1.0, and 1.2.0
inctab();
- // earlier version - save ShowInLegend to ExtendedData1
fdExtData << tab() << startStr(sShowInLegend);
fdExtData << BoolToStr(compositeTypeStyle->IsShowInLegend());
fdExtData << endStr(sShowInLegend) << std::endl;
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOCompoundSymbolDefinition.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOCompoundSymbolDefinition.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOCompoundSymbolDefinition.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -84,13 +84,13 @@
{
if (writeAsRootElement)
{
- // verify the LDF version
+ // verify the SymbolDefinition version
MdfString strVersion;
if (version)
{
if ((*version >= Version(1, 0, 0)) && (*version <= Version(1, 1, 0)))
{
- // SymbolDefinition in MapGuide 2008 / 2009
+ // SymbolDefinition in MapGuide 2008 - current
strVersion = version->ToString();
}
else
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IODrawingLayerDefinition.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IODrawingLayerDefinition.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IODrawingLayerDefinition.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -18,6 +18,7 @@
#include "stdafx.h"
#include "IODrawingLayerDefinition.h"
#include "VectorScaleRange.h"
+#include "IOWatermarkInstance.h"
#include "IOUnknown.h"
using namespace XERCES_CPP_NAMESPACE;
@@ -33,6 +34,8 @@
ELEM_MAP_ENTRY(6, MinScale);
ELEM_MAP_ENTRY(7, MaxScale);
ELEM_MAP_ENTRY(8, ExtendedData1);
+ELEM_MAP_ENTRY(9, Watermarks);
+ELEM_MAP_ENTRY(10, Watermark);
IODrawingLayerDefinition::IODrawingLayerDefinition(Version& version) : SAX2ElementHandler(version)
@@ -63,6 +66,20 @@
this->m_startElemName = name;
break;
+ case eWatermark:
+ {
+ Version wdVersion;
+ if (!IODrawingLayerDefinition::GetWatermarkDefinitionVersion(&this->m_version, wdVersion))
+ return;
+
+ WatermarkInstance* watermark = new WatermarkInstance(L"", L"");
+ this->m_layer->GetWatermarks()->Adopt(watermark);
+ IOWatermarkInstance* IO = new IOWatermarkInstance(watermark, wdVersion);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
case eExtendedData1:
this->m_procExtData = true;
break;
@@ -123,6 +140,16 @@
}
+// Determine which WatermarkDefinition schema version to use based
+// on the supplied LDF version:
+// * LDF version <= 2.3.0 => WD version 2.3.0
+bool IODrawingLayerDefinition::GetWatermarkDefinitionVersion(Version* ldfVersion, Version& wdVersion)
+{
+ wdVersion = Version(2, 3, 0);
+ return true;
+}
+
+
void IODrawingLayerDefinition::Write(MdfStream& fd, DrawingLayerDefinition* drawingLayer, Version* version)
{
// verify the LDF version
@@ -134,9 +161,9 @@
// LDF in MapGuide 2006
strVersion = L"1.0.0";
}
- else if ((*version >= Version(1, 0, 0)) && (*version <= Version(1, 3, 0)))
+ else if ((*version >= Version(1, 0, 0)) && (*version <= Version(2, 3, 0)))
{
- // LDF in MapGuide 2007 / 2008 / 2009 / 2010
+ // LDF in MapGuide 2007 - current
strVersion = version->ToString();
}
else
@@ -150,7 +177,7 @@
else
{
// use the current highest version
- strVersion = L"1.3.0";
+ strVersion = L"2.3.0";
}
fd << tab() << "<LayerDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"LayerDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
@@ -159,6 +186,8 @@
fd << tab() << startStr(sDrawingLayerDefinition) << std::endl;
inctab();
+ MdfStringStream fdExtData;
+
// Property: ResourceId
fd << tab() << startStr(sResourceId);
fd << EncodeString(drawingLayer->GetResourceID());
@@ -172,6 +201,36 @@
fd << endStr(sOpacity) << std::endl;
}
+ // Property: Watermarks (optional)
+ int watermarkCount = drawingLayer->GetWatermarks()->GetCount();
+ if (watermarkCount != 0)
+ {
+ if (!version || (*version >= Version(2, 3, 0)))
+ {
+ // only write Watermarks if the LDF version is 2.3.0 or greater
+ fd << tab() << startStr(sWatermarks) << std::endl;
+ inctab();
+ for (int i=0; i<watermarkCount; ++i)
+ IOWatermarkInstance::Write(fd, drawingLayer->GetWatermarks()->GetAt(i), version);
+ dectab();
+ fd << tab() << endStr(sWatermarks) << std::endl;
+ }
+ else if (*version >= Version(1, 0, 0))
+ {
+ // save Watermarks as extended data for LDF versions 1.0.0 - 1.3.0
+ inctab();
+
+ fdExtData << tab() << startStr(sWatermarks) << std::endl;
+ inctab();
+ for (int i=0; i<watermarkCount; ++i)
+ IOWatermarkInstance::Write(fdExtData, drawingLayer->GetWatermarks()->GetAt(i), version);
+ dectab();
+ fdExtData << tab() << endStr(sWatermarks) << std::endl;
+
+ dectab();
+ }
+ }
+
// Property: Sheet
fd << tab() << startStr(sSheet);
fd << EncodeString(drawingLayer->GetSheet());
@@ -202,7 +261,7 @@
}
// Write any unknown XML / extended data
- IOUnknown::Write(fd, drawingLayer->GetUnknownXml(), version);
+ IOUnknown::Write(fd, drawingLayer->GetUnknownXml(), fdExtData.str(), version);
dectab();
fd << tab() << endStr(sDrawingLayerDefinition) << std::endl;
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IODrawingLayerDefinition.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IODrawingLayerDefinition.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IODrawingLayerDefinition.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -41,6 +41,7 @@
static void Write(MdfStream& fd, DrawingLayerDefinition* drawingLayer, Version* version);
private:
+ static bool GetWatermarkDefinitionVersion(Version* ldfVersion, Version& wdVersion);
DrawingLayerDefinition* m_layer;
};
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOGridLayerDefinition.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOGridLayerDefinition.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOGridLayerDefinition.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -18,6 +18,7 @@
#include "stdafx.h"
#include "IOGridLayerDefinition.h"
#include "IOGridScaleRange.h"
+#include "IOWatermarkInstance.h"
#include "IOUnknown.h"
using namespace XERCES_CPP_NAMESPACE;
@@ -33,6 +34,8 @@
ELEM_MAP_ENTRY(6, Filter);
ELEM_MAP_ENTRY(7, GridScaleRange);
ELEM_MAP_ENTRY(8, ExtendedData1);
+ELEM_MAP_ENTRY(9, Watermarks);
+ELEM_MAP_ENTRY(10, Watermark);
IOGridLayerDefinition::IOGridLayerDefinition(Version& version) : SAX2ElementHandler(version)
@@ -63,6 +66,20 @@
this->m_startElemName = name;
break;
+ case eWatermark:
+ {
+ Version wdVersion;
+ if (!IOGridLayerDefinition::GetWatermarkDefinitionVersion(&this->m_version, wdVersion))
+ return;
+
+ WatermarkInstance* watermark = new WatermarkInstance(L"", L"");
+ this->m_layer->GetWatermarks()->Adopt(watermark);
+ IOWatermarkInstance* IO = new IOWatermarkInstance(watermark, wdVersion);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
case eGridScaleRange:
{
IOGridScaleRange* IO = new IOGridScaleRange(this->m_layer, this->m_version);
@@ -127,6 +144,16 @@
}
+// Determine which WatermarkDefinition schema version to use based
+// on the supplied LDF version:
+// * LDF version <= 2.3.0 => WD version 2.3.0
+bool IOGridLayerDefinition::GetWatermarkDefinitionVersion(Version* ldfVersion, Version& wdVersion)
+{
+ wdVersion = Version(2, 3, 0);
+ return true;
+}
+
+
void IOGridLayerDefinition::Write(MdfStream& fd, GridLayerDefinition* gridLayer, Version* version)
{
// verify the LDF version
@@ -138,9 +165,9 @@
// LDF in MapGuide 2006
strVersion = L"1.0.0";
}
- else if ((*version >= Version(1, 0, 0)) && (*version <= Version(1, 3, 0)))
+ else if ((*version >= Version(1, 0, 0)) && (*version <= Version(2, 3, 0)))
{
- // LDF in MapGuide 2007 / 2008 / 2009 / 2010
+ // LDF in MapGuide 2007 - current
strVersion = version->ToString();
}
else
@@ -154,7 +181,7 @@
else
{
// use the current highest version
- strVersion = L"1.3.0";
+ strVersion = L"2.3.0";
}
fd << tab() << "<LayerDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"LayerDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
@@ -163,6 +190,8 @@
fd << tab() << startStr(sGridLayerDefinition) << std::endl;
inctab();
+ MdfStringStream fdExtData;
+
// Property: ResourceId
fd << tab() << startStr(sResourceId);
fd << EncodeString(gridLayer->GetResourceID());
@@ -176,6 +205,36 @@
fd << endStr(sOpacity) << std::endl;
}
+ // Property: Watermarks (optional)
+ int watermarkCount = gridLayer->GetWatermarks()->GetCount();
+ if (watermarkCount != 0)
+ {
+ if (!version || (*version >= Version(2, 3, 0)))
+ {
+ // only write Watermarks if the LDF version is 2.3.0 or greater
+ fd << tab() << startStr(sWatermarks) << std::endl;
+ inctab();
+ for (int i=0; i<watermarkCount; ++i)
+ IOWatermarkInstance::Write(fd, gridLayer->GetWatermarks()->GetAt(i), version);
+ dectab();
+ fd << tab() << endStr(sWatermarks) << std::endl;
+ }
+ else if (*version >= Version(1, 0, 0))
+ {
+ // save Watermarks as extended data for LDF versions 1.0.0 - 1.3.0
+ inctab();
+
+ fdExtData << tab() << startStr(sWatermarks) << std::endl;
+ inctab();
+ for (int i=0; i<watermarkCount; ++i)
+ IOWatermarkInstance::Write(fdExtData, gridLayer->GetWatermarks()->GetAt(i), version);
+ dectab();
+ fdExtData << tab() << endStr(sWatermarks) << std::endl;
+
+ dectab();
+ }
+ }
+
// Property: FeatureName
fd << tab() << startStr(sFeatureName);
fd << EncodeString(gridLayer->GetFeatureName());
@@ -199,7 +258,7 @@
IOGridScaleRange::Write(fd, gridLayer->GetScaleRanges()->GetAt(i), version);
// Write any unknown XML / extended data
- IOUnknown::Write(fd, gridLayer->GetUnknownXml(), version);
+ IOUnknown::Write(fd, gridLayer->GetUnknownXml(), fdExtData.str(), version);
dectab();
fd << tab() << endStr(sGridLayerDefinition) << std::endl;
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOGridLayerDefinition.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOGridLayerDefinition.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOGridLayerDefinition.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -41,6 +41,7 @@
static void Write(MdfStream& fd, GridLayerDefinition* gridLayer, Version* version);
private:
+ static bool GetWatermarkDefinitionVersion(Version* ldfVersion, Version& wdVersion);
GridLayerDefinition* m_layer;
};
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOLabel.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOLabel.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOLabel.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -322,7 +322,7 @@
fd << endStr(sUnderlined) << std::endl;
}
- // Property: AdvancePlacement
+ // Property: AdvancedPlacement
fd << tab() << startStr(sAdvancedPlacement) << std::endl;
inctab();
fd << tab() << startStr(sScaleLimit);
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOLineRule.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOLineRule.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOLineRule.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -132,6 +132,7 @@
fd << tab() << startStr(sLineRule) << std::endl;
inctab();
+ // Property: LegendLabel
fd << tab() << startStr(sLegendLabel);
fd << EncodeString(lineRule->GetLegendLabel());
fd << endStr(sLegendLabel) << std::endl;
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOLineTypeStyle.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOLineTypeStyle.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOLineTypeStyle.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -127,10 +127,10 @@
fd << BoolToStr(lineTypeStyle->IsShowInLegend());
fd << endStr(sShowInLegend) << std::endl;
}
- else
+ else if (*version >= Version(1, 0, 0))
{
+ // save ShowInLegend as extended data for LDF versions 1.0.0, 1.1.0, and 1.2.0
inctab();
- // earlier version - save ShowInLegend to ExtendedData1
fdExtData << tab() << startStr(sShowInLegend);
fdExtData << BoolToStr(lineTypeStyle->IsShowInLegend());
fdExtData << endStr(sShowInLegend) << std::endl;
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOMapDefinition.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOMapDefinition.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOMapDefinition.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -21,6 +21,7 @@
#include "IOFill.h"
#include "IOMapLayer.h"
#include "IOMapLayerGroup.h"
+#include "IOWatermarkInstance.h"
#include "IOBaseMapDefinition.h"
using namespace XERCES_CPP_NAMESPACE;
@@ -73,6 +74,18 @@
handlerStack->push(IO);
IO->StartElement(name, handlerStack);
}
+ else if (this->m_currElemName == L"Watermark") // NOXLATE
+ {
+ Version wdVersion;
+ if (!IOMapDefinition::GetWatermarkDefinitionVersion(&this->m_version, wdVersion))
+ return;
+
+ WatermarkInstance* watermark = new WatermarkInstance(L"", L"");
+ this->m_map->GetWatermarks()->Adopt(watermark);
+ IOWatermarkInstance* IO = new IOWatermarkInstance(watermark, wdVersion);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
else if (this->m_currElemName == L"BaseMapDefinition") // NOXLATE
{
IOBaseMapDefinition* IO = new IOBaseMapDefinition(this->m_map, this->m_version);
@@ -108,9 +121,45 @@
}
+// Determine which WatermarkDefinition schema version to use based
+// on the supplied MDF version:
+// * MDF version <= 2.3.0 => WD version 2.3.0
+bool IOMapDefinition::GetWatermarkDefinitionVersion(Version* mdfVersion, Version& wdVersion)
+{
+ wdVersion = Version(2, 3, 0);
+ return true;
+}
+
+
void IOMapDefinition::Write(MdfStream& fd, MapDefinition* map, Version* version)
{
- fd << tab() << "<MapDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"MapDefinition-1.0.0.xsd\">" << std::endl; // NOXLATE
+ // verify the MDF version
+ MdfString strVersion;
+ if (version)
+ {
+ if ((*version >= Version(1, 0, 0)) && (*version <= Version(2, 3, 0)))
+ {
+ // MDF in MapGuide 2006 - current
+ strVersion = version->ToString();
+ }
+ else
+ {
+ // unsupported MDF version
+ // TODO - need a way to return error information
+ _ASSERT(false);
+ return;
+ }
+ }
+ else
+ {
+ // use the current highest version
+ strVersion = L"2.3.0";
+ }
+
+ if (!version || (*version > Version(1, 0, 0)))
+ fd << tab() << "<MapDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"MapDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
+ else
+ fd << tab() << "<MapDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"MapDefinition-1.0.0.xsd\">" << std::endl; // NOXLATE
inctab();
// Property: Name
@@ -118,6 +167,7 @@
fd << EncodeString(map->GetName());
fd << "</Name>" << std::endl; // NOXLATE
+ // Property: CoordinateSystem
fd << tab() << "<CoordinateSystem>"; // NOXLATE
fd << EncodeString(map->GetCoordinateSystem());
fd << "</CoordinateSystem>" << std::endl; // NOXLATE
@@ -150,6 +200,22 @@
if (map->GetFiniteDisplayScales()->GetCount() > 0)
IOBaseMapDefinition::Write(fd, map, version);
+ // Property: Watermarks (optional)
+ int watermarkCount = map->GetWatermarks()->GetCount();
+ if (watermarkCount != 0)
+ {
+ // only write Watermarks if the MDF version is 2.3.0 or greater
+ if (!version || (*version >= Version(2, 3, 0)))
+ {
+ fd << tab() << startStr("Watermarks") << std::endl; // NOXLATE
+ inctab();
+ for (int i=0; i<watermarkCount; ++i)
+ IOWatermarkInstance::Write(fd, map->GetWatermarks()->GetAt(i), version);
+ dectab();
+ fd << tab() << endStr("Watermarks") << std::endl; // NOXLATE
+ }
+ }
+
dectab();
fd << tab() << "</MapDefinition>" << std::endl; // NOXLATE
}
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOMapDefinition.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOMapDefinition.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOMapDefinition.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -41,6 +41,7 @@
static void Write(MdfStream& fd, MapDefinition* map, Version* version);
private:
+ static bool GetWatermarkDefinitionVersion(Version* mdfVersion, Version& wdVersion);
MapDefinition* m_map;
};
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOMapLayerGroupCommon.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOMapLayerGroupCommon.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOMapLayerGroupCommon.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -42,14 +42,6 @@
}
-void IOMapLayerGroupCommon::StartElement(const wchar_t* name, HandlerStack* handlerStack)
-{
-#ifdef _NDEBUG
- _ASSERT(false);
-#endif
-}
-
-
void IOMapLayerGroupCommon::ElementChars(const wchar_t* ch)
{
if (this->m_currElemName == L"Name") // NOXLATE
@@ -65,14 +57,6 @@
}
-void IOMapLayerGroupCommon::EndElement(const wchar_t* name, HandlerStack* handlerStack)
-{
-#ifdef _NDEBUG
- _ASSERT(false);
-#endif
-}
-
-
void IOMapLayerGroupCommon::Write(MdfStream& fd, MapLayerGroupCommon* layerGroup, Version* version)
{
// Property: Name
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOMapLayerGroupCommon.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOMapLayerGroupCommon.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOMapLayerGroupCommon.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -37,9 +37,7 @@
IOMapLayerGroupCommon(MapDefinition* map, Version& version);
virtual ~IOMapLayerGroupCommon();
- virtual void StartElement(const wchar_t* name, HandlerStack* handlerStack);
virtual void ElementChars(const wchar_t* ch);
- virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
static void Write(MdfStream& fd, MapLayerGroupCommon* layerGroup, Version* version);
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOPointTypeStyle.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOPointTypeStyle.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOPointTypeStyle.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -151,10 +151,10 @@
fd << BoolToStr(pointTypeStyle->IsShowInLegend());
fd << endStr(sShowInLegend) << std::endl;
}
- else
+ else if (*version >= Version(1, 0, 0))
{
+ // save ShowInLegend as extended data for LDF versions 1.0.0, 1.1.0, and 1.2.0
inctab();
- // earlier version - save ShowInLegend to ExtendedData1
fdExtData << tab() << startStr(sShowInLegend);
fdExtData << BoolToStr(pointTypeStyle->IsShowInLegend());
fdExtData << endStr(sShowInLegend) << std::endl;
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOSimpleSymbolDefinition.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOSimpleSymbolDefinition.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOSimpleSymbolDefinition.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -119,13 +119,13 @@
{
if (writeAsRootElement)
{
- // verify the LDF version
+ // verify the SymbolDefinition version
MdfString strVersion;
if (version)
{
if ((*version >= Version(1, 0, 0)) && (*version <= Version(1, 1, 0)))
{
- // SymbolDefinition in MapGuide 2008 / 2009
+ // SymbolDefinition in MapGuide 2008 - current
strVersion = version->ToString();
}
else
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOSymbolInstance.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOSymbolInstance.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOSymbolInstance.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -154,6 +154,7 @@
// Determine which SymbolDefinition schema version to use based
// on the supplied LDF version:
+// * LDF version == 2.3.0 => SD version 1.1.0
// * LDF version == 1.3.0 => SD version 1.1.0
// * LDF version == 1.2.0 => SD version 1.1.0
// * LDF version <= 1.1.0 => SD version 1.0.0
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOVectorLayerDefinition.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOVectorLayerDefinition.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOVectorLayerDefinition.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -19,6 +19,7 @@
#include "IOVectorLayerDefinition.h"
#include "IONameStringPair.h"
#include "IOVectorScaleRange.h"
+#include "IOWatermarkInstance.h"
#include "IOUnknown.h"
using namespace XERCES_CPP_NAMESPACE;
@@ -38,6 +39,8 @@
ELEM_MAP_ENTRY(10, ToolTip);
ELEM_MAP_ENTRY(11, VectorScaleRange);
ELEM_MAP_ENTRY(12, ExtendedData1);
+ELEM_MAP_ENTRY(13, Watermarks);
+ELEM_MAP_ENTRY(14, Watermark);
IOVectorLayerDefinition::IOVectorLayerDefinition(Version& version) : SAX2ElementHandler(version)
@@ -68,6 +71,20 @@
this->m_startElemName = name;
break;
+ case eWatermark:
+ {
+ Version wdVersion;
+ if (!IOVectorLayerDefinition::GetWatermarkDefinitionVersion(&this->m_version, wdVersion))
+ return;
+
+ WatermarkInstance* watermark = new WatermarkInstance(L"", L"");
+ this->m_layer->GetWatermarks()->Adopt(watermark);
+ IOWatermarkInstance* IO = new IOWatermarkInstance(watermark, wdVersion);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
case ePropertyMapping:
{
IONameStringPair* IO = new IONameStringPair(this->m_layer, this->m_version);
@@ -155,6 +172,16 @@
}
+// Determine which WatermarkDefinition schema version to use based
+// on the supplied LDF version:
+// * LDF version <= 2.3.0 => WD version 2.3.0
+bool IOVectorLayerDefinition::GetWatermarkDefinitionVersion(Version* ldfVersion, Version& wdVersion)
+{
+ wdVersion = Version(2, 3, 0);
+ return true;
+}
+
+
void IOVectorLayerDefinition::Write(MdfStream& fd, VectorLayerDefinition* vectorLayer, Version* version)
{
// verify the LDF version
@@ -166,9 +193,9 @@
// LDF in MapGuide 2006
strVersion = L"1.0.0";
}
- else if ((*version >= Version(1, 0, 0)) && (*version <= Version(1, 3, 0)))
+ else if ((*version >= Version(1, 0, 0)) && (*version <= Version(2, 3, 0)))
{
- // LDF in MapGuide 2007 / 2008 / 2009 / 2010
+ // LDF in MapGuide 2007 - current
strVersion = version->ToString();
}
else
@@ -182,7 +209,7 @@
else
{
// use the current highest version
- strVersion = L"1.3.0";
+ strVersion = L"2.3.0";
}
fd << tab() << "<LayerDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"LayerDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
@@ -191,6 +218,8 @@
fd << tab() << startStr(sVectorLayerDefinition) << std::endl;
inctab();
+ MdfStringStream fdExtData;
+
// Property: ResourceId
fd << tab() << startStr(sResourceId);
fd << EncodeString(vectorLayer->GetResourceID());
@@ -204,6 +233,36 @@
fd << endStr(sOpacity) << std::endl;
}
+ // Property: Watermarks (optional)
+ int watermarkCount = vectorLayer->GetWatermarks()->GetCount();
+ if (watermarkCount != 0)
+ {
+ if (!version || (*version >= Version(2, 3, 0)))
+ {
+ // only write Watermarks if the LDF version is 2.3.0 or greater
+ fd << tab() << startStr(sWatermarks) << std::endl;
+ inctab();
+ for (int i=0; i<watermarkCount; ++i)
+ IOWatermarkInstance::Write(fd, vectorLayer->GetWatermarks()->GetAt(i), version);
+ dectab();
+ fd << tab() << endStr(sWatermarks) << std::endl;
+ }
+ else if (*version >= Version(1, 0, 0))
+ {
+ // save Watermarks as extended data for LDF versions 1.0.0 - 1.3.0
+ inctab();
+
+ fdExtData << tab() << startStr(sWatermarks) << std::endl;
+ inctab();
+ for (int i=0; i<watermarkCount; ++i)
+ IOWatermarkInstance::Write(fdExtData, vectorLayer->GetWatermarks()->GetAt(i), version);
+ dectab();
+ fdExtData << tab() << endStr(sWatermarks) << std::endl;
+
+ dectab();
+ }
+ }
+
// Property: FeatureName
fd << tab() << startStr(sFeatureName);
fd << EncodeString(vectorLayer->GetFeatureName());
@@ -255,7 +314,7 @@
IOVectorScaleRange::Write(fd, vectorLayer->GetScaleRanges()->GetAt(i), version);
// Write any unknown XML / extended data
- IOUnknown::Write(fd, vectorLayer->GetUnknownXml(), version);
+ IOUnknown::Write(fd, vectorLayer->GetUnknownXml(), fdExtData.str(), version);
dectab();
fd << tab() << endStr(sVectorLayerDefinition) << std::endl;
Modified: sandbox/rfc90/MgDev/Common/MdfParser/IOVectorLayerDefinition.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/IOVectorLayerDefinition.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/IOVectorLayerDefinition.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -41,6 +41,7 @@
static void Write(MdfStream& fd, VectorLayerDefinition* vectorLayer, Version* version);
private:
+ static bool GetWatermarkDefinitionVersion(Version* ldfVersion, Version& wdVersion);
VectorLayerDefinition* m_layer;
};
Modified: sandbox/rfc90/MgDev/Common/MdfParser/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/Makefile.am 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/Makefile.am 2010-11-13 18:14:35 UTC (rev 5390)
@@ -4,7 +4,7 @@
INCLUDES = \
-I../MdfModel/ \
- -I../../Oem/dbxml-2.3.10/xerces-c-src/src/
+ -I../../Oem/dbxml/xerces-c-src/src/
lib_LTLIBRARIES = libMgMdfParser.la
@@ -93,11 +93,19 @@
IOText.cpp \
IOTextFrame.cpp \
IOThemeLabel.cpp \
+ IOTileWatermarkPosition.cpp \
IOUnknown.cpp \
IOUtil.cpp \
IOVectorLayerDefinition.cpp \
IOVectorScaleRange.cpp \
IOW2DSymbol.cpp \
+ IOWatermarkAppearance.cpp \
+ IOWatermarkDefinition.cpp \
+ IOWatermarkInstance.cpp \
+ IOWatermarkOffsetUnit.cpp \
+ IOWatermarkXOffset.cpp \
+ IOWatermarkYOffset.cpp \
+ IOXYWatermarkPosition.cpp \
MdfParser.cpp \
SAX2ElementHandler.cpp \
SAX2Parser.cpp
@@ -186,11 +194,19 @@
IOText.h \
IOTextFrame.h \
IOThemeLabel.h \
+ IOTileWatermarkPosition.h \
IOUnknown.h \
IOUtil.h \
IOVectorLayerDefinition.h \
IOVectorScaleRange.h \
IOW2DSymbol.h \
+ IOWatermarkAppearance.h \
+ IOWatermarkDefinition.h \
+ IOWatermarkInstance.h \
+ IOWatermarkOffsetUnit.h \
+ IOWatermarkXOffset.h \
+ IOWatermarkYOffset.h \
+ IOXYWatermarkPosition.h \
MdfParser.h \
SAX2ElementHandler.h \
SAX2Parser.h \
@@ -200,4 +216,4 @@
libMgMdfParser_la_LDFLAGS = -release $(PACKAGE_VERSION) \
-L../MdfModel \
- -L../../Oem/dbxml-2.3.10/install/lib
+ -L../../Oem/dbxml/install/lib
Modified: sandbox/rfc90/MgDev/Common/MdfParser/MdfParser.rc
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/MdfParser.rc 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/MdfParser.rc 2010-11-13 18:14:35 UTC (rev 5390)
@@ -6,7 +6,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
+#include "winresrc.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
1 TEXTINCLUDE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#include ""winresrc.h""\r\n"
"\0"
END
Modified: sandbox/rfc90/MgDev/Common/MdfParser/MdfParser.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/MdfParser.vcproj 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/MdfParser.vcproj 2010-11-13 18:14:35 UTC (rev 5390)
@@ -44,7 +44,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\MdfModel;"..\..\Oem\dbxml-2.3.10\xerces-c-src\src""
+ AdditionalIncludeDirectories="..\MdfModel;"..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MDFPARSER_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
ExceptionHandling="2"
@@ -65,10 +65,10 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="xerces-c_2D.lib"
+ AdditionalDependencies="xerces-c_3mgD.lib"
OutputFile="$(OutDir)\MgMdfParserd.dll"
LinkIncremental="2"
- AdditionalLibraryDirectories="..\..\Oem\dbxml-2.3.10\lib"
+ AdditionalLibraryDirectories="..\..\Oem\dbxml\lib"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\MgMdfParserd.pdb"
SubSystem="2"
@@ -124,7 +124,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\MdfModel;"..\..\Oem\dbxml-2.3.10\xerces-c-src\src""
+ AdditionalIncludeDirectories="..\MdfModel;"..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MDFPARSER_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
ExceptionHandling="2"
@@ -146,10 +146,10 @@
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="false"
- AdditionalDependencies="xerces-c_2D.lib"
+ AdditionalDependencies="xerces-c_3mgD.lib"
OutputFile="$(OutDir)\MgMdfParserd.dll"
LinkIncremental="2"
- AdditionalLibraryDirectories="..\..\Oem\dbxml-2.3.10\lib64"
+ AdditionalLibraryDirectories="..\..\Oem\dbxml\lib64"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\MgMdfParserd.pdb"
SubSystem="2"
@@ -203,7 +203,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- AdditionalIncludeDirectories="..\MdfModel;"..\..\Oem\dbxml-2.3.10\xerces-c-src\src""
+ AdditionalIncludeDirectories="..\MdfModel;"..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MDFPARSER_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
ExceptionHandling="2"
RuntimeLibrary="2"
@@ -221,10 +221,10 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="xerces-c_2.lib"
+ AdditionalDependencies="xerces-c_3mg.lib"
OutputFile="$(OutDir)\MgMdfParser.dll"
LinkIncremental="1"
- AdditionalLibraryDirectories="..\..\Oem\dbxml-2.3.10\lib"
+ AdditionalLibraryDirectories="..\..\Oem\dbxml\lib"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\MgMdfParser.pdb"
SubSystem="2"
@@ -282,7 +282,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- AdditionalIncludeDirectories="..\MdfModel;"..\..\Oem\dbxml-2.3.10\xerces-c-src\src""
+ AdditionalIncludeDirectories="..\MdfModel;"..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MDFPARSER_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
ExceptionHandling="2"
RuntimeLibrary="2"
@@ -300,10 +300,10 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="xerces-c_2.lib"
+ AdditionalDependencies="xerces-c_3mg.lib"
OutputFile="$(OutDir)\MgMdfParser.dll"
LinkIncremental="1"
- AdditionalLibraryDirectories="..\..\Oem\dbxml-2.3.10\lib64"
+ AdditionalLibraryDirectories="..\..\Oem\dbxml\lib64"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\MgMdfParser.pdb"
SubSystem="2"
@@ -1015,6 +1015,14 @@
>
</File>
<File
+ RelativePath=".\IOTileWatermarkPosition.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\IOTileWatermarkPosition.h"
+ >
+ </File>
+ <File
RelativePath=".\IOUnknown.cpp"
>
</File>
@@ -1055,6 +1063,62 @@
>
</File>
<File
+ RelativePath=".\IOWatermarkAppearance.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\IOWatermarkAppearance.h"
+ >
+ </File>
+ <File
+ RelativePath=".\IOWatermarkDefinition.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\IOWatermarkDefinition.h"
+ >
+ </File>
+ <File
+ RelativePath=".\IOWatermarkInstance.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\IOWatermarkInstance.h"
+ >
+ </File>
+ <File
+ RelativePath=".\IOWatermarkOffsetUnit.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\IOWatermarkOffsetUnit.h"
+ >
+ </File>
+ <File
+ RelativePath=".\IOWatermarkXOffset.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\IOWatermarkXOffset.h"
+ >
+ </File>
+ <File
+ RelativePath=".\IOWatermarkYOffset.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\IOWatermarkYOffset.h"
+ >
+ </File>
+ <File
+ RelativePath=".\IOXYWatermarkPosition.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\IOXYWatermarkPosition.h"
+ >
+ </File>
+ <File
RelativePath=".\MdfParser.cpp"
>
</File>
Modified: sandbox/rfc90/MgDev/Common/MdfParser/SAX2Parser.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/SAX2Parser.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/SAX2Parser.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -27,6 +27,7 @@
#include "PrintLayout/IOPrintLayoutDefinition.h"
#include "PrintLayout/IOPrintLayoutElementDefinition.h"
#include "PrintLayout/IOMapViewportDefinition.h"
+#include "IOWatermarkDefinition.h"
using namespace XERCES_CPP_NAMESPACE;
using namespace MDFMODEL_NAMESPACE;
@@ -63,26 +64,18 @@
SAX2Parser::~SAX2Parser()
{
- if (m_handlerStack != NULL)
- delete m_handlerStack;
- if (m_parser != NULL)
- delete m_parser;
- if (m_map != NULL)
- delete m_map;
- if (m_vLayer != NULL)
- delete m_vLayer;
- if (m_dLayer != NULL)
- delete m_dLayer;
- if (m_gLayer != NULL)
- delete m_gLayer;
- if (m_sSymbol != NULL)
- delete m_sSymbol;
- if (m_cSymbol != NULL)
- delete m_cSymbol;
- if (m_printLayout != NULL)
- delete m_printLayout;
- if (m_mapViewport != NULL)
- delete m_mapViewport;
+ delete m_handlerStack;
+ delete m_parser;
+
+ delete m_map;
+ delete m_vLayer;
+ delete m_dLayer;
+ delete m_gLayer;
+ delete m_sSymbol;
+ delete m_cSymbol;
+ delete m_printLayout;
+ delete m_mapViewport;
+ delete m_watermark;
}
@@ -97,6 +90,7 @@
m_cSymbol = NULL;
m_printLayout = NULL;
m_mapViewport = NULL;
+ m_watermark = NULL;
m_succeeded = false;
}
@@ -250,6 +244,16 @@
}
+// Returns a reference to the parser's watermark definition
+// After this call the parser no longer owns the object.
+WatermarkDefinition* SAX2Parser::DetachWatermarkDefinition()
+{
+ WatermarkDefinition* ret = m_watermark;
+ m_watermark = NULL;
+ return ret;
+}
+
+
bool SAX2Parser::GetSucceeded() const
{
return m_succeeded;
@@ -400,6 +404,22 @@
}
+void SAX2Parser::WriteToFile(std::string name, WatermarkDefinition* watermark, Version* version)
+{
+ std::ofstream fd;
+ fd.open(name.c_str());
+ if (fd.is_open())
+ {
+ zerotab();
+ fd << tab() << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl; // NOXLATE
+
+ if (NULL != watermark)
+ IOWatermarkDefinition::Write(fd, watermark, version);
+ }
+ fd.close();
+}
+
+
std::string SAX2Parser::SerializeToXML(MapDefinition* map, Version* version)
{
MdfStringStream fd;
@@ -470,12 +490,23 @@
}
+std::string SAX2Parser::SerializeToXML(WatermarkDefinition* watermark, Version* version)
+{
+ MdfStringStream fd;
+
+ if (NULL != watermark)
+ IOWatermarkDefinition::Write(fd, watermark, version);
+
+ return fd.str();
+}
+
+
void SAX2Parser::startElement(const XMLCh* const uri,
const XMLCh* const localname,
const XMLCh* const qname,
const Attributes& attributes)
{
- std::wstring str = X2W(localname);
+ std::wstring str = X2W(qname);
m_strbuffer = L""; // discard any text between start tags
m_tagOpen = true;
@@ -490,7 +521,7 @@
if (str == L"MapDefinition") // NOXLATE
{
// set the version
- m_version = Version(1, 0, 0);
+ SetMapDefinitionVersion(attributes);
_ASSERT(m_map == NULL); // otherwise we leak
m_map = new MapDefinition(L"", L"");
@@ -573,6 +604,17 @@
m_handlerStack->push(IO);
IO->StartElement(str.c_str(), m_handlerStack);
}
+ else if (str == L"WatermarkDefinition") //NOXLATE
+ {
+ // set the version
+ SetWatermarkDefinitionVersion(attributes);
+
+ _ASSERT(m_watermark == NULL); // otherwise we leak
+ m_watermark = new WatermarkDefinition();
+ IOWatermarkDefinition* IO = new IOWatermarkDefinition(m_watermark, m_version);
+ m_handlerStack->push(IO);
+ IO->StartElement(str.c_str(), m_handlerStack);
+ }
}
// Otherwise, if the stack has items on it, just pass the event through.
else
@@ -583,7 +625,7 @@
void SAX2Parser::characters(const XMLCh* const chars,
- const unsigned int length)
+ const XMLSize_t length)
{
// The character data may be split into multiple calls, so just store it for now.
// Also, do not record text outside of start/end tags
@@ -606,7 +648,7 @@
m_strbuffer = L"";
}
- (m_handlerStack->top())->EndElement(X2W(localname), m_handlerStack);
+ (m_handlerStack->top())->EndElement(X2W(qname), m_handlerStack);
}
}
@@ -623,6 +665,31 @@
}
+void SAX2Parser::SetMapDefinitionVersion(const Attributes& attributes)
+{
+ // check for a version attribute
+ int index = attributes.getIndex(W2X(L"version"));
+ const XMLCh* verValue = (index >= 0)? attributes.getValue(index) : NULL;
+
+ // according to the latest schema map definition elements require a version
+ // attribute, but users may generate XML which is missing this attribute
+ if (verValue)
+ {
+ std::wstring version = X2W(verValue);
+
+ if (_wcsicmp(version.c_str(), L"1.0.0") == 0)
+ m_version = MdfModel::Version(1, 0, 0);
+ else if (_wcsicmp(version.c_str(), L"2.3.0") == 0)
+ m_version = MdfModel::Version(2, 3, 0);
+ }
+ else
+ {
+ // assume the latest version if the attribute is missing
+ m_version = MdfModel::Version(2, 3, 0);
+ }
+}
+
+
void SAX2Parser::SetLayerDefinitionVersion(const Attributes& attributes)
{
// check for a version attribute
@@ -643,11 +710,13 @@
m_version = MdfModel::Version(1, 2, 0);
else if (_wcsicmp(version.c_str(), L"1.3.0") == 0)
m_version = MdfModel::Version(1, 3, 0);
+ else if (_wcsicmp(version.c_str(), L"2.3.0") == 0)
+ m_version = MdfModel::Version(2, 3, 0);
}
else
{
// assume the latest version if the attribute is missing
- m_version = MdfModel::Version(1, 3, 0);
+ m_version = MdfModel::Version(2, 3, 0);
}
}
@@ -676,6 +745,7 @@
}
}
+
void SAX2Parser::SetPrintLayoutDefinitionVersion(const Attributes& attributes)
{
// check for a version attribute
@@ -695,6 +765,7 @@
}
}
+
void SAX2Parser::SetPrintLayoutElementDefinitionVersion(const Attributes& attributes)
{
// check for a version attribute
@@ -714,6 +785,33 @@
}
}
+
+void SAX2Parser::SetWatermarkDefinitionVersion(const Attributes& attributes)
+{
+ // Although right now we only have 1.0.0 here, this function is still
+ // needed for future expansion.
+
+ // check for a version attribute
+ int index = attributes.getIndex(W2X(L"version"));
+ const XMLCh* verValue = (index >= 0)? attributes.getValue(index) : NULL;
+
+ // according to the schema watermark definition elements require a version
+ // attribute, but users may generate XML which is missing this attribute
+ if (verValue)
+ {
+ std::wstring version = X2W(verValue);
+
+ if (_wcsicmp(version.c_str(), L"2.3.0") == 0)
+ m_version = MdfModel::Version(2, 3, 0);
+ }
+ else
+ {
+ // assume the latest version if the attribute is missing
+ m_version = MdfModel::Version(2, 3, 0);
+ }
+}
+
+
MapDefinition* SAX2Parser::CreateClone(MapDefinition* map)
{
_ASSERT(NULL != map);
@@ -787,3 +885,18 @@
return parser.DetachSymbolDefinition();
}
+
+
+WatermarkDefinition* SAX2Parser::CreateClone(WatermarkDefinition* watermark)
+{
+ _ASSERT(NULL != watermark);
+ if (NULL == watermark)
+ return NULL;
+
+ SAX2Parser parser;
+ std::string xmlOfWD("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); // NOXLATE
+ xmlOfWD.append(parser.SerializeToXML(watermark, NULL));
+ parser.ParseString(xmlOfWD.c_str(), xmlOfWD.size());
+
+ return parser.DetachWatermarkDefinition();
+}
Modified: sandbox/rfc90/MgDev/Common/MdfParser/SAX2Parser.h
===================================================================
--- sandbox/rfc90/MgDev/Common/MdfParser/SAX2Parser.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/MdfParser/SAX2Parser.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -27,6 +27,7 @@
#include "PrintLayout/PrintLayoutDefinition.h"
#include "PrintLayout/PrintLayoutElementDefinition.h"
#include "PrintLayout/MapViewportDefinition.h"
+#include "WatermarkDefinition.h"
// disable C4244 of XSerializeEngine about __w64 int assigned to unsigned long
// disable C4267 of XmlScanner about size_t assigned to unsigned int
@@ -40,6 +41,8 @@
#include <xercesc/framework/XMLFormatter.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/framework/MemBufInputSource.hpp>
+#include <xercesc/parsers/SAX2XMLReaderImpl.hpp>
+
#pragma warning(pop)
#include "IOUtil.h"
@@ -80,6 +83,7 @@
MapViewportDefinition* mapViewport,
MdfModel::Version* version);
void WriteToFile(std::string name, SymbolDefinition* symbol, MdfModel::Version* version);
+ void WriteToFile(std::string name, WatermarkDefinition* watermark, MdfModel::Version* version);
// Serialization functions for the various Definitions the parser supports
std::string SerializeToXML(MapDefinition* map, MdfModel::Version* version);
@@ -87,6 +91,7 @@
std::string SerializeToXML(SymbolDefinition* symbol, MdfModel::Version* version);
std::string SerializeToXML(PrintLayoutDefinition* printLayout, MdfModel::Version* version);
std::string SerializeToXML(PrintLayoutElementDefinition* printLayoutElem, MdfModel::Version* version);
+ std::string SerializeToXML(WatermarkDefinition* watermark, MdfModel::Version* version);
// Detaches the most recently parsed object from the parser.
// The calling method is then responsible for disposing the object,
@@ -102,6 +107,7 @@
PrintLayoutDefinition* DetachPrintLayoutDefinition();
PrintLayoutElementDefinition* DetachPrintLayoutElementDefinition();
MapViewportDefinition* DetachMapViewportDefinition();
+ WatermarkDefinition* DetachWatermarkDefinition();
// Creates a clone of the given map/layer/symbol/print layout/print layout element definition.
// The object is serialized and parsed into a new object, which is returned.
@@ -110,6 +116,7 @@
static SymbolDefinition* CreateClone(SymbolDefinition* symbol);
static PrintLayoutDefinition* CreateClone(PrintLayoutDefinition* printLayout);
static PrintLayoutElementDefinition* CreateClone(PrintLayoutElementDefinition* printLayoutElem);
+ static WatermarkDefinition* CreateClone(WatermarkDefinition* watermark);
// Success State
bool GetSucceeded() const;
@@ -128,7 +135,7 @@
const XMLCh* const qname);
// Occurs when characters in between XML tags are encountered.
- void characters(const XMLCh* const chars, const unsigned int length);
+ void characters(const XMLCh* const chars, const XMLSize_t length);
// Get error info
const MdfString& GetErrorMessage();
@@ -143,10 +150,12 @@
private:
// Helper methods to extract version info
+ void SetMapDefinitionVersion(const Attributes& attributes);
void SetLayerDefinitionVersion(const Attributes& attributes);
void SetSymbolDefinitionVersion(const Attributes& attributes);
void SetPrintLayoutDefinitionVersion(const Attributes& attributes);
void SetPrintLayoutElementDefinitionVersion(const Attributes& attributes);
+ void SetWatermarkDefinitionVersion(const Attributes& attributes);
protected:
// The objects to be generated by the parser.
@@ -158,6 +167,7 @@
CompoundSymbolDefinition* m_cSymbol;
PrintLayoutDefinition* m_printLayout;
MapViewportDefinition* m_mapViewport;
+ WatermarkDefinition* m_watermark;
// Succeeded is true if the parse has succeeded. As of now,
// there are very loose constraints on this boolean.
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Data/BlobProperty.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Data/BlobProperty.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Data/BlobProperty.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -132,13 +132,13 @@
str += "<Type>blob</Type>";
}
- str += "<Value>";
- if (m_value != NULL)
+ if (m_value != NULL || !this->IsNull())
{
+ str += "<Value>";
Ptr<MgByteReader> reader = this->GetValue();
str += MgUtil::GetStringFromReader(reader);
+ str += "</Value>";
}
- str += "</Value>";
str += "</" + rootElmName + ">";
}
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Data/BooleanProperty.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Data/BooleanProperty.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Data/BooleanProperty.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -118,15 +118,16 @@
str += "<Type>boolean</Type>";
}
- str += "<Value>";
+ if (!this->IsNull())
+ {
+ str += "<Value>";
+ if( this->GetValue())
+ str += "true" ;
+ else
+ str += "false" ;
+ str += "</Value>";
+ }
- if( this->GetValue())
- str += "true" ;
- else
- str += "false" ;
-
- str += "</Value>";
-
str += "</" + rootElmName + ">";
}
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Data/ByteProperty.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Data/ByteProperty.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Data/ByteProperty.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -124,10 +124,14 @@
{
str += "<Type>byte</Type>";
}
- str += "<Value>";
- str += MgUtil::Char2Hex(this->GetValue());
- str += "</Value>";
+ if (!this->IsNull())
+ {
+ str += "<Value>";
+ str += MgUtil::Char2Hex(this->GetValue());
+ str += "</Value>";
+ }
+
str += "</" + rootElmName + ">";
}
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Data/ClobProperty.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Data/ClobProperty.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Data/ClobProperty.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -131,13 +131,13 @@
str += "<Type>clob</Type>";
}
- str += "<Value>";
- if (m_value != NULL)
+ if (m_value != NULL || !this->IsNull())
{
+ str += "<Value>";
Ptr<MgByteReader> reader = this->GetValue();
str += MgUtil::GetStringFromReader(reader);
+ str += "</Value>";
}
- str += "</Value>";
str += "</" + rootElmName + ">";
}
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Data/DateTimeProperty.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Data/DateTimeProperty.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Data/DateTimeProperty.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -118,15 +118,18 @@
str += "<Type>datetime</Type>";
}
- str += "<Value>";
- char buf[128]; buf[0] = 0;
- Ptr<MgDateTime> dtPtr = this->GetValue();
- if (dtPtr != NULL)
+ if (!this->IsNull())
{
- STRING dateStr = dtPtr->ToString();
- str += MgUtil::WideCharToMultiByte(dateStr);
+ str += "<Value>";
+ char buf[128]; buf[0] = 0;
+ Ptr<MgDateTime> dtPtr = this->GetValue();
+ if (dtPtr != NULL)
+ {
+ STRING dateStr = dtPtr->ToString();
+ str += MgUtil::WideCharToMultiByte(dateStr);
+ }
+ str += "</Value>";
}
- str += "</Value>";
str += "</" + rootElmName + ">";
}
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Data/DoubleProperty.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Data/DoubleProperty.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Data/DoubleProperty.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -130,7 +130,12 @@
string doubleStr = "";
MgUtil::DoubleToString(m_value, doubleStr);
- str += "<Value>" + doubleStr + "</Value>";
+ if (!this->IsNull())
+ {
+ str += "<Value>";
+ str += doubleStr;
+ str += "</Value>";
+ }
str += "</" + rootElmName + ">";
}
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Data/Int16Property.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Data/Int16Property.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Data/Int16Property.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -122,17 +122,20 @@
str += "<Type>int16</Type>";
}
- str += "<Value>";
+ if (!this->IsNull())
+ {
+ str += "<Value>";
+ char buf[128]; buf[0] = 0;
+ #ifdef _WIN32
+ itoa(this->GetValue(), buf, 10);
+ #else
+ snprintf(buf, 128, "%d", this->GetValue());
+ #endif
- char buf[128]; buf[0] = 0;
- #ifdef _WIN32
- itoa(this->GetValue(), buf, 10);
- #else
- snprintf(buf, 128, "%d", this->GetValue());
- #endif
+ str += std::string(buf);
+ str += "</Value>";
+ }
- str += std::string(buf) + "</Value>";
-
str += "</" + rootElmName + ">";
}
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Data/Int32Property.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Data/Int32Property.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Data/Int32Property.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -121,17 +121,20 @@
str += "<Type>int32</Type>";
}
- str += "<Value>";
+ if (!this->IsNull())
+ {
+ str += "<Value>";
+ char buf[128]; buf[0] = 0;
+ #ifdef _WIN32
+ itoa(this->GetValue(), buf, 10);
+ #else
+ snprintf(buf, 128, "%li", this->GetValue());
+ #endif
- char buf[128]; buf[0] = 0;
- #ifdef _WIN32
- itoa(this->GetValue(), buf, 10);
- #else
- snprintf(buf, 128, "%li", this->GetValue());
- #endif
+ str += std::string(buf);
+ str += "</Value>";
+ }
- str += std::string(buf) + "</Value>";
-
str += "</" + rootElmName + ">";
}
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Data/Int64Property.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Data/Int64Property.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Data/Int64Property.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -112,13 +112,16 @@
str += "<Type>int64</Type>";
}
- str += "<Value>";
+ if (!this->IsNull())
+ {
+ str += "<Value>";
+ std::string tmp = "";
+ MgUtil::Int64ToString(this->GetValue(), tmp);
- std::string tmp = "";
- MgUtil::Int64ToString(this->GetValue(), tmp);
+ str += tmp;
+ str += "</Value>";
+ }
- str += tmp + "</Value>";
-
str += "</" + rootElmName + ">";
}
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Data/SingleProperty.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Data/SingleProperty.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Data/SingleProperty.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -125,7 +125,12 @@
string singleStr = "";
MgUtil::DoubleToString(m_value, singleStr);
- str += "<Value>" + singleStr + "</Value>";
+ if (!this->IsNull())
+ {
+ str += "<Value>";
+ str += singleStr;
+ str += "</Value>";
+ }
str += "</" + rootElmName + ">";
}
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Makefile.am 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Makefile.am 2010-11-13 18:14:35 UTC (rev 5390)
@@ -251,7 +251,7 @@
-I../Geometry \
-I../../Oem/ACE/ACE_wrappers \
-I../../Oem/geos-2.2.0/source/headers \
- -I../../Oem/dbxml-2.3.10/xerces-c-src/src
+ -I../../Oem/dbxml/xerces-c-src/src
libMgPlatformBase_la_LIBADD = \
-lACE \
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/MapLayer/MapBase.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/MapLayer/MapBase.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/MapLayer/MapBase.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -776,3 +776,55 @@
throw new MgNotImplementedException(L"MgMapBase.GetService",
__LINE__, __WFILE__, NULL, L"", NULL);
}
+
+//static method to create the map definition
+MdfModel::MapDefinition* MgMapBase::GetMapDefinition(MgResourceService* svcResource, MgResourceIdentifier* resId)
+{
+ // get and parse the map definition
+ Ptr<MgByteReader> reader = svcResource->GetResourceContent(resId, L"");
+ Ptr<MgByteSink> sink = new MgByteSink(reader);
+ Ptr<MgByte> bytes = sink->ToBuffer();
+
+ assert(bytes->GetLength() > 0);
+
+ MdfParser::SAX2Parser parser;
+ parser.ParseString((const char*)bytes->Bytes(), bytes->GetLength());
+
+ if (!parser.GetSucceeded())
+ {
+ STRING errorMsg = parser.GetErrorMessage();
+ MgStringCollection arguments;
+ arguments.Add(errorMsg);
+ throw new MgInvalidMapDefinitionException(L"MgMapBase::GetMapDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
+ }
+
+ // detach the map definition from the parser - it's
+ // now the caller's responsibility to delete it
+ MdfModel::MapDefinition* mdef = parser.DetachMapDefinition();
+ assert(mdef != NULL);
+
+ return mdef;
+}
+
+//static method to create the map definition
+MdfModel::MapDefinition* MgMapBase::GetMapDefinition(CREFSTRING resourceContent)
+{
+ // get and parse the map definition
+ MdfParser::SAX2Parser parser;
+ parser.ParseString(resourceContent.c_str(), resourceContent.length());
+
+ if (!parser.GetSucceeded())
+ {
+ STRING errorMsg = parser.GetErrorMessage();
+ MgStringCollection arguments;
+ arguments.Add(errorMsg);
+ throw new MgInvalidMapDefinitionException(L"MgMapBase::GetMapDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
+ }
+
+ // detach the map definition from the parser - it's
+ // now the caller's responsibility to delete it
+ MdfModel::MapDefinition* mdef = parser.DetachMapDefinition();
+ assert(mdef != NULL);
+
+ return mdef;
+}
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/MapLayer/MapBase.h
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/MapLayer/MapBase.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/MapLayer/MapBase.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -36,6 +36,10 @@
#include "ReadOnlyLayerCollection.h"
#include "SelectionBase.h"
+BEGIN_NAMESPACE_MDFMODEL
+class MapDefinition;
+END_NAMESPACE_MDFMODEL
+
class MgPoint;
class MgMapBase;
template class MG_PLATFORMBASE_API Ptr<MgMapBase>;
@@ -549,6 +553,9 @@
INTERNAL_API:
+ static MdfModel::MapDefinition* GetMapDefinition(MgResourceService* svcResource, MgResourceIdentifier* resId);
+ static MdfModel::MapDefinition* GetMapDefinition(CREFSTRING resourceContent);
+
//////////////////////////////////////////////////////////////////
/// \brief
/// Serialize data to a TCP/IP stream.
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -68,11 +68,8 @@
}
m_selections.clear();
- if (m_stream != NULL)
- {
- delete m_stream;
- m_stream = NULL;
- }
+ delete m_stream;
+ m_stream = NULL;
}
@@ -542,7 +539,7 @@
{
m_stream->FromBase64(*sIter);
- selText = L"(";
+ selText = L"(";
bool bFirstProp = true;
MgLayerBase::IdPropertyList::iterator idIter;
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBase.h
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBase.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBase.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -62,6 +62,7 @@
#include "Exception/FeatureServiceException.h"
#include "Exception/InvalidLayerDefinitionException.h"
#include "Exception/InvalidMapDefinitionException.h"
+#include "Exception/InvalidWatermarkDefinitionException.h"
#include "Exception/InvalidRepositoryNameException.h"
#include "Exception/InvalidRepositoryTypeException.h"
#include "Exception/InvalidResourceDataNameException.h"
@@ -162,5 +163,6 @@
#include "MapLayer/MapCollection.h"
#include "MapLayer/ReadOnlyLayerCollection.h"
#include "MapLayer/SelectionBase.h"
+#include "MapLayer/Watermark.h"
#endif
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBase.rc
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBase.rc 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBase.rc 2010-11-13 18:14:35 UTC (rev 5390)
@@ -6,7 +6,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
+#include "winresrc.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
1 TEXTINCLUDE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#include ""winresrc.h""\r\n"
"\0"
END
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBase.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBase.vcproj 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBase.vcproj 2010-11-13 18:14:35 UTC (rev 5390)
@@ -44,7 +44,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\MdfModel;..\MdfParser;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;"..\..\Oem\dbxml-2.3.10\xerces-c-src\src""
+ AdditionalIncludeDirectories="..\MdfModel;..\MdfParser;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;"..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PLATFORMBASE_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -121,7 +121,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\MdfModel;..\MdfParser;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;"..\..\Oem\dbxml-2.3.10\xerces-c-src\src""
+ AdditionalIncludeDirectories="..\MdfModel;..\MdfParser;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;"..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PLATFORMBASE_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -196,7 +196,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- AdditionalIncludeDirectories="..\MdfModel;..\MdfParser;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;"..\..\Oem\dbxml-2.3.10\xerces-c-src\src""
+ AdditionalIncludeDirectories="..\MdfModel;..\MdfParser;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;"..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLATFORMBASE_EXPORTS"
RuntimeLibrary="2"
WarningLevel="3"
@@ -273,7 +273,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- AdditionalIncludeDirectories="..\MdfModel;..\MdfParser;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;"..\..\Oem\dbxml-2.3.10\xerces-c-src\src""
+ AdditionalIncludeDirectories="..\MdfModel;..\MdfParser;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;"..\..\Oem\dbxml\xerces-c-src\src""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLATFORMBASE_EXPORTS"
RuntimeLibrary="2"
WarningLevel="3"
@@ -1775,6 +1775,46 @@
>
</File>
<File
+ RelativePath=".\Exception\InvalidWatermarkDefinitionException.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\Exception\InvalidWatermarkDefinitionException.h"
+ >
+ </File>
+ <File
RelativePath=".\Exception\LayerNotFoundException.cpp"
>
<FileConfiguration
@@ -4770,6 +4810,46 @@
RelativePath=".\MapLayer\SelectionBase.h"
>
</File>
+ <File
+ RelativePath=".\MapLayer\Watermark.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\MapLayer\Watermark.h"
+ >
+ </File>
</Filter>
<File
RelativePath=".\PlatformBase.h"
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBaseBuild.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBaseBuild.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/PlatformBaseBuild.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -42,6 +42,7 @@
#include "Exception/FeatureServiceException.cpp"
#include "Exception/InvalidMapDefinitionException.cpp"
#include "Exception/InvalidLayerDefinitionException.cpp"
+#include "Exception/InvalidWatermarkDefinitionException.cpp"
#include "Exception/InvalidRepositoryNameException.cpp"
#include "Exception/InvalidRepositoryTypeException.cpp"
#include "Exception/InvalidResourceDataNameException.cpp"
@@ -68,6 +69,7 @@
#include "MapLayer/ObjectChange.cpp"
#include "MapLayer/ReadOnlyLayerCollection.cpp"
#include "MapLayer/SelectionBase.cpp"
+#include "MapLayer/Watermark.cpp"
#include "Services/BaseServiceDefs.cpp"
#include "Services/ClassDefinition.cpp"
#include "Services/ClassDefinitionCollection.cpp"
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureAggregateOptions.h
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureAggregateOptions.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureAggregateOptions.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -194,9 +194,16 @@
virtual void Serialize(MgStream* stream);
virtual void Deserialize(MgStream* stream);
- virtual INT32 GetClassId() { return m_cls_id; }
- virtual void Dispose() { delete this; }
+ virtual INT32 GetClassId()
+ {
+ return m_cls_id;
+ }
+ virtual void Dispose()
+ {
+ delete this;
+ }
+
private:
bool m_selectDistinct; // Apply Distinct operator
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureProperty.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureProperty.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureProperty.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -114,23 +114,26 @@
{
str += "<Type>feature</Type>";
}
- str += "<Value>";
- std::string featureXml;
+ if (!this->IsNull())
+ {
+ str += "<Value>";
+ std::string featureXml;
- Ptr<MgByteReader> reader = m_value->ToXml();
- MgByteSink sink(reader);
- sink.ToStringUtf8(featureXml);
+ Ptr<MgByteReader> reader = m_value->ToXml();
+ MgByteSink sink(reader);
+ sink.ToStringUtf8(featureXml);
- size_t idx = featureXml.find("?>");
- if (idx >= 0)
- {
- featureXml = featureXml.substr(idx+2);
+ size_t idx = featureXml.find("?>");
+ if (idx >= 0)
+ {
+ featureXml = featureXml.substr(idx+2);
+ }
+
+ str += featureXml;
+ str += "</Value>";
}
- str += featureXml;
- str += "</Value>";
-
str += "</" + rootElmName + ">";
}
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureQueryOptions.h
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureQueryOptions.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureQueryOptions.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -455,33 +455,6 @@
///
void RemoveComputedProperty(CREFSTRING aliasName);
-INTERNAL_API:
-
- virtual ~MgFeatureQueryOptions();
-
- MgStringCollection* GetClassProperties();
- MgStringPropertyCollection* GetComputedProperties();
- MgStringCollection* GetOrderingProperties();
-
- STRING GetFilter();
- bool GetBinaryOperator();
-
- STRING GetGeometryProperty();
- MgGeometry* GetGeometry();
-
- INT32 GetOrderOption();
- INT32 GetSpatialOperation();
- INT32 GetFetchSize();
-
- virtual void Serialize(MgStream* stream);
- virtual void Deserialize(MgStream* stream);
- STRING GetLogString();
-
- virtual INT32 GetClassId() { return m_cls_id; }
- virtual void Dispose() { delete this; }
-
- void ValidateEmptyArgument(CREFSTRING value);
-
//////////////////////////////////////////////////////////////////////////////
/// \brief
/// For queries that return a large number of objects
@@ -512,6 +485,40 @@
///
void SetFetchSize(INT32 fetchSize);
+INTERNAL_API:
+
+ virtual ~MgFeatureQueryOptions();
+
+ MgStringCollection* GetClassProperties();
+ MgStringPropertyCollection* GetComputedProperties();
+ MgStringCollection* GetOrderingProperties();
+
+ STRING GetFilter();
+ bool GetBinaryOperator();
+
+ STRING GetGeometryProperty();
+ MgGeometry* GetGeometry();
+
+ INT32 GetOrderOption();
+ INT32 GetSpatialOperation();
+ INT32 GetFetchSize();
+
+ virtual void Serialize(MgStream* stream);
+ virtual void Deserialize(MgStream* stream);
+ STRING GetLogString();
+
+ virtual INT32 GetClassId()
+ {
+ return m_cls_id;
+ }
+
+ virtual void Dispose()
+ {
+ delete this;
+ }
+
+ void ValidateEmptyArgument(CREFSTRING value);
+
private:
STRING m_filterText; // Where Clause
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureService.h
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureService.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Services/FeatureService.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -203,9 +203,9 @@
/// \exception MgInvalidArgumentException
/// \exception MgFdoException
///
- virtual MgStringCollection* GetConnectionPropertyValues( CREFSTRING providerName,
- CREFSTRING propertyName,
- CREFSTRING partialConnString ) = 0;
+ virtual MgStringCollection* GetConnectionPropertyValues(CREFSTRING providerName,
+ CREFSTRING propertyName,
+ CREFSTRING partialConnString) = 0;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -349,6 +349,46 @@
/////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
+ /// Gets the capabilities of an FDO Provider expressed in XML
+ /// according to the \link FdoProviderCapabilities_schema FdoProviderCapabilities \endlink schema.
+ ///
+ /// \remarks
+ /// MgFeatureService derives most of its capabilities from the
+ /// FDO Provider to which it is connected. Capabilities vary
+ /// among providers. For example, the FDO Provider for ArcSDE
+ /// supports all of the spatial operators, and the FDO Provider
+ /// for Oracle supports only a subset. For a fuller discussion,
+ /// see \link ProviderCapabilities Provider Capabilities \endlink.
+ ///
+ /// <!-- Syntax in .Net, Java, and PHP -->
+ /// \htmlinclude DotNetSyntaxTop.html
+ /// virtual MgByteReader GetCapabilities(string providerName);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude JavaSyntaxTop.html
+ /// virtual MgByteReader GetCapabilities(String providerName);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude PHPSyntaxTop.html
+ /// virtual MgByteReader GetCapabilities(string providerName);
+ /// \htmlinclude SyntaxBottom.html
+ ///
+ /// \param providerName (String/string)
+ /// The name of the FDO provider. Get the exact
+ /// form of the name from
+ /// MgFeatureService::GetFeatureProviders.
+ /// \param connectionString (String/string)
+ /// The connection string to use.
+ ///
+ /// \return
+ /// Returns an MgByteReader containing the capabilities in XML
+ /// format (or NULL).
+ ///
+ /// \exception MgInvalidArgumentException
+ /// \exception MgFdoException
+ ///
+ virtual MgByteReader* GetCapabilities(CREFSTRING providerName, CREFSTRING connectionString) = 0;
+
+ /////////////////////////////////////////////////////////////////////////////////////////////
+ /// \brief
/// Creates or updates a feature schema within the specified feature source.
///
/// <!-- Syntax in .Net, Java, and PHP -->
@@ -421,7 +461,8 @@
/// schema and classes.
///
virtual MgFeatureSchemaCollection* DescribeSchema(MgResourceIdentifier* resource,
- CREFSTRING schemaName, MgStringCollection* classNames) = 0;
+ CREFSTRING schemaName,
+ MgStringCollection* classNames) = 0;
///////////////////////////////////////////////////////////////////////////
/// \brief
@@ -465,7 +506,7 @@
/// schema and classes.
///
virtual MgFeatureSchemaCollection* DescribeSchema(MgResourceIdentifier* resource,
- CREFSTRING schemaName) = 0;
+ CREFSTRING schemaName) = 0;
///////////////////////////////////////////////////////////////////////////
/// \brief
@@ -516,7 +557,8 @@
/// \exception MgFdoException
///
virtual STRING DescribeSchemaAsXml(MgResourceIdentifier* resource,
- CREFSTRING schemaName, MgStringCollection* classNames) = 0;
+ CREFSTRING schemaName,
+ MgStringCollection* classNames) = 0;
///////////////////////////////////////////////////////////////////////////
/// \brief
@@ -559,7 +601,7 @@
/// \exception MgFdoException
///
virtual STRING DescribeSchemaAsXml(MgResourceIdentifier* resource,
- CREFSTRING schemaName) = 0;
+ CREFSTRING schemaName) = 0;
////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -675,9 +717,9 @@
/// \exception MgInvalidArgumentException
/// \exception MgFdoException
///
- virtual MgFeatureReader* SelectFeatures( MgResourceIdentifier* resource,
- CREFSTRING className,
- MgFeatureQueryOptions* options ) = 0;
+ virtual MgFeatureReader* SelectFeatures(MgResourceIdentifier* resource,
+ CREFSTRING className,
+ MgFeatureQueryOptions* options) = 0;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -725,10 +767,10 @@
/// \exception MgInvalidArgumentException
/// \exception MgFdoException
///
- virtual MgFeatureReader* SelectFeatures( MgResourceIdentifier* resource,
- CREFSTRING className,
- MgFeatureQueryOptions* options,
- CREFSTRING coordinateSystem ) = 0;
+ virtual MgFeatureReader* SelectFeatures(MgResourceIdentifier* resource,
+ CREFSTRING className,
+ MgFeatureQueryOptions* options,
+ CREFSTRING coordinateSystem) = 0;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -771,9 +813,9 @@
/// \exception MgInvalidArgumentException
/// \exception MgFdoException
///
- virtual MgDataReader* SelectAggregate( MgResourceIdentifier* resource,
- CREFSTRING className,
- MgFeatureAggregateOptions* options ) = 0;
+ virtual MgDataReader* SelectAggregate(MgResourceIdentifier* resource,
+ CREFSTRING className,
+ MgFeatureAggregateOptions* options) = 0;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -838,9 +880,9 @@
/// \exception MgInvalidOperationException
/// \exception MgFdoException
///
- virtual MgPropertyCollection* UpdateFeatures( MgResourceIdentifier* resource,
- MgFeatureCommandCollection* commands,
- bool useTransaction ) = 0;
+ virtual MgPropertyCollection* UpdateFeatures(MgResourceIdentifier* resource,
+ MgFeatureCommandCollection* commands,
+ bool useTransaction) = 0;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -911,9 +953,9 @@
/// \exception MgInvalidOperationException
/// \exception MgFdoException
///
- virtual MgPropertyCollection* UpdateFeatures( MgResourceIdentifier* resource,
- MgFeatureCommandCollection* commands,
- MgTransaction* transaction ) = 0;
+ virtual MgPropertyCollection* UpdateFeatures(MgResourceIdentifier* resource,
+ MgFeatureCommandCollection* commands,
+ MgTransaction* transaction) = 0;
////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -950,9 +992,9 @@
/// \exception MgInvalidArgumentException
/// \exception ...
///
- virtual MgFeatureReader* GetLockedFeatures( MgResourceIdentifier* resource,
- CREFSTRING className,
- MgFeatureQueryOptions* options ) = 0;
+ virtual MgFeatureReader* GetLockedFeatures(MgResourceIdentifier* resource,
+ CREFSTRING className,
+ MgFeatureQueryOptions* options) = 0;
////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -983,7 +1025,7 @@
/// \exception MgInvalidOperationException
/// \exception MgFdoException
///
- virtual MgTransaction* BeginTransaction( MgResourceIdentifier* resource ) = 0;
+ virtual MgTransaction* BeginTransaction(MgResourceIdentifier* resource) = 0;
////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -1031,8 +1073,8 @@
/// \exception MgInvalidOperationException
/// \exception MgFdoException
///
- virtual MgSqlDataReader* ExecuteSqlQuery( MgResourceIdentifier* resource,
- CREFSTRING sqlStatement ) = 0;
+ virtual MgSqlDataReader* ExecuteSqlQuery(MgResourceIdentifier* resource,
+ CREFSTRING sqlStatement) = 0;
////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -1091,10 +1133,10 @@
/// \exception MgInvalidOperationException
/// \exception MgFdoException
///
- virtual MgSqlDataReader* ExecuteSqlQuery( MgResourceIdentifier* resource,
- CREFSTRING sqlStatement,
- MgParameterCollection* parameters,
- MgTransaction* transaction ) = 0;
+ virtual MgSqlDataReader* ExecuteSqlQuery(MgResourceIdentifier* resource,
+ CREFSTRING sqlStatement,
+ MgParameterCollection* parameters,
+ MgTransaction* transaction) = 0;
////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -1139,8 +1181,8 @@
/// \exception MgInvalidOperationException
/// \exception MgFdoException
///
- virtual INT32 ExecuteSqlNonQuery( MgResourceIdentifier* resource,
- CREFSTRING sqlNonSelectStatement ) = 0;
+ virtual INT32 ExecuteSqlNonQuery(MgResourceIdentifier* resource,
+ CREFSTRING sqlNonSelectStatement) = 0;
////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -1197,10 +1239,10 @@
/// \exception MgInvalidOperationException
/// \exception MgFdoException
///
- virtual INT32 ExecuteSqlNonQuery( MgResourceIdentifier* resource,
- CREFSTRING sqlNonSelectStatement,
- MgParameterCollection* parameters,
- MgTransaction* transaction ) = 0;
+ virtual INT32 ExecuteSqlNonQuery(MgResourceIdentifier* resource,
+ CREFSTRING sqlNonSelectStatement,
+ MgParameterCollection* parameters,
+ MgTransaction* transaction) = 0;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -1237,8 +1279,8 @@
/// \exception MgInvalidOperationException
/// \exception MgFdoException
///
- virtual MgSpatialContextReader* GetSpatialContexts( MgResourceIdentifier* resource,
- bool bActiveOnly) = 0;
+ virtual MgSpatialContextReader* GetSpatialContexts(MgResourceIdentifier* resource,
+ bool bActiveOnly) = 0;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -1275,8 +1317,8 @@
/// \exception MgInvalidOperationException
/// \exception MgFdoException
///
- virtual MgLongTransactionReader* GetLongTransactions( MgResourceIdentifier* resource,
- bool bActiveOnly) = 0;
+ virtual MgLongTransactionReader* GetLongTransactions(MgResourceIdentifier* resource,
+ bool bActiveOnly) = 0;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -1312,8 +1354,8 @@
/// \exception MgInvalidResourceTypeException
/// \exception MgSessionNotFoundException
///
- virtual bool SetLongTransaction( MgResourceIdentifier* featureSourceId,
- CREFSTRING longTransactionName) = 0;
+ virtual bool SetLongTransaction(MgResourceIdentifier* featureSourceId,
+ CREFSTRING longTransactionName) = 0;
/////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -1343,7 +1385,7 @@
/// \exception MgInvalidArgumentException
/// \exception MgFdoException
///
- virtual MgStringCollection* GetSchemas( MgResourceIdentifier* resource ) = 0;
+ virtual MgStringCollection* GetSchemas(MgResourceIdentifier* resource) = 0;
/////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -1376,7 +1418,7 @@
/// \exception MgInvalidArgumentException
/// \exception MgFdoException
///
- virtual MgStringCollection* GetClasses( MgResourceIdentifier* resource, CREFSTRING schemaName ) = 0;
+ virtual MgStringCollection* GetClasses(MgResourceIdentifier* resource, CREFSTRING schemaName) = 0;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -1409,9 +1451,9 @@
/// \exception MgInvalidArgumentException
/// \exception MgFdoException
///
- virtual MgClassDefinition* GetClassDefinition( MgResourceIdentifier* resource,
- CREFSTRING schemaName,
- CREFSTRING className) = 0;
+ virtual MgClassDefinition* GetClassDefinition(MgResourceIdentifier* resource,
+ CREFSTRING schemaName,
+ CREFSTRING className) = 0;
////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
@@ -1484,10 +1526,49 @@
/// \return
/// Returns an MgByteReader containing the XML schema.
///
- virtual MgByteReader* DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId, MgStringCollection* featureClasses) = 0;
+ virtual MgByteReader* DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId,
+ MgStringCollection* featureClasses) = 0;
////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
+ /// Retrieves schema informationabout a set of feature classes for a given feature source with specified format.
+ ///
+ /// \note1
+ ///
+ /// <!-- Syntax in .Net, Java, and PHP -->
+ /// \htmlinclude DotNetSyntaxTop.html
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string outputFormat);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude JavaSyntaxTop.html
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string outputFormat);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude PHPSyntaxTop.html
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasse, string outputFormats);
+ /// \htmlinclude SyntaxBottom.html
+ ///
+ /// \param featureSourceId (MgResourceIdentifier)
+ /// The resource identifier defining the
+ /// location of the feature source in
+ /// the repository.
+ /// \param featureClasses (MgStringCollection)
+ /// A collection of strings identifying the feature classes for which to
+ /// retrieve schema information. If this collection is null or empty, information
+ /// is returned for all feature classes.
+ /// \param outputFormat (String/string)
+ /// A string identifying the output format of
+ /// the retrieved schema information.
+ /// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 8.2
+ /// http://portal.opengeospatial.org/files/?artifact_id=8339
+ ///
+ /// \return
+ /// Returns an MgByteReader containing the XML schema.
+ ///
+ virtual MgByteReader* DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId,
+ MgStringCollection* featureClasses,
+ CREFSTRING outputFormat) = 0;
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////
+ /// \brief
/// Retrieves feature information based on the supplied criteria.
///
/// \note1
@@ -1523,9 +1604,77 @@
/// \return
/// Returns an MgByteReader containing the requested feature information.
///
- virtual MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId, CREFSTRING featureClass,
- MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures) = 0;
+ virtual MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId,
+ CREFSTRING featureClass,
+ MgStringCollection* requiredProperties,
+ CREFSTRING srs,
+ CREFSTRING filter,
+ INT32 maxFeatures) = 0;
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Retrieves feature information based on the supplied criteria with specified format.
+ ///
+ /// \note1
+ ///
+ /// <!-- Syntax in .Net, Java, and PHP -->
+ /// \htmlinclude DotNetSyntaxTop.html
+ /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat, string sortCriteria, string namespacePrefix, string namespaceUrl);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude JavaSyntaxTop.html
+ /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat, string sortCriteria, string namespacePrefix, string namespaceUrl);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude PHPSyntaxTop.html
+ /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat, string sortCriteria, string namespacePrefix, string namespaceUrl);
+ /// \htmlinclude SyntaxBottom.html
+ ///
+ /// \param featureSourceId (MgResourceIdentifier)
+ /// The resource identifier defining the
+ /// location of the feature source in
+ /// the repository.
+ /// \param featureClass (String/string)
+ /// The feature class containing the features to retrieve.
+ /// \param requiredProperties (MgStringCollection)
+ /// The collection of properties to retrieve for each feature. If the
+ /// collection is null or empty, all properties will be retrieved.
+ /// \param srs (String/string)
+ /// The spatial reference system in which to return feature geometries
+ /// \param filter (String/string)
+ /// An XML string containing the definition for an OGC filter
+ /// \param maxFeatures (int)
+ /// The maximum number of features to retrieve. If the value is less
+ /// than or equal to zero, all features will be retrieved.
+ /// \param wfsVersion (String/string)
+ /// A string identifying the wfs version
+ /// \param outputFormat (String/string)
+ /// A string identifying the output format of
+ /// the retrieved feature information.
+ /// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 9.2
+ /// http://portal.opengeospatial.org/files/?artifact_id=8339
+ /// \param sortCriteria (String/string)
+ /// A string identifying the sort criteria
+ /// \param namespacePrefix (String/string)
+ /// A string identifying the namespace prefix in the output xml
+ /// \param namespaceUrl (String/string)
+ /// A string idenyifying the namespace url in the output xml
+ ///
+ /// \return
+ /// Returns an MgByteReader containing the requested feature information.
+ ///
+ /// \exception MgInvalidArgumentException
+ ///
+ virtual MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId,
+ CREFSTRING featureClass,
+ MgStringCollection* requiredProperties,
+ CREFSTRING srs,
+ CREFSTRING filter,
+ INT32 maxFeatures,
+ CREFSTRING wfsVersion,
+ CREFSTRING outputFormat,
+ CREFSTRING sortCriteria,
+ CREFSTRING namespacePrefix,
+ CREFSTRING namespaceUrl) = 0;
+
////////////////////////////////////////////////////////////////////////////////
/// \brief
/// This method enumerates all the providers and if they are FDO enabled for
@@ -1596,10 +1745,10 @@
virtual STRING GetFdoCacheInfo() = 0;
- virtual MgClassDefinition* GetClassDefinition( MgResourceIdentifier* resource,
- CREFSTRING schemaName,
- CREFSTRING className,
- bool serialize) = 0;
+ virtual MgClassDefinition* GetClassDefinition(MgResourceIdentifier* resource,
+ CREFSTRING schemaName,
+ CREFSTRING className,
+ bool serialize) = 0;
// Commit the transaction specified by the transaction id.
virtual bool CommitTransaction(CREFSTRING transactionId) = 0;
@@ -1672,11 +1821,11 @@
/// \exception MgInvalidOperationException
/// \exception MgFdoException
///
- virtual MgSqlDataReader* ExecuteSqlQuery( MgResourceIdentifier* resource,
- CREFSTRING sqlStatement,
- MgParameterCollection* parameters,
- MgTransaction* transaction,
- INT32 fetchSize ) = 0;
+ virtual MgSqlDataReader* ExecuteSqlQuery(MgResourceIdentifier* resource,
+ CREFSTRING sqlStatement,
+ MgParameterCollection* parameters,
+ MgTransaction* transaction,
+ INT32 fetchSize) = 0;
protected:
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Services/GeometryProperty.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Services/GeometryProperty.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Services/GeometryProperty.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -99,7 +99,10 @@
/// <summary>
/// Self destructing method
/// </summary>
- void MgGeometryProperty::Dispose() { delete this; }
+ void MgGeometryProperty::Dispose()
+ {
+ delete this;
+ }
/////////////////////////////////////////////////////////////////
/// <summary>
@@ -118,31 +121,43 @@
{
str += "<Type>geometry</Type>";
}
- str += "<Value>";
- Ptr<MgByteReader> byteReader = this->GetValue();
-
- if (byteReader != NULL)
+ if (!this->IsNull())
{
- MgAgfReaderWriter agfReader;
- Ptr<MgGeometry> geom = agfReader.Read(byteReader);
+ string valueXml = "";
+ try
+ {
+ valueXml += "<Value>";
+ Ptr<MgByteReader> byteReader = this->GetValue();
- // geom->ToXml(str); // TODO: we need this method
- STRING awktStr = L"";
- if (geom != NULL)
- {
- awktStr = geom->ToAwkt(false);
- assert(!awktStr.empty());
+ if (byteReader != NULL)
+ {
+ MgAgfReaderWriter agfReader;
+ Ptr<MgGeometry> geom = agfReader.Read(byteReader);
+
+ // geom->ToXml(str); // TODO: we need this method
+ STRING awktStr = L"";
+ if (geom != NULL)
+ {
+ awktStr = geom->ToAwkt(false);
+ assert(!awktStr.empty());
+ }
+
+ if (!awktStr.empty())
+ {
+ valueXml += MgUtil::WideCharToMultiByte(awktStr);
+ }
+ }
+ valueXml += "</Value>";
}
-
- if (!awktStr.empty())
+ catch(MgException* ex) //Can happen if the geometry is invalid
{
- str += MgUtil::WideCharToMultiByte(awktStr);
+ SAFE_RELEASE(ex);
+ valueXml = ""; //Treat an invalid geometry as a NULL geometry
}
+ str += valueXml;
}
- str += "</Value>";
-
str += "</" + rootElmName + ">";
}
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Services/PlatformBaseClassId.h
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Services/PlatformBaseClassId.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Services/PlatformBaseClassId.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -79,6 +79,7 @@
#define PlatformBase_Exception_MgServiceNotAvailableException PLATFORMBASE_EXCEPTION_ID+21
#define PlatformBase_Exception_MgServiceNotSupportedException PLATFORMBASE_EXCEPTION_ID+22
#define PlatformBase_Exception_MgUserNotFoundException PLATFORMBASE_EXCEPTION_ID+23
+#define PlatformBase_Exception_MgInvalidWatermarkDefinitionException PLATFORMBASE_EXCEPTION_ID+24
// MapLayer API
#define PlatformBase_MapLayer_MapBase PLATFORMBASE_MAPLAYER_ID+0
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Services/RasterProperty.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Services/RasterProperty.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Services/RasterProperty.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -126,9 +126,14 @@
{
str += "<Type>raster</Type>";
}
- str += "<Value>";
-// Ptr<MgByteReader> reader = this->GetValue();
- str += /* MgUtil::GetStringFromReader(reader) +*/ "</Value></Property>";
+
+ if (!this->IsNull())
+ {
+ str += "<Value>";
+ // Ptr<MgByteReader> reader = this->GetValue();
+ str += /* MgUtil::GetStringFromReader(reader) +*/ "</Value>";
+ }
+ str += "</Property>";
}
//////////////////////////////////////////////////////////////////
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Services/ResourceDefs.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Services/ResourceDefs.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Services/ResourceDefs.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -53,6 +53,7 @@
const STRING MgResourceType::ApplicationDefinition = L"ApplicationDefinition";
const STRING MgResourceType::PrintLayoutDefinition = L"PrintLayoutDefinition";
const STRING MgResourceType::PrintLayoutElementDefinition = L"PrintLayoutElementDefinition";
+const STRING MgResourceType::WatermarkDefinition = L"WatermarkDefinition";
const STRING MgResourceType::User = L"User";
Modified: sandbox/rfc90/MgDev/Common/PlatformBase/Services/ResourceDefs.h
===================================================================
--- sandbox/rfc90/MgDev/Common/PlatformBase/Services/ResourceDefs.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/PlatformBase/Services/ResourceDefs.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -282,7 +282,18 @@
///
static const STRING PrintLayoutElementDefinition; ///\if INTERNAL value("PrintLayoutElementDefinition") \endif
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// This resource is a watermark definition.
+ ///
+ /// \remarks
+ /// It represents the watermark rendered in a map.
+ ///
+ /// \see \ref WatermarkDefinition_schema "WatermarkDefinition schema"
+ ///
+ static const STRING WatermarkDefinition; ///\if INTERNAL value("WatermarkDefinition") \endif
+
INTERNAL_API:
static const STRING User; /// User definition
static const STRING Group; /// Group definition
Modified: sandbox/rfc90/MgDev/Common/Renderers/AGGImageIO.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/AGGImageIO.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/AGGImageIO.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -968,25 +968,15 @@
//NOTE: We do not use gd for reading or writing PNG since internally gd drops a bit
//from the alpha channel, which is not desirable for high quality output
- //if (format == L"META") // return bitmap only if rendering metatiles
- //{
- // return new RS_ByteData((unsigned char*) src, src_width * src_height * 4); // 32 bit pixels
- //}
- //else
if (format == L"PNG")
{
png_write_context cxt;
memset(&cxt, 0, sizeof(cxt));
write_png(&cxt, src, dst_width, dst_height, gamma, drop_alpha);
- if (cxt.used > 0)
- {
- std::auto_ptr<RS_ByteData> byteData;
- byteData.reset(new RS_ByteData(cxt.buf, (unsigned int)cxt.used));
- delete [] cxt.buf;
- return byteData.release();
- } else
- return NULL;
+ RS_ByteData* byteData = (cxt.used > 0)? new RS_ByteData(cxt.buf, (unsigned int)cxt.used) : NULL;
+ delete [] cxt.buf;
+ return byteData;
}
else if (format == L"JPG" || format == L"GIF" || format == L"PNG8")
{
@@ -1063,9 +1053,7 @@
int size = 0;
unsigned char* data = NULL;
- if (format == L"META") // meta tiling.... keep the raster for now
- data = (unsigned char*)gdImgPalette;
- else if (format == L"GIF") // MgImageFormats::Gif
+ if (format == L"GIF") // MgImageFormats::Gif
data = (unsigned char*)gdImageGifPtr(gdImgPalette, &size);
else if (format == L"PNG8") // MgImageFormats::Png8
data = (unsigned char*)gdImagePngPtr(gdImgPalette, &size);
@@ -1082,7 +1070,8 @@
else //if we allocated a temporary image to stretch-blit, destroy it
gdImageDestroy(gdimg24);
//if we allocated a paletted image, destroy it (very likely that is)
- gdImageDestroy(gdImgPalette);
+ if(NULL != gdImgPalette)
+ gdImageDestroy(gdImgPalette);
return byteData.release();
}
Modified: sandbox/rfc90/MgDev/Common/Renderers/AGGImageIO.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/AGGImageIO.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/AGGImageIO.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -15,6 +15,9 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
+#ifndef AGGIMAGEIO_H
+#define AGGIMAGEIO_H
+
class RS_ByteData;
class AGGImageIO
@@ -41,3 +44,5 @@
static unsigned char* ReadFile(const RS_String& fname, size_t& len);
static void UnmultiplyAlpha(unsigned int* argb, int len);
};
+
+#endif //AGGIMAGEIO_H
Modified: sandbox/rfc90/MgDev/Common/Renderers/AGGRenderer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/AGGRenderer.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/AGGRenderer.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -16,7 +16,7 @@
//
#include "stdafx.h"
-#include "assert.h"
+
#include "AGGRenderer.h"
#include "LineStyle.h"
#include "SLDSymbols.h"
@@ -62,6 +62,23 @@
#include "DWFRSInputStream.h"
#include "RSDWFInputStream.h"
+#include "RenderUtil.h"
+#define MgImageFormats_Meta L"META"
+//// try to include directly
+//#define MAPGUIDECOMMON_EXPORTS
+//#ifdef _WIN32
+//#ifdef MAPGUIDECOMMON_EXPORTS
+//# define MG_MAPGUIDE_API __declspec(dllexport)
+//#else
+//# define MG_MAPGUIDE_API __declspec(dllimport)
+//#endif
+//#else
+//#define MG_MAPGUIDE_API
+//#endif
+//#define PUBLISHED_API public
+//typedef wstring STRING;
+//#include "Services/ImageFormats.h"
+
using namespace DWFToolkit;
using namespace DWFCore;
@@ -256,15 +273,11 @@
RS_ByteData* AGGRenderer::Save(const RS_String& format, int width, int height,
RS_ColorVector* baseColorPalette, unsigned int* imagebuffer)
{
- if (format == L"META")
+ if (format == MgImageFormats_Meta)
{
- assert (imagebuffer == NULL); // this musnt happen
+ if (imagebuffer == NULL) // this musnt happen
+ return NULL;
int imagebufferByteSize = width*height*4; // multiply 32 bit pixel by 4 bytes
- // m_bownbuffer = false; // take ownership of rendered imagebuffer for to create subtiles later
- //auto_ptr<RS_ByteData> retVal;
- //retVal.reset(new RS_ByteData((unsigned char*) m_rows, imagebufferByteSize));
- //return retVal.release();
- // the RS_ByteData CTOR memcopies the source
return new RS_ByteData((unsigned char*) m_rows, imagebufferByteSize);
} else {
if (imagebuffer) // use imagebuffer from previous meta tiling pass
@@ -274,17 +287,7 @@
}
}
-/*
-//////////////////////////////////////////////////////////////////////////////
-// Return the rendered image passed in via the imagebuffer (m_rows) as
-// a bytestream in the given image format using the provided colorPalette
-// if given.
-RS_ByteData* AGGRenderer::Save(const RS_String& format, int width, int height)
-{
- return AGGImageIO::Save(format, m_rows, m_width, m_height, width, height, m_bgcolor, baseColorPalette);
-}
-*/
//////////////////////////////////////////////////////////////////////////////
void AGGRenderer::Combine(const RS_String& fileIn1, const RS_String& fileIn2, const RS_String& fileOut)
{
@@ -2529,6 +2532,17 @@
//////////////////////////////////////////////////////////////////////////////
+void AGGRenderer::DrawScreenRaster(unsigned char* data, int length,
+ RS_ImageFormat format, int native_width, int native_height,
+ double x, double y, double w, double h, double angledeg,
+ double alpha)
+{
+ RenderUtil::DrawScreenRaster(this, data, length, format, native_width, native_height,
+ x, y, w, h, angledeg, alpha);
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
void AGGRenderer::DrawScreenRasterTransform(agg_context* cxt, unsigned char* data, int length,
RS_ImageFormat format, int native_width, int native_height,
double x, double y, double w, double h,
Modified: sandbox/rfc90/MgDev/Common/Renderers/AGGRenderer.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/AGGRenderer.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/AGGRenderer.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -183,6 +183,9 @@
RENDERERS_API virtual void DrawScreenRaster(unsigned char* data, int length,
RS_ImageFormat format, int native_width, int native_height,
double x, double y, double w, double h, double angledeg);
+ RENDERERS_API virtual void DrawScreenRaster(unsigned char* data, int length,
+ RS_ImageFormat format, int native_width, int native_height,
+ double x, double y, double w, double h, double angledeg, double alpha);
RENDERERS_API virtual void DrawScreenText(const RS_TextMetrics& tm, RS_TextDef& tdef, double insx, double insy, RS_F_Point* path, int npts, double param_position );
RENDERERS_API virtual bool YPointsUp();
Modified: sandbox/rfc90/MgDev/Common/Renderers/AGGW2DRewriter.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/AGGW2DRewriter.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/AGGW2DRewriter.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -367,9 +367,9 @@
color = override;
}
- WT_Logical_Point oldpos = filledEllipse.position();
+ WT_Logical_Point center = filledEllipse.position();
- LineBuffer* dstpts = rewriter->ProcessW2DPoints(file, (WT_Logical_Point*)&oldpos, 1, false);
+ LineBuffer* dstpts = rewriter->ProcessW2DPoints(file, (WT_Logical_Point*)¢er, 1, false);
std::auto_ptr<LineBuffer> spDstLB(dstpts);
if (!dstpts)
@@ -378,15 +378,24 @@
double major = rewriter->ScaleW2DNumber(file, filledEllipse.major());
double minor = rewriter->ScaleW2DNumber(file, filledEllipse.minor());
- double start = filledEllipse.start_degree() * (M_PI / 180.0);
- double end = filledEllipse.end_degree() * (M_PI / 180.0);
+ double start = filledEllipse.start_radian();
+ double end = filledEllipse.end_radian();
+ double tilt = filledEllipse.tilt_radian();
+ // compute start point
+ double rcos = cos(tilt);
+ double rsin = sin(tilt);
+ double tx = major * cos(start);
+ double ty = minor * sin(start);
+ double startX = dstpts->x_coord(0) + tx*rcos - ty*rsin;
+ double startY = dstpts->y_coord(0) + ty*rcos + tx*rsin;
+
LineBuffer* ell = LineBufferPool::NewLineBuffer(rewriter->GetBufferPool(), 20);
std::auto_ptr<LineBuffer> spEllLB(ell);
ell->SetDrawingScale(1.0);
- ell->MoveTo(dstpts->x_coord(0) + major * cos(start), dstpts->y_coord(0) + minor * sin(start));
- ell->ArcTo(dstpts->x_coord(0), dstpts->y_coord(0), major, minor, start, end);
+ ell->MoveTo(startX, startY);
+ ell->ArcTo(dstpts->x_coord(0), dstpts->y_coord(0), major, minor, start, end, tilt);
AGGRenderer::DrawScreenPolygon((agg_context*)rewriter->GetW2DTargetImage(), ell, NULL, color.argb());
@@ -419,9 +428,9 @@
color = override;
}
- WT_Logical_Point oldpos = outlineEllipse.position();
+ WT_Logical_Point center = outlineEllipse.position();
- LineBuffer* dstpts = rewriter->ProcessW2DPoints(file, (WT_Logical_Point*)&oldpos, 1, false);
+ LineBuffer* dstpts = rewriter->ProcessW2DPoints(file, (WT_Logical_Point*)¢er, 1, false);
std::auto_ptr<LineBuffer> spDstLB(dstpts);
if (!dstpts)
@@ -430,20 +439,29 @@
double major = rewriter->ScaleW2DNumber(file, outlineEllipse.major());
double minor = rewriter->ScaleW2DNumber(file, outlineEllipse.minor());
- double start = outlineEllipse.start_degree() * (M_PI / 180.0);
- double end = outlineEllipse.end_degree() * (M_PI / 180.0);
+ double start = outlineEllipse.start_radian();
+ double end = outlineEllipse.end_radian();
+ double tilt = outlineEllipse.tilt_radian();
- //get W2D line weight
- double weightpx = rewriter->ScaleW2DNumber(file, file.rendition().line_weight().weight_value());
- weightpx = rs_max(1.0, weightpx);
+ // compute start point
+ double rcos = cos(tilt);
+ double rsin = sin(tilt);
+ double tx = major * cos(start);
+ double ty = minor * sin(start);
+ double startX = dstpts->x_coord(0) + tx*rcos - ty*rsin;
+ double startY = dstpts->y_coord(0) + ty*rcos + tx*rsin;
LineBuffer* ell = LineBufferPool::NewLineBuffer(rewriter->GetBufferPool(), 20);
std::auto_ptr<LineBuffer> spEllLB(ell);
ell->SetDrawingScale(1.0);
- ell->MoveTo(dstpts->x_coord(0) + major * cos(start), dstpts->y_coord(0) + minor * sin(start));
- ell->ArcTo(dstpts->x_coord(0), dstpts->y_coord(0), major, minor, start, end);
+ ell->MoveTo(startX, startY);
+ ell->ArcTo(dstpts->x_coord(0), dstpts->y_coord(0), major, minor, start, end, tilt);
+ //get W2D line weight
+ double weightpx = rewriter->ScaleW2DNumber(file, file.rendition().line_weight().weight_value());
+ weightpx = rs_max(1.0, weightpx);
+
SE_LineStroke lineStroke(color.argb(), weightpx);
AGGRenderer::DrawScreenPolyline((agg_context*)rewriter->GetW2DTargetImage(), ell, NULL, lineStroke);
@@ -857,6 +875,7 @@
return WT_Result::Success;
}
+
WT_Result agr_process_layer(WT_Layer & layer, WT_File & file)
{
AGGRenderer* rewriter = (AGGRenderer*)file.stream_user_data();
Modified: sandbox/rfc90/MgDev/Common/Renderers/DWFRenderer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/DWFRenderer.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/DWFRenderer.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -66,6 +66,8 @@
#include "AGGRenderer.h"
#include "AGGImageIO.h"
+#include "RenderUtil.h"
+
using namespace DWFToolkit;
using namespace DWFCore;
using namespace std;
@@ -258,24 +260,16 @@
DWFRenderer::~DWFRenderer()
{
- if (m_wtPointBuffer)
- delete[] m_wtPointBuffer;
+ delete[] m_wtPointBuffer;
+ delete m_hatchFac;
+ delete m_fillFac;
+ delete m_obsMesh;
- if (m_hatchFac)
- delete m_hatchFac;
-
- if (m_fillFac)
- delete m_fillFac;
-
- if (m_obsMesh)
- delete m_obsMesh; //should not get here
-
delete (NodeTable*)m_hObjNodes;
// could be non-NULL if an exception was raised before this was
// added to the attribute resources collection
- if (m_attributes)
- delete m_attributes;
+ delete m_attributes;
}
@@ -367,11 +361,8 @@
m_lLayoutStreams.clear();
m_lLayoutLabelStreams.clear();
- if (m_obsMesh)
- {
- delete m_obsMesh;
- m_obsMesh = NULL;
- }
+ delete m_obsMesh;
+ m_obsMesh = NULL;
// clear the map info
m_mapInfo = NULL;
@@ -395,11 +386,8 @@
// could be non-NULL if an exception was raised before this was
// added to the attribute resources collection
- if (m_attributes)
- {
- delete m_attributes;
- m_attributes = NULL;
- }
+ delete m_attributes;
+ m_attributes = NULL;
m_attributes = DWFCORE_ALLOC_OBJECT(DWFObjectDefinitionResource(
DWFXML::kzElement_PageObjectDefinition,
@@ -836,8 +824,7 @@
IncrementDrawableCount();
}
- if (NULL != aggcxt)
- delete aggcxt;
+ delete aggcxt;
}
@@ -2711,6 +2698,16 @@
}
+void DWFRenderer::DrawScreenRaster(unsigned char* data, int length,
+ RS_ImageFormat format, int native_width, int native_height,
+ double x, double y, double w, double h, double angleDeg,
+ double alpha)
+{
+ RenderUtil::DrawScreenRaster(this, data, length, format, native_width, native_height,
+ x, y, w, h, angleDeg, alpha);
+}
+
+
void DWFRenderer::DrawScreenText(const RS_TextMetrics& tm,
RS_TextDef& tdef,
double insx,
Modified: sandbox/rfc90/MgDev/Common/Renderers/DWFRenderer.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/DWFRenderer.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/DWFRenderer.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -178,6 +178,10 @@
virtual void DrawScreenRaster(unsigned char* data, int length,
RS_ImageFormat format, int native_width, int native_height,
double x, double y, double w, double h, double angleDeg);
+ virtual void DrawScreenRaster(unsigned char* data, int length,
+ RS_ImageFormat format, int native_width, int native_height,
+ double x, double y, double w, double h, double angleDeg,
+ double alpha);
virtual void DrawScreenText(const RS_TextMetrics& tm, RS_TextDef& tdef, double insx, double insy,
RS_F_Point* path, int npts, double param_position);
Modified: sandbox/rfc90/MgDev/Common/Renderers/EMapRenderer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/EMapRenderer.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/EMapRenderer.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -53,6 +53,7 @@
delete m_uuid;
}
+
void EMapRenderer::StartMap(RS_MapUIInfo* mapInfo,
RS_Bounds& extents,
double mapScale,
Modified: sandbox/rfc90/MgDev/Common/Renderers/EPlotRenderer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/EPlotRenderer.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/EPlotRenderer.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -73,9 +73,7 @@
{
delete m_uuid;
- if (m_dwfPackageWriter)
- delete m_dwfPackageWriter;
-
+ delete m_dwfPackageWriter;
m_dwfPackageWriter = NULL;
}
Modified: sandbox/rfc90/MgDev/Common/Renderers/FontManager.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/FontManager.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/FontManager.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -50,7 +50,7 @@
//-------------------------------------------------------------------------
-// Constructor/Desctructor
+// Constructor/Destructor
//-------------------------------------------------------------------------
@@ -68,22 +68,6 @@
{
AutoMutexLocker autoLocker(sm_mutex);
- FaceMapIterator it;
- FaceMapEntryType* pEntry = NULL;
- char* pData = NULL;
-
- it = m_facemap.begin();
-
- // clean up entries
- while (it != m_facemap.end())
- {
- pEntry = (FaceMapEntryType*)(*it).second;
- pData = pEntry->pData;
- free(pData);
- delete pEntry;
- ++it;
- }
-
// free up font map entries
for (FontMapIterator fmi = m_fontAliases.begin(); fmi != m_fontAliases.end(); fmi++)
{
@@ -93,15 +77,9 @@
m_fontAliases.clear();
- // clear map
- m_facemap.clear();
-
// clean up fontlist
- FontListIterator it_font;
RS_Font* font = NULL;
-
- it_font = m_fontlist.begin();
-
+ FontListIterator it_font = m_fontlist.begin();
while (it_font != m_fontlist.end())
{
font = (RS_Font*)(*it_font);
@@ -128,51 +106,6 @@
}
-int FontManager::get_face(const char* filename, FT_Long index, FT_Face* face)
-{
- AutoMutexLocker autoLocker(sm_mutex);
-
- int ret = 0; // our return error code
- FaceMapIterator it; // an interator
- FaceMapEntryType* pEntry = NULL; // pointer to loaded font data
-
- // look for face in map
- it = m_facemap.find(filename);
-
- if (it != m_facemap.end())
- {
- // found an entry
- pEntry = (FaceMapEntryType*)(*it).second;
-
- // create a new face
- ret = FT_New_Memory_Face(m_library, (FT_Byte*)pEntry->pData, (FT_Long)pEntry->length, index, face);
- }
- else
- {
- // ok, we have to load it
-// ret = FT_New_Face(m_library, filename, index, face);
-
- pEntry = load_file(filename);
-
- if (pEntry)
- {
- // insert the entry into the map
- m_facemap.insert(FaceMapPair(filename, pEntry));
-
- // create a new face
- ret = FT_New_Memory_Face(m_library, (FT_Byte*)pEntry->pData, (FT_Long)pEntry->length, index, face);
- }
- else
- {
- face = NULL;
- ret = -1;
- }
- }
-
- return ret;
-}
-
-
FaceMapEntryType* FontManager::load_file(const char* filename)
{
AutoMutexLocker autoLocker(sm_mutex);
@@ -337,11 +270,8 @@
do
{
- error = FT_New_Face(m_library, entryName.c_str(), index, &face);
-
// TODO: revisit using the font manager here
-// error = m_FM->get_face(entryName.c_str(), index, &face);
-
+ error = FT_New_Face(m_library, entryName.c_str(), index, &face);
if (!error)
{
// init num_faces if necessary
Modified: sandbox/rfc90/MgDev/Common/Renderers/FontManager.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/FontManager.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/FontManager.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -62,8 +62,6 @@
~FontManager();
public:
- int get_face(const char* filename, FT_Long index, FT_Face* face);
-
void init_font_list();
void create_font(FT_Face face, FT_Long index, wchar_t const* filename);
@@ -81,7 +79,6 @@
private:
FT_Library m_library;
- FaceMap m_facemap;
FontList m_fontlist;
FontMap m_fontAliases;
Modified: sandbox/rfc90/MgDev/Common/Renderers/GDRenderer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/GDRenderer.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/GDRenderer.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -56,6 +56,7 @@
#include "complex_polygon_gd.h"
#include "SymbolTrans.h"
+#include "RenderUtil.h"
using namespace DWFToolkit;
using namespace DWFCore;
@@ -156,11 +157,8 @@
if (m_imsym)
gdImageDestroy((gdImagePtr)m_imsym);
- if (m_wtPointBuffer)
- delete [] m_wtPointBuffer;
-
+ delete [] m_wtPointBuffer;
delete m_labeler;
-
delete m_polyrasterizer;
}
@@ -2204,6 +2202,15 @@
}
+// Fills and returns the point buffer using the supplied line buffer.
+// No transformations are applied.
+const RS_D_Point* GDRenderer::FillPointBuffer(LineBuffer* lb)
+{
+ _TransferPoints(lb, NULL);
+ return m_wtPointBuffer;
+}
+
+
void GDRenderer::UpdateSymbolTrans(WT_File& /*file*/, WT_Viewport& viewport)
{
_ASSERT(m_xformer);
@@ -2655,6 +2662,16 @@
}
+void GDRenderer::DrawScreenRaster(unsigned char* data, int length,
+ RS_ImageFormat format, int native_width, int native_height,
+ double x, double y, double w, double h, double angleDeg,
+ double alpha)
+{
+ RenderUtil::DrawScreenRaster(this, data, length, format, native_width, native_height,
+ x, y, w, h, angleDeg, alpha);
+}
+
+
void GDRenderer::DrawScreenText(const RS_TextMetrics& tm, RS_TextDef& tdef, double insx, double insy,
RS_F_Point* path, int npts, double param_position)
{
Modified: sandbox/rfc90/MgDev/Common/Renderers/GDRenderer.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/GDRenderer.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/GDRenderer.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -160,6 +160,10 @@
virtual void DrawScreenRaster(unsigned char* data, int length,
RS_ImageFormat format, int native_width, int native_height,
double x, double y, double w, double h, double angleDeg);
+ virtual void DrawScreenRaster(unsigned char* data, int length,
+ RS_ImageFormat format, int native_width, int native_height,
+ double x, double y, double w, double h, double angleDeg,
+ double alpha);
virtual void DrawScreenText(const RS_TextMetrics& tm, RS_TextDef& tdef, double insx, double insy,
RS_F_Point* path, int npts, double param_position);
@@ -285,9 +289,9 @@
WT_Logical_Point* srcpts,
int numpts,
bool checkInBounds);
+ /*Do not export from DLL*/ double ScaleW2DNumber(WT_File& file, long number);
+ /*Do not export from DLL*/ const RS_D_Point* FillPointBuffer(LineBuffer* lb);
- /*Do not export from DLL*/ double ScaleW2DNumber(WT_File& file, long number);
-
private:
void AddW2DContent(RS_InputStream* in, CSysTransformer* xformer, const RS_String& w2dfilter);
Modified: sandbox/rfc90/MgDev/Common/Renderers/GDW2DRewriter.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/GDW2DRewriter.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/GDW2DRewriter.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -410,37 +410,93 @@
color = override;
}
- WT_Logical_Point oldpos = filledEllipse.position();
+ WT_Logical_Point center = filledEllipse.position();
- const RS_D_Point* dstpts = rewriter->ProcessW2DPoints(file, (WT_Logical_Point*)&oldpos, 1, false);
+ const RS_D_Point* dstpts = rewriter->ProcessW2DPoints(file, (WT_Logical_Point*)¢er, 1, false);
- int major = ROUND(rewriter->ScaleW2DNumber(file, filledEllipse.major()));
- int minor = ROUND(rewriter->ScaleW2DNumber(file, filledEllipse.minor()));
+ //negate because GD is left-handed coords
+ double tilt = -filledEllipse.tilt_radian();
- //simple bounds check before we draw
- if ( !(dstpts[0].x + major < 0
- || dstpts[0].x - major > ((gdImagePtr)rewriter->GetW2DTargetImage())->sx
- || dstpts[0].y + minor < 0
- || dstpts[0].x - minor > ((gdImagePtr)rewriter->GetW2DTargetImage())->sy))
+ if (tilt == 0.0)
{
- //negate because GD is left-handed coords
- float end = 360.f - filledEllipse.start_degree();
- float start = 360.f - filledEllipse.end_degree();
+ // case where ellipse is unrotated
- //gd does not like negative angles (it's sin/cos lookup table doesn't)
- while (start < 0.f)
+ int major = ROUND(rewriter->ScaleW2DNumber(file, filledEllipse.major()));
+ int minor = ROUND(rewriter->ScaleW2DNumber(file, filledEllipse.minor()));
+
+ //simple bounds check before we draw
+ if ( !(dstpts[0].x + major < 0
+ || dstpts[0].x - major > ((gdImagePtr)rewriter->GetW2DTargetImage())->sx
+ || dstpts[0].y + minor < 0
+ || dstpts[0].x - minor > ((gdImagePtr)rewriter->GetW2DTargetImage())->sy))
{
- start += 360.f;
- end += 360.f;
+ //negate because GD is left-handed coords
+ float end = 360.f - filledEllipse.start_degree();
+ float start = 360.f - filledEllipse.end_degree();
+
+ //gd does not like negative angles (its sin/cos lookup table doesn't)
+ while (start < 0.f)
+ {
+ start += 360.f;
+ end += 360.f;
+ }
+
+ int gdc = ConvertColor((gdImagePtr)rewriter->GetW2DTargetImage(), color);
+ gdImageFilledArc((gdImagePtr)rewriter->GetW2DTargetImage(),
+ dstpts[0].x, dstpts[0].y,
+ major * 2, minor * 2,
+ (int)start, (int)end,
+ gdc, gdArc);
}
+ }
+ else
+ {
+ // case where ellipse is rotated
+ double rcos = cos(tilt);
+ double rsin = sin(tilt);
- //TODO: tilt. Need to tesselate into a line buffer in order to rotate.
- int gdc = ConvertColor((gdImagePtr)rewriter->GetW2DTargetImage(), color);
- gdImageFilledArc((gdImagePtr)rewriter->GetW2DTargetImage(),
- dstpts[0].x, dstpts[0].y,
- major, minor,
- (int)start, (int)end, //negate because GD is left-handed coords
- gdc, gdArc);
+ double major = rewriter->ScaleW2DNumber(file, filledEllipse.major());
+ double minor = rewriter->ScaleW2DNumber(file, filledEllipse.minor());
+
+ // the half-width / half-height of the bounding box for the rotated ellipse
+ int wid2 = (int)sqrt(major*major*rcos*rcos + minor*minor*rsin*rsin) + 1;
+ int hgt2 = (int)sqrt(major*major*rsin*rsin + minor*minor*rcos*rcos) + 1;
+
+ //simple bounds check before we draw
+ if ( !(dstpts[0].x + wid2 < 0
+ || dstpts[0].x - wid2 > ((gdImagePtr)rewriter->GetW2DTargetImage())->sx
+ || dstpts[0].y + hgt2 < 0
+ || dstpts[0].x - hgt2 > ((gdImagePtr)rewriter->GetW2DTargetImage())->sy))
+ {
+ //negate because GD is left-handed coords
+ double start = -filledEllipse.start_radian();
+ double end = -filledEllipse.end_radian();
+
+ // compute start point
+ double tx = major * cos(start);
+ double ty = minor * sin(start);
+ double startX = dstpts[0].x + tx*rcos - ty*rsin;
+ double startY = dstpts[0].y + ty*rcos + tx*rsin;
+
+ // use a line buffer to tessellate the arc
+ LineBuffer* ell = LineBufferPool::NewLineBuffer(rewriter->GetBufferPool(), 20);
+ std::auto_ptr<LineBuffer> spEllLB(ell);
+
+ ell->SetDrawingScale(1.0);
+ ell->MoveTo(startX, startY);
+ ell->ArcTo(dstpts[0].x, dstpts[0].y, major, minor, start, end, tilt);
+
+ int numpts = ell->point_count();
+ const RS_D_Point* dstpts = rewriter->FillPointBuffer(ell);
+
+ LineBufferPool::FreeLineBuffer(rewriter->GetBufferPool(), spEllLB.release());
+
+ int gdc = ConvertColor((gdImagePtr)rewriter->GetW2DTargetImage(), color);
+ gdImageFilledPolygon((gdImagePtr)rewriter->GetW2DTargetImage(),
+ (gdPointPtr)dstpts,
+ numpts,
+ gdc);
+ }
}
return WT_Result::Success;
@@ -469,62 +525,134 @@
color = override;
}
- WT_Logical_Point oldpos = outlineEllipse.position();
+ WT_Logical_Point center = outlineEllipse.position();
- const RS_D_Point* dstpts = rewriter->ProcessW2DPoints(file, (WT_Logical_Point*)&oldpos, 1, false);
+ const RS_D_Point* dstpts = rewriter->ProcessW2DPoints(file, (WT_Logical_Point*)¢er, 1, false);
- int major = ROUND(rewriter->ScaleW2DNumber(file, outlineEllipse.major()));
- int minor = ROUND(rewriter->ScaleW2DNumber(file, outlineEllipse.minor()));
+ //negate because GD is left-handed coords
+ double tilt = -outlineEllipse.tilt_radian();
- //simple bounds check before we draw
- if ( !(dstpts[0].x + major < 0
- || dstpts[0].x - major > ((gdImagePtr)rewriter->GetW2DTargetImage())->sx
- || dstpts[0].y + minor < 0
- || dstpts[0].x - minor > ((gdImagePtr)rewriter->GetW2DTargetImage())->sy))
+ if (tilt == 0.0)
{
- //negate because GD is left-handed coords
- float end = 360.f - outlineEllipse.start_degree();
- float start = 360.f - outlineEllipse.end_degree();
+ // case where ellipse is unrotated
- //gd does not like negative angles (it's sin/cos lookup table doesn't)
- while (start < 0.f)
+ int major = ROUND(rewriter->ScaleW2DNumber(file, outlineEllipse.major()));
+ int minor = ROUND(rewriter->ScaleW2DNumber(file, outlineEllipse.minor()));
+
+ //simple bounds check before we draw
+ if ( !(dstpts[0].x + major < 0
+ || dstpts[0].x - major > ((gdImagePtr)rewriter->GetW2DTargetImage())->sx
+ || dstpts[0].y + minor < 0
+ || dstpts[0].x - minor > ((gdImagePtr)rewriter->GetW2DTargetImage())->sy))
{
- start += 360.f;
- end += 360.f;
- }
+ //negate because GD is left-handed coords
+ float end = 360.f - outlineEllipse.start_degree();
+ float start = 360.f - outlineEllipse.end_degree();
- //TODO: tilt. Need to tesselate into a line buffer in order to rotate.
- int gdc = ConvertColor((gdImagePtr)rewriter->GetW2DTargetImage(), color);
+ //gd does not like negative angles (its sin/cos lookup table doesn't)
+ while (start < 0.f)
+ {
+ start += 360.f;
+ end += 360.f;
+ }
- ////////////////////////
- // handle thickness
+ ////////////////////////
+ // handle thickness
- //get W2D line weight
- int thick = ROUND(rewriter->ScaleW2DNumber(file, file.rendition().line_weight().weight_value()));
+ //get W2D line weight
+ int thick = ROUND(rewriter->ScaleW2DNumber(file, file.rendition().line_weight().weight_value()));
+ gdImagePtr brush1 = NULL;
- gdImagePtr brush1 = NULL;
+ if (thick > 1)
+ {
+ brush1 = rs_gdImageThickLineBrush(thick, color);
+ gdImageSetBrush((gdImagePtr)rewriter->GetW2DTargetImage(), brush1);
+ }
- if (thick > 1)
- {
- brush1 = rs_gdImageThickLineBrush(thick, color);
- gdImageSetBrush((gdImagePtr)rewriter->GetW2DTargetImage(), brush1);
+ int gdc = ConvertColor((gdImagePtr)rewriter->GetW2DTargetImage(), color);
+ gdImageArc((gdImagePtr)rewriter->GetW2DTargetImage(),
+ dstpts[0].x, dstpts[0].y,
+ major * 2, minor * 2,
+ (int)start, (int)end,
+ brush1 ? gdBrushed : gdc);
+
+ if (brush1)
+ {
+ gdImageSetBrush((gdImagePtr)rewriter->GetW2DTargetImage(), NULL);
+ gdImageDestroy(brush1);
+ }
}
+ }
+ else
+ {
+ // case where ellipse is rotated
+ double rcos = cos(tilt);
+ double rsin = sin(tilt);
- gdImageArc((gdImagePtr)rewriter->GetW2DTargetImage(),
- dstpts[0].x, dstpts[0].y,
- major * 2, minor * 2,
- (int)start, (int)end,
- brush1 ? gdBrushed : gdc);
+ double major = rewriter->ScaleW2DNumber(file, outlineEllipse.major());
+ double minor = rewriter->ScaleW2DNumber(file, outlineEllipse.minor());
- if (brush1)
+ // the half-width / half-height of the bounding box for the rotated ellipse
+ int wid2 = (int)sqrt(major*major*rcos*rcos + minor*minor*rsin*rsin) + 1;
+ int hgt2 = (int)sqrt(major*major*rsin*rsin + minor*minor*rcos*rcos) + 1;
+
+ //simple bounds check before we draw
+ if ( !(dstpts[0].x + wid2 < 0
+ || dstpts[0].x - wid2 > ((gdImagePtr)rewriter->GetW2DTargetImage())->sx
+ || dstpts[0].y + hgt2 < 0
+ || dstpts[0].x - hgt2 > ((gdImagePtr)rewriter->GetW2DTargetImage())->sy))
{
- gdImageSetBrush((gdImagePtr)rewriter->GetW2DTargetImage(), NULL);
- gdImageDestroy(brush1);
+ //negate because GD is left-handed coords
+ double start = -outlineEllipse.start_radian();
+ double end = -outlineEllipse.end_radian();
+
+ // compute start point
+ double tx = major * cos(start);
+ double ty = minor * sin(start);
+ double startX = dstpts[0].x + tx*rcos - ty*rsin;
+ double startY = dstpts[0].y + ty*rcos + tx*rsin;
+
+ // use a line buffer to tessellate the arc
+ LineBuffer* ell = LineBufferPool::NewLineBuffer(rewriter->GetBufferPool(), 20);
+ std::auto_ptr<LineBuffer> spEllLB(ell);
+
+ ell->SetDrawingScale(1.0);
+ ell->MoveTo(startX, startY);
+ ell->ArcTo(dstpts[0].x, dstpts[0].y, major, minor, start, end, tilt);
+
+ int numpts = ell->point_count();
+ const RS_D_Point* dstpts = rewriter->FillPointBuffer(ell);
+
+ LineBufferPool::FreeLineBuffer(rewriter->GetBufferPool(), spEllLB.release());
+
+ ////////////////////////
+ // handle thickness
+
+ //get W2D line weight
+ int thick = ROUND(rewriter->ScaleW2DNumber(file, file.rendition().line_weight().weight_value()));
+ gdImagePtr brush1 = NULL;
+
+ if (thick > 1)
+ {
+ brush1 = rs_gdImageThickLineBrush(thick, color);
+ gdImageSetBrush((gdImagePtr)rewriter->GetW2DTargetImage(), brush1);
+ }
+
+ int gdc = ConvertColor((gdImagePtr)rewriter->GetW2DTargetImage(), color);
+ gdImageOpenPolygon((gdImagePtr)rewriter->GetW2DTargetImage(),
+ (gdPointPtr)dstpts,
+ numpts,
+ brush1 ? gdBrushed : gdc);
+
+ if (brush1)
+ {
+ gdImageSetBrush((gdImagePtr)rewriter->GetW2DTargetImage(), NULL);
+ gdImageDestroy(brush1);
+ }
}
}
return WT_Result::Success;
-
}
Modified: sandbox/rfc90/MgDev/Common/Renderers/KmlRenderer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/KmlRenderer.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/KmlRenderer.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -23,6 +23,8 @@
#include "UnicodeString.h"
#include "PolygonUtils.h"
+#include "RenderUtil.h"
+
const double ELEV_FACTOR = 0.1;
@@ -506,20 +508,15 @@
void KmlRenderer::ClearStyles()
{
- if (m_styleContent != NULL)
- {
- delete m_styleContent;
- m_styleContent = NULL;
- }
+ delete m_styleContent;
+ m_styleContent = NULL;
}
void KmlRenderer::WriteStyle(RS_FillStyle& fill)
{
if (m_styleContent == NULL)
- {
m_styleContent = new KmlContent();
- }
char buffer[256];
int thisStyleId = 0;
@@ -673,6 +670,16 @@
}
+void KmlRenderer::DrawScreenRaster(unsigned char* data, int length,
+ RS_ImageFormat format, int native_width, int native_height,
+ double x, double y, double w, double h, double angleDeg,
+ double alpha)
+{
+ RenderUtil::DrawScreenRaster(this, data, length, format, native_width, native_height,
+ x, y, w, h, angleDeg, alpha);
+}
+
+
void KmlRenderer::DrawScreenText(const RS_TextMetrics& /*tm*/,
RS_TextDef& /*tdef*/,
double /*insx*/,
Modified: sandbox/rfc90/MgDev/Common/Renderers/KmlRenderer.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/KmlRenderer.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/KmlRenderer.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -129,6 +129,10 @@
virtual void DrawScreenRaster(unsigned char* data, int length,
RS_ImageFormat format, int native_width, int native_height,
double x, double y, double w, double h, double angleDeg);
+ virtual void DrawScreenRaster(unsigned char* data, int length,
+ RS_ImageFormat format, int native_width, int native_height,
+ double x, double y, double w, double h, double angleDeg,
+ double alpha);
virtual void DrawScreenText(const RS_TextMetrics& tm, RS_TextDef& tdef, double insx, double insy,
RS_F_Point* path, int npts, double param_position);
Modified: sandbox/rfc90/MgDev/Common/Renderers/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/Makefile.am 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/Makefile.am 2010-11-13 18:14:35 UTC (rev 5390)
@@ -38,6 +38,7 @@
KmlPolyStyle.cpp \
KmlRenderer.cpp \
ObservationMesh.cpp \
+ RenderUtil.cpp \
RS_ByteData.cpp \
SymbolTrans.cpp \
W2DRewriter.cpp \
@@ -67,6 +68,7 @@
KmlRenderer.h \
ObservationMesh.h \
Renderers.h \
+ RenderUtil.h \
RS_ByteData.h \
RSDWFInputStream.h \
RSDWFOutputStream.h \
Modified: sandbox/rfc90/MgDev/Common/Renderers/RS_ByteData.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/RS_ByteData.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/RS_ByteData.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -43,8 +43,7 @@
RS_ByteData::~RS_ByteData()
{
- if (m_bytes)
- delete [] m_bytes;
+ delete [] m_bytes;
}
Modified: sandbox/rfc90/MgDev/Common/Renderers/Renderers.rc
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/Renderers.rc 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/Renderers.rc 2010-11-13 18:14:35 UTC (rev 5390)
@@ -6,7 +6,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
+#include "winresrc.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
1 TEXTINCLUDE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#include ""winresrc.h""\r\n"
"\0"
END
Modified: sandbox/rfc90/MgDev/Common/Renderers/Renderers.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Common/Renderers/Renderers.vcproj 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Renderers/Renderers.vcproj 2010-11-13 18:14:35 UTC (rev 5390)
@@ -45,7 +45,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="$(USRCFLAGS)"
Optimization="0"
- AdditionalIncludeDirectories="..\MdfModel;..\Stylization;..\..\Oem\FDO\inc;..\..\Oem\FDO\inc\ExpressionEngine;..\..\Oem\DWFTK7.1\develop\global\src;..\..\Oem\DWFTK7.1\develop\global\src\dwf;..\..\Oem\gd\gd;..\..\Oem\gd\freetype\include;"..\..\Oem\agg-2.4\include";"..\..\Oem\agg-2.4\font_freetype";..\..\Oem\gd\lpng;..\..\Oem\gd\zlib"
+ AdditionalIncludeDirectories="..\Foundation;..\Geometry;..\MapGuideCommon;..\MdfModel;..\PlatformBase;..\Stylization;..\..\Oem\FDO\inc;..\..\Oem\FDO\inc\ExpressionEngine;..\..\Oem\DWFTK7.1\develop\global\src;..\..\Oem\DWFTK7.1\develop\global\src\dwf;..\..\Oem\gd\gd;..\..\Oem\gd\freetype\include;"..\..\Oem\agg-2.4\include";"..\..\Oem\agg-2.4\font_freetype";..\..\Oem\gd\lpng;..\..\Oem\gd\zlib;..\..\Oem\ACE\ACE_wrappers"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;RENDERERS_EXPORTS;DWFCORE_STATIC;DWFTK_STATIC;DWFTK_USE_DWFCORE_ZLIB;DWFTK_BUILD_EXPAT;WHIP_STATIC_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
MinimalRebuild="true"
ExceptionHandling="2"
@@ -694,6 +694,14 @@
>
</File>
<File
+ RelativePath=".\RenderUtil.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\RenderUtil.h"
+ >
+ </File>
+ <File
RelativePath=".\stdafx.h"
>
</File>
Modified: sandbox/rfc90/MgDev/Common/Schema/BatchPropertyCollection-1.0.0.xsd
===================================================================
--- sandbox/rfc90/MgDev/Common/Schema/BatchPropertyCollection-1.0.0.xsd 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Schema/BatchPropertyCollection-1.0.0.xsd 2010-11-13 18:14:35 UTC (rev 5390)
@@ -17,7 +17,7 @@
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
<xs:element name="Type" type="xs:string"/>
- <xs:element name="Value" type="xs:string"/>
+ <xs:element name="Value" type="xs:string" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
Modified: sandbox/rfc90/MgDev/Common/Stylization/Band.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/Band.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/Band.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -68,10 +68,7 @@
Band::~Band()
{
- if (m_pBandData)
- {
- delete m_pBandData;
- }
+ delete m_pBandData;
}
//*************************************************************************************************************
Modified: sandbox/rfc90/MgDev/Common/Stylization/BandData.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/BandData.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/BandData.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -286,10 +286,7 @@
BitBandData::~BitBandData()
{
- if (m_pData)
- {
- delete[] m_pData;
- }
+ delete[] m_pData;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -303,10 +300,7 @@
ByteBandData::~ByteBandData()
{
- if (m_pData)
- {
- delete[] m_pData;
- }
+ delete[] m_pData;
}
//*************************************************************************************************************
Modified: sandbox/rfc90/MgDev/Common/Stylization/DataValueStack.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/DataValueStack.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/DataValueStack.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -32,8 +32,7 @@
{
//note this destructor will not call
//the individual element destructors
- if (m_data)
- delete [] m_data;
+ delete [] m_data;
}
inline void push(T* dv)
Modified: sandbox/rfc90/MgDev/Common/Stylization/DefaultStylizer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/DefaultStylizer.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/DefaultStylizer.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -217,7 +217,7 @@
nFeatures = StylizeVLHelper(layer, scaleRange, renderer, features, true, xformer, cancel, userData);
}
- #ifdef _MAPDEBUG
+ #ifdef _DEBUG
printf(" DefaultStylizer::StylizeVectorLayer() Layer: %S Features: %d\n", layer->GetFeatureName().c_str(), nFeatures);
#endif
}
@@ -230,6 +230,19 @@
//////////////////////////////////////////////////////////////////////////////
+void DefaultStylizer::StylizeWatermark(Renderer* renderer,
+ MdfModel::WatermarkDefinition* watermark,
+ int drawWidth,
+ int drawHeight,
+ int saveWidth,
+ int saveHeight)
+{
+ m_styleEngine->StylizeWatermark((SE_Renderer*)renderer, watermark, drawWidth, drawHeight, saveWidth, saveHeight);
+ m_styleEngine->ClearCache();
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
int DefaultStylizer::StylizeVLHelper(MdfModel::VectorLayerDefinition* layer,
MdfModel::VectorScaleRange* scaleRange,
Renderer* renderer,
@@ -303,7 +316,7 @@
int nFeatures = 0;
while (features->ReadNext())
{
- #ifdef _MAPDEBUG
+ #ifdef _DEBUG
++nFeatures;
#endif
@@ -450,10 +463,8 @@
void DefaultStylizer::SetGeometryAdapter(FdoGeometryType type, GeometryAdapter* stylizer)
{
GeometryAdapter* old = (GeometryAdapter*)m_hGeomStylizers[type];
+ delete old;
- if (old)
- delete old;
-
m_hGeomStylizers[type] = stylizer;
}
@@ -521,9 +532,6 @@
m_hGeomStylizers.clear();
- if (m_pRasterAdapter)
- {
- delete m_pRasterAdapter;
- m_pRasterAdapter = NULL;
- }
+ delete m_pRasterAdapter;
+ m_pRasterAdapter = NULL;
}
Modified: sandbox/rfc90/MgDev/Common/Stylization/DefaultStylizer.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/DefaultStylizer.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/DefaultStylizer.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -59,6 +59,13 @@
CSysTransformer* xformer,
double mapScale);
+ STYLIZATION_API virtual void StylizeWatermark(Renderer* renderer,
+ MdfModel::WatermarkDefinition* watermark,
+ int drawWidth,
+ int drawHeight,
+ int saveWidth,
+ int saveHeight);
+
STYLIZATION_API virtual void SetGeometryAdapter(FdoGeometryType type, GeometryAdapter* stylizer);
private:
Modified: sandbox/rfc90/MgDev/Common/Stylization/ExpressionHelper.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/ExpressionHelper.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/ExpressionHelper.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -28,7 +28,6 @@
#include "ExpressionFunctionIf.h"
#include "ExpressionFunctionLookup.h"
#include "ExpressionFunctionRange.h"
-#include "Foundation.h"
const RS_String s_Empty(L"");
Modified: sandbox/rfc90/MgDev/Common/Stylization/GeometryAdapter.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/GeometryAdapter.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/GeometryAdapter.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -21,7 +21,6 @@
#include "SymbolVisitor.h"
#include "SLDSymbols.h"
#include "ExpressionHelper.h"
-#include "Foundation.h"
extern void ProcessStylizerException(FdoException* exception, int line, wchar_t* file);
Modified: sandbox/rfc90/MgDev/Common/Stylization/GridData.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/GridData.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/GridData.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -107,30 +107,18 @@
itr != m_BandVector.end();
++itr)
{
- if (*itr)
- {
- delete *itr;
- *itr = NULL;
- }
+ delete *itr;
+ *itr = NULL;
}
- if (NULL != m_pColorBand)
- {
- delete m_pColorBand;
- m_pColorBand = NULL;
- }
+ delete m_pColorBand;
+ m_pColorBand = NULL;
- if (NULL != m_pDrapedColorBand)
- {
- delete m_pDrapedColorBand;
- m_pDrapedColorBand = NULL;
- }
+ delete m_pDrapedColorBand;
+ m_pDrapedColorBand = NULL;
- if (NULL != m_pStylizedBand)
- {
- delete m_pStylizedBand;
- m_pStylizedBand = NULL;
- }
+ delete m_pStylizedBand;
+ m_pStylizedBand = NULL;
}
//*************************************************************************************************************
@@ -139,9 +127,7 @@
{
Band* pBand = new Band(dataType, this);
if (NULL == pBand)
- {
return NULL;
- }
pBand->SetName(name.c_str());
Modified: sandbox/rfc90/MgDev/Common/Stylization/GridThemeParser.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/GridThemeParser.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/GridThemeParser.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -236,16 +236,11 @@
}
catch (std::exception &)
{
- if (pTheme)
- {
- delete pTheme;
- pTheme = NULL;
- }
- if (pBucket)
- {
- delete pBucket;
- pBucket = NULL;
- }
+ delete pTheme;
+ pTheme = NULL;
+
+ delete pBucket;
+ pBucket = NULL;
}
return pTheme;
}
Modified: sandbox/rfc90/MgDev/Common/Stylization/LabelRenderer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/LabelRenderer.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/LabelRenderer.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -55,19 +55,13 @@
{
LabelInfo& info = group.m_labels[j];
- if (info.m_pts)
- {
- delete [] info.m_pts;
- info.m_pts = NULL;
- info.m_numpts = 0;
- }
+ delete [] info.m_pts;
+ info.m_pts = NULL;
+ info.m_numpts = 0;
// the style was cloned when it was passed to the LabelRenderer
- if (info.m_sestyle)
- {
- delete info.m_sestyle;
- info.m_sestyle = NULL;
- }
+ delete info.m_sestyle;
+ info.m_sestyle = NULL;
}
}
@@ -253,19 +247,13 @@
{
LabelInfo& info = group.m_labels[j];
- if (info.m_pts)
- {
- delete [] info.m_pts;
- info.m_pts = NULL;
- info.m_numpts = 0;
- }
+ delete [] info.m_pts;
+ info.m_pts = NULL;
+ info.m_numpts = 0;
// the style was cloned when it was passed to the LabelRenderer
- if (info.m_sestyle)
- {
- delete info.m_sestyle;
- info.m_sestyle = NULL;
- }
+ delete info.m_sestyle;
+ info.m_sestyle = NULL;
}
group.m_labels.clear();
Modified: sandbox/rfc90/MgDev/Common/Stylization/LabelRendererLocal.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/LabelRendererLocal.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/LabelRendererLocal.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -56,25 +56,16 @@
{
LabelInfoLocal& info = group.m_labels[j];
- if (info.m_rotated_points)
- {
- delete [] info.m_rotated_points;
- info.m_rotated_points = NULL;
- }
+ delete [] info.m_rotated_points;
+ info.m_rotated_points = NULL;
- if (info.m_pts)
- {
- delete [] info.m_pts;
- info.m_pts = NULL;
- info.m_numpts = 0;
- }
+ delete [] info.m_pts;
+ info.m_pts = NULL;
+ info.m_numpts = 0;
// the style was cloned when it was passed to the LabelRenderer
- if (info.m_sestyle)
- {
- delete info.m_sestyle;
- info.m_sestyle = NULL;
- }
+ delete info.m_sestyle;
+ info.m_sestyle = NULL;
}
}
@@ -407,19 +398,13 @@
// at this point there shouldn't yet be any rotated points
_ASSERT(info.m_rotated_points == NULL);
- if (info.m_pts)
- {
- delete [] info.m_pts;
- info.m_pts = NULL;
- info.m_numpts = 0;
- }
+ delete [] info.m_pts;
+ info.m_pts = NULL;
+ info.m_numpts = 0;
// the style was cloned when it was passed to the LabelRenderer
- if (info.m_sestyle)
- {
- delete info.m_sestyle;
- info.m_sestyle = NULL;
- }
+ delete info.m_sestyle;
+ info.m_sestyle = NULL;
}
group.m_labels.clear();
@@ -502,19 +487,13 @@
// the original label infos should still not have any rotated points
_ASSERT(info.m_rotated_points == NULL);
- if (info.m_pts)
- {
- delete [] info.m_pts;
- info.m_pts = NULL;
- info.m_numpts = 0;
- }
+ delete [] info.m_pts;
+ info.m_pts = NULL;
+ info.m_numpts = 0;
// the style was cloned when it was passed to the LabelRenderer
- if (info.m_sestyle)
- {
- delete info.m_sestyle;
- info.m_sestyle = NULL;
- }
+ delete info.m_sestyle;
+ info.m_sestyle = NULL;
}
group.m_labels = repeated_infos;
@@ -831,11 +810,8 @@
_ASSERT(info.m_pts == NULL);
// the style was cloned when it was passed to the LabelRenderer
- if (info.m_sestyle)
- {
- delete info.m_sestyle;
- info.m_sestyle = NULL;
- }
+ delete info.m_sestyle;
+ info.m_sestyle = NULL;
}
}
Modified: sandbox/rfc90/MgDev/Common/Stylization/LineBuffer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/LineBuffer.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/LineBuffer.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -755,7 +755,7 @@
}
-void LineBuffer::ArcTo(double cx, double cy, double a, double b, double startRad, double endRad)
+void LineBuffer::ArcTo(double cx, double cy, double a, double b, double startRad, double endRad, double rotRad)
{
// store off arc start point index
EnsureArcsSpArray(2);
@@ -798,6 +798,10 @@
// get the angular separation corresponding to the number of segments
double dRad = extent / nSegs;
+ // account for the overall arc rotation
+ double rcos = cos(rotRad);
+ double rsin = sin(rotRad);
+
// add the segments
EnsurePoints(nSegs);
for (int i=1; i<=nSegs; ++i)
@@ -806,8 +810,8 @@
double tx = a * cos(ang);
double ty = b * sin(ang);
- double x = cx + tx;
- double y = cy + ty;
+ double x = cx + tx*rcos - ty*rsin;
+ double y = cy + ty*rcos + tx*rsin;
LineTo(x, y);
}
Modified: sandbox/rfc90/MgDev/Common/Stylization/LineBuffer.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/LineBuffer.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/LineBuffer.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -105,7 +105,7 @@
// the fancy stuff
STYLIZATION_API void CircularArcTo(double midx, double midy, double endx, double endy);
STYLIZATION_API void CircularArcTo(double midx, double midy, double midz, double endx, double endy, double endz);
- STYLIZATION_API void ArcTo(double cx, double cy, double a, double b, double startRad, double endRad);
+ STYLIZATION_API void ArcTo(double cx, double cy, double a, double b, double startRad, double endRad, double rotRad = 0.0);
// STYLIZATION_API void QuadTo(double x2, double y2, double x3, double y3);
// STYLIZATION_API void CubicTo(double x2, double y2, double x3, double y3, double x4, double y4);
// STYLIZATION_API void AddEllipse(double cx, double cy, double a, double b);
@@ -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;
@@ -245,8 +247,8 @@
void MultiPointCentroid(double* cx, double* cy) const;
void MultiPolygonCentroid(double* cx, double* cy) const;
void MultiPolylineCentroid(double* cx, double* cy, double* slope) const;
-
+
void ResizePoints(int n); // new size of array # of points
void ResizeContours(int n);
void ResizeArcsSpArray(int n);
@@ -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: sandbox/rfc90/MgDev/Common/Stylization/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/Makefile.am 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/Makefile.am 2010-11-13 18:14:35 UTC (rev 5390)
@@ -179,7 +179,6 @@
SE_BufferPool.h \
SE_ExpressionBase.h \
SE_LineBuffer.h \
- SE_LineRenderer.h \
SE_Matrix.h \
SE_PositioningAlgorithms.h \
SE_Renderer.h \
Modified: sandbox/rfc90/MgDev/Common/Stylization/PointAdapter.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/PointAdapter.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/PointAdapter.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -20,7 +20,6 @@
#include "PointAdapter.h"
#include "LineBuffer.h"
#include "FeatureTypeStyleVisitor.h"
-#include "Foundation.h"
//////////////////////////////////////////////////////////////////////////////
Modified: sandbox/rfc90/MgDev/Common/Stylization/PolygonAdapter.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/PolygonAdapter.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/PolygonAdapter.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -20,7 +20,6 @@
#include "PolygonAdapter.h"
#include "LineBuffer.h"
#include "FeatureTypeStyleVisitor.h"
-#include "Foundation.h"
//////////////////////////////////////////////////////////////////////////////
Modified: sandbox/rfc90/MgDev/Common/Stylization/PolylineAdapter.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/PolylineAdapter.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/PolylineAdapter.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -20,7 +20,6 @@
#include "PolylineAdapter.h"
#include "LineBuffer.h"
#include "FeatureTypeStyleVisitor.h"
-#include "Foundation.h"
//////////////////////////////////////////////////////////////////////////////
Modified: sandbox/rfc90/MgDev/Common/Stylization/RS_FontEngine.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/RS_FontEngine.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/RS_FontEngine.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -20,7 +20,6 @@
#include "RS_FontEngine.h"
#include "RichTextEngine.h"
#include "SE_Renderer.h"
-#include "Foundation.h"
//////////////////////////////////////////////////////////////////////////////
@@ -798,8 +797,7 @@
}
}
- if (pRichTextEngine)
- delete pRichTextEngine;
+ delete pRichTextEngine;
}
Modified: sandbox/rfc90/MgDev/Common/Stylization/RasterAdapter.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/RasterAdapter.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/RasterAdapter.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -99,7 +99,7 @@
int devW = (int)(mapExt.width() * pixelsPerMapUnit);
int devH = (int)(mapExt.height() * pixelsPerMapUnit);
- while (imgW >= 2048 || imgH >= 2048)
+ while (imgW >= renderer->GetMaxRasterImageWidth() || imgH >= renderer->GetMaxRasterImageHeight())
{
imgW >>= 1;
imgH >>= 1;
@@ -195,8 +195,7 @@
{
RS_InputStream* pal = raster->GetPalette();
DecodeMapped(reader, pal, dst, imgW, imgH);
- if (pal)
- delete pal;
+ delete pal;
}
break;
case 1:
Modified: sandbox/rfc90/MgDev/Common/Stylization/Renderer.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/Renderer.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/Renderer.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -219,6 +219,14 @@
virtual double GetRasterGridSizeOverrideRatio() = 0;
virtual void SetRasterGridSizeOverrideRatio(double ratio) = 0;
+ // gets/sets the max width for raster image
+ virtual double GetMaxRasterImageWidth() = 0;
+ virtual void SetMaxRasterImageWidth(int width) = 0;
+
+ // gets/sets the max height for raster image
+ virtual double GetMaxRasterImageHeight() = 0;
+ virtual void SetMaxRasterImageHeight(int height) = 0;
+
// flags whether the renderer processes tooltip expressions
virtual bool SupportsTooltips() = 0;
Modified: sandbox/rfc90/MgDev/Common/Stylization/RichTextEngine.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/RichTextEngine.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/RichTextEngine.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -43,11 +43,8 @@
delete pNext;
}
- if ( this->m_pHeadBlock )
- delete this->m_pHeadBlock;
-
- if ( this->m_pCurrLine )
- delete this->m_pCurrLine;
+ delete this->m_pHeadBlock;
+ delete this->m_pCurrLine;
}
@@ -1137,8 +1134,7 @@
{
size_t numComponents = this->m_components.size();
for ( size_t i=0; i<numComponents; ++i )
- if ( m_components[i] )
- delete this->m_components[i];
+ delete this->m_components[i];
}
void AtomBaseComponentCollection::AddComponent( AtomBaseComponent* pComponent )
Modified: sandbox/rfc90/MgDev/Common/Stylization/SE_AreaPositioning.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/SE_AreaPositioning.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/SE_AreaPositioning.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -17,7 +17,6 @@
#include "stdafx.h"
#include "SE_AreaPositioning.h"
-#include "Foundation.h"
///////////////////////////////////////////////////////////////////////////////
Modified: sandbox/rfc90/MgDev/Common/Stylization/SE_ExpressionBase.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/SE_ExpressionBase.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/SE_ExpressionBase.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -18,10 +18,7 @@
#include "stdafx.h"
#include "SE_ExpressionBase.h"
#include "StylizationEngine.h"
-#include "Foundation.h"
-
#include "SimpleSymbolDefinition.h"
-
#include <wctype.h>
using namespace MDFMODEL_NAMESPACE;
@@ -345,16 +342,20 @@
// string must start with a single quote
if (*str++ == sExprSingleQuote)
{
- while (*str != L'\0' && *str != sExprSingleQuote)
+ // make sure we have at least one more character
+ if (*str++ == L'\0')
+ return false;
+
+ // move to the end of the string
+ while (*str != L'\0')
str++;
+ // back up one character
+ str--;
+
// string must have a matching closing single quote
- if (*str++ == sExprSingleQuote)
- {
- // closing single quote must be the last character of the string
- if (*str == L'\0')
- return true;
- }
+ if (*str == sExprSingleQuote)
+ return true;
}
return false;
Modified: sandbox/rfc90/MgDev/Common/Stylization/SE_LineBuffer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/SE_LineBuffer.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/SE_LineBuffer.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -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;
}
}
@@ -298,6 +305,55 @@
}
+SE_EllipseDef* SE_LineBuffer::GetEllipseDefinition(int index)
+{
+ SE_LB_SegType* endseg = m_segs + m_nsegs;
+ SE_LB_SegType* curseg = m_segs;
+
+ SE_EllipseDef* arc_def = NULL; // output
+ int arc_idx = 0; // elliptical arcs counter
+
+ int src_idx = 0;
+
+ // Locate the arc start in the array of points
+ while (curseg != endseg && arc_idx <= index)
+ {
+ switch (*curseg++)
+ {
+ case SegType_MoveTo:
+ case SegType_LineTo:
+ src_idx += 2;
+ break;
+
+ case SegType_EllipticalArc:
+ {
+ if (arc_idx == index)
+ {
+ // Arc found
+ arc_def = new SE_EllipseDef;
+
+ arc_def->cx = m_pts[src_idx++];
+ arc_def->cy = m_pts[src_idx++];
+ arc_def->rx = m_pts[src_idx++];
+ arc_def->ry = m_pts[src_idx++];
+ arc_def->sAng = m_pts[src_idx++];
+ arc_def->eAng = m_pts[src_idx++];
+ arc_def->rot = m_pts[src_idx++];
+ arc_def->xf = m_xf;
+ }
+ else
+ src_idx += 7; // continue
+
+ arc_idx++;
+ }
+ break;
+ }
+ }
+
+ return arc_def;
+}
+
+
void SE_LineBuffer::Transform(const SE_Matrix& xform, double tolerance)
{
if (m_xf_bounds)
Modified: sandbox/rfc90/MgDev/Common/Stylization/SE_LineBuffer.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/SE_LineBuffer.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/SE_LineBuffer.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -26,6 +26,20 @@
class SE_BufferPool;
+// Ellipse definition
+struct SE_EllipseDef
+{
+ double cx; // X center
+ double cy; // Y center
+ double rx; // major radius
+ double ry; // minor radius
+ double sAng; // start angle
+ double eAng; // start angle
+ double rot; // rotation
+ SE_Matrix xf; // scale matrix
+};
+
+
class SE_LineBuffer
{
friend class SE_BufferPool;
@@ -71,6 +85,18 @@
STYLIZATION_API SE_LineBuffer* Clone(bool keepPool = true);
+ // Retrieve the elliptical arc parameters
+ // index - the index of the arc in the symbol, zero-based
+ //
+ // E.g. for a buffer with:
+ // M L L M A0 M A1
+ // M=MoveTo, L=LineTo, A=ArcTo
+ // GetEllipseDefinition would return arc segment A0 for index=0,
+ // and arc segment A1 for index=1.
+ //
+ // Caller has to check for NULL and delete the returned object.
+ STYLIZATION_API SE_EllipseDef* GetEllipseDefinition(int index);
+
private:
SE_Bounds* GetSEBounds(RS_Bounds& bounds);
void PopulateXFBuffer();
Modified: sandbox/rfc90/MgDev/Common/Stylization/SE_LineRenderer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/SE_LineRenderer.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/SE_LineRenderer.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -16,7 +16,7 @@
//
#include "stdafx.h"
-#include "SE_LineRenderer.h"
+#include "SE_Renderer.h"
#include "SE_BufferPool.h"
#include "RS_FontEngine.h"
@@ -210,14 +210,21 @@
//
// ============================================================================
-void SE_LineRenderer::ProcessLineOverlapWrap(SE_Renderer* renderer, LineBuffer* geometry, SE_RenderLineStyle* style)
+void SE_Renderer::ProcessLineOverlapWrap(LineBuffer* geometry, SE_RenderLineStyle* style)
{
- SE_BufferPool* lbp = renderer->GetBufferPool();
+ _ASSERT(style->repeat > 0.0);
- SE_RenderPrimitiveList& rs = style->symbol;
+ // the style needs to contain at least one primitive
+ SE_RenderPrimitiveList& prims = style->symbol;
+ if (prims.size() == 0)
+ return;
- RS_FontEngine* fe = renderer->GetRSFontEngine();
+ SE_BufferPool* lbp = GetBufferPool();
+ RS_FontEngine* fe = GetRSFontEngine();
+
+ double px2su = GetScreenUnitsPerPixel();
+
RS_Bounds styleBounds(DBL_MAX, DBL_MAX, -DBL_MAX, -DBL_MAX);
styleBounds.add_point(style->bounds[0]);
styleBounds.add_point(style->bounds[1]);
@@ -227,12 +234,6 @@
double affected_height = rs_max(fabs(styleBounds.miny), fabs(styleBounds.maxy));
double affected_height_inv = (affected_height > 0.0)? 1.0 / affected_height : 0.0;
- double increment = style->repeat;
- _ASSERT(increment > 0.0);
-
- double startOffsetMax = rs_max(style->startOffset, 0.0);
- double endOffsetMax = rs_max(style->endOffset, 0.0);
-
bool roundJoin = (style->vertexJoin == SE_LineJoin_Round);
// get the size of the largest contour so we can pre-allocate hotspots for it
@@ -257,11 +258,11 @@
// in the symbol. We need this because straight lines become curved when
// the warping is applied.
int maxChoppedSize = 0;
- choppedBuffers = (LineBuffer**)alloca(rs.size() * sizeof(LineBuffer*));
- memset(choppedBuffers, 0, rs.size() * sizeof(LineBuffer*));
- for (unsigned cur_prim=0; cur_prim<rs.size(); ++cur_prim)
+ choppedBuffers = (LineBuffer**)alloca(prims.size() * sizeof(LineBuffer*));
+ memset(choppedBuffers, 0, prims.size() * sizeof(LineBuffer*));
+ for (unsigned cur_prim=0; cur_prim<prims.size(); ++cur_prim)
{
- SE_RenderPrimitive* primitive = rs[cur_prim];
+ SE_RenderPrimitive* primitive = prims[cur_prim];
if (primitive->type == SE_RenderPrimitive_Polygon || primitive->type == SE_RenderPrimitive_Polyline)
{
@@ -269,20 +270,20 @@
// create the chopped up LineBuffer for this primitive
choppedBuffers[cur_prim] = LineBufferPool::NewLineBuffer(lbp, 128, FdoDimensionality_XY, true);
- SE_LineRenderer::ChopLineBuffer(renderer, pl->geometry->xf_buffer(), choppedBuffers[cur_prim]);
+ ChopLineBuffer(pl->geometry->xf_buffer(), choppedBuffers[cur_prim]);
// update rendering attributes to account for the selection mode - it's
// ok to update these attributes and not revert them
- if (renderer->m_bSelectionMode)
+ if (m_bSelectionMode)
{
if (primitive->type == SE_RenderPrimitive_Polygon)
{
SE_RenderPolygon* pl = (SE_RenderPolygon*)primitive;
- pl->fill = renderer->m_selFillColor;
+ pl->fill = m_selFillColor;
}
- pl->lineStroke.color = renderer->m_selLineStroke.color;
- pl->lineStroke.weight = renderer->m_selLineStroke.weight;
+ pl->lineStroke.color = m_selLineStroke.color;
+ pl->lineStroke.weight = m_selLineStroke.weight;
}
}
else if (primitive->type == SE_RenderPrimitive_Text)
@@ -295,12 +296,12 @@
// update rendering attributes to account for the selection mode - it's
// ok to update these attributes and not revert them
- if (renderer->m_bSelectionMode)
+ if (m_bSelectionMode)
{
- tp->tdef.textcolor() = renderer->m_textForeColor;
- tp->tdef.ghostcolor() = renderer->m_textBackColor;
-// tp->tdef.framecolor() = renderer->m_textBackColor;
-// tp->tdef.opaquecolor() = renderer->m_textBackColor;
+ tp->tdef.textcolor() = m_textForeColor;
+ tp->tdef.ghostcolor() = m_textBackColor;
+// tp->tdef.framecolor() = m_textBackColor;
+// tp->tdef.opaquecolor() = m_textBackColor;
}
}
else if (primitive->type == SE_RenderPrimitive_Raster)
@@ -334,9 +335,34 @@
// make a list of hotspots where we go from one join to another
// or from join to straight line or from straight line to join
- int ptCount = SE_LineRenderer::ConfigureHotSpots(renderer, geometry, cur_contour, style, styleBounds, hotspots);
+ int ptCount = ConfigureHotSpots(geometry, cur_contour, style, styleBounds, hotspots);
double total_length = hotspots[ptCount-1].mid;
+ // get the distribution for the current contour
+ double repeat = style->repeat;
+ double startOffset = style->startOffset;
+ double endOffset = style->endOffset;
+ if (style->unitsControl == SE_UnitsControl_Parametric)
+ {
+ repeat *= total_length;
+ startOffset *= total_length;
+ endOffset *= total_length;
+
+ // It makes no sense to distribute symbols using a repeat value
+ // which is much less than one pixel. We'll scale up any value
+ // less than 0.25 to 0.5.
+ if (repeat > 0.0 && repeat < 0.25*px2su)
+ {
+ // just increase it by an integer multiple so the overall
+ // distribution isn't affected
+ int factor = (int)(0.5*px2su / repeat);
+ repeat *= factor;
+ }
+ }
+
+ double startOffsetMax = rs_max(startOffset, 0.0);
+ double endOffsetMax = rs_max(endOffset, 0.0);
+
// check if:
// - the start offset goes beyond the end of the contour
// - the end offset goes beyond the beginning of the contour
@@ -353,22 +379,22 @@
// calculate the initial draw position
double drawpos = startpos;
- if (style->startOffset < 0.0 && style->endOffset >= 0.0)
+ if (startOffset < 0.0 && endOffset >= 0.0)
{
// only end offset is specified - adjust the draw position so we
- // have: endpos = drawpos + i*increment
- drawpos = fmod(endpos, increment);
+ // have: endpos = drawpos + i*repeat
+ drawpos = fmod(endpos, repeat);
- // reduce the draw position by one increment if the initial style would
+ // reduce the draw position by one repeat if the initial style would
// still display
- if (drawpos - increment + styleBounds.maxx >= 0.0)
- drawpos -= increment;
+ if (drawpos - repeat + styleBounds.maxx >= 0.0)
+ drawpos -= repeat;
// Roundoff error can lead to the final symbol position being slightly
// greater than endpos, which could lead to additional undesireable
// clipping of the final symbol. Prevent this by reducing drawpos
- // slightly (a fraction of the increment).
- drawpos -= 1.0e-10 * increment;
+ // slightly (a fraction of the repeat).
+ drawpos -= 1.0e-10 * repeat;
}
// cache these for later use
@@ -411,9 +437,9 @@
{
// We're not yet in danger of a corner (or the start/end of the distribution).
// Just put the pedal to the metal and draw an unwarped symbol.
- renderer->DrawSymbol(rs, xformStart, next_hotspot->angle_start);
+ DrawSymbol(prims, xformStart, next_hotspot->angle_start);
- drawpos += increment;
+ drawpos += repeat;
sym_minx = drawpos + styleBounds.minx;
sym_maxx = drawpos + styleBounds.maxx;
}
@@ -425,9 +451,9 @@
double last_angleRad = 0.0;
// loop over the symbol's primitive elements - we will handle them one by one
- for (unsigned cur_prim=0; cur_prim<rs.size(); ++cur_prim)
+ for (unsigned cur_prim=0; cur_prim<prims.size(); ++cur_prim)
{
- SE_RenderPrimitive* primitive = rs[cur_prim];
+ SE_RenderPrimitive* primitive = prims[cur_prim];
// initialize our work buffer to the chopped line buffer
geom = *choppedBuffers[cur_prim];
@@ -843,14 +869,14 @@
geomToDraw = NULL;
else
{
- geomToDraw = SE_LineRenderer::ClipPolygon(lbp, geom, startpos, endpos);
+ geomToDraw = ClipPolygon(lbp, geom, startpos, endpos);
spLB.reset(geomToDraw);
}
}
if (geomToDraw)
{
- renderer->DrawScreenPolygon(geomToDraw, NULL, pl->fill);
+ DrawScreenPolygon(geomToDraw, NULL, pl->fill);
if (spLB.get())
LineBufferPool::FreeLineBuffer(lbp, spLB.release());
}
@@ -877,14 +903,14 @@
geomToDraw = NULL;
else
{
- geomToDraw = SE_LineRenderer::ClipPolyline(lbp, geom, startpos, endpos);
+ geomToDraw = ClipPolyline(lbp, geom, startpos, endpos);
spLB.reset(geomToDraw);
}
}
if (geomToDraw)
{
- renderer->DrawScreenPolyline(geomToDraw, NULL, pl->lineStroke);
+ DrawScreenPolyline(geomToDraw, NULL, pl->lineStroke);
if (spLB.get())
LineBufferPool::FreeLineBuffer(lbp, spLB.release());
}
@@ -911,7 +937,7 @@
// We must recalculate the text metrics with the new tdef before we can call DrawScreenText.
RS_TextMetrics tm;
if (fe->GetTextMetrics(tp->content, tdef, tm, false))
- renderer->DrawScreenText(tm, tdef, x, y, NULL, 0, 0.0);
+ DrawScreenText(tm, tdef, x, y, NULL, 0, 0.0);
}
}
break;
@@ -933,7 +959,7 @@
geom.get_point(0, x, y);
double angleDeg = (rp->angleRad + last_angleRad) * M_180PI;
- renderer->DrawScreenRaster(imgData.data, imgData.size, imgData.format, imgData.width, imgData.height, x, y, rp->extent[0], rp->extent[1], angleDeg);
+ DrawScreenRaster(imgData.data, imgData.size, imgData.format, imgData.width, imgData.height, x, y, rp->extent[0], rp->extent[1], angleDeg);
}
}
}
@@ -942,7 +968,7 @@
}
// we're finally done with the symbol draw, so move forward by the repeat amount
- drawpos += increment;
+ drawpos += repeat;
sym_minx = drawpos + styleBounds.minx;
sym_maxx = drawpos + styleBounds.maxx;
@@ -963,7 +989,7 @@
// free the chopped line buffers
if (choppedBuffers)
{
- for (unsigned cur_prim=0; cur_prim<rs.size(); ++cur_prim)
+ for (unsigned cur_prim=0; cur_prim<prims.size(); ++cur_prim)
{
if (choppedBuffers[cur_prim] != NULL)
LineBufferPool::FreeLineBuffer(lbp, choppedBuffers[cur_prim]);
@@ -976,8 +1002,8 @@
// This method configures hotspots for the supplied feature geometry.
// Hotspots contain all the information needed to render the warped
// symbol distribution for the polyline.
-int SE_LineRenderer::ConfigureHotSpots(SE_Renderer* renderer, LineBuffer* geometry, int cur_contour,
- SE_RenderLineStyle* style, RS_Bounds& styleBounds, HotSpot* hotspots)
+int SE_Renderer::ConfigureHotSpots(LineBuffer* geometry, int cur_contour, SE_RenderLineStyle* style,
+ RS_Bounds& styleBounds, HotSpot* hotspots)
{
// This value is used when computing the miter warping. The maximum
// warp occurs at + or - affected_height from the centerline and all
@@ -987,7 +1013,7 @@
bool is_closed = geometry->contour_closed(cur_contour);
// initialize hotspot vertices to the set of reduced points
- int ptCount = SE_LineRenderer::ComputePoints(renderer, geometry, cur_contour, hotspots);
+ int ptCount = ComputePoints(geometry, cur_contour, hotspots);
_ASSERT(ptCount >= 2);
// compute the parametric positions and entry/exit angles for the hotspots
@@ -1416,7 +1442,7 @@
// Flip the angles for renderers with Y pointing down, since they were computed
// from screen points. The sin/cos values for the angles must stay in screen
// space, however.
- if (!renderer->YPointsUp())
+ if (!YPointsUp())
{
for (int i=0; i<ptCount; ++i)
{
@@ -1435,9 +1461,9 @@
// the hotspot vertices to the reduced set of points.
// TODO: WCW - enhance the point reduction to replace each blob of
// closely spaced points with its average position
-int SE_LineRenderer::ComputePoints(SE_Renderer* renderer, LineBuffer* geometry, int cur_contour, HotSpot* hotspots)
+int SE_Renderer::ComputePoints(LineBuffer* geometry, int cur_contour, HotSpot* hotspots)
{
- double ds = renderer->GetDrawingScale();
+ double ds = GetDrawingScale();
double d2min = ds*ds*OPTIMIZE_DISTANCE_SQ;
// start index and number of points in the point array for current contour
@@ -1467,7 +1493,7 @@
skipped = false;
- renderer->WorldToScreenPoint(x, y, hotspots[ptCount].x, hotspots[ptCount].y);
+ WorldToScreenPoint(x, y, hotspots[ptCount].x, hotspots[ptCount].y);
++ptCount;
lastx = x;
@@ -1485,7 +1511,7 @@
if (x == lastx && y == lasty)
{
// use an offset of 0.1 pixels
- double offset = 0.1*renderer->GetScreenUnitsPerPixel();
+ double offset = 0.1*GetScreenUnitsPerPixel();
// they're identical - add a second hotspot and adjust both so we
// have a short (yet valid) segment centered about the original point
@@ -1514,7 +1540,7 @@
if (skipped)
{
// the last point is still stored in x,y
- renderer->WorldToScreenPoint(x, y, hotspots[ptCount-1].x, hotspots[ptCount-1].y);
+ WorldToScreenPoint(x, y, hotspots[ptCount-1].x, hotspots[ptCount-1].y);
}
return ptCount;
@@ -1522,9 +1548,9 @@
///////////////////////////////////////////////////////////////////////////////
-void SE_LineRenderer::ChopLineBuffer(SE_Renderer* renderer, LineBuffer* inBuffer, LineBuffer* outBuffer)
+void SE_Renderer::ChopLineBuffer(LineBuffer* inBuffer, LineBuffer* outBuffer)
{
- double pixelsPerScreenUnit = 1.0 / renderer->GetScreenUnitsPerPixel();
+ double pixelsPerScreenUnit = 1.0 / GetScreenUnitsPerPixel();
for (int j=0; j<inBuffer->cntr_count(); ++j)
{
@@ -1607,7 +1633,7 @@
// Clips a polyline against the clip region. A new contour is created
// each time the polyline passes a clip boundary. The algorithm is just
// Cohen-Sutherland modified for 1D clipping (using the parameter Z).
-LineBuffer* SE_LineRenderer::ClipPolyline(LineBufferPool* lbp, LineBuffer& geometry, double zMin, double zMax)
+LineBuffer* SE_Renderer::ClipPolyline(LineBufferPool* lbp, LineBuffer& geometry, double zMin, double zMax)
{
// need at least two points
if (geometry.point_count() < 2)
@@ -1640,7 +1666,7 @@
{
geometry.get_point(i-1, aline[0], aline[1], aline[4]);
geometry.get_point(i , aline[2], aline[3], aline[5]);
- int res = SE_LineRenderer::ClipLine(zMin, zMax, aline, bline);
+ int res = ClipLine(zMin, zMax, aline, bline);
if (res == 0)
{
@@ -1677,7 +1703,7 @@
///////////////////////////////////////////////////////////////////////////////
// Clips a polygon against the clip region. The algorithm is just
// Sutherland-Hodgman modified for 1D clipping (using the parameter Z).
-LineBuffer* SE_LineRenderer::ClipPolygon(LineBufferPool* lbp, LineBuffer& geometry, double zMin, double zMax)
+LineBuffer* SE_Renderer::ClipPolygon(LineBufferPool* lbp, LineBuffer& geometry, double zMin, double zMax)
{
// need at least two points
if (geometry.point_count() < 3)
@@ -1717,7 +1743,7 @@
{
geometry.get_point(i-1, aline[0], aline[1], aline[4]);
geometry.get_point(i , aline[2], aline[3], aline[5]);
- int res = SE_LineRenderer::ClipLine(zMin, zMax, aline, bline);
+ int res = ClipLine(zMin, zMax, aline, bline);
if (res == 0)
{
@@ -1766,7 +1792,7 @@
#define LEFT 0x01
#define RIGHT 0x02
-int SE_LineRenderer::ClipLine(double zMin, double zMax, double* line, double* ret)
+int SE_Renderer::ClipLine(double zMin, double zMax, double* line, double* ret)
{
ret[0] = line[0];
ret[1] = line[1];
@@ -1774,8 +1800,8 @@
ret[3] = line[3];
// compute the initial clip codes for the endpoints
- int clipCode1 = SE_LineRenderer::ClipCode(zMin, zMax, line[4]);
- int clipCode2 = SE_LineRenderer::ClipCode(zMin, zMax, line[5]);
+ int clipCode1 = ClipCode(zMin, zMax, line[4]);
+ int clipCode2 = ClipCode(zMin, zMax, line[5]);
// trivially reject or accept the line segment
if ((clipCode1 & clipCode2) != 0) // both points left or both points right
@@ -1822,7 +1848,7 @@
///////////////////////////////////////////////////////////////////////////////
// Returns whether a point is inside the clip region, or to the left or right.
-int SE_LineRenderer::ClipCode(double zMin, double zMax, double z)
+int SE_Renderer::ClipCode(double zMin, double zMax, double z)
{
if (z < zMin)
return LEFT;
@@ -1832,3 +1858,1072 @@
return INSIDE;
}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Distributes symbols along a polyline using the OverlapNone vertex control option.
+void SE_Renderer::ProcessLineOverlapNone(LineBuffer* geometry, SE_RenderLineStyle* style)
+{
+ _ASSERT(style->repeat > 0.0);
+
+ // the style needs to contain at least one primitive
+ SE_RenderPrimitiveList& prims = style->symbol;
+ if (prims.size() == 0)
+ return;
+
+ SE_Matrix symxf;
+ bool yUp = YPointsUp();
+ double px2su = GetScreenUnitsPerPixel();
+
+ double baseAngleRad = style->angleRad;
+
+ // precompute these - these are in renderer space, hence the check for yUp with the sine
+ double baseAngleCos = cos(baseAngleRad);
+ double baseAngleSin = sin(yUp? baseAngleRad : -baseAngleRad);
+
+ // account for any viewport rotation
+ double w2sAngleRad = GetWorldToScreenRotation();
+
+ double angleRad, angleCos, angleSin;
+ if (w2sAngleRad == 0.0)
+ {
+ angleRad = baseAngleRad;
+ angleCos = baseAngleCos;
+ angleSin = baseAngleSin;
+ }
+ else
+ {
+ angleRad = baseAngleRad + w2sAngleRad;
+ angleCos = cos(angleRad);
+ angleSin = sin(yUp? angleRad : -angleRad);
+ }
+
+ // screen coordinates of current line segment
+ double segX0, segY0, segX1, segY1;
+
+ // this is the same for all contours / groups
+ double leftEdge = style->bounds[0].x;
+ double rightEdge = style->bounds[1].x;
+
+ // get segment lengths
+ double* segLens = (double*)alloca(sizeof(double)*geometry->point_count());
+ ComputeSegmentLengths(geometry, segLens);
+
+ // used for segment group calculations
+ int* segGroups = (int*)alloca(2*sizeof(int)*geometry->point_count());
+ double* groupLens = (double*)alloca(sizeof(double)*geometry->point_count());
+
+ // configure the default path line stroke to use
+ SE_LineStroke dpLineStroke = style->dpLineStroke;
+ if (m_bSelectionMode)
+ {
+ dpLineStroke.color = m_selLineStroke.color;
+ dpLineStroke.weight = m_selLineStroke.weight;
+ }
+
+ // Used for drawing the centerline paths at vertices. In the case of
+ // a single contour the start/end points will need a MoveTo/LineTo,
+ // while the interior points will need a MoveTo/LineTo/LineTo.
+ LineBuffer vertexLines(3*geometry->point_count()-2);
+
+ // iterate over the contours
+ for (int j=0; j<geometry->cntr_count(); ++j)
+ {
+ // get starting segment for current contour
+ int start_seg_contour = geometry->contour_start_point(j);
+
+ // skip zero-length contours
+ if (segLens[start_seg_contour] == 0.0)
+ continue;
+
+ // get the distribution for the current contour
+ double repeat = style->repeat;
+ double startOffset = style->startOffset;
+ double endOffset = style->endOffset;
+ if (style->unitsControl == SE_UnitsControl_Parametric)
+ {
+ repeat *= segLens[start_seg_contour];
+ startOffset *= segLens[start_seg_contour];
+ endOffset *= segLens[start_seg_contour];
+
+ // It makes no sense to distribute symbols using a repeat value
+ // which is much less than one pixel. We'll scale up any value
+ // less than 0.25 to 0.5.
+ if (repeat > 0.0 && repeat < 0.25*px2su)
+ {
+ // just increase it by an integer multiple so the overall
+ // distribution isn't affected
+ int factor = (int)(0.5*px2su / repeat);
+ repeat *= factor;
+ }
+ }
+
+ // check if:
+ // - the start offset goes beyond the end of the contour
+ // - the end offset goes beyond the beginning of the contour
+ // - the start offset goes beyond the end offset
+ double offsetSum = rs_max(startOffset, 0.0) + rs_max(endOffset, 0.0);
+ if (offsetSum > segLens[start_seg_contour])
+ continue;
+
+ // compute the segment groups for this contour based on the vertex angle limit
+ int numGroups = ComputeSegmentGroups(geometry, j, style->vertexAngleLimit, segLens, segGroups);
+ if (numGroups == 0)
+ continue;
+
+ // compute the group lengths
+ ComputeGroupLengths(segLens, numGroups, segGroups, groupLens);
+
+ // for this vertex control option we set the offsets to zero if they're unspecified
+ startOffset = rs_max(startOffset, 0.0);
+ endOffset = rs_max(endOffset, 0.0);
+
+ // compute the starting group based on the style's start offset
+ int start_group = 0;
+ if (startOffset > 0.0)
+ {
+ for (int k=0; k<numGroups; ++k)
+ {
+ if (startOffset < groupLens[k])
+ {
+ start_group = k;
+ break;
+ }
+
+ // adjust the start offset so it's relative to the starting group
+ startOffset -= groupLens[k];
+ }
+ }
+
+ // compute the ending group based on the style's end offset
+ int end_group = numGroups-1;
+ if (endOffset > 0.0)
+ {
+ for (int k=numGroups-1; k>=0; --k)
+ {
+ if (endOffset < groupLens[k])
+ {
+ end_group = k;
+ break;
+ }
+
+ // adjust the end offset so it's relative to the ending group
+ endOffset -= groupLens[k];
+ }
+ }
+
+ // iterate over the relevant groups
+ for (int k=start_group; k<=end_group; ++k)
+ {
+ // get segment range for current group
+ int start_seg = segGroups[2*k];
+ int end_seg = segGroups[2*k+1];
+ int cur_seg = start_seg;
+
+ // get the actual start / end offsets for the current group
+ // - for the first group its start offset is the specified value, while
+ // for subsequent groups it's zero (we draw a symbol directly at the
+ // start of the group)
+ // - for the last group the end offset is the specified value, while for
+ // prior groups it's zero (we draw a symbol directly at the end of the
+ // group)
+ double startOffsetGroup = (k == start_group)? startOffset : 0.0;
+ double endOffsetGroup = (k == end_group)? endOffset : 0.0;
+
+ // Compute the symbol distribution for the group. The drawpos variable
+ // is the position of the first symbol. If gap is > 0 then the next symbol
+ // is offset by that amount. Subsequent symbols are then offset by the
+ // repeat, except for the last one which is again offset by the gap.
+ //
+ // Here's a graphical depiction:
+ //
+ // |-----+-----+---+---+---+-----+--------|
+ // s d | \__|__/ | e
+ // t r g r g n
+ // a a a e a d
+ // r w p p p
+ // t p e
+ // o a
+ // s t
+ int numSymbols = 0;
+ double drawpos = startOffsetGroup;
+ double gap = 0.0;
+ ComputeGroupDistribution(groupLens[k], startOffsetGroup, endOffsetGroup, repeat,
+ rightEdge - leftEdge, drawpos, gap, numSymbols);
+ if (numSymbols == 0)
+ continue;
+
+ //-------------------------------------------------------
+ // draw symbols along the group
+ //-------------------------------------------------------
+
+ int numDrawn = 0;
+ double increment;
+
+ // get start point of first segment in screen space
+ WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX0, segY0);
+
+ while (cur_seg < end_seg)
+ {
+ ++cur_seg;
+
+ // skip zero-length segments - no need to update the start/end points
+ double len = segLens[cur_seg];
+ if (len == 0.0)
+ continue;
+
+ // get end point of current segment in screen space
+ WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX1, segY1);
+
+ // if our draw position falls within this segment then process
+ if (drawpos <= len)
+ {
+ // compute linear deltas for x and y directions - we will use these
+ // to quickly move along the line without having to do too much math
+ double invlen = 1.0 / len;
+ double dx_incr = (segX1 - segX0) * invlen;
+ double dy_incr = (segY1 - segY0) * invlen;
+
+ if (style->angleControl == SE_AngleControl_FromGeometry)
+ {
+ angleCos = dx_incr*baseAngleCos - dy_incr*baseAngleSin;
+ angleSin = dy_incr*baseAngleCos + dx_incr*baseAngleSin;
+ angleRad = atan2(dy_incr, dx_incr);
+
+ // since dy_incr and dx_incr are in renderer space we need to
+ // negate the angle if y points down
+ if (!yUp)
+ angleRad = -angleRad;
+
+ angleRad += baseAngleRad;
+ }
+ double tx = segX0 + dx_incr * drawpos;
+ double ty = segY0 + dy_incr * drawpos;
+
+ symxf.setIdentity();
+ symxf.rotate(angleSin, angleCos);
+ symxf.translate(tx, ty);
+
+ // loop-draw the symbol along the current segment, incrementing
+ // the draw position by the appropriate amount
+ while (drawpos <= len && numDrawn < numSymbols)
+ {
+ // in the case of labels we only draw them at the interior points
+ if (style->drawLast)
+ {
+ if (numDrawn > 0 && numDrawn < numSymbols-1)
+ AddLabel(geometry, style, symxf, angleRad);
+ }
+ else
+ {
+ // handle the centerline path at the group's start
+ if (numDrawn == 0)
+ {
+ // This is the first time drawing anything for this group. If
+ // this is the starting group, then initialize the centerline
+ // path at the group's start. If it's not the starting group
+ // then we'll add LineTo segments (see further down) to the
+ // existing centerline path at the previous group's end.
+ if (k == start_group)
+ vertexLines.MoveTo(symxf.x2, symxf.y2);
+ }
+ else if (numDrawn == 1 && numSymbols > 2)
+ {
+ // finish and draw the centerline path at the group's start,
+ // aligning it with the left edge of the symbol
+ // TODO: account for symbol rotation
+ vertexLines.LineTo(symxf.x2 + dx_incr*leftEdge, symxf.y2 + dy_incr*leftEdge);
+ DrawScreenPolyline(&vertexLines, NULL, dpLineStroke);
+ vertexLines.Reset();
+ }
+
+ // only draw symbols at the interior points
+ if (numDrawn > 0 && numDrawn < numSymbols-1)
+ DrawSymbol(prims, symxf, angleRad, style->addToExclusionRegion);
+
+ // handle the centerline path at the group's end - only
+ // need to do this if we have at least one interior symbol
+ if (numDrawn == numSymbols-2 && numSymbols > 2)
+ {
+ // initialize the centerline path at the group's end,
+ // aligning it with the right edge of the symbol
+ // TODO: account for symbol rotation
+ vertexLines.MoveTo(symxf.x2 + dx_incr*rightEdge, symxf.y2 + dy_incr*rightEdge);
+ }
+ else if (numDrawn == numSymbols-1)
+ {
+ // This is the last time drawing anything for this group, so
+ // finish the centerline path at the group's end. If this is
+ // the ending group, then also draw it. If it's not the ending
+ // group then we'll draw it up above when we finish the centerline
+ // path at the next group's start.
+ vertexLines.LineTo(symxf.x2, symxf.y2);
+ if (k == end_group)
+ {
+ DrawScreenPolyline(&vertexLines, NULL, dpLineStroke);
+ vertexLines.Reset();
+ }
+ }
+ }
+
+ ++numDrawn;
+
+ // move forward
+ increment = repeat;
+ if (gap != 0.0)
+ {
+ // if we have a gap, then use it after drawing the first
+ // symbol and before drawing the last symbol
+ if (numSymbols == 2)
+ {
+ // in this case the gap takes us until the end
+ increment = gap;
+ }
+ else
+ {
+ if (numDrawn == 1)
+ increment = gap - leftEdge;
+ else if (numDrawn == numSymbols - 1)
+ increment = gap + rightEdge;
+ }
+ }
+
+ symxf.translate(dx_incr*increment, dy_incr*increment);
+ drawpos += increment;
+ }
+ }
+
+ drawpos -= len;
+
+ // start point for next segment is current end point
+ segX0 = segX1;
+ segY0 = segY1;
+ }
+ }
+ }
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Distributes symbols along a polyline using the OverlapDirect vertex control option.
+// This setting is intended to only be used in the context of point symbols. These
+// symbols are simply drawn without any wrapping, truncation, or other modification.
+//
+// The following rules apply to the StartOffset and EndOffset parameters:
+// - if StartOffset is specified (>=0) then a symbol is drawn at the start
+// offset location
+// - if EndOffset is specified (>=0) then a symbol is drawn at the end
+// offset location
+// - if StartOffset and EndOffset are both specified but their sum is greater
+// than the contour length (EndOffset offset comes before StartOffset)
+// then no symbols are drawn
+// - if StartOffset and EndOffset are both unspecified (< 0) then no symbols
+// are drawn
+void SE_Renderer::ProcessLineOverlapDirect(LineBuffer* geometry, SE_RenderLineStyle* style)
+{
+ _ASSERT(style->repeat > 0.0);
+
+ // the style needs to contain at least one primitive
+ SE_RenderPrimitiveList& prims = style->symbol;
+ if (prims.size() == 0)
+ return;
+
+ SE_Matrix symxf;
+ bool yUp = YPointsUp();
+ double px2su = GetScreenUnitsPerPixel();
+
+ double baseAngleRad = style->angleRad;
+
+ // precompute these - these are in renderer space, hence the check for yUp with the sine
+ double baseAngleCos = cos(baseAngleRad);
+ double baseAngleSin = sin(yUp? baseAngleRad : -baseAngleRad);
+
+ // account for any viewport rotation
+ double w2sAngleRad = GetWorldToScreenRotation();
+
+ double angleRad, angleCos, angleSin;
+ if (w2sAngleRad == 0.0)
+ {
+ angleRad = baseAngleRad;
+ angleCos = baseAngleCos;
+ angleSin = baseAngleSin;
+ }
+ else
+ {
+ angleRad = baseAngleRad + w2sAngleRad;
+ angleCos = cos(angleRad);
+ angleSin = sin(yUp? angleRad : -angleRad);
+ }
+
+ // screen coordinates of current line segment
+ double segX0, segY0, segX1, segY1;
+
+ // get segment lengths
+ double* segLens = (double*)alloca(sizeof(double)*geometry->point_count());
+ ComputeSegmentLengths(geometry, segLens);
+
+ // used for segment group calculations
+ int* segGroups = (int*)alloca(2*sizeof(int)*geometry->point_count());
+ double* groupLens = (double*)alloca(sizeof(double)*geometry->point_count());
+
+ // iterate over the contours
+ for (int j=0; j<geometry->cntr_count(); ++j)
+ {
+ // get starting segment for current contour
+ int start_seg_contour = geometry->contour_start_point(j);
+
+ // skip zero-length contours
+ if (segLens[start_seg_contour] == 0.0)
+ continue;
+
+ // get the distribution for the current contour
+ double repeat = style->repeat;
+ double startOffset = style->startOffset;
+ double endOffset = style->endOffset;
+ if (style->unitsControl == SE_UnitsControl_Parametric)
+ {
+ repeat *= segLens[start_seg_contour];
+ startOffset *= segLens[start_seg_contour];
+ endOffset *= segLens[start_seg_contour];
+
+ // It makes no sense to distribute symbols using a repeat value
+ // which is much less than one pixel. We'll scale up any value
+ // less than 0.25 to 0.5.
+ if (repeat > 0.0 && repeat < 0.25*px2su)
+ {
+ // just increase it by an integer multiple so the overall
+ // distribution isn't affected
+ int factor = (int)(0.5*px2su / repeat);
+ repeat *= factor;
+ }
+ }
+
+ // check if:
+ // - the start offset goes beyond the end of the contour
+ // - the end offset goes beyond the beginning of the contour
+ // - the start offset goes beyond the end offset
+ double offsetSum = rs_max(startOffset, 0.0) + rs_max(endOffset, 0.0);
+ if (offsetSum > segLens[start_seg_contour])
+ continue;
+
+ // compute the segment groups for this contour based on the vertex angle limit
+ int numGroups = ComputeSegmentGroups(geometry, j, style->vertexAngleLimit, segLens, segGroups);
+ if (numGroups == 0)
+ continue;
+
+ // compute the group lengths
+ ComputeGroupLengths(segLens, numGroups, segGroups, groupLens);
+
+ // compute the starting group based on the style's start offset
+ int start_group = 0;
+ if (startOffset > 0.0)
+ {
+ for (int k=0; k<numGroups; ++k)
+ {
+ if (startOffset < groupLens[k])
+ {
+ start_group = k;
+ break;
+ }
+
+ // adjust the start offset so it's relative to the starting group
+ startOffset -= groupLens[k];
+ }
+ }
+
+ // compute the ending group based on the style's end offset
+ int end_group = numGroups-1;
+ if (endOffset > 0.0)
+ {
+ for (int k=numGroups-1; k>=0; --k)
+ {
+ if (endOffset < groupLens[k])
+ {
+ end_group = k;
+ break;
+ }
+
+ // adjust the end offset so it's relative to the ending group
+ endOffset -= groupLens[k];
+ }
+ }
+
+ // iterate over the relevant groups
+ for (int k=start_group; k<=end_group; ++k)
+ {
+ // get segment range for current group
+ int start_seg = segGroups[2*k];
+ int end_seg = segGroups[2*k+1];
+ int cur_seg = start_seg;
+
+ // get the actual start / end offsets for the current group
+ // - for the first group its start offset is the specified value, while
+ // for subsequent groups it's zero (we draw a symbol directly at the
+ // start of the group)
+ // - for the last group the end offset is the specified value, while for
+ // prior groups it's zero (we draw a symbol directly at the end of the
+ // group)
+ double startOffsetGroup = (k == start_group)? startOffset : 0.0;
+ double endOffsetGroup = (k == end_group)? endOffset : 0.0;
+
+ // Compute the symbol distribution for the group. The drawpos variable
+ // is the position of the first symbol. If gap is > 0 then the next symbol
+ // is offset by that amount. Subsequent symbols are then offset by the
+ // repeat, except for the last one which is again offset by the gap.
+ //
+ // Here's a graphical depiction:
+ //
+ // |-----+-----+---+---+---+-----+--------|
+ // s d | \__|__/ | e
+ // t r g r g n
+ // a a a e a d
+ // r w p p p
+ // t p e
+ // o a
+ // s t
+ int numSymbols = 0;
+ double drawpos = startOffsetGroup;
+ double gap = 0.0;
+ ComputeGroupDistribution(groupLens[k], startOffsetGroup, endOffsetGroup, repeat, 0.0,
+ drawpos, gap, numSymbols);
+ if (numSymbols == 0)
+ continue;
+
+ //-------------------------------------------------------
+ // draw symbols along the group
+ //-------------------------------------------------------
+
+ int numDrawn = 0;
+ double increment;
+
+ // get start point of first segment in screen space
+ WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX0, segY0);
+
+ while (cur_seg < end_seg)
+ {
+ ++cur_seg;
+
+ // skip zero-length segments - no need to update the start/end points
+ double len = segLens[cur_seg];
+ if (len == 0.0)
+ continue;
+
+ // get end point of current segment in screen space
+ WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX1, segY1);
+
+ // if our draw position falls within this segment then process
+ if (drawpos <= len)
+ {
+ // compute linear deltas for x and y directions - we will use these
+ // to quickly move along the line without having to do too much math
+ double invlen = 1.0 / len;
+ double dx_incr = (segX1 - segX0) * invlen;
+ double dy_incr = (segY1 - segY0) * invlen;
+
+ if (style->angleControl == SE_AngleControl_FromGeometry)
+ {
+ angleCos = dx_incr*baseAngleCos - dy_incr*baseAngleSin;
+ angleSin = dy_incr*baseAngleCos + dx_incr*baseAngleSin;
+ angleRad = atan2(dy_incr, dx_incr);
+
+ // since dy_incr and dx_incr are in renderer space we need to
+ // negate the angle if y points down
+ if (!yUp)
+ angleRad = -angleRad;
+
+ angleRad += baseAngleRad;
+ }
+ double tx = segX0 + dx_incr * drawpos;
+ double ty = segY0 + dy_incr * drawpos;
+
+ symxf.setIdentity();
+ symxf.rotate(angleSin, angleCos);
+ symxf.translate(tx, ty);
+
+ // loop-draw the symbol along the current segment,
+ // incrementing the draw position by the appropriate amount
+ while (drawpos <= len && numDrawn < numSymbols)
+ {
+ // don't draw the same symbol once at the end of a group
+ // and again at the start of the next group
+ if (k == start_group || numDrawn > 0)
+ {
+ // draw the symbol at the current position
+ if (style->drawLast)
+ AddLabel(geometry, style, symxf, angleRad);
+ else
+ DrawSymbol(prims, symxf, angleRad, style->addToExclusionRegion);
+ }
+
+ ++numDrawn;
+
+ // move forward
+ increment = repeat;
+ if (gap != 0.0)
+ {
+ // if we have a gap, then use it after drawing the first
+ // symbol and before drawing the last symbol
+ if (numDrawn == 1 || numDrawn == numSymbols - 1)
+ increment = gap;
+ }
+
+ symxf.translate(dx_incr*increment, dy_incr*increment);
+ drawpos += increment;
+ }
+ }
+
+ drawpos -= len;
+
+ // start point for next segment is current end point
+ segX0 = segX1;
+ segY0 = segY1;
+ }
+ }
+ }
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Distributes feature labels along a polyline.
+void SE_Renderer::ProcessLineLabels(LineBuffer* geometry, SE_RenderLineStyle* style)
+{
+ // the style needs to contain at least one primitive
+ SE_RenderPrimitiveList& prims = style->symbol;
+ if (prims.size() == 0)
+ return;
+
+ SE_Matrix symxf;
+ bool yUp = YPointsUp();
+
+ double baseAngleRad = style->angleRad;
+
+ // precompute these - these are in renderer space, hence the check for yUp with the sine
+ double baseAngleCos = cos(baseAngleRad);
+ double baseAngleSin = sin(yUp? baseAngleRad : -baseAngleRad);
+
+ // account for any viewport rotation
+ double w2sAngleRad = GetWorldToScreenRotation();
+
+ double angleRad, angleCos, angleSin;
+ if (w2sAngleRad == 0.0)
+ {
+ angleRad = baseAngleRad;
+ angleCos = baseAngleCos;
+ angleSin = baseAngleSin;
+ }
+ else
+ {
+ angleRad = baseAngleRad + w2sAngleRad;
+ angleCos = cos(angleRad);
+ angleSin = sin(yUp? angleRad : -angleRad);
+ }
+
+ // screen coordinates of current line segment
+ double segX0, segY0, segX1, segY1;
+
+ // this is the same for all contours
+ double repeat = PATH_LABEL_SEPARATION_INCHES * MILLIMETERS_PER_INCH * GetScreenUnitsPerMillimeterDevice();
+ double leftEdge = style->bounds[0].x;
+ double rightEdge = style->bounds[1].x;
+ double symWidth = rightEdge - leftEdge;
+
+ // repeat needs to be the separation (end of one label to start of the
+ // next) plus the symbol width
+ repeat += symWidth;
+
+ // get the segment lengths
+ double* segLens = (double*)alloca(sizeof(double)*geometry->point_count());
+ ComputeSegmentLengths(geometry, segLens);
+
+ // iterate over the contours
+ for (int j=0; j<geometry->cntr_count(); ++j)
+ {
+ // get segment range for current contour
+ int start_seg = geometry->contour_start_point(j);
+ int end_seg = geometry->contour_end_point(j);
+
+ // skip contours shorter than the symbol width
+ double contourLen = segLens[start_seg];
+ if (contourLen <= symWidth)
+ continue;
+
+ // how many times should we repeat the symbol along the path?
+ // TODO: fine tune this formula
+ int numSymbols = 1 + (int)((contourLen - symWidth) / repeat);
+ double startOffset = 0.5*(contourLen - (numSymbols - 1) * repeat);
+
+ // account for the symbol's extent to properly center it
+ startOffset -= 0.5*(leftEdge + rightEdge);
+
+ //-------------------------------------------------------
+ // draw symbols along the contour
+ //-------------------------------------------------------
+
+ int numDrawn = 0;
+ int cur_seg = start_seg;
+ double drawpos = startOffset;
+
+ // get start point of first segment in screen space
+ WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX0, segY0);
+
+ while (cur_seg < end_seg)
+ {
+ ++cur_seg;
+
+ // skip zero-length segments - no need to update the start/end points
+ double len = segLens[cur_seg];
+ if (len == 0.0)
+ continue;
+
+ // get end point of current segment in screen space
+ WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX1, segY1);
+
+ // if our draw position falls within this segment then process
+ if (drawpos <= len)
+ {
+ // compute linear deltas for x and y directions - we will use these
+ // to quickly move along the line without having to do too much math
+ double invlen = 1.0 / len;
+ double dx_incr = (segX1 - segX0) * invlen;
+ double dy_incr = (segY1 - segY0) * invlen;
+
+ if (style->angleControl == SE_AngleControl_FromGeometry)
+ {
+ angleCos = dx_incr*baseAngleCos - dy_incr*baseAngleSin;
+ angleSin = dy_incr*baseAngleCos + dx_incr*baseAngleSin;
+ angleRad = atan2(dy_incr, dx_incr);
+
+ // since dy_incr and dx_incr are in renderer space we need to
+ // negate the angle if y points down
+ if (!yUp)
+ angleRad = -angleRad;
+
+ angleRad += baseAngleRad;
+ }
+ double tx = segX0 + dx_incr * drawpos;
+ double ty = segY0 + dy_incr * drawpos;
+
+ symxf.setIdentity();
+ symxf.rotate(angleSin, angleCos);
+ symxf.translate(tx, ty);
+
+ // loop-draw the symbol along the current segment, incrementing
+ // the draw position by the appropriate amount
+ while (drawpos <= len && numDrawn < numSymbols)
+ {
+ AddLabel(geometry, style, symxf, angleRad);
+ ++numDrawn;
+
+ // move forward
+ symxf.translate(dx_incr*repeat, dy_incr*repeat);
+ drawpos += repeat;
+ }
+ }
+
+ drawpos -= len;
+
+ // start point for next segment is current end point
+ segX0 = segX1;
+ segY0 = segY1;
+ }
+ }
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// This method computes the segment lengths for the geometry. For a given
+// contour with N points starting at index M, the length for the entire
+// contour is stored at location M, while the segment lengths are stored at
+// locations M+n, n=[1, N-1].
+void SE_Renderer::ComputeSegmentLengths(LineBuffer* geometry, double* segLens)
+{
+ // screen coordinates of current line segment
+ double segX0, segY0, segX1, segY1;
+
+ // iterate over the contours
+ for (int j=0; j<geometry->cntr_count(); ++j)
+ {
+ // get segment range for current contour
+ int start_seg = geometry->contour_start_point(j);
+ int end_seg = geometry->contour_end_point(j);
+ int cur_seg = start_seg;
+
+ // compute lengths for the contour and all its segments
+ segLens[start_seg] = 0.0;
+
+ // get start point of first segment in screen space
+ WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX0, segY0);
+
+ while (cur_seg < end_seg)
+ {
+ ++cur_seg;
+
+ // get end point of current segment in screen space
+ WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX1, segY1);
+
+ // get segment length
+ double dx = segX1 - segX0;
+ double dy = segY1 - segY0;
+ double len = sqrt(dx*dx + dy*dy);
+
+ segLens[cur_seg] = len;
+ segLens[start_seg] += len;
+
+ // start point for next segment is current end point
+ segX0 = segX1;
+ segY0 = segY1;
+ }
+ }
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// This method computes group lengths. The segGroups array is the one
+// obtained from ComputeSegmentGroups.
+void SE_Renderer::ComputeGroupLengths(double* segLens, int numGroups, int* segGroups, double* groupLens)
+{
+ for (int j=0; j<numGroups; ++j)
+ {
+ // get segment range for group
+ int seg0 = segGroups[2*j];
+ int seg1 = segGroups[2*j+1];
+
+ // get the length of the group
+ groupLens[j] = 0.0;
+ for (int i=seg0+1; i<=seg1; ++i)
+ groupLens[j] += segLens[i];
+ }
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// This method groups together segments for the specified contour based on
+// the supplied vertex angle limit. Any pair of segments are part of the
+// same group if their relative angle is less then the vertex angle limit.
+// The integer array will contain the indices delineating the segments, i.e.
+// group 0 goes from index segGroups[0] to segGroups[1], group 1 goes from
+// segGroups[2] to segGroups[3], etc. Each group is guranteed to start and
+// end with a non-generate segment. The method returns the number of groups.
+int SE_Renderer::ComputeSegmentGroups(LineBuffer* geometry, int contour, double vertexAngleLimit, double* segLens, int* segGroups)
+{
+ // get segment range for specified contour
+ int start_seg = geometry->contour_start_point(contour);
+ int end_seg = geometry->contour_end_point(contour);
+
+ // skip zero-length contours
+ if (segLens[start_seg] == 0.0)
+ return 0;
+
+ // we have a non-degenerate contour - we'll get at least one group
+
+ // make sure vertex angle limit is positive and in the range [0, 180]
+ vertexAngleLimit = fabs(vertexAngleLimit);
+ vertexAngleLimit = rs_min(vertexAngleLimit, M_PI);
+ double cosLimit = cos(vertexAngleLimit);
+
+ // screen coordinates of current line segment
+ double segX0, segY0, segX1, segY1;
+
+ // keep track of number of groups
+ int numGroups = 0;
+
+ // find the initial group's starting segment (the first non-degenerate segment)
+ int cur_seg = start_seg + 1;
+ while (cur_seg <= end_seg && segLens[cur_seg] == 0.0)
+ ++cur_seg;
+
+ int group_min = cur_seg - 1;
+ int group_max = cur_seg;
+
+ // get the normalized vector for the segment
+ WorldToScreenPoint(geometry->x_coord(cur_seg-1), geometry->y_coord(cur_seg-1), segX0, segY0);
+ WorldToScreenPoint(geometry->x_coord(cur_seg ), geometry->y_coord(cur_seg ), segX1, segY1);
+ double dx0 = (segX1 - segX0) / segLens[cur_seg];
+ double dy0 = (segY1 - segY0) / segLens[cur_seg];
+
+ // iterate over the rest of the contour, adding groups as we find them
+ while (cur_seg < end_seg)
+ {
+ ++cur_seg;
+
+ // find next non-degenerate segment
+ while (cur_seg <= end_seg && segLens[cur_seg] == 0.0)
+ ++cur_seg;
+
+ // no more non-degenerate segments left - done processing the contour
+ if (cur_seg > end_seg)
+ break;
+
+ // get the normalized vector for the segment
+ WorldToScreenPoint(geometry->x_coord(cur_seg-1), geometry->y_coord(cur_seg-1), segX0, segY0);
+ WorldToScreenPoint(geometry->x_coord(cur_seg ), geometry->y_coord(cur_seg ), segX1, segY1);
+ double dx1 = (segX1 - segX0) / segLens[cur_seg];
+ double dy1 = (segY1 - segY0) / segLens[cur_seg];
+
+ // compare relative angles between current and previous segments
+ double cosAngle = dx0*dx1 + dy0*dy1;
+ if (cosAngle < cosLimit)
+ {
+ // vertex limit exceeded - record the existing group
+ segGroups[2*numGroups ] = group_min;
+ segGroups[2*numGroups+1] = group_max;
+ ++numGroups;
+
+ // initialize the next group
+ group_min = cur_seg - 1;
+ group_max = cur_seg;
+ }
+ else
+ {
+ // vertex limit not exceeded - extend current group to this segment
+ group_max = cur_seg;
+ }
+
+ // current normalized vector becomes the old one
+ dx0 = dx1;
+ dy0 = dy1;
+ }
+
+ // record the final group
+ segGroups[2*numGroups ] = group_min;
+ segGroups[2*numGroups+1] = group_max;
+ ++numGroups;
+
+ return numGroups;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Computes the point distribution for a group, given its start offset, end
+// end offset, and repeat.
+//
+// The following rules apply:
+// - If only StartOffset is specified (>=0) then the first point is at the
+// start offset location, and the distribution repeats until the end of
+// the group.
+// - If only EndOffset is specified (>=0) then the last point is at the end
+// offset location, and the distribution repeats until the start of the
+// group.
+// - If StartOffset and EndOffset are both specified then the first and last
+// points are at the start and end offset locations. Points are then
+// distributed at the repeat value within the group. The interior dist-
+// ribution is centered within the start / end offset locations, leaving a
+// gap on either side. The number of interior points is chosen so that
+// repeat/2 < gap < repeat. The symbol width is also taken into account
+// when computing the interior distribution.
+// - If StartOffset and EndOffset are both unspecified (< 0) then points
+// are not included at the start and end offset locations, but the interior
+// distribution is the same as in the previous case assuming zero offsets.
+void SE_Renderer::ComputeGroupDistribution(double groupLen, double startOffset, double endOffset, double repeat,
+ double symWidth, double& startPos, double& gap, int& numSymbols)
+{
+ _ASSERT(repeat > 0.0);
+ _ASSERT(startOffset <= groupLen);
+ _ASSERT(endOffset <= groupLen);
+
+ // Use a slightly smaller group length to avoid round-off issues when
+ // computing the distribution. See comments below.
+ groupLen *= 0.999999999999;
+
+ if (startOffset >= 0.0)
+ {
+ if (endOffset < 0.0)
+ {
+ // only the start offset is specified
+
+ // starting symbol
+ startPos = startOffset;
+
+ // no gap in this case
+ gap = 0.0;
+
+ // interior symbols
+ double remainder = groupLen - startOffset;
+ int numInterior = (int)(remainder / repeat);
+
+ // if the interior distribution goes exactly until the end then reduce
+ // the interior count by one so we don't draw a symbol at the end
+ // NOTE: using a slightly smaller group length addresses this
+// if (remainder <= numInterior*repeat && numInterior > 0)
+// --numInterior;
+
+ numSymbols = 1 + numInterior;
+ }
+ else
+ {
+ // both start and end offsets are specified
+
+ // starting symbol
+ startPos = startOffset;
+
+ // interior symbols - in the case where the repeat is set to the symbol
+ // width, the minimum gap is 0.5*factor*repeat
+ double factor = 0.15;
+ double remainder = rs_max(groupLen - startOffset - endOffset - factor*symWidth, 0.0);
+ int numInterior = (int)(remainder / repeat);
+
+ // if the interior distribution fits exactly then reduce the
+ // interior count by one so we don't draw a symbol at the end
+ // NOTE: using a slightly smaller group length addresses this
+// if (remainder <= numInterior*repeat && numInterior > 0)
+// --numInterior;
+
+ if (numInterior == 0)
+ gap = groupLen - startOffset - endOffset; // no room for any internal symbols
+ else
+ gap = 0.5*(remainder - (numInterior - 1)*repeat - (1.0-factor)*symWidth);
+
+ numSymbols = 2 + numInterior;
+ }
+ }
+ else
+ {
+ if (endOffset < 0.0)
+ {
+ // both start and end offsets are unspecified
+
+ // no gap in this case
+ gap = 0.0;
+
+ // interior symbols
+ double remainder = groupLen;
+ int numInterior = (int)(remainder / repeat);
+
+ // if the interior distribution fits exactly then reduce the
+ // interior count by one so we don't draw a symbol at the end
+ // NOTE: using a slightly smaller group length addresses this
+// if (remainder <= numInterior*repeat && numInterior > 0)
+// --numInterior;
+
+ // starting symbol
+ if (numInterior == 0)
+ startPos = remainder; // no room for any internal symbols
+ else
+ startPos = 0.5*(remainder - (numInterior - 1)*repeat);
+
+ numSymbols = numInterior;
+ }
+ else
+ {
+ // only the end offset is specified
+
+ // no gap in this case
+ gap = 0.0;
+
+ // interior symbols
+ double remainder = groupLen - endOffset;
+ int numInterior = (int)(remainder / repeat);
+
+ // if the interior distribution goes exactly until the start then reduce
+ // the interior count by one so we don't draw a symbol at the start
+ // NOTE: using a slightly smaller group length addresses this
+// if (remainder <= numInterior*repeat && numInterior > 0)
+// --numInterior;
+
+ // starting symbol
+ startPos = groupLen - endOffset - numInterior*repeat;
+
+ numSymbols = 1 + numInterior;
+ }
+ }
+}
Deleted: sandbox/rfc90/MgDev/Common/Stylization/SE_LineRenderer.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/SE_LineRenderer.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/SE_LineRenderer.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -1,44 +0,0 @@
-//
-// Copyright (C) 2007-2010 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 SE_LINERENDERER_H_
-#define SE_LINERENDERER_H_
-
-#include "SE_Renderer.h"
-
-
-// forward declare
-struct HotSpot;
-
-
-///////////////////////////////////////////////////////////////////////////////
-class SE_LineRenderer
-{
-public:
- static void ProcessLineOverlapWrap(SE_Renderer* renderer, LineBuffer* geometry, SE_RenderLineStyle* style);
-
-private:
- static int ConfigureHotSpots(SE_Renderer* renderer, LineBuffer* geometry, int cur_contour, SE_RenderLineStyle* style, RS_Bounds& styleBounds, HotSpot* hotspots);
- static int ComputePoints(SE_Renderer* renderer, LineBuffer* geometry, int cur_contour, HotSpot* hotspots);
- static void ChopLineBuffer(SE_Renderer* renderer, LineBuffer* inBuffer, LineBuffer* outBuffer);
- static LineBuffer* ClipPolyline(LineBufferPool* lbp, LineBuffer& geometry, double zMin, double zMax);
- static LineBuffer* ClipPolygon(LineBufferPool* lbp, LineBuffer& geometry, double zMin, double zMax);
- static int ClipLine(double zMin, double zMax, double* line, double* ret);
- static int ClipCode(double zMin, double zMax, double z);
-};
-
-#endif
Modified: sandbox/rfc90/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -21,7 +21,6 @@
#include "SE_SymbolManager.h"
#include "SE_Bounds.h"
#include "RS_FontEngine.h"
-#include "Foundation.h"
// Recomputes the bounds of an SE_RenderStyle that contains a text
@@ -77,6 +76,11 @@
void SE_PositioningAlgorithms::Default(SE_ApplyContext* applyCtx,
SE_RenderStyle* rstyle)
{
+ // the style needs to contain at least one primitive
+ SE_RenderPrimitiveList& prims = rstyle->symbol;
+ if (prims.size() == 0)
+ return;
+
SE_Renderer* se_renderer = applyCtx->renderer;
LineBuffer* geometry = applyCtx->geometry;
SE_Matrix& xform = *applyCtx->xform;
@@ -184,12 +188,13 @@
if (rstyle->type != SE_RenderStyle_Point)
return;
+ // the style needs to contain at least one primitive
+ SE_RenderPrimitiveList& prims = rstyle->symbol;
+ if (prims.size() == 0)
+ return;
+
SE_RenderPointStyle* rpstyle = (SE_RenderPointStyle*)rstyle;
- // the point style needs to contain at least one graphic element
- if (rpstyle->symbol.size() == 0)
- return;
-
// get actual feature point and transform to screen space
// TODO: in the case of a multi-point feature we get the average of all the points;
// generating candidate labels around this point doesn't make a whole lot of
@@ -327,9 +332,9 @@
// check if the incoming point style contains just a single text element
bool foundSingleText = false;
- if (rpstyle->symbol.size() == 1)
+ if (prims.size() == 1)
{
- if (rpstyle->symbol[0]->type == SE_RenderPrimitive_Text)
+ if (prims[0]->type == SE_RenderPrimitive_Text)
foundSingleText = true;
}
@@ -465,12 +470,17 @@
if (rstyle->type == SE_RenderStyle_Area)
return;
+ // the style needs to contain at least one primitive
+ SE_RenderPrimitiveList& prims = rstyle->symbol;
+ if (prims.size() == 0)
+ return;
+
// If the symbol contains just a single text element then add the
// text as a regular path label (non-symbol). Use 0.5 as the
// default value for the scale limit.
- if (rstyle->symbol.size() == 1 && rstyle->symbol[0]->type == SE_RenderPrimitive_Text)
+ if (prims.size() == 1 && prims[0]->type == SE_RenderPrimitive_Text)
{
- SE_RenderText* rt = (SE_RenderText*)rstyle->symbol[0];
+ SE_RenderText* rt = (SE_RenderText*)prims[0];
RS_LabelInfo info(0.0, 0.0, 0.0, 0.0, RS_Units_Device, rt->tdef);
RS_OverpostType overpostType = rstyle->checkExclusionRegion? RS_OverpostType_AllFit : RS_OverpostType_All;
@@ -492,6 +502,9 @@
RS_FeatureReader* featureReader,
SE_SymbolManager* symbolManager)
{
+ if (featureReader == NULL)
+ return;
+
SE_Renderer* se_renderer = applyCtx->renderer;
LineBuffer* geometry = applyCtx->geometry;
@@ -499,6 +512,12 @@
if (rstyle->type != SE_RenderStyle_Line)
return;
+ SE_RenderLineStyle* rlStyle = (SE_RenderLineStyle*)rstyle;
+
+ // ... and the units control must be absolute
+ if (rlStyle->unitsControl != SE_UnitsControl_Absolute)
+ return;
+
// highway info format: countryCode|type1|num1|type2|num2|type3|num3|...
// example: US|2|101|3|1
StringOfTokens highwayInfo(featureReader->GetString(L"Url"), L"|");
@@ -507,7 +526,6 @@
if (shieldCount < 1)
return;
- SE_RenderLineStyle* rlStyle = (SE_RenderLineStyle*)rstyle;
double startOffset = rlStyle->startOffset;
double increment = rlStyle->repeat;
Modified: sandbox/rfc90/MgDev/Common/Stylization/SE_RenderProxies.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/SE_RenderProxies.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/SE_RenderProxies.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -142,6 +142,7 @@
}
std::wstring content;
+ std::wstring expression;
double position[2];
RS_TextDef tdef;
RS_TextMetrics tm;
@@ -160,6 +161,7 @@
double position[2];
double extent[2];
double angleRad; // radians CCW
+ double opacity;
};
Modified: sandbox/rfc90/MgDev/Common/Stylization/SE_Renderer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/SE_Renderer.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/SE_Renderer.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -17,7 +17,6 @@
#include "stdafx.h"
#include "SE_Renderer.h"
-#include "SE_LineRenderer.h"
#include "SE_AreaPositioning.h"
#include "RS_FontEngine.h"
@@ -85,8 +84,31 @@
m_rasterGridSizeOverrideRatio = ratio;
}
+///////////////////////////////////////////////////////////////////////////////
+double SE_Renderer::GetMaxRasterImageWidth()
+{
+ return m_maxRasterImageWidth;
+}
///////////////////////////////////////////////////////////////////////////////
+void SE_Renderer::SetMaxRasterImageWidth(int width)
+{
+ m_maxRasterImageWidth = width;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+double SE_Renderer::GetMaxRasterImageHeight()
+{
+ return m_maxRasterImageHeight;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void SE_Renderer::SetMaxRasterImageHeight(int height)
+{
+ m_maxRasterImageHeight = height;
+}
+
+///////////////////////////////////////////////////////////////////////////////
bool SE_Renderer::SupportsTooltips()
{
// by default, set the renderer to process tooltip expressions
@@ -301,7 +323,7 @@
else if (style->vertexControl == SE_VertexControl_OverlapDirect)
ProcessLineOverlapDirect(featGeom, style);
else
- SE_LineRenderer::ProcessLineOverlapWrap(this, featGeom, style);
+ ProcessLineOverlapWrap(featGeom, style);
}
@@ -463,7 +485,7 @@
xform.transform(rp->position[0], rp->position[1], x, y);
double angleDeg = (rp->angleRad + angleRad) * M_180PI;
- DrawScreenRaster(imgData.data, imgData.size, imgData.format, imgData.width, imgData.height, x, y, rp->extent[0], rp->extent[1], angleDeg);
+ DrawScreenRaster(imgData.data, imgData.size, imgData.format, imgData.width, imgData.height, x, y, rp->extent[0], rp->extent[1], angleDeg, rp->opacity);
}
}
}
@@ -611,6 +633,7 @@
SE_RenderText* dt = new SE_RenderText();
rpc = dt;
+ dt->expression = st->expression;
dt->content = st->content;
dt->position[0] = st->position[0];
dt->position[1] = st->position[1];
@@ -651,1020 +674,6 @@
}
-///////////////////////////////////////////////////////////////////////////////
-// This method computes the segment lengths for the geometry. For a given
-// contour with N points starting at index M, the length for the entire
-// contour is stored at location M, while the segment lengths are stored at
-// locations M+n, n=[1, N-1].
-void SE_Renderer::ComputeSegmentLengths(LineBuffer* geometry, double* segLens)
-{
- // screen coordinates of current line segment
- double segX0, segY0, segX1, segY1;
-
- // iterate over the contours
- for (int j=0; j<geometry->cntr_count(); ++j)
- {
- // get segment range for current contour
- int start_seg = geometry->contour_start_point(j);
- int end_seg = geometry->contour_end_point(j);
- int cur_seg = start_seg;
-
- // compute lengths for the contour and all its segments
- segLens[start_seg] = 0.0;
-
- // get start point of first segment in screen space
- WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX0, segY0);
-
- while (cur_seg < end_seg)
- {
- ++cur_seg;
-
- // get end point of current segment in screen space
- WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX1, segY1);
-
- // get segment length
- double dx = segX1 - segX0;
- double dy = segY1 - segY0;
- double len = sqrt(dx*dx + dy*dy);
-
- segLens[cur_seg] = len;
- segLens[start_seg] += len;
-
- // start point for next segment is current end point
- segX0 = segX1;
- segY0 = segY1;
- }
- }
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
-// This method computes group lengths. The segGroups array is the one
-// obtained from ComputeSegmentGroups.
-void SE_Renderer::ComputeGroupLengths(double* segLens, int numGroups, int* segGroups, double* groupLens)
-{
- for (int j=0; j<numGroups; ++j)
- {
- // get segment range for group
- int seg0 = segGroups[2*j];
- int seg1 = segGroups[2*j+1];
-
- // get the length of the group
- groupLens[j] = 0.0;
- for (int i=seg0+1; i<=seg1; ++i)
- groupLens[j] += segLens[i];
- }
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
-// This method groups together segments for the specified contour based on
-// the supplied vertex angle limit. Any pair of segments are part of the
-// same group if their relative angle is less then the vertex angle limit.
-// The integer array will contain the indices delineating the segments, i.e.
-// group 0 goes from index segGroups[0] to segGroups[1], group 1 goes from
-// segGroups[2] to segGroups[3], etc. Each group is guranteed to start and
-// end with a non-generate segment. The method returns the number of groups.
-int SE_Renderer::ComputeSegmentGroups(LineBuffer* geometry, int contour, double vertexAngleLimit, double* segLens, int* segGroups)
-{
- // get segment range for specified contour
- int start_seg = geometry->contour_start_point(contour);
- int end_seg = geometry->contour_end_point(contour);
-
- // skip zero-length contours
- if (segLens[start_seg] == 0.0)
- return 0;
-
- // we have a non-degenerate contour - we'll get at least one group
-
- // make sure vertex angle limit is positive and in the range [0, 180]
- vertexAngleLimit = fabs(vertexAngleLimit);
- vertexAngleLimit = rs_min(vertexAngleLimit, M_PI);
- double cosLimit = cos(vertexAngleLimit);
-
- // screen coordinates of current line segment
- double segX0, segY0, segX1, segY1;
-
- // keep track of number of groups
- int numGroups = 0;
-
- // find the initial group's starting segment (the first non-degenerate segment)
- int cur_seg = start_seg + 1;
- while (cur_seg <= end_seg && segLens[cur_seg] == 0.0)
- ++cur_seg;
-
- int group_min = cur_seg - 1;
- int group_max = cur_seg;
-
- // get the normalized vector for the segment
- WorldToScreenPoint(geometry->x_coord(cur_seg-1), geometry->y_coord(cur_seg-1), segX0, segY0);
- WorldToScreenPoint(geometry->x_coord(cur_seg ), geometry->y_coord(cur_seg ), segX1, segY1);
- double dx0 = (segX1 - segX0) / segLens[cur_seg];
- double dy0 = (segY1 - segY0) / segLens[cur_seg];
-
- // iterate over the rest of the contour, adding groups as we find them
- while (cur_seg < end_seg)
- {
- ++cur_seg;
-
- // find next non-degenerate segment
- while (cur_seg <= end_seg && segLens[cur_seg] == 0.0)
- ++cur_seg;
-
- // no more non-degenerate segments left - done processing the contour
- if (cur_seg > end_seg)
- break;
-
- // get the normalized vector for the segment
- WorldToScreenPoint(geometry->x_coord(cur_seg-1), geometry->y_coord(cur_seg-1), segX0, segY0);
- WorldToScreenPoint(geometry->x_coord(cur_seg ), geometry->y_coord(cur_seg ), segX1, segY1);
- double dx1 = (segX1 - segX0) / segLens[cur_seg];
- double dy1 = (segY1 - segY0) / segLens[cur_seg];
-
- // compare relative angles between current and previous segments
- double cosAngle = dx0*dx1 + dy0*dy1;
- if (cosAngle < cosLimit)
- {
- // vertex limit exceeded - record the existing group
- segGroups[2*numGroups ] = group_min;
- segGroups[2*numGroups+1] = group_max;
- ++numGroups;
-
- // initialize the next group
- group_min = cur_seg - 1;
- group_max = cur_seg;
- }
- else
- {
- // vertex limit not exceeded - extend current group to this segment
- group_max = cur_seg;
- }
-
- // current normalized vector becomes the old one
- dx0 = dx1;
- dy0 = dy1;
- }
-
- // record the final group
- segGroups[2*numGroups ] = group_min;
- segGroups[2*numGroups+1] = group_max;
- ++numGroups;
-
- return numGroups;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Computes the point distribution for a group, given its start offset, end
-// end offset, and repeat.
-//
-// The following rules apply:
-// - If only StartOffset is specified (>=0) then the first point is at the
-// start offset location, and the distribution repeats until the end of
-// the group.
-// - If only EndOffset is specified (>=0) then the last point is at the end
-// offset location, and the distribution repeats until the start of the
-// group.
-// - If StartOffset and EndOffset are both specified then the first and last
-// points are at the start and end offset locations. Points are then
-// distributed at the repeat value within the group. The interior dist-
-// ribution is centered within the start / end offset locations, leaving a
-// gap on either side. The number of interior points is chosen so that
-// repeat/2 < gap < repeat. The symbol width is also taken into account
-// when computing the interior distribution.
-// - If StartOffset and EndOffset are both unspecified (< 0) then points
-// are not included at the start and end offset locations, but the interior
-// distribution is the same as in the previous case assuming zero offsets.
-void SE_Renderer::ComputeGroupDistribution(double groupLen, double startOffset, double endOffset, double repeat,
- double symWidth, double& startPos, double& gap, int& numSymbols)
-{
- _ASSERT(repeat > 0.0);
- _ASSERT(startOffset <= groupLen);
- _ASSERT(endOffset <= groupLen);
-
- // Use a slightly smaller group length to avoid round-off issues when
- // computing the distribution. See comments below.
- groupLen *= 0.999999999999;
-
- if (startOffset >= 0.0)
- {
- if (endOffset < 0.0)
- {
- // only the start offset is specified
-
- // starting symbol
- startPos = startOffset;
-
- // no gap in this case
- gap = 0.0;
-
- // interior symbols
- double remainder = groupLen - startOffset;
- int numInterior = (int)(remainder / repeat);
-
- // if the interior distribution goes exactly until the end then reduce
- // the interior count by one so we don't draw a symbol at the end
- // NOTE: using a slightly smaller group length addresses this
-// if (remainder <= numInterior*repeat && numInterior > 0)
-// --numInterior;
-
- numSymbols = 1 + numInterior;
- }
- else
- {
- // both start and end offsets are specified
-
- // starting symbol
- startPos = startOffset;
-
- // interior symbols - in the case where the repeat is set to the symbol
- // width, the minimum gap is 0.5*factor*repeat
- double factor = 0.15;
- double remainder = rs_max(groupLen - startOffset - endOffset - factor*symWidth, 0.0);
- int numInterior = (int)(remainder / repeat);
-
- // if the interior distribution fits exactly then reduce the
- // interior count by one so we don't draw a symbol at the end
- // NOTE: using a slightly smaller group length addresses this
-// if (remainder <= numInterior*repeat && numInterior > 0)
-// --numInterior;
-
- if (numInterior == 0)
- gap = groupLen - startOffset - endOffset; // no room for any internal symbols
- else
- gap = 0.5*(remainder - (numInterior - 1)*repeat - (1.0-factor)*symWidth);
-
- numSymbols = 2 + numInterior;
- }
- }
- else
- {
- if (endOffset < 0.0)
- {
- // both start and end offsets are unspecified
-
- // no gap in this case
- gap = 0.0;
-
- // interior symbols
- double remainder = groupLen;
- int numInterior = (int)(remainder / repeat);
-
- // if the interior distribution fits exactly then reduce the
- // interior count by one so we don't draw a symbol at the end
- // NOTE: using a slightly smaller group length addresses this
-// if (remainder <= numInterior*repeat && numInterior > 0)
-// --numInterior;
-
- // starting symbol
- if (numInterior == 0)
- startPos = remainder; // no room for any internal symbols
- else
- startPos = 0.5*(remainder - (numInterior - 1)*repeat);
-
- numSymbols = numInterior;
- }
- else
- {
- // only the end offset is specified
-
- // no gap in this case
- gap = 0.0;
-
- // interior symbols
- double remainder = groupLen - endOffset;
- int numInterior = (int)(remainder / repeat);
-
- // if the interior distribution goes exactly until the start then reduce
- // the interior count by one so we don't draw a symbol at the start
- // NOTE: using a slightly smaller group length addresses this
-// if (remainder <= numInterior*repeat && numInterior > 0)
-// --numInterior;
-
- // starting symbol
- startPos = groupLen - endOffset - numInterior*repeat;
-
- numSymbols = 1 + numInterior;
- }
- }
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Distributes symbols along a polyline using the OverlapNone vertex control option.
-void SE_Renderer::ProcessLineOverlapNone(LineBuffer* geometry, SE_RenderLineStyle* style)
-{
- _ASSERT(style->repeat > 0.0);
-
- SE_Matrix symxf;
- bool yUp = YPointsUp();
-
- double baseAngleRad = style->angleRad;
-
- // precompute these - these are in renderer space, hence the check for yUp with the sine
- double baseAngleCos = cos(baseAngleRad);
- double baseAngleSin = sin(yUp? baseAngleRad : -baseAngleRad);
-
- // account for any viewport rotation
- double w2sAngleRad = GetWorldToScreenRotation();
-
- double angleRad, angleCos, angleSin;
- if (w2sAngleRad == 0.0)
- {
- angleRad = baseAngleRad;
- angleCos = baseAngleCos;
- angleSin = baseAngleSin;
- }
- else
- {
- angleRad = baseAngleRad + w2sAngleRad;
- angleCos = cos(angleRad);
- angleSin = sin(yUp? angleRad : -angleRad);
- }
-
- // screen coordinates of current line segment
- double segX0, segY0, segX1, segY1;
-
- // this is the same for all contours / groups
- double repeat = style->repeat;
- double leftEdge = style->bounds[0].x;
- double rightEdge = style->bounds[1].x;
-
- // get segment lengths
- double* segLens = (double*)alloca(sizeof(double)*geometry->point_count());
- ComputeSegmentLengths(geometry, segLens);
-
- // used for segment group calculations
- int* segGroups = (int*)alloca(2*sizeof(int)*geometry->point_count());
- double* groupLens = (double*)alloca(sizeof(double)*geometry->point_count());
-
- // configure the default path line stroke to use
- SE_LineStroke dpLineStroke = style->dpLineStroke;
- if (m_bSelectionMode)
- {
- dpLineStroke.color = m_selLineStroke.color;
- dpLineStroke.weight = m_selLineStroke.weight;
- }
-
- // Used for drawing the centerline paths at vertices. In the case of
- // a single contour the start/end points will need a MoveTo/LineTo,
- // while the interior points will need a MoveTo/LineTo/LineTo.
- LineBuffer vertexLines(3*geometry->point_count()-2);
-
- // iterate over the contours
- for (int j=0; j<geometry->cntr_count(); ++j)
- {
- // get starting segment for current contour
- int start_seg_contour = geometry->contour_start_point(j);
-
- // skip zero-length contours
- if (segLens[start_seg_contour] == 0.0)
- continue;
-
- // check if:
- // - the start offset goes beyond the end of the contour
- // - the end offset goes beyond the beginning of the contour
- // - the start offset goes beyond the end offset
- double offsetSum = rs_max(style->startOffset, 0.0) + rs_max(style->endOffset, 0.0);
- if (offsetSum > segLens[start_seg_contour])
- continue;
-
- // compute the segment groups for this contour based on the vertex angle limit
- int numGroups = ComputeSegmentGroups(geometry, j, style->vertexAngleLimit, segLens, segGroups);
- if (numGroups == 0)
- continue;
-
- // compute the group lengths
- ComputeGroupLengths(segLens, numGroups, segGroups, groupLens);
-
- // for this vertex control option we set the offsets to zero if they're unspecified
- double startOffset = rs_max(style->startOffset, 0.0);
- double endOffset = rs_max(style->endOffset, 0.0);
-
- // compute the starting group based on the style's start offset
- int start_group = 0;
- if (startOffset > 0.0)
- {
- for (int k=0; k<numGroups; ++k)
- {
- if (startOffset < groupLens[k])
- {
- start_group = k;
- break;
- }
-
- // adjust the start offset so it's relative to the starting group
- startOffset -= groupLens[k];
- }
- }
-
- // compute the ending group based on the style's end offset
- int end_group = numGroups-1;
- if (endOffset > 0.0)
- {
- for (int k=numGroups-1; k>=0; --k)
- {
- if (endOffset < groupLens[k])
- {
- end_group = k;
- break;
- }
-
- // adjust the end offset so it's relative to the ending group
- endOffset -= groupLens[k];
- }
- }
-
- // iterate over the relevant groups
- for (int k=start_group; k<=end_group; ++k)
- {
- // get segment range for current group
- int start_seg = segGroups[2*k];
- int end_seg = segGroups[2*k+1];
- int cur_seg = start_seg;
-
- // get the actual start / end offsets for the current group
- // - for the first group its start offset is the specified value, while
- // for subsequent groups it's zero (we draw a symbol directly at the
- // start of the group)
- // - for the last group the end offset is the specified value, while for
- // prior groups it's zero (we draw a symbol directly at the end of the
- // group)
- double startOffsetGroup = (k == start_group)? startOffset : 0.0;
- double endOffsetGroup = (k == end_group)? endOffset : 0.0;
-
- // Compute the symbol distribution for the group. The drawpos variable
- // is the position of the first symbol. If gap is > 0 then the next symbol
- // is offset by that amount. Subsequent symbols are then offset by the
- // repeat, except for the last one which is again offset by the gap.
- //
- // Here's a graphical depiction:
- //
- // |-----+-----+---+---+---+-----+--------|
- // s d | \__|__/ | e
- // t r g r g n
- // a a a e a d
- // r w p p p
- // t p e
- // o a
- // s t
- int numSymbols = 0;
- double drawpos = startOffsetGroup;
- double gap = 0.0;
- ComputeGroupDistribution(groupLens[k], startOffsetGroup, endOffsetGroup, repeat,
- rightEdge - leftEdge, drawpos, gap, numSymbols);
- if (numSymbols == 0)
- continue;
-
- //-------------------------------------------------------
- // draw symbols along the group
- //-------------------------------------------------------
-
- int numDrawn = 0;
- double increment;
-
- // get start point of first segment in screen space
- WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX0, segY0);
-
- while (cur_seg < end_seg)
- {
- ++cur_seg;
-
- // skip zero-length segments - no need to update the start/end points
- double len = segLens[cur_seg];
- if (len == 0.0)
- continue;
-
- // get end point of current segment in screen space
- WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX1, segY1);
-
- // if our draw position falls within this segment then process
- if (drawpos <= len)
- {
- // compute linear deltas for x and y directions - we will use these
- // to quickly move along the line without having to do too much math
- double invlen = 1.0 / len;
- double dx_incr = (segX1 - segX0) * invlen;
- double dy_incr = (segY1 - segY0) * invlen;
-
- if (style->angleControl == SE_AngleControl_FromGeometry)
- {
- angleCos = dx_incr*baseAngleCos - dy_incr*baseAngleSin;
- angleSin = dy_incr*baseAngleCos + dx_incr*baseAngleSin;
- angleRad = atan2(dy_incr, dx_incr);
-
- // since dy_incr and dx_incr are in renderer space we need to
- // negate the angle if y points down
- if (!yUp)
- angleRad = -angleRad;
-
- angleRad += baseAngleRad;
- }
- double tx = segX0 + dx_incr * drawpos;
- double ty = segY0 + dy_incr * drawpos;
-
- symxf.setIdentity();
- symxf.rotate(angleSin, angleCos);
- symxf.translate(tx, ty);
-
- // loop-draw the symbol along the current segment, incrementing
- // the draw position by the appropriate amount
- while (drawpos <= len && numDrawn < numSymbols)
- {
- // in the case of labels we only draw them at the interior points
- if (style->drawLast)
- {
- if (numDrawn > 0 && numDrawn < numSymbols-1)
- AddLabel(geometry, style, symxf, angleRad);
- }
- else
- {
- // handle the centerline path at the group's start
- if (numDrawn == 0)
- {
- // This is the first time drawing anything for this group. If
- // this is the starting group, then initialize the centerline
- // path at the group's start. If it's not the starting group
- // then we'll add LineTo segments (see further down) to the
- // existing centerline path at the previous group's end.
- if (k == start_group)
- vertexLines.MoveTo(symxf.x2, symxf.y2);
- }
- else if (numDrawn == 1 && numSymbols > 2)
- {
- // finish and draw the centerline path at the group's start,
- // aligning it with the left edge of the symbol
- // TODO: account for symbol rotation
- vertexLines.LineTo(symxf.x2 + dx_incr*leftEdge, symxf.y2 + dy_incr*leftEdge);
- DrawScreenPolyline(&vertexLines, NULL, dpLineStroke);
- vertexLines.Reset();
- }
-
- // only draw symbols at the interior points
- if (numDrawn > 0 && numDrawn < numSymbols-1)
- DrawSymbol(style->symbol, symxf, angleRad, style->addToExclusionRegion);
-
- // handle the centerline path at the group's end - only
- // need to do this if we have at least one interior symbol
- if (numDrawn == numSymbols-2 && numSymbols > 2)
- {
- // initialize the centerline path at the group's end,
- // aligning it with the right edge of the symbol
- // TODO: account for symbol rotation
- vertexLines.MoveTo(symxf.x2 + dx_incr*rightEdge, symxf.y2 + dy_incr*rightEdge);
- }
- else if (numDrawn == numSymbols-1)
- {
- // This is the last time drawing anything for this group, so
- // finish the centerline path at the group's end. If this is
- // the ending group, then also draw it. If it's not the ending
- // group then we'll draw it up above when we finish the centerline
- // path at the next group's start.
- vertexLines.LineTo(symxf.x2, symxf.y2);
- if (k == end_group)
- {
- DrawScreenPolyline(&vertexLines, NULL, dpLineStroke);
- vertexLines.Reset();
- }
- }
- }
-
- ++numDrawn;
-
- // move forward
- increment = repeat;
- if (gap != 0.0)
- {
- // if we have a gap, then use it after drawing the first
- // symbol and before drawing the last symbol
- if (numSymbols == 2)
- {
- // in this case the gap takes us until the end
- increment = gap;
- }
- else
- {
- if (numDrawn == 1)
- increment = gap - leftEdge;
- else if (numDrawn == numSymbols - 1)
- increment = gap + rightEdge;
- }
- }
-
- symxf.translate(dx_incr*increment, dy_incr*increment);
- drawpos += increment;
- }
- }
-
- drawpos -= len;
-
- // start point for next segment is current end point
- segX0 = segX1;
- segY0 = segY1;
- }
- }
- }
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Distributes feature labels along a polyline.
-void SE_Renderer::ProcessLineLabels(LineBuffer* geometry, SE_RenderLineStyle* style)
-{
- SE_Matrix symxf;
- bool yUp = YPointsUp();
-
- double baseAngleRad = style->angleRad;
-
- // precompute these - these are in renderer space, hence the check for yUp with the sine
- double baseAngleCos = cos(baseAngleRad);
- double baseAngleSin = sin(yUp? baseAngleRad : -baseAngleRad);
-
- // account for any viewport rotation
- double w2sAngleRad = GetWorldToScreenRotation();
-
- double angleRad, angleCos, angleSin;
- if (w2sAngleRad == 0.0)
- {
- angleRad = baseAngleRad;
- angleCos = baseAngleCos;
- angleSin = baseAngleSin;
- }
- else
- {
- angleRad = baseAngleRad + w2sAngleRad;
- angleCos = cos(angleRad);
- angleSin = sin(yUp? angleRad : -angleRad);
- }
-
- // screen coordinates of current line segment
- double segX0, segY0, segX1, segY1;
-
- // this is the same for all contours
- double repeat = PATH_LABEL_SEPARATION_INCHES * MILLIMETERS_PER_INCH * GetScreenUnitsPerMillimeterDevice();
- double leftEdge = style->bounds[0].x;
- double rightEdge = style->bounds[1].x;
- double symWidth = rightEdge - leftEdge;
-
- // repeat needs to be the separation (end of one label to start of the
- // next) plus the symbol width
- repeat += symWidth;
-
- // get the segment lengths
- double* segLens = (double*)alloca(sizeof(double)*geometry->point_count());
- ComputeSegmentLengths(geometry, segLens);
-
- // iterate over the contours
- for (int j=0; j<geometry->cntr_count(); ++j)
- {
- // get segment range for current contour
- int start_seg = geometry->contour_start_point(j);
- int end_seg = geometry->contour_end_point(j);
-
- // skip contours shorter than the symbol width
- double contourLen = segLens[start_seg];
- if (contourLen <= symWidth)
- continue;
-
- // how many times should we repeat the symbol along the path?
- // TODO: fine tune this formula
- int numSymbols = 1 + (int)((contourLen - symWidth) / repeat);
- double startOffset = 0.5*(contourLen - (numSymbols - 1) * repeat);
-
- // account for the symbol's extent to properly center it
- startOffset -= 0.5*(leftEdge + rightEdge);
-
- //-------------------------------------------------------
- // draw symbols along the contour
- //-------------------------------------------------------
-
- int numDrawn = 0;
- int cur_seg = start_seg;
- double drawpos = startOffset;
-
- // get start point of first segment in screen space
- WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX0, segY0);
-
- while (cur_seg < end_seg)
- {
- ++cur_seg;
-
- // skip zero-length segments - no need to update the start/end points
- double len = segLens[cur_seg];
- if (len == 0.0)
- continue;
-
- // get end point of current segment in screen space
- WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX1, segY1);
-
- // if our draw position falls within this segment then process
- if (drawpos <= len)
- {
- // compute linear deltas for x and y directions - we will use these
- // to quickly move along the line without having to do too much math
- double invlen = 1.0 / len;
- double dx_incr = (segX1 - segX0) * invlen;
- double dy_incr = (segY1 - segY0) * invlen;
-
- if (style->angleControl == SE_AngleControl_FromGeometry)
- {
- angleCos = dx_incr*baseAngleCos - dy_incr*baseAngleSin;
- angleSin = dy_incr*baseAngleCos + dx_incr*baseAngleSin;
- angleRad = atan2(dy_incr, dx_incr);
-
- // since dy_incr and dx_incr are in renderer space we need to
- // negate the angle if y points down
- if (!yUp)
- angleRad = -angleRad;
-
- angleRad += baseAngleRad;
- }
- double tx = segX0 + dx_incr * drawpos;
- double ty = segY0 + dy_incr * drawpos;
-
- symxf.setIdentity();
- symxf.rotate(angleSin, angleCos);
- symxf.translate(tx, ty);
-
- // loop-draw the symbol along the current segment, incrementing
- // the draw position by the appropriate amount
- while (drawpos <= len && numDrawn < numSymbols)
- {
- AddLabel(geometry, style, symxf, angleRad);
- ++numDrawn;
-
- // move forward
- symxf.translate(dx_incr*repeat, dy_incr*repeat);
- drawpos += repeat;
- }
- }
-
- drawpos -= len;
-
- // start point for next segment is current end point
- segX0 = segX1;
- segY0 = segY1;
- }
- }
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Distributes symbols along a polyline using the OverlapDirect vertex control option.
-// This setting is intended to only be used in the context of point symbols. These
-// symbols are simply drawn without any wrapping, truncation, or other modification.
-//
-// The following rules apply to the StartOffset and EndOffset parameters:
-// - if StartOffset is specified (>=0) then a symbol is drawn at the start
-// offset location
-// - if EndOffset is specified (>=0) then a symbol is drawn at the end
-// offset location
-// - if StartOffset and EndOffset are both specified but their sum is greater
-// than the contour length (EndOffset offset comes before StartOffset)
-// then no symbols are drawn
-// - if StartOffset and EndOffset are both unspecified (< 0) then no symbols
-// are drawn
-void SE_Renderer::ProcessLineOverlapDirect(LineBuffer* geometry, SE_RenderLineStyle* style)
-{
- _ASSERT(style->repeat > 0.0);
-
- SE_Matrix symxf;
- bool yUp = YPointsUp();
-
- double baseAngleRad = style->angleRad;
-
- // precompute these - these are in renderer space, hence the check for yUp with the sine
- double baseAngleCos = cos(baseAngleRad);
- double baseAngleSin = sin(yUp? baseAngleRad : -baseAngleRad);
-
- // account for any viewport rotation
- double w2sAngleRad = GetWorldToScreenRotation();
-
- double angleRad, angleCos, angleSin;
- if (w2sAngleRad == 0.0)
- {
- angleRad = baseAngleRad;
- angleCos = baseAngleCos;
- angleSin = baseAngleSin;
- }
- else
- {
- angleRad = baseAngleRad + w2sAngleRad;
- angleCos = cos(angleRad);
- angleSin = sin(yUp? angleRad : -angleRad);
- }
-
- // screen coordinates of current line segment
- double segX0, segY0, segX1, segY1;
-
- // this is the same for all contours / groups
- double repeat = style->repeat;
-
- // get segment lengths
- double* segLens = (double*)alloca(sizeof(double)*geometry->point_count());
- ComputeSegmentLengths(geometry, segLens);
-
- // used for segment group calculations
- int* segGroups = (int*)alloca(2*sizeof(int)*geometry->point_count());
- double* groupLens = (double*)alloca(sizeof(double)*geometry->point_count());
-
- // iterate over the contours
- for (int j=0; j<geometry->cntr_count(); ++j)
- {
- // get starting segment for current contour
- int start_seg_contour = geometry->contour_start_point(j);
-
- // skip zero-length contours
- if (segLens[start_seg_contour] == 0.0)
- continue;
-
- // check if:
- // - the start offset goes beyond the end of the contour
- // - the end offset goes beyond the beginning of the contour
- // - the start offset goes beyond the end offset
- double offsetSum = rs_max(style->startOffset, 0.0) + rs_max(style->endOffset, 0.0);
- if (offsetSum > segLens[start_seg_contour])
- continue;
-
- // compute the segment groups for this contour based on the vertex angle limit
- int numGroups = ComputeSegmentGroups(geometry, j, style->vertexAngleLimit, segLens, segGroups);
- if (numGroups == 0)
- continue;
-
- // compute the group lengths
- ComputeGroupLengths(segLens, numGroups, segGroups, groupLens);
-
- // compute the starting group based on the style's start offset
- int start_group = 0;
- double startOffset = style->startOffset;
- if (startOffset > 0.0)
- {
- for (int k=0; k<numGroups; ++k)
- {
- if (startOffset < groupLens[k])
- {
- start_group = k;
- break;
- }
-
- // adjust the start offset so it's relative to the starting group
- startOffset -= groupLens[k];
- }
- }
-
- // compute the ending group based on the style's end offset
- int end_group = numGroups-1;
- double endOffset = style->endOffset;
- if (endOffset > 0.0)
- {
- for (int k=numGroups-1; k>=0; --k)
- {
- if (endOffset < groupLens[k])
- {
- end_group = k;
- break;
- }
-
- // adjust the end offset so it's relative to the ending group
- endOffset -= groupLens[k];
- }
- }
-
- // iterate over the relevant groups
- for (int k=start_group; k<=end_group; ++k)
- {
- // get segment range for current group
- int start_seg = segGroups[2*k];
- int end_seg = segGroups[2*k+1];
- int cur_seg = start_seg;
-
- // get the actual start / end offsets for the current group
- // - for the first group its start offset is the specified value, while
- // for subsequent groups it's zero (we draw a symbol directly at the
- // start of the group)
- // - for the last group the end offset is the specified value, while for
- // prior groups it's zero (we draw a symbol directly at the end of the
- // group)
- double startOffsetGroup = (k == start_group)? startOffset : 0.0;
- double endOffsetGroup = (k == end_group)? endOffset : 0.0;
-
- // Compute the symbol distribution for the group. The drawpos variable
- // is the position of the first symbol. If gap is > 0 then the next symbol
- // is offset by that amount. Subsequent symbols are then offset by the
- // repeat, except for the last one which is again offset by the gap.
- //
- // Here's a graphical depiction:
- //
- // |-----+-----+---+---+---+-----+--------|
- // s d | \__|__/ | e
- // t r g r g n
- // a a a e a d
- // r w p p p
- // t p e
- // o a
- // s t
- int numSymbols = 0;
- double drawpos = startOffsetGroup;
- double gap = 0.0;
- ComputeGroupDistribution(groupLens[k], startOffsetGroup, endOffsetGroup, repeat, 0.0,
- drawpos, gap, numSymbols);
- if (numSymbols == 0)
- continue;
-
- //-------------------------------------------------------
- // draw symbols along the group
- //-------------------------------------------------------
-
- int numDrawn = 0;
- double increment;
-
- // get start point of first segment in screen space
- WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX0, segY0);
-
- while (cur_seg < end_seg)
- {
- ++cur_seg;
-
- // skip zero-length segments - no need to update the start/end points
- double len = segLens[cur_seg];
- if (len == 0.0)
- continue;
-
- // get end point of current segment in screen space
- WorldToScreenPoint(geometry->x_coord(cur_seg), geometry->y_coord(cur_seg), segX1, segY1);
-
- // if our draw position falls within this segment then process
- if (drawpos <= len)
- {
- // compute linear deltas for x and y directions - we will use these
- // to quickly move along the line without having to do too much math
- double invlen = 1.0 / len;
- double dx_incr = (segX1 - segX0) * invlen;
- double dy_incr = (segY1 - segY0) * invlen;
-
- if (style->angleControl == SE_AngleControl_FromGeometry)
- {
- angleCos = dx_incr*baseAngleCos - dy_incr*baseAngleSin;
- angleSin = dy_incr*baseAngleCos + dx_incr*baseAngleSin;
- angleRad = atan2(dy_incr, dx_incr);
-
- // since dy_incr and dx_incr are in renderer space we need to
- // negate the angle if y points down
- if (!yUp)
- angleRad = -angleRad;
-
- angleRad += baseAngleRad;
- }
- double tx = segX0 + dx_incr * drawpos;
- double ty = segY0 + dy_incr * drawpos;
-
- symxf.setIdentity();
- symxf.rotate(angleSin, angleCos);
- symxf.translate(tx, ty);
-
- // loop-draw the symbol along the current segment,
- // incrementing the draw position by the appropriate amount
- while (drawpos <= len && numDrawn < numSymbols)
- {
- // don't draw the same symbol once at the end of a group
- // and again at the start of the next group
- if (k == start_group || numDrawn > 0)
- {
- // draw the symbol at the current position
- if (style->drawLast)
- AddLabel(geometry, style, symxf, angleRad);
- else
- DrawSymbol(style->symbol, symxf, angleRad, style->addToExclusionRegion);
- }
-
- ++numDrawn;
-
- // move forward
- increment = repeat;
- if (gap != 0.0)
- {
- // if we have a gap, then use it after drawing the first
- // symbol and before drawing the last symbol
- if (numDrawn == 1 || numDrawn == numSymbols - 1)
- increment = gap;
- }
-
- symxf.translate(dx_incr*increment, dy_incr*increment);
- drawpos += increment;
- }
- }
-
- drawpos -= len;
-
- // start point for next segment is current end point
- segX0 = segX1;
- segY0 = segY1;
- }
- }
- }
-}
-
-
//////////////////////////////////////////////////////////////////////////////
// Indicates whether rendering optimization is used by this renderer. For example, if we are rendering text and
// optimization is turned on, then text is rendered as a simple line when it is very small.
Modified: sandbox/rfc90/MgDev/Common/Stylization/SE_Renderer.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/SE_Renderer.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/SE_Renderer.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -23,13 +23,13 @@
#include "SE_SymbolDefProxies.h"
#include "SE_RenderProxies.h"
+// forward declare
class RS_FontEngine;
+struct HotSpot;
class SE_Renderer : public Renderer
{
- friend class SE_LineRenderer;
-
public:
STYLIZATION_API SE_Renderer();
STYLIZATION_API virtual ~SE_Renderer();
@@ -46,6 +46,12 @@
STYLIZATION_API virtual double GetRasterGridSizeOverrideRatio();
STYLIZATION_API virtual void SetRasterGridSizeOverrideRatio(double ratio);
+ STYLIZATION_API virtual double GetMaxRasterImageWidth();
+ STYLIZATION_API virtual void SetMaxRasterImageWidth(int width);
+
+ STYLIZATION_API virtual double GetMaxRasterImageHeight();
+ STYLIZATION_API virtual void SetMaxRasterImageHeight(int height);
+
STYLIZATION_API virtual bool SupportsTooltips();
STYLIZATION_API virtual bool SupportsHyperlinks();
@@ -81,6 +87,12 @@
virtual void DrawScreenRaster(unsigned char* data, int length,
RS_ImageFormat format, int native_width, int native_height,
double x, double y, double w, double h, double angleDeg) = 0;
+ // Draw screen raster with alpha. Alpha is a value between 0 and 1.
+ // 0 means completely transparent, while 1 means completely opaque.
+ virtual void DrawScreenRaster(unsigned char* data, int length,
+ RS_ImageFormat format, int native_width, int native_height,
+ double x, double y, double w, double h, double angleDeg,
+ double alpha) = 0;
virtual void DrawScreenText(const RS_TextMetrics& tm, RS_TextDef& tdef, double insx, double insy,
RS_F_Point* path, int npts, double param_position) = 0;
@@ -114,7 +126,7 @@
// angles are in radians CCW
void AddLabel(LineBuffer* geom, SE_RenderStyle* style, const SE_Matrix& xform, double angleRad);
- // helper methods
+ // helper method
void ProcessLineLabels(LineBuffer* geometry, SE_RenderLineStyle* style);
// Indicates whether rendering optimization is used by this renderer. For example, we are rendering text and
@@ -123,13 +135,23 @@
STYLIZATION_API virtual bool OptimizeGeometry();
private:
+ void ProcessLineOverlapWrap(LineBuffer* geometry, SE_RenderLineStyle* style);
+ void ProcessLineOverlapNone(LineBuffer* geometry, SE_RenderLineStyle* style);
+ void ProcessLineOverlapDirect(LineBuffer* geometry, SE_RenderLineStyle* style);
+
+ int ConfigureHotSpots(LineBuffer* geometry, int cur_contour, SE_RenderLineStyle* style, RS_Bounds& styleBounds, HotSpot* hotspots);
+ int ComputePoints(LineBuffer* geometry, int cur_contour, HotSpot* hotspots);
+ void ChopLineBuffer(LineBuffer* inBuffer, LineBuffer* outBuffer);
+ LineBuffer* ClipPolyline(LineBufferPool* lbp, LineBuffer& geometry, double zMin, double zMax);
+ LineBuffer* ClipPolygon(LineBufferPool* lbp, LineBuffer& geometry, double zMin, double zMax);
+ int ClipLine(double zMin, double zMax, double* line, double* ret);
+ int ClipCode(double zMin, double zMax, double z);
+
void ComputeSegmentLengths(LineBuffer* geometry, double* segLens);
void ComputeGroupLengths(double* segLens, int numGroups, int* segGroups, double* groupLens);
int ComputeSegmentGroups(LineBuffer* geometry, int contour, double vertexAngleLimit, double* segLens, int* segGroups);
void ComputeGroupDistribution(double groupLen, double startOffset, double endOffset, double repeat, double symWidth,
double& startPos, double& gap, int& numSymbols);
- void ProcessLineOverlapNone(LineBuffer* geometry, SE_RenderLineStyle* style);
- void ProcessLineOverlapDirect(LineBuffer* geometry, SE_RenderLineStyle* style);
protected:
SE_BufferPool* m_pPool;
@@ -142,6 +164,8 @@
int m_rasterGridSize;
int m_minRasterGridSize;
double m_rasterGridSizeOverrideRatio;
+ int m_maxRasterImageWidth;
+ int m_maxRasterImageHeight;
private:
RS_F_Point m_lastSymbolExtent[4];
Modified: sandbox/rfc90/MgDev/Common/Stylization/SE_StyleVisitor.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/SE_StyleVisitor.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/SE_StyleVisitor.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -467,11 +467,8 @@
void SE_StyleVisitor::VisitPath(Path& path)
{
- if (m_primitive)
- {
- delete m_primitive;
- m_primitive = NULL;
- }
+ delete m_primitive;
+ m_primitive = NULL;
SE_Color fillColor;
ParseColorExpression(path.GetFillColor(), fillColor, 0);
@@ -532,11 +529,8 @@
void SE_StyleVisitor::VisitImage(Image& image)
{
- if (m_primitive)
- {
- delete m_primitive;
- m_primitive = NULL;
- }
+ delete m_primitive;
+ m_primitive = NULL;
SE_Raster* primitive = new SE_Raster();
m_primitive = primitive;
@@ -609,11 +603,8 @@
void SE_StyleVisitor::VisitText(Text& text)
{
- if (m_primitive)
- {
- delete m_primitive;
- m_primitive = NULL;
- }
+ delete m_primitive;
+ m_primitive = NULL;
SE_Text* primitive = new SE_Text();
m_primitive = primitive;
Modified: sandbox/rfc90/MgDev/Common/Stylization/SE_SymbolDefProxies.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/SE_SymbolDefProxies.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/SE_SymbolDefProxies.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -300,6 +300,11 @@
if (ctx->fonte == NULL)
return NULL;
+ // don't bother creating a primitive if there's no content
+ const wchar_t* contentStr = content.evaluate(ctx->exec);
+ if (wcslen(contentStr) == 0)
+ return NULL;
+
SE_RenderText* ret = new SE_RenderText();
const wchar_t* sResizeCtrl = resizeControl.evaluate(ctx->exec);
@@ -309,8 +314,9 @@
ret->resizeControl = SE_ResizeControl_AdjustToResizeBox;
else // default is ResizeNone
ret->resizeControl = SE_ResizeControl_ResizeNone;
-
- ret->content = content.evaluate(ctx->exec);
+ if(NULL != content.expression)
+ ret->expression = content.expression->ToString();
+ ret->content = contentStr;
ret->position[0] = position[0].evaluate(ctx->exec);
ret->position[1] = position[1].evaluate(ctx->exec);
@@ -521,6 +527,9 @@
ret->angleRad = fmod(angleDeg.evaluate(ctx->exec), 360.0) * M_PI180;
+ // this one is just a raw double
+ ret->opacity = opacity;
+
SE_Matrix rxf;
rxf.rotate(ret->angleRad);
rxf.translate(ret->position[0], ret->position[1]);
@@ -798,21 +807,33 @@
style->angleRad = fmod(angleDeg.evaluate(ctx->exec), 360.0) * M_PI180;
- // scale by xform->x0 and xform->y1 instead of mm2su, because these encompass
- // mm2su as well as scaleX and scaleY
- style->startOffset = startOffset.evaluate(ctx->exec) * fabs(ctx->xform->x0);
- style->endOffset = endOffset.evaluate(ctx->exec) * fabs(ctx->xform->x0);
- style->repeat = repeat.evaluate(ctx->exec) * fabs(ctx->xform->x0);
- double origRepeat = style->repeat;
+ style->startOffset = startOffset.evaluate(ctx->exec);
+ style->endOffset = endOffset.evaluate(ctx->exec);
+ style->repeat = repeat.evaluate(ctx->exec);
- // It makes no sense to distribute symbols using a repeat value which is much
- // less than one pixel. We'll scale up any value less than 0.25 to 0.5.
- if (style->repeat > 0.0 && style->repeat < 0.25*ctx->px2su)
+ // with parametric units control the repeat / offsets will be scaled
+ // later on by each contour length, which includes the transform
+ double origRepeat = -1.0;
+ if (style->unitsControl == SE_UnitsControl_Absolute)
{
- // just increase it by an integer multiple so the overall distribution
- // isn't affected
- int factor = (int)(0.5*ctx->px2su / style->repeat);
- style->repeat *= factor;
+ // scale by xform->x0 and xform->y1 instead of mm2su, because
+ // these include mm2su as well as scaleX and scaleY
+ style->startOffset *= fabs(ctx->xform->x0);
+ style->endOffset *= fabs(ctx->xform->x0);
+ style->repeat *= fabs(ctx->xform->x0);
+
+ origRepeat = style->repeat;
+
+ // It makes no sense to distribute symbols using a repeat value
+ // which is much less than one pixel. We'll scale up any value
+ // less than 0.25 to 0.5.
+ if (style->repeat > 0.0 && style->repeat < 0.25*ctx->px2su)
+ {
+ // just increase it by an integer multiple so the overall
+ // distribution isn't affected
+ int factor = (int)(0.5*ctx->px2su / style->repeat);
+ style->repeat *= factor;
+ }
}
double angleLimit = vertexAngleLimit.evaluate(ctx->exec);
@@ -976,16 +997,17 @@
double origRepeatX = style->repeat[0];
double origRepeatY = style->repeat[1];
- // It makes no sense to distribute symbols using repeat values which are much
- // less than one pixel. We'll scale up any values less than 0.25 to 0.5.
+ // It makes no sense to distribute symbols using repeat values which
+ // are much less than one pixel. We'll scale up any values less than
+ // 0.25 to 0.5.
for (int i=0; i<=1; ++i)
{
// work with absolute value in case repeat is negative
double repeat = fabs(style->repeat[i]);
if (repeat > 0.0 && repeat < 0.25*ctx->px2su)
{
- // just increase it by an integer multiple so the overall distribution
- // isn't affected
+ // just increase it by an integer multiple so the overall
+ // distribution isn't affected
int factor = (int)(0.5*ctx->px2su / repeat);
style->repeat[i] *= factor;
}
Modified: sandbox/rfc90/MgDev/Common/Stylization/SE_SymbolDefProxies.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/SE_SymbolDefProxies.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/SE_SymbolDefProxies.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -54,6 +54,7 @@
LineBuffer* geometry;
SE_Renderer* renderer;
SE_Matrix* xform;
+ MdfModel::SizeContext sizeContext;
};
@@ -150,8 +151,9 @@
SE_Double extent[2];
SE_Boolean sizeScalable;
SE_Double angleDeg; // degrees CCW
+ double opacity;
- SE_INLINE SE_Raster() : ownPtr(false)
+ SE_INLINE SE_Raster() : ownPtr(false), opacity(1.0)
{}
~SE_Raster()
Modified: sandbox/rfc90/MgDev/Common/Stylization/Stylization.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/Stylization.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/Stylization.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -69,6 +69,16 @@
#include "Text.h"
#include "Override.h"
+#include "WatermarkDefinition.h"
+#include "WatermarkAppearance.h"
+#include "WatermarkInstance.h"
+#include "WatermarkPosition.h"
+#include "XYWatermarkPosition.h"
+#include "TileWatermarkPosition.h"
+#include "WatermarkXOffset.h"
+#include "WatermarkYOffset.h"
+#include "WatermarkOffsetUnit.h"
+
#include "Base64.h"
// FDO headers
Modified: sandbox/rfc90/MgDev/Common/Stylization/Stylization.rc
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/Stylization.rc 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/Stylization.rc 2010-11-13 18:14:35 UTC (rev 5390)
@@ -6,7 +6,7 @@
//
// Generated from the TEXTINCLUDE 1 resource.
//
-#include "afxres.h"
+#include "winresrc.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
1 TEXTINCLUDE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#include ""winresrc.h""\r\n"
"\0"
END
Modified: sandbox/rfc90/MgDev/Common/Stylization/Stylization.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/Stylization.vcproj 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/Stylization.vcproj 2010-11-13 18:14:35 UTC (rev 5390)
@@ -684,10 +684,6 @@
>
</File>
<File
- RelativePath=".\SE_LineRenderer.h"
- >
- </File>
- <File
RelativePath=".\SE_Matrix.cpp"
>
</File>
Modified: sandbox/rfc90/MgDev/Common/Stylization/StylizationEngine.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/StylizationEngine.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/StylizationEngine.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -200,6 +200,550 @@
}
+// opaque is a double between 0 and 1.
+// 0 means totally transparent, while 1 means totally opaque.
+// The caller should be responsible for validating opaque value.
+inline unsigned int TransparentColor(unsigned int argb, double opaque)
+{
+ //unsigned int alpha = (unsigned int)(((argb >> 24) & 0xFF) * opaque);
+ return argb & 0xFFFFFF
+ | (((unsigned int)(((argb >> 24) & 0xFF)* opaque)) << 24);
+}
+
+
+// Unit can't be Pixels.
+// The caller should be responsible for not input pixel
+inline double GetUnitPerMeter(WatermarkOffset::WatermarkOffsetUnit unit)
+{
+ switch(unit)
+ {
+ case WatermarkOffset::Centimeters:
+ return LengthConverter::MetersToUnit(MdfModel::Centimeters, 1);
+ break;
+ case WatermarkOffset::Inches:
+ return LengthConverter::MetersToUnit(MdfModel::Inches, 1);
+ break;
+ case WatermarkOffset::Millimeters:
+ return LengthConverter::MetersToUnit(MdfModel::Millimeters, 1);
+ break;
+ case WatermarkOffset::Points:
+ return LengthConverter::MetersToUnit(MdfModel::Points, 1);
+ break;
+ default:
+ return 1;
+ break;
+ }
+}
+
+
+void StylizationEngine::StylizeWatermark(SE_Renderer* se_renderer,
+ WatermarkDefinition* watermark,
+ int drawWidth, int drawHeight,
+ int saveWidth, int saveHeight)
+{
+ m_serenderer = se_renderer;
+ m_reader = NULL;
+
+ double drawingScale = m_serenderer->GetDrawingScale();
+
+ // get tooltip and url for the layer
+ SE_String seTip;
+ SE_String seUrl;
+ if (se_renderer->SupportsTooltips())
+ m_visitor->ParseStringExpression(L"", seTip, L"");
+ if (se_renderer->SupportsHyperlinks())
+ m_visitor->ParseStringExpression(L"", seUrl, L"");
+
+ double transparency = watermark->GetAppearance()->GetTransparency();
+ transparency = (transparency < 0.0)? 0.0 : ((transparency > 100.0)? 100.0 : transparency);
+ double opacity = 1.0 - 0.01*transparency;
+
+ const double MIMIMUM_RENDERING_OPACITY = 0.001;
+ if (opacity < MIMIMUM_RENDERING_OPACITY) // Not render when totally transparent
+ return;
+ double rotation = watermark->GetAppearance()->GetRotation();
+ rotation = (rotation < 0.0)? 0.0 : ((rotation > 360.0)? 360.0 : rotation);
+
+ SE_Rule rule;
+
+ // Translate watermark source into SE_SymbolInstance list.
+ // As the source is adopted into symbol, we need to detach them after
+ // the rendering is done.
+ CompositeSymbolization symbols;
+
+ std::auto_ptr<SymbolInstance> instance(new SymbolInstance());
+ instance->AdoptSymbolDefinition(watermark->GetContent());
+ instance->SetUsageContext(SymbolInstance::ucPoint);
+ symbols.GetSymbolCollection()->Adopt(instance.release());
+
+ m_visitor->Convert(rule.symbolInstances, &symbols);
+ _ASSERT(rule.symbolInstances.size() == 1u);
+
+ // translate appearance (transparency / rotation) into symbol instance
+ SE_SymbolInstance* sym = rule.symbolInstances[0];
+ size_t nStyles = sym->styles.size();
+ for (size_t styleIx=0; styleIx<nStyles; ++styleIx)
+ {
+ SE_PointStyle* style = (SE_PointStyle*)(sym->styles[styleIx]);
+ style->angleDeg.value = style->angleDeg.defValue = style->angleDeg.defValue + rotation;
+ if (style->symbol.size() == 0)
+ continue;
+
+ size_t nPrimitives = style->symbol.size();
+ for (size_t primitiveIx=0; primitiveIx<nPrimitives; ++primitiveIx)
+ {
+ SE_Primitive* primitive = style->symbol[primitiveIx];
+ SE_Text* textPri = dynamic_cast<SE_Text*>(primitive);
+ SE_Polygon* polygonPri = dynamic_cast<SE_Polygon*>(primitive);
+ SE_Polyline* linePri = dynamic_cast<SE_Polyline*>(primitive);
+ SE_Raster* rasterPri = dynamic_cast<SE_Raster*>(primitive);
+ if (textPri)
+ {
+ // text needs to change color
+ textPri->textColor.value.argb = textPri->textColor.defValue.argb = TransparentColor(textPri->textColor.value.argb, opacity);
+ textPri->ghostColor.value.argb = textPri->ghostColor.defValue.argb = TransparentColor(textPri->ghostColor.value.argb, opacity);
+ textPri->frameLineColor.value.argb = textPri->frameLineColor.defValue.argb = TransparentColor(textPri->frameLineColor.value.argb, opacity);
+ textPri->frameFillColor.value.argb = textPri->frameFillColor.defValue.argb = TransparentColor(textPri->frameFillColor.value.argb, opacity);
+ }
+ else if (linePri)
+ {
+ linePri->color.value.argb = linePri->color.defValue.argb = TransparentColor(linePri->color.value.argb, opacity);
+ if (polygonPri)
+ polygonPri->fill.value.argb = polygonPri->fill.defValue.argb = TransparentColor(polygonPri->fill.value.argb, opacity);
+ }
+ else if (rasterPri)
+ {
+ rasterPri->opacity = opacity;
+ }
+ }
+ }
+
+ // prepare some rendering context variable
+ double mm2sud = m_serenderer->GetScreenUnitsPerMillimeterDevice();
+ double mm2suw = m_serenderer->GetScreenUnitsPerMillimeterWorld();
+ double px2su = m_serenderer->GetScreenUnitsPerPixel();
+ bool yUp = m_serenderer->YPointsUp();
+
+ // the factor to convert screen units to mapping units
+ double su2wu = 0.001 / (mm2suw * m_serenderer->GetMetersPerUnit());
+
+ // prepare the position list
+ XYWatermarkPosition* xyPosition = dynamic_cast<XYWatermarkPosition*>(watermark->GetPosition());
+ TileWatermarkPosition* tilePosition = dynamic_cast<TileWatermarkPosition*>(watermark->GetPosition());
+ WatermarkXOffset::HorizontalAlignment hAlignment = WatermarkXOffset::Center;
+ WatermarkYOffset::VerticalAlignment vAlignment = WatermarkYOffset::Center;
+ WatermarkOffset::WatermarkOffsetUnit hUnit = WatermarkOffset::Pixels;
+ WatermarkOffset::WatermarkOffsetUnit vUnit = WatermarkOffset::Pixels;
+ double xOffset = 0.0;
+ double yOffset = 0.0;
+ if (xyPosition)
+ {
+ hAlignment = xyPosition->GetXPosition()->GetAlignment();
+ vAlignment = xyPosition->GetYPosition()->GetAlignment();
+ hUnit = xyPosition->GetXPosition()->GetUnit();
+ vUnit = xyPosition->GetYPosition()->GetUnit();
+ xOffset = xyPosition->GetXPosition()->GetOffset(); // in watermark units
+ yOffset = xyPosition->GetYPosition()->GetOffset(); // in watermark units
+ }
+ else if (tilePosition)
+ {
+ hAlignment = tilePosition->GetHorizontalPosition()->GetAlignment();
+ vAlignment = tilePosition->GetVerticalPosition()->GetAlignment();
+ hUnit = tilePosition->GetHorizontalPosition()->GetUnit();
+ vUnit = tilePosition->GetVerticalPosition()->GetUnit();
+ xOffset = tilePosition->GetHorizontalPosition()->GetOffset(); // in watermark units
+ yOffset = tilePosition->GetVerticalPosition()->GetOffset(); // in watermark units
+ }
+ double pixelPerMeterDevice = 1000.0 * mm2sud / px2su;
+ double suPerhUnit = ((hUnit == WatermarkOffset::Pixels)? 1.0 : pixelPerMeterDevice / GetUnitPerMeter(hUnit)) * px2su;
+ double suPervUnit = ((vUnit == WatermarkOffset::Pixels)? 1.0 : pixelPerMeterDevice / GetUnitPerMeter(vUnit)) * px2su;
+ xOffset *= suPerhUnit; // in screen units
+ yOffset *= suPervUnit; // in screen units
+
+ std::vector<double> watermarkPosList;
+ if (xyPosition)
+ {
+ switch (hAlignment)
+ {
+ case WatermarkXOffset::Right:
+ xOffset = saveWidth - xOffset;
+ break;
+ case WatermarkXOffset::Left:
+ break;
+ default:
+ xOffset += 0.5*saveWidth;
+ break;
+ }
+
+ switch (vAlignment)
+ {
+ case WatermarkYOffset::Bottom:
+ yOffset = yUp? yOffset : saveHeight - yOffset;
+ break;
+ case WatermarkYOffset::Top:
+ yOffset = yUp? saveHeight - yOffset : yOffset;
+ break;
+ default:
+ yOffset = 0.5*saveHeight + (yUp? yOffset : -yOffset);
+ break;
+ }
+
+ xOffset *= drawWidth / saveWidth;
+ yOffset *= drawHeight / saveHeight;
+ double mapPosX, mapPosY;
+ m_serenderer->ScreenToWorldPoint(xOffset, yOffset, mapPosX, mapPosY);
+ watermarkPosList.push_back(mapPosX);
+ watermarkPosList.push_back(mapPosY);
+ }
+ else if (tilePosition)
+ {
+ double tileWidth = tilePosition->GetTileWidth()*px2su;
+ double tileHeight = tilePosition->GetTileHeight()*px2su;
+
+ switch (hAlignment)
+ {
+ case WatermarkXOffset::Right:
+ xOffset = tileWidth - xOffset;
+ break;
+ case WatermarkXOffset::Left:
+ break;
+ default:
+ xOffset += 0.5*tileWidth;
+ break;
+ }
+
+ switch (vAlignment)
+ {
+ case WatermarkYOffset::Bottom:
+ yOffset = yUp? yOffset : tileHeight - yOffset;
+ break;
+ case WatermarkYOffset::Top:
+ yOffset = yUp? tileHeight - yOffset : yOffset;
+ break;
+ default:
+ yOffset = 0.5*tileHeight + (yUp? yOffset : -yOffset);
+ break;
+ }
+
+ double drawPosX, drawPosY, mapPosX, mapPosY;
+ for (int i=0; i<=(int)(saveWidth/tileWidth); ++i)
+ {
+ for (int j=0; j<=(int)(saveHeight/tileHeight); ++j)
+ {
+ drawPosX = i*tileWidth+xOffset;
+ drawPosY = yUp? (saveHeight-(j+1)*tileHeight+yOffset) : j*tileHeight+yOffset;
+ xOffset *= drawWidth / saveWidth;
+ yOffset *= drawHeight / saveHeight;
+ m_serenderer->ScreenToWorldPoint(drawPosX, drawPosY, mapPosX, mapPosY);
+ watermarkPosList.push_back(mapPosX);
+ watermarkPosList.push_back(mapPosY);
+ }
+ }
+ }
+
+ // we always start with rendering pass 0
+ int symbolRenderingPass = 0;
+ int nextSymbolRenderingPass = -1;
+
+ // main loop over feature data
+ int numPasses = 0;
+ while (symbolRenderingPass >= 0)
+ {
+ ++numPasses;
+
+ // create an expression engine with our custom functions
+ // NOTE: We must create a new engine with each rendering pass. The engine
+ // stores a weak reference to the RS_FeatureReader's internal
+ // FdoIFeatureReader, and this internal reader is different for each
+ // pass.
+ FdoPtr<FdoExpressionEngine> exec = ExpressionHelper::GetExpressionEngine(se_renderer, NULL);
+
+ std::auto_ptr<LineBuffer> spLB;
+ size_t nPos = watermarkPosList.size();
+ for (size_t posIx=0; posIx<nPos; posIx+=2)
+ {
+ //Get geometry
+ LineBuffer* lb = LineBufferPool::NewLineBuffer(m_pool, 8, FdoDimensionality_Z);
+ spLB.reset(lb);
+ lb->MoveTo(watermarkPosList[posIx], watermarkPosList[posIx+1]);
+ // tell line buffer the current drawing scale (used for arc tessellation)
+ lb->SetDrawingScale(drawingScale);
+
+ //Render line buffer
+
+ // -------------------------------------------------------------------------
+ //
+ // Here's a description of how the transforms work for point symbols.
+ //
+ // =============
+ // Point Symbols
+ // =============
+ //
+ // For point symbols we have the following transform stack:
+ //
+ // [T_fe] [S_mm] [T_si] [R_pu] [S_si] [T_pu] {Geom}
+ //
+ // where:
+ // T_pu = point usage origin offset (a translation)
+ // S_si = symbol instance scaling
+ // R_pu = point usage rotation
+ // T_si = symbol instance insertion offset
+ // S_mm = scaling converting mm to screen units (also includes inverting y, if necessary)
+ // T_fe = translation to the point feature
+ //
+ // This can be rewritten as:
+ //
+ // [T_fe] [T_si*] [R_pu*] [T_pu*] [S_mm] [S_si] {Geom}
+ //
+ // where:
+ // T_si* = symbol instance insertion offset, using offsets scaled by S_mm
+ // R_pu* = point usage rotation, with angle accounting for y-up or y-down
+ // T_pu* = point usage origin offset, using offsets scaled by S_mm and S_si
+ //
+ // We store [S_mm] [S_si] in xformScale below, and apply it to the symbol geometry
+ // during symbol evaluation. The remaining transforms get applied in SE_Renderer::
+ // ProcessPoint.
+ // -------------------------------------------------------------------------
+
+ // TODO: Obey the indices - get rid of the indices altogther - single pass!
+
+ // For now always clip using the new stylization - the performance impact of not
+ // clipping is too high. We also need a better approach to clipping. Instead
+ // of clipping the feature geometry we need to calculate where to start/stop
+ // drawing symbols.
+ bool bClip = true; //m_serenderer->RequiresClipping();
+ double clipOffsetSU = 0.0;
+
+ // Make a pass over all the instances. During this pass we:
+ // - evaluate the active styles
+ // - compute the overall clip offset
+
+ SE_Matrix xformScale;
+ xformScale.scale(sym->scale[0].evaluate(exec),
+ sym->scale[1].evaluate(exec));
+
+ // The symbol geometry needs to be inverted if the y coordinate in the renderer
+ // points down. This is so that in symbol definitions y points up consistently
+ // no matter what the underlying renderer is doing. Normally we could just apply
+ // the world to screen transform to everything, but in some cases we only apply
+ // it to the position of the symbol and then offset the symbol geometry from
+ // there - so the symbol geometry needs to be pre-inverted.
+ double mm2suX = (sym->sizeContext == MappingUnits)? mm2suw : mm2sud;
+ double mm2suY = yUp? mm2suX : -mm2suX;
+ xformScale.scale(mm2suX, mm2suY);
+
+ // initialize the style evaluation context
+ SE_EvalContext evalCtx;
+ evalCtx.exec = exec;
+ evalCtx.mm2su = mm2suX;
+ evalCtx.mm2sud = mm2sud;
+ evalCtx.mm2suw = mm2suw;
+ evalCtx.px2su = px2su;
+ evalCtx.pool = m_pool;
+ evalCtx.fonte = m_serenderer->GetRSFontEngine();
+ evalCtx.xform = &xformScale;
+ evalCtx.resources = m_resources;
+
+ // iterate over all styles in the instance
+ for (size_t styIx=0; styIx<nStyles; ++styIx)
+ {
+ SE_Style* style = sym->styles[styIx];
+
+ // process the symbol rendering pass - negative rendering passes are
+ // rendered with pass 0
+ int symbolRenderPass = style->renderPass.evaluate(exec);
+ if (symbolRenderPass < 0)
+ symbolRenderPass = 0;
+
+ // if the rendering pass for the style doesn't match the current pass
+ // then don't render using it
+ if (symbolRenderPass != symbolRenderingPass)
+ continue;
+
+ // evaluate the style (all expressions inside it) and convert to a
+ // constant screen space render style
+ style->evaluate(&evalCtx);
+ }
+
+ // Adjust the offset according to watermark position
+ // For example, the watermark is on top/left, the original offset is enough.
+ // However, if the watermark is on bottom/right, the symbols has to be added
+ // an offset to make the bottom/right of their bounds to be the position.
+ RS_F_Point bounds[4];
+ bounds[0].x = bounds[3].x = +DBL_MAX;
+ bounds[1].x = bounds[2].x = -DBL_MAX;
+ bounds[0].y = bounds[1].y = +DBL_MAX;
+ bounds[2].y = bounds[3].y = -DBL_MAX;
+ for (size_t styIx=0; styIx<nStyles; ++styIx)
+ {
+ SE_RenderPointStyle* ptStyle = (SE_RenderPointStyle*)(
+ sym->styles[styIx]->rstyle);
+ SE_Matrix xformStyle;
+
+ // point usage offset (already scaled)
+ xformStyle.translate(ptStyle->offset[0], ptStyle->offset[1]);
+ // point usage rotation - assume geometry angle is zero
+ xformStyle.rotate(ptStyle->angleRad);
+ // compute the offset
+ for (int i=0; i<4; ++i)
+ {
+ // account for the style-specific transform
+ RS_F_Point pt = ptStyle->bounds[i];
+ xformStyle.transform(pt.x, pt.y);
+ bounds[0].x = bounds[3].x = rs_min(bounds[0].x, pt.x);
+ bounds[1].x = bounds[2].x = rs_max(bounds[2].x, pt.x);
+ bounds[0].y = bounds[1].y = rs_min(bounds[0].y, pt.y);
+ bounds[2].y = bounds[3].y = rs_max(bounds[2].y, pt.y);
+ }
+ }
+
+ // bounds[0].x is left, bounds[1].x is right
+ switch (hAlignment)
+ {
+ case WatermarkXOffset::Right:
+ sym->absOffset[0].value = sym->absOffset[0].defValue = -bounds[1].x / mm2suX;
+ break;
+ case WatermarkXOffset::Left:
+ sym->absOffset[0].value = sym->absOffset[0].defValue = -bounds[0].x / mm2suX;
+ break;
+ default:
+ sym->absOffset[0].value = sym->absOffset[0].defValue = -0.5*(bounds[0].x + bounds[1].x) / mm2suX;
+ break;
+ }
+
+ // bounds[1].y is bottom, bounds[2].y is top
+ switch (vAlignment)
+ {
+ case WatermarkYOffset::Bottom:
+ sym->absOffset[1].value = sym->absOffset[1].defValue = (yUp? -1.0: 1.0) * bounds[1].y / mm2suY;
+ break;
+ case WatermarkYOffset::Top:
+ sym->absOffset[1].value = sym->absOffset[1].defValue = (yUp? -1.0: 1.0) * bounds[2].y / mm2suY;
+ break;
+ default:
+ sym->absOffset[1].value = sym->absOffset[1].defValue = (yUp? -1.0: 1.0) * 0.5*(bounds[1].y + bounds[2].y) / mm2suY;
+ break;
+ }
+
+ // prepare the geometry on which we will apply the styles
+ if (bClip)
+ {
+ // compute offset to apply to the clipping bounds
+ for (size_t styIx=0; styIx<nStyles; ++styIx)
+ {
+ SE_Style* style = sym->styles[styIx];
+ double styleClipOffsetSU = GetClipOffset(sym, style, exec, mm2suX, mm2suY);
+ clipOffsetSU = rs_max(styleClipOffsetSU, clipOffsetSU);
+ }
+
+ // compute the clip region to use - start with the map request extents
+ RS_Bounds clip = m_serenderer->GetBounds();
+
+ // add one pixel's worth to handle any roundoff
+ clipOffsetSU += px2su;
+
+ // limit the offset to something reasonable
+ if (clipOffsetSU > MAX_CLIPOFFSET_IN_MM * mm2sud)
+ clipOffsetSU = MAX_CLIPOFFSET_IN_MM * mm2sud;
+
+ // expand clip region by the offset
+ double clipOffsetWU = clipOffsetSU * su2wu;
+ clip.minx -= clipOffsetWU;
+ clip.miny -= clipOffsetWU;
+ clip.maxx += clipOffsetWU;
+ clip.maxy += clipOffsetWU;
+
+ // clip geometry to given extents
+ LineBuffer* lbc = lb->Clip(clip, LineBuffer::ctAGF, m_pool);
+ if (lbc != lb)
+ {
+ // if the clipped buffer is NULL (completely clipped) just move on to
+ // the next feature
+ if (!lbc) continue;
+
+ // otherwise continue processing with the clipped buffer
+ lb = lbc;
+ spLB.reset(lb);
+ }
+ }
+
+ // Make another pass over all the instances. During this pass we:
+ // - compute the next symbol rendering pass
+ // - apply the styles to the geometry (original or clipped)
+
+ // initialize the style application context
+ SE_Matrix xformTrans;
+ xformTrans.translate(sym->absOffset[0].evaluate(exec) * mm2suX,
+ sym->absOffset[1].evaluate(exec) * mm2suY);
+
+ SE_ApplyContext applyCtx;
+ applyCtx.geometry = lb;
+ applyCtx.renderer = m_serenderer;
+ applyCtx.xform = &xformTrans;
+ applyCtx.sizeContext = sym->sizeContext;
+
+ for (size_t styIx=0; styIx<nStyles; ++styIx)
+ {
+ SE_Style* style = sym->styles[styIx];
+
+ // process the symbol rendering pass - negative rendering passes are
+ // rendered with pass 0
+ int symbolRenderPass = style->renderPass.evaluate(exec);
+ if (symbolRenderPass < 0)
+ symbolRenderPass = 0;
+
+ // If the rendering pass for the style doesn't match the current pass
+ // then don't render using it.
+ if (symbolRenderPass != symbolRenderingPass)
+ {
+ // if the style's rendering pass is greater than the current pass,
+ // then update nextRenderingPass to account for it
+ if (symbolRenderPass > symbolRenderingPass)
+ {
+ // update nextRenderingPass if it hasn't yet been set, or if
+ // the style's pass is less than the current next pass
+ if (nextSymbolRenderingPass == -1 || symbolRenderPass < nextSymbolRenderingPass)
+ nextSymbolRenderingPass = symbolRenderPass;
+ }
+
+ continue;
+ }
+
+ // TODO: why are these in the symbol instance?
+ style->rstyle->addToExclusionRegion = sym->addToExclusionRegion.evaluate(exec);
+ style->rstyle->checkExclusionRegion = sym->checkExclusionRegion.evaluate(exec);
+ style->rstyle->drawLast = sym->drawLast.evaluate(exec);
+
+ const wchar_t* positioningAlgo = sym->positioningAlgorithm.evaluate(exec);
+ if (wcslen(positioningAlgo) > 0)
+ {
+ LayoutCustomLabel(positioningAlgo, &applyCtx, style->rstyle, mm2suX);
+ }
+ else
+ {
+ // apply the style to the geometry using the renderer
+ style->apply(&applyCtx);
+ }
+ }
+
+
+ if(spLB.get())
+ LineBufferPool::FreeLineBuffer(m_pool, spLB.release());
+ }
+
+ // switch to the next symbol rendering pass
+ symbolRenderingPass = nextSymbolRenderingPass;
+ nextSymbolRenderingPass = -1;
+ }
+
+ // Detach symbol definition from the created composite symbol so that
+ // it will not be finalized when composite symbol is finalized.
+ // The code is sure there is only one symbol instance.
+ _ASSERT(symbols.GetSymbolCollection()->GetCount() == 1);
+ symbols.GetSymbolCollection()->GetAt(0)->OrphanSymbolDefinition();
+}
+
+
void StylizationEngine::Stylize(RS_FeatureReader* reader,
FdoExpressionEngine* exec,
LineBuffer* geometry,
@@ -619,6 +1163,7 @@
applyCtx.geometry = lb;
applyCtx.renderer = m_serenderer;
applyCtx.xform = &xformTrans;
+ applyCtx.sizeContext = sym->sizeContext;
size_t nStyles = sym->styles.size();
for (size_t styIx=0; styIx<nStyles; ++styIx)
Modified: sandbox/rfc90/MgDev/Common/Stylization/StylizationEngine.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/StylizationEngine.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/StylizationEngine.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -69,6 +69,14 @@
CancelStylization cancel,
void* userData);
+ //Stylize the supplied watermark
+ void StylizeWatermark(SE_Renderer* se_renderer,
+ WatermarkDefinition* watermark,
+ int drawWidth,
+ int drawHeight,
+ int saveWidth,
+ int saveHeight);
+
// Stylizes the current feature on the reader using the supplied composite type style.
void Stylize(RS_FeatureReader* reader,
FdoExpressionEngine* exec,
Modified: sandbox/rfc90/MgDev/Common/Stylization/StylizationUtil.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/StylizationUtil.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/StylizationUtil.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -23,7 +23,6 @@
#include "SLDSymbols.h"
#include "SE_StyleVisitor.h"
#include "SE_BufferPool.h"
-#include "Foundation.h"
extern void ProcessStylizerException(FdoException* exception, int line, wchar_t* file);
@@ -640,6 +639,7 @@
applyCtx.geometry = NULL; // gets set below
applyCtx.renderer = pSERenderer;
applyCtx.xform = &xform;
+ applyCtx.sizeContext = sym->sizeContext;
for (std::vector<SE_Style*>::const_iterator siter = sym->styles.begin(); siter != sym->styles.end(); siter++)
{
@@ -659,7 +659,7 @@
// don't call style->apply() since we do some special processing
// to make the point symbol fill the preview image
- SE_RenderPointStyle* ptStyle = (SE_RenderPointStyle*)(rStyle);
+ SE_RenderPointStyle* ptStyle = (SE_RenderPointStyle*)rStyle;
// get the center of the scaled point symbol
double symCtrX = 0.5*(symBounds.minx + symBounds.maxx) * scale;
@@ -723,6 +723,18 @@
}
}
+ // if the the line style uses parametric units control reconfigure
+ // it so you just get one symbol at the middle
+ SE_RenderLineStyle* lnStyle = (SE_RenderLineStyle*)rStyle;
+ if (lnStyle->unitsControl == SE_UnitsControl_Parametric)
+ {
+ if (lnStyle->repeat > 0.0)
+ lnStyle->repeat = 0.5;
+
+ lnStyle->startOffset = rs_min(lnStyle->startOffset, 0.0);
+ lnStyle->endOffset = rs_min(lnStyle->endOffset, 0.0);
+ }
+
// just apply the style to the preview geometry
applyCtx.geometry = &lb;
style->apply(&applyCtx);
@@ -829,6 +841,9 @@
// look the same when scaled. We therefore don't want these to be a contributing
// factor in the scaling, and therefore don't add their bounds to the returned
// bounds.
+ //
+ // Another example is line styles which have parametric-based units control
+ // enabled.
bool addBounds = true;
SE_RenderStyle* rStyle = style->rstyle;
@@ -836,7 +851,7 @@
{
case SE_RenderStyle_Point:
{
- SE_RenderPointStyle* ptStyle = (SE_RenderPointStyle*)(rStyle);
+ SE_RenderPointStyle* ptStyle = (SE_RenderPointStyle*)rStyle;
// point usage offset (already scaled)
xformStyle.translate(ptStyle->offset[0], ptStyle->offset[1]);
@@ -853,10 +868,10 @@
case SE_RenderStyle_Line:
{
- SE_RenderLineStyle* lnStyle = (SE_RenderLineStyle*)(rStyle);
+ SE_RenderLineStyle* lnStyle = (SE_RenderLineStyle*)rStyle;
// see comment above the addBounds declaration
- if (lnStyle->solidLine)
+ if (lnStyle->solidLine || lnStyle->unitsControl == SE_UnitsControl_Parametric)
addBounds = false;
// make the preview bounds width include two repetitions of the symbol
@@ -874,7 +889,7 @@
case SE_RenderStyle_Area:
{
- SE_RenderAreaStyle* arStyle = (SE_RenderAreaStyle*)(rStyle);
+ SE_RenderAreaStyle* arStyle = (SE_RenderAreaStyle*)rStyle;
// see comment above the addBounds declaration
if (arStyle->solidFill)
@@ -1019,7 +1034,7 @@
{
case SE_RenderStyle_Point:
{
- SE_RenderPointStyle* ptStyle = (SE_RenderPointStyle*)(rStyle);
+ SE_RenderPointStyle* ptStyle = (SE_RenderPointStyle*)rStyle;
// point usage offset (already scaled)
xformStyle.translate(ptStyle->offset[0], ptStyle->offset[1]);
@@ -1036,7 +1051,7 @@
case SE_RenderStyle_Line:
{
- SE_RenderLineStyle* lnStyle = (SE_RenderLineStyle*)(rStyle);
+ SE_RenderLineStyle* lnStyle = (SE_RenderLineStyle*)rStyle;
// line usage rotation - assume geometry angle is zero
xformStyle.rotate(lnStyle->angleRad);
@@ -1046,7 +1061,7 @@
case SE_RenderStyle_Area:
{
- SE_RenderAreaStyle* arStyle = (SE_RenderAreaStyle*)(rStyle);
+ SE_RenderAreaStyle* arStyle = (SE_RenderAreaStyle*)rStyle;
// area usage rotation - assume geometry angle is zero
xformStyle.rotate(arStyle->angleRad);
Modified: sandbox/rfc90/MgDev/Common/Stylization/Stylizer.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/Stylizer.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/Stylizer.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -76,6 +76,16 @@
double mapScale) = 0;
///<summary>
+ /// Stylizes a watermark.
+ ///</summary>
+ virtual void StylizeWatermark(Renderer* renderer,
+ MdfModel::WatermarkDefinition* watermark,
+ int drawWidth,
+ int drawHeight,
+ int saveWidth,
+ int saveHeight) = 0;
+
+ ///<summary>
/// Allows a user to set a custom stylization object for a given geometry type.
///</summary>
virtual void SetGeometryAdapter(FdoGeometryType type, GeometryAdapter* stylizer) = 0;
Modified: sandbox/rfc90/MgDev/Common/Stylization/ThemeParameters.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/ThemeParameters.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/ThemeParameters.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -17,7 +17,6 @@
#include "stdafx.h"
#include "ThemeParameters.h"
-#include "Foundation.h"
static const wchar_t* sEmpty = L"";
Modified: sandbox/rfc90/MgDev/Common/Stylization/atom.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/atom.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/atom.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -2122,10 +2122,8 @@
~RangeCapabilityParticle()
{
- if(m_pMin)
- delete(m_pMin);
- if(m_pMax)
- delete(m_pMax);
+ delete(m_pMin);
+ delete(m_pMax);
}
Particle* Clone() const
Modified: sandbox/rfc90/MgDev/Common/Stylization/atom_element_style.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/atom_element_style.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/atom_element_style.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -71,7 +71,8 @@
ATOM::Status StyleDescriptionElement::RemoveFromDescription(const ATOM::StyleParticle::StyleParticleType eType)
{
ATOM::StyleParticle* pGone = RemoveFromList(m_pDescription,eType);
- if(pGone != NULL) {
+ if(pGone != NULL)
+ {
delete(pGone);
return ATOM::Status::keOk;
}
@@ -88,7 +89,6 @@
-
/* Style Particle List Tools */
// Finds (the first) particle in a list (or set)
@@ -180,7 +180,8 @@
void StyleChangeElement::Reset()
{
// Kill the deltas.
- while(m_pDeltas) {
+ while(m_pDeltas)
+ {
ATOM::StyleParticle* p = m_pDeltas;
m_pDeltas = const_cast<ATOM::StyleParticle*>(p->Next());
delete(p);
Modified: sandbox/rfc90/MgDev/Common/Stylization/mtext_parser.cpp
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/mtext_parser.cpp 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/mtext_parser.cpp 2010-11-13 18:14:35 UTC (rev 5390)
@@ -1892,12 +1892,12 @@
// Takes a pointer to an existing parser and destroys it.
ATOM::Status MTextGenerator::Destroy(ATOM::ISink* pOldSink)
{
- if(pOldSink == NULL)
+ if (pOldSink == NULL)
return ATOM::Status::keInvalidArg;
// TO DO ... validate that it's one of ours?
- delete(pOldSink);
+ delete pOldSink;
return ATOM::Status::keOk;
}
Modified: sandbox/rfc90/MgDev/Common/Stylization/stdafx.h
===================================================================
--- sandbox/rfc90/MgDev/Common/Stylization/stdafx.h 2010-11-13 18:07:46 UTC (rev 5389)
+++ sandbox/rfc90/MgDev/Common/Stylization/stdafx.h 2010-11-13 18:14:35 UTC (rev 5390)
@@ -28,4 +28,11 @@
// when aggressive inlining is turned on in the project file.
#define __ACE_INLINE__ 0
+#else
+
+#define _wcsicmp wcscasecmp
+#define _wcsnicmp wcsncasecmp
+
+#define _isnan isnan
+
#endif
More information about the mapguide-commits
mailing list