00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00033
00034
#ifndef SH_SHNORMAL_HPP
00035
#define SH_SHNORMAL_HPP
00036
00037
#include "ShVector.hpp"
00038
namespace SH {
00039
00044
template<
int N, ShBindingType Binding,
typename T=
float,
bool Swizzled=false>
00045 class ShNormal :
public ShVector<N, Binding, T, Swizzled> {
00046
public:
00047
ShNormal();
00048
ShNormal(
const ShGeneric<N, T>& other);
00049
ShNormal(
const ShNormal<N, Binding, T, Swizzled>& other);
00050
ShNormal(
const ShVariableNodePtr& node,
const ShSwizzle& swizzle,
bool neg);
00051
explicit ShNormal(T data[N]);
00052
00053 ~
ShNormal();
00054
00055
ShNormal& operator=(
const ShGeneric<N, T>& other);
00056
ShNormal& operator=(
const ShNormal<N, Binding, T, Swizzled>& other);
00057
00058
ShNormal& operator=(
const ShProgram& prg);
00059
00060
ShNormal& operator+=(
const ShGeneric<N, T>& right);
00061
ShNormal& operator-=(
const ShGeneric<N, T>& right);
00062
ShNormal& operator*=(
const ShGeneric<N, T>& right);
00063
ShNormal& operator/=(
const ShGeneric<N, T>& right);
00064
ShNormal& operator%=(
const ShGeneric<N, T>& right);
00065
ShNormal& operator*=(T);
00066
ShNormal& operator/=(T);
00067
ShNormal& operator%=(T);
00068
ShNormal& operator+=(T);
00069
ShNormal& operator-=(T);
00070
ShNormal& operator+=(
const ShGeneric<1, T>&);
00071
ShNormal& operator-=(
const ShGeneric<1, T>&);
00072
ShNormal& operator*=(
const ShGeneric<1, T>&);
00073
ShNormal& operator/=(
const ShGeneric<1, T>&);
00074
ShNormal& operator%=(
const ShGeneric<1, T>&);
00075
ShNormal<1, Binding, T, true> operator()(
int)
const;
00076
ShNormal<2, Binding, T, true> operator()(
int,
int)
const;
00077
ShNormal<3, Binding, T, true> operator()(
int,
int,
int)
const;
00078
ShNormal<4, Binding, T, true> operator()(
int,
int,
int,
int)
const;
00079
ShNormal<1, Binding, T, true> operator[](
int)
const;
00080
00081
template<
int N2>
00082
ShNormal<N2, Binding, T, true> swiz(
int indices[])
const;
00083
00084
ShNormal operator-()
const;
00085
typedef T ValueType;
00086
static const int typesize = N;
00087
static const ShBindingType binding_type = Binding;
00088
static const ShSemanticType semantic_type = SH_NORMAL;
00089
00090
typedef ShNormal<N, SH_INPUT, T> InputType;
00091
typedef ShNormal<N, SH_OUTPUT, T> OutputType;
00092
typedef ShNormal<N, SH_INOUT, T> InOutType;
00093
typedef ShNormal<N, SH_TEMP, T> TempType;
00094
typedef ShNormal<N, SH_CONST, T> ConstType;
00095
private:
00096
typedef ShVector<N, Binding, T, Swizzled> ParentType;
00097 };
00098
00099
template<ShBindingType Binding,
typename T,
bool Swizzled>
00100
class ShNormal<1, Binding, T, Swizzled> :
public ShVector<1, Binding, T, Swizzled> {
00101
public:
00102
ShNormal();
00103
ShNormal(
const ShGeneric<1, T>& other);
00104
ShNormal(
const ShNormal<1, Binding, T, Swizzled>& other);
00105
ShNormal(
const ShVariableNodePtr& node,
const ShSwizzle& swizzle,
bool neg);
00106
explicit ShNormal(T data[1]);
00107
00108
ShNormal(T);
00109
00110 ~
ShNormal();
00111
00112
ShNormal& operator=(
const ShGeneric<1, T>& other);
00113
ShNormal& operator=(
const ShNormal<1, Binding, T, Swizzled>& other);
00114
00115
ShNormal& operator=(T other);
00116
00117
ShNormal& operator=(
const ShProgram& prg);
00118
00119
ShNormal& operator+=(
const ShGeneric<1, T>& right);
00120
ShNormal& operator-=(
const ShGeneric<1, T>& right);
00121
ShNormal& operator*=(
const ShGeneric<1, T>& right);
00122
ShNormal& operator/=(
const ShGeneric<1, T>& right);
00123
ShNormal& operator%=(
const ShGeneric<1, T>& right);
00124
ShNormal& operator*=(T);
00125
ShNormal& operator/=(T);
00126
ShNormal& operator%=(T);
00127
ShNormal& operator+=(T);
00128
ShNormal& operator-=(T);
00129
ShNormal<1, Binding, T, true> operator()(
int) const;
00130
ShNormal<2, Binding, T, true> operator()(
int,
int) const;
00131
ShNormal<3, Binding, T, true> operator()(
int,
int,
int) const;
00132
ShNormal<4, Binding, T, true> operator()(
int,
int,
int,
int) const;
00133
ShNormal<1, Binding, T, true> operator[](
int) const;
00134
00135 template<
int N2>
00136
ShNormal<N2, Binding, T, true> swiz(
int indices[]) const;
00137
00138
ShNormal operator-() const;
00139 typedef T ValueType;
00140 static const
int typesize = 1;
00141 static const ShBindingType binding_type = Binding;
00142 static const ShSemanticType semantic_type = SH_NORMAL;
00143
00144 typedef
ShNormal<1, SH_INPUT, T> InputType;
00145 typedef ShNormal<1, SH_OUTPUT, T> OutputType;
00146 typedef ShNormal<1, SH_INOUT, T> InOutType;
00147 typedef ShNormal<1, SH_TEMP, T> TempType;
00148 typedef ShNormal<1, SH_CONST, T> ConstType;
00149 private:
00150 typedef
ShVector<1, Binding, T, Swizzled> ParentType;
00151 };
00152
00153 template<ShBindingType Binding, typename T,
bool Swizzled>
00154 class ShNormal<2, Binding, T, Swizzled> : public ShVector<2, Binding, T, Swizzled> {
00155
public:
00156 ShNormal();
00157 ShNormal(
const ShGeneric<2, T>& other);
00158 ShNormal(
const ShNormal<2, Binding, T, Swizzled>& other);
00159 ShNormal(
const ShVariableNodePtr& node,
const ShSwizzle& swizzle,
bool neg);
00160
explicit ShNormal(T data[2]);
00161
00162 ShNormal(T, T);
00163 ShNormal(
const ShGeneric<1, T>&,
const ShGeneric<1, T>&);
00164
00165 ~ShNormal();
00166
00167 ShNormal& operator=(
const ShGeneric<2, T>& other);
00168 ShNormal& operator=(
const ShNormal<2, Binding, T, Swizzled>& other);
00169
00170 ShNormal& operator=(
const ShProgram& prg);
00171
00172 ShNormal& operator+=(
const ShGeneric<2, T>& right);
00173 ShNormal& operator-=(
const ShGeneric<2, T>& right);
00174 ShNormal& operator*=(
const ShGeneric<2, T>& right);
00175 ShNormal& operator/=(
const ShGeneric<2, T>& right);
00176 ShNormal& operator%=(
const ShGeneric<2, T>& right);
00177 ShNormal& operator*=(T);
00178 ShNormal& operator/=(T);
00179 ShNormal& operator%=(T);
00180 ShNormal& operator+=(T);
00181 ShNormal& operator-=(T);
00182 ShNormal& operator+=(
const ShGeneric<1, T>&);
00183 ShNormal& operator-=(
const ShGeneric<1, T>&);
00184 ShNormal& operator*=(
const ShGeneric<1, T>&);
00185 ShNormal& operator/=(
const ShGeneric<1, T>&);
00186 ShNormal& operator%=(
const ShGeneric<1, T>&);
00187
ShNormal<1, Binding, T, true> operator()(
int) const;
00188 ShNormal<2, Binding, T, true> operator()(
int,
int) const;
00189 ShNormal<3, Binding, T, true> operator()(
int,
int,
int) const;
00190 ShNormal<4, Binding, T, true> operator()(
int,
int,
int,
int) const;
00191 ShNormal<1, Binding, T, true> operator[](
int) const;
00192
00193 template<
int N2>
00194 ShNormal<N2, Binding, T, true> swiz(
int indices[]) const;
00195
00196 ShNormal operator-() const;
00197 typedef T ValueType;
00198 static const
int typesize = 2;
00199 static const ShBindingType binding_type = Binding;
00200 static const ShSemanticType semantic_type = SH_NORMAL;
00201
00202 typedef ShNormal<2, SH_INPUT, T> InputType;
00203 typedef ShNormal<2, SH_OUTPUT, T> OutputType;
00204 typedef ShNormal<2, SH_INOUT, T> InOutType;
00205 typedef ShNormal<2, SH_TEMP, T> TempType;
00206 typedef ShNormal<2, SH_CONST, T> ConstType;
00207 private:
00208 typedef ShVector<2, Binding, T, Swizzled> ParentType;
00209 };
00210
00211 template<ShBindingType Binding, typename T,
bool Swizzled>
00212 class ShNormal<3, Binding, T, Swizzled> : public ShVector<3, Binding, T, Swizzled> {
00213
public:
00214 ShNormal();
00215 ShNormal(
const ShGeneric<3, T>& other);
00216 ShNormal(
const ShNormal<3, Binding, T, Swizzled>& other);
00217 ShNormal(
const ShVariableNodePtr& node,
const ShSwizzle& swizzle,
bool neg);
00218
explicit ShNormal(T data[3]);
00219
00220 ShNormal(T, T, T);
00221 ShNormal(
const ShGeneric<1, T>&,
const ShGeneric<1, T>&,
const ShGeneric<1, T>&);
00222
00223 ~ShNormal();
00224
00225 ShNormal& operator=(
const ShGeneric<3, T>& other);
00226 ShNormal& operator=(
const ShNormal<3, Binding, T, Swizzled>& other);
00227
00228 ShNormal& operator=(
const ShProgram& prg);
00229
00230 ShNormal& operator+=(
const ShGeneric<3, T>& right);
00231 ShNormal& operator-=(
const ShGeneric<3, T>& right);
00232 ShNormal& operator*=(
const ShGeneric<3, T>& right);
00233 ShNormal& operator/=(
const ShGeneric<3, T>& right);
00234 ShNormal& operator%=(
const ShGeneric<3, T>& right);
00235 ShNormal& operator*=(T);
00236 ShNormal& operator/=(T);
00237 ShNormal& operator%=(T);
00238 ShNormal& operator+=(T);
00239 ShNormal& operator-=(T);
00240 ShNormal& operator+=(
const ShGeneric<1, T>&);
00241 ShNormal& operator-=(
const ShGeneric<1, T>&);
00242 ShNormal& operator*=(
const ShGeneric<1, T>&);
00243 ShNormal& operator/=(
const ShGeneric<1, T>&);
00244 ShNormal& operator%=(
const ShGeneric<1, T>&);
00245
ShNormal<1, Binding, T, true> operator()(
int) const;
00246 ShNormal<2, Binding, T, true> operator()(
int,
int) const;
00247 ShNormal<3, Binding, T, true> operator()(
int,
int,
int) const;
00248 ShNormal<4, Binding, T, true> operator()(
int,
int,
int,
int) const;
00249 ShNormal<1, Binding, T, true> operator[](
int) const;
00250
00251 template<
int N2>
00252 ShNormal<N2, Binding, T, true> swiz(
int indices[]) const;
00253
00254 ShNormal operator-() const;
00255 typedef T ValueType;
00256 static const
int typesize = 3;
00257 static const ShBindingType binding_type = Binding;
00258 static const ShSemanticType semantic_type = SH_NORMAL;
00259
00260 typedef ShNormal<3, SH_INPUT, T> InputType;
00261 typedef ShNormal<3, SH_OUTPUT, T> OutputType;
00262 typedef ShNormal<3, SH_INOUT, T> InOutType;
00263 typedef ShNormal<3, SH_TEMP, T> TempType;
00264 typedef ShNormal<3, SH_CONST, T> ConstType;
00265 private:
00266 typedef ShVector<3, Binding, T, Swizzled> ParentType;
00267 };
00268
00269 template<ShBindingType Binding, typename T,
bool Swizzled>
00270 class ShNormal<4, Binding, T, Swizzled> : public ShVector<4, Binding, T, Swizzled> {
00271
public:
00272 ShNormal();
00273 ShNormal(
const ShGeneric<4, T>& other);
00274 ShNormal(
const ShNormal<4, Binding, T, Swizzled>& other);
00275 ShNormal(
const ShVariableNodePtr& node,
const ShSwizzle& swizzle,
bool neg);
00276
explicit ShNormal(T data[4]);
00277
00278 ShNormal(T, T, T, T);
00279 ShNormal(
const ShGeneric<1, T>&,
const ShGeneric<1, T>&,
const ShGeneric<1, T>&,
const ShGeneric<1, T>&);
00280
00281 ~ShNormal();
00282
00283 ShNormal& operator=(
const ShGeneric<4, T>& other);
00284 ShNormal& operator=(
const ShNormal<4, Binding, T, Swizzled>& other);
00285
00286 ShNormal& operator=(
const ShProgram& prg);
00287
00288 ShNormal& operator+=(
const ShGeneric<4, T>& right);
00289 ShNormal& operator-=(
const ShGeneric<4, T>& right);
00290 ShNormal& operator*=(
const ShGeneric<4, T>& right);
00291 ShNormal& operator/=(
const ShGeneric<4, T>& right);
00292 ShNormal& operator%=(
const ShGeneric<4, T>& right);
00293 ShNormal& operator*=(T);
00294 ShNormal& operator/=(T);
00295 ShNormal& operator%=(T);
00296 ShNormal& operator+=(T);
00297 ShNormal& operator-=(T);
00298 ShNormal& operator+=(
const ShGeneric<1, T>&);
00299 ShNormal& operator-=(
const ShGeneric<1, T>&);
00300 ShNormal& operator*=(
const ShGeneric<1, T>&);
00301 ShNormal& operator/=(
const ShGeneric<1, T>&);
00302 ShNormal& operator%=(
const ShGeneric<1, T>&);
00303
ShNormal<1, Binding, T, true> operator()(
int) const;
00304 ShNormal<2, Binding, T, true> operator()(
int,
int) const;
00305 ShNormal<3, Binding, T, true> operator()(
int,
int,
int) const;
00306 ShNormal<4, Binding, T, true> operator()(
int,
int,
int,
int) const;
00307 ShNormal<1, Binding, T, true> operator[](
int) const;
00308
00309 template<
int N2>
00310 ShNormal<N2, Binding, T, true> swiz(
int indices[]) const;
00311
00312 ShNormal operator-() const;
00313 typedef T ValueType;
00314 static const
int typesize = 4;
00315 static const ShBindingType binding_type = Binding;
00316 static const ShSemanticType semantic_type = SH_NORMAL;
00317
00318 typedef ShNormal<4, SH_INPUT, T> InputType;
00319 typedef ShNormal<4, SH_OUTPUT, T> OutputType;
00320 typedef ShNormal<4, SH_INOUT, T> InOutType;
00321 typedef ShNormal<4, SH_TEMP, T> TempType;
00322 typedef ShNormal<4, SH_CONST, T> ConstType;
00323 private:
00324 typedef ShVector<4, Binding, T, Swizzled> ParentType;
00325 };
00326
00327 typedef ShNormal<1, SH_INPUT,
float>
ShInputNormal1f;
00328 typedef ShNormal<1, SH_OUTPUT,
float>
ShOutputNormal1f;
00329 typedef ShNormal<1, SH_INOUT,
float>
ShInOutNormal1f;
00330 typedef ShNormal<1, SH_TEMP,
float>
ShNormal1f;
00331 typedef ShNormal<1, SH_CONST,
float>
ShConstNormal1f;
00332 typedef ShNormal<2, SH_INPUT,
float>
ShInputNormal2f;
00333 typedef ShNormal<2, SH_OUTPUT,
float>
ShOutputNormal2f;
00334 typedef ShNormal<2, SH_INOUT,
float>
ShInOutNormal2f;
00335 typedef ShNormal<2, SH_TEMP,
float>
ShNormal2f;
00336 typedef ShNormal<2, SH_CONST,
float>
ShConstNormal2f;
00337 typedef ShNormal<3, SH_INPUT,
float>
ShInputNormal3f;
00338 typedef ShNormal<3, SH_OUTPUT,
float>
ShOutputNormal3f;
00339 typedef ShNormal<3, SH_INOUT,
float>
ShInOutNormal3f;
00340 typedef ShNormal<3, SH_TEMP,
float>
ShNormal3f;
00341 typedef ShNormal<3, SH_CONST,
float>
ShConstNormal3f;
00342 typedef ShNormal<4, SH_INPUT,
float>
ShInputNormal4f;
00343 typedef ShNormal<4, SH_OUTPUT,
float>
ShOutputNormal4f;
00344 typedef ShNormal<4, SH_INOUT,
float>
ShInOutNormal4f;
00345 typedef ShNormal<4, SH_TEMP,
float>
ShNormal4f;
00346 typedef ShNormal<4, SH_CONST,
float>
ShConstNormal4f;
00347
00348 }
00349 #include "ShNormalImpl.hpp"
00350
00351 #endif