| 268 | | void ChunkMaterialBase::insertIntoChunks( UInt32 uiIndex, |
|---|
| 269 | | const StateChunkPtr value ) |
|---|
| 270 | | { |
|---|
| 271 | | if(value == NullFC) |
|---|
| 272 | | return; |
|---|
| 273 | | |
|---|
| 274 | | editMField(ChunksFieldMask, _mfChunks); |
|---|
| 275 | | |
|---|
| 276 | | MFUnrecStateChunkPtr::iterator fieldIt = _mfChunks.begin_nc(); |
|---|
| 277 | | |
|---|
| 278 | | //addRef(value); |
|---|
| 279 | | |
|---|
| 280 | | fieldIt += uiIndex; |
|---|
| 281 | | |
|---|
| 282 | | _mfChunks.insert(fieldIt, value); |
|---|
| 283 | | } |
|---|
| 284 | | |
|---|
| 285 | | void ChunkMaterialBase::replaceInChunks( UInt32 uiIndex, |
|---|
| 286 | | const StateChunkPtr value ) |
|---|
| 287 | | { |
|---|
| 288 | | if(value == NullFC) |
|---|
| 289 | | return; |
|---|
| 290 | | |
|---|
| 291 | | if(uiIndex >= _mfChunks.size()) |
|---|
| 292 | | return; |
|---|
| 293 | | |
|---|
| 294 | | editMField(ChunksFieldMask, _mfChunks); |
|---|
| 295 | | |
|---|
| 296 | | |
|---|
| 297 | | // addRef(value); |
|---|
| 298 | | // subRef(_mfChunks[uiIndex]); |
|---|
| 299 | | |
|---|
| 300 | | // _mfChunks[uiIndex] = value; |
|---|
| 301 | | |
|---|
| 302 | | _mfChunks.replace(uiIndex, value); |
|---|
| 303 | | } |
|---|
| 304 | | |
|---|
| 305 | | void ChunkMaterialBase::replaceInChunks(const StateChunkPtr pOldElem, |
|---|
| 306 | | const StateChunkPtr pNewElem) |
|---|
| 307 | | { |
|---|
| 308 | | if(pNewElem == NullFC) |
|---|
| 309 | | return; |
|---|
| 310 | | |
|---|
| 311 | | Int32 elemIdx = _mfChunks.findIndex(pOldElem); |
|---|
| 312 | | |
|---|
| 313 | | if(elemIdx != -1) |
|---|
| | 270 | void ChunkMaterialBase::removeFromChunks(UInt32 uiIndex) |
|---|
| | 271 | { |
|---|
| | 272 | if(uiIndex < _mfChunks.size()) |
|---|
| 317 | | // MFStateChunkPtr::iterator fieldIt = _mfChunks.begin(); |
|---|
| 318 | | |
|---|
| 319 | | // fieldIt += elemIdx; |
|---|
| 320 | | // addRef(pNewElem); |
|---|
| 321 | | // subRef(pOldElem); |
|---|
| 322 | | |
|---|
| 323 | | // (*fieldIt) = pNewElem; |
|---|
| 324 | | _mfChunks.replace(elemIdx, pNewElem); |
|---|
| 325 | | } |
|---|
| 326 | | } |
|---|
| 327 | | |
|---|
| 328 | | void ChunkMaterialBase::removeFromChunks(UInt32 uiIndex) |
|---|
| 329 | | { |
|---|
| 330 | | if(uiIndex < _mfChunks.size()) |
|---|
| | 276 | MFUnrecStateChunkPtr::iterator fieldIt = _mfChunks.begin_nc(); |
|---|
| | 277 | |
|---|
| | 278 | fieldIt += uiIndex; |
|---|
| | 279 | |
|---|
| | 280 | _mfChunks.erase(fieldIt); |
|---|
| | 281 | } |
|---|
| | 282 | } |
|---|
| | 283 | |
|---|
| | 284 | void ChunkMaterialBase::removeFromChunks(const StateChunkPtr value) |
|---|
| | 285 | { |
|---|
| | 286 | Int32 iElemIdx = _mfChunks.findIndex(value); |
|---|
| | 287 | |
|---|
| | 288 | if(iElemIdx != -1) |
|---|