1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 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 \*---------------------------------------------------------------------------*/
40 #ifndef _OSGCHUNKMATERIAL_H_
41 #define _OSGCHUNKMATERIAL_H_
46 #include "OSGChunkMaterialBase.h"
52 /*! \brief Material using chunk set. See \ref
53 PageSystemMaterialChunkMaterial for a description.
55 \ingroup GrpSystemMaterialBase
56 \ingroup GrpLibOSGSystem
60 class OSG_SYSTEM_DLLMAPPING ChunkMaterial
: public ChunkMaterialBase
62 /*========================== PUBLIC =================================*/
66 /*---------------------------------------------------------------------*/
70 virtual void changed(ConstFieldMaskArg whichField
,
75 /*---------------------------------------------------------------------*/
79 virtual void dump( UInt32 uiIndent
= 0,
80 const BitVector bvFlags
= 0) const;
83 /*---------------------------------------------------------------------*/
84 /*! \name Rendering */
87 virtual void rebuildState (void );
89 virtual bool isTransparent(void ) const;
92 /*---------------------------------------------------------------------*/
96 bool addChunk (StateChunk
*chunk
,
97 Int32 slot
= State::AutoSlotReplace
);
98 bool subChunk (StateChunk
*chunk
,
99 Int32 slot
= State::AutoSlotReplace
);
100 bool insertChunk (StateChunk
*chunk
,
102 Int32 slot
= State::AutoSlotReplace
);
104 bool getChunkSlot(StateChunk
*chunk
, Int32
&slot
) const;
105 bool setChunkSlot(StateChunk
*chunk
, Int32 slot
);
108 /*---------------------------------------------------------------------*/
112 Int32
find( StateChunk
*chunk
) const;
113 StateChunk
*find(const FieldContainerType
&type
,
115 State::AutoSlotReplace
) const;
118 /*---------------------------------------------------------------------*/
122 StateChunk
*getChunk (const UInt32 index
) const;
123 const MFUnrecStateChunkPtr
*getMFChunks( void ) const;
124 const MFInt32
*getMFSlots ( void ) const;
127 /*---------------------------------------------------------------------*/
131 void clearChunks(void);
134 /*---------------------------------------------------------------------*/
138 virtual void fill(ChunkBlock
*pBlock
);
141 /*---------------------------------------------------------------------*/
146 virtual bool operator == (const ChunkMaterial
&other
) const;
150 /*========================= PROTECTED ===============================*/
154 /*---------------------------------------------------------------------*/
155 /*! \name Constructors */
159 ChunkMaterial(const ChunkMaterial
&source
);
162 /*---------------------------------------------------------------------*/
163 /*! \name Destructor */
166 virtual ~ChunkMaterial(void);
169 /*---------------------------------------------------------------------*/
173 static void initMethod(InitPhase ePhase
);
176 /*---------------------------------------------------------------------*/
177 /*! \name Ptr MField Set */
180 void pushToChunks ( StateChunk
* const value
);
182 void assignChunks (const MFUnrecStateChunkPtr
& value
);
184 void removeFromChunks ( UInt32 uiIndex
);
185 void removeFromChunksByObj( StateChunk
* const value
);
187 void replaceChunk ( UInt32 uiIndex
,
188 StateChunk
* const value
);
191 /*---------------------------------------------------------------------*/
192 /*! \name Destructor */
195 void addChunks(State
*state
) const;
198 /*========================== PRIVATE ================================*/
202 typedef ChunkMaterialBase Inherited
;
204 friend class FieldContainer
;
205 friend class ChunkMaterialBase
;
207 // prohibit default functions (move to 'public' if you need one)
208 void operator =(const ChunkMaterial
&source
);
211 typedef ChunkMaterial
*ChunkMaterialP
;
215 #include "OSGChunkMaterialBase.inl"
216 #include "OSGChunkMaterial.inl"
218 #endif /* _OSGCHUNKMATERIAL_H_ */