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