[Mapguide_dev] svn commit: r1038 - RFC 10 Make Schemas More
Amenable to Interim Enhancements
Trevor Wekel
trevor.wekel at autodesk.com
Mon Jan 8 21:20:46 EST 2007
Revision: 1038
Author: trevorwekel
Date: 8:10:06 PM, Monday, January 08, 2007
Message:
RFC 10 - Make Schemas More Amenable to Interim Enhancements
----
Modified : /trunk/MgDev/Common/MdfModel/AttributeRelate.h
Modified : /trunk/MgDev/Common/MdfModel/CalculatedProperty.h
Modified : /trunk/MgDev/Common/MdfModel/ChannelBand.h
Modified : /trunk/MgDev/Common/MdfModel/Extension.h
Modified : /trunk/MgDev/Common/MdfModel/FeatureSource.h
Modified : /trunk/MgDev/Common/MdfModel/FeatureTypeStyle.h
Modified : /trunk/MgDev/Common/MdfModel/Fill.h
Modified : /trunk/MgDev/Common/MdfModel/GridColor.h
Modified : /trunk/MgDev/Common/MdfModel/GridScaleRange.h
Modified : /trunk/MgDev/Common/MdfModel/HillShade.h
Modified : /trunk/MgDev/Common/MdfModel/Label.h
Modified : /trunk/MgDev/Common/MdfModel/LayerDefinition.h
Modified : /trunk/MgDev/Common/MdfModel/Makefile.am
Modified : /trunk/MgDev/Common/MdfModel/MdfModel.vcproj
Added : /trunk/MgDev/Common/MdfModel/MdfRootObject.cpp
Added : /trunk/MgDev/Common/MdfModel/MdfRootObject.h
Modified : /trunk/MgDev/Common/MdfModel/NameStringPair.h
Modified : /trunk/MgDev/Common/MdfModel/RelateProperty.h
Modified : /trunk/MgDev/Common/MdfModel/Rule.h
Modified : /trunk/MgDev/Common/MdfModel/Stroke.h
Modified : /trunk/MgDev/Common/MdfModel/SupplementalSpatialContextInfo.h
Modified : /trunk/MgDev/Common/MdfModel/Symbol.h
Modified : /trunk/MgDev/Common/MdfModel/Symbolization.h
Modified : /trunk/MgDev/Common/MdfModel/VectorScaleRange.h
Modified : /trunk/MgDev/Common/MdfParser/FSDSAX2Parser.cpp
Modified : /trunk/MgDev/Common/MdfParser/FSDSAX2Parser.h
Modified : /trunk/MgDev/Common/MdfParser/IOAreaRule.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOAreaSymbolization2D.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOAreaTypeStyle.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOAttributeRelate.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOBlockSymbol.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOCalculatedProperty.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOChannelBand.cpp
Modified : /trunk/MgDev/Common/MdfParser/IODrawingLayerDefinition.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOExtension.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOFeatureSource.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOFill.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOFontSymbol.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOGridColor.cpp
Added : /trunk/MgDev/Common/MdfParser/IOGridColorBands.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOGridColorRule.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOGridColorStyle.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOGridLayerDefinition.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOGridScaleRange.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOGridSurfaceStyle.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOHillShade.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOImageSymbol.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOLabel.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOLineRule.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOLineSymbolization2D.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOLineTypeStyle.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOMarkSymbol.cpp
Modified : /trunk/MgDev/Common/MdfParser/IONameStringPair.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOPointRule.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOPointSymbolization2D.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOPointTypeStyle.cpp
Modified : /trunk/MgDev/Common/MdfParser/IORelateProperty.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOStroke.cpp
Modified :
/trunk/MgDev/Common/MdfParser/IOSupplementalSpatialContextInfo.cpp
Added : /trunk/MgDev/Common/MdfParser/IOUnknown.cpp
Added : /trunk/MgDev/Common/MdfParser/IOUnknown.h
Modified : /trunk/MgDev/Common/MdfParser/IOUtil.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOUtil.h
Modified : /trunk/MgDev/Common/MdfParser/IOVectorLayerDefinition.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOVectorScaleRange.cpp
Modified : /trunk/MgDev/Common/MdfParser/IOW2DSymbol.cpp
Modified : /trunk/MgDev/Common/MdfParser/Makefile.am
Modified : /trunk/MgDev/Common/MdfParser/MdfParser.vcproj
Added : /trunk/MgDev/Common/MdfParser/SAX2ElementHandler.cpp
Modified : /trunk/MgDev/Common/MdfParser/SAX2ElementHandler.h
Modified : /trunk/MgDev/Common/MdfParser/SAX2Parser.cpp
Modified : /trunk/MgDev/Common/MdfParser/SAX2Parser.h
Modified : /trunk/MgDev/Common/Schema/FeatureSource-1.0.0.xsd
Modified : /trunk/MgDev/Common/Schema/LayerDefinition-1.0.0.xsd
Index: E:/MgDev/OS/Common/Schema/FeatureSource-1.0.0.xsd
===================================================================
--- E:/MgDev/OS/Common/Schema/FeatureSource-1.0.0.xsd (revision 1037)
+++ E:/MgDev/OS/Common/Schema/FeatureSource-1.0.0.xsd (revision 1038)
@@ -54,9 +54,11 @@
<xs:documentation>The feature class that is being
extended; this is the class whose attributes are used for joining other
attribute classes</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
<xs:attribute name="version" type="xs:string">
<xs:annotation>
@@ -79,6 +81,7 @@
<xs:documentation>Text for value of
parameter</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:simpleType name="RelateTypeEnum">
@@ -112,6 +115,7 @@
<xs:documentation>Expression for the
property</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="RelatePropertyType">
@@ -126,6 +130,7 @@
<xs:documentation>Name of property (field) in attribute
class</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="AttributeRelateType">
@@ -165,6 +170,7 @@
<xs:documentation>Force 1 : 1 in the case of 1 : many
</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="SpatialContextType">
@@ -182,6 +188,15 @@
<xs:documentation>Coordinate system used for this spatial
context</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
-</xs:schema>
\ No newline at end of file
+ <xs:complexType name="ExtendedDataType">
+ <xs:annotation>
+ <xs:documentation>A type allocating space for future,
additional, and validatable data for this feature
source</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:any maxOccurs="unbounded" processContents="lax"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Index: E:/MgDev/OS/Common/Schema/LayerDefinition-1.0.0.xsd
===================================================================
--- E:/MgDev/OS/Common/Schema/LayerDefinition-1.0.0.xsd (revision 1037)
+++ E:/MgDev/OS/Common/Schema/LayerDefinition-1.0.0.xsd (revision 1038)
@@ -90,6 +90,7 @@
<xs:documentation>The zoomed out part of the scale range.
Assume application's maximum value if the value is not specified.
Exclusive.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
@@ -140,6 +141,7 @@
<xs:documentation>The stylization to be applied to the
features for a given scale range.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
@@ -188,6 +190,7 @@
</xs:annotation>
</xs:element>
</xs:choice>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="PointTypeStyleType">
@@ -210,6 +213,7 @@
<xs:documentation>One or more PointRules defining the
PointTypeStyle</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="PointRuleType">
@@ -235,6 +239,7 @@
<xs:choice minOccurs="0">
<xs:element name="PointSymbolization2D"
type="PointSymbolization2DType"/>
</xs:choice>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="PointSymbolizationType">
@@ -246,33 +251,36 @@
<xs:annotation>
<xs:documentation>The different types of point
geometries.</xs:documentation>
</xs:annotation>
- <xs:choice>
- <xs:element name="Mark" type="MarkSymbolType">
- <xs:annotation>
- <xs:documentation>Predefined shape such as square or
circle.</xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="Image" type="ImageSymbolType">
- <xs:annotation>
- <xs:documentation>Raster or image symbol. Note that these do
not scale well, but sometimes this is all that you have. Supported
formats are application specific.</xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="Font" type="FontSymbolType">
- <xs:annotation>
- <xs:documentation>Specify the symbol using a font
character.</xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="W2D" type="W2DSymbolType">
- <xs:annotation>
- <xs:documentation>Vector symbol defined using a W2D
stream.</xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="Block" type="BlockSymbolType">
- <xs:annotation>
- <xs:documentation>Vector symbol specifed from a
block.</xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:choice>
+ <xs:sequence>
+ <xs:choice>
+ <xs:element name="Mark" type="MarkSymbolType">
+ <xs:annotation>
+ <xs:documentation>Predefined shape such as square or
circle.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Image" type="ImageSymbolType">
+ <xs:annotation>
+ <xs:documentation>Raster or image symbol. Note that these
do not scale well, but sometimes this is all that you have. Supported
formats are application specific.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Font" type="FontSymbolType">
+ <xs:annotation>
+ <xs:documentation>Specify the symbol using a font
character.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="W2D" type="W2DSymbolType">
+ <xs:annotation>
+ <xs:documentation>Vector symbol defined using a W2D
stream.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Block" type="BlockSymbolType">
+ <xs:annotation>
+ <xs:documentation>Vector symbol specifed from a
block.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
+ </xs:sequence>
</xs:complexType>
<xs:complexType name="LineTypeStyleType">
<xs:annotation>
@@ -284,6 +292,7 @@
<xs:documentation>Rules to define a theme.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="LineRuleType">
@@ -309,6 +318,7 @@
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="LineSymbolization2D" type="StrokeType"/>
</xs:choice>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="AreaSymbolizationType">
@@ -333,6 +343,7 @@
<xs:documentation>The style of the polygon
edge.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
@@ -347,6 +358,7 @@
<xs:documentation>Rules to define a theme.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="AreaRuleType">
@@ -376,6 +388,7 @@
</xs:annotation>
</xs:element>
</xs:choice>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="StrokeType">
@@ -392,6 +405,7 @@
<xs:documentation>Unit of measurement that the thickness is
specified in</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="FillType">
@@ -406,6 +420,7 @@
<xs:documentation>The background color. Not applicable to
solid fills. </xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:simpleType name="BackgroundStyleType">
@@ -514,6 +529,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
@@ -583,6 +599,7 @@
<xs:documentation>No edge is drawin if not
specified.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
@@ -602,6 +619,7 @@
<xs:documentation>The name to show the end
user.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:simpleType name="ShapeType">
@@ -623,32 +641,35 @@
</xs:annotation>
<xs:complexContent>
<xs:extension base="SymbolType">
- <xs:choice>
- <xs:element name="Image">
- <xs:annotation>
- <xs:documentation>Reference to the
image.</xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element name="ResourceId">
- <xs:annotation>
- <xs:documentation>The reference to the
resource.</xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="LibraryItemName" minOccurs="0">
- <xs:annotation>
- <xs:documentation>If ResourceId specifies a
library, this identifies the name of a library item.</xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="Content" type="xs:hexBinary">
- <xs:annotation>
- <xs:documentation>BinHex data for image.
</xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:choice>
+ <xs:sequence>
+ <xs:choice>
+ <xs:element name="Image">
+ <xs:annotation>
+ <xs:documentation>Reference to the
image.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="ResourceId">
+ <xs:annotation>
+ <xs:documentation>The reference to the
resource.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="LibraryItemName" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>If ResourceId specifies a
library, this identifies the name of a library item.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Content" type="xs:hexBinary">
+ <xs:annotation>
+ <xs:documentation>BinHex data for image.
</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
+ </xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
@@ -669,6 +690,7 @@
<xs:element name="Italic" type="xs:boolean" minOccurs="0"/>
<xs:element name="Underlined" type="xs:boolean"
minOccurs="0"/>
<xs:element name="ForegroundColor" type="xs:string"/>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
@@ -711,6 +733,7 @@
<xs:documentation>If specified all text in the symbol is
drawn in this color.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
@@ -734,6 +757,7 @@
<xs:documentation>Static color.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
@@ -760,6 +784,7 @@
</xs:annotation>
</xs:element>
<xs:element name="GridScaleRange" type="GridScaleRangeType"
maxOccurs="unbounded"/>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
@@ -794,6 +819,7 @@
<xs:documentation>Default is 255. Range is
0:255.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="GridColorBandsType">
@@ -810,15 +836,18 @@
<xs:annotation>
<xs:documentation>The color to use for a grid
rule.</xs:documentation>
</xs:annotation>
- <xs:choice>
- <xs:element name="ExplicitColor" type="xs:string">
- <xs:annotation>
- <xs:documentation>Explicit ARGB color.</xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="Band" type="xs:string"/>
- <xs:element name="Bands" type="GridColorBandsType"/>
- </xs:choice>
+ <xs:sequence>
+ <xs:choice>
+ <xs:element name="ExplicitColor" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Explicit ARGB color.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Band" type="xs:string"/>
+ <xs:element name="Bands" type="GridColorBandsType"/>
+ </xs:choice>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
+ </xs:sequence>
</xs:complexType>
<xs:complexType name="GridColorRuleType">
<xs:annotation>
@@ -841,6 +870,7 @@
</xs:annotation>
</xs:element>
<xs:element name="Color" type="GridColorType"/>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="HillshadeType">
@@ -868,6 +898,7 @@
<xs:documentation>Default is 1. Applied to band prior to
computing hillshade.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="GridColorStylizationType">
@@ -892,6 +923,7 @@
</xs:annotation>
</xs:element>
<xs:element name="ColorRule" type="GridColorRuleType"
minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="GridSurfaceStylizationType">
@@ -919,6 +951,7 @@
<xs:documentation>The color that will show if there is no
ColorStyle defined at a pixel.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="GridScaleRangeType">
@@ -947,6 +980,15 @@
<xs:documentation>When the user has zoomed in by this amount,
a request for more detailed raster data is made.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
+ <xs:complexType name="ExtendedDataType">
+ <xs:annotation>
+ <xs:documentation>A type allocating space for future,
additional, and validatable data for this feature
source</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:any maxOccurs="unbounded" processContents="lax"/>
+ </xs:sequence>
+ </xs:complexType>
</xs:schema>
Index: E:/MgDev/OS/Common/MdfParser/IOCalculatedProperty.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOCalculatedProperty.cpp
(revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOCalculatedProperty.cpp
(revision 1038)
@@ -22,6 +22,11 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, CalculatedProperty);
+ELEM_MAP_ENTRY(2, Name);
+ELEM_MAP_ENTRY(3, Expression);
+
IOCalculatedProperty::IOCalculatedProperty()
: m_pCalculatedProperty(NULL), m_pExtension(NULL)
{
@@ -39,10 +44,21 @@
void IOCalculatedProperty::StartElement(const wchar_t *name,
HandlerStack *handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"CalculatedProperty") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eCalculatedProperty:
m_startElemName = name;
m_pCalculatedProperty = new CalculatedProperty();
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
}
@@ -58,6 +74,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->m_pCalculatedProperty->SetUnknownXml(UnknownXml());
+
m_pExtension->GetCalculatedProperties()->Adopt(m_pCalculatedProperty);
handlerStack->pop();
this->m_pCalculatedProperty = NULL;
@@ -81,6 +100,12 @@
fd << EncodeString(pCalculatedProperty->GetExpression());
fd << "</Expression>" << std::endl; // NOXLATE
+ // Write any previously found unknown XML
+ if (!pCalculatedProperty->GetUnknownXml().empty())
+ {
+ fd << toCString(pCalculatedProperty->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</CalculatedProperty>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOPointTypeStyle.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOPointTypeStyle.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOPointTypeStyle.cpp (revision 1038)
@@ -23,6 +23,12 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, PointTypeStyle);
+ELEM_MAP_ENTRY(2, PointRule);
+ELEM_MAP_ENTRY(3, DisplayAsText);
+ELEM_MAP_ENTRY(4, AllowOverpost);
+
IOPointTypeStyle::IOPointTypeStyle()
{
this->_pointTypeStyle = NULL;
@@ -42,17 +48,30 @@
void IOPointTypeStyle::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"PointTypeStyle") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case ePointTypeStyle:
m_startElemName = name;
this->_pointTypeStyle = new PointTypeStyle();
+ break;
+
+ case ePointRule:
+ {
+ IOPointRule *IO = new IOPointRule(this->_pointTypeStyle);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"PointRule") // NOXLATE
- {
- IOPointRule *IO = new IOPointRule(this->_pointTypeStyle);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
}
void IOPointTypeStyle::ElementChars(const wchar_t *ch)
@@ -67,6 +86,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_pointTypeStyle->SetUnknownXml(UnknownXml());
+
this->scaleRange->GetFeatureTypeStyles()->Adopt(this->_pointTypeStyle);
handlerStack->pop();
this->scaleRange = NULL;
@@ -99,6 +121,12 @@
delete IO;
}
+ // Write any previously found unknown XML
+ if (!pointTypeStyle->GetUnknownXml().empty())
+ {
+ fd << toCString(pointTypeStyle->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</PointTypeStyle>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/MdfParser.vcproj
===================================================================
--- E:/MgDev/OS/Common/MdfParser/MdfParser.vcproj (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/MdfParser.vcproj (revision 1038)
@@ -328,6 +328,10 @@
>
</File>
<File
+ RelativePath=".\IOGridColorBands.cpp"
+ >
+ </File>
+ <File
RelativePath=".\IOGridColorRule.cpp"
>
</File>
@@ -536,6 +540,14 @@
>
</File>
<File
+ RelativePath=".\IOUnknown.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\IOUnknown.h"
+ >
+ </File>
+ <File
RelativePath=".\IOUtil.cpp"
>
</File>
@@ -580,6 +592,10 @@
>
</File>
<File
+ RelativePath=".\SAX2ElementHandler.cpp"
+ >
+ </File>
+ <File
RelativePath=".\SAX2ElementHandler.h"
>
</File>
Index: E:/MgDev/OS/Common/MdfParser/IOLabel.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOLabel.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOLabel.cpp (revision 1038)
@@ -23,6 +23,29 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, Label);
+ELEM_MAP_ENTRY(2, AdvancedPlacement);
+ELEM_MAP_ENTRY(3, ScaleLimit);
+ELEM_MAP_ENTRY(4, Text);
+ELEM_MAP_ENTRY(5, FontName);
+ELEM_MAP_ENTRY(6, ForegroundColor);
+ELEM_MAP_ENTRY(7, BackgroundColor);
+ELEM_MAP_ENTRY(8, BackgroundStyle);
+ELEM_MAP_ENTRY(9, HorizontalAlignment);
+ELEM_MAP_ENTRY(10, VerticalAlignment);
+ELEM_MAP_ENTRY(11, Bold);
+ELEM_MAP_ENTRY(12, Italic);
+ELEM_MAP_ENTRY(13, Underlined);
+ELEM_MAP_ENTRY(14, Unit);
+ELEM_MAP_ENTRY(15, SizeContext);
+ELEM_MAP_ENTRY(16, SizeX);
+ELEM_MAP_ENTRY(17, SizeY);
+ELEM_MAP_ENTRY(18, InsertionPointX);
+ELEM_MAP_ENTRY(19, InsertionPointY);
+ELEM_MAP_ENTRY(20, Rotation);
+ELEM_MAP_ENTRY(21, MaintainAspect);
+
IOLabel::IOLabel()
{
this->_label = NULL;
@@ -44,16 +67,30 @@
void IOLabel::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"Label") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eLabel:
m_startElemName = name;
this->_label = new Label();
+ break;
+
+ case eAdvancedPlacement:
+ if (this->_label)
+ {
+ this->_label->GetSymbol()->SetAdvancedPlacement(true);
+ this->m_handlingPlacement = true;
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"AdvancedPlacement" && this->_label) //
NOXLATE
- {
- this->_label->GetSymbol()->SetAdvancedPlacement(true);
- this->m_handlingPlacement = true;
- }
}
void IOLabel::ElementChars(const wchar_t *ch)
@@ -126,6 +163,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_label->SetUnknownXml(UnknownXml());
+
this->rule->AdoptLabel(this->_label);
handlerStack->pop();
this->rule= NULL;
@@ -231,6 +271,12 @@
fd << tab() << "</AdvancedPlacement>" << std::endl; //
NOXLATE
}
+ // Write any previously found unknown XML
+ if (!label->GetUnknownXml().empty())
+ {
+ fd << toCString(label->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</Label>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOBlockSymbol.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOBlockSymbol.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOBlockSymbol.cpp (revision 1038)
@@ -25,13 +25,41 @@
// When a BlockSymbol is successfully parsed by this class, it must be
accessed by the
// parent class and then managed appropriately. It will not be deleted
by this class.
+CREATE_ELEMENT_MAP;
+// Inherited Symbol Elements
+ELEM_MAP_ENTRY(1, Unit);
+ELEM_MAP_ENTRY(2, SizeContext);
+ELEM_MAP_ENTRY(3, SizeX);
+ELEM_MAP_ENTRY(4, SizeY);
+ELEM_MAP_ENTRY(5, InsertionPointX);
+ELEM_MAP_ENTRY(6, InsertionPointY);
+ELEM_MAP_ENTRY(7, Rotation);
+ELEM_MAP_ENTRY(8, MaintainAspect);
+// Local Elements
+ELEM_MAP_ENTRY(9, Block);
+ELEM_MAP_ENTRY(10, DrawingName);
+ELEM_MAP_ENTRY(11, BlockName);
+ELEM_MAP_ENTRY(12, BlockColor);
+ELEM_MAP_ENTRY(13, LayerColor);
+
void IOBlockSymbol::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
this->m_currElemName = name;
- if (this->m_currElemName == L"Block") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eBlock:
this->m_startElemName = name;
this->m_symbol = new BlockSymbol();
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
}
@@ -54,6 +82,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->m_symbol->SetUnknownXml(UnknownXml());
+
handlerStack->pop();
this->m_startElemName = L"";
}
@@ -92,6 +123,12 @@
fd << "</LayerColor>" << std::endl; // NOXLATE
}
+ // Write any previously found unknown XML
+ if (!symbol->GetUnknownXml().empty())
+ {
+ fd << toCString(symbol->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</Block>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IONameStringPair.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IONameStringPair.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IONameStringPair.cpp (revision 1038)
@@ -22,6 +22,12 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, PropertyMapping);
+ELEM_MAP_ENTRY(2, Parameter);
+ELEM_MAP_ENTRY(3, Name);
+ELEM_MAP_ENTRY(4, Value);
+
IONameStringPair::IONameStringPair()
: _nameStringPair(NULL), layer(NULL), featureSource(NULL)
{
@@ -46,21 +52,32 @@
void IONameStringPair::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (NULL != layer)
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
- if (m_currElemName == L"PropertyMapping") // NOXLATE
+ case ePropertyMapping:
+ if (NULL != layer)
{
m_startElemName = name;
this->_nameStringPair = new NameStringPair(L"", L"");
}
- }
- else if (NULL != featureSource)
- {
- if (m_currElemName == L"Parameter") // NOXLATE
+ break;
+
+ case eParameter:
+ if (NULL != featureSource)
{
m_startElemName = name;
this->_nameStringPair = new NameStringPair(L"", L"");
}
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
}
@@ -76,6 +93,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_nameStringPair->SetUnknownXml(UnknownXml());
+
if (NULL != this->layer)
this->layer->GetPropertyMappings()->Adopt(this->_nameStringPair);
else if (NULL != this->featureSource)
@@ -101,4 +121,10 @@
fd << tab() << "<Value>"; // NOXLATE
fd << EncodeString(nameStringPair->GetValue());
fd << "</Value>" << std::endl; // NOXLATE
+
+ // Write any previously found unknown XML
+ if (!nameStringPair->GetUnknownXml().empty())
+ {
+ fd << toCString(nameStringPair->GetUnknownXml());
+ }
}
Index: E:/MgDev/OS/Common/MdfParser/IOVectorScaleRange.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOVectorScaleRange.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOVectorScaleRange.cpp (revision 1038)
@@ -26,6 +26,14 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, VectorScaleRange);
+ELEM_MAP_ENTRY(2, AreaTypeStyle);
+ELEM_MAP_ENTRY(3, LineTypeStyle);
+ELEM_MAP_ENTRY(4, PointTypeStyle);
+ELEM_MAP_ENTRY(5, MinScale);
+ELEM_MAP_ENTRY(6, MaxScale);
+
IOVectorScaleRange::IOVectorScaleRange()
{
this->_scaleRange = NULL;
@@ -45,29 +53,46 @@
void IOVectorScaleRange::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"VectorScaleRange") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eVectorScaleRange:
m_startElemName = name;
this->_scaleRange = new VectorScaleRange();
+ break;
+
+ case eAreaTypeStyle:
+ {
+ IOAreaTypeStyle *IO = new
IOAreaTypeStyle(this->_scaleRange);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eLineTypeStyle:
+ {
+ IOLineTypeStyle *IO = new
IOLineTypeStyle(this->_scaleRange);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case ePointTypeStyle:
+ {
+ IOPointTypeStyle *IO = new
IOPointTypeStyle(this->_scaleRange);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"AreaTypeStyle") // NOXLATE
- {
- IOAreaTypeStyle *IO = new IOAreaTypeStyle(this->_scaleRange);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
- else if (m_currElemName == L"LineTypeStyle") // NOXLATE
- {
- IOLineTypeStyle *IO = new IOLineTypeStyle(this->_scaleRange);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
- else if (m_currElemName == L"PointTypeStyle") // NOXLATE
- {
- IOPointTypeStyle *IO = new IOPointTypeStyle(this->_scaleRange);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
}
void IOVectorScaleRange::ElementChars(const wchar_t *ch)
@@ -82,6 +107,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_scaleRange->SetUnknownXml(UnknownXml());
+
this->layer->GetScaleRanges()->Adopt(this->_scaleRange);
handlerStack->pop();
this->layer = NULL;
@@ -135,6 +163,12 @@
}
}
+ // Write any previously found unknown XML
+ if (!scaleRange->GetUnknownXml().empty())
+ {
+ fd << toCString(scaleRange->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</VectorScaleRange>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOGridLayerDefinition.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOGridLayerDefinition.cpp
(revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOGridLayerDefinition.cpp
(revision 1038)
@@ -23,6 +23,15 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, GridLayerDefinition);
+ELEM_MAP_ENTRY(2, GridScaleRange);
+ELEM_MAP_ENTRY(3, ResourceId);
+ELEM_MAP_ENTRY(4, FeatureName);
+ELEM_MAP_ENTRY(5, Geometry);
+ELEM_MAP_ENTRY(6, Filter);
+ELEM_MAP_ENTRY(7, Opacity);
+
IOGridLayerDefinition::IOGridLayerDefinition():_layer(NULL)
{
}
@@ -38,16 +47,29 @@
void IOGridLayerDefinition::StartElement(const wchar_t *name,
HandlerStack *handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"GridLayerDefinition") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eGridLayerDefinition:
m_startElemName = name;
+ break;
+
+ case eGridScaleRange:
+ {
+ IOGridScaleRange *IO = new IOGridScaleRange(this->_layer);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"GridScaleRange") // NOXLATE
- {
- IOGridScaleRange *IO = new IOGridScaleRange(this->_layer);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
}
void IOGridLayerDefinition::ElementChars(const wchar_t *ch)
@@ -68,6 +90,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_layer->SetUnknownXml(UnknownXml());
+
handlerStack->pop();
this->_layer = NULL;
m_startElemName = L"";
@@ -122,6 +147,12 @@
delete IO;
}
+ // Write any previously found unknown XML
+ if (!gridLayer->GetUnknownXml().empty())
+ {
+ fd << toCString(gridLayer->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</GridLayerDefinition>" << std::endl; // NOXLATE
Index: E:/MgDev/OS/Common/MdfParser/IOGridColorBands.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOGridColorBands.cpp (revision 0)
+++ E:/MgDev/OS/Common/MdfParser/IOGridColorBands.cpp (revision 1038)
@@ -0,0 +1,146 @@
+//
+// Copyright (C) 2004-2006 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
+//
+
+#include "stdafx.h"
+#include "IOGridColor.h"
+#include "IOChannelBand.h"
+#include "IOExtra.h"
+
+using namespace XERCES_CPP_NAMESPACE;
+using namespace MDFMODEL_NAMESPACE;
+using namespace MDFPARSER_NAMESPACE;
+
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, Bands);
+ELEM_MAP_ENTRY(2, RedBand);
+ELEM_MAP_ENTRY(3, GreenBand);
+ELEM_MAP_ENTRY(4, BlueBand);
+
+//
+// IOGridColorBands
+//
+IOGridColorBands::IOGridColorBands():color(NULL),redChannel(NULL),
greenChannel(NULL), blueChannel(NULL)
+{
+}
+
+IOGridColorBands::IOGridColorBands(GridColorRule * colorRule):
IOGridColor(colorRule),color(NULL),
+
redChannel(NULL), greenChannel(NULL), blueChannel(NULL)
+{
+}
+
+IOGridColorBands::~IOGridColorBands()
+{
+
+}
+
+void IOGridColorBands::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
+{
+ m_currElemName = name;
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
+ {
+ case eBands:
+ m_startElemName = name;
+ this->color = new GridColorBands();
+ break;
+
+ case eRedBand:
+ {
+ redChannel = new ChannelBand();
+ IOChannelBand* pIO = new IOChannelBand(redChannel,
m_currElemName);
+ handlerStack->push(pIO);
+ pIO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eGreenBand:
+ {
+ greenChannel = new ChannelBand();
+ IOChannelBand* pIO = new IOChannelBand(greenChannel,
m_currElemName);
+ handlerStack->push(pIO);
+ pIO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eBlueBand:
+ {
+ blueChannel = new ChannelBand();
+ IOChannelBand* pIO = new IOChannelBand(blueChannel,
m_currElemName);
+ handlerStack->push(pIO);
+ pIO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
+ }
+}
+
+void IOGridColorBands::ElementChars(const wchar_t *ch)
+{
+
+}
+
+void IOGridColorBands::EndElement(const wchar_t *name, HandlerStack
*handlerStack)
+{
+ if (m_startElemName == name)
+ {
+ if (!UnknownXml().empty())
+ this->color->SetUnknownXml(UnknownXml());
+
+ this->color->SetRedBand(*redChannel);
+ this->color->SetGreenBand(*greenChannel);
+ this->color->SetBlueBand(*blueChannel);
+ this->colorRule->AdoptGridColor(color);
+ handlerStack->pop();
+ this->colorRule = NULL;
+ this->color = NULL;
+ m_startElemName = L"";
+ delete this;
+ }
+}
+
+void IOGridColorBands::Write(MdfStream &fd, GridColorBands * pColor)
+{
+ fd << tab() << "<Bands>" << std::endl; // NOXLATE
+ inctab();
+
+ std::auto_ptr<IOChannelBand> spIO;
+
+ spIO.reset(new IOChannelBand(L"RedBand")); // NOXLATE
+ spIO->Write(fd, &(pColor->GetRedBand()));
+
+ spIO.reset(new IOChannelBand(L"GreenBand")); // NOXLATE
+ spIO->Write(fd, &(pColor->GetGreenBand()));
+
+ spIO.reset(new IOChannelBand(L"BlueBand")); // NOXLATE
+ spIO->Write(fd, &(pColor->GetBlueBand()));
+
+ // Write any previously found unknown XML
+ if (!pColor->GetUnknownXml().empty())
+ {
+ fd << toCString(pColor->GetUnknownXml());
+ }
+
+ dectab();
+ fd << tab() << "</Bands>" << std::endl; // NOXLATE
+}
Property changes on: E:\MgDev\OS\Common\MdfParser\IOGridColorBands.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Index: E:/MgDev/OS/Common/MdfParser/SAX2ElementHandler.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/SAX2ElementHandler.cpp (revision 0)
+++ E:/MgDev/OS/Common/MdfParser/SAX2ElementHandler.cpp (revision 1038)
@@ -0,0 +1,32 @@
+//
+// Copyright (C) 2004-2006 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
+//
+
+#include "stdafx.h"
+#include "SAX2ElementHandler.h"
+#include "IOUnknown.h"
+
+using namespace XERCES_CPP_NAMESPACE;
+using namespace MDFMODEL_NAMESPACE;
+using namespace MDFPARSER_NAMESPACE;
+
+void SAX2ElementHandler::ParseUnknownXml(const wchar_t *name,
HandlerStack *handlerStack)
+{
+ IOUnknown *IO = new IOUnknown(&m_unknownXml);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+}
+
Property changes on: E:\MgDev\OS\Common\MdfParser\SAX2ElementHandler.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Index: E:/MgDev/OS/Common/MdfParser/IOGridColorStyle.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOGridColorStyle.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOGridColorStyle.cpp (revision 1038)
@@ -25,6 +25,14 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, ColorStyle);
+ELEM_MAP_ENTRY(2, HillShade);
+ELEM_MAP_ENTRY(3, ColorRule);
+ELEM_MAP_ENTRY(4, TransparencyColor);
+ELEM_MAP_ENTRY(5, BrightnessFactor);
+ELEM_MAP_ENTRY(6, ContrastFactor);
+
IOGridColorStyle::IOGridColorStyle():colorStyle(NULL), scaleRange(NULL)
{
}
@@ -40,23 +48,38 @@
void IOGridColorStyle::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"ColorStyle") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eColorStyle:
m_startElemName = name;
this->colorStyle = new GridColorStyle();
+ break;
+
+ case eHillShade:
+ {
+ IOHillShade *IO = new IOHillShade(this->colorStyle);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eColorRule:
+ {
+ IOGridColorRule *IO = new
IOGridColorRule(this->colorStyle);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"HillShade") // NOXLATE
- {
- IOHillShade *IO = new IOHillShade(this->colorStyle);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
- else if (m_currElemName == L"ColorRule") // NOXLATE
- {
- IOGridColorRule *IO = new IOGridColorRule(this->colorStyle);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
}
void IOGridColorStyle::ElementChars(const wchar_t *ch)
@@ -73,6 +96,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->colorStyle->SetUnknownXml(UnknownXml());
+
this->scaleRange->AdoptColorStyle(this->colorStyle);
handlerStack->pop();
this->scaleRange = NULL;
@@ -132,6 +158,12 @@
}
}
+ // Write any previously found unknown XML
+ if (!pColorStyle->GetUnknownXml().empty())
+ {
+ fd << toCString(pColorStyle->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</ColorStyle>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/SAX2Parser.h
===================================================================
--- E:/MgDev/OS/Common/MdfParser/SAX2Parser.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/SAX2Parser.h (revision 1038)
@@ -69,18 +69,13 @@
// Unfortunately, the SAX2 Parser doesn't necessarily send all
the
// characters that appear inside a tag in one call of
characters()-
// for example with escape characters it separates them into
separate calls.
- // Therefore, m_strbuffer is used to accumulate the characters,
openTag and
- // prevOpenTag are used to determine if we're still reading
characters in the
- // same open tag, and tagOpen and charsInTag are used in the
case when you have
- // no characters in between a tag (i.e. <Metadata></Metadata>)
to make sure
- // that whitespace or line returns don't get assigned to it
instead.
+ // Therefore, m_strbuffer is used to accumulate the characters.
tagOpen is
+ // used in the case when you have characters outside a tag
(i.e. <Metadata></Metadata>)
+ // to make sure that whitespace or line returns don't get
assigned to it instead.
std::wstring m_strbuffer;
+ bool m_tagOpen;
- std::wstring m_openTag;
- std::wstring m_prevOpenTag;
MdfString m_strParserError;
- bool m_tagOpen;
- bool m_charsInTag;
void WriteDefinition(MdfStream &fd,
MapDefinition* map,
Index: E:/MgDev/OS/Common/MdfParser/IOLineTypeStyle.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOLineTypeStyle.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOLineTypeStyle.cpp (revision 1038)
@@ -23,6 +23,10 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, LineTypeStyle);
+ELEM_MAP_ENTRY(2, LineRule);
+
IOLineTypeStyle::IOLineTypeStyle()
{
this->_lineTypeStyle = NULL;
@@ -42,17 +46,30 @@
void IOLineTypeStyle::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"LineTypeStyle") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eLineTypeStyle:
m_startElemName = name;
- this->_lineTypeStyle = new LineTypeStyle(); // NOXLATE
+ this->_lineTypeStyle = new LineTypeStyle();
+ break;
+
+ case eLineRule:
+ {
+ IOLineRule *IO = new IOLineRule(this->_lineTypeStyle);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"LineRule") // NOXLATE
- {
- IOLineRule *IO = new IOLineRule(this->_lineTypeStyle);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
}
void IOLineTypeStyle::ElementChars(const wchar_t *ch)
@@ -64,6 +81,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_lineTypeStyle->SetUnknownXml(UnknownXml());
+
this->scaleRange->GetFeatureTypeStyles()->Adopt(this->_lineTypeStyle);
handlerStack->pop();
this->scaleRange = NULL;
@@ -86,6 +106,12 @@
delete IO;
}
+ // Write any previously found unknown XML
+ if (!lineTypeStyle->GetUnknownXml().empty())
+ {
+ fd << toCString(lineTypeStyle->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</LineTypeStyle>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOFeatureSource.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOFeatureSource.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOFeatureSource.cpp (revision 1038)
@@ -26,6 +26,16 @@
#include "IOExtension.h"
#include "IOSupplementalSpatialContextInfo.h"
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, FeatureSource);
+ELEM_MAP_ENTRY(2, Parameter);
+ELEM_MAP_ENTRY(3, Extension);
+ELEM_MAP_ENTRY(4, SupplementalSpatialContextInfo);
+ELEM_MAP_ENTRY(5, Provider);
+ELEM_MAP_ENTRY(6, ConfigurationDocument);
+ELEM_MAP_ENTRY(7, LongTransaction);
+
+
IOFeatureSource::IOFeatureSource()
: m_pFeatureSource(NULL)
{
@@ -43,32 +53,45 @@
void IOFeatureSource::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"FeatureSource") // NOXLATE
- {
- m_startElemName = name;
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId) {
+ case eFeatureSource:
+ m_startElemName = name;
+ break;
+
+ case eParameter:
+ {
+ IONameStringPair *IO = new
IONameStringPair(this->m_pFeatureSource);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eExtension:
+ {
+ IOExtension *IO = new
IOExtension(this->m_pFeatureSource);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eSupplementalSpatialContextInfo:
+ {
+ IOSupplementalSpatialContextInfo *IO =
+ new
IOSupplementalSpatialContextInfo(this->m_pFeatureSource);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else
- {
- if (m_currElemName == L"Parameter") // NOXLATE
- {
- IONameStringPair *IO = new
IONameStringPair(this->m_pFeatureSource);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
- else if (m_currElemName == L"Extension") // NOXLATE
- {
- IOExtension *IO = new IOExtension(this->m_pFeatureSource);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
- else if (m_currElemName == L"SupplementalSpatialContextInfo")
// NOXLATE
- {
- IOSupplementalSpatialContextInfo *IO =
- new
IOSupplementalSpatialContextInfo(this->m_pFeatureSource);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
- }
}
void IOFeatureSource::ElementChars(const wchar_t *ch)
@@ -85,6 +108,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->m_pFeatureSource->SetUnknownXml(UnknownXml());
+
handlerStack->pop();
this->m_pFeatureSource = NULL;
m_startElemName = L"";
@@ -141,7 +167,14 @@
spIO->Write(fd, pFeatureSource->GetExtensions()->GetAt(x));
}
+ // Write any previously found unknown XML
+ if (!pFeatureSource->GetUnknownXml().empty())
+ {
+ fd << toCString(pFeatureSource->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</FeatureSource>" << std::endl; // NOXLATE
}
+
Index: E:/MgDev/OS/Common/MdfParser/IORelateProperty.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IORelateProperty.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IORelateProperty.cpp (revision 1038)
@@ -22,6 +22,11 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, RelateProperty);
+ELEM_MAP_ENTRY(2, FeatureClassProperty);
+ELEM_MAP_ENTRY(3, AttributeClassProperty);
+
IORelateProperty::IORelateProperty()
: m_pRelateProperty(NULL), m_pAttributeRelate(NULL)
{
@@ -39,10 +44,21 @@
void IORelateProperty::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"RelateProperty") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eRelateProperty:
m_startElemName = name;
m_pRelateProperty = new RelateProperty();
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
}
@@ -65,6 +81,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->m_pRelateProperty->SetUnknownXml(UnknownXml());
+
m_pAttributeRelate->GetRelateProperties()->Adopt(m_pRelateProperty);
handlerStack->pop();
this->m_pRelateProperty = NULL;
@@ -89,7 +108,14 @@
fd << EncodeString(pRelateProperty->GetAttributeClassProperty());
fd << "</AttributeClassProperty>" << std::endl; // NOXLATE
+ // Write any previously found unknown XML
+ if (!pRelateProperty->GetUnknownXml().empty())
+ {
+ fd << toCString(pRelateProperty->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</RelateProperty>" << std::endl; // NOXLATE
}
+
Index: E:/MgDev/OS/Common/MdfParser/IOUtil.h
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOUtil.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOUtil.h (revision 1038)
@@ -73,5 +73,8 @@
return false;
}
+ std::string startStr(const std::string elementName);
+ std::string endStr(const std::string elementName);
+
END_NAMESPACE_MDFPARSER
#endif // _IOUTIL_H
Index: E:/MgDev/OS/Common/MdfParser/IOAreaSymbolization2D.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOAreaSymbolization2D.cpp
(revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOAreaSymbolization2D.cpp
(revision 1038)
@@ -24,6 +24,11 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, AreaSymbolization2D);
+ELEM_MAP_ENTRY(2, Fill);
+ELEM_MAP_ENTRY(3, Stroke);
+
IOAreaSymbolization2D::IOAreaSymbolization2D()
{
this->_areaSymbolization = NULL;
@@ -43,28 +48,43 @@
void IOAreaSymbolization2D::StartElement(const wchar_t *name,
HandlerStack *handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"AreaSymbolization2D") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eAreaSymbolization2D:
m_startElemName = name;
this->_areaSymbolization = new AreaSymbolization2D();
// delete the fill and edge that are created by default -
recreate if present when parsing
delete this->_areaSymbolization->OrphanFill();
delete this->_areaSymbolization->OrphanEdge();
+ break;
+
+ case eFill:
+ {
+ this->_areaSymbolization->AdoptFill(new Fill());
+ IOFill *IO = new
IOFill(this->_areaSymbolization->GetFill());
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eStroke:
+ {
+ this->_areaSymbolization->AdoptEdge(new Stroke());
+ IOStroke *IO = new
IOStroke(this->_areaSymbolization->GetEdge(), m_currElemName);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"Fill") // NOXLATE
- {
- this->_areaSymbolization->AdoptFill(new Fill());
- IOFill *IO = new IOFill(this->_areaSymbolization->GetFill());
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
- else if (m_currElemName == L"Stroke") // NOXLATE
- {
- this->_areaSymbolization->AdoptEdge(new Stroke());
- IOStroke *IO = new
IOStroke(this->_areaSymbolization->GetEdge(), m_currElemName);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
}
void IOAreaSymbolization2D::ElementChars(const wchar_t *ch)
@@ -76,6 +96,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_areaSymbolization->SetUnknownXml(UnknownXml());
+
if (this->_areaSymbolization != NULL)
this->areaRule->AdoptSymbolization(this->_areaSymbolization);
handlerStack->pop();
@@ -99,6 +122,12 @@
if (areaSymbolization != NULL && areaSymbolization->GetEdge() !=
NULL)
IOStroke::Write(fd, areaSymbolization->GetEdge(), "Stroke"); //
NOXLATE
+ // Write any previously found unknown XML
+ if (!areaSymbolization->GetUnknownXml().empty())
+ {
+ fd << toCString(areaSymbolization->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</AreaSymbolization2D>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOGridColor.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOGridColor.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOGridColor.cpp (revision 1038)
@@ -24,6 +24,12 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, Color);
+ELEM_MAP_ENTRY(2, Bands);
+ELEM_MAP_ENTRY(3, ExplicitColor);
+ELEM_MAP_ENTRY(4, Band);
+
IOGridColor::IOGridColor():colorRule(NULL)
{
}
@@ -39,16 +45,29 @@
void IOGridColor::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"Color") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eColor:
m_startElemName = name;
+ break;
+
+ case eBands:
+ {
+ IOGridColorBands* pIO = new IOGridColorBands(colorRule);
+ handlerStack->push(pIO);
+ pIO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"Bands") // NOXLATE
- {
- IOGridColorBands* pIO = new IOGridColorBands(colorRule);
- handlerStack->push(pIO);
- pIO->StartElement(name, handlerStack);
- }
}
void IOGridColor::ElementChars(const wchar_t *ch)
@@ -71,6 +90,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->colorRule->SetUnknownXml(UnknownXml());
+
handlerStack->pop();
this->colorRule = NULL;
m_startElemName = L"";
@@ -107,95 +129,13 @@
delete pIO;
}
- dectab();
- fd << tab() << "</Color>" << std::endl; // NOXLATE
-}
-
-//
-// IOGridColorBands
-//
-IOGridColorBands::IOGridColorBands():color(NULL),redChannel(NULL),
greenChannel(NULL), blueChannel(NULL)
-{
-}
-
-IOGridColorBands::IOGridColorBands(GridColorRule * colorRule):
IOGridColor(colorRule),color(NULL),
-
redChannel(NULL), greenChannel(NULL), blueChannel(NULL)
-{
-}
-
-IOGridColorBands::~IOGridColorBands()
-{
-
-}
-
-void IOGridColorBands::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
-{
- m_currElemName = name;
- if (m_currElemName == L"Bands") // NOXLATE
+ // Write any previously found unknown XML
+ if (!pColor->GetUnknownXml().empty())
{
- m_startElemName = name;
- this->color = new GridColorBands();
+ fd << toCString(pColor->GetUnknownXml());
}
- else if (m_currElemName == L"RedBand") // NOXLATE
- {
- redChannel = new ChannelBand();
- IOChannelBand* pIO = new IOChannelBand(redChannel,
m_currElemName);
- handlerStack->push(pIO);
- pIO->StartElement(name, handlerStack);
- }
- else if (m_currElemName == L"GreenBand") // NOXLATE
- {
- greenChannel = new ChannelBand();
- IOChannelBand* pIO = new IOChannelBand(greenChannel,
m_currElemName);
- handlerStack->push(pIO);
- pIO->StartElement(name, handlerStack);
- }
- else if (m_currElemName == L"BlueBand") // NOXLATE
- {
- blueChannel = new ChannelBand();
- IOChannelBand* pIO = new IOChannelBand(blueChannel,
m_currElemName);
- handlerStack->push(pIO);
- pIO->StartElement(name, handlerStack);
- }
-}
-void IOGridColorBands::ElementChars(const wchar_t *ch)
-{
-
-}
-
-void IOGridColorBands::EndElement(const wchar_t *name, HandlerStack
*handlerStack)
-{
- if (m_startElemName == name)
- {
- this->color->SetRedBand(*redChannel);
- this->color->SetGreenBand(*greenChannel);
- this->color->SetBlueBand(*blueChannel);
- this->colorRule->AdoptGridColor(color);
- handlerStack->pop();
- this->colorRule = NULL;
- this->color = NULL;
- m_startElemName = L"";
- delete this;
- }
-}
-
-void IOGridColorBands::Write(MdfStream &fd, GridColorBands * pColor)
-{
- fd << tab() << "<Bands>" << std::endl; // NOXLATE
- inctab();
-
- std::auto_ptr<IOChannelBand> spIO;
-
- spIO.reset(new IOChannelBand(L"RedBand")); // NOXLATE
- spIO->Write(fd, &(pColor->GetRedBand()));
-
- spIO.reset(new IOChannelBand(L"GreenBand")); // NOXLATE
- spIO->Write(fd, &(pColor->GetGreenBand()));
-
- spIO.reset(new IOChannelBand(L"BlueBand")); // NOXLATE
- spIO->Write(fd, &(pColor->GetBlueBand()));
-
dectab();
- fd << tab() << "</Bands>" << std::endl; // NOXLATE
+ fd << tab() << "</Color>" << std::endl; // NOXLATE
}
+
Index: E:/MgDev/OS/Common/MdfParser/IOFill.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOFill.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOFill.cpp (revision 1038)
@@ -22,6 +22,12 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, Fill);
+ELEM_MAP_ENTRY(2, FillPattern);
+ELEM_MAP_ENTRY(3, ForegroundColor);
+ELEM_MAP_ENTRY(4, BackgroundColor);
+
IOFill::IOFill()
{
this->_fill = NULL;
@@ -39,8 +45,21 @@
void IOFill::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"Fill") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
+ {
+ case eFill:
m_startElemName = name;
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
+ }
}
void IOFill::ElementChars(const wchar_t *ch)
@@ -57,6 +76,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_fill->SetUnknownXml(UnknownXml());
+
handlerStack->pop();
this->_fill = NULL;
m_startElemName = L"";
@@ -84,6 +106,12 @@
fd << EncodeString(fill->GetBackgroundColor());
fd << "</BackgroundColor>" << std::endl; // NOXLATE
+ // Write any previously found unknown XML
+ if (!fill->GetUnknownXml().empty())
+ {
+ fd << toCString(fill->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</Fill>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOAreaTypeStyle.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOAreaTypeStyle.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOAreaTypeStyle.cpp (revision 1038)
@@ -23,6 +23,10 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, AreaTypeStyle);
+ELEM_MAP_ENTRY(2, AreaRule);
+
IOAreaTypeStyle::IOAreaTypeStyle()
{
this->_areaTypeStyle = NULL;
@@ -42,17 +46,30 @@
void IOAreaTypeStyle::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"AreaTypeStyle") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eAreaTypeStyle:
m_startElemName = name;
this->_areaTypeStyle = new AreaTypeStyle();
+ break;
+
+ case eAreaRule:
+ {
+ IOAreaRule *IO = new IOAreaRule(this->_areaTypeStyle);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"AreaRule") // NOXLATE
- {
- IOAreaRule *IO = new IOAreaRule(this->_areaTypeStyle);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
}
void IOAreaTypeStyle::ElementChars(const wchar_t *ch)
@@ -64,6 +81,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_areaTypeStyle->SetUnknownXml(UnknownXml());
+
this->scaleRange->GetFeatureTypeStyles()->Adopt(this->_areaTypeStyle);
handlerStack->pop();
this->scaleRange = NULL;
@@ -86,6 +106,12 @@
delete IO;
}
+ // Write any previously found unknown XML
+ if (!areaTypeStyle->GetUnknownXml().empty())
+ {
+ fd << toCString(areaTypeStyle->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</AreaTypeStyle>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOHillShade.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOHillShade.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOHillShade.cpp (revision 1038)
@@ -22,6 +22,13 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, HillShade);
+ELEM_MAP_ENTRY(2, Band);
+ELEM_MAP_ENTRY(3, Azimuth);
+ELEM_MAP_ENTRY(4, Altitude);
+ELEM_MAP_ENTRY(5, ScaleFactor);
+
IOHillShade::IOHillShade():colorStyle(NULL),hillShade(NULL)
{
}
@@ -37,10 +44,21 @@
void IOHillShade::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"HillShade") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eHillShade:
m_startElemName = name;
this->hillShade = new HillShade();
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
}
@@ -60,6 +78,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->hillShade->SetUnknownXml(UnknownXml());
+
this->colorStyle->AdoptHillShade(this->hillShade);
handlerStack->pop();
this->colorStyle = NULL;
@@ -97,6 +118,12 @@
fd << "</ScaleFactor>" << std::endl; // NOXLATE
}
+ // Write any previously found unknown XML
+ if (!pHillShade->GetUnknownXml().empty())
+ {
+ fd << toCString(pHillShade->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</HillShade>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOChannelBand.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOChannelBand.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOChannelBand.cpp (revision 1038)
@@ -22,6 +22,18 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+// From Grid Color - Start Elements
+ELEM_MAP_ENTRY(1, RedBand);
+ELEM_MAP_ENTRY(2, GreenBand);
+ELEM_MAP_ENTRY(3, BlueBand);
+// Local Elements
+ELEM_MAP_ENTRY(4, Band);
+ELEM_MAP_ENTRY(5, LowBand);
+ELEM_MAP_ENTRY(6, HighBand);
+ELEM_MAP_ENTRY(7, LowChannel);
+ELEM_MAP_ENTRY(8, HighChannel);
+
IOChannelBand::IOChannelBand(const std::wstring &strElemName)
: m_pChannel(NULL), m_strElemName(strElemName)
{
@@ -39,11 +51,24 @@
void IOChannelBand::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == m_strElemName)
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eRedBand:
+ case eGreenBand:
+ case eBlueBand:
m_startElemName = name;
if (NULL == this->m_pChannel)
m_pChannel = new ChannelBand();
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
}
@@ -70,6 +95,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->m_pChannel->SetUnknownXml(UnknownXml());
+
handlerStack->pop();
this->m_pChannel = NULL;
m_startElemName = L"";
@@ -115,6 +143,11 @@
fd << "</HighChannel>" << std::endl; // NOXLATE
}
+ // Write any previously found unknown XML
+ if (!pChannel->GetUnknownXml().empty())
+ {
+ fd << toCString(pChannel->GetUnknownXml());
+ }
dectab();
fd << tab() << "</" << EncodeString(this->m_strElemName) << '>' <<
std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOAreaRule.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOAreaRule.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOAreaRule.cpp (revision 1038)
@@ -24,6 +24,13 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, AreaRule);
+ELEM_MAP_ENTRY(2, AreaSymbolization2D);
+ELEM_MAP_ENTRY(3, Label);
+ELEM_MAP_ENTRY(4, LegendLabel);
+ELEM_MAP_ENTRY(5, Filter);
+
IOAreaRule::IOAreaRule()
{
this->_areaRule = NULL;
@@ -43,24 +50,38 @@
void IOAreaRule::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"AreaRule") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eAreaRule:
m_startElemName = name;
this->_areaRule = new AreaRule();
+ break;
+ case eAreaSymbolization2D:
+ {
+ IOAreaSymbolization2D *IO = new
IOAreaSymbolization2D(this->_areaRule);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eLabel:
+ {
+ IOLabel *IO = new IOLabel(this->_areaRule);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"AreaSymbolization2D") // NOXLATE
- {
- IOAreaSymbolization2D *IO = new
IOAreaSymbolization2D(this->_areaRule);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
- else if (m_currElemName == L"Label") // NOXLATE
- {
- IOLabel *IO = new IOLabel(this->_areaRule);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
}
void IOAreaRule::ElementChars(const wchar_t *ch)
@@ -75,6 +96,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_areaRule->SetUnknownXml(UnknownXml());
+
this->areaTypeStyle->GetRules()->Adopt(this->_areaRule);
handlerStack->pop();
this->areaTypeStyle= NULL;
@@ -116,6 +140,12 @@
IO->Write(fd, symbolization);
delete IO;
+ // Write any previously found unknown XML
+ if (!areaRule->GetUnknownXml().empty())
+ {
+ fd << toCString(areaRule->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</AreaRule>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IODrawingLayerDefinition.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IODrawingLayerDefinition.cpp
(revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IODrawingLayerDefinition.cpp
(revision 1038)
@@ -23,6 +23,15 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, DrawingLayerDefinition);
+ELEM_MAP_ENTRY(2, Opacity);
+ELEM_MAP_ENTRY(3, ResourceId);
+ELEM_MAP_ENTRY(4, Sheet);
+ELEM_MAP_ENTRY(5, LayerFilter);
+ELEM_MAP_ENTRY(6, MinScale);
+ELEM_MAP_ENTRY(7, MaxScale);
+
IODrawingLayerDefinition::IODrawingLayerDefinition()
{
this->_layer = NULL;
@@ -40,9 +49,20 @@
void IODrawingLayerDefinition::StartElement(const wchar_t *name,
HandlerStack *handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"DrawingLayerDefinition") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eDrawingLayerDefinition:
m_startElemName = name;
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
}
@@ -66,6 +86,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_layer->SetUnknownXml(UnknownXml());
+
handlerStack->pop();
this->_layer = NULL;
m_startElemName = L"";
@@ -123,6 +146,12 @@
fd << "</MaxScale>" << std::endl; // NOXLATE
}
+ // Write any previously found unknown XML
+ if (!drawingLayer->GetUnknownXml().empty())
+ {
+ fd << toCString(drawingLayer->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</DrawingLayerDefinition>" << std::endl; // NOXLATE
Index: E:/MgDev/OS/Common/MdfParser/IOPointSymbolization2D.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOPointSymbolization2D.cpp
(revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOPointSymbolization2D.cpp
(revision 1038)
@@ -28,6 +28,14 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, PointSymbolization2D);
+ELEM_MAP_ENTRY(2, Mark);
+ELEM_MAP_ENTRY(3, Image);
+ELEM_MAP_ENTRY(4, Font);
+ELEM_MAP_ENTRY(5, W2D);
+ELEM_MAP_ENTRY(6, Block);
+
IOPointSymbolization2D::IOPointSymbolization2D()
{
this->_PointSymbolization2D = NULL;
@@ -49,23 +57,37 @@
void IOPointSymbolization2D::StartElement(const wchar_t *name,
HandlerStack *handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"PointSymbolization2D") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ if (m_currElemId == ePointSymbolization2D)
{
m_startElemName = name;
this->_PointSymbolization2D = new PointSymbolization2D();
}
+ else if (m_currElemId == eUnknown)
+ {
+ ParseUnknownXml(name, handlerStack);
+ }
else
{
- if (m_currElemName == L"Mark") // NOXLATE
+ switch (m_currElemId)
+ {
+ case eMark:
this->ioSymbol = new IOMarkSymbol();
- else if (m_currElemName == L"Image") // NOXLATE
+ break;
+ case eImage:
this->ioSymbol = new IOImageSymbol();
- else if (m_currElemName == L"Font") // NOXLATE
+ break;
+ case eFont:
this->ioSymbol = new IOFontSymbol();
- else if (m_currElemName == L"W2D") // NOXLATE
+ break;
+ case eW2D:
this->ioSymbol = new IOW2DSymbol();
- else if (m_currElemName == L"Block") // NOXLATE
+ break;
+ case eBlock:
this->ioSymbol = new IOBlockSymbol();
+ break;
+ }
if (this->ioSymbol)
{
handlerStack->push(this->ioSymbol);
@@ -84,6 +106,9 @@
{
if (this->_PointSymbolization2D != NULL)
{
+ if (!UnknownXml().empty())
+
this->_PointSymbolization2D->SetUnknownXml(UnknownXml());
+
this->pointRule->AdoptSymbolization(this->_PointSymbolization2D);
if (this->ioSymbol != NULL)
{
@@ -122,6 +147,12 @@
else if (blockSymbol)
IOBlockSymbol::Write(fd, blockSymbol);
+ // Write any previously found unknown XML
+ if (!PointSymbolization2D->GetUnknownXml().empty())
+ {
+ fd << toCString(PointSymbolization2D->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</PointSymbolization2D>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOExtension.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOExtension.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOExtension.cpp (revision 1038)
@@ -24,6 +24,13 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, Extension);
+ELEM_MAP_ENTRY(2, CalculatedProperty);
+ELEM_MAP_ENTRY(3, AttributeRelate);
+ELEM_MAP_ENTRY(4, Name);
+ELEM_MAP_ENTRY(5, FeatureClass);
+
IOExtension::IOExtension()
: m_pExtension(NULL), m_pFeatureSource(NULL)
{
@@ -41,26 +48,37 @@
void IOExtension::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"Extension") // NOXLATE
- {
- m_startElemName = name;
- m_pExtension = new Extension();
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId) {
+ case eExtension:
+ m_startElemName = name;
+ m_pExtension = new Extension();
+ break;
+
+ case eCalculatedProperty:
+ {
+ IOCalculatedProperty *IO = new
IOCalculatedProperty(this->m_pExtension);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eAttributeRelate:
+ {
+ IOAttributeRelate *IO = new
IOAttributeRelate(this->m_pExtension);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else
- {
- if (m_currElemName == L"CalculatedProperty") // NOXLATE
- {
- IOCalculatedProperty *IO = new
IOCalculatedProperty(this->m_pExtension);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
- else if (m_currElemName == L"AttributeRelate") // NOXLATE
- {
- IOAttributeRelate *IO = new
IOAttributeRelate(this->m_pExtension);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
- }
}
void IOExtension::ElementChars(const wchar_t *ch)
@@ -75,6 +93,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ m_pExtension->SetUnknownXml(UnknownXml());
+
m_pFeatureSource->GetExtensions()->Adopt(m_pExtension);
handlerStack->pop();
this->m_pExtension = NULL;
@@ -112,7 +133,14 @@
spIO->Write(fd, pExtension->GetAttributeRelates()->GetAt(x));
}
+ // Write any previously found unknown XML
+ if (!pExtension->GetUnknownXml().empty())
+ {
+ fd << toCString(pExtension->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</Extension>" << std::endl; // NOXLATE
}
+
Index: E:/MgDev/OS/Common/MdfParser/IOGridColorRule.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOGridColorRule.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOGridColorRule.cpp (revision 1038)
@@ -25,6 +25,13 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, ColorRule);
+ELEM_MAP_ENTRY(2, Color);
+ELEM_MAP_ENTRY(3, Label);
+ELEM_MAP_ENTRY(4, LegendLabel);
+ELEM_MAP_ENTRY(5, Filter);
+
IOGridColorRule::IOGridColorRule():colorStyle(NULL), colorRule(NULL)
{
}
@@ -40,23 +47,38 @@
void IOGridColorRule::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"ColorRule") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eColorRule:
m_startElemName = name;
this->colorRule = new GridColorRule();
+ break;
+
+ case eColor:
+ {
+ IOGridColor *IO = new IOGridColor(this->colorRule);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eLabel:
+ {
+ IOLabel *IO = new IOLabel(this->colorRule);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"Color") // NOXLATE
- {
- IOGridColor *IO = new IOGridColor(this->colorRule);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
- else if (m_currElemName == L"Label") // NOXLATE
- {
- IOLabel *IO = new IOLabel(this->colorRule);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
}
void IOGridColorRule::ElementChars(const wchar_t *ch)
@@ -71,6 +93,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->colorRule->SetUnknownXml(UnknownXml());
+
this->colorStyle->GetRules()->Adopt(this->colorRule);
handlerStack->pop();
this->colorStyle = NULL;
@@ -110,6 +135,12 @@
pIO->Write(fd, pColorRule->GetGridColor());
delete pIO;
+ // Write any previously found unknown XML
+ if (!pColorRule->GetUnknownXml().empty())
+ {
+ fd << toCString(pColorRule->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</ColorRule>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOUtil.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOUtil.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOUtil.cpp (revision 1038)
@@ -159,4 +159,20 @@
return std::string("false"); // NOXLATE
}
+std::string startStr(const std::string elementName)
+{
+ std::string out("<"); // NOXLATE
+ out.append(elementName);
+ out.append(">"); // NOXLATE
+ return out;
+}
+
+std::string endStr(const std::string elementName)
+{
+ std::string out("</"); // NOXLATE
+ out.append(elementName);
+ out.append(">"); // NOXLATE
+ return out;
+}
+
END_NAMESPACE_MDFPARSER
Index: E:/MgDev/OS/Common/MdfParser/IOLineRule.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOLineRule.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOLineRule.cpp (revision 1038)
@@ -24,6 +24,13 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, LineRule);
+ELEM_MAP_ENTRY(2, LineSymbolization2D);
+ELEM_MAP_ENTRY(3, Label);
+ELEM_MAP_ENTRY(4, LegendLabel);
+ELEM_MAP_ENTRY(5, Filter);
+
IOLineRule::IOLineRule()
{
this->_lineRule = NULL;
@@ -43,23 +50,38 @@
void IOLineRule::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"LineRule") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eLineRule:
m_startElemName = name;
this->_lineRule = new LineRule();
+ break;
+
+ case eLineSymbolization2D:
+ {
+ IOLineSymbolization2D *IO = new
IOLineSymbolization2D(this->_lineRule);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eLabel:
+ {
+ IOLabel *IO = new IOLabel(this->_lineRule);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"LineSymbolization2D") // NOXLATE
- {
- IOLineSymbolization2D *IO = new
IOLineSymbolization2D(this->_lineRule);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
- else if (m_currElemName == L"Label") // NOXLATE
- {
- IOLabel *IO = new IOLabel(this->_lineRule);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
}
void IOLineRule::ElementChars(const wchar_t *ch)
@@ -74,6 +96,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_lineRule->SetUnknownXml(UnknownXml());
+
this->lineTypeStyle->GetRules()->Adopt(this->_lineRule);
handlerStack->pop();
this->lineTypeStyle= NULL;
@@ -116,6 +141,12 @@
delete IO;
}
+ // Write any previously found unknown XML
+ if (!lineRule->GetUnknownXml().empty())
+ {
+ fd << toCString(lineRule->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</LineRule>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOW2DSymbol.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOW2DSymbol.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOW2DSymbol.cpp (revision 1038)
@@ -25,6 +25,23 @@
// When a W2DSymbol is successfully parsed by this class, it must be
accessed by the
// parent class and then managed appropriately. It will not be deleted
by this class.
+CREATE_ELEMENT_MAP;
+// Inherited Symbol Elements
+ELEM_MAP_ENTRY(1, Unit);
+ELEM_MAP_ENTRY(2, SizeContext);
+ELEM_MAP_ENTRY(3, SizeX);
+ELEM_MAP_ENTRY(4, SizeY);
+ELEM_MAP_ENTRY(5, InsertionPointX);
+ELEM_MAP_ENTRY(6, InsertionPointY);
+ELEM_MAP_ENTRY(7, Rotation);
+ELEM_MAP_ENTRY(8, MaintainAspect);
+// Local Elements
+ELEM_MAP_ENTRY(9, W2D);
+ELEM_MAP_ENTRY(10, W2DSymbol);
+ELEM_MAP_ENTRY(11, FillColor);
+ELEM_MAP_ENTRY(12, LineColor);
+ELEM_MAP_ENTRY(13, TextColor);
+
IOW2DSymbol::IOW2DSymbol() : IOSymbol()
{
this->m_ioResourceRef = NULL;
@@ -33,17 +50,30 @@
void IOW2DSymbol::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
this->m_currElemName = name;
- if (this->m_currElemName == L"W2D") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eW2D:
this->m_startElemName = name;
this->m_symbol = new W2DSymbol(L"", L"");
+ break;
+
+ case eW2DSymbol:
+ {
+ this->m_ioResourceRef = new IOResourceRef(name);
+ handlerStack->push(this->m_ioResourceRef);
+ this->m_ioResourceRef->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (this->m_currElemName == L"W2DSymbol") // NOXLATE
- {
- this->m_ioResourceRef = new IOResourceRef(name);
- handlerStack->push(this->m_ioResourceRef);
- this->m_ioResourceRef->StartElement(name, handlerStack);
- }
}
void IOW2DSymbol::ElementChars(const wchar_t *ch)
@@ -63,6 +93,9 @@
{
if (this->m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->m_symbol->SetUnknownXml(UnknownXml());
+
// copy the values found by the IOResourceRef into our symbol
W2DSymbol* symbol = static_cast<W2DSymbol*>(this->m_symbol);
if (this->m_ioResourceRef)
@@ -112,6 +145,12 @@
fd << "</TextColor>" << std::endl; // NOXLATE
}
+ // Write any previously found unknown XML
+ if (!symbol->GetUnknownXml().empty())
+ {
+ fd << toCString(symbol->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</W2D>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOFontSymbol.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOFontSymbol.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOFontSymbol.cpp (revision 1038)
@@ -25,13 +25,43 @@
// When a FontSymbol is successfully parsed by this class, it must be
accessed by the
// parent class and then managed appropriately. It will not be deleted
by this class.
+CREATE_ELEMENT_MAP;
+// Inherited Symbol Elements
+ELEM_MAP_ENTRY(1, Unit);
+ELEM_MAP_ENTRY(2, SizeContext);
+ELEM_MAP_ENTRY(3, SizeX);
+ELEM_MAP_ENTRY(4, SizeY);
+ELEM_MAP_ENTRY(5, InsertionPointX);
+ELEM_MAP_ENTRY(6, InsertionPointY);
+ELEM_MAP_ENTRY(7, Rotation);
+ELEM_MAP_ENTRY(8, MaintainAspect);
+// Local Elements
+ELEM_MAP_ENTRY(9, Font);
+ELEM_MAP_ENTRY(10, FontName);
+ELEM_MAP_ENTRY(11, Character);
+ELEM_MAP_ENTRY(12, Bold);
+ELEM_MAP_ENTRY(13, Italic);
+ELEM_MAP_ENTRY(14, Underlined);
+ELEM_MAP_ENTRY(15, ForegroundColor);
+
void IOFontSymbol::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
this->m_currElemName = name;
- if (this->m_currElemName == L"Font") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eFont:
this->m_startElemName = name;
this->m_symbol = new FontSymbol();
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
}
@@ -58,6 +88,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->m_symbol->SetUnknownXml(UnknownXml());
+
handlerStack->pop();
this->m_startElemName = L"";
}
@@ -112,6 +145,12 @@
fd << EncodeString(symbol->GetForegroundColor());
fd << "</ForegroundColor>" << std::endl; // NOXLATE
+ // Write any previously found unknown XML
+ if (!symbol->GetUnknownXml().empty())
+ {
+ fd << toCString(symbol->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</Font>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOLineSymbolization2D.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOLineSymbolization2D.cpp
(revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOLineSymbolization2D.cpp
(revision 1038)
@@ -23,6 +23,13 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, LineSymbolization2D);
+ELEM_MAP_ENTRY(2, LineStyle);
+ELEM_MAP_ENTRY(3, Thickness);
+ELEM_MAP_ENTRY(4, Color);
+ELEM_MAP_ENTRY(5, Unit);
+
IOLineSymbolization2D::IOLineSymbolization2D()
{
this->_lineSymbolization = NULL;
@@ -42,10 +49,21 @@
void IOLineSymbolization2D::StartElement(const wchar_t *name,
HandlerStack *handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"LineSymbolization2D") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eLineSymbolization2D:
m_startElemName = name;
this->_lineSymbolization = new LineSymbolization2D();
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
}
@@ -68,6 +86,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_lineSymbolization->SetUnknownXml(UnknownXml());
+
this->lineRule->GetSymbolizations()->Adopt(this->_lineSymbolization);
handlerStack->pop();
this->lineRule= NULL;
@@ -81,5 +102,38 @@
{
//Property: Stroke
if (lineSymbolization->GetStroke())
- IOStroke::Write(fd, lineSymbolization->GetStroke(),
"LineSymbolization2D"); // NOXLATE
+ {
+ fd << tab() << startStr(sLineSymbolization2D) << std::endl;
+ inctab();
+
+ //Property: LineStyle
+ fd << tab() << startStr(sLineStyle);
+ fd <<
EncodeString(lineSymbolization->GetStroke()->GetLineStyle());
+ fd << endStr(sLineStyle) << std::endl;
+
+ //Property: Thickness
+ fd << tab() << startStr(sThickness);
+ fd <<
EncodeString(lineSymbolization->GetStroke()->GetThickness());
+ fd << endStr(sThickness) << std::endl;
+
+ //Property: ForegroundColor
+ fd << tab() << startStr(sColor);
+ fd << EncodeString(lineSymbolization->GetStroke()->GetColor());
+ fd << endStr(sColor) << std::endl;
+
+ //Property: Unit
+ fd << tab() << startStr(sUnit);
+ std::auto_ptr<MdfString>
str(LengthConverter::UnitToEnglish(lineSymbolization->GetStroke()->GetUn
it()));
+ fd << EncodeString(*str);
+ fd << endStr(sUnit) << std::endl;
+
+ // Write any previously found unknown XML
+ if (!lineSymbolization->GetUnknownXml().empty())
+ {
+ fd << toCString(lineSymbolization->GetUnknownXml());
+ }
+
+ dectab();
+ fd << tab() << endStr(sLineSymbolization2D) << std::endl;
+ }
}
Index: E:/MgDev/OS/Common/MdfParser/FSDSAX2Parser.h
===================================================================
--- E:/MgDev/OS/Common/MdfParser/FSDSAX2Parser.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/FSDSAX2Parser.h (revision 1038)
@@ -69,19 +69,14 @@
// Unfortunately, the SAX2 Parser doesn't necessarily send all
the
// characters that appear inside a tag in one call of
characters()-
// for example with escape characters it separates them into
separate calls.
- // Therefore, m_strbuffer is used to accumulate the characters,
openTag and
- // prevOpenTag are used to determine if we're still reading
characters in the
- // same open tag, and tagOpen and charsInTag are used in the
case when you have
- // no characters in between a tag (i.e. <Metadata></Metadata>)
to make sure
- // that whitespace or line returns don't get assigned to it
instead.
+ // Therefore, m_strbuffer is used to accumulate the characters.
tagOpen is
+ // used in the case when you have characters outside a tag
(i.e. <Metadata></Metadata>)
+ // to make sure that whitespace or line returns don't get
assigned to it instead.
std::wstring m_strbuffer;
-
- std::wstring m_openTag;
- std::wstring m_prevOpenTag;
- MdfString m_strParserError;
bool m_tagOpen;
- bool m_charsInTag;
+ MdfString m_strParserError;
+
void WriteDefinition(FeatureSource *pFeatureSource, MdfStream
&fd);
// error handling override
Index: E:/MgDev/OS/Common/MdfParser/IOUnknown.h
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOUnknown.h (revision 0)
+++ E:/MgDev/OS/Common/MdfParser/IOUnknown.h (revision 1038)
@@ -0,0 +1,43 @@
+//
+// Copyright (C) 2004-2006 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 _IOUNKNOWN_H
+#define _IOUNKNOWN_H
+
+#include "SAX2ElementHandler.h"
+
+using namespace XERCES_CPP_NAMESPACE;
+using namespace MDFMODEL_NAMESPACE;
+
+BEGIN_NAMESPACE_MDFPARSER
+
+class IOUnknown : public SAX2ElementHandler
+{
+ private:
+ std::wstring* _xml;
+
+ public:
+ IOUnknown(std::wstring* xml);
+ ~IOUnknown();
+
+ 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);
+};
+
+END_NAMESPACE_MDFPARSER
+#endif // _IOUNKNOWN_H
Property changes on: E:\MgDev\OS\Common\MdfParser\IOUnknown.h
___________________________________________________________________
Name: svn:eol-style
+ native
Index: E:/MgDev/OS/Common/MdfParser/IOStroke.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOStroke.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOStroke.cpp (revision 1038)
@@ -24,6 +24,13 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, Stroke);
+ELEM_MAP_ENTRY(2, LineStyle);
+ELEM_MAP_ENTRY(3, Thickness);
+ELEM_MAP_ENTRY(4, Color);
+ELEM_MAP_ENTRY(5, Unit);
+
IOStroke::IOStroke(std::wstring elementName)
{
this->_stroke = NULL;
@@ -42,9 +49,25 @@
void IOStroke::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
+ // Note: this->m_elementName is not part of the Element Map, so the
+ // eStroke value is substituted - but sStroke will not be the
correct
+ // string, and cannot not be used in place of m_elementName.
+
m_currElemName = name;
if (m_currElemName == this->m_elementName)
+ {
+ m_currElemId = eStroke;
m_startElemName = name;
+ }
+ else
+ {
+ m_currElemId = _ElementIdFromName(name);
+ }
+
+ if (eUnknown == m_currElemId)
+ {
+ ParseUnknownXml(name, handlerStack);
+ }
}
void IOStroke::ElementChars(const wchar_t *ch)
@@ -66,6 +89,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_stroke->SetUnknownXml(UnknownXml());
+
handlerStack->pop();
this->_stroke = NULL;
m_startElemName = L"";
@@ -99,6 +125,12 @@
fd << EncodeString(*str);
fd << "</Unit>" << std::endl; // NOXLATE
+ // Write any previously found unknown XML
+ if (!stroke->GetUnknownXml().empty())
+ {
+ fd << toCString(stroke->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</" << name << ">" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOImageSymbol.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOImageSymbol.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOImageSymbol.cpp (revision 1038)
@@ -25,6 +25,20 @@
// When a ImageSymbol is successfully parsed by this class, it must be
accessed by the
// parent class and then managed appropriately. It will not be deleted
by this class.
+CREATE_ELEMENT_MAP;
+// Inherited Symbol Elements
+ELEM_MAP_ENTRY(1, Unit);
+ELEM_MAP_ENTRY(2, SizeContext);
+ELEM_MAP_ENTRY(3, SizeX);
+ELEM_MAP_ENTRY(4, SizeY);
+ELEM_MAP_ENTRY(5, InsertionPointX);
+ELEM_MAP_ENTRY(6, InsertionPointY);
+ELEM_MAP_ENTRY(7, Rotation);
+ELEM_MAP_ENTRY(8, MaintainAspect);
+// Local Elements
+ELEM_MAP_ENTRY(9, Image);
+ELEM_MAP_ENTRY(10, Content);
+
IOImageSymbol::IOImageSymbol() : IOSymbol()
{
this->m_ioResourceRef = NULL;
@@ -33,6 +47,8 @@
void IOImageSymbol::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
this->m_currElemName = name;
+ m_currElemId = _ElementIdFromName(name);
+
// it's a pain to have the "Image" element contain an "Image"
element
if (this->m_currElemName == L"Image" && this->m_startElemName !=
L"Image") // NOXLATE
{
@@ -45,6 +61,10 @@
handlerStack->push(this->m_ioResourceRef);
this->m_ioResourceRef->StartElement(name, handlerStack);
}
+ else if (eUnknown == m_currElemId)
+ {
+ ParseUnknownXml(name, handlerStack);
+ }
}
void IOImageSymbol::ElementChars(const wchar_t *ch)
@@ -60,6 +80,9 @@
{
if (this->m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->m_symbol->SetUnknownXml(UnknownXml());
+
// copy the values found by the IOResourceRef into our symbol
ImageSymbol* symbol =
static_cast<ImageSymbol*>(this->m_symbol);
if (this->m_ioResourceRef)
@@ -95,6 +118,12 @@
fd << "</Content>" << std::endl; // NOXLATE
}
+ // Write any previously found unknown XML
+ if (!symbol->GetUnknownXml().empty())
+ {
+ fd << toCString(symbol->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</Image>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOVectorLayerDefinition.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOVectorLayerDefinition.cpp
(revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOVectorLayerDefinition.cpp
(revision 1038)
@@ -24,11 +24,26 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, VectorLayerDefinition);
+ELEM_MAP_ENTRY(2, PropertyMapping);
+ELEM_MAP_ENTRY(3, VectorScaleRange);
+ELEM_MAP_ENTRY(4, Opacity);
+ELEM_MAP_ENTRY(5, ResourceId);
+ELEM_MAP_ENTRY(6, FeatureName);
+ELEM_MAP_ENTRY(7, FeatureNameType);
+ELEM_MAP_ENTRY(8, Geometry);
+ELEM_MAP_ENTRY(9, Url);
+ELEM_MAP_ENTRY(10, ToolTip);
+ELEM_MAP_ENTRY(11, Filter);
+
+
IOVectorLayerDefinition::IOVectorLayerDefinition()
{
this->_layer = NULL;
}
+
IOVectorLayerDefinition::IOVectorLayerDefinition(VectorLayerDefinition
*layer)
{
this->_layer = layer;
@@ -41,53 +56,88 @@
void IOVectorLayerDefinition::StartElement(const wchar_t *name,
HandlerStack *handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"VectorLayerDefinition") // NOXLATE
- {
- m_startElemName = name;
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId) {
+ case eVectorLayerDefinition:
+ m_startElemName = name;
+ break;
+
+ case ePropertyMapping:
+ {
+ IONameStringPair *IO = new
IONameStringPair(this->_layer);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eVectorScaleRange:
+ {
+ IOVectorScaleRange *IO = new
IOVectorScaleRange(this->_layer);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"PropertyMapping") // NOXLATE
- {
- IONameStringPair *IO = new IONameStringPair(this->_layer);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
- else if (m_currElemName == L"VectorScaleRange") // NOXLATE
- {
- IOVectorScaleRange *IO = new IOVectorScaleRange(this->_layer);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
}
void IOVectorLayerDefinition::ElementChars(const wchar_t *ch)
{
- if (m_currElemName == L"Opacity") // NOXLATE
- (this->_layer)->SetOpacity(wstrToDouble(ch));
- else if (m_currElemName == L"ResourceId") // NOXLATE
- (this->_layer)->SetResourceID(ch);
- else if (m_currElemName == L"FeatureName") // NOXLATE
- (this->_layer)->SetFeatureName(ch);
- else if (m_currElemName == L"FeatureNameType") // NOXLATE
- {
- if (::wcscmp(ch, L"FeatureClass") == 0) // NOXLATE
-
_layer->SetFeatureNameType(VectorLayerDefinition::FeatureClass);
- else if (::wcscmp(ch, L"NamedExtension") == 0) // NOXLATE
-
_layer->SetFeatureNameType(VectorLayerDefinition::NamedExtension);
+ switch (m_currElemId) {
+ case eOpacity:
+ (this->_layer)->SetOpacity(wstrToDouble(ch));
+ break;
+
+ case eResourceId:
+ (this->_layer)->SetResourceID(ch);
+ break;
+
+ case eFeatureName:
+ (this->_layer)->SetFeatureName(ch);
+ break;
+
+ case eFeatureNameType:
+ if (::wcscmp(ch, L"FeatureClass") == 0) // NOXLATE
+
_layer->SetFeatureNameType(VectorLayerDefinition::FeatureClass);
+ else if (::wcscmp(ch, L"NamedExtension") == 0) // NOXLATE
+
_layer->SetFeatureNameType(VectorLayerDefinition::NamedExtension);
+ break;
+
+ case eGeometry:
+ (this->_layer)->SetGeometry(ch);
+ break;
+
+ case eUrl:
+ (this->_layer)->SetUrl(ch);
+ break;
+
+ case eToolTip:
+ (this->_layer)->SetToolTip(ch);
+ break;
+
+ case eFilter:
+ (this->_layer)->SetFilter(ch);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"Geometry") // NOXLATE
- (this->_layer)->SetGeometry(ch); // NOXLATE
- else if (m_currElemName == L"Url") // NOXLATE
- (this->_layer)->SetUrl(ch);
- else if (m_currElemName == L"ToolTip") // NOXLATE
- (this->_layer)->SetToolTip(ch);
- else if (m_currElemName == L"Filter") // NOXLATE
- (this->_layer)->SetFilter(ch);
}
void IOVectorLayerDefinition::EndElement(const wchar_t *name,
HandlerStack *handlerStack)
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_layer->SetUnknownXml(UnknownXml());
+
handlerStack->pop();
this->_layer = NULL;
m_startElemName = L"";
@@ -100,74 +150,74 @@
fd << tab() << "<LayerDefinition
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xsi:noNamespaceSchemaLocation=\"LayerDefinition-1.0.0.xsd\"
version=\"1.0.0\">" << std::endl; // NOXLATE
inctab();
- fd << tab() << "<VectorLayerDefinition>" << std::endl; // NOXLATE
+ fd << tab() << startStr(sVectorLayerDefinition) << std::endl;
inctab();
//Property: ResourceId
- fd << tab() << "<ResourceId>"; // NOXLATE
+ fd << tab() << startStr(sResourceId);
fd << EncodeString(featureLayer->GetResourceID());
- fd << "</ResourceId>" << std::endl; // NOXLATE
+ fd << endStr(sResourceId) << std::endl;
//Property: Opacity (optional)
if (featureLayer->GetOpacity() != 1.0)
{
- fd << tab() << "<Opacity>"; // NOXLATE
+ fd << tab() << startStr(sOpacity);
fd << DoubleToStr(featureLayer->GetOpacity());
- fd << "</Opacity>" << std::endl; // NOXLATE
+ fd << endStr(sOpacity) << std::endl;
}
//Property: FeatureName
- fd << tab() << "<FeatureName>"; // NOXLATE
+ fd << tab() << startStr(sFeatureName);
fd << EncodeString(featureLayer->GetFeatureName());
- fd << "</FeatureName>" << std::endl; // NOXLATE
+ fd << endStr(sFeatureName) << std::endl;
//Property: FeatureNameType
- fd << tab() << "<FeatureNameType>"; // NOXLATE
+ fd << tab() << startStr(sFeatureNameType);
if (featureLayer->GetFeatureNameType() ==
VectorLayerDefinition::FeatureClass)
fd << "FeatureClass"; // NOXLATE
else
fd << "NamedExtension"; // NOXLATE
- fd << "</FeatureNameType>" << std::endl; // NOXLATE
+ fd << endStr(sFeatureNameType) << std::endl;
//Property: Filter
if (featureLayer->GetFilter().length() > 0)
{
- fd << tab() << "<Filter>"; // NOXLATE
+ fd << tab() << startStr(sFilter);
fd << EncodeString(featureLayer->GetFilter());
- fd << "</Filter>" << std::endl; // NOXLATE
+ fd << endStr(sFilter) << std::endl;
}
//Property: PropertyMappings
for (int x = 0; x <
featureLayer->GetPropertyMappings()->GetCount(); x++)
{
- fd << tab() << "<PropertyMapping>" << std::endl; // NOXLATE
+ fd << tab() << startStr(sPropertyMapping) << std::endl;
inctab();
IONameStringPair * IO = new IONameStringPair();
IO->Write(fd, featureLayer->GetPropertyMappings()->GetAt(x));
delete IO;
dectab();
- fd << tab() << "</PropertyMapping>" << std::endl; // NOXLATE
+ fd << tab() << endStr(sPropertyMapping) << std::endl;
}
//Property: Geometry
- fd << tab() << "<Geometry>"; // NOXLATE
+ fd << tab() << startStr(sGeometry);
fd << EncodeString(featureLayer->GetGeometry());
- fd << "</Geometry>" << std::endl; // NOXLATE
+ fd << endStr(sGeometry) << std::endl;
//Property: Url
if (featureLayer->GetUrl().length() > 0)
{
- fd << tab() << "<Url>"; // NOXLATE
+ fd << tab() << startStr(sUrl);
fd << EncodeString(featureLayer->GetUrl());
- fd << "</Url>" << std::endl; // NOXLATE
+ fd << endStr(sUrl) << std::endl;
}
//Property: ToolTip
if (featureLayer->GetToolTip().length() > 0)
{
- fd << tab() << "<ToolTip>"; // NOXLATE
+ fd << tab() << startStr(sToolTip);
fd << EncodeString(featureLayer->GetToolTip());
- fd << "</ToolTip>" << std::endl; // NOXLATE
+ fd << endStr(sToolTip) << std::endl;
}
//Property: VectorScaleRange
@@ -178,8 +228,14 @@
delete IO;
}
+ // Write any previously found unknown XML
+ if (!featureLayer->GetUnknownXml().empty())
+ {
+ fd << toCString(featureLayer->GetUnknownXml());
+ }
+
dectab();
- fd << tab() << "</VectorLayerDefinition>" << std::endl; // NOXLATE
+ fd << tab() << endStr(sVectorLayerDefinition) << std::endl; //
NOXLATE
dectab();
fd << tab() << "</LayerDefinition>" << std::endl; // NOXLATE
Index: E:/MgDev/OS/Common/MdfParser/IOSupplementalSpatialContextInfo.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOSupplementalSpatialContextInfo.cpp
(revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOSupplementalSpatialContextInfo.cpp
(revision 1038)
@@ -22,6 +22,10 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, SupplementalSpatialContextInfo);
+ELEM_MAP_ENTRY(2, Name);
+ELEM_MAP_ENTRY(3, CoordinateSystem);
IOSupplementalSpatialContextInfo::IOSupplementalSpatialContextInfo()
: _ssContextInfo(NULL), featureSource(NULL)
@@ -40,13 +44,24 @@
void IOSupplementalSpatialContextInfo::StartElement(const wchar_t
*name, HandlerStack *handlerStack)
{
m_currElemName = name;
- if (NULL != featureSource)
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
- if (m_currElemName == L"SupplementalSpatialContextInfo") //
NOXLATE
+ case eSupplementalSpatialContextInfo:
+ if (NULL != featureSource)
{
m_startElemName = name;
this->_ssContextInfo = new
SupplementalSpatialContextInfo(L"", L"");
}
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
}
@@ -62,6 +77,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_ssContextInfo->SetUnknownXml(UnknownXml());
+
if (NULL != this->featureSource)
this->featureSource->GetSupplementalSpatialContextInfo()->Adopt(this->_s
sContextInfo);
@@ -83,4 +101,10 @@
fd << tab() << "<CoordinateSystem>"; // NOXLATE
fd << EncodeString(ssContextInfo->GetCoordinateSystem());
fd << "</CoordinateSystem>" << std::endl; // NOXLATE
+
+ // Write any previously found unknown XML
+ if (!ssContextInfo->GetUnknownXml().empty())
+ {
+ fd << toCString(ssContextInfo->GetUnknownXml());
+ }
}
Index: E:/MgDev/OS/Common/MdfParser/IOGridScaleRange.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOGridScaleRange.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOGridScaleRange.cpp (revision 1038)
@@ -27,6 +27,14 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, GridScaleRange);
+ELEM_MAP_ENTRY(2, SurfaceStyle);
+ELEM_MAP_ENTRY(3, ColorStyle);
+ELEM_MAP_ENTRY(4, MinScale);
+ELEM_MAP_ENTRY(5, MaxScale);
+ELEM_MAP_ENTRY(6, RebuildFactor);
+
IOGridScaleRange::IOGridScaleRange():_scaleRange(NULL), layer(NULL)
{
}
@@ -42,25 +50,37 @@
void IOGridScaleRange::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"GridScaleRange") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eGridScaleRange:
m_startElemName = name;
this->_scaleRange = new GridScaleRange();
- }
- else
- {
- if (m_currElemName == L"SurfaceStyle") // NOXLATE
+ break;
+
+ case eSurfaceStyle:
{
IOGridSurfaceStyle *IO = new
IOGridSurfaceStyle(this->_scaleRange);
handlerStack->push(IO);
IO->StartElement(name, handlerStack);
}
- else if (m_currElemName == L"ColorStyle") // NOXLATE
+ break;
+
+ case eColorStyle:
{
IOGridColorStyle *IO = new
IOGridColorStyle(this->_scaleRange);
handlerStack->push(IO);
IO->StartElement(name, handlerStack);
}
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
}
@@ -78,6 +98,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_scaleRange->SetUnknownXml(UnknownXml());
+
this->layer->GetScaleRanges()->Adopt(this->_scaleRange);
handlerStack->pop();
this->layer = NULL;
@@ -131,6 +154,12 @@
fd << DoubleToStr(scaleRange->GetRebuildFactor());
fd << "</RebuildFactor>" << std::endl; // NOXLATE
+ // Write any previously found unknown XML
+ if (!scaleRange->GetUnknownXml().empty())
+ {
+ fd << toCString(scaleRange->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</GridScaleRange>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOGridSurfaceStyle.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOGridSurfaceStyle.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOGridSurfaceStyle.cpp (revision 1038)
@@ -23,6 +23,13 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, SurfaceStyle);
+ELEM_MAP_ENTRY(2, Band);
+ELEM_MAP_ENTRY(3, ZeroValue);
+ELEM_MAP_ENTRY(4, ScaleFactor);
+ELEM_MAP_ENTRY(5, DefaultColor);
+
IOGridSurfaceStyle::IOGridSurfaceStyle():surfaceStyle(NULL),
scaleRange(NULL)
{
}
@@ -38,10 +45,21 @@
void IOGridSurfaceStyle::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"SurfaceStyle") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eSurfaceStyle:
m_startElemName = name;
this->surfaceStyle = new GridSurfaceStyle();
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
}
@@ -61,7 +79,10 @@
{
if (m_startElemName == name)
{
- //this->scaleRange->GetGridStyles()->Adopt(this->surfaceStyle);
+ if (!UnknownXml().empty())
+ this->surfaceStyle->SetUnknownXml(UnknownXml());
+
+ //this->scaleRange->GetGridStyles()->Adopt(this->surfaceStyle);
this->scaleRange->AdoptSurfaceStyle(this->surfaceStyle);
handlerStack->pop();
this->scaleRange = NULL;
@@ -102,6 +123,12 @@
fd << EncodeString(pSurfaceStyle->GetDefaultColor());
fd << "</DefaultColor>" << std::endl; // NOXLATE
+ // Write any previously found unknown XML
+ if (!pSurfaceStyle->GetUnknownXml().empty())
+ {
+ fd << toCString(pSurfaceStyle->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</SurfaceStyle>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOMarkSymbol.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOMarkSymbol.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOMarkSymbol.cpp (revision 1038)
@@ -27,6 +27,23 @@
// When a MarkSymbol is successfully parsed by this class, it must be
accessed by the
// parent class and then managed appropriately. It will not be deleted
by this class.
+CREATE_ELEMENT_MAP;
+// Inherited Symbol Elements
+ELEM_MAP_ENTRY(1, Unit);
+ELEM_MAP_ENTRY(2, SizeContext);
+ELEM_MAP_ENTRY(3, SizeX);
+ELEM_MAP_ENTRY(4, SizeY);
+ELEM_MAP_ENTRY(5, InsertionPointX);
+ELEM_MAP_ENTRY(6, InsertionPointY);
+ELEM_MAP_ENTRY(7, Rotation);
+ELEM_MAP_ENTRY(8, MaintainAspect);
+// Local Elements
+ELEM_MAP_ENTRY(9, Mark);
+ELEM_MAP_ENTRY(10, Fill);
+ELEM_MAP_ENTRY(11, Edge);
+ELEM_MAP_ENTRY(12, Shape);
+
+
IOMarkSymbol::IOMarkSymbol() : IOSymbol()
{
this->m_ioStroke = NULL;
@@ -36,30 +53,47 @@
void IOMarkSymbol::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
this->m_currElemName = name;
- if (this->m_currElemName == L"Mark") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
- this->m_startElemName = name;
- MarkSymbol* markSymbol = new MarkSymbol(MarkSymbol::Square);
- delete markSymbol->OrphanFill();
- delete markSymbol->OrphanEdge();
- this->m_symbol = markSymbol;
+ case eMark:
+ {
+ this->m_startElemName = name;
+ MarkSymbol* markSymbol = new
MarkSymbol(MarkSymbol::Square);
+ delete markSymbol->OrphanFill();
+ delete markSymbol->OrphanEdge();
+ this->m_symbol = markSymbol;
+ }
+ break;
+
+ case eFill:
+ {
+ MarkSymbol* symbol =
static_cast<MarkSymbol*>(this->m_symbol);
+ symbol->AdoptFill(new Fill());
+ this->m_ioFill = new IOFill(symbol->GetFill());
+ handlerStack->push(this->m_ioFill);
+ this->m_ioFill->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eEdge:
+ {
+ MarkSymbol* symbol =
static_cast<MarkSymbol*>(this->m_symbol);
+ symbol->AdoptEdge(new Stroke());
+ this->m_ioStroke = new IOStroke(symbol->GetEdge(),
this->m_currElemName);
+ handlerStack->push(this->m_ioStroke);
+ this->m_ioStroke->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (this->m_currElemName == L"Fill") // NOXLATE
- {
- MarkSymbol* symbol = static_cast<MarkSymbol*>(this->m_symbol);
- symbol->AdoptFill(new Fill());
- this->m_ioFill = new IOFill(symbol->GetFill());
- handlerStack->push(this->m_ioFill);
- this->m_ioFill->StartElement(name, handlerStack);
- }
- else if (this->m_currElemName == L"Edge") // NOXLATE
- {
- MarkSymbol* symbol = static_cast<MarkSymbol*>(this->m_symbol);
- symbol->AdoptEdge(new Stroke());
- this->m_ioStroke = new IOStroke(symbol->GetEdge(),
this->m_currElemName);
- handlerStack->push(this->m_ioStroke);
- this->m_ioStroke->StartElement(name, handlerStack);
- }
}
void IOMarkSymbol::ElementChars(const wchar_t *ch)
@@ -88,6 +122,9 @@
{
if (this->m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->m_symbol->SetUnknownXml(UnknownXml());
+
handlerStack->pop();
this->m_startElemName = L"";
}
@@ -124,6 +161,12 @@
if (symbol->GetEdge() != NULL)
IOStroke::Write(fd, symbol->GetEdge(), "Edge"); // NOXLATE
+ // Write any previously found unknown XML
+ if (!symbol->GetUnknownXml().empty())
+ {
+ fd << toCString(symbol->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</Mark>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/IOPointRule.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOPointRule.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOPointRule.cpp (revision 1038)
@@ -24,6 +24,13 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, PointRule);
+ELEM_MAP_ENTRY(2, PointSymbolization2D);
+ELEM_MAP_ENTRY(3, Label);
+ELEM_MAP_ENTRY(4, LegendLabel);
+ELEM_MAP_ENTRY(5, Filter);
+
IOPointRule::IOPointRule()
{
this->_pointRule = NULL;
@@ -43,23 +50,38 @@
void IOPointRule::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"PointRule") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case ePointRule:
m_startElemName = name;
this->_pointRule = new PointRule();
+ break;
+
+ case ePointSymbolization2D:
+ {
+ IOPointSymbolization2D *IO = new
IOPointSymbolization2D(this->_pointRule);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eLabel:
+ {
+ IOLabel *IO = new IOLabel(this->_pointRule);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
- else if (m_currElemName == L"PointSymbolization2D") // NOXLATE
- {
- IOPointSymbolization2D *IO = new
IOPointSymbolization2D(this->_pointRule);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
- else if (m_currElemName == L"Label") // NOXLATE
- {
- IOLabel *IO = new IOLabel(this->_pointRule);
- handlerStack->push(IO);
- IO->StartElement(name, handlerStack);
- }
}
void IOPointRule::ElementChars(const wchar_t *ch)
@@ -74,6 +96,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->_pointRule->SetUnknownXml(UnknownXml());
+
this->pointTypeStyle->GetRules()->Adopt(this->_pointRule);
handlerStack->pop();
this->pointTypeStyle= NULL;
@@ -117,6 +142,12 @@
delete IO;
}
+ // Write any previously found unknown XML
+ if (!pointRule->GetUnknownXml().empty())
+ {
+ fd << toCString(pointRule->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</PointRule>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/FSDSAX2Parser.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/FSDSAX2Parser.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/FSDSAX2Parser.cpp (revision 1038)
@@ -28,6 +28,8 @@
{
FSDSAX2Parser::FSDSAX2Parser()
{
+ m_tagOpen = false;
+
Flush();
Initialize();
}
@@ -61,7 +63,6 @@
m_Parser->setFeature(XMLUni::fgSAX2CoreValidation, false);
m_Parser->setContentHandler(this);
m_Parser->setErrorHandler(this);
- m_prevOpenTag = L"";
m_strbuffer = L"";
}
@@ -171,7 +172,9 @@
const Attributes&
attributes)
{
std::wstring str = X2W(localname);
- m_openTag = str;
+ m_strbuffer = L""; // discard any text between start tags
+ m_tagOpen = true;
+
// If the stack is empty, then check to see if we've
encountered the
// start of one of the below definitions. Allocate space for
the object
// we will be creating, create the appropriate IO object,
passing in the reference
@@ -193,29 +196,15 @@
{
(m_HandlerStack->top())->StartElement(str.c_str(),
m_HandlerStack);
}
- m_tagOpen = true;
- m_charsInTag = false;
}
void FSDSAX2Parser::characters(const XMLCh* const chars
, const unsigned int length)
{
- if (m_openTag.compare(m_prevOpenTag) != 0)
- {
- if (!m_HandlerStack->empty())
- {
- if (m_charsInTag)
-
(m_HandlerStack->top())->ElementChars(m_strbuffer.c_str());
- m_strbuffer = L"";
- }
- }
-
- m_strbuffer += X2W(chars);
-
- m_prevOpenTag = m_openTag;
-
+ // 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
if (m_tagOpen)
- m_charsInTag = true;
+ m_strbuffer += X2W(chars);
}
void FSDSAX2Parser::endElement(const XMLCh* const uri,
@@ -223,9 +212,15 @@
const XMLCh* const qname)
{
m_tagOpen = false;
- m_prevOpenTag = L"";
if (!m_HandlerStack->empty())
{
+ // Now is the time to make the ElementChars() call.
+ if (!m_strbuffer.empty())
+ {
+
(m_HandlerStack->top())->ElementChars(m_strbuffer.c_str());
+ m_strbuffer = L"";
+ }
+
(m_HandlerStack->top())->EndElement(X2W(localname),
m_HandlerStack);
}
}
Index: E:/MgDev/OS/Common/MdfParser/IOUnknown.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOUnknown.cpp (revision 0)
+++ E:/MgDev/OS/Common/MdfParser/IOUnknown.cpp (revision 1038)
@@ -0,0 +1,71 @@
+//
+// Copyright (C) 2004-2006 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
+//
+
+#include "stdafx.h"
+#include "IOUnknown.h"
+
+using namespace XERCES_CPP_NAMESPACE;
+using namespace MDFPARSER_NAMESPACE;
+
+
+IOUnknown::IOUnknown(std::wstring* xml)
+{
+ _xml = xml;
+ m_startElemName.clear();
+}
+
+IOUnknown::~IOUnknown()
+{
+}
+
+void IOUnknown::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
+{
+
+ if (m_startElemName.empty())
+ {
+ m_startElemName = name;
+
+ _xml->append(L"<"); // NOXLATE
+ _xml->append(name);
+ _xml->append(L">"); // NOXLATE
+ }
+ else
+ {
+ IOUnknown *IO = new IOUnknown(_xml);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+}
+
+void IOUnknown::ElementChars(const wchar_t *ch)
+{
+ _xml->append(ch);
+}
+
+void IOUnknown::EndElement(const wchar_t *name, HandlerStack
*handlerStack)
+{
+ _xml->append(L"</"); // NOXLATE
+ _xml->append(name);
+ _xml->append(L">"); // NOXLATE
+
+ if (m_startElemName == name)
+ {
+ handlerStack->pop();
+ delete this;
+ }
+}
+
Property changes on: E:\MgDev\OS\Common\MdfParser\IOUnknown.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Index: E:/MgDev/OS/Common/MdfParser/Makefile.am
===================================================================
--- E:/MgDev/OS/Common/MdfParser/Makefile.am (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/Makefile.am (revision 1038)
@@ -27,6 +27,7 @@
IOFill.cpp \
IOFontSymbol.cpp \
IOGridColor.cpp \
+ IOGridColorBands.cpp \
IOGridColorRule.cpp \
IOGridColorStyle.cpp \
IOGridLayerDefinition.cpp \
@@ -53,11 +54,13 @@
IOStroke.cpp \
IOSupplementalSpatialContextInfo.cpp \
IOSymbol.cpp \
+ IOUnknown.cpp \
IOUtil.cpp \
IOVectorLayerDefinition.cpp \
IOVectorScaleRange.cpp \
IOW2DSymbol.cpp \
MdfParser.cpp \
+ SAX2ElementHandler.cpp \
SAX2Parser.cpp
noinst_HEADERS = \
@@ -105,6 +108,7 @@
IOStroke.h \
IOSupplementalSpatialContextInfo.h \
IOSymbol.h \
+ IOUnknown.h \
IOUtil.h \
IOVectorLayerDefinition.h \
IOVectorScaleRange.h \
Index: E:/MgDev/OS/Common/MdfParser/IOAttributeRelate.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/IOAttributeRelate.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/IOAttributeRelate.cpp (revision 1038)
@@ -24,6 +24,16 @@
using namespace MDFMODEL_NAMESPACE;
using namespace MDFPARSER_NAMESPACE;
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, AttributeRelate);
+ELEM_MAP_ENTRY(2, RelateProperty);
+ELEM_MAP_ENTRY(3, AttributeClass);
+ELEM_MAP_ENTRY(4, ResourceId);
+ELEM_MAP_ENTRY(5, Name);
+ELEM_MAP_ENTRY(6, AttributeNameDelimiter);
+ELEM_MAP_ENTRY(7, RelateType);
+ELEM_MAP_ENTRY(8, ForceOneToOne);
+
IOAttributeRelate::IOAttributeRelate()
: m_pAttributeRelate(NULL), m_pExtension(NULL)
{
@@ -41,19 +51,29 @@
void IOAttributeRelate::StartElement(const wchar_t *name, HandlerStack
*handlerStack)
{
m_currElemName = name;
- if (m_currElemName == L"AttributeRelate") // NOXLATE
+ m_currElemId = _ElementIdFromName(name);
+
+ switch (m_currElemId)
{
+ case eAttributeRelate:
m_startElemName = name;
m_pAttributeRelate = new AttributeRelate();
- }
- else
- {
- if (m_currElemName == L"RelateProperty") // NOXLATE
+ break;
+
+ case eRelateProperty:
{
IORelateProperty *IO = new
IORelateProperty(this->m_pAttributeRelate);
handlerStack->push(IO);
IO->StartElement(name, handlerStack);
}
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+
+ default:
+ break;
}
}
@@ -77,6 +97,9 @@
{
if (m_startElemName == name)
{
+ if (!UnknownXml().empty())
+ this->m_pAttributeRelate->SetUnknownXml(UnknownXml());
+
m_pExtension->GetAttributeRelates()->Adopt(m_pAttributeRelate);
handlerStack->pop();
this->m_pAttributeRelate = NULL;
@@ -127,6 +150,12 @@
spIO->Write(fd,
pAttributeRelate->GetRelateProperties()->GetAt(x));
}
+ // Write any previously found unknown XML
+ if (!pAttributeRelate->GetUnknownXml().empty())
+ {
+ fd << toCString(pAttributeRelate->GetUnknownXml());
+ }
+
dectab();
fd << tab() << "</AttributeRelate>" << std::endl; // NOXLATE
}
Index: E:/MgDev/OS/Common/MdfParser/SAX2ElementHandler.h
===================================================================
--- E:/MgDev/OS/Common/MdfParser/SAX2ElementHandler.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/SAX2ElementHandler.h (revision 1038)
@@ -20,7 +20,9 @@
#include <string>
#include <stack>
+#include <vector>
#include "MdfParser.h"
+#include "UnicodeString.h"
using namespace XERCES_CPP_NAMESPACE;
using namespace MDFMODEL_NAMESPACE;
@@ -44,20 +46,57 @@
class MDFPARSER_API SAX2ElementHandler {
public:
- virtual ~SAX2ElementHandler() {};
+ virtual ~SAX2ElementHandler() {}
virtual void StartElement(const wchar_t *name, HandlerStack
*handlerStack) = 0;
virtual void ElementChars(const wchar_t *ch) = 0;
virtual void EndElement(const wchar_t *name, HandlerStack
*handlerStack) = 0;
protected:
+ void ParseUnknownXml(const wchar_t *name, HandlerStack
*handlerStack);
+ std::wstring& UnknownXml() { return m_unknownXml; }
+
+ std::wstring m_unknownXml;
+
// m_startElemName stores the name of the XML tag that
initiated
// the creation of this SAX2ElementHandler object.
std::wstring m_startElemName;
// m_currElemName stores the name of the last XML start tag.
std::wstring m_currElemName;
+ int m_currElemId;
};
+// For each element type, the following macros define a method,
_ElementIdFromName()
+// and two variables, eElementName - an integer ID which can be used in
case
+// statements, and sElementName - a std::string which can be used in
serialization.
+// CREATE_ELEMENT_MAP is called first, and then ELEM_MAP_ENTRY for each
element
+// type. The IDs provided to ELEM_MAP_ENTRY must be consecutive,
starting from 1.
+//
+#define CREATE_ELEMENT_MAP
\
+ static std::vector<std::wstring> _elementMap;
\
+ static std::string _CreateMapEntry(const wchar_t* wName, const
char* sName) \
+ {
\
+ _elementMap.push_back(wName);
\
+ return sName;
\
+ }
\
+ static int _ElementIdFromName(const wchar_t* name)
\
+ {
\
+ std::vector<std::wstring>::const_iterator iter =
_elementMap.begin(); \
+ int id = 1;
\
+ for (iter++; iter != _elementMap.end(); iter++)
\
+ {
\
+ if (0 == ::wcscmp(iter->c_str(), name))
\
+ return id;
\
+ id++;
\
+ }
\
+ return 0;
\
+ }
\
+ ELEM_MAP_ENTRY(0, Unknown)
+
+#define ELEM_MAP_ENTRY(ID, NAME)
\
+ static const std::string s##NAME = _CreateMapEntry(L###NAME,
#NAME); \
+ static const int e##NAME = ID
+
END_NAMESPACE_MDFPARSER
#endif // _SAX2ELEMENTHANDLER_H
Index: E:/MgDev/OS/Common/MdfParser/SAX2Parser.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfParser/SAX2Parser.cpp (revision 1037)
+++ E:/MgDev/OS/Common/MdfParser/SAX2Parser.cpp (revision 1038)
@@ -50,7 +50,6 @@
m_Parser = NULL;
m_HandlerStack = NULL;
m_tagOpen = false;
- m_charsInTag = false;
Flush();
Initialize();
@@ -95,7 +94,6 @@
m_Parser->setFeature(XMLUni::fgXercesSchemaFullChecking, false);
m_Parser->setFeature(XMLUni::fgSAX2CoreValidation, false); // true
for validation
m_Parser->setContentHandler(this);
- m_prevOpenTag = L"";
m_strbuffer = L"";
}
@@ -341,7 +339,9 @@
const Attributes& attributes)
{
std::wstring str = X2W(localname);
- m_openTag = str;
+ m_strbuffer = L""; // discard any text between start tags
+ m_tagOpen = true;
+
// If the stack is empty, then check to see if we've encountered
the
// start of one of the below definitions. Allocate space for the
object
// we will be creating, create the appropriate IO object, passing
in the reference
@@ -386,30 +386,16 @@
{
(m_HandlerStack->top())->StartElement(str.c_str(),
m_HandlerStack);
}
- m_tagOpen = true;
- m_charsInTag = false;
}
void SAX2Parser::characters(const XMLCh* const chars,
const unsigned int length)
{
- if (m_openTag.compare(m_prevOpenTag) != 0)
- {
- if (!m_HandlerStack->empty())
- {
- if (m_charsInTag)
-
(m_HandlerStack->top())->ElementChars(m_strbuffer.c_str());
- m_strbuffer = L"";
- }
- }
-
- m_strbuffer += X2W(chars);
-
- m_prevOpenTag = m_openTag;
-
+ // 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
if (m_tagOpen)
- m_charsInTag = true;
+ m_strbuffer += X2W(chars);
}
@@ -418,9 +404,15 @@
const XMLCh* const qname)
{
m_tagOpen = false;
- m_prevOpenTag = L"";
if (!m_HandlerStack->empty())
{
+ // Now is the time to make the ElementChars() call.
+ if (!m_strbuffer.empty())
+ {
+ (m_HandlerStack->top())->ElementChars(m_strbuffer.c_str());
+ m_strbuffer = L"";
+ }
+
(m_HandlerStack->top())->EndElement(X2W(localname),
m_HandlerStack);
}
}
Index: E:/MgDev/OS/Common/MdfModel/MdfRootObject.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/MdfRootObject.h (revision 0)
+++ E:/MgDev/OS/Common/MdfModel/MdfRootObject.h (revision 1038)
@@ -0,0 +1,54 @@
+//
+// Copyright (C) 2004-2006 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 MDFROOTOBJECT_H_
+#define MDFROOTOBJECT_H_
+
+#include "MdfModel.h"
+
+BEGIN_NAMESPACE_MDFMODEL
+
+
//----------------------------------------------------------------------
---
+ // DESCRIPTION:
+ // Common base class for all MdfModel classes. Provides support
for
+ // round-tripping unknown XML data from/to future schema versions.
+
//----------------------------------------------------------------------
---
+ class MDFMODEL_API MdfRootObject
+ {
+ public:
+ // Destruction
+ virtual ~MdfRootObject() {}
+
+ // Operations
+ // Property : UnknownXml
+ const MdfString& GetUnknownXml() const;
+ void SetUnknownXml(const MdfString& pstrUnknownXml);
+
+ protected:
+ // Construction, initialization
+ // Default constructor is protected to make this class
abstract.
+ MdfRootObject() {}
+
+ private:
+ // Data members
+ // Cache for parser, keeping unknown XML for round-tripping.
+ MdfString m_strUnknownXml;
+
+ };
+
+END_NAMESPACE_MDFMODEL
+#endif //MDFROOTOBJECT_H_
Property changes on: E:\MgDev\OS\Common\MdfModel\MdfRootObject.h
___________________________________________________________________
Name: svn:eol-style
+ native
Index: E:/MgDev/OS/Common/MdfModel/Stroke.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/Stroke.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/Stroke.h (revision 1038)
@@ -21,6 +21,7 @@
#include "MdfModel.h"
#include "SizeContexts.h"
#include "LengthConverter.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -30,7 +31,7 @@
// concrete classes are used by LineSymbolization and
AreaSymbolization to
// define the stylization for lines and polygon outlines.
//----------------------------------------------------------------------
---
- class MDFMODEL_API Stroke
+ class MDFMODEL_API Stroke : public MdfRootObject
{
public:
// Construction, destruction, initialization
Index: E:/MgDev/OS/Common/MdfModel/FeatureSource.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/FeatureSource.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/FeatureSource.h (revision 1038)
@@ -22,6 +22,7 @@
#include "NameStringPair.h"
#include "Extension.h"
#include "SupplementalSpatialContextInfo.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -31,7 +32,7 @@
// needed to connect to a feature source. It also contains extensions
that
// contain joins for the feature classes in the feature source.
//----------------------------------------------------------------------
---
- class MDFMODEL_API FeatureSource
+class MDFMODEL_API FeatureSource : public MdfRootObject
{
public:
// Construction, destruction, initialization
Index: E:/MgDev/OS/Common/MdfModel/GridColor.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/GridColor.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/GridColor.h (revision 1038)
@@ -20,6 +20,7 @@
#include <vector>
#include "ChannelBand.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -29,7 +30,7 @@
// The grid color is used to stylize the pixel using the given or
calculated
// color.
//----------------------------------------------------------------------
---
- class MDFMODEL_API GridColor
+ class MDFMODEL_API GridColor : public MdfRootObject
{
public:
virtual ~GridColor();
Index: E:/MgDev/OS/Common/MdfModel/Fill.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/Fill.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/Fill.h (revision 1038)
@@ -19,6 +19,7 @@
#define FILL_H_
#include "MdfModel.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -27,7 +28,7 @@
// Class Fill is an abstract base that defines how to color/paint
// feature geometry.
//---------------------------------------------------------------------
- class MDFMODEL_API Fill
+ class MDFMODEL_API Fill : public MdfRootObject
{
public:
// Construction, destruction, initialization
Index: E:/MgDev/OS/Common/MdfModel/MdfRootObject.cpp
===================================================================
--- E:/MgDev/OS/Common/MdfModel/MdfRootObject.cpp (revision 0)
+++ E:/MgDev/OS/Common/MdfModel/MdfRootObject.cpp (revision 1038)
@@ -0,0 +1,52 @@
+//
+// Copyright (C) 2004-2006 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
+//
+
+//---------------------------------------------------------------------
----
+// DESCRIPTION:
+// The MdfRootObject class implementation. MdfRootObject is an abstract
class.
+//---------------------------------------------------------------------
----
+
+#include "stdafx.h"
+#include "MdfRootObject.h"
+#include "Base64.h"
+
+using namespace MDFMODEL_NAMESPACE;
+
+//---------------------------------------------------------------------
----
+// PURPOSE: Accessor for the UnknownXml property cached by an XML
Parser.
+// The Xml stream is then serialized when writing to a future
+// schema version - to support round-tripping.
+// RETURNS:
+//---------------------------------------------------------------------
----
+const MdfString& MdfRootObject::GetUnknownXml()const
+{
+ return this->m_strUnknownXml;
+}
+
+//---------------------------------------------------------------------
----
+// PURPOSE: Accessor to the UnknownXml property cached in this
MdfRootObject
+// by an Xml Parser. It is stored here in case it is needed
+// during serialization.
+// PARAMETERS:
+// Input:
+// pstrUnknownXml - an Xml stream containing unknown elements.
+//---------------------------------------------------------------------
----
+void MdfRootObject::SetUnknownXml(const MdfString& strUnknownXml)
+{
+ this->m_strUnknownXml = strUnknownXml;
+}
+
Property changes on: E:\MgDev\OS\Common\MdfModel\MdfRootObject.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Index: E:/MgDev/OS/Common/MdfModel/Extension.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/Extension.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/Extension.h (revision 1038)
@@ -21,6 +21,7 @@
#include "MdfModel.h"
#include "AttributeRelate.h"
#include "CalculatedProperty.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -28,7 +29,7 @@
// DESCRIPTION:
// Extension class defines the joins between feature classes
//----------------------------------------------------------------------
---
- class MDFMODEL_API Extension
+class MDFMODEL_API Extension : public MdfRootObject
{
public:
// Construction, destruction, initialization
Index: E:/MgDev/OS/Common/MdfModel/Label.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/Label.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/Label.h (revision 1038)
@@ -20,6 +20,7 @@
#include "MdfModel.h"
#include "TextSymbol.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -31,7 +32,7 @@
// text label. Other types of Symbols can be used by themselves, or
in
// combination, to create more intricate labels.
//----------------------------------------------------------------------
---
- class MDFMODEL_API Label
+ class MDFMODEL_API Label : public MdfRootObject
{
public:
// Orientation Enum is used to control the orientation of a
Label with
Index: E:/MgDev/OS/Common/MdfModel/NameStringPair.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/NameStringPair.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/NameStringPair.h (revision 1038)
@@ -20,6 +20,7 @@
#include "MdfModel.h"
#include "MdfOwnerCollection.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -28,7 +29,7 @@
// Class NameStringPair represents a pair of strings. The first
is the
// name and the second is the associated text.
//
------------------------------------------------------------------------
- class MDFMODEL_API NameStringPair
+class MDFMODEL_API NameStringPair : public MdfRootObject
{
public:
//Constructors,
Index: E:/MgDev/OS/Common/MdfModel/LayerDefinition.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/LayerDefinition.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/LayerDefinition.h (revision 1038)
@@ -19,6 +19,7 @@
#define LAYERDEFINITION_H_
#include "MdfModel.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -31,7 +32,7 @@
// LayerDefinitions are encapsulated by MapLayer objects that make
up a Map. They
// are referenced primarily by their Uri.
//----------------------------------------------------------------------
---
- class MDFMODEL_API LayerDefinition
+class MDFMODEL_API LayerDefinition : public MdfRootObject
{
public:
// Construction, destruction, initialization
Index: E:/MgDev/OS/Common/MdfModel/VectorScaleRange.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/VectorScaleRange.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/VectorScaleRange.h (revision 1038)
@@ -21,6 +21,7 @@
#include "MdfModel.h"
#include "MdfOwnerCollection.h"
#include "FeatureTypeStyle.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -33,7 +34,7 @@
// collection. Each will result in the drawing of some of the
layer's geometric
// primitives and/or their labels.
//----------------------------------------------------------------------
---
- class MDFMODEL_API VectorScaleRange
+class MDFMODEL_API VectorScaleRange : public MdfRootObject
{
public:
// Represents the maximum value for the map scale.
Index: E:/MgDev/OS/Common/MdfModel/Symbolization.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/Symbolization.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/Symbolization.h (revision 1038)
@@ -19,6 +19,7 @@
#define SYMBOLIZATION_H_
#include "MdfModel.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -29,7 +30,7 @@
// Class Fill is an abstract base that defines how to color/paint
// feature geometry.
//---------------------------------------------------------------------
- class MDFMODEL_API Symbolization
+ class MDFMODEL_API Symbolization : public MdfRootObject
{
public:
// Construction, destruction, initialization
Index: E:/MgDev/OS/Common/MdfModel/MdfModel.vcproj
===================================================================
--- E:/MgDev/OS/Common/MdfModel/MdfModel.vcproj (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/MdfModel.vcproj (revision 1038)
@@ -514,6 +514,14 @@
>
</File>
<File
+ RelativePath=".\MdfRootObject.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\MdfRootObject.h"
+ >
+ </File>
+ <File
RelativePath=".\NameStringPair.cpp"
>
</File>
Index: E:/MgDev/OS/Common/MdfModel/SupplementalSpatialContextInfo.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/SupplementalSpatialContextInfo.h
(revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/SupplementalSpatialContextInfo.h
(revision 1038)
@@ -20,6 +20,7 @@
#include "MdfModel.h"
#include "MdfOwnerCollection.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -29,7 +30,7 @@
// for a spatial context when the coordinate system is missing
from the
// feature source.
//
------------------------------------------------------------------------
- class MDFMODEL_API SupplementalSpatialContextInfo
+class MDFMODEL_API SupplementalSpatialContextInfo : public
MdfRootObject
{
public:
//Constructors,
Index: E:/MgDev/OS/Common/MdfModel/GridScaleRange.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/GridScaleRange.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/GridScaleRange.h (revision 1038)
@@ -23,6 +23,7 @@
#include "GridSurfaceStyle.h"
#include "GridColorStyle.h"
#include <vector>
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -35,7 +36,7 @@
// collection. Each will result in the drawing of some of the
layer's geometric
// primitives and/or their labels.
//----------------------------------------------------------------------
---
- class MDFMODEL_API GridScaleRange
+ class MDFMODEL_API GridScaleRange : public MdfRootObject
{
public:
// Represents the maximum value for the map scale.
Index: E:/MgDev/OS/Common/MdfModel/RelateProperty.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/RelateProperty.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/RelateProperty.h (revision 1038)
@@ -20,6 +20,7 @@
#include "MdfModel.h"
#include "MdfOwnerCollection.h"
+#include "MdfRootObject.h"
namespace MdfModel
{
@@ -29,7 +30,7 @@
// RelateProperty class defines the calculated properties from
attributes
// from the same feature class
//----------------------------------------------------------------------
---
- class MDFMODEL_API RelateProperty
+ class MDFMODEL_API RelateProperty : public MdfRootObject
{
public:
// Construction, destruction, initialization
Index: E:/MgDev/OS/Common/MdfModel/ChannelBand.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/ChannelBand.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/ChannelBand.h (revision 1038)
@@ -19,6 +19,7 @@
#define CHANNELBAND_H_
#include <vector>
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -27,7 +28,7 @@
// Class ChannelBand is used to map the band's value to a valid
color channel value.
// It defines how to scale numbers into a color channel.
//----------------------------------------------------------------------
-------
- class MDFMODEL_API ChannelBand
+ class MDFMODEL_API ChannelBand : public MdfRootObject
{
public:
ChannelBand();
Index: E:/MgDev/OS/Common/MdfModel/HillShade.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/HillShade.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/HillShade.h (revision 1038)
@@ -19,6 +19,7 @@
#define HILLSHADE_H_
#include <vector>
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -27,7 +28,7 @@
// Class HillShade is used to specify how to shade given a band and
a light
// source.
//----------------------------------------------------------------------
---
- class MDFMODEL_API HillShade
+ class MDFMODEL_API HillShade : public MdfRootObject
{
public:
HillShade();
Index: E:/MgDev/OS/Common/MdfModel/AttributeRelate.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/AttributeRelate.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/AttributeRelate.h (revision 1038)
@@ -20,6 +20,7 @@
#include "MdfModel.h"
#include "RelateProperty.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -28,7 +29,7 @@
// AttributeRelate class defines the attribute class in the target
feature
// source
//----------------------------------------------------------------------
---
- class MDFMODEL_API AttributeRelate
+class MDFMODEL_API AttributeRelate : public MdfRootObject
{
public:
Index: E:/MgDev/OS/Common/MdfModel/Symbol.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/Symbol.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/Symbol.h (revision 1038)
@@ -21,6 +21,7 @@
#include "MdfModel.h"
#include "SizeContexts.h"
#include "LengthConverter.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -32,7 +33,7 @@
// point geometric primitives. Its use of expressions for its
properties
// allows it to support multivariate theming. Symbol is an abstract
class.
//----------------------------------------------------------------------
---
- class MDFMODEL_API Symbol
+ class MDFMODEL_API Symbol : public MdfRootObject
{
public:
Index: E:/MgDev/OS/Common/MdfModel/CalculatedProperty.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/CalculatedProperty.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/CalculatedProperty.h (revision 1038)
@@ -20,6 +20,7 @@
#include "MdfModel.h"
#include "MdfOwnerCollection.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -28,7 +29,7 @@
// CalculatedProperty class defines the calculated properties from
attributes
// from the same feature class
//----------------------------------------------------------------------
---
- class MDFMODEL_API CalculatedProperty
+class MDFMODEL_API CalculatedProperty : public MdfRootObject
{
public:
// Construction, destruction, initialization
Index: E:/MgDev/OS/Common/MdfModel/Rule.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/Rule.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/Rule.h (revision 1038)
@@ -21,6 +21,7 @@
#include "MdfModel.h"
#include "MdfOwnerCollection.h"
#include "Label.h"
+#include "MdfRootObject.h"
namespace MdfParser
{
@@ -39,7 +40,7 @@
// Filtering criteria takes the form of a tree that uses logical
operators
// to combine attribute-based and geometry-based filters.
//----------------------------------------------------------------------
---
- class MDFMODEL_API Rule
+class MDFMODEL_API Rule : public MdfRootObject
{
friend class MdfParser::IOAreaRule;
friend class MdfParser::IOLineRule;
Index: E:/MgDev/OS/Common/MdfModel/FeatureTypeStyle.h
===================================================================
--- E:/MgDev/OS/Common/MdfModel/FeatureTypeStyle.h (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/FeatureTypeStyle.h (revision 1038)
@@ -21,6 +21,7 @@
#include "MdfModel.h"
#include "MdfOwnerCollection.h"
#include "Rule.h"
+#include "MdfRootObject.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -35,7 +36,7 @@
// It is possible for FeatureTypeStyle's concrete classes to
contain
// only Labels.
//----------------------------------------------------------------------
---
- class MDFMODEL_API FeatureTypeStyle
+ class MDFMODEL_API FeatureTypeStyle : public MdfRootObject
{
public:
// Construction, destruction, initialization.
Index: E:/MgDev/OS/Common/MdfModel/Makefile.am
===================================================================
--- E:/MgDev/OS/Common/MdfModel/Makefile.am (revision 1037)
+++ E:/MgDev/OS/Common/MdfModel/Makefile.am (revision 1038)
@@ -43,6 +43,7 @@
MapLayerGroupCommon.cpp \
MarkSymbol.cpp \
MdfModel.cpp \
+ MdfRootObject.cpp \
NameStringPair.cpp \
PointRule.cpp \
PointSymbolization2D.cpp \
@@ -104,6 +105,7 @@
MarkSymbol.h \
MdfModel.h \
MdfOwnerCollection.h \
+ MdfRootObject.h \
NameStringPair.h \
PointRule.h \
PointSymbolization2D.h \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070108/bf52c4df/attachment-0001.html
More information about the Mapguide_dev
mailing list