fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Material / Base / OSGChunkMaterial.h
blob86d76d7df81fd10c2db48572cab1bd08b6c4b62f
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
40 #ifndef _OSGCHUNKMATERIAL_H_
41 #define _OSGCHUNKMATERIAL_H_
42 #ifdef __sgi
43 #pragma once
44 #endif
46 #include "OSGChunkMaterialBase.h"
48 OSG_BEGIN_NAMESPACE
50 class ChunkBlock;
52 /*! \brief Material using chunk set. See \ref
53 PageSystemMaterialChunkMaterial for a description.
55 \ingroup GrpSystemMaterialBase
56 \ingroup GrpLibOSGSystem
57 \includebasedoc
60 class OSG_SYSTEM_DLLMAPPING ChunkMaterial : public ChunkMaterialBase
62 /*========================== PUBLIC =================================*/
64 public:
66 /*---------------------------------------------------------------------*/
67 /*! \name Sync */
68 /*! \{ */
70 virtual void changed(ConstFieldMaskArg whichField,
71 UInt32 origin,
72 BitVector detail);
74 /*! \} */
75 /*---------------------------------------------------------------------*/
76 /*! \name Output */
77 /*! \{ */
79 virtual void dump( UInt32 uiIndent = 0,
80 const BitVector bvFlags = 0) const;
82 /*! \} */
83 /*---------------------------------------------------------------------*/
84 /*! \name Rendering */
85 /*! \{ */
87 virtual void rebuildState (void );
89 virtual bool isTransparent(void ) const;
91 /*! \} */
92 /*---------------------------------------------------------------------*/
93 /*! \name Access */
94 /*! \{ */
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,
101 UInt32 chunkIndex,
102 Int32 slot = State::AutoSlotReplace);
104 bool getChunkSlot(StateChunk *chunk, Int32 &slot) const;
105 bool setChunkSlot(StateChunk *chunk, Int32 slot);
107 /*! \} */
108 /*---------------------------------------------------------------------*/
109 /*! \name Find */
110 /*! \{ */
112 Int32 find( StateChunk *chunk) const;
113 StateChunk *find(const FieldContainerType &type,
114 Int32 slot =
115 State::AutoSlotReplace) const;
117 /*! \} */
118 /*---------------------------------------------------------------------*/
119 /*! \name Find */
120 /*! \{ */
122 StateChunk *getChunk (const UInt32 index) const;
123 const MFUnrecStateChunkPtr *getMFChunks( void ) const;
124 const MFInt32 *getMFSlots ( void ) const;
126 /*! \} */
127 /*---------------------------------------------------------------------*/
128 /*! \name Find */
129 /*! \{ */
131 void clearChunks(void);
133 /*! \} */
134 /*---------------------------------------------------------------------*/
135 /*! \name Find */
136 /*! \{ */
138 virtual void fill(ChunkBlock *pBlock);
140 /*! \} */
141 /*---------------------------------------------------------------------*/
142 /*! \name Find */
143 /*! \{ */
145 #if 0
146 virtual bool operator == (const ChunkMaterial &other) const;
147 #endif
149 /*! \} */
150 /*========================= PROTECTED ===============================*/
152 protected:
154 /*---------------------------------------------------------------------*/
155 /*! \name Constructors */
156 /*! \{ */
158 ChunkMaterial(void);
159 ChunkMaterial(const ChunkMaterial &source);
161 /*! \} */
162 /*---------------------------------------------------------------------*/
163 /*! \name Destructor */
164 /*! \{ */
166 virtual ~ChunkMaterial(void);
168 /*! \} */
169 /*---------------------------------------------------------------------*/
170 /*! \name Init */
171 /*! \{ */
173 static void initMethod(InitPhase ePhase);
175 /*! \} */
176 /*---------------------------------------------------------------------*/
177 /*! \name Ptr MField Set */
178 /*! \{ */
180 void pushToChunks ( StateChunk * const value );
181 #if 0
182 void assignChunks (const MFUnrecStateChunkPtr & value );
183 #endif
184 void removeFromChunks ( UInt32 uiIndex);
185 void removeFromChunksByObj( StateChunk * const value );
187 void replaceChunk ( UInt32 uiIndex,
188 StateChunk * const value );
190 /*! \} */
191 /*---------------------------------------------------------------------*/
192 /*! \name Destructor */
193 /*! \{ */
195 void addChunks(State *state) const;
197 /*! \} */
198 /*========================== PRIVATE ================================*/
200 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;
213 OSG_END_NAMESPACE
215 #include "OSGChunkMaterialBase.inl"
216 #include "OSGChunkMaterial.inl"
218 #endif /* _OSGCHUNKMATERIAL_H_ */