1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
42 ** This file is automatically generated. **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
47 ** Do not change this file, changes should be done in the derived **
48 ** class TiledQuadTreeTerrain!
50 *****************************************************************************
51 \*****************************************************************************/
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
61 #include "OSGConfig.h"
65 #include "OSGImage.h" // HeightTiles Class
66 #include "OSGMaterial.h" // HeightTextures Class
68 #include "OSGTiledQuadTreeTerrainBase.h"
69 #include "OSGTiledQuadTreeTerrain.h"
71 #include <boost/bind.hpp>
75 /***************************************************************************\
77 \***************************************************************************/
79 /*! \class OSG::TiledQuadTreeTerrain
80 Tiled terrain node core.
83 /***************************************************************************\
84 * Field Documentation *
85 \***************************************************************************/
87 /*! \var Image * TiledQuadTreeTerrainBase::_mfHeightTiles
91 /*! \var Material * TiledQuadTreeTerrainBase::_mfHeightTextures
95 /*! \var UInt32 TiledQuadTreeTerrainBase::_sfSizeX
96 x-size of 2-dimensional tile array.
99 /*! \var UInt32 TiledQuadTreeTerrainBase::_sfSizeY
100 y-size of 2-dimensional tile array.
103 /*! \var Real32 TiledQuadTreeTerrainBase::_sfHeightScale
107 /*! \var Real32 TiledQuadTreeTerrainBase::_sfVertexSpacing
111 /*! \var bool TiledQuadTreeTerrainBase::_sfGeoMorphing
115 /*! \var Real32 TiledQuadTreeTerrainBase::_sfDetail
116 Detail of terrain tesselation.
119 /*! \var Int32 TiledQuadTreeTerrainBase::_sfCurrentX
123 /*! \var Int32 TiledQuadTreeTerrainBase::_sfCurrentY
127 /*! \var Int32 TiledQuadTreeTerrainBase::_sfSizeROI
128 Number of tiles (0, 1, 2, 3) around current eye point.
131 /*! \var bool TiledQuadTreeTerrainBase::_sfUpdate
132 Perform any updates (tiling, terrain tiles).
135 /*! \var bool TiledQuadTreeTerrainBase::_sfUpdateTerrain
136 Update terrain tiles in the next frame.
139 /*! \var bool TiledQuadTreeTerrainBase::_sfPerPixelLighting
140 Do per-pixel lighting with normalmap; otherwise generate per-vertex normals.
144 /***************************************************************************\
145 * FieldType/FieldTrait Instantiation *
146 \***************************************************************************/
148 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
149 PointerType FieldTraits
<TiledQuadTreeTerrain
*, nsOSG
>::_type(
150 "TiledQuadTreeTerrainPtr",
152 TiledQuadTreeTerrain::getClassType(),
156 OSG_FIELDTRAITS_GETTYPE_NS(TiledQuadTreeTerrain
*, nsOSG
)
158 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
159 TiledQuadTreeTerrain
*,
162 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
163 TiledQuadTreeTerrain
*,
166 /***************************************************************************\
167 * Field Description *
168 \***************************************************************************/
170 void TiledQuadTreeTerrainBase::classDescInserter(TypeObject
&oType
)
172 FieldDescriptionBase
*pDesc
= NULL
;
175 pDesc
= new MFUnrecImagePtr::Description(
176 MFUnrecImagePtr::getClassType(),
178 "Terrain tile array.\n",
179 HeightTilesFieldId
, HeightTilesFieldMask
,
181 (Field::MFDefaultFlags
| Field::FStdAccess
),
182 static_cast<FieldEditMethodSig
>(&TiledQuadTreeTerrain::editHandleHeightTiles
),
183 static_cast<FieldGetMethodSig
>(&TiledQuadTreeTerrain::getHandleHeightTiles
));
185 oType
.addInitialDesc(pDesc
);
187 pDesc
= new MFUnrecMaterialPtr::Description(
188 MFUnrecMaterialPtr::getClassType(),
190 "Terrain textures.\n",
191 HeightTexturesFieldId
, HeightTexturesFieldMask
,
193 (Field::MFDefaultFlags
| Field::FStdAccess
),
194 static_cast<FieldEditMethodSig
>(&TiledQuadTreeTerrain::editHandleHeightTextures
),
195 static_cast<FieldGetMethodSig
>(&TiledQuadTreeTerrain::getHandleHeightTextures
));
197 oType
.addInitialDesc(pDesc
);
199 pDesc
= new SFUInt32::Description(
200 SFUInt32::getClassType(),
202 "x-size of 2-dimensional tile array.\n",
203 SizeXFieldId
, SizeXFieldMask
,
205 (Field::SFDefaultFlags
| Field::FStdAccess
),
206 static_cast<FieldEditMethodSig
>(&TiledQuadTreeTerrain::editHandleSizeX
),
207 static_cast<FieldGetMethodSig
>(&TiledQuadTreeTerrain::getHandleSizeX
));
209 oType
.addInitialDesc(pDesc
);
211 pDesc
= new SFUInt32::Description(
212 SFUInt32::getClassType(),
214 "y-size of 2-dimensional tile array.\n",
215 SizeYFieldId
, SizeYFieldMask
,
217 (Field::SFDefaultFlags
| Field::FStdAccess
),
218 static_cast<FieldEditMethodSig
>(&TiledQuadTreeTerrain::editHandleSizeY
),
219 static_cast<FieldGetMethodSig
>(&TiledQuadTreeTerrain::getHandleSizeY
));
221 oType
.addInitialDesc(pDesc
);
223 pDesc
= new SFReal32::Description(
224 SFReal32::getClassType(),
227 HeightScaleFieldId
, HeightScaleFieldMask
,
229 (Field::SFDefaultFlags
| Field::FStdAccess
),
230 static_cast<FieldEditMethodSig
>(&TiledQuadTreeTerrain::editHandleHeightScale
),
231 static_cast<FieldGetMethodSig
>(&TiledQuadTreeTerrain::getHandleHeightScale
));
233 oType
.addInitialDesc(pDesc
);
235 pDesc
= new SFReal32::Description(
236 SFReal32::getClassType(),
239 VertexSpacingFieldId
, VertexSpacingFieldMask
,
241 (Field::SFDefaultFlags
| Field::FStdAccess
),
242 static_cast<FieldEditMethodSig
>(&TiledQuadTreeTerrain::editHandleVertexSpacing
),
243 static_cast<FieldGetMethodSig
>(&TiledQuadTreeTerrain::getHandleVertexSpacing
));
245 oType
.addInitialDesc(pDesc
);
247 pDesc
= new SFBool::Description(
248 SFBool::getClassType(),
251 GeoMorphingFieldId
, GeoMorphingFieldMask
,
253 (Field::SFDefaultFlags
| Field::FStdAccess
),
254 static_cast<FieldEditMethodSig
>(&TiledQuadTreeTerrain::editHandleGeoMorphing
),
255 static_cast<FieldGetMethodSig
>(&TiledQuadTreeTerrain::getHandleGeoMorphing
));
257 oType
.addInitialDesc(pDesc
);
259 pDesc
= new SFReal32::Description(
260 SFReal32::getClassType(),
262 "Detail of terrain tesselation.\n",
263 DetailFieldId
, DetailFieldMask
,
265 (Field::SFDefaultFlags
| Field::FStdAccess
),
266 static_cast<FieldEditMethodSig
>(&TiledQuadTreeTerrain::editHandleDetail
),
267 static_cast<FieldGetMethodSig
>(&TiledQuadTreeTerrain::getHandleDetail
));
269 oType
.addInitialDesc(pDesc
);
271 pDesc
= new SFInt32::Description(
272 SFInt32::getClassType(),
275 CurrentXFieldId
, CurrentXFieldMask
,
277 (Field::SFDefaultFlags
| Field::FStdAccess
),
278 static_cast<FieldEditMethodSig
>(&TiledQuadTreeTerrain::editHandleCurrentX
),
279 static_cast<FieldGetMethodSig
>(&TiledQuadTreeTerrain::getHandleCurrentX
));
281 oType
.addInitialDesc(pDesc
);
283 pDesc
= new SFInt32::Description(
284 SFInt32::getClassType(),
287 CurrentYFieldId
, CurrentYFieldMask
,
289 (Field::SFDefaultFlags
| Field::FStdAccess
),
290 static_cast<FieldEditMethodSig
>(&TiledQuadTreeTerrain::editHandleCurrentY
),
291 static_cast<FieldGetMethodSig
>(&TiledQuadTreeTerrain::getHandleCurrentY
));
293 oType
.addInitialDesc(pDesc
);
295 pDesc
= new SFInt32::Description(
296 SFInt32::getClassType(),
298 "Number of tiles (0, 1, 2, 3) around current eye point.\n",
299 SizeROIFieldId
, SizeROIFieldMask
,
301 (Field::SFDefaultFlags
| Field::FStdAccess
),
302 static_cast<FieldEditMethodSig
>(&TiledQuadTreeTerrain::editHandleSizeROI
),
303 static_cast<FieldGetMethodSig
>(&TiledQuadTreeTerrain::getHandleSizeROI
));
305 oType
.addInitialDesc(pDesc
);
307 pDesc
= new SFBool::Description(
308 SFBool::getClassType(),
310 "Perform any updates (tiling, terrain tiles).\n",
311 UpdateFieldId
, UpdateFieldMask
,
313 (Field::SFDefaultFlags
| Field::FStdAccess
),
314 static_cast<FieldEditMethodSig
>(&TiledQuadTreeTerrain::editHandleUpdate
),
315 static_cast<FieldGetMethodSig
>(&TiledQuadTreeTerrain::getHandleUpdate
));
317 oType
.addInitialDesc(pDesc
);
319 pDesc
= new SFBool::Description(
320 SFBool::getClassType(),
322 "Update terrain tiles in the next frame.\n",
323 UpdateTerrainFieldId
, UpdateTerrainFieldMask
,
325 (Field::SFDefaultFlags
| Field::FStdAccess
),
326 static_cast<FieldEditMethodSig
>(&TiledQuadTreeTerrain::editHandleUpdateTerrain
),
327 static_cast<FieldGetMethodSig
>(&TiledQuadTreeTerrain::getHandleUpdateTerrain
));
329 oType
.addInitialDesc(pDesc
);
331 pDesc
= new SFBool::Description(
332 SFBool::getClassType(),
334 "Do per-pixel lighting with normalmap; otherwise generate per-vertex normals.\n",
335 PerPixelLightingFieldId
, PerPixelLightingFieldMask
,
337 (Field::SFDefaultFlags
| Field::FStdAccess
),
338 static_cast<FieldEditMethodSig
>(&TiledQuadTreeTerrain::editHandlePerPixelLighting
),
339 static_cast<FieldGetMethodSig
>(&TiledQuadTreeTerrain::getHandlePerPixelLighting
));
341 oType
.addInitialDesc(pDesc
);
345 TiledQuadTreeTerrainBase::TypeObject
TiledQuadTreeTerrainBase::_type(
346 TiledQuadTreeTerrainBase::getClassname(),
347 Inherited::getClassname(),
350 reinterpret_cast<PrototypeCreateF
>(&TiledQuadTreeTerrainBase::createEmptyLocal
),
351 reinterpret_cast<InitContainerF
>(&TiledQuadTreeTerrain::initMethod
),
352 reinterpret_cast<ExitContainerF
>(&TiledQuadTreeTerrain::exitMethod
),
353 reinterpret_cast<InitalInsertDescFunc
>(
354 reinterpret_cast<void *>(&TiledQuadTreeTerrain::classDescInserter
)),
357 "<?xml version=\"1.0\"?>\n"
360 " name=\"TiledQuadTreeTerrain\"\n"
361 " parent=\"MaterialGroup\"\n"
362 " library=\"Drawable\"\n"
363 " pointerfieldtypes=\"both\"\n"
364 " structure=\"concrete\"\n"
365 " systemcomponent=\"true\"\n"
366 " parentsystemcomponent=\"true\"\n"
367 " decoratable=\"false\"\n"
368 " useLocalIncludes=\"false\"\n"
369 " docGroupBase=\"GrpDrawablesTerrain\"\n"
371 " Tiled terrain node core.\n"
373 "\t name=\"heightTiles\"\n"
374 "\t type=\"ImagePtr\"\n"
375 "\t cardinality=\"multi\"\n"
376 "\t visibility=\"external\"\n"
377 "\t access=\"public\"\n"
379 "\tTerrain tile array.\n"
382 "\t name=\"heightTextures\"\n"
383 "\t type=\"MaterialPtr\"\n"
384 "\t cardinality=\"multi\"\n"
385 "\t visibility=\"external\"\n"
386 "\t access=\"public\"\n"
388 "\tTerrain textures.\n"
391 "\t name=\"sizeX\"\n"
392 "\t type=\"UInt32\"\n"
393 "\t cardinality=\"single\"\n"
394 "\t visibility=\"external\"\n"
395 "\t defaultValue=\"1\"\n"
396 "\t access=\"public\"\n"
398 "\tx-size of 2-dimensional tile array.\n"
401 "\t name=\"sizeY\"\n"
402 "\t type=\"UInt32\"\n"
403 "\t cardinality=\"single\"\n"
404 "\t visibility=\"external\"\n"
405 "\t defaultValue=\"1\"\n"
406 "\t access=\"public\"\n"
408 "\ty-size of 2-dimensional tile array.\n"
411 "\t name=\"heightScale\"\n"
412 "\t type=\"Real32\"\n"
413 "\t cardinality=\"single\"\n"
414 "\t visibility=\"external\"\n"
415 "\t defaultValue=\"1.0f\"\n"
416 "\t access=\"public\"\n"
420 "\t name=\"vertexSpacing\"\n"
421 "\t type=\"Real32\"\n"
422 "\t cardinality=\"single\"\n"
423 "\t visibility=\"external\"\n"
424 "\t defaultValue=\"0.1f\"\n"
425 "\t access=\"public\"\n"
429 "\t name=\"geoMorphing\"\n"
431 "\t cardinality=\"single\"\n"
432 "\t visibility=\"external\"\n"
433 "\t defaultValue=\"false\"\n"
434 "\t access=\"public\"\n"
438 "\t name=\"detail\"\n"
439 "\t type=\"Real32\"\n"
440 "\t cardinality=\"single\"\n"
441 "\t visibility=\"external\"\n"
442 "\t defaultValue=\"22.0f\"\n"
443 "\t access=\"public\"\n"
445 "\tDetail of terrain tesselation.\n"
448 "\t name=\"currentX\"\n"
449 "\t type=\"Int32\"\n"
450 "\t cardinality=\"single\"\n"
451 "\t visibility=\"external\"\n"
452 "\t defaultValue=\"0\"\n"
453 "\t access=\"public\"\n"
457 "\t name=\"currentY\"\n"
458 "\t type=\"Int32\"\n"
459 "\t cardinality=\"single\"\n"
460 "\t visibility=\"external\"\n"
461 "\t defaultValue=\"0\"\n"
462 "\t access=\"public\"\n"
466 "\t name=\"sizeROI\"\n"
467 "\t type=\"Int32\"\n"
468 "\t cardinality=\"single\"\n"
469 "\t visibility=\"external\"\n"
470 "\t defaultValue=\"1\"\n"
471 "\t access=\"public\"\n"
473 "\tNumber of tiles (0, 1, 2, 3) around current eye point.\n"
476 "\t name=\"update\"\n"
478 "\t cardinality=\"single\"\n"
479 "\t visibility=\"external\"\n"
480 "\t defaultValue=\"true\"\n"
481 "\t access=\"public\"\n"
483 "\tPerform any updates (tiling, terrain tiles).\n"
486 "\t name=\"updateTerrain\"\n"
488 "\t cardinality=\"single\"\n"
489 "\t visibility=\"external\"\n"
490 "\t defaultValue=\"false\"\n"
491 "\t access=\"public\"\n"
493 "\tUpdate terrain tiles in the next frame.\n"
496 "\t name=\"perPixelLighting\"\n"
498 "\t cardinality=\"single\"\n"
499 "\t visibility=\"external\"\n"
500 "\t defaultValue=\"true\"\n"
501 "\t access=\"public\"\n"
503 "\tDo per-pixel lighting with normalmap; otherwise generate per-vertex normals.\n"
505 "</FieldContainer>\n",
506 "Tiled terrain node core.\n"
509 /*------------------------------ get -----------------------------------*/
511 FieldContainerType
&TiledQuadTreeTerrainBase::getType(void)
516 const FieldContainerType
&TiledQuadTreeTerrainBase::getType(void) const
521 UInt32
TiledQuadTreeTerrainBase::getContainerSize(void) const
523 return sizeof(TiledQuadTreeTerrain
);
526 /*------------------------- decorator get ------------------------------*/
529 //! Get the TiledQuadTreeTerrain::_mfHeightTiles field.
530 const MFUnrecImagePtr
*TiledQuadTreeTerrainBase::getMFHeightTiles(void) const
532 return &_mfHeightTiles
;
535 MFUnrecImagePtr
*TiledQuadTreeTerrainBase::editMFHeightTiles (void)
537 editMField(HeightTilesFieldMask
, _mfHeightTiles
);
539 return &_mfHeightTiles
;
541 Image
* TiledQuadTreeTerrainBase::getHeightTiles(const UInt32 index
) const
543 return _mfHeightTiles
[index
];
546 //! Get the TiledQuadTreeTerrain::_mfHeightTextures field.
547 const MFUnrecMaterialPtr
*TiledQuadTreeTerrainBase::getMFHeightTextures(void) const
549 return &_mfHeightTextures
;
552 MFUnrecMaterialPtr
*TiledQuadTreeTerrainBase::editMFHeightTextures (void)
554 editMField(HeightTexturesFieldMask
, _mfHeightTextures
);
556 return &_mfHeightTextures
;
558 Material
* TiledQuadTreeTerrainBase::getHeightTextures(const UInt32 index
) const
560 return _mfHeightTextures
[index
];
563 SFUInt32
*TiledQuadTreeTerrainBase::editSFSizeX(void)
565 editSField(SizeXFieldMask
);
570 const SFUInt32
*TiledQuadTreeTerrainBase::getSFSizeX(void) const
576 SFUInt32
*TiledQuadTreeTerrainBase::editSFSizeY(void)
578 editSField(SizeYFieldMask
);
583 const SFUInt32
*TiledQuadTreeTerrainBase::getSFSizeY(void) const
589 SFReal32
*TiledQuadTreeTerrainBase::editSFHeightScale(void)
591 editSField(HeightScaleFieldMask
);
593 return &_sfHeightScale
;
596 const SFReal32
*TiledQuadTreeTerrainBase::getSFHeightScale(void) const
598 return &_sfHeightScale
;
602 SFReal32
*TiledQuadTreeTerrainBase::editSFVertexSpacing(void)
604 editSField(VertexSpacingFieldMask
);
606 return &_sfVertexSpacing
;
609 const SFReal32
*TiledQuadTreeTerrainBase::getSFVertexSpacing(void) const
611 return &_sfVertexSpacing
;
615 SFBool
*TiledQuadTreeTerrainBase::editSFGeoMorphing(void)
617 editSField(GeoMorphingFieldMask
);
619 return &_sfGeoMorphing
;
622 const SFBool
*TiledQuadTreeTerrainBase::getSFGeoMorphing(void) const
624 return &_sfGeoMorphing
;
628 SFReal32
*TiledQuadTreeTerrainBase::editSFDetail(void)
630 editSField(DetailFieldMask
);
635 const SFReal32
*TiledQuadTreeTerrainBase::getSFDetail(void) const
641 SFInt32
*TiledQuadTreeTerrainBase::editSFCurrentX(void)
643 editSField(CurrentXFieldMask
);
648 const SFInt32
*TiledQuadTreeTerrainBase::getSFCurrentX(void) const
654 SFInt32
*TiledQuadTreeTerrainBase::editSFCurrentY(void)
656 editSField(CurrentYFieldMask
);
661 const SFInt32
*TiledQuadTreeTerrainBase::getSFCurrentY(void) const
667 SFInt32
*TiledQuadTreeTerrainBase::editSFSizeROI(void)
669 editSField(SizeROIFieldMask
);
674 const SFInt32
*TiledQuadTreeTerrainBase::getSFSizeROI(void) const
680 SFBool
*TiledQuadTreeTerrainBase::editSFUpdate(void)
682 editSField(UpdateFieldMask
);
687 const SFBool
*TiledQuadTreeTerrainBase::getSFUpdate(void) const
693 SFBool
*TiledQuadTreeTerrainBase::editSFUpdateTerrain(void)
695 editSField(UpdateTerrainFieldMask
);
697 return &_sfUpdateTerrain
;
700 const SFBool
*TiledQuadTreeTerrainBase::getSFUpdateTerrain(void) const
702 return &_sfUpdateTerrain
;
706 SFBool
*TiledQuadTreeTerrainBase::editSFPerPixelLighting(void)
708 editSField(PerPixelLightingFieldMask
);
710 return &_sfPerPixelLighting
;
713 const SFBool
*TiledQuadTreeTerrainBase::getSFPerPixelLighting(void) const
715 return &_sfPerPixelLighting
;
721 void TiledQuadTreeTerrainBase::pushToHeightTiles(Image
* const value
)
723 editMField(HeightTilesFieldMask
, _mfHeightTiles
);
725 _mfHeightTiles
.push_back(value
);
728 void TiledQuadTreeTerrainBase::assignHeightTiles(const MFUnrecImagePtr
&value
)
730 MFUnrecImagePtr ::const_iterator elemIt
=
732 MFUnrecImagePtr ::const_iterator elemEnd
=
735 static_cast<TiledQuadTreeTerrain
*>(this)->clearHeightTiles();
737 while(elemIt
!= elemEnd
)
739 this->pushToHeightTiles(*elemIt
);
745 void TiledQuadTreeTerrainBase::removeFromHeightTiles(UInt32 uiIndex
)
747 if(uiIndex
< _mfHeightTiles
.size())
749 editMField(HeightTilesFieldMask
, _mfHeightTiles
);
751 _mfHeightTiles
.erase(uiIndex
);
755 void TiledQuadTreeTerrainBase::removeObjFromHeightTiles(Image
* const value
)
757 Int32 iElemIdx
= _mfHeightTiles
.findIndex(value
);
761 editMField(HeightTilesFieldMask
, _mfHeightTiles
);
763 _mfHeightTiles
.erase(iElemIdx
);
766 void TiledQuadTreeTerrainBase::clearHeightTiles(void)
768 editMField(HeightTilesFieldMask
, _mfHeightTiles
);
771 _mfHeightTiles
.clear();
774 void TiledQuadTreeTerrainBase::pushToHeightTextures(Material
* const value
)
776 editMField(HeightTexturesFieldMask
, _mfHeightTextures
);
778 _mfHeightTextures
.push_back(value
);
781 void TiledQuadTreeTerrainBase::assignHeightTextures(const MFUnrecMaterialPtr
&value
)
783 MFUnrecMaterialPtr::const_iterator elemIt
=
785 MFUnrecMaterialPtr::const_iterator elemEnd
=
788 static_cast<TiledQuadTreeTerrain
*>(this)->clearHeightTextures();
790 while(elemIt
!= elemEnd
)
792 this->pushToHeightTextures(*elemIt
);
798 void TiledQuadTreeTerrainBase::removeFromHeightTextures(UInt32 uiIndex
)
800 if(uiIndex
< _mfHeightTextures
.size())
802 editMField(HeightTexturesFieldMask
, _mfHeightTextures
);
804 _mfHeightTextures
.erase(uiIndex
);
808 void TiledQuadTreeTerrainBase::removeObjFromHeightTextures(Material
* const value
)
810 Int32 iElemIdx
= _mfHeightTextures
.findIndex(value
);
814 editMField(HeightTexturesFieldMask
, _mfHeightTextures
);
816 _mfHeightTextures
.erase(iElemIdx
);
819 void TiledQuadTreeTerrainBase::clearHeightTextures(void)
821 editMField(HeightTexturesFieldMask
, _mfHeightTextures
);
824 _mfHeightTextures
.clear();
829 /*------------------------------ access -----------------------------------*/
831 SizeT
TiledQuadTreeTerrainBase::getBinSize(ConstFieldMaskArg whichField
)
833 SizeT returnValue
= Inherited::getBinSize(whichField
);
835 if(FieldBits::NoField
!= (HeightTilesFieldMask
& whichField
))
837 returnValue
+= _mfHeightTiles
.getBinSize();
839 if(FieldBits::NoField
!= (HeightTexturesFieldMask
& whichField
))
841 returnValue
+= _mfHeightTextures
.getBinSize();
843 if(FieldBits::NoField
!= (SizeXFieldMask
& whichField
))
845 returnValue
+= _sfSizeX
.getBinSize();
847 if(FieldBits::NoField
!= (SizeYFieldMask
& whichField
))
849 returnValue
+= _sfSizeY
.getBinSize();
851 if(FieldBits::NoField
!= (HeightScaleFieldMask
& whichField
))
853 returnValue
+= _sfHeightScale
.getBinSize();
855 if(FieldBits::NoField
!= (VertexSpacingFieldMask
& whichField
))
857 returnValue
+= _sfVertexSpacing
.getBinSize();
859 if(FieldBits::NoField
!= (GeoMorphingFieldMask
& whichField
))
861 returnValue
+= _sfGeoMorphing
.getBinSize();
863 if(FieldBits::NoField
!= (DetailFieldMask
& whichField
))
865 returnValue
+= _sfDetail
.getBinSize();
867 if(FieldBits::NoField
!= (CurrentXFieldMask
& whichField
))
869 returnValue
+= _sfCurrentX
.getBinSize();
871 if(FieldBits::NoField
!= (CurrentYFieldMask
& whichField
))
873 returnValue
+= _sfCurrentY
.getBinSize();
875 if(FieldBits::NoField
!= (SizeROIFieldMask
& whichField
))
877 returnValue
+= _sfSizeROI
.getBinSize();
879 if(FieldBits::NoField
!= (UpdateFieldMask
& whichField
))
881 returnValue
+= _sfUpdate
.getBinSize();
883 if(FieldBits::NoField
!= (UpdateTerrainFieldMask
& whichField
))
885 returnValue
+= _sfUpdateTerrain
.getBinSize();
887 if(FieldBits::NoField
!= (PerPixelLightingFieldMask
& whichField
))
889 returnValue
+= _sfPerPixelLighting
.getBinSize();
895 void TiledQuadTreeTerrainBase::copyToBin(BinaryDataHandler
&pMem
,
896 ConstFieldMaskArg whichField
)
898 Inherited::copyToBin(pMem
, whichField
);
900 if(FieldBits::NoField
!= (HeightTilesFieldMask
& whichField
))
902 _mfHeightTiles
.copyToBin(pMem
);
904 if(FieldBits::NoField
!= (HeightTexturesFieldMask
& whichField
))
906 _mfHeightTextures
.copyToBin(pMem
);
908 if(FieldBits::NoField
!= (SizeXFieldMask
& whichField
))
910 _sfSizeX
.copyToBin(pMem
);
912 if(FieldBits::NoField
!= (SizeYFieldMask
& whichField
))
914 _sfSizeY
.copyToBin(pMem
);
916 if(FieldBits::NoField
!= (HeightScaleFieldMask
& whichField
))
918 _sfHeightScale
.copyToBin(pMem
);
920 if(FieldBits::NoField
!= (VertexSpacingFieldMask
& whichField
))
922 _sfVertexSpacing
.copyToBin(pMem
);
924 if(FieldBits::NoField
!= (GeoMorphingFieldMask
& whichField
))
926 _sfGeoMorphing
.copyToBin(pMem
);
928 if(FieldBits::NoField
!= (DetailFieldMask
& whichField
))
930 _sfDetail
.copyToBin(pMem
);
932 if(FieldBits::NoField
!= (CurrentXFieldMask
& whichField
))
934 _sfCurrentX
.copyToBin(pMem
);
936 if(FieldBits::NoField
!= (CurrentYFieldMask
& whichField
))
938 _sfCurrentY
.copyToBin(pMem
);
940 if(FieldBits::NoField
!= (SizeROIFieldMask
& whichField
))
942 _sfSizeROI
.copyToBin(pMem
);
944 if(FieldBits::NoField
!= (UpdateFieldMask
& whichField
))
946 _sfUpdate
.copyToBin(pMem
);
948 if(FieldBits::NoField
!= (UpdateTerrainFieldMask
& whichField
))
950 _sfUpdateTerrain
.copyToBin(pMem
);
952 if(FieldBits::NoField
!= (PerPixelLightingFieldMask
& whichField
))
954 _sfPerPixelLighting
.copyToBin(pMem
);
958 void TiledQuadTreeTerrainBase::copyFromBin(BinaryDataHandler
&pMem
,
959 ConstFieldMaskArg whichField
)
961 Inherited::copyFromBin(pMem
, whichField
);
963 if(FieldBits::NoField
!= (HeightTilesFieldMask
& whichField
))
965 editMField(HeightTilesFieldMask
, _mfHeightTiles
);
966 _mfHeightTiles
.copyFromBin(pMem
);
968 if(FieldBits::NoField
!= (HeightTexturesFieldMask
& whichField
))
970 editMField(HeightTexturesFieldMask
, _mfHeightTextures
);
971 _mfHeightTextures
.copyFromBin(pMem
);
973 if(FieldBits::NoField
!= (SizeXFieldMask
& whichField
))
975 editSField(SizeXFieldMask
);
976 _sfSizeX
.copyFromBin(pMem
);
978 if(FieldBits::NoField
!= (SizeYFieldMask
& whichField
))
980 editSField(SizeYFieldMask
);
981 _sfSizeY
.copyFromBin(pMem
);
983 if(FieldBits::NoField
!= (HeightScaleFieldMask
& whichField
))
985 editSField(HeightScaleFieldMask
);
986 _sfHeightScale
.copyFromBin(pMem
);
988 if(FieldBits::NoField
!= (VertexSpacingFieldMask
& whichField
))
990 editSField(VertexSpacingFieldMask
);
991 _sfVertexSpacing
.copyFromBin(pMem
);
993 if(FieldBits::NoField
!= (GeoMorphingFieldMask
& whichField
))
995 editSField(GeoMorphingFieldMask
);
996 _sfGeoMorphing
.copyFromBin(pMem
);
998 if(FieldBits::NoField
!= (DetailFieldMask
& whichField
))
1000 editSField(DetailFieldMask
);
1001 _sfDetail
.copyFromBin(pMem
);
1003 if(FieldBits::NoField
!= (CurrentXFieldMask
& whichField
))
1005 editSField(CurrentXFieldMask
);
1006 _sfCurrentX
.copyFromBin(pMem
);
1008 if(FieldBits::NoField
!= (CurrentYFieldMask
& whichField
))
1010 editSField(CurrentYFieldMask
);
1011 _sfCurrentY
.copyFromBin(pMem
);
1013 if(FieldBits::NoField
!= (SizeROIFieldMask
& whichField
))
1015 editSField(SizeROIFieldMask
);
1016 _sfSizeROI
.copyFromBin(pMem
);
1018 if(FieldBits::NoField
!= (UpdateFieldMask
& whichField
))
1020 editSField(UpdateFieldMask
);
1021 _sfUpdate
.copyFromBin(pMem
);
1023 if(FieldBits::NoField
!= (UpdateTerrainFieldMask
& whichField
))
1025 editSField(UpdateTerrainFieldMask
);
1026 _sfUpdateTerrain
.copyFromBin(pMem
);
1028 if(FieldBits::NoField
!= (PerPixelLightingFieldMask
& whichField
))
1030 editSField(PerPixelLightingFieldMask
);
1031 _sfPerPixelLighting
.copyFromBin(pMem
);
1035 //! create a new instance of the class
1036 TiledQuadTreeTerrainTransitPtr
TiledQuadTreeTerrainBase::createLocal(BitVector bFlags
)
1038 TiledQuadTreeTerrainTransitPtr fc
;
1040 if(getClassType().getPrototype() != NULL
)
1042 FieldContainerTransitPtr tmpPtr
=
1043 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
1045 fc
= dynamic_pointer_cast
<TiledQuadTreeTerrain
>(tmpPtr
);
1051 //! create a new instance of the class, copy the container flags
1052 TiledQuadTreeTerrainTransitPtr
TiledQuadTreeTerrainBase::createDependent(BitVector bFlags
)
1054 TiledQuadTreeTerrainTransitPtr fc
;
1056 if(getClassType().getPrototype() != NULL
)
1058 FieldContainerTransitPtr tmpPtr
=
1059 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
1061 fc
= dynamic_pointer_cast
<TiledQuadTreeTerrain
>(tmpPtr
);
1067 //! create a new instance of the class
1068 TiledQuadTreeTerrainTransitPtr
TiledQuadTreeTerrainBase::create(void)
1070 TiledQuadTreeTerrainTransitPtr fc
;
1072 if(getClassType().getPrototype() != NULL
)
1074 FieldContainerTransitPtr tmpPtr
=
1075 getClassType().getPrototype()-> shallowCopy();
1077 fc
= dynamic_pointer_cast
<TiledQuadTreeTerrain
>(tmpPtr
);
1083 TiledQuadTreeTerrain
*TiledQuadTreeTerrainBase::createEmptyLocal(BitVector bFlags
)
1085 TiledQuadTreeTerrain
*returnValue
;
1087 newPtr
<TiledQuadTreeTerrain
>(returnValue
, bFlags
);
1089 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
1094 //! create an empty new instance of the class, do not copy the prototype
1095 TiledQuadTreeTerrain
*TiledQuadTreeTerrainBase::createEmpty(void)
1097 TiledQuadTreeTerrain
*returnValue
;
1099 newPtr
<TiledQuadTreeTerrain
>(returnValue
, Thread::getCurrentLocalFlags());
1101 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
1102 ~Thread::getCurrentLocalFlags();
1108 FieldContainerTransitPtr
TiledQuadTreeTerrainBase::shallowCopyLocal(
1109 BitVector bFlags
) const
1111 TiledQuadTreeTerrain
*tmpPtr
;
1113 newPtr(tmpPtr
, dynamic_cast<const TiledQuadTreeTerrain
*>(this), bFlags
);
1115 FieldContainerTransitPtr
returnValue(tmpPtr
);
1117 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
1122 FieldContainerTransitPtr
TiledQuadTreeTerrainBase::shallowCopyDependent(
1123 BitVector bFlags
) const
1125 TiledQuadTreeTerrain
*tmpPtr
;
1127 newPtr(tmpPtr
, dynamic_cast<const TiledQuadTreeTerrain
*>(this), ~bFlags
);
1129 FieldContainerTransitPtr
returnValue(tmpPtr
);
1131 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
1136 FieldContainerTransitPtr
TiledQuadTreeTerrainBase::shallowCopy(void) const
1138 TiledQuadTreeTerrain
*tmpPtr
;
1141 dynamic_cast<const TiledQuadTreeTerrain
*>(this),
1142 Thread::getCurrentLocalFlags());
1144 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
1146 FieldContainerTransitPtr
returnValue(tmpPtr
);
1154 /*------------------------- constructors ----------------------------------*/
1156 TiledQuadTreeTerrainBase::TiledQuadTreeTerrainBase(void) :
1159 _mfHeightTextures (),
1160 _sfSizeX (UInt32(1)),
1161 _sfSizeY (UInt32(1)),
1162 _sfHeightScale (Real32(1.0f
)),
1163 _sfVertexSpacing (Real32(0.1f
)),
1164 _sfGeoMorphing (bool(false)),
1165 _sfDetail (Real32(22.0f
)),
1166 _sfCurrentX (Int32(0)),
1167 _sfCurrentY (Int32(0)),
1168 _sfSizeROI (Int32(1)),
1169 _sfUpdate (bool(true)),
1170 _sfUpdateTerrain (bool(false)),
1171 _sfPerPixelLighting (bool(true))
1175 TiledQuadTreeTerrainBase::TiledQuadTreeTerrainBase(const TiledQuadTreeTerrainBase
&source
) :
1178 _mfHeightTextures (),
1179 _sfSizeX (source
._sfSizeX
),
1180 _sfSizeY (source
._sfSizeY
),
1181 _sfHeightScale (source
._sfHeightScale
),
1182 _sfVertexSpacing (source
._sfVertexSpacing
),
1183 _sfGeoMorphing (source
._sfGeoMorphing
),
1184 _sfDetail (source
._sfDetail
),
1185 _sfCurrentX (source
._sfCurrentX
),
1186 _sfCurrentY (source
._sfCurrentY
),
1187 _sfSizeROI (source
._sfSizeROI
),
1188 _sfUpdate (source
._sfUpdate
),
1189 _sfUpdateTerrain (source
._sfUpdateTerrain
),
1190 _sfPerPixelLighting (source
._sfPerPixelLighting
)
1195 /*-------------------------- destructors ----------------------------------*/
1197 TiledQuadTreeTerrainBase::~TiledQuadTreeTerrainBase(void)
1201 void TiledQuadTreeTerrainBase::onCreate(const TiledQuadTreeTerrain
*source
)
1203 Inherited::onCreate(source
);
1207 TiledQuadTreeTerrain
*pThis
= static_cast<TiledQuadTreeTerrain
*>(this);
1209 MFUnrecImagePtr::const_iterator HeightTilesIt
=
1210 source
->_mfHeightTiles
.begin();
1211 MFUnrecImagePtr::const_iterator HeightTilesEnd
=
1212 source
->_mfHeightTiles
.end ();
1214 while(HeightTilesIt
!= HeightTilesEnd
)
1216 pThis
->pushToHeightTiles(*HeightTilesIt
);
1221 MFUnrecMaterialPtr::const_iterator HeightTexturesIt
=
1222 source
->_mfHeightTextures
.begin();
1223 MFUnrecMaterialPtr::const_iterator HeightTexturesEnd
=
1224 source
->_mfHeightTextures
.end ();
1226 while(HeightTexturesIt
!= HeightTexturesEnd
)
1228 pThis
->pushToHeightTextures(*HeightTexturesIt
);
1235 GetFieldHandlePtr
TiledQuadTreeTerrainBase::getHandleHeightTiles (void) const
1237 MFUnrecImagePtr::GetHandlePtr
returnValue(
1238 new MFUnrecImagePtr::GetHandle(
1240 this->getType().getFieldDesc(HeightTilesFieldId
),
1241 const_cast<TiledQuadTreeTerrainBase
*>(this)));
1246 EditFieldHandlePtr
TiledQuadTreeTerrainBase::editHandleHeightTiles (void)
1248 MFUnrecImagePtr::EditHandlePtr
returnValue(
1249 new MFUnrecImagePtr::EditHandle(
1251 this->getType().getFieldDesc(HeightTilesFieldId
),
1254 returnValue
->setAddMethod(
1255 boost::bind(&TiledQuadTreeTerrain::pushToHeightTiles
,
1256 static_cast<TiledQuadTreeTerrain
*>(this), _1
));
1257 returnValue
->setRemoveMethod(
1258 boost::bind(&TiledQuadTreeTerrain::removeFromHeightTiles
,
1259 static_cast<TiledQuadTreeTerrain
*>(this), _1
));
1260 returnValue
->setRemoveObjMethod(
1261 boost::bind(&TiledQuadTreeTerrain::removeObjFromHeightTiles
,
1262 static_cast<TiledQuadTreeTerrain
*>(this), _1
));
1263 returnValue
->setClearMethod(
1264 boost::bind(&TiledQuadTreeTerrain::clearHeightTiles
,
1265 static_cast<TiledQuadTreeTerrain
*>(this)));
1267 editMField(HeightTilesFieldMask
, _mfHeightTiles
);
1272 GetFieldHandlePtr
TiledQuadTreeTerrainBase::getHandleHeightTextures (void) const
1274 MFUnrecMaterialPtr::GetHandlePtr
returnValue(
1275 new MFUnrecMaterialPtr::GetHandle(
1277 this->getType().getFieldDesc(HeightTexturesFieldId
),
1278 const_cast<TiledQuadTreeTerrainBase
*>(this)));
1283 EditFieldHandlePtr
TiledQuadTreeTerrainBase::editHandleHeightTextures (void)
1285 MFUnrecMaterialPtr::EditHandlePtr
returnValue(
1286 new MFUnrecMaterialPtr::EditHandle(
1288 this->getType().getFieldDesc(HeightTexturesFieldId
),
1291 returnValue
->setAddMethod(
1292 boost::bind(&TiledQuadTreeTerrain::pushToHeightTextures
,
1293 static_cast<TiledQuadTreeTerrain
*>(this), _1
));
1294 returnValue
->setRemoveMethod(
1295 boost::bind(&TiledQuadTreeTerrain::removeFromHeightTextures
,
1296 static_cast<TiledQuadTreeTerrain
*>(this), _1
));
1297 returnValue
->setRemoveObjMethod(
1298 boost::bind(&TiledQuadTreeTerrain::removeObjFromHeightTextures
,
1299 static_cast<TiledQuadTreeTerrain
*>(this), _1
));
1300 returnValue
->setClearMethod(
1301 boost::bind(&TiledQuadTreeTerrain::clearHeightTextures
,
1302 static_cast<TiledQuadTreeTerrain
*>(this)));
1304 editMField(HeightTexturesFieldMask
, _mfHeightTextures
);
1309 GetFieldHandlePtr
TiledQuadTreeTerrainBase::getHandleSizeX (void) const
1311 SFUInt32::GetHandlePtr
returnValue(
1312 new SFUInt32::GetHandle(
1314 this->getType().getFieldDesc(SizeXFieldId
),
1315 const_cast<TiledQuadTreeTerrainBase
*>(this)));
1320 EditFieldHandlePtr
TiledQuadTreeTerrainBase::editHandleSizeX (void)
1322 SFUInt32::EditHandlePtr
returnValue(
1323 new SFUInt32::EditHandle(
1325 this->getType().getFieldDesc(SizeXFieldId
),
1329 editSField(SizeXFieldMask
);
1334 GetFieldHandlePtr
TiledQuadTreeTerrainBase::getHandleSizeY (void) const
1336 SFUInt32::GetHandlePtr
returnValue(
1337 new SFUInt32::GetHandle(
1339 this->getType().getFieldDesc(SizeYFieldId
),
1340 const_cast<TiledQuadTreeTerrainBase
*>(this)));
1345 EditFieldHandlePtr
TiledQuadTreeTerrainBase::editHandleSizeY (void)
1347 SFUInt32::EditHandlePtr
returnValue(
1348 new SFUInt32::EditHandle(
1350 this->getType().getFieldDesc(SizeYFieldId
),
1354 editSField(SizeYFieldMask
);
1359 GetFieldHandlePtr
TiledQuadTreeTerrainBase::getHandleHeightScale (void) const
1361 SFReal32::GetHandlePtr
returnValue(
1362 new SFReal32::GetHandle(
1364 this->getType().getFieldDesc(HeightScaleFieldId
),
1365 const_cast<TiledQuadTreeTerrainBase
*>(this)));
1370 EditFieldHandlePtr
TiledQuadTreeTerrainBase::editHandleHeightScale (void)
1372 SFReal32::EditHandlePtr
returnValue(
1373 new SFReal32::EditHandle(
1375 this->getType().getFieldDesc(HeightScaleFieldId
),
1379 editSField(HeightScaleFieldMask
);
1384 GetFieldHandlePtr
TiledQuadTreeTerrainBase::getHandleVertexSpacing (void) const
1386 SFReal32::GetHandlePtr
returnValue(
1387 new SFReal32::GetHandle(
1389 this->getType().getFieldDesc(VertexSpacingFieldId
),
1390 const_cast<TiledQuadTreeTerrainBase
*>(this)));
1395 EditFieldHandlePtr
TiledQuadTreeTerrainBase::editHandleVertexSpacing (void)
1397 SFReal32::EditHandlePtr
returnValue(
1398 new SFReal32::EditHandle(
1400 this->getType().getFieldDesc(VertexSpacingFieldId
),
1404 editSField(VertexSpacingFieldMask
);
1409 GetFieldHandlePtr
TiledQuadTreeTerrainBase::getHandleGeoMorphing (void) const
1411 SFBool::GetHandlePtr
returnValue(
1412 new SFBool::GetHandle(
1414 this->getType().getFieldDesc(GeoMorphingFieldId
),
1415 const_cast<TiledQuadTreeTerrainBase
*>(this)));
1420 EditFieldHandlePtr
TiledQuadTreeTerrainBase::editHandleGeoMorphing (void)
1422 SFBool::EditHandlePtr
returnValue(
1423 new SFBool::EditHandle(
1425 this->getType().getFieldDesc(GeoMorphingFieldId
),
1429 editSField(GeoMorphingFieldMask
);
1434 GetFieldHandlePtr
TiledQuadTreeTerrainBase::getHandleDetail (void) const
1436 SFReal32::GetHandlePtr
returnValue(
1437 new SFReal32::GetHandle(
1439 this->getType().getFieldDesc(DetailFieldId
),
1440 const_cast<TiledQuadTreeTerrainBase
*>(this)));
1445 EditFieldHandlePtr
TiledQuadTreeTerrainBase::editHandleDetail (void)
1447 SFReal32::EditHandlePtr
returnValue(
1448 new SFReal32::EditHandle(
1450 this->getType().getFieldDesc(DetailFieldId
),
1454 editSField(DetailFieldMask
);
1459 GetFieldHandlePtr
TiledQuadTreeTerrainBase::getHandleCurrentX (void) const
1461 SFInt32::GetHandlePtr
returnValue(
1462 new SFInt32::GetHandle(
1464 this->getType().getFieldDesc(CurrentXFieldId
),
1465 const_cast<TiledQuadTreeTerrainBase
*>(this)));
1470 EditFieldHandlePtr
TiledQuadTreeTerrainBase::editHandleCurrentX (void)
1472 SFInt32::EditHandlePtr
returnValue(
1473 new SFInt32::EditHandle(
1475 this->getType().getFieldDesc(CurrentXFieldId
),
1479 editSField(CurrentXFieldMask
);
1484 GetFieldHandlePtr
TiledQuadTreeTerrainBase::getHandleCurrentY (void) const
1486 SFInt32::GetHandlePtr
returnValue(
1487 new SFInt32::GetHandle(
1489 this->getType().getFieldDesc(CurrentYFieldId
),
1490 const_cast<TiledQuadTreeTerrainBase
*>(this)));
1495 EditFieldHandlePtr
TiledQuadTreeTerrainBase::editHandleCurrentY (void)
1497 SFInt32::EditHandlePtr
returnValue(
1498 new SFInt32::EditHandle(
1500 this->getType().getFieldDesc(CurrentYFieldId
),
1504 editSField(CurrentYFieldMask
);
1509 GetFieldHandlePtr
TiledQuadTreeTerrainBase::getHandleSizeROI (void) const
1511 SFInt32::GetHandlePtr
returnValue(
1512 new SFInt32::GetHandle(
1514 this->getType().getFieldDesc(SizeROIFieldId
),
1515 const_cast<TiledQuadTreeTerrainBase
*>(this)));
1520 EditFieldHandlePtr
TiledQuadTreeTerrainBase::editHandleSizeROI (void)
1522 SFInt32::EditHandlePtr
returnValue(
1523 new SFInt32::EditHandle(
1525 this->getType().getFieldDesc(SizeROIFieldId
),
1529 editSField(SizeROIFieldMask
);
1534 GetFieldHandlePtr
TiledQuadTreeTerrainBase::getHandleUpdate (void) const
1536 SFBool::GetHandlePtr
returnValue(
1537 new SFBool::GetHandle(
1539 this->getType().getFieldDesc(UpdateFieldId
),
1540 const_cast<TiledQuadTreeTerrainBase
*>(this)));
1545 EditFieldHandlePtr
TiledQuadTreeTerrainBase::editHandleUpdate (void)
1547 SFBool::EditHandlePtr
returnValue(
1548 new SFBool::EditHandle(
1550 this->getType().getFieldDesc(UpdateFieldId
),
1554 editSField(UpdateFieldMask
);
1559 GetFieldHandlePtr
TiledQuadTreeTerrainBase::getHandleUpdateTerrain (void) const
1561 SFBool::GetHandlePtr
returnValue(
1562 new SFBool::GetHandle(
1564 this->getType().getFieldDesc(UpdateTerrainFieldId
),
1565 const_cast<TiledQuadTreeTerrainBase
*>(this)));
1570 EditFieldHandlePtr
TiledQuadTreeTerrainBase::editHandleUpdateTerrain (void)
1572 SFBool::EditHandlePtr
returnValue(
1573 new SFBool::EditHandle(
1575 this->getType().getFieldDesc(UpdateTerrainFieldId
),
1579 editSField(UpdateTerrainFieldMask
);
1584 GetFieldHandlePtr
TiledQuadTreeTerrainBase::getHandlePerPixelLighting (void) const
1586 SFBool::GetHandlePtr
returnValue(
1587 new SFBool::GetHandle(
1588 &_sfPerPixelLighting
,
1589 this->getType().getFieldDesc(PerPixelLightingFieldId
),
1590 const_cast<TiledQuadTreeTerrainBase
*>(this)));
1595 EditFieldHandlePtr
TiledQuadTreeTerrainBase::editHandlePerPixelLighting(void)
1597 SFBool::EditHandlePtr
returnValue(
1598 new SFBool::EditHandle(
1599 &_sfPerPixelLighting
,
1600 this->getType().getFieldDesc(PerPixelLightingFieldId
),
1604 editSField(PerPixelLightingFieldMask
);
1610 #ifdef OSG_MT_CPTR_ASPECT
1611 void TiledQuadTreeTerrainBase::execSyncV( FieldContainer
&oFrom
,
1612 ConstFieldMaskArg whichField
,
1613 AspectOffsetStore
&oOffsets
,
1614 ConstFieldMaskArg syncMode
,
1615 const UInt32 uiSyncInfo
)
1617 TiledQuadTreeTerrain
*pThis
= static_cast<TiledQuadTreeTerrain
*>(this);
1619 pThis
->execSync(static_cast<TiledQuadTreeTerrain
*>(&oFrom
),
1628 #ifdef OSG_MT_CPTR_ASPECT
1629 FieldContainer
*TiledQuadTreeTerrainBase::createAspectCopy(
1630 const FieldContainer
*pRefAspect
) const
1632 TiledQuadTreeTerrain
*returnValue
;
1634 newAspectCopy(returnValue
,
1635 dynamic_cast<const TiledQuadTreeTerrain
*>(pRefAspect
),
1636 dynamic_cast<const TiledQuadTreeTerrain
*>(this));
1642 void TiledQuadTreeTerrainBase::resolveLinks(void)
1644 Inherited::resolveLinks();
1646 static_cast<TiledQuadTreeTerrain
*>(this)->clearHeightTiles();
1648 static_cast<TiledQuadTreeTerrain
*>(this)->clearHeightTextures();