fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Material / Base / OSGMaterial.h
blobe76097d3c76815dcdd2b93c850d4bf3400363bab
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 _OSGMATERIAL_H_
41 #define _OSGMATERIAL_H_
42 #ifdef __sgi
43 #pragma once
44 #endif
46 #include "OSGConfig.h"
47 #include "OSGAction.h"
48 #include "OSGMaterialBase.h"
49 #include "OSGState.h"
50 #include "OSGMaterialMapFields.h"
52 OSG_BEGIN_NAMESPACE
55 class MaterialDrawable;
56 class DrawEnv;
57 class Window;
58 class PrimeMaterial;
60 template <class Desc>
61 class MapCacheHandlerMixin;
63 /*! \brief Abstract Material base class. See \ref PageSystemMaterial for a
64 description.
66 \ingroup GrpSystemMaterialBase
67 \ingroup GrpLibOSGSystem
68 \includebasedoc
71 class OSG_SYSTEM_DLLMAPPING Material : public MaterialBase
73 /*========================== PUBLIC =================================*/
75 public:
76 /*---------------------------------------------------------------------*/
77 /*! \name Constants */
78 /*! \{ */
80 static const Int32 NoStateSorting;
81 static const Int32 TransparencyAutoDetection;
82 static const Int32 TransparencyForceTransparent;
83 static const Int32 TransparencyForceOpaque;
85 /*! \} */
86 /*---------------------------------------------------------------------*/
87 /*! \name Sync */
88 /*! \{ */
90 virtual void changed(ConstFieldMaskArg whichField,
91 UInt32 origin,
92 BitVector detail);
94 /*! \} */
95 /*---------------------------------------------------------------------*/
96 /*! \name Output */
97 /*! \{ */
99 virtual void dump( UInt32 uiIndent = 0,
100 const BitVector bvFlags = 0) const;
102 /*! \} */
103 /*---------------------------------------------------------------------*/
104 /*! \name Rendering */
105 /*! \{ */
107 virtual
108 PrimeMaterial *finalize ( MaterialMapKey oKey,
109 const StateOverride *pOverrides,
110 Window *pWin ) = 0;
111 virtual
112 bool isTransparent( void ) const = 0;
114 /*! \} */
115 /*---------------------------------------------------------------------*/
116 /*! \name Comparison */
117 /*! \{ */
119 virtual Action::ResultE renderEnter(NodeCore * const pCore,
120 Action *pAction);
122 virtual Action::ResultE renderLeave(NodeCore * const pCore,
123 Action *pAction);
125 /*! \} */
126 /*---------------------------------------------------------------------*/
127 /*! \name Comparison */
128 /*! \{ */
130 #if 0
131 virtual bool operator < (const Material &other) const;
133 virtual bool operator == (const Material &other) const;
134 virtual bool operator != (const Material &other) const;
135 #endif
137 /*! \} */
138 /*========================= PROTECTED ===============================*/
140 protected:
142 /*---------------------------------------------------------------------*/
143 /*! \name Constructors */
144 /*! \{ */
146 Material(void);
147 Material(const Material &source);
149 /*! \} */
150 /*---------------------------------------------------------------------*/
151 /*! \name Destructors */
152 /*! \{ */
154 virtual ~Material(void);
156 /*! \} */
157 /*---------------------------------------------------------------------*/
158 /*! \name Init */
159 /*! \{ */
161 static void initMethod(InitPhase ePhase);
163 /*! \} */
164 /*---------------------------------------------------------------------*/
165 /*! \name Helper */
166 /*! \{ */
168 virtual void resolveLinks(void);
170 /*! \} */
171 /*========================== PRIVATE ================================*/
173 private:
175 typedef MaterialBase Inherited;
177 friend class FieldContainer;
178 friend class MaterialBase;
180 template <class Desc>
181 friend class MapCacheHandlerMixin;
183 // prohibit default functions (move to 'public' if you need one)
184 void operator =(const Material &source);
187 typedef Material *MaterialP;
189 /*---------------------------------------------------------------------*/
190 /*! \name Material Access */
191 /*! \{ */
193 /*! \ingroup GrpSystemFunctions
196 OSG_SYSTEM_DLLMAPPING PrimeMaterial *getDefaultMaterial (void);
198 /*! \ingroup GrpSystemFunctions
201 OSG_SYSTEM_DLLMAPPING PrimeMaterial *getDefaultUnlitMaterial(void);
203 /*! \} */
204 /*---------------------------------------------------------------------*/
206 OSG_END_NAMESPACE
208 #include "OSGMaterialBase.inl"
209 #include "OSGMaterial.inl"
211 #endif /* _OSGMATERIAL_H_ */