[mapguide-commits] r4304 - in trunk/MgDev: Common/Geometry Common/Geometry/CoordinateSystem Web/src/DotNetUnmanagedApi/Geometry

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Oct 17 02:39:30 EDT 2009


Author: waltweltonlair
Date: 2009-10-17 02:39:29 -0400 (Sat, 17 Oct 2009)
New Revision: 4304

Added:
   trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGridOrientation.h
   trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGridSpecializationType.h
Modified:
   trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGrids.h
   trunk/MgDev/Common/Geometry/Geometry.vcproj
   trunk/MgDev/Common/Geometry/GeometryCommon.h
   trunk/MgDev/Common/Geometry/Makefile.am
   trunk/MgDev/Web/src/DotNetUnmanagedApi/Geometry/GeometryConstants.xml
Log:
The CoordinateSystemGrids.h header file is listed in GeometryApiGen.xml so that its
declared type can be part of the published API.  However there's a problem - the
header file declares both regular classes (with constructors, destructor, and methods)
and enumerations (static constants defined inside a class).  Any class included in
an ApiGen.xml file is treated as a regular class by SWIG, and so the DotNet API classes
corresponding to the enumerations were being created with constructors, etc.  This leads
to incorrect published API.

For MapGuide published API the correct thing to do is to put regular classes and
enumerated types into different header files.  The regular types can then be included
in the xyzApiGen.xml file, while the enumerated types are included in the xyzConstants.xml
file.

I have split out the enumerated types from CoordinateSystemGrids.h and put these into
separate classes.  The new headers are now specified in GeometryConstants.xml.

CoordinateSystemGrids.h is still not adhering to the MapGuide coding standards in that
it declares multiple classes.  The coding standard specifies one class per file.  See
https://trac.osgeo.org/mapguide/wiki/MapGuideCodingStandards#SourceFileNaming.

I also noticed some other problems with the new published grid classes:
 * missing \defgroup and \ingroup tags
 * some types are declared as published API but are not included in the API XML files

Someone working on the grid functionality needs to clean this up before the next release.


Added: trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGridOrientation.h
===================================================================
--- trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGridOrientation.h	                        (rev 0)
+++ trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGridOrientation.h	2009-10-17 06:39:29 UTC (rev 4304)
@@ -0,0 +1,51 @@
+//
+//  Copyright (C) 2004-2009 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 _MGCOORDINATESYSTEMGRIDORIENTATION_H_
+#define _MGCOORDINATESYSTEMGRIDORIENTATION_H_
+
+///////////////////////////////////////////////////////////////////////////////
+/// <summary>
+/// An enumeration of the supported values for the <c>m_Orientation</c> member
+/// of several objects related to grids and graticules. <p>
+/// This value is used to qualify objects which are of the "iso" type.  I.e. a
+/// grid line is referred to as an isoline as it is the locus of points which
+/// have a specific value for either the easting or the northing.  It is this
+/// value which indicates which.  Thus, a grid line which is classified as
+/// having an "EastWest" orientation will be a isoline which is the locus of
+/// points which share a common <b>easting</b> value, and the "m_Value" element
+/// of that object will be an <b>easting</b> value.  Note that in this example,
+/// the line is typically a vertical line.
+/// </summary>
+class MG_GEOMETRY_API MgCoordinateSystemGridOrientation
+{
+PUBLISHED_API:
+    ///////////////////////////////////////////////////////////////////////////
+    /// /brief Not specified yet, initialize to this value.
+    static const INT8 None = 0;
+    ///////////////////////////////////////////////////////////////////////////
+    /// /brief The object represents a constant easting value.
+    static const INT8 EastWest = 1;         // generally indicates a vertical grid line
+    ///////////////////////////////////////////////////////////////////////////
+    /// /brief The object represents a constant northing value.
+    static const INT8 NorthSouth = 2;       // generally indicates a horizontal grid line
+    ///////////////////////////////////////////////////////////////////////////
+    /// /brief Indicates the failure of an algorithm or other problem.
+    static const INT8 Unknown = 3;          // indicates a failure of an algorithm
+};
+
+#endif //_MGCOORDINATESYSTEMGRIDORIENTATION_H_


Property changes on: trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGridOrientation.h
___________________________________________________________________
Added: svn:eol-style
   + native

Added: trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGridSpecializationType.h
===================================================================
--- trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGridSpecializationType.h	                        (rev 0)
+++ trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGridSpecializationType.h	2009-10-17 06:39:29 UTC (rev 4304)
@@ -0,0 +1,55 @@
+//
+//  Copyright (C) 2004-2009 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 _MGCOORDINATESYSTEMGRIDSPECIALIZATIONTYPE_H_
+#define _MGCOORDINATESYSTEMGRIDSPECIALIZATIONTYPE_H_
+
+///////////////////////////////////////////////////////////////////////////////
+/// <summary>
+/// An enumeration of the various types of specialized grids/graticules
+/// currently supported.  A specialized grid is one for which specific
+/// standards exist to which the results of this feature are compliant with.
+/// A generic grid is a simple non-standardized grid of a coordinate system
+/// drawn in a viewport based on another coordinate system. <p>
+/// The values assigned are intended to support grouping standardized grids
+/// with similar features and is currently entirely arbitrary.  Using a
+/// numeric literal instead of thes names of the defined constants is a sure
+/// way to write code that will get broken in the future.
+/// </summary>
+class MG_GEOMETRY_API MgCoordinateSystemGridSpecializationType
+{
+PUBLISHED_API:
+    ///////////////////////////////////////////////////////////////////////////
+    /// /brief Not specified yet, initialize to this value.
+    static const INT32 None              = 0;
+    ///////////////////////////////////////////////////////////////////////////
+    /// /brief Generic grid of a specified coordinate system; may be
+    /// geographic or projected.
+    static const INT32 Generic           = (0 + 1);     // Generic grid of a specified coordinate system;
+                                                        // may be geographic or projected
+    ///////////////////////////////////////////////////////////////////////////
+    /// /brief Specialized grid: MGRS (Military Grid Reference System)
+    static const INT32 MGRS              = (16 + 1);
+    ///////////////////////////////////////////////////////////////////////////
+    /// /brief Specialized grid: USNG (United States National Grid)
+    static const INT32 USNG              = (16 + 2);
+    ///////////////////////////////////////////////////////////////////////////
+    /// /brief Indicates the failure of an algorithm or other problem.
+    static const INT32 Unknown           = (65366);
+};
+
+#endif //_MGCOORDINATESYSTEMGRIDSPECIALIZATIONTYPE_H_


Property changes on: trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGridSpecializationType.h
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGrids.h
===================================================================
--- trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGrids.h	2009-10-17 05:28:48 UTC (rev 4303)
+++ trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemGrids.h	2009-10-17 06:39:29 UTC (rev 4304)
@@ -15,6 +15,9 @@
 //  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
+#ifndef _MGCOORDINATESYSTEMGRIDS_H_
+#define _MGCOORDINATESYSTEMGRIDS_H_
+
 //=============================================================================
 // Class declararations
 class MgCoordinateSystemGridBoundary;           // MgPolygon based extents of the grid
@@ -47,73 +50,8 @@
                                                 // as a double
 
 
-
 ///////////////////////////////////////////////////////////////////////////////
 /// <summary>
-/// An enumeration of the various types of specialized grids/graticules
-/// currently supported.  A specialized grid is one for which specific
-/// standards exist to which the results of this feature are compliant with.
-/// A generic grid is a simple non-standardized grid of a coordinate system
-/// drawn in a viewport based on another coordinate system. <p>
-/// The values assigned are intended to support grouping standardized grids
-/// with similar features and is currently entirely arbitrary.  Using a
-/// numeric literal instead of thes names of the defined constants is a sure
-/// way to write code that will get broken in the future.
-/// </summary>
-class MgCoordinateSystemGridSpecializationType
-{
-PUBLISHED_API:
-    ///////////////////////////////////////////////////////////////////////////
-    /// /brief Not specified yet, initialize to this value.
-    static const INT32 None              = 0;
-    ///////////////////////////////////////////////////////////////////////////
-    /// /brief Generic grid of a specified coordinate system; may be
-    /// geographic or projected.
-    static const INT32 Generic           = (0 + 1);     // Generic grid of a specified coordinate system;
-                                                        // may be geographic or projected
-    ///////////////////////////////////////////////////////////////////////////
-    /// /brief Specialized grid: MGRS (Military Grid Reference System)
-    static const INT32 MGRS              = (16 + 1);
-    ///////////////////////////////////////////////////////////////////////////
-    /// /brief Specialized grid: USNG (United States National Grid)
-    static const INT32 USNG              = (16 + 2);
-    ///////////////////////////////////////////////////////////////////////////
-    /// /brief Indicates the failure of an algorithm or other problem.
-    static const INT32 Unknown           = (65366);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-/// <summary>
-/// An enumeration of the supported values for the <c>m_Orientation</c> member
-/// of several objects related to grids and graticules. <p>
-/// This value is used to qualify objects which are of the "iso" type.  I.e. a
-/// grid line is referred to as an isoline as it is the locus of points which
-/// have a specific value for either the easting or the northing.  It is this
-/// value which indicates which.  Thus, a grid line which is classified as
-/// having an "EastWest" orientation will be a isoline which is the locus of
-/// points which share a common <b>easting</b> value, and the "m_Value" element
-/// of that object will be an <b>easting</b> value.  Note that in this example,
-/// the line is typically a vertical line.
-/// </summary>
-class MgCoordinateSystemGridOrientation
-{
-PUBLISHED_API:
-    ///////////////////////////////////////////////////////////////////////////
-    /// /brief Not specified yet, initialize to this value.
-    static const INT8 None = 0;
-    ///////////////////////////////////////////////////////////////////////////
-    /// /brief The object represents a constant easting value.
-    static const INT8 EastWest = 1;         // generally indicates a vertical grid line
-    ///////////////////////////////////////////////////////////////////////////
-    /// /brief The object represents a constant northing value.
-    static const INT8 NorthSouth = 2;       // generally indicates a horizontal grid line
-    ///////////////////////////////////////////////////////////////////////////
-    /// /brief Indicates the failure of an algorithm or other problem.
-    static const INT8 Unknown = 3;          // indicates a failure of an algorithm
-};
-
-///////////////////////////////////////////////////////////////////////////////
-/// <summary>
 /// <c>MgCoordinateSystemGridSpecification</c> is an object that is used to
 /// convey all the parameters necessary for the generation of a grid/graticule
 /// lumped into a single object for convenience.  Thus, adding a parameter
@@ -905,3 +843,5 @@
 CLASS_ID:
     static const INT32 m_cls_id = CoordinateSystem_CoordinateSystemGridTickCollection;
 };
+
+#endif //_MGCOORDINATESYSTEMGRIDS_H_

Modified: trunk/MgDev/Common/Geometry/Geometry.vcproj
===================================================================
--- trunk/MgDev/Common/Geometry/Geometry.vcproj	2009-10-17 05:28:48 UTC (rev 4303)
+++ trunk/MgDev/Common/Geometry/Geometry.vcproj	2009-10-17 06:39:29 UTC (rev 4304)
@@ -2653,10 +2653,18 @@
 				>
 			</File>
 			<File
+				RelativePath=".\CoordinateSystem\CoordinateSystemGridOrientation.h"
+				>
+			</File>
+			<File
 				RelativePath=".\CoordinateSystem\CoordinateSystemGrids.h"
 				>
 			</File>
 			<File
+				RelativePath=".\CoordinateSystem\CoordinateSystemGridSpecializationType.h"
+				>
+			</File>
+			<File
 				RelativePath=".\CoordinateSystem\CoordinateSystemMathComparator.h"
 				>
 			</File>
@@ -2669,6 +2677,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\CoordinateSystem\CoordinateSystemMgrsGridLevel.h"
+				>
+			</File>
+			<File
 				RelativePath=".\CoordinateSystem\CoordinateSystemMgrsLetteringScheme.h"
 				>
 			</File>

Modified: trunk/MgDev/Common/Geometry/GeometryCommon.h
===================================================================
--- trunk/MgDev/Common/Geometry/GeometryCommon.h	2009-10-17 05:28:48 UTC (rev 4303)
+++ trunk/MgDev/Common/Geometry/GeometryCommon.h	2009-10-17 06:39:29 UTC (rev 4304)
@@ -139,11 +139,13 @@
 #include "CoordinateSystem/CoordinateSystemProjectionFormatType.h"          //for MgCoordinateSystemProjectionFormatType
 #include "CoordinateSystem/CoordinateSystemProjectionParameterType.h"       //for MgCoordinateSystemProjectionParameterType
 #include "CoordinateSystem/CoordinateSystemErrorCode.h"                     //for MgCoordinateSystemErrorCode
+#include "CoordinateSystem/CoordinateSystemGridOrientation.h"               //for MgCoordinateSystemGridOrientation
+#include "CoordinateSystem/CoordinateSystemGridSpecializationType.h"        //for MgCoordinateSystemGridSpecializationType
 #include "CoordinateSystem/CoordinateSystemGrids.h"                         //for MgCoordinateSystemGridSpecification
+#include "CoordinateSystem/CoordinateSystemGridGeneric.h"                   //for MgCoordinateSystemGridGeneric
 #include "CoordinateSystem/CoordinateSystemMgrsGridLevel.h"                 //for MgCoordinateSystemMgrsGridLevel
+#include "CoordinateSystem/CoordinateSystemMgrsLetteringScheme.h"           //for MgCoordinateSystemMgrsLetteringScheme
 #include "CoordinateSystem/CoordinateSystemMgrs.h"                          //for MgCoordinateSystemMgrs
-#include "CoordinateSystem/CoordinateSystemGridGeneric.h"                   //for MgCoordinateSystemGridGeneric
-#include "CoordinateSystem/CoordinateSystemMgrsLetteringScheme.h"           //for MgCoordinateSystemMgrsLetteringScheme
 #include "CoordinateSystem/CoordinateSystemFactory.h"
 
 #include "Exception/CoordinateSystemComputationFailedException.h"

Modified: trunk/MgDev/Common/Geometry/Makefile.am
===================================================================
--- trunk/MgDev/Common/Geometry/Makefile.am	2009-10-17 05:28:48 UTC (rev 4303)
+++ trunk/MgDev/Common/Geometry/Makefile.am	2009-10-17 06:39:29 UTC (rev 4304)
@@ -174,8 +174,7 @@
   ../CoordinateSystem/CoordSysMgrsZone.cpp \
   ../CoordinateSystem/CoordSysMgrs.cpp \
   ../CoordinateSystem/CoordSysOneGrid.cpp
-  
-  
+
 noinst_HEADERS = $(include_SOURCES) \
   AgfReaderWriter.h \
   AgfStream.h \
@@ -321,10 +320,13 @@
   CoordinateSystem/CoordinateSystemUnitInformation.h \
   CoordinateSystem/CoordinateSystemUnitType.h \
   CoordinateSystem/CoordinateSystemWktFlavor.h \
+  CoordinateSystem/CoordinateSystemGridOrientation.h \
+  CoordinateSystem/CoordinateSystemGridSpecializationType.h \
   CoordinateSystem/CoordinateSystemGrids.h \
-  CoordinateSystem/CoordinateSystemMgrs.h \
-  CoordinateSystem/CoordinateSystemMgrsGridLevel.h \
   CoordinateSystem/CoordinateSystemGridGeneric.h \
+  CoordinateSystem/CoordinateSystemMgrsGridLevel.h \
+  CoordinateSystem/CoordinateSystemMgrsLetteringScheme.h \
+  CoordinateSystem/CoordinateSystemMgrs.h \
   Exception/CoordinateSystemComputationFailedException.h \
   Exception/CoordinateSystemConversionFailedException.h \
   Exception/CoordinateSystemInitializationFailedException.h \
@@ -385,9 +387,6 @@
   ../CoordinateSystem/CoordSysMgrs.h \
   ../CoordinateSystem/CoordSysOneGrid.h
 
- 
-
-
 INCLUDES = \
   -I../Security \
   -I../MdfParser \
@@ -411,4 +410,3 @@
   -L../Foundation \
   -L../../Oem/CsMap \
   -L../../Common/CoordinateSystem
-  

Modified: trunk/MgDev/Web/src/DotNetUnmanagedApi/Geometry/GeometryConstants.xml
===================================================================
--- trunk/MgDev/Web/src/DotNetUnmanagedApi/Geometry/GeometryConstants.xml	2009-10-17 05:28:48 UTC (rev 4303)
+++ trunk/MgDev/Web/src/DotNetUnmanagedApi/Geometry/GeometryConstants.xml	2009-10-17 06:39:29 UTC (rev 4304)
@@ -73,6 +73,8 @@
   <Class name="MgCoordinateSystemCodeFormat" />
   <Class name="MgCoordinateSystemErrorCode" />
   <Class name="MgCoordinateSystemGeodeticTransformationMethod" />
+  <Class name="MgCoordinateSystemGridOrientation" />
+  <Class name="MgCoordinateSystemGridSpecializationType" />
   <Class name="MgCoordinateSystemMgrsLetteringScheme" />
   <Class name="MgCoordinateSystemProjectionCode" />
   <Class name="MgCoordinateSystemProjectionFormatType" />
@@ -99,6 +101,8 @@
     <Header path="../../../../Common/Geometry/CoordinateSystem/CoordinateSystemCodeFormat.h" />
     <Header path="../../../../Common/Geometry/CoordinateSystem/CoordinateSystemErrorCode.h" />
     <Header path="../../../../Common/Geometry/CoordinateSystem/CoordinateSystemGeodeticTransformationMethod.h" />
+    <Header path="../../../../Common/Geometry/CoordinateSystem/CoordinateSystemGridOrientation.h" />
+    <Header path="../../../../Common/Geometry/CoordinateSystem/CoordinateSystemGridSpecializationType.h" />
     <Header path="../../../../Common/Geometry/CoordinateSystem/CoordinateSystemMgrsLetteringScheme.h" />
     <Header path="../../../../Common/Geometry/CoordinateSystem/CoordinateSystemProjectionCode.h" />
     <Header path="../../../../Common/Geometry/CoordinateSystem/CoordinateSystemProjectionFormatType.h" />



More information about the mapguide-commits mailing list