Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ShVector.hpp

00001 // WARNING - DO NOT EDIT THIS FILE: 00002 // This file was automatically generated from scripts/ShVector.hpp.py. 00003 // If you wish to change it, edit that file instead. 00004 // 00005 // --- 00006 // 00007 // Sh: A GPU metaprogramming language. 00008 // 00009 // Copyright (c) 2003 University of Waterloo Computer Graphics Laboratory 00010 // Project administrator: Michael D. McCool 00011 // Authors: Zheng Qin, Stefanus Du Toit, Kevin Moule, Tiberiu S. Popa, 00012 // Michael D. McCool 00013 // 00014 // This software is provided 'as-is', without any express or implied 00015 // warranty. In no event will the authors be held liable for any damages 00016 // arising from the use of this software. 00017 // 00018 // Permission is granted to anyone to use this software for any purpose, 00019 // including commercial applications, and to alter it and redistribute it 00020 // freely, subject to the following restrictions: 00021 // 00022 // 1. The origin of this software must not be misrepresented; you must 00023 // not claim that you wrote the original software. If you use this 00024 // software in a product, an acknowledgment in the product documentation 00025 // would be appreciated but is not required. 00026 // 00027 // 2. Altered source versions must be plainly marked as such, and must 00028 // not be misrepresented as being the original software. 00029 // 00030 // 3. This notice may not be removed or altered from any source 00031 // distribution. 00033 00034 #ifndef SH_SHVECTOR_HPP 00035 #define SH_SHVECTOR_HPP 00036 00037 #include "ShAttrib.hpp" 00038 namespace SH { 00039 00047 template<int N, ShBindingType Binding, typename T=float, bool Swizzled=false> 00048 class ShVector : public ShAttrib<N, Binding, T, Swizzled> { 00049 public: 00050 ShVector(); 00051 ShVector(const ShGeneric<N, T>& other); 00052 ShVector(const ShVector<N, Binding, T, Swizzled>& other); 00053 ShVector(const ShVariableNodePtr& node, const ShSwizzle& swizzle, bool neg); 00054 explicit ShVector(T data[N]); 00055 00056 ~ShVector(); 00057 00058 ShVector& operator=(const ShGeneric<N, T>& other); 00059 ShVector& operator=(const ShVector<N, Binding, T, Swizzled>& other); 00060 00061 ShVector& operator=(const ShProgram& prg); 00062 00063 ShVector& operator+=(const ShGeneric<N, T>& right); 00064 ShVector& operator-=(const ShGeneric<N, T>& right); 00065 ShVector& operator*=(const ShGeneric<N, T>& right); 00066 ShVector& operator/=(const ShGeneric<N, T>& right); 00067 ShVector& operator%=(const ShGeneric<N, T>& right); 00068 ShVector& operator*=(T); 00069 ShVector& operator/=(T); 00070 ShVector& operator%=(T); 00071 ShVector& operator+=(T); 00072 ShVector& operator-=(T); 00073 ShVector& operator+=(const ShGeneric<1, T>&); 00074 ShVector& operator-=(const ShGeneric<1, T>&); 00075 ShVector& operator*=(const ShGeneric<1, T>&); 00076 ShVector& operator/=(const ShGeneric<1, T>&); 00077 ShVector& operator%=(const ShGeneric<1, T>&); 00078 ShVector<1, Binding, T, true> operator()(int) const; 00079 ShVector<2, Binding, T, true> operator()(int, int) const; 00080 ShVector<3, Binding, T, true> operator()(int, int, int) const; 00081 ShVector<4, Binding, T, true> operator()(int, int, int, int) const; 00082 ShVector<1, Binding, T, true> operator[](int) const; 00083 00084 template<int N2> 00085 ShVector<N2, Binding, T, true> swiz(int indices[]) const; 00086 00087 ShVector operator-() const; 00088 typedef T ValueType; 00089 static const int typesize = N; 00090 static const ShBindingType binding_type = Binding; 00091 static const ShSemanticType semantic_type = SH_VECTOR; 00092 00093 typedef ShVector<N, SH_INPUT, T> InputType; 00094 typedef ShVector<N, SH_OUTPUT, T> OutputType; 00095 typedef ShVector<N, SH_INOUT, T> InOutType; 00096 typedef ShVector<N, SH_TEMP, T> TempType; 00097 typedef ShVector<N, SH_CONST, T> ConstType; 00098 private: 00099 typedef ShAttrib<N, Binding, T, Swizzled> ParentType; 00100 }; 00101 00102 template<ShBindingType Binding, typename T, bool Swizzled> 00103 class ShVector<1, Binding, T, Swizzled> : public ShAttrib<1, Binding, T, Swizzled> { 00104 public: 00105 ShVector(); 00106 ShVector(const ShGeneric<1, T>& other); 00107 ShVector(const ShVector<1, Binding, T, Swizzled>& other); 00108 ShVector(const ShVariableNodePtr& node, const ShSwizzle& swizzle, bool neg); 00109 explicit ShVector(T data[1]); 00110 00111 ShVector(T); 00112 00113 ~ShVector(); 00114 00115 ShVector& operator=(const ShGeneric<1, T>& other); 00116 ShVector& operator=(const ShVector<1, Binding, T, Swizzled>& other); 00117 00118 ShVector& operator=(T other); 00119 00120 ShVector& operator=(const ShProgram& prg); 00121 00122 ShVector& operator+=(const ShGeneric<1, T>& right); 00123 ShVector& operator-=(const ShGeneric<1, T>& right); 00124 ShVector& operator*=(const ShGeneric<1, T>& right); 00125 ShVector& operator/=(const ShGeneric<1, T>& right); 00126 ShVector& operator%=(const ShGeneric<1, T>& right); 00127 ShVector& operator*=(T); 00128 ShVector& operator/=(T); 00129 ShVector& operator%=(T); 00130 ShVector& operator+=(T); 00131 ShVector& operator-=(T); 00132 ShVector<1, Binding, T, true> operator()(int) const; 00133 ShVector<2, Binding, T, true> operator()(int, int) const; 00134 ShVector<3, Binding, T, true> operator()(int, int, int) const; 00135 ShVector<4, Binding, T, true> operator()(int, int, int, int) const; 00136 ShVector<1, Binding, T, true> operator[](int) const; 00137 00138 template<int N2> 00139 ShVector<N2, Binding, T, true> swiz(int indices[]) const; 00140 00141 ShVector operator-() const; 00142 typedef T ValueType; 00143 static const int typesize = 1; 00144 static const ShBindingType binding_type = Binding; 00145 static const ShSemanticType semantic_type = SH_VECTOR; 00146 00147 typedef ShVector<1, SH_INPUT, T> InputType; 00148 typedef ShVector<1, SH_OUTPUT, T> OutputType; 00149 typedef ShVector<1, SH_INOUT, T> InOutType; 00150 typedef ShVector<1, SH_TEMP, T> TempType; 00151 typedef ShVector<1, SH_CONST, T> ConstType; 00152 private: 00153 typedef ShAttrib<1, Binding, T, Swizzled> ParentType; 00154 }; 00155 00156 template<ShBindingType Binding, typename T, bool Swizzled> 00157 class ShVector<2, Binding, T, Swizzled> : public ShAttrib<2, Binding, T, Swizzled> { 00158 public: 00159 ShVector(); 00160 ShVector(const ShGeneric<2, T>& other); 00161 ShVector(const ShVector<2, Binding, T, Swizzled>& other); 00162 ShVector(const ShVariableNodePtr& node, const ShSwizzle& swizzle, bool neg); 00163 explicit ShVector(T data[2]); 00164 00165 ShVector(T, T); 00166 ShVector(const ShGeneric<1, T>&, const ShGeneric<1, T>&); 00167 00168 ~ShVector(); 00169 00170 ShVector& operator=(const ShGeneric<2, T>& other); 00171 ShVector& operator=(const ShVector<2, Binding, T, Swizzled>& other); 00172 00173 ShVector& operator=(const ShProgram& prg); 00174 00175 ShVector& operator+=(const ShGeneric<2, T>& right); 00176 ShVector& operator-=(const ShGeneric<2, T>& right); 00177 ShVector& operator*=(const ShGeneric<2, T>& right); 00178 ShVector& operator/=(const ShGeneric<2, T>& right); 00179 ShVector& operator%=(const ShGeneric<2, T>& right); 00180 ShVector& operator*=(T); 00181 ShVector& operator/=(T); 00182 ShVector& operator%=(T); 00183 ShVector& operator+=(T); 00184 ShVector& operator-=(T); 00185 ShVector& operator+=(const ShGeneric<1, T>&); 00186 ShVector& operator-=(const ShGeneric<1, T>&); 00187 ShVector& operator*=(const ShGeneric<1, T>&); 00188 ShVector& operator/=(const ShGeneric<1, T>&); 00189 ShVector& operator%=(const ShGeneric<1, T>&); 00190 ShVector<1, Binding, T, true> operator()(int) const; 00191 ShVector<2, Binding, T, true> operator()(int, int) const; 00192 ShVector<3, Binding, T, true> operator()(int, int, int) const; 00193 ShVector<4, Binding, T, true> operator()(int, int, int, int) const; 00194 ShVector<1, Binding, T, true> operator[](int) const; 00195 00196 template<int N2> 00197 ShVector<N2, Binding, T, true> swiz(int indices[]) const; 00198 00199 ShVector operator-() const; 00200 typedef T ValueType; 00201 static const int typesize = 2; 00202 static const ShBindingType binding_type = Binding; 00203 static const ShSemanticType semantic_type = SH_VECTOR; 00204 00205 typedef ShVector<2, SH_INPUT, T> InputType; 00206 typedef ShVector<2, SH_OUTPUT, T> OutputType; 00207 typedef ShVector<2, SH_INOUT, T> InOutType; 00208 typedef ShVector<2, SH_TEMP, T> TempType; 00209 typedef ShVector<2, SH_CONST, T> ConstType; 00210 private: 00211 typedef ShAttrib<2, Binding, T, Swizzled> ParentType; 00212 }; 00213 00214 template<ShBindingType Binding, typename T, bool Swizzled> 00215 class ShVector<3, Binding, T, Swizzled> : public ShAttrib<3, Binding, T, Swizzled> { 00216 public: 00217 ShVector(); 00218 ShVector(const ShGeneric<3, T>& other); 00219 ShVector(const ShVector<3, Binding, T, Swizzled>& other); 00220 ShVector(const ShVariableNodePtr& node, const ShSwizzle& swizzle, bool neg); 00221 explicit ShVector(T data[3]); 00222 00223 ShVector(T, T, T); 00224 ShVector(const ShGeneric<1, T>&, const ShGeneric<1, T>&, const ShGeneric<1, T>&); 00225 00226 ~ShVector(); 00227 00228 ShVector& operator=(const ShGeneric<3, T>& other); 00229 ShVector& operator=(const ShVector<3, Binding, T, Swizzled>& other); 00230 00231 ShVector& operator=(const ShProgram& prg); 00232 00233 ShVector& operator+=(const ShGeneric<3, T>& right); 00234 ShVector& operator-=(const ShGeneric<3, T>& right); 00235 ShVector& operator*=(const ShGeneric<3, T>& right); 00236 ShVector& operator/=(const ShGeneric<3, T>& right); 00237 ShVector& operator%=(const ShGeneric<3, T>& right); 00238 ShVector& operator*=(T); 00239 ShVector& operator/=(T); 00240 ShVector& operator%=(T); 00241 ShVector& operator+=(T); 00242 ShVector& operator-=(T); 00243 ShVector& operator+=(const ShGeneric<1, T>&); 00244 ShVector& operator-=(const ShGeneric<1, T>&); 00245 ShVector& operator*=(const ShGeneric<1, T>&); 00246 ShVector& operator/=(const ShGeneric<1, T>&); 00247 ShVector& operator%=(const ShGeneric<1, T>&); 00248 ShVector<1, Binding, T, true> operator()(int) const; 00249 ShVector<2, Binding, T, true> operator()(int, int) const; 00250 ShVector<3, Binding, T, true> operator()(int, int, int) const; 00251 ShVector<4, Binding, T, true> operator()(int, int, int, int) const; 00252 ShVector<1, Binding, T, true> operator[](int) const; 00253 00254 template<int N2> 00255 ShVector<N2, Binding, T, true> swiz(int indices[]) const; 00256 00257 ShVector operator-() const; 00258 typedef T ValueType; 00259 static const int typesize = 3; 00260 static const ShBindingType binding_type = Binding; 00261 static const ShSemanticType semantic_type = SH_VECTOR; 00262 00263 typedef ShVector<3, SH_INPUT, T> InputType; 00264 typedef ShVector<3, SH_OUTPUT, T> OutputType; 00265 typedef ShVector<3, SH_INOUT, T> InOutType; 00266 typedef ShVector<3, SH_TEMP, T> TempType; 00267 typedef ShVector<3, SH_CONST, T> ConstType; 00268 private: 00269 typedef ShAttrib<3, Binding, T, Swizzled> ParentType; 00270 }; 00271 00272 template<ShBindingType Binding, typename T, bool Swizzled> 00273 class ShVector<4, Binding, T, Swizzled> : public ShAttrib<4, Binding, T, Swizzled> { 00274 public: 00275 ShVector(); 00276 ShVector(const ShGeneric<4, T>& other); 00277 ShVector(const ShVector<4, Binding, T, Swizzled>& other); 00278 ShVector(const ShVariableNodePtr& node, const ShSwizzle& swizzle, bool neg); 00279 explicit ShVector(T data[4]); 00280 00281 ShVector(T, T, T, T); 00282 ShVector(const ShGeneric<1, T>&, const ShGeneric<1, T>&, const ShGeneric<1, T>&, const ShGeneric<1, T>&); 00283 00284 ~ShVector(); 00285 00286 ShVector& operator=(const ShGeneric<4, T>& other); 00287 ShVector& operator=(const ShVector<4, Binding, T, Swizzled>& other); 00288 00289 ShVector& operator=(const ShProgram& prg); 00290 00291 ShVector& operator+=(const ShGeneric<4, T>& right); 00292 ShVector& operator-=(const ShGeneric<4, T>& right); 00293 ShVector& operator*=(const ShGeneric<4, T>& right); 00294 ShVector& operator/=(const ShGeneric<4, T>& right); 00295 ShVector& operator%=(const ShGeneric<4, T>& right); 00296 ShVector& operator*=(T); 00297 ShVector& operator/=(T); 00298 ShVector& operator%=(T); 00299 ShVector& operator+=(T); 00300 ShVector& operator-=(T); 00301 ShVector& operator+=(const ShGeneric<1, T>&); 00302 ShVector& operator-=(const ShGeneric<1, T>&); 00303 ShVector& operator*=(const ShGeneric<1, T>&); 00304 ShVector& operator/=(const ShGeneric<1, T>&); 00305 ShVector& operator%=(const ShGeneric<1, T>&); 00306 ShVector<1, Binding, T, true> operator()(int) const; 00307 ShVector<2, Binding, T, true> operator()(int, int) const; 00308 ShVector<3, Binding, T, true> operator()(int, int, int) const; 00309 ShVector<4, Binding, T, true> operator()(int, int, int, int) const; 00310 ShVector<1, Binding, T, true> operator[](int) const; 00311 00312 template<int N2> 00313 ShVector<N2, Binding, T, true> swiz(int indices[]) const; 00314 00315 ShVector operator-() const; 00316 typedef T ValueType; 00317 static const int typesize = 4; 00318 static const ShBindingType binding_type = Binding; 00319 static const ShSemanticType semantic_type = SH_VECTOR; 00320 00321 typedef ShVector<4, SH_INPUT, T> InputType; 00322 typedef ShVector<4, SH_OUTPUT, T> OutputType; 00323 typedef ShVector<4, SH_INOUT, T> InOutType; 00324 typedef ShVector<4, SH_TEMP, T> TempType; 00325 typedef ShVector<4, SH_CONST, T> ConstType; 00326 private: 00327 typedef ShAttrib<4, Binding, T, Swizzled> ParentType; 00328 }; 00329 00330 typedef ShVector<1, SH_INPUT, float> ShInputVector1f; 00331 typedef ShVector<1, SH_OUTPUT, float> ShOutputVector1f; 00332 typedef ShVector<1, SH_INOUT, float> ShInOutVector1f; 00333 typedef ShVector<1, SH_TEMP, float> ShVector1f; 00334 typedef ShVector<1, SH_CONST, float> ShConstVector1f; 00335 typedef ShVector<2, SH_INPUT, float> ShInputVector2f; 00336 typedef ShVector<2, SH_OUTPUT, float> ShOutputVector2f; 00337 typedef ShVector<2, SH_INOUT, float> ShInOutVector2f; 00338 typedef ShVector<2, SH_TEMP, float> ShVector2f; 00339 typedef ShVector<2, SH_CONST, float> ShConstVector2f; 00340 typedef ShVector<3, SH_INPUT, float> ShInputVector3f; 00341 typedef ShVector<3, SH_OUTPUT, float> ShOutputVector3f; 00342 typedef ShVector<3, SH_INOUT, float> ShInOutVector3f; 00343 typedef ShVector<3, SH_TEMP, float> ShVector3f; 00344 typedef ShVector<3, SH_CONST, float> ShConstVector3f; 00345 typedef ShVector<4, SH_INPUT, float> ShInputVector4f; 00346 typedef ShVector<4, SH_OUTPUT, float> ShOutputVector4f; 00347 typedef ShVector<4, SH_INOUT, float> ShInOutVector4f; 00348 typedef ShVector<4, SH_TEMP, float> ShVector4f; 00349 typedef ShVector<4, SH_CONST, float> ShConstVector4f; 00350 00351 } // namespace SH 00352 #include "ShVectorImpl.hpp" 00353 00354 #endif // SH_SHVECTOR_HPP

Generated on Mon Oct 18 14:17:40 2004 for Sh by doxygen 1.3.7