@@ -43,7 +43,7 @@ class ICOORD {
43
43
// / constructor
44
44
// /@param xin x value
45
45
// /@param yin y value
46
- ICOORD (int16_t xin, int16_t yin) {
46
+ ICOORD (TDimension xin, TDimension yin) {
47
47
xcoord = xin;
48
48
ycoord = yin;
49
49
}
@@ -54,20 +54,20 @@ class ICOORD {
54
54
bool Serialize (TFile *f) const ;
55
55
56
56
// / access function
57
- int16_t x () const {
57
+ TDimension x () const {
58
58
return xcoord;
59
59
}
60
60
// / access_function
61
- int16_t y () const {
61
+ TDimension y () const {
62
62
return ycoord;
63
63
}
64
64
65
65
// / rewrite function
66
- void set_x (int16_t xin) {
66
+ void set_x (TDimension xin) {
67
67
xcoord = xin; // write new value
68
68
}
69
69
// / rewrite function
70
- void set_y (int16_t yin) { // value to set
70
+ void set_y (TDimension yin) { // value to set
71
71
ycoord = yin;
72
72
}
73
73
@@ -128,15 +128,15 @@ class ICOORD {
128
128
// / cross product
129
129
friend int32_t operator *(const ICOORD &, const ICOORD &);
130
130
// / multiply
131
- friend ICOORD operator *(const ICOORD &, int16_t );
131
+ friend ICOORD operator *(const ICOORD &, TDimension );
132
132
// / multiply
133
- friend ICOORD operator *(int16_t , const ICOORD &);
133
+ friend ICOORD operator *(TDimension , const ICOORD &);
134
134
// / multiply
135
- friend ICOORD &operator *=(ICOORD &, int16_t );
135
+ friend ICOORD &operator *=(ICOORD &, TDimension );
136
136
// / divide
137
- friend ICOORD operator /(const ICOORD &, int16_t );
137
+ friend ICOORD operator /(const ICOORD &, TDimension );
138
138
// / divide
139
- friend ICOORD &operator /=(ICOORD &, int16_t );
139
+ friend ICOORD &operator /=(ICOORD &, TDimension );
140
140
// / rotate
141
141
// /@param vec by vector
142
142
void rotate (const FCOORD &vec);
@@ -155,8 +155,8 @@ class ICOORD {
155
155
bool DeSerialize (bool swap, FILE *fp);
156
156
157
157
protected:
158
- int16_t xcoord; // /< x value
159
- int16_t ycoord; // /< y value
158
+ TDimension xcoord; // /< x value
159
+ TDimension ycoord; // /< y value
160
160
};
161
161
162
162
class ICOORDELT : public ELIST_LINK ,
@@ -171,7 +171,7 @@ class ICOORDELT : public ELIST_LINK,
171
171
// / constructor
172
172
// /@param xin x value
173
173
// /@param yin y value
174
- ICOORDELT (int16_t xin, int16_t yin) {
174
+ ICOORDELT (TDimension xin, TDimension yin) {
175
175
xcoord = xin;
176
176
ycoord = yin;
177
177
}
@@ -438,7 +438,7 @@ inline int32_t operator*( // cross product
438
438
439
439
inline ICOORD operator *( // scalar multiply
440
440
const ICOORD &op1, // operands
441
- int16_t scale) {
441
+ TDimension scale) {
442
442
ICOORD result; // output
443
443
444
444
result.xcoord = op1.xcoord * scale;
@@ -447,7 +447,7 @@ inline ICOORD operator*( // scalar multiply
447
447
}
448
448
449
449
inline ICOORD operator *( // scalar multiply
450
- int16_t scale,
450
+ TDimension scale,
451
451
const ICOORD &op1 // operands
452
452
) {
453
453
ICOORD result; // output
@@ -465,7 +465,7 @@ inline ICOORD operator*( // scalar multiply
465
465
466
466
inline ICOORD &operator *=( // scalar multiply
467
467
ICOORD &op1, // operands
468
- int16_t scale) {
468
+ TDimension scale) {
469
469
op1.xcoord *= scale;
470
470
op1.ycoord *= scale;
471
471
return op1;
@@ -479,7 +479,7 @@ inline ICOORD &operator*=( // scalar multiply
479
479
480
480
inline ICOORD operator /( // scalar divide
481
481
const ICOORD &op1, // operands
482
- int16_t scale) {
482
+ TDimension scale) {
483
483
ICOORD result; // output
484
484
485
485
result.xcoord = op1.xcoord / scale;
@@ -495,7 +495,7 @@ inline ICOORD operator/( // scalar divide
495
495
496
496
inline ICOORD &operator /=( // scalar divide
497
497
ICOORD &op1, // operands
498
- int16_t scale) {
498
+ TDimension scale) {
499
499
op1.xcoord /= scale;
500
500
op1.ycoord /= scale;
501
501
return op1;
@@ -509,8 +509,8 @@ inline ICOORD &operator/=( // scalar divide
509
509
510
510
inline void ICOORD::rotate ( // rotate by vector
511
511
const FCOORD &vec) {
512
- auto tmp = static_cast <int16_t >(std::floor (xcoord * vec.x () - ycoord * vec.y () + 0 .5f ));
513
- ycoord = static_cast <int16_t >(std::floor (ycoord * vec.x () + xcoord * vec.y () + 0 .5f ));
512
+ auto tmp = static_cast <TDimension >(std::floor (xcoord * vec.x () - ycoord * vec.y () + 0 .5f ));
513
+ ycoord = static_cast <TDimension >(std::floor (ycoord * vec.x () + xcoord * vec.y () + 0 .5f ));
514
514
xcoord = tmp;
515
515
}
516
516
0 commit comments