fixed: let the material fill the override chunk block
[opensg.git] / Source / System / Material / Base / OSGSimpleMaterial.h
blob9ed7ce12e3e046e32db3de440b3dc10a6c34442f
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 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGSIMPLEMATERIAL_H_
40 #define _OSGSIMPLEMATERIAL_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGConfig.h"
46 #include "OSGMaterialChunk.h"
47 #include "OSGBlendChunk.h"
48 #include "OSGSimpleMaterialBase.h"
50 OSG_BEGIN_NAMESPACE
52 /*! \brief Simple Material wrapping standard OpenGL lighting. See \ref
53 PageSystemMaterialSimpleMaterial for a description.
55 \ingroup GrpSystemMaterialBase
56 \ingroup GrpLibOSGSystem
57 \includebasedoc
60 class OSG_SYSTEM_DLLMAPPING SimpleMaterial : public SimpleMaterialBase
62 /*========================== PUBLIC =================================*/
64 public:
66 /*---------------------------------------------------------------------*/
67 /*! \name Sync */
68 /*! \{ */
71 virtual void changed(ConstFieldMaskArg whichField,
72 UInt32 origin,
73 BitVector detail);
75 /*! \} */
76 /*---------------------------------------------------------------------*/
77 /*! \name Output */
78 /*! \{ */
80 virtual void dump( UInt32 uiIndent = 0,
81 const BitVector bvFlags = 0) const;
83 /*! \} */
84 /*---------------------------------------------------------------------*/
85 /*! \name Rendering */
86 /*! \{ */
88 virtual void rebuildState (void);
90 virtual bool isTransparent(void) const;
92 /*! \} */
93 /*---------------------------------------------------------------------*/
94 /*! \name Rendering */
95 /*! \{ */
97 virtual void fill(ChunkBlock *pBlock);
99 /*! \} */
100 /*========================= PROTECTED ===============================*/
102 protected:
104 // these chunks are used for rendering the material
106 MaterialChunkUnrecPtr _materialChunk;
107 BlendChunkUnrecPtr _blendChunk;
109 /*---------------------------------------------------------------------*/
110 /*! \name Constructors */
111 /*! \{ */
113 SimpleMaterial(void);
114 SimpleMaterial(const SimpleMaterial &source);
116 /*! \} */
117 /*---------------------------------------------------------------------*/
118 /*! \name Destructors */
119 /*! \{ */
121 virtual ~SimpleMaterial(void);
123 /*! \} */
124 /*---------------------------------------------------------------------*/
125 /*! \name Init */
126 /*! \{ */
128 static void initMethod(InitPhase ePhase);
130 /*! \} */
131 /*---------------------------------------------------------------------*/
132 /*! \name Helper */
133 /*! \{ */
135 virtual void resolveLinks(void);
137 /*! \} */
138 /*---------------------------------------------------------------------*/
139 /*! \name Helper */
140 /*! \{ */
142 void prepareLocalChunks(void);
144 /*! \} */
145 /*========================== PRIVATE ================================*/
147 private:
149 typedef SimpleMaterialBase Inherited;
151 friend class FieldContainer;
152 friend class SimpleMaterialBase;
154 // prohibit default functions (move to 'public' if you need one)
155 void operator =(const SimpleMaterial &source);
158 typedef SimpleMaterial *SimpleMaterialP;
160 OSG_END_NAMESPACE
162 #include "OSGSimpleMaterialBase.inl"
163 #include "OSGSimpleMaterial.inl"
165 #endif /* _OSGSIMPLEMATERIAL_H_ */