1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
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 #ifndef _OSGCHUNKOVERRIDEGROUP_H_
40 #define _OSGCHUNKOVERRIDEGROUP_H_
45 #include "OSGChunkOverrideGroupBase.h"
47 #include "OSGChunkBlockMapFields.h"
48 #include "OSGChunkBlock.h"
49 #include "OSGMapCacheHandlerMixin.h"
55 class ChunkOverrideGroup
;
57 /*! \ingroup GrpSystemNodeCoreGroupsCores
61 struct ChunkOverrideMapCache
63 typedef ChunkOverrideGroupBase ParentT
;
64 typedef ChunkOverrideGroup FinalContainer
;
66 typedef SFChunkBlockPtrMap MapCacheField
;
67 typedef MapCacheField::StoredType MapCache
;
68 typedef SFChunkBlockPtrMap::EditHandle::KeyPool MapKeyPool
;
70 typedef MapCache::mapped_type MapCacheElement
;
71 typedef MapCache::key_type MapCacheKey
;
73 typedef ChunkBlock FinalizedElement
;
75 static const bool IsInternal
= false;
77 static void setFallback(ParentT
*pContainer
, MapCacheElement pElem
)
79 pContainer
->setFallbackChunkBlock(pElem
);
82 static MapCacheElement
getFallback(ParentT
*pContainer
)
84 return pContainer
->getFallbackChunkBlock();
87 static const Char8
*getFieldName(void)
89 return "chunkBlockStore";
93 /*! \brief ChunkOverrideGroup class. See \ref
94 PageSystemChunkOverrideGroup for a description.
95 \ingroup GrpSystemNodeCoreGroupsCores
96 \ingroup GrpLibOSGSystem
100 class OSG_SYSTEM_DLLMAPPING ChunkOverrideGroup
:
101 public MapCacheHandlerMixin
<ChunkOverrideMapCache
>
105 /*========================== PUBLIC =================================*/
109 typedef MapCacheHandlerMixin
<ChunkOverrideMapCache
> Inherited
;
110 typedef ChunkOverrideGroup Self
;
112 /*---------------------------------------------------------------------*/
116 virtual void changed(ConstFieldMaskArg whichField
,
121 /*---------------------------------------------------------------------*/
126 /*---------------------------------------------------------------------*/
130 void addChunkBlock(ChunkBlock
* const pChunkBlock
,
131 ChunkBlockMapKey key
= 0);
133 void subChunkBlock(ChunkBlockMapKey key
= 0);
136 /*---------------------------------------------------------------------*/
140 ChunkBlock
*findChunkBlock(ChunkBlockMapKey key
) const;
143 /*---------------------------------------------------------------------*/
144 /*! \name your_category */
147 const SFChunkBlockPtrMap
*getSFChunkBlockStore(void) const;
150 /*---------------------------------------------------------------------*/
151 /*! \name Rendering */
155 /*---------------------------------------------------------------------*/
159 bool addChunk(StateChunk
*chunk
,
160 Int32 slot
= State::AutoSlotReplace
);
162 bool subChunk(StateChunk
*chunk
,
163 Int32 slot
= State::AutoSlotReplace
);
166 /*---------------------------------------------------------------------*/
170 Int32
find( StateChunk
*chunk
);
171 StateChunk
*find(const StateChunkClass
&type
,
172 Int32 slot
=State::AutoSlotReplace
);
175 /*---------------------------------------------------------------------*/
180 /*---------------------------------------------------------------------*/
184 virtual void dump( UInt32 uiIndent
= 0,
185 const BitVector bvFlags
= 0) const;
188 /*========================= PROTECTED ===============================*/
192 /*---------------------------------------------------------------------*/
193 /*! \name Type information */
196 static void classDescInserter(TypeObject
&oType
);
199 /*---------------------------------------------------------------------*/
204 /*---------------------------------------------------------------------*/
205 /*! \name Constructors */
208 ChunkOverrideGroup(void);
209 ChunkOverrideGroup(const ChunkOverrideGroup
&source
);
212 /*---------------------------------------------------------------------*/
213 /*! \name Destructors */
216 virtual ~ChunkOverrideGroup(void);
219 /*---------------------------------------------------------------------*/
224 /*---------------------------------------------------------------------*/
225 /*! \name MT Destruction */
229 /*---------------------------------------------------------------------*/
233 Action::ResultE
renderEnter(Action
*action
);
234 Action::ResultE
renderLeave(Action
*action
);
237 /*---------------------------------------------------------------------*/
238 /*! \name Ptr MField Set */
242 /*---------------------------------------------------------------------*/
246 static void initMethod(InitPhase ePhase
);
249 /*---------------------------------------------------------------------*/
250 /*! \name Ptr MField Set */
254 /*========================== PRIVATE ================================*/
258 friend class FieldContainer
;
259 friend class ChunkOverrideGroupBase
;
261 // prohibit default functions (move to 'public' if you need one)
262 void operator =(const ChunkOverrideGroup
&source
);
265 typedef ChunkOverrideGroup
*ChunkOverrideGroupP
;
269 #include "OSGChunkOverrideGroupBase.inl"
270 #include "OSGChunkOverrideGroup.inl"
272 #endif /* _OSGCHUNKOVERRIDEGROUP_H_ */