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
00032
00033
00034
00035
00036
00037
00038
00039
00040 namespace qgar
00041 {
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 class TEMPLATE_FUNCTION_CANNOT_BE_INSTANTIATED_SEE_DOC;
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 template <class T>
00063 AbstractGenPrimitive<T>::AbstractGenPrimitive()
00064
00065 : _source(static_cast<T>(0), static_cast<T>(0)),
00066 _target(static_cast<T>(0), static_cast<T>(0))
00067
00068 {
00069
00070 }
00071
00072
00073
00074
00075
00076 template <class T>
00077 AbstractGenPrimitive<T>::AbstractGenPrimitive(const AbstractGenPrimitive<T>& aPrim)
00078
00079 : _source(aPrim._source),
00080 _target(aPrim._target)
00081
00082 {
00083
00084 }
00085
00086
00087
00088
00089
00090 template <class T>
00091 AbstractGenPrimitive<T>::AbstractGenPrimitive(const GenPoint<T> aSource,
00092 const GenPoint<T> aTarget)
00093
00094 : _source(aSource),
00095 _target(aTarget)
00096
00097 {
00098
00099 }
00100
00101
00102
00103
00104
00105 template <class T>
00106 AbstractGenPrimitive<T>::AbstractGenPrimitive(T aXSource,
00107 T aYSource,
00108 T aXTarget,
00109 T aYTarget)
00110
00111 : _source(aXSource, aYSource),
00112 _target(aXTarget, aYTarget)
00113
00114 {
00115
00116 }
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127 template <class T>
00128 AbstractGenPrimitive<T>::~AbstractGenPrimitive()
00129 {
00130
00131 }
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141 template <class T>
00142 inline const GenPoint<T>&
00143 AbstractGenPrimitive<T>::accessSource() const
00144 {
00145 return _source;
00146 }
00147
00148
00149
00150
00151 template <class T>
00152 inline GenPoint<T>
00153 AbstractGenPrimitive<T>::source() const
00154 {
00155 return _source;
00156 }
00157
00158
00159
00160
00161 template <class T>
00162 inline const GenPoint<T>&
00163 AbstractGenPrimitive<T>::accessTarget() const
00164 {
00165 return _target;
00166 }
00167
00168
00169
00170
00171 template <class T>
00172 inline GenPoint<T>
00173 AbstractGenPrimitive<T>::target() const
00174 {
00175 return _target;
00176 }
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186 template <class T>
00187 inline T
00188 AbstractGenPrimitive<T>::xSource() const
00189 {
00190 return _source.x();
00191 }
00192
00193
00194
00195
00196 template <class T>
00197 inline T
00198 AbstractGenPrimitive<T>::xTarget() const
00199 {
00200 return _target.x();
00201 }
00202
00203
00204
00205
00206 template <class T>
00207 inline T
00208 AbstractGenPrimitive<T>::ySource() const
00209 {
00210 return _source.y();
00211 }
00212
00213
00214
00215
00216 template <class T>
00217 inline T
00218 AbstractGenPrimitive<T>::yTarget() const
00219 {
00220 return _target.y();
00221 }
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231 template <class T>
00232 inline T
00233 AbstractGenPrimitive<T>::dx() const
00234 {
00235 return (_target.x() - _source.x());
00236 }
00237
00238
00239
00240
00241 template <class T>
00242 inline T
00243 AbstractGenPrimitive<T>::dy() const
00244 {
00245 return (_target.y() - _source.y());
00246 }
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257 template <class T>
00258 inline void
00259 AbstractGenPrimitive<T>::setSource(T aX, T aY)
00260 {
00261 _source.setXY(aX,aY);
00262 }
00263
00264
00265 template <class T>
00266 inline void
00267 AbstractGenPrimitive<T>::setSource(const GenPoint<T>& aPt)
00268 {
00269 _source = aPt;
00270 }
00271
00272
00273
00274
00275
00276 template <class T>
00277 inline void
00278 AbstractGenPrimitive<T>::setTarget(T aX, T aY)
00279 {
00280 _target.setXY(aX,aY);
00281 }
00282
00283
00284 template <class T>
00285 inline void
00286 AbstractGenPrimitive<T>::setTarget(const GenPoint<T>& aPt)
00287 {
00288 _target = aPt;
00289 }
00290
00291
00292
00293
00294
00295 template <class T>
00296 void
00297 AbstractGenPrimitive<T>::setSourceTarget(T aXSource,
00298 T aYSource,
00299 T aXTarget,
00300 T aYTarget)
00301 {
00302 _source.setXY(aXSource, aYSource);
00303 _target.setXY(aXTarget, aYTarget);
00304 }
00305
00306
00307 template <class T>
00308 void
00309 AbstractGenPrimitive<T>::setSourceTarget(const GenPoint<T>& aSource,
00310 const GenPoint<T>& aTarget)
00311 {
00312 _source = aSource;
00313 _target = aTarget;
00314 }
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325 template <class T>
00326 void
00327 AbstractGenPrimitive<T>::fixSource(T aX, T aY)
00328 {
00329 this->setSource(aX,aY);
00330 this->updateSource();
00331 }
00332
00333
00334 template <class T>
00335 void
00336 AbstractGenPrimitive<T>::fixSource(const GenPoint<T>& aPt)
00337 {
00338 this->setSource(aPt);
00339 this->updateSource();
00340 }
00341
00342
00343
00344
00345
00346 template <class T>
00347 void
00348 AbstractGenPrimitive<T>::fixTarget(T aX, T aY)
00349 {
00350 this->setTarget(aX,aY);
00351 this->updateTarget();
00352 }
00353
00354
00355 template <class T>
00356 void
00357 AbstractGenPrimitive<T>::fixTarget(const GenPoint<T>& aPt)
00358 {
00359 this->setTarget(aPt);
00360 this->updateTarget();
00361 }
00362
00363
00364
00365
00366
00367 template <class T>
00368 void
00369 AbstractGenPrimitive<T>::fixSourceTarget(T aXSource,
00370 T aYSource,
00371 T aXTarget,
00372 T aYTarget)
00373 {
00374 this->setSourceTarget(aXSource, aYSource, aXTarget, aYTarget);
00375 this->updateSourceTarget();
00376 }
00377
00378
00379 template <class T>
00380 void
00381 AbstractGenPrimitive<T>::fixSourceTarget(const GenPoint<T>& aSource,
00382 const GenPoint<T>& aTarget)
00383 {
00384 this->setSourceTarget(aSource, aTarget);
00385 this->updateSourceTarget();
00386 }
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396 template <class T>
00397 inline void
00398 AbstractGenPrimitive<T>::setXSource(T aX)
00399 {
00400 (this->_source).setX(aX);
00401 }
00402
00403
00404
00405
00406 template <class T>
00407 inline void
00408 AbstractGenPrimitive<T>::setXTarget(T aX)
00409 {
00410 (this->_target).setX(aX);
00411 }
00412
00413
00414
00415
00416 template <class T>
00417 inline void
00418 AbstractGenPrimitive<T>::setYSource(T aY)
00419 {
00420 (this->_source).setY(aY);
00421 }
00422
00423
00424
00425
00426 template <class T>
00427 inline void
00428 AbstractGenPrimitive<T>::setYTarget(T aY)
00429 {
00430 (this->_target).setY(aY);
00431 }
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441 template <class T>
00442 void
00443 AbstractGenPrimitive<T>::fixXSource(T aX)
00444 {
00445 this->setXSource(aX);
00446 this->updateSource();
00447 }
00448
00449
00450
00451
00452 template <class T>
00453 void
00454 AbstractGenPrimitive<T>::fixXTarget(T aX)
00455 {
00456 this->setXTarget(aX);
00457 this->updateTarget();
00458 }
00459
00460
00461
00462
00463 template <class T>
00464 void
00465 AbstractGenPrimitive<T>::fixYSource(T aY)
00466 {
00467 this->setYSource(aY);
00468 this->updateSource();
00469 }
00470
00471
00472
00473
00474 template <class T>
00475 void
00476 AbstractGenPrimitive<T>::fixYTarget(T aY)
00477 {
00478 this->setYTarget(aY);
00479 this->updateTarget();
00480 }
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490 template <class T>
00491 AbstractGenPrimitive<T>&
00492 AbstractGenPrimitive<T>::operator=(const AbstractGenPrimitive<T>& aPrim)
00493 {
00494
00495 if (this != &aPrim)
00496 {
00497 this->_source = aPrim._source;
00498 this->_target = aPrim._target;
00499 }
00500
00501 return *this;
00502 }
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590 }