115 | | A few changes would be required to the internal stylization interfaces in order to pass the elevation settings through the framework to the Stylize() methods of the affected !GeometryAdapters. Inside these methods, the offset and extrusion expressions would be evaluated for the current feature, and the resulting floating point values would be passed as additional parameters into the Renderer::!StartFeature() command. The method signature chages are as follows: |
116 | | |
117 | | '''GeometryAdapter::Stylize()''' would be modified from this: |
118 | | {{{ |
119 | | virtual void Stylize(Renderer* /*renderer*/, |
120 | | RS_FeatureReader* /*features*/, |
121 | | RS_FilterExecutor* /*exec*/, |
122 | | LineBuffer* /*lb*/, |
123 | | MdfModel::FeatureTypeStyle* /*style*/, |
124 | | const MdfModel::MdfString* /*tooltip = NULL*/, |
125 | | const MdfModel::MdfString* /*url = NULL*/) |
126 | | }}} |
127 | | to this: |
128 | | {{{ |
129 | | virtual void Stylize(Renderer* /*renderer*/, |
130 | | RS_FeatureReader* /*features*/, |
131 | | RS_FilterExecutor* /*exec*/, |
132 | | LineBuffer* /*lb*/, |
133 | | MdfModel::FeatureTypeStyle* /*style*/, |
134 | | const MdfModel::MdfString* /*tooltip = NULL*/, |
135 | | const MdfModel::MdfString* /*url = NULL*/, |
136 | | RS_ElevationSettings* /*elevSettings = NULL*/) |
137 | | }}} |
138 | | where RS_ElevationSettings is a simple struct-like class that contains the elevation settings. |
139 | | |
140 | | '''Renderer::!StartFeature()''' would be modified from this: |
141 | | {{{ |
142 | | virtual void StartFeature (RS_FeatureReader* feature, |
143 | | const RS_String* tooltip = NULL, |
144 | | const RS_String* url = NULL, |
145 | | const RS_String* theme = NULL) = 0; |
146 | | }}} |
147 | | to this: |
148 | | {{{ |
149 | | virtual void StartFeature (RS_FeatureReader* feature, |
150 | | const RS_String* tooltip = NULL, |
151 | | const RS_String* url = NULL, |
152 | | const RS_String* theme = NULL, |
153 | | double zOffset = 0, |
154 | | double zExtrusion = 0, |
155 | | RS_ElevationType zOffsetType = RS_ElevationType_RelativeToGround) = 0; |
156 | | }}} |
157 | | |
158 | | All concrete classes that inherit from !GeometryAdapter would need to be updated to use the new Stylize() method signature. |
159 | | |
160 | | All concrete classes that implement the Renderer interface would need to be updated to reflect the changes, though only !KmlRenderer would currently make use of the new parameters. |
161 | | |
162 | | ==== !KmlRenderer Modifications ==== |
163 | | |
164 | | The KML Service generates KML using the !KmlRenderer class - a concrete implementation of the Renderer interface. This class would be updated to set the Z coordinate of the generated geometries to be equal to (zOffset + zExtrusion). Also, if zExtrusion > 0, we would write out the KML element <extrude>1</extrude> to indicate that the features should be extruded down to the ground. If zOffset > 0, we will stil extrude the features down to the ground level, since Google Earth does not currently provide a means for rendering floating extruded objects. |
| 137 | The Stylization project would be modified to make the necessary elevation settings available to the !KmlRenderer class that generates KML output for the KML Service. This class would be updated to set the Z coordinate of the generated geometries to be equal to (zOffset + zExtrusion). Also, if zExtrusion > 0, we would write out the KML element <extrude>1</extrude> to indicate that the features should be extruded down to the ground. If zOffset > 0, we will stil extrude the features down to the ground level, since Google Earth does not currently provide a means for rendering floating extruded objects. |