| 1191 | | /*********************************** Non-ptr code ********************************/ |
|---|
| 1192 | | void QuadTreeTerrainBase::pushToHeightError(const Real32& value) |
|---|
| 1193 | | { |
|---|
| 1194 | | editMField(HeightErrorFieldMask, _mfHeightError); |
|---|
| 1195 | | _mfHeightError.push_back(value); |
|---|
| 1196 | | } |
|---|
| 1197 | | |
|---|
| 1198 | | void QuadTreeTerrainBase::insertIntoHeightError(UInt32 uiIndex, |
|---|
| 1199 | | const Real32& value ) |
|---|
| 1200 | | { |
|---|
| 1201 | | editMField(HeightErrorFieldMask, _mfHeightError); |
|---|
| 1202 | | |
|---|
| 1203 | | MFReal32::iterator fieldIt = _mfHeightError.begin(); |
|---|
| 1204 | | |
|---|
| 1205 | | fieldIt += uiIndex; |
|---|
| 1206 | | |
|---|
| 1207 | | _mfHeightError.insert(fieldIt, value); |
|---|
| 1208 | | } |
|---|
| 1209 | | |
|---|
| 1210 | | void QuadTreeTerrainBase::replaceInHeightError(UInt32 uiIndex, |
|---|
| 1211 | | const Real32& value ) |
|---|
| 1212 | | { |
|---|
| 1213 | | if(uiIndex >= _mfHeightError.size()) |
|---|
| 1214 | | return; |
|---|
| 1215 | | |
|---|
| 1216 | | editMField(HeightErrorFieldMask, _mfHeightError); |
|---|
| 1217 | | |
|---|
| 1218 | | _mfHeightError[uiIndex] = value; |
|---|
| 1219 | | } |
|---|
| 1220 | | |
|---|
| 1221 | | void QuadTreeTerrainBase::replaceInHeightError(const Real32& pOldElem, |
|---|
| 1222 | | const Real32& pNewElem) |
|---|
| 1223 | | { |
|---|
| 1224 | | Int32 elemIdx = _mfHeightError.findIndex(pOldElem); |
|---|
| 1225 | | |
|---|
| 1226 | | if(elemIdx != -1) |
|---|
| 1227 | | { |
|---|
| 1228 | | editMField(HeightErrorFieldMask, _mfHeightError); |
|---|
| 1229 | | |
|---|
| 1230 | | MFReal32::iterator fieldIt = _mfHeightError.begin(); |
|---|
| 1231 | | |
|---|
| 1232 | | fieldIt += elemIdx; |
|---|
| 1233 | | |
|---|
| 1234 | | (*fieldIt) = pNewElem; |
|---|
| 1235 | | } |
|---|
| 1236 | | } |
|---|
| 1237 | | |
|---|
| 1238 | | void QuadTreeTerrainBase::removeFromHeightError(UInt32 uiIndex) |
|---|
| 1239 | | { |
|---|
| 1240 | | if(uiIndex < _mfHeightError.size()) |
|---|
| 1241 | | { |
|---|
| 1242 | | editMField(HeightErrorFieldMask, _mfHeightError); |
|---|
| 1243 | | |
|---|
| 1244 | | MFReal32::iterator fieldIt = _mfHeightError.begin(); |
|---|
| 1245 | | |
|---|
| 1246 | | fieldIt += uiIndex; |
|---|
| 1247 | | _mfHeightError.erase(fieldIt); |
|---|
| 1248 | | } |
|---|
| 1249 | | } |
|---|
| 1250 | | |
|---|
| 1251 | | void QuadTreeTerrainBase::removeFromHeightError(const Real32& value) |
|---|
| 1252 | | { |
|---|
| 1253 | | Int32 iElemIdx = _mfHeightError.findIndex(value); |
|---|
| 1254 | | |
|---|
| 1255 | | if(iElemIdx != -1) |
|---|
| 1256 | | { |
|---|
| 1257 | | editMField(HeightErrorFieldMask, _mfHeightError); |
|---|
| 1258 | | |
|---|
| 1259 | | MFReal32::iterator fieldIt = _mfHeightError.begin(); |
|---|
| 1260 | | |
|---|
| 1261 | | fieldIt += iElemIdx; |
|---|
| 1262 | | |
|---|
| 1263 | | _mfHeightError.erase(fieldIt); |
|---|
| 1264 | | } |
|---|
| 1265 | | } |
|---|
| 1266 | | |
|---|
| 1267 | | void QuadTreeTerrainBase::clearHeightError(void) |
|---|
| 1268 | | { |
|---|
| 1269 | | editMField(HeightErrorFieldMask, _mfHeightError); |
|---|
| 1270 | | |
|---|
| 1271 | | _mfHeightError.clear(); |
|---|
| 1272 | | } |
|---|
| 1273 | | /*********************************** Non-ptr code ********************************/ |
|---|
| 1274 | | void QuadTreeTerrainBase::pushToHeightQuad(const Real32& value) |
|---|
| 1275 | | { |
|---|
| 1276 | | editMField(HeightQuadFieldMask, _mfHeightQuad); |
|---|
| 1277 | | _mfHeightQuad.push_back(value); |
|---|
| 1278 | | } |
|---|
| 1279 | | |
|---|
| 1280 | | void QuadTreeTerrainBase::insertIntoHeightQuad(UInt32 uiIndex, |
|---|
| 1281 | | const Real32& value ) |
|---|
| 1282 | | { |
|---|
| 1283 | | editMField(HeightQuadFieldMask, _mfHeightQuad); |
|---|
| 1284 | | |
|---|
| 1285 | | MFReal32::iterator fieldIt = _mfHeightQuad.begin(); |
|---|
| 1286 | | |
|---|
| 1287 | | fieldIt += uiIndex; |
|---|
| 1288 | | |
|---|
| 1289 | | _mfHeightQuad.insert(fieldIt, value); |
|---|
| 1290 | | } |
|---|
| 1291 | | |
|---|
| 1292 | | void QuadTreeTerrainBase::replaceInHeightQuad(UInt32 uiIndex, |
|---|
| 1293 | | const Real32& value ) |
|---|
| 1294 | | { |
|---|
| 1295 | | if(uiIndex >= _mfHeightQuad.size()) |
|---|
| 1296 | | return; |
|---|
| 1297 | | |
|---|
| 1298 | | editMField(HeightQuadFieldMask, _mfHeightQuad); |
|---|
| 1299 | | |
|---|
| 1300 | | _mfHeightQuad[uiIndex] = value; |
|---|
| 1301 | | } |
|---|
| 1302 | | |
|---|
| 1303 | | void QuadTreeTerrainBase::replaceInHeightQuad(const Real32& pOldElem, |
|---|
| 1304 | | const Real32& pNewElem) |
|---|
| 1305 | | { |
|---|
| 1306 | | Int32 elemIdx = _mfHeightQuad.findIndex(pOldElem); |
|---|
| 1307 | | |
|---|
| 1308 | | if(elemIdx != -1) |
|---|
| 1309 | | { |
|---|
| 1310 | | editMField(HeightQuadFieldMask, _mfHeightQuad); |
|---|
| 1311 | | |
|---|
| 1312 | | MFReal32::iterator fieldIt = _mfHeightQuad.begin(); |
|---|
| 1313 | | |
|---|
| 1314 | | fieldIt += elemIdx; |
|---|
| 1315 | | |
|---|
| 1316 | | (*fieldIt) = pNewElem; |
|---|
| 1317 | | } |
|---|
| 1318 | | } |
|---|
| 1319 | | |
|---|
| 1320 | | void QuadTreeTerrainBase::removeFromHeightQuad(UInt32 uiIndex) |
|---|
| 1321 | | { |
|---|
| 1322 | | if(uiIndex < _mfHeightQuad.size()) |
|---|
| 1323 | | { |
|---|
| 1324 | | editMField(HeightQuadFieldMask, _mfHeightQuad); |
|---|
| 1325 | | |
|---|
| 1326 | | MFReal32::iterator fieldIt = _mfHeightQuad.begin(); |
|---|
| 1327 | | |
|---|
| 1328 | | fieldIt += uiIndex; |
|---|
| 1329 | | _mfHeightQuad.erase(fieldIt); |
|---|
| 1330 | | } |
|---|
| 1331 | | } |
|---|
| 1332 | | |
|---|
| 1333 | | void QuadTreeTerrainBase::removeFromHeightQuad(const Real32& value) |
|---|
| 1334 | | { |
|---|
| 1335 | | Int32 iElemIdx = _mfHeightQuad.findIndex(value); |
|---|
| 1336 | | |
|---|
| 1337 | | if(iElemIdx != -1) |
|---|
| 1338 | | { |
|---|
| 1339 | | editMField(HeightQuadFieldMask, _mfHeightQuad); |
|---|
| 1340 | | |
|---|
| 1341 | | MFReal32::iterator fieldIt = _mfHeightQuad.begin(); |
|---|
| 1342 | | |
|---|
| 1343 | | fieldIt += iElemIdx; |
|---|
| 1344 | | |
|---|
| 1345 | | _mfHeightQuad.erase(fieldIt); |
|---|
| 1346 | | } |
|---|
| 1347 | | } |
|---|
| 1348 | | |
|---|
| 1349 | | void QuadTreeTerrainBase::clearHeightQuad(void) |
|---|
| 1350 | | { |
|---|
| 1351 | | editMField(HeightQuadFieldMask, _mfHeightQuad); |
|---|
| 1352 | | |
|---|
| 1353 | | _mfHeightQuad.clear(); |
|---|
| 1354 | | } |
|---|