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_SHVECTORIMPL_HPP
00035 #define SH_SHVECTORIMPL_HPP
00036
00037 #include "ShVector.hpp"
00038
00039 namespace SH {
00040
00041 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00042 inline
00043 ShVector<N, Binding, T, Swizzled>::ShVector()
00044 {
00045 this->m_node->specialType(SH_VECTOR);
00046 }
00047
00048 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00049 template<typename T2>
00050 inline
00051 ShVector<N, Binding, T, Swizzled>::ShVector(const ShGeneric<N, T2>& other)
00052 : ParentType(other)
00053 {
00054 this->m_node->specialType(SH_VECTOR);
00055 }
00056
00057 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00058 inline
00059 ShVector<N, Binding, T, Swizzled>::ShVector(const ShVector<N, Binding, T, Swizzled>& other)
00060 : ParentType(other)
00061 {
00062 this->m_node->specialType(SH_VECTOR);
00063 }
00064
00065 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00066 template<typename T2>
00067 inline
00068 ShVector<N, Binding, T, Swizzled>::ShVector(const ShVector<N, Binding, T2, Swizzled>& other)
00069 : ParentType(other)
00070 {
00071 this->m_node->specialType(SH_VECTOR);
00072 }
00073
00074 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00075 inline
00076 ShVector<N, Binding, T, Swizzled>::ShVector(const ShVariableNodePtr& node, const ShSwizzle& swizzle, bool neg)
00077 : ParentType(node, swizzle, neg)
00078 {
00079 this->m_node->specialType(SH_VECTOR);
00080 }
00081
00082 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00083 inline
00084 ShVector<N, Binding, T, Swizzled>::ShVector(host_type data[N])
00085 : ParentType(data)
00086 {
00087 this->m_node->specialType(SH_VECTOR);
00088 }
00089
00090 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00091 inline
00092 ShVector<N, Binding, T, Swizzled>::~ShVector()
00093 {
00094 }
00095
00096 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00097 template<typename T2>
00098 inline
00099 ShVector<N, Binding, T, Swizzled>&
00100 ShVector<N, Binding, T, Swizzled>::operator=(const ShGeneric<N, T2>& other)
00101 {
00102 ParentType::operator=(other);
00103 return *this;
00104 }
00105
00106 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00107 inline
00108 ShVector<N, Binding, T, Swizzled>&
00109 ShVector<N, Binding, T, Swizzled>::operator=(const ShVector<N, Binding, T, Swizzled>& other)
00110 {
00111 ParentType::operator=(other);
00112 return *this;
00113 }
00114
00115 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00116 template<typename T2>
00117 inline
00118 ShVector<N, Binding, T, Swizzled>&
00119 ShVector<N, Binding, T, Swizzled>::operator=(const ShVector<N, Binding, T2, Swizzled>& other)
00120 {
00121 ParentType::operator=(other);
00122 return *this;
00123 }
00124
00125 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00126 inline
00127 ShVector<N, Binding, T, Swizzled>&
00128 ShVector<N, Binding, T, Swizzled>::operator=(const ShProgram& prg)
00129 {
00130 ParentType::operator=(prg);
00131 return *this;
00132 }
00133
00134 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00135 template<typename T2>
00136 inline
00137 ShVector<N, Binding, T, Swizzled>&
00138 ShVector<N, Binding, T, Swizzled>::operator+=(const ShGeneric<N, T2>& right)
00139 {
00140 ParentType::operator+=(right);
00141 return *this;
00142 }
00143
00144 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00145 template<typename T2>
00146 inline
00147 ShVector<N, Binding, T, Swizzled>&
00148 ShVector<N, Binding, T, Swizzled>::operator-=(const ShGeneric<N, T2>& right)
00149 {
00150 ParentType::operator-=(right);
00151 return *this;
00152 }
00153
00154 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00155 template<typename T2>
00156 inline
00157 ShVector<N, Binding, T, Swizzled>&
00158 ShVector<N, Binding, T, Swizzled>::operator*=(const ShGeneric<N, T2>& right)
00159 {
00160 ParentType::operator*=(right);
00161 return *this;
00162 }
00163
00164 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00165 template<typename T2>
00166 inline
00167 ShVector<N, Binding, T, Swizzled>&
00168 ShVector<N, Binding, T, Swizzled>::operator/=(const ShGeneric<N, T2>& right)
00169 {
00170 ParentType::operator/=(right);
00171 return *this;
00172 }
00173
00174 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00175 template<typename T2>
00176 inline
00177 ShVector<N, Binding, T, Swizzled>&
00178 ShVector<N, Binding, T, Swizzled>::operator%=(const ShGeneric<N, T2>& right)
00179 {
00180 ParentType::operator%=(right);
00181 return *this;
00182 }
00183
00184 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00185 inline
00186 ShVector<N, Binding, T, Swizzled>&
00187 ShVector<N, Binding, T, Swizzled>::operator+=(host_type right)
00188 {
00189 ParentType::operator+=(right);
00190 return *this;
00191 }
00192
00193 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00194 inline
00195 ShVector<N, Binding, T, Swizzled>&
00196 ShVector<N, Binding, T, Swizzled>::operator-=(host_type right)
00197 {
00198 ParentType::operator-=(right);
00199 return *this;
00200 }
00201
00202 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00203 inline
00204 ShVector<N, Binding, T, Swizzled>&
00205 ShVector<N, Binding, T, Swizzled>::operator*=(host_type right)
00206 {
00207 ParentType::operator*=(right);
00208 return *this;
00209 }
00210
00211 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00212 inline
00213 ShVector<N, Binding, T, Swizzled>&
00214 ShVector<N, Binding, T, Swizzled>::operator/=(host_type right)
00215 {
00216 ParentType::operator/=(right);
00217 return *this;
00218 }
00219
00220 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00221 inline
00222 ShVector<N, Binding, T, Swizzled>&
00223 ShVector<N, Binding, T, Swizzled>::operator%=(host_type right)
00224 {
00225 ParentType::operator%=(right);
00226 return *this;
00227 }
00228
00229 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00230 template<typename T2>
00231 inline
00232 ShVector<N, Binding, T, Swizzled>&
00233 ShVector<N, Binding, T, Swizzled>::operator+=(const ShGeneric<1, T2>& right)
00234 {
00235 ParentType::operator+=(right);
00236 return *this;
00237 }
00238
00239 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00240 template<typename T2>
00241 inline
00242 ShVector<N, Binding, T, Swizzled>&
00243 ShVector<N, Binding, T, Swizzled>::operator-=(const ShGeneric<1, T2>& right)
00244 {
00245 ParentType::operator-=(right);
00246 return *this;
00247 }
00248
00249 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00250 template<typename T2>
00251 inline
00252 ShVector<N, Binding, T, Swizzled>&
00253 ShVector<N, Binding, T, Swizzled>::operator*=(const ShGeneric<1, T2>& right)
00254 {
00255 ParentType::operator*=(right);
00256 return *this;
00257 }
00258
00259 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00260 template<typename T2>
00261 inline
00262 ShVector<N, Binding, T, Swizzled>&
00263 ShVector<N, Binding, T, Swizzled>::operator/=(const ShGeneric<1, T2>& right)
00264 {
00265 ParentType::operator/=(right);
00266 return *this;
00267 }
00268
00269 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00270 template<typename T2>
00271 inline
00272 ShVector<N, Binding, T, Swizzled>&
00273 ShVector<N, Binding, T, Swizzled>::operator%=(const ShGeneric<1, T2>& right)
00274 {
00275 ParentType::operator%=(right);
00276 return *this;
00277 }
00278
00279 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00280 inline
00281 ShVector<1, Binding, T, true>
00282 ShVector<N, Binding, T, Swizzled>::operator()(int s0) const
00283 {
00284 return ShVector<1, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(N, s0), this->m_neg);
00285 }
00286
00287 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00288 inline
00289 ShVector<2, Binding, T, true>
00290 ShVector<N, Binding, T, Swizzled>::operator()(int s0, int s1) const
00291 {
00292 return ShVector<2, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(N, s0, s1), this->m_neg);
00293 }
00294
00295 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00296 inline
00297 ShVector<3, Binding, T, true>
00298 ShVector<N, Binding, T, Swizzled>::operator()(int s0, int s1, int s2) const
00299 {
00300 return ShVector<3, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(N, s0, s1, s2), this->m_neg);
00301 }
00302
00303 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00304 inline
00305 ShVector<4, Binding, T, true>
00306 ShVector<N, Binding, T, Swizzled>::operator()(int s0, int s1, int s2, int s3) const
00307 {
00308 return ShVector<4, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(N, s0, s1, s2, s3), this->m_neg);
00309 }
00310
00311 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00312 template<int N2>
00313 ShVector<N2, Binding, T, true>
00314 ShVector<N, Binding, T, Swizzled>::swiz(int indices[]) const
00315 {
00316 return ShVector<N2, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(N, N2, indices), this->m_neg);
00317 }
00318
00319 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00320 inline
00321 ShVector<1, Binding, T, true>
00322 ShVector<N, Binding, T, Swizzled>::operator[](int s0) const
00323 {
00324 return ShVector<1, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(N, s0), this->m_neg);
00325 }
00326
00327 template<int N, ShBindingType Binding, typename T, bool Swizzled>
00328 ShVector<N, Binding, T, Swizzled>
00329 ShVector<N, Binding, T, Swizzled>::operator-() const
00330 {
00331 return ShVector<N, Binding, T, Swizzled>(this->m_node, this->m_swizzle, !this->m_neg);
00332 }
00333
00334 template<ShBindingType Binding, typename T, bool Swizzled>
00335 inline
00336 ShVector<1, Binding, T, Swizzled>::ShVector()
00337 {
00338 this->m_node->specialType(SH_VECTOR);
00339 }
00340
00341 template<ShBindingType Binding, typename T, bool Swizzled>
00342 template<typename T2>
00343 inline
00344 ShVector<1, Binding, T, Swizzled>::ShVector(const ShGeneric<1, T2>& other)
00345 : ParentType(other)
00346 {
00347 this->m_node->specialType(SH_VECTOR);
00348 }
00349
00350 template<ShBindingType Binding, typename T, bool Swizzled>
00351 inline
00352 ShVector<1, Binding, T, Swizzled>::ShVector(const ShVector<1, Binding, T, Swizzled>& other)
00353 : ParentType(other)
00354 {
00355 this->m_node->specialType(SH_VECTOR);
00356 }
00357
00358 template<ShBindingType Binding, typename T, bool Swizzled>
00359 template<typename T2>
00360 inline
00361 ShVector<1, Binding, T, Swizzled>::ShVector(const ShVector<1, Binding, T2, Swizzled>& other)
00362 : ParentType(other)
00363 {
00364 this->m_node->specialType(SH_VECTOR);
00365 }
00366
00367 template<ShBindingType Binding, typename T, bool Swizzled>
00368 inline
00369 ShVector<1, Binding, T, Swizzled>::ShVector(const ShVariableNodePtr& node, const ShSwizzle& swizzle, bool neg)
00370 : ParentType(node, swizzle, neg)
00371 {
00372 this->m_node->specialType(SH_VECTOR);
00373 }
00374
00375 template<ShBindingType Binding, typename T, bool Swizzled>
00376 inline
00377 ShVector<1, Binding, T, Swizzled>::ShVector(host_type data[1])
00378 : ParentType(data)
00379 {
00380 this->m_node->specialType(SH_VECTOR);
00381 }
00382
00383 template<ShBindingType Binding, typename T, bool Swizzled>
00384 inline
00385 ShVector<1, Binding, T, Swizzled>::ShVector(host_type s0)
00386 : ParentType(s0)
00387 {
00388 this->m_node->specialType(SH_VECTOR);
00389 }
00390
00391 template<ShBindingType Binding, typename T, bool Swizzled>
00392 inline
00393 ShVector<1, Binding, T, Swizzled>::~ShVector()
00394 {
00395 }
00396
00397 template<ShBindingType Binding, typename T, bool Swizzled>
00398 template<typename T2>
00399 inline
00400 ShVector<1, Binding, T, Swizzled>&
00401 ShVector<1, Binding, T, Swizzled>::operator=(const ShGeneric<1, T2>& other)
00402 {
00403 ParentType::operator=(other);
00404 return *this;
00405 }
00406
00407 template<ShBindingType Binding, typename T, bool Swizzled>
00408 inline
00409 ShVector<1, Binding, T, Swizzled>&
00410 ShVector<1, Binding, T, Swizzled>::operator=(const ShVector<1, Binding, T, Swizzled>& other)
00411 {
00412 ParentType::operator=(other);
00413 return *this;
00414 }
00415
00416 template<ShBindingType Binding, typename T, bool Swizzled>
00417 template<typename T2>
00418 inline
00419 ShVector<1, Binding, T, Swizzled>&
00420 ShVector<1, Binding, T, Swizzled>::operator=(const ShVector<1, Binding, T2, Swizzled>& other)
00421 {
00422 ParentType::operator=(other);
00423 return *this;
00424 }
00425
00426 template<ShBindingType Binding, typename T, bool Swizzled>
00427 inline
00428 ShVector<1, Binding, T, Swizzled>&
00429 ShVector<1, Binding, T, Swizzled>::operator=(host_type other)
00430 {
00431 ParentType::operator=(other);
00432 return *this;
00433 }
00434
00435 template<ShBindingType Binding, typename T, bool Swizzled>
00436 inline
00437 ShVector<1, Binding, T, Swizzled>&
00438 ShVector<1, Binding, T, Swizzled>::operator=(const ShProgram& prg)
00439 {
00440 ParentType::operator=(prg);
00441 return *this;
00442 }
00443
00444 template<ShBindingType Binding, typename T, bool Swizzled>
00445 template<typename T2>
00446 inline
00447 ShVector<1, Binding, T, Swizzled>&
00448 ShVector<1, Binding, T, Swizzled>::operator+=(const ShGeneric<1, T2>& right)
00449 {
00450 ParentType::operator+=(right);
00451 return *this;
00452 }
00453
00454 template<ShBindingType Binding, typename T, bool Swizzled>
00455 template<typename T2>
00456 inline
00457 ShVector<1, Binding, T, Swizzled>&
00458 ShVector<1, Binding, T, Swizzled>::operator-=(const ShGeneric<1, T2>& right)
00459 {
00460 ParentType::operator-=(right);
00461 return *this;
00462 }
00463
00464 template<ShBindingType Binding, typename T, bool Swizzled>
00465 template<typename T2>
00466 inline
00467 ShVector<1, Binding, T, Swizzled>&
00468 ShVector<1, Binding, T, Swizzled>::operator*=(const ShGeneric<1, T2>& right)
00469 {
00470 ParentType::operator*=(right);
00471 return *this;
00472 }
00473
00474 template<ShBindingType Binding, typename T, bool Swizzled>
00475 template<typename T2>
00476 inline
00477 ShVector<1, Binding, T, Swizzled>&
00478 ShVector<1, Binding, T, Swizzled>::operator/=(const ShGeneric<1, T2>& right)
00479 {
00480 ParentType::operator/=(right);
00481 return *this;
00482 }
00483
00484 template<ShBindingType Binding, typename T, bool Swizzled>
00485 template<typename T2>
00486 inline
00487 ShVector<1, Binding, T, Swizzled>&
00488 ShVector<1, Binding, T, Swizzled>::operator%=(const ShGeneric<1, T2>& right)
00489 {
00490 ParentType::operator%=(right);
00491 return *this;
00492 }
00493
00494 template<ShBindingType Binding, typename T, bool Swizzled>
00495 inline
00496 ShVector<1, Binding, T, Swizzled>&
00497 ShVector<1, Binding, T, Swizzled>::operator+=(host_type right)
00498 {
00499 ParentType::operator+=(right);
00500 return *this;
00501 }
00502
00503 template<ShBindingType Binding, typename T, bool Swizzled>
00504 inline
00505 ShVector<1, Binding, T, Swizzled>&
00506 ShVector<1, Binding, T, Swizzled>::operator-=(host_type right)
00507 {
00508 ParentType::operator-=(right);
00509 return *this;
00510 }
00511
00512 template<ShBindingType Binding, typename T, bool Swizzled>
00513 inline
00514 ShVector<1, Binding, T, Swizzled>&
00515 ShVector<1, Binding, T, Swizzled>::operator*=(host_type right)
00516 {
00517 ParentType::operator*=(right);
00518 return *this;
00519 }
00520
00521 template<ShBindingType Binding, typename T, bool Swizzled>
00522 inline
00523 ShVector<1, Binding, T, Swizzled>&
00524 ShVector<1, Binding, T, Swizzled>::operator/=(host_type right)
00525 {
00526 ParentType::operator/=(right);
00527 return *this;
00528 }
00529
00530 template<ShBindingType Binding, typename T, bool Swizzled>
00531 inline
00532 ShVector<1, Binding, T, Swizzled>&
00533 ShVector<1, Binding, T, Swizzled>::operator%=(host_type right)
00534 {
00535 ParentType::operator%=(right);
00536 return *this;
00537 }
00538
00539 template<ShBindingType Binding, typename T, bool Swizzled>
00540 inline
00541 ShVector<1, Binding, T, true>
00542 ShVector<1, Binding, T, Swizzled>::operator()(int s0) const
00543 {
00544 return ShVector<1, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(1, s0), this->m_neg);
00545 }
00546
00547 template<ShBindingType Binding, typename T, bool Swizzled>
00548 inline
00549 ShVector<2, Binding, T, true>
00550 ShVector<1, Binding, T, Swizzled>::operator()(int s0, int s1) const
00551 {
00552 return ShVector<2, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(1, s0, s1), this->m_neg);
00553 }
00554
00555 template<ShBindingType Binding, typename T, bool Swizzled>
00556 inline
00557 ShVector<3, Binding, T, true>
00558 ShVector<1, Binding, T, Swizzled>::operator()(int s0, int s1, int s2) const
00559 {
00560 return ShVector<3, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(1, s0, s1, s2), this->m_neg);
00561 }
00562
00563 template<ShBindingType Binding, typename T, bool Swizzled>
00564 inline
00565 ShVector<4, Binding, T, true>
00566 ShVector<1, Binding, T, Swizzled>::operator()(int s0, int s1, int s2, int s3) const
00567 {
00568 return ShVector<4, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(1, s0, s1, s2, s3), this->m_neg);
00569 }
00570
00571 template<ShBindingType Binding, typename T, bool Swizzled>
00572 template<int N2>
00573 ShVector<N2, Binding, T, true>
00574 ShVector<1, Binding, T, Swizzled>::swiz(int indices[]) const
00575 {
00576 return ShVector<N2, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(1, N2, indices), this->m_neg);
00577 }
00578
00579 template<ShBindingType Binding, typename T, bool Swizzled>
00580 inline
00581 ShVector<1, Binding, T, true>
00582 ShVector<1, Binding, T, Swizzled>::operator[](int s0) const
00583 {
00584 return ShVector<1, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(1, s0), this->m_neg);
00585 }
00586
00587 template<ShBindingType Binding, typename T, bool Swizzled>
00588 ShVector<1, Binding, T, Swizzled>
00589 ShVector<1, Binding, T, Swizzled>::operator-() const
00590 {
00591 return ShVector<1, Binding, T, Swizzled>(this->m_node, this->m_swizzle, !this->m_neg);
00592 }
00593
00594 template<ShBindingType Binding, typename T, bool Swizzled>
00595 inline
00596 ShVector<2, Binding, T, Swizzled>::ShVector()
00597 {
00598 this->m_node->specialType(SH_VECTOR);
00599 }
00600
00601 template<ShBindingType Binding, typename T, bool Swizzled>
00602 template<typename T2>
00603 inline
00604 ShVector<2, Binding, T, Swizzled>::ShVector(const ShGeneric<2, T2>& other)
00605 : ParentType(other)
00606 {
00607 this->m_node->specialType(SH_VECTOR);
00608 }
00609
00610 template<ShBindingType Binding, typename T, bool Swizzled>
00611 inline
00612 ShVector<2, Binding, T, Swizzled>::ShVector(const ShVector<2, Binding, T, Swizzled>& other)
00613 : ParentType(other)
00614 {
00615 this->m_node->specialType(SH_VECTOR);
00616 }
00617
00618 template<ShBindingType Binding, typename T, bool Swizzled>
00619 template<typename T2>
00620 inline
00621 ShVector<2, Binding, T, Swizzled>::ShVector(const ShVector<2, Binding, T2, Swizzled>& other)
00622 : ParentType(other)
00623 {
00624 this->m_node->specialType(SH_VECTOR);
00625 }
00626
00627 template<ShBindingType Binding, typename T, bool Swizzled>
00628 inline
00629 ShVector<2, Binding, T, Swizzled>::ShVector(const ShVariableNodePtr& node, const ShSwizzle& swizzle, bool neg)
00630 : ParentType(node, swizzle, neg)
00631 {
00632 this->m_node->specialType(SH_VECTOR);
00633 }
00634
00635 template<ShBindingType Binding, typename T, bool Swizzled>
00636 inline
00637 ShVector<2, Binding, T, Swizzled>::ShVector(host_type data[2])
00638 : ParentType(data)
00639 {
00640 this->m_node->specialType(SH_VECTOR);
00641 }
00642
00643 template<ShBindingType Binding, typename T, bool Swizzled>
00644 inline
00645 ShVector<2, Binding, T, Swizzled>::ShVector(host_type s0, host_type s1)
00646 : ParentType(s0, s1)
00647 {
00648 this->m_node->specialType(SH_VECTOR);
00649 }
00650
00651 template<ShBindingType Binding, typename T, bool Swizzled>
00652 template<typename T2,typename T3>
00653 inline
00654 ShVector<2, Binding, T, Swizzled>::ShVector(const ShGeneric<1, T2>& s0, const ShGeneric<1, T3>& s1)
00655 : ParentType(s0, s1)
00656 {
00657 this->m_node->specialType(SH_VECTOR);
00658 }
00659
00660 template<ShBindingType Binding, typename T, bool Swizzled>
00661 inline
00662 ShVector<2, Binding, T, Swizzled>::~ShVector()
00663 {
00664 }
00665
00666 template<ShBindingType Binding, typename T, bool Swizzled>
00667 template<typename T2>
00668 inline
00669 ShVector<2, Binding, T, Swizzled>&
00670 ShVector<2, Binding, T, Swizzled>::operator=(const ShGeneric<2, T2>& other)
00671 {
00672 ParentType::operator=(other);
00673 return *this;
00674 }
00675
00676 template<ShBindingType Binding, typename T, bool Swizzled>
00677 inline
00678 ShVector<2, Binding, T, Swizzled>&
00679 ShVector<2, Binding, T, Swizzled>::operator=(const ShVector<2, Binding, T, Swizzled>& other)
00680 {
00681 ParentType::operator=(other);
00682 return *this;
00683 }
00684
00685 template<ShBindingType Binding, typename T, bool Swizzled>
00686 template<typename T2>
00687 inline
00688 ShVector<2, Binding, T, Swizzled>&
00689 ShVector<2, Binding, T, Swizzled>::operator=(const ShVector<2, Binding, T2, Swizzled>& other)
00690 {
00691 ParentType::operator=(other);
00692 return *this;
00693 }
00694
00695 template<ShBindingType Binding, typename T, bool Swizzled>
00696 inline
00697 ShVector<2, Binding, T, Swizzled>&
00698 ShVector<2, Binding, T, Swizzled>::operator=(const ShProgram& prg)
00699 {
00700 ParentType::operator=(prg);
00701 return *this;
00702 }
00703
00704 template<ShBindingType Binding, typename T, bool Swizzled>
00705 template<typename T2>
00706 inline
00707 ShVector<2, Binding, T, Swizzled>&
00708 ShVector<2, Binding, T, Swizzled>::operator+=(const ShGeneric<2, T2>& right)
00709 {
00710 ParentType::operator+=(right);
00711 return *this;
00712 }
00713
00714 template<ShBindingType Binding, typename T, bool Swizzled>
00715 template<typename T2>
00716 inline
00717 ShVector<2, Binding, T, Swizzled>&
00718 ShVector<2, Binding, T, Swizzled>::operator-=(const ShGeneric<2, T2>& right)
00719 {
00720 ParentType::operator-=(right);
00721 return *this;
00722 }
00723
00724 template<ShBindingType Binding, typename T, bool Swizzled>
00725 template<typename T2>
00726 inline
00727 ShVector<2, Binding, T, Swizzled>&
00728 ShVector<2, Binding, T, Swizzled>::operator*=(const ShGeneric<2, T2>& right)
00729 {
00730 ParentType::operator*=(right);
00731 return *this;
00732 }
00733
00734 template<ShBindingType Binding, typename T, bool Swizzled>
00735 template<typename T2>
00736 inline
00737 ShVector<2, Binding, T, Swizzled>&
00738 ShVector<2, Binding, T, Swizzled>::operator/=(const ShGeneric<2, T2>& right)
00739 {
00740 ParentType::operator/=(right);
00741 return *this;
00742 }
00743
00744 template<ShBindingType Binding, typename T, bool Swizzled>
00745 template<typename T2>
00746 inline
00747 ShVector<2, Binding, T, Swizzled>&
00748 ShVector<2, Binding, T, Swizzled>::operator%=(const ShGeneric<2, T2>& right)
00749 {
00750 ParentType::operator%=(right);
00751 return *this;
00752 }
00753
00754 template<ShBindingType Binding, typename T, bool Swizzled>
00755 inline
00756 ShVector<2, Binding, T, Swizzled>&
00757 ShVector<2, Binding, T, Swizzled>::operator+=(host_type right)
00758 {
00759 ParentType::operator+=(right);
00760 return *this;
00761 }
00762
00763 template<ShBindingType Binding, typename T, bool Swizzled>
00764 inline
00765 ShVector<2, Binding, T, Swizzled>&
00766 ShVector<2, Binding, T, Swizzled>::operator-=(host_type right)
00767 {
00768 ParentType::operator-=(right);
00769 return *this;
00770 }
00771
00772 template<ShBindingType Binding, typename T, bool Swizzled>
00773 inline
00774 ShVector<2, Binding, T, Swizzled>&
00775 ShVector<2, Binding, T, Swizzled>::operator*=(host_type right)
00776 {
00777 ParentType::operator*=(right);
00778 return *this;
00779 }
00780
00781 template<ShBindingType Binding, typename T, bool Swizzled>
00782 inline
00783 ShVector<2, Binding, T, Swizzled>&
00784 ShVector<2, Binding, T, Swizzled>::operator/=(host_type right)
00785 {
00786 ParentType::operator/=(right);
00787 return *this;
00788 }
00789
00790 template<ShBindingType Binding, typename T, bool Swizzled>
00791 inline
00792 ShVector<2, Binding, T, Swizzled>&
00793 ShVector<2, Binding, T, Swizzled>::operator%=(host_type right)
00794 {
00795 ParentType::operator%=(right);
00796 return *this;
00797 }
00798
00799 template<ShBindingType Binding, typename T, bool Swizzled>
00800 template<typename T2>
00801 inline
00802 ShVector<2, Binding, T, Swizzled>&
00803 ShVector<2, Binding, T, Swizzled>::operator+=(const ShGeneric<1, T2>& right)
00804 {
00805 ParentType::operator+=(right);
00806 return *this;
00807 }
00808
00809 template<ShBindingType Binding, typename T, bool Swizzled>
00810 template<typename T2>
00811 inline
00812 ShVector<2, Binding, T, Swizzled>&
00813 ShVector<2, Binding, T, Swizzled>::operator-=(const ShGeneric<1, T2>& right)
00814 {
00815 ParentType::operator-=(right);
00816 return *this;
00817 }
00818
00819 template<ShBindingType Binding, typename T, bool Swizzled>
00820 template<typename T2>
00821 inline
00822 ShVector<2, Binding, T, Swizzled>&
00823 ShVector<2, Binding, T, Swizzled>::operator*=(const ShGeneric<1, T2>& right)
00824 {
00825 ParentType::operator*=(right);
00826 return *this;
00827 }
00828
00829 template<ShBindingType Binding, typename T, bool Swizzled>
00830 template<typename T2>
00831 inline
00832 ShVector<2, Binding, T, Swizzled>&
00833 ShVector<2, Binding, T, Swizzled>::operator/=(const ShGeneric<1, T2>& right)
00834 {
00835 ParentType::operator/=(right);
00836 return *this;
00837 }
00838
00839 template<ShBindingType Binding, typename T, bool Swizzled>
00840 template<typename T2>
00841 inline
00842 ShVector<2, Binding, T, Swizzled>&
00843 ShVector<2, Binding, T, Swizzled>::operator%=(const ShGeneric<1, T2>& right)
00844 {
00845 ParentType::operator%=(right);
00846 return *this;
00847 }
00848
00849 template<ShBindingType Binding, typename T, bool Swizzled>
00850 inline
00851 ShVector<1, Binding, T, true>
00852 ShVector<2, Binding, T, Swizzled>::operator()(int s0) const
00853 {
00854 return ShVector<1, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(2, s0), this->m_neg);
00855 }
00856
00857 template<ShBindingType Binding, typename T, bool Swizzled>
00858 inline
00859 ShVector<2, Binding, T, true>
00860 ShVector<2, Binding, T, Swizzled>::operator()(int s0, int s1) const
00861 {
00862 return ShVector<2, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(2, s0, s1), this->m_neg);
00863 }
00864
00865 template<ShBindingType Binding, typename T, bool Swizzled>
00866 inline
00867 ShVector<3, Binding, T, true>
00868 ShVector<2, Binding, T, Swizzled>::operator()(int s0, int s1, int s2) const
00869 {
00870 return ShVector<3, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(2, s0, s1, s2), this->m_neg);
00871 }
00872
00873 template<ShBindingType Binding, typename T, bool Swizzled>
00874 inline
00875 ShVector<4, Binding, T, true>
00876 ShVector<2, Binding, T, Swizzled>::operator()(int s0, int s1, int s2, int s3) const
00877 {
00878 return ShVector<4, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(2, s0, s1, s2, s3), this->m_neg);
00879 }
00880
00881 template<ShBindingType Binding, typename T, bool Swizzled>
00882 template<int N2>
00883 ShVector<N2, Binding, T, true>
00884 ShVector<2, Binding, T, Swizzled>::swiz(int indices[]) const
00885 {
00886 return ShVector<N2, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(2, N2, indices), this->m_neg);
00887 }
00888
00889 template<ShBindingType Binding, typename T, bool Swizzled>
00890 inline
00891 ShVector<1, Binding, T, true>
00892 ShVector<2, Binding, T, Swizzled>::operator[](int s0) const
00893 {
00894 return ShVector<1, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(2, s0), this->m_neg);
00895 }
00896
00897 template<ShBindingType Binding, typename T, bool Swizzled>
00898 ShVector<2, Binding, T, Swizzled>
00899 ShVector<2, Binding, T, Swizzled>::operator-() const
00900 {
00901 return ShVector<2, Binding, T, Swizzled>(this->m_node, this->m_swizzle, !this->m_neg);
00902 }
00903
00904 template<ShBindingType Binding, typename T, bool Swizzled>
00905 inline
00906 ShVector<3, Binding, T, Swizzled>::ShVector()
00907 {
00908 this->m_node->specialType(SH_VECTOR);
00909 }
00910
00911 template<ShBindingType Binding, typename T, bool Swizzled>
00912 template<typename T2>
00913 inline
00914 ShVector<3, Binding, T, Swizzled>::ShVector(const ShGeneric<3, T2>& other)
00915 : ParentType(other)
00916 {
00917 this->m_node->specialType(SH_VECTOR);
00918 }
00919
00920 template<ShBindingType Binding, typename T, bool Swizzled>
00921 inline
00922 ShVector<3, Binding, T, Swizzled>::ShVector(const ShVector<3, Binding, T, Swizzled>& other)
00923 : ParentType(other)
00924 {
00925 this->m_node->specialType(SH_VECTOR);
00926 }
00927
00928 template<ShBindingType Binding, typename T, bool Swizzled>
00929 template<typename T2>
00930 inline
00931 ShVector<3, Binding, T, Swizzled>::ShVector(const ShVector<3, Binding, T2, Swizzled>& other)
00932 : ParentType(other)
00933 {
00934 this->m_node->specialType(SH_VECTOR);
00935 }
00936
00937 template<ShBindingType Binding, typename T, bool Swizzled>
00938 inline
00939 ShVector<3, Binding, T, Swizzled>::ShVector(const ShVariableNodePtr& node, const ShSwizzle& swizzle, bool neg)
00940 : ParentType(node, swizzle, neg)
00941 {
00942 this->m_node->specialType(SH_VECTOR);
00943 }
00944
00945 template<ShBindingType Binding, typename T, bool Swizzled>
00946 inline
00947 ShVector<3, Binding, T, Swizzled>::ShVector(host_type data[3])
00948 : ParentType(data)
00949 {
00950 this->m_node->specialType(SH_VECTOR);
00951 }
00952
00953 template<ShBindingType Binding, typename T, bool Swizzled>
00954 inline
00955 ShVector<3, Binding, T, Swizzled>::ShVector(host_type s0, host_type s1, host_type s2)
00956 : ParentType(s0, s1, s2)
00957 {
00958 this->m_node->specialType(SH_VECTOR);
00959 }
00960
00961 template<ShBindingType Binding, typename T, bool Swizzled>
00962 template<typename T2,typename T3,typename T4>
00963 inline
00964 ShVector<3, Binding, T, Swizzled>::ShVector(const ShGeneric<1, T2>& s0, const ShGeneric<1, T3>& s1, const ShGeneric<1, T4>& s2)
00965 : ParentType(s0, s1, s2)
00966 {
00967 this->m_node->specialType(SH_VECTOR);
00968 }
00969
00970 template<ShBindingType Binding, typename T, bool Swizzled>
00971 inline
00972 ShVector<3, Binding, T, Swizzled>::~ShVector()
00973 {
00974 }
00975
00976 template<ShBindingType Binding, typename T, bool Swizzled>
00977 template<typename T2>
00978 inline
00979 ShVector<3, Binding, T, Swizzled>&
00980 ShVector<3, Binding, T, Swizzled>::operator=(const ShGeneric<3, T2>& other)
00981 {
00982 ParentType::operator=(other);
00983 return *this;
00984 }
00985
00986 template<ShBindingType Binding, typename T, bool Swizzled>
00987 inline
00988 ShVector<3, Binding, T, Swizzled>&
00989 ShVector<3, Binding, T, Swizzled>::operator=(const ShVector<3, Binding, T, Swizzled>& other)
00990 {
00991 ParentType::operator=(other);
00992 return *this;
00993 }
00994
00995 template<ShBindingType Binding, typename T, bool Swizzled>
00996 template<typename T2>
00997 inline
00998 ShVector<3, Binding, T, Swizzled>&
00999 ShVector<3, Binding, T, Swizzled>::operator=(const ShVector<3, Binding, T2, Swizzled>& other)
01000 {
01001 ParentType::operator=(other);
01002 return *this;
01003 }
01004
01005 template<ShBindingType Binding, typename T, bool Swizzled>
01006 inline
01007 ShVector<3, Binding, T, Swizzled>&
01008 ShVector<3, Binding, T, Swizzled>::operator=(const ShProgram& prg)
01009 {
01010 ParentType::operator=(prg);
01011 return *this;
01012 }
01013
01014 template<ShBindingType Binding, typename T, bool Swizzled>
01015 template<typename T2>
01016 inline
01017 ShVector<3, Binding, T, Swizzled>&
01018 ShVector<3, Binding, T, Swizzled>::operator+=(const ShGeneric<3, T2>& right)
01019 {
01020 ParentType::operator+=(right);
01021 return *this;
01022 }
01023
01024 template<ShBindingType Binding, typename T, bool Swizzled>
01025 template<typename T2>
01026 inline
01027 ShVector<3, Binding, T, Swizzled>&
01028 ShVector<3, Binding, T, Swizzled>::operator-=(const ShGeneric<3, T2>& right)
01029 {
01030 ParentType::operator-=(right);
01031 return *this;
01032 }
01033
01034 template<ShBindingType Binding, typename T, bool Swizzled>
01035 template<typename T2>
01036 inline
01037 ShVector<3, Binding, T, Swizzled>&
01038 ShVector<3, Binding, T, Swizzled>::operator*=(const ShGeneric<3, T2>& right)
01039 {
01040 ParentType::operator*=(right);
01041 return *this;
01042 }
01043
01044 template<ShBindingType Binding, typename T, bool Swizzled>
01045 template<typename T2>
01046 inline
01047 ShVector<3, Binding, T, Swizzled>&
01048 ShVector<3, Binding, T, Swizzled>::operator/=(const ShGeneric<3, T2>& right)
01049 {
01050 ParentType::operator/=(right);
01051 return *this;
01052 }
01053
01054 template<ShBindingType Binding, typename T, bool Swizzled>
01055 template<typename T2>
01056 inline
01057 ShVector<3, Binding, T, Swizzled>&
01058 ShVector<3, Binding, T, Swizzled>::operator%=(const ShGeneric<3, T2>& right)
01059 {
01060 ParentType::operator%=(right);
01061 return *this;
01062 }
01063
01064 template<ShBindingType Binding, typename T, bool Swizzled>
01065 inline
01066 ShVector<3, Binding, T, Swizzled>&
01067 ShVector<3, Binding, T, Swizzled>::operator+=(host_type right)
01068 {
01069 ParentType::operator+=(right);
01070 return *this;
01071 }
01072
01073 template<ShBindingType Binding, typename T, bool Swizzled>
01074 inline
01075 ShVector<3, Binding, T, Swizzled>&
01076 ShVector<3, Binding, T, Swizzled>::operator-=(host_type right)
01077 {
01078 ParentType::operator-=(right);
01079 return *this;
01080 }
01081
01082 template<ShBindingType Binding, typename T, bool Swizzled>
01083 inline
01084 ShVector<3, Binding, T, Swizzled>&
01085 ShVector<3, Binding, T, Swizzled>::operator*=(host_type right)
01086 {
01087 ParentType::operator*=(right);
01088 return *this;
01089 }
01090
01091 template<ShBindingType Binding, typename T, bool Swizzled>
01092 inline
01093 ShVector<3, Binding, T, Swizzled>&
01094 ShVector<3, Binding, T, Swizzled>::operator/=(host_type right)
01095 {
01096 ParentType::operator/=(right);
01097 return *this;
01098 }
01099
01100 template<ShBindingType Binding, typename T, bool Swizzled>
01101 inline
01102 ShVector<3, Binding, T, Swizzled>&
01103 ShVector<3, Binding, T, Swizzled>::operator%=(host_type right)
01104 {
01105 ParentType::operator%=(right);
01106 return *this;
01107 }
01108
01109 template<ShBindingType Binding, typename T, bool Swizzled>
01110 template<typename T2>
01111 inline
01112 ShVector<3, Binding, T, Swizzled>&
01113 ShVector<3, Binding, T, Swizzled>::operator+=(const ShGeneric<1, T2>& right)
01114 {
01115 ParentType::operator+=(right);
01116 return *this;
01117 }
01118
01119 template<ShBindingType Binding, typename T, bool Swizzled>
01120 template<typename T2>
01121 inline
01122 ShVector<3, Binding, T, Swizzled>&
01123 ShVector<3, Binding, T, Swizzled>::operator-=(const ShGeneric<1, T2>& right)
01124 {
01125 ParentType::operator-=(right);
01126 return *this;
01127 }
01128
01129 template<ShBindingType Binding, typename T, bool Swizzled>
01130 template<typename T2>
01131 inline
01132 ShVector<3, Binding, T, Swizzled>&
01133 ShVector<3, Binding, T, Swizzled>::operator*=(const ShGeneric<1, T2>& right)
01134 {
01135 ParentType::operator*=(right);
01136 return *this;
01137 }
01138
01139 template<ShBindingType Binding, typename T, bool Swizzled>
01140 template<typename T2>
01141 inline
01142 ShVector<3, Binding, T, Swizzled>&
01143 ShVector<3, Binding, T, Swizzled>::operator/=(const ShGeneric<1, T2>& right)
01144 {
01145 ParentType::operator/=(right);
01146 return *this;
01147 }
01148
01149 template<ShBindingType Binding, typename T, bool Swizzled>
01150 template<typename T2>
01151 inline
01152 ShVector<3, Binding, T, Swizzled>&
01153 ShVector<3, Binding, T, Swizzled>::operator%=(const ShGeneric<1, T2>& right)
01154 {
01155 ParentType::operator%=(right);
01156 return *this;
01157 }
01158
01159 template<ShBindingType Binding, typename T, bool Swizzled>
01160 inline
01161 ShVector<1, Binding, T, true>
01162 ShVector<3, Binding, T, Swizzled>::operator()(int s0) const
01163 {
01164 return ShVector<1, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(3, s0), this->m_neg);
01165 }
01166
01167 template<ShBindingType Binding, typename T, bool Swizzled>
01168 inline
01169 ShVector<2, Binding, T, true>
01170 ShVector<3, Binding, T, Swizzled>::operator()(int s0, int s1) const
01171 {
01172 return ShVector<2, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(3, s0, s1), this->m_neg);
01173 }
01174
01175 template<ShBindingType Binding, typename T, bool Swizzled>
01176 inline
01177 ShVector<3, Binding, T, true>
01178 ShVector<3, Binding, T, Swizzled>::operator()(int s0, int s1, int s2) const
01179 {
01180 return ShVector<3, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(3, s0, s1, s2), this->m_neg);
01181 }
01182
01183 template<ShBindingType Binding, typename T, bool Swizzled>
01184 inline
01185 ShVector<4, Binding, T, true>
01186 ShVector<3, Binding, T, Swizzled>::operator()(int s0, int s1, int s2, int s3) const
01187 {
01188 return ShVector<4, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(3, s0, s1, s2, s3), this->m_neg);
01189 }
01190
01191 template<ShBindingType Binding, typename T, bool Swizzled>
01192 template<int N2>
01193 ShVector<N2, Binding, T, true>
01194 ShVector<3, Binding, T, Swizzled>::swiz(int indices[]) const
01195 {
01196 return ShVector<N2, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(3, N2, indices), this->m_neg);
01197 }
01198
01199 template<ShBindingType Binding, typename T, bool Swizzled>
01200 inline
01201 ShVector<1, Binding, T, true>
01202 ShVector<3, Binding, T, Swizzled>::operator[](int s0) const
01203 {
01204 return ShVector<1, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(3, s0), this->m_neg);
01205 }
01206
01207 template<ShBindingType Binding, typename T, bool Swizzled>
01208 ShVector<3, Binding, T, Swizzled>
01209 ShVector<3, Binding, T, Swizzled>::operator-() const
01210 {
01211 return ShVector<3, Binding, T, Swizzled>(this->m_node, this->m_swizzle, !this->m_neg);
01212 }
01213
01214 template<ShBindingType Binding, typename T, bool Swizzled>
01215 inline
01216 ShVector<4, Binding, T, Swizzled>::ShVector()
01217 {
01218 this->m_node->specialType(SH_VECTOR);
01219 }
01220
01221 template<ShBindingType Binding, typename T, bool Swizzled>
01222 template<typename T2>
01223 inline
01224 ShVector<4, Binding, T, Swizzled>::ShVector(const ShGeneric<4, T2>& other)
01225 : ParentType(other)
01226 {
01227 this->m_node->specialType(SH_VECTOR);
01228 }
01229
01230 template<ShBindingType Binding, typename T, bool Swizzled>
01231 inline
01232 ShVector<4, Binding, T, Swizzled>::ShVector(const ShVector<4, Binding, T, Swizzled>& other)
01233 : ParentType(other)
01234 {
01235 this->m_node->specialType(SH_VECTOR);
01236 }
01237
01238 template<ShBindingType Binding, typename T, bool Swizzled>
01239 template<typename T2>
01240 inline
01241 ShVector<4, Binding, T, Swizzled>::ShVector(const ShVector<4, Binding, T2, Swizzled>& other)
01242 : ParentType(other)
01243 {
01244 this->m_node->specialType(SH_VECTOR);
01245 }
01246
01247 template<ShBindingType Binding, typename T, bool Swizzled>
01248 inline
01249 ShVector<4, Binding, T, Swizzled>::ShVector(const ShVariableNodePtr& node, const ShSwizzle& swizzle, bool neg)
01250 : ParentType(node, swizzle, neg)
01251 {
01252 this->m_node->specialType(SH_VECTOR);
01253 }
01254
01255 template<ShBindingType Binding, typename T, bool Swizzled>
01256 inline
01257 ShVector<4, Binding, T, Swizzled>::ShVector(host_type data[4])
01258 : ParentType(data)
01259 {
01260 this->m_node->specialType(SH_VECTOR);
01261 }
01262
01263 template<ShBindingType Binding, typename T, bool Swizzled>
01264 inline
01265 ShVector<4, Binding, T, Swizzled>::ShVector(host_type s0, host_type s1, host_type s2, host_type s3)
01266 : ParentType(s0, s1, s2, s3)
01267 {
01268 this->m_node->specialType(SH_VECTOR);
01269 }
01270
01271 template<ShBindingType Binding, typename T, bool Swizzled>
01272 template<typename T2,typename T3,typename T4,typename T5>
01273 inline
01274 ShVector<4, Binding, T, Swizzled>::ShVector(const ShGeneric<1, T2>& s0, const ShGeneric<1, T3>& s1, const ShGeneric<1, T4>& s2, const ShGeneric<1, T5>& s3)
01275 : ParentType(s0, s1, s2, s3)
01276 {
01277 this->m_node->specialType(SH_VECTOR);
01278 }
01279
01280 template<ShBindingType Binding, typename T, bool Swizzled>
01281 inline
01282 ShVector<4, Binding, T, Swizzled>::~ShVector()
01283 {
01284 }
01285
01286 template<ShBindingType Binding, typename T, bool Swizzled>
01287 template<typename T2>
01288 inline
01289 ShVector<4, Binding, T, Swizzled>&
01290 ShVector<4, Binding, T, Swizzled>::operator=(const ShGeneric<4, T2>& other)
01291 {
01292 ParentType::operator=(other);
01293 return *this;
01294 }
01295
01296 template<ShBindingType Binding, typename T, bool Swizzled>
01297 inline
01298 ShVector<4, Binding, T, Swizzled>&
01299 ShVector<4, Binding, T, Swizzled>::operator=(const ShVector<4, Binding, T, Swizzled>& other)
01300 {
01301 ParentType::operator=(other);
01302 return *this;
01303 }
01304
01305 template<ShBindingType Binding, typename T, bool Swizzled>
01306 template<typename T2>
01307 inline
01308 ShVector<4, Binding, T, Swizzled>&
01309 ShVector<4, Binding, T, Swizzled>::operator=(const ShVector<4, Binding, T2, Swizzled>& other)
01310 {
01311 ParentType::operator=(other);
01312 return *this;
01313 }
01314
01315 template<ShBindingType Binding, typename T, bool Swizzled>
01316 inline
01317 ShVector<4, Binding, T, Swizzled>&
01318 ShVector<4, Binding, T, Swizzled>::operator=(const ShProgram& prg)
01319 {
01320 ParentType::operator=(prg);
01321 return *this;
01322 }
01323
01324 template<ShBindingType Binding, typename T, bool Swizzled>
01325 template<typename T2>
01326 inline
01327 ShVector<4, Binding, T, Swizzled>&
01328 ShVector<4, Binding, T, Swizzled>::operator+=(const ShGeneric<4, T2>& right)
01329 {
01330 ParentType::operator+=(right);
01331 return *this;
01332 }
01333
01334 template<ShBindingType Binding, typename T, bool Swizzled>
01335 template<typename T2>
01336 inline
01337 ShVector<4, Binding, T, Swizzled>&
01338 ShVector<4, Binding, T, Swizzled>::operator-=(const ShGeneric<4, T2>& right)
01339 {
01340 ParentType::operator-=(right);
01341 return *this;
01342 }
01343
01344 template<ShBindingType Binding, typename T, bool Swizzled>
01345 template<typename T2>
01346 inline
01347 ShVector<4, Binding, T, Swizzled>&
01348 ShVector<4, Binding, T, Swizzled>::operator*=(const ShGeneric<4, T2>& right)
01349 {
01350 ParentType::operator*=(right);
01351 return *this;
01352 }
01353
01354 template<ShBindingType Binding, typename T, bool Swizzled>
01355 template<typename T2>
01356 inline
01357 ShVector<4, Binding, T, Swizzled>&
01358 ShVector<4, Binding, T, Swizzled>::operator/=(const ShGeneric<4, T2>& right)
01359 {
01360 ParentType::operator/=(right);
01361 return *this;
01362 }
01363
01364 template<ShBindingType Binding, typename T, bool Swizzled>
01365 template<typename T2>
01366 inline
01367 ShVector<4, Binding, T, Swizzled>&
01368 ShVector<4, Binding, T, Swizzled>::operator%=(const ShGeneric<4, T2>& right)
01369 {
01370 ParentType::operator%=(right);
01371 return *this;
01372 }
01373
01374 template<ShBindingType Binding, typename T, bool Swizzled>
01375 inline
01376 ShVector<4, Binding, T, Swizzled>&
01377 ShVector<4, Binding, T, Swizzled>::operator+=(host_type right)
01378 {
01379 ParentType::operator+=(right);
01380 return *this;
01381 }
01382
01383 template<ShBindingType Binding, typename T, bool Swizzled>
01384 inline
01385 ShVector<4, Binding, T, Swizzled>&
01386 ShVector<4, Binding, T, Swizzled>::operator-=(host_type right)
01387 {
01388 ParentType::operator-=(right);
01389 return *this;
01390 }
01391
01392 template<ShBindingType Binding, typename T, bool Swizzled>
01393 inline
01394 ShVector<4, Binding, T, Swizzled>&
01395 ShVector<4, Binding, T, Swizzled>::operator*=(host_type right)
01396 {
01397 ParentType::operator*=(right);
01398 return *this;
01399 }
01400
01401 template<ShBindingType Binding, typename T, bool Swizzled>
01402 inline
01403 ShVector<4, Binding, T, Swizzled>&
01404 ShVector<4, Binding, T, Swizzled>::operator/=(host_type right)
01405 {
01406 ParentType::operator/=(right);
01407 return *this;
01408 }
01409
01410 template<ShBindingType Binding, typename T, bool Swizzled>
01411 inline
01412 ShVector<4, Binding, T, Swizzled>&
01413 ShVector<4, Binding, T, Swizzled>::operator%=(host_type right)
01414 {
01415 ParentType::operator%=(right);
01416 return *this;
01417 }
01418
01419 template<ShBindingType Binding, typename T, bool Swizzled>
01420 template<typename T2>
01421 inline
01422 ShVector<4, Binding, T, Swizzled>&
01423 ShVector<4, Binding, T, Swizzled>::operator+=(const ShGeneric<1, T2>& right)
01424 {
01425 ParentType::operator+=(right);
01426 return *this;
01427 }
01428
01429 template<ShBindingType Binding, typename T, bool Swizzled>
01430 template<typename T2>
01431 inline
01432 ShVector<4, Binding, T, Swizzled>&
01433 ShVector<4, Binding, T, Swizzled>::operator-=(const ShGeneric<1, T2>& right)
01434 {
01435 ParentType::operator-=(right);
01436 return *this;
01437 }
01438
01439 template<ShBindingType Binding, typename T, bool Swizzled>
01440 template<typename T2>
01441 inline
01442 ShVector<4, Binding, T, Swizzled>&
01443 ShVector<4, Binding, T, Swizzled>::operator*=(const ShGeneric<1, T2>& right)
01444 {
01445 ParentType::operator*=(right);
01446 return *this;
01447 }
01448
01449 template<ShBindingType Binding, typename T, bool Swizzled>
01450 template<typename T2>
01451 inline
01452 ShVector<4, Binding, T, Swizzled>&
01453 ShVector<4, Binding, T, Swizzled>::operator/=(const ShGeneric<1, T2>& right)
01454 {
01455 ParentType::operator/=(right);
01456 return *this;
01457 }
01458
01459 template<ShBindingType Binding, typename T, bool Swizzled>
01460 template<typename T2>
01461 inline
01462 ShVector<4, Binding, T, Swizzled>&
01463 ShVector<4, Binding, T, Swizzled>::operator%=(const ShGeneric<1, T2>& right)
01464 {
01465 ParentType::operator%=(right);
01466 return *this;
01467 }
01468
01469 template<ShBindingType Binding, typename T, bool Swizzled>
01470 inline
01471 ShVector<1, Binding, T, true>
01472 ShVector<4, Binding, T, Swizzled>::operator()(int s0) const
01473 {
01474 return ShVector<1, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(4, s0), this->m_neg);
01475 }
01476
01477 template<ShBindingType Binding, typename T, bool Swizzled>
01478 inline
01479 ShVector<2, Binding, T, true>
01480 ShVector<4, Binding, T, Swizzled>::operator()(int s0, int s1) const
01481 {
01482 return ShVector<2, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(4, s0, s1), this->m_neg);
01483 }
01484
01485 template<ShBindingType Binding, typename T, bool Swizzled>
01486 inline
01487 ShVector<3, Binding, T, true>
01488 ShVector<4, Binding, T, Swizzled>::operator()(int s0, int s1, int s2) const
01489 {
01490 return ShVector<3, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(4, s0, s1, s2), this->m_neg);
01491 }
01492
01493 template<ShBindingType Binding, typename T, bool Swizzled>
01494 inline
01495 ShVector<4, Binding, T, true>
01496 ShVector<4, Binding, T, Swizzled>::operator()(int s0, int s1, int s2, int s3) const
01497 {
01498 return ShVector<4, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(4, s0, s1, s2, s3), this->m_neg);
01499 }
01500
01501 template<ShBindingType Binding, typename T, bool Swizzled>
01502 template<int N2>
01503 ShVector<N2, Binding, T, true>
01504 ShVector<4, Binding, T, Swizzled>::swiz(int indices[]) const
01505 {
01506 return ShVector<N2, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(4, N2, indices), this->m_neg);
01507 }
01508
01509 template<ShBindingType Binding, typename T, bool Swizzled>
01510 inline
01511 ShVector<1, Binding, T, true>
01512 ShVector<4, Binding, T, Swizzled>::operator[](int s0) const
01513 {
01514 return ShVector<1, Binding, T, true>(this->m_node, this->m_swizzle * ShSwizzle(4, s0), this->m_neg);
01515 }
01516
01517 template<ShBindingType Binding, typename T, bool Swizzled>
01518 ShVector<4, Binding, T, Swizzled>
01519 ShVector<4, Binding, T, Swizzled>::operator-() const
01520 {
01521 return ShVector<4, Binding, T, Swizzled>(this->m_node, this->m_swizzle, !this->m_neg);
01522 }
01523
01524
01525 }
01526
01527 #endif // SH_SHVECTORIMPL_HPP