fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / State / Shader / Base / OSGShaderVariable.h
blobcf3747087b15b57238fb587c1c26a42ed7bedd81
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 _OSGSHADERVARIABLE_H_
40 #define _OSGSHADERVARIABLE_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGShaderVariableBase.h"
47 OSG_BEGIN_NAMESPACE
49 class ShaderProgramVariables;
51 /*! \brief ShaderParameter class. See \ref
52 PageSystemShaderParameter for a description.
53 \ingroup GrpSystemShaderBase
54 \ingroup GrpLibOSGSystem
55 \includebasedoc
58 class OSG_SYSTEM_DLLMAPPING ShaderVariable : public ShaderVariableBase
60 private:
62 /*========================== PUBLIC =================================*/
64 public:
66 typedef ShaderVariableBase Inherited;
68 static bool WarnUnknown;
70 /*---------------------------------------------------------------------*/
71 /*! \name Sync */
72 /*! \{ */
74 virtual void changed(ConstFieldMaskArg whichField,
75 UInt32 origin,
76 BitVector details);
78 /*! \} */
79 /*---------------------------------------------------------------------*/
80 /*! \name Output */
81 /*! \{ */
83 const std::string &getName(void) const;
85 /*! \} */
86 /*---------------------------------------------------------------------*/
87 /*! \name Output */
88 /*! \{ */
90 virtual bool isProcedural(void) const;
92 /*! \} */
93 /*---------------------------------------------------------------------*/
94 /*! \name Output */
95 /*! \{ */
97 virtual void dump( UInt32 uiIndent = 0,
98 const BitVector bvFlags = 0) const;
100 /*! \} */
101 /*---------------------------------------------------------------------*/
102 /*! \name TypeId's */
103 /*! \{ */
105 enum SHVType
107 SHVTypeUnknown = 0,
108 SHVTypeBool,
109 SHVTypeInt,
110 SHVTypeUInt,
111 SHVTypeReal,
112 SHVTypeVec2s, // missing
113 SHVTypeVec3s, // missing
114 SHVTypeVec4s, // missing
115 SHVTypeVec2f,
116 SHVTypeVec3f,
117 SHVTypeVec4f,
118 SHVTypePnt2f,
119 SHVTypePnt3f,
120 SHVTypeMatrix,
121 SHVTypeString, // missing
122 SHVTypeMBool, // missing
123 SHVTypeMInt,
124 SHVTypeMUInt,
125 SHVTypeMReal,
126 SHVTypeMVec2s, // missing
127 SHVTypeMVec3s, // missing
128 SHVTypeMVec4s, // missing
129 SHVTypeMVec2f,
130 SHVTypeMVec3f,
131 SHVTypeMVec4f,
132 SHVTypeMMatrix,
133 SHVTypeMString, // missing
134 SHVTypeOSG,
135 SHVTypeFunctor,
136 SHVTypeUniformBlock,
137 SHVTypeShaderStorageBlock
140 enum SHVFlags
142 SHVFlagNone = 0,
143 SHVFlagUpdate = 1
146 SHVType getTypeId(void);
148 /*! \} */
149 /*========================= PROTECTED ===============================*/
151 protected:
153 SHVType _typeid;
155 /*---------------------------------------------------------------------*/
156 /*! \name Constructors */
157 /*! \{ */
159 ShaderVariable(void);
160 ShaderVariable(const ShaderVariable &source);
162 /*! \} */
163 /*---------------------------------------------------------------------*/
164 /*! \name Destructors */
165 /*! \{ */
167 virtual ~ShaderVariable(void);
169 void setTypeId (SHVType type);
171 /*! \} */
172 /*---------------------------------------------------------------------*/
173 /*! \name Init */
174 /*! \{ */
176 static void initMethod(InitPhase ePhase);
178 /*! \} */
179 /*========================== PRIVATE ================================*/
181 private:
183 friend class FieldContainer;
184 friend class ShaderVariableBase;
185 friend class ShaderProgramVariables;
187 // prohibit default functions (move to 'public' if you need one)
188 void operator =(const ShaderVariable &source);
191 typedef ShaderVariable *ShaderVariableP;
193 OSG_END_NAMESPACE
195 #include "OSGShaderVariableBase.inl"
196 #include "OSGShaderVariable.inl"
198 #endif /* _OSGSHADERVARIABLE_H_ */