49 QList<LayerData>::iterator v_it =
mLayerData.begin();
53 if ( v_it->vectorLayer == 0 )
65 if ( !v_it->zCoordInterpolation )
67 attList.push_back( v_it->interpolationAttribute );
71 double attributeValue = 0.0;
72 bool attributeConversionOk =
false;
79 if ( !v_it->zCoordInterpolation )
81 QVariant attributeVariant = theFeature.
attribute( v_it->interpolationAttribute );
82 if ( !attributeVariant.isValid() )
86 attributeValue = attributeVariant.toDouble( &attributeConversionOk );
87 if ( !attributeConversionOk || qIsNaN( attributeValue ) )
110 bool hasZValue =
false;
111 const unsigned char* currentWkbPtr = geom->
asWkb();
121 currentWkbPtr += ( 1 +
sizeof( int ) );
122 theVertex.
x = *((
double * )( currentWkbPtr ) );
123 currentWkbPtr +=
sizeof( double );
124 theVertex.
y = *((
double * )( currentWkbPtr ) );
125 if ( zCoord && hasZValue )
127 currentWkbPtr +=
sizeof( double );
128 theVertex.
z = *((
double * )( currentWkbPtr ) );
132 theVertex.
z = attributeValue;
141 currentWkbPtr += ( 1 +
sizeof( int ) );
142 int* npoints = (
int* )currentWkbPtr;
143 currentWkbPtr +=
sizeof( int );
144 for (
int index = 0; index < *npoints; ++index )
146 theVertex.
x = *((
double * )( currentWkbPtr ) );
147 currentWkbPtr +=
sizeof( double );
148 theVertex.
y = *((
double * )( currentWkbPtr ) );
149 currentWkbPtr +=
sizeof( double );
150 if ( zCoord && hasZValue )
152 theVertex.
z = *((
double * )( currentWkbPtr ) );
153 currentWkbPtr +=
sizeof( double );
157 theVertex.
z = attributeValue;
168 int* nrings = (
int* )( mGeometry + 5 );
170 unsigned char* ptr = mGeometry + 9;
171 for (
int index = 0; index < *nrings; ++index )
173 npoints = (
int* )ptr;
174 ptr +=
sizeof( int );
175 for (
int index2 = 0; index2 < *npoints; ++index2 )
177 tempx = (
double* )ptr;
178 ptr +=
sizeof( double );
179 tempy = (
double* )ptr;
180 if ( point.sqrDist( *tempx, *tempy ) < actdist )
184 actdist = point.sqrDist( *tempx, *tempy );
185 vertexnr = vertexcounter;
189 beforeVertex = vertexcounter + ( *npoints - 2 );
190 afterVertex = vertexcounter + 1;
192 else if ( index2 == ( *npoints - 1 ) )
194 beforeVertex = vertexcounter - 1;
195 afterVertex = vertexcounter - ( *npoints - 2 );
199 beforeVertex = vertexcounter - 1;
200 afterVertex = vertexcounter + 1;
203 ptr +=
sizeof( double );
206 ptr +=
sizeof( double );
217 unsigned char* ptr = mGeometry + 5;
218 int* npoints = (
int* )ptr;
219 ptr +=
sizeof( int );
220 for (
int index = 0; index < *npoints; ++index )
222 ptr += ( 1 +
sizeof( int ) );
223 tempx = (
double* )ptr;
224 tempy = (
double* )( ptr +
sizeof(
double ) );
225 if ( point.sqrDist( *tempx, *tempy ) < actdist )
229 actdist = point.sqrDist( *tempx, *tempy );
232 ptr += ( 2 *
sizeof( double ) );
235 ptr +=
sizeof( double );
244 unsigned char* ptr = mGeometry + 5;
245 int* nlines = (
int* )ptr;
247 ptr +=
sizeof( int );
248 for (
int index = 0; index < *nlines; ++index )
250 ptr += (
sizeof( int ) + 1 );
251 npoints = (
int* )ptr;
252 ptr +=
sizeof( int );
253 for (
int index2 = 0; index2 < *npoints; ++index2 )
255 tempx = (
double* )ptr;
256 ptr +=
sizeof( double );
257 tempy = (
double* )ptr;
258 ptr +=
sizeof( double );
259 if ( point.sqrDist( *tempx, *tempy ) < actdist )
263 actdist = point.sqrDist( *tempx, *tempy );
264 vertexnr = vertexcounter;
272 beforeVertex = vertexnr - 1;
274 if ( index2 == ( *npoints ) - 1 )
280 afterVertex = vertexnr + 1;
285 ptr +=
sizeof( double );
296 unsigned char* ptr = mGeometry + 5;
297 int* npolys = (
int* )ptr;
300 ptr +=
sizeof( int );
301 for (
int index = 0; index < *npolys; ++index )
303 ptr += ( 1 +
sizeof( int ) );
304 nrings = (
int* )ptr;
305 ptr +=
sizeof( int );
306 for (
int index2 = 0; index2 < *nrings; ++index2 )
308 npoints = (
int* )ptr;
309 ptr +=
sizeof( int );
310 for (
int index3 = 0; index3 < *npoints; ++index3 )
312 tempx = (
double* )ptr;
313 ptr +=
sizeof( double );
314 tempy = (
double* )ptr;
315 if ( point.sqrDist( *tempx, *tempy ) < actdist )
319 actdist = point.sqrDist( *tempx, *tempy );
320 vertexnr = vertexcounter;
325 beforeVertex = vertexcounter + ( *npoints - 2 );
326 afterVertex = vertexcounter + 1;
328 else if ( index3 == ( *npoints - 1 ) )
330 beforeVertex = vertexcounter - 1;
331 afterVertex = vertexcounter - ( *npoints - 2 );
335 beforeVertex = vertexcounter - 1;
336 afterVertex = vertexcounter + 1;
339 ptr +=
sizeof( double );
342 ptr +=
sizeof( double );