00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef CATPOINT_H
00013 #define CATPOINT_H
00014
00015 #include "CATTypes.h"
00016 #include <math.h>
00017
00018
00019
00020
00021 class CATPoint
00022 {
00023 public:
00024 CATPoint( const CATPoint& point)
00025 {
00026 x=point.x;
00027 y=point.y;
00028 size=point.size;
00029 }
00030
00031 CATPoint( CATFloat64 xp, CATFloat64 yp, CATFloat64 sizep=0.0)
00032 {
00033 x = xp;
00034 y = yp;
00035 size = sizep;
00036 }
00037
00038 CATPoint()
00039 {
00040 Clear();
00041 }
00042
00043 void Clear()
00044 {
00045 x = 0.0;
00046 y = 0.0;
00047 size = 0.0;
00048 }
00049
00050 virtual ~CATPoint()
00051 {
00052
00053 }
00054
00055
00056 CATPoint operator+(const CATPoint& npoint)
00057 {
00058 CATPoint point(*this);
00059 point.x += npoint.x;
00060 point.y += npoint.y;
00061
00062 return point;
00063 }
00064
00065 CATPoint operator-(const CATPoint& npoint)
00066 {
00067 CATPoint point(*this);
00068 point.x -= npoint.x;
00069 point.y -= npoint.y;
00070
00071 return point;
00072 }
00073
00074 CATPoint& operator=(const CATPoint& npoint)
00075 {
00076 x = npoint.x;
00077 y = npoint.y;
00078 size = npoint.size;
00079 return *this;
00080 }
00081
00082 CATPoint operator*(CATFloat64 scaler)
00083 {
00084 CATPoint point(*this);
00085 point.x *= scaler;
00086 point.y *= scaler;
00087
00088 return point;
00089 }
00090
00091 CATPoint operator/(CATFloat64 scaler)
00092 {
00093 CATPoint point(*this);
00094 point.x /= scaler;
00095 point.y /= scaler;
00096
00097 return point;
00098 }
00099
00100 CATPoint operator*(const CATPoint& npoint)
00101 {
00102 CATPoint point(*this);
00103 point.x *= npoint.x;
00104 point.y *= npoint.y;
00105
00106 return point;
00107 }
00108
00109 public:
00110 CATFloat64 x;
00111 CATFloat64 y;
00112
00113 CATFloat64 size;
00114 };
00115
00116
00117
00118
00119 class CATScanPoint
00120 {
00121 public:
00122 CATScanPoint( const CATScanPoint& point)
00123 {
00124 y = point.y;
00125 z = point.z;
00126 rotation = point.rotation;
00127 color = point.color;
00128 }
00129
00130 CATScanPoint( CATFloat64 yp, CATFloat64 zp, CATFloat64 rot_deg = 0, CATUInt32 colorp = 0)
00131 {
00132 y = yp;
00133 z = zp;
00134 rotation = rot_deg;
00135 color = colorp;
00136 }
00137
00138 CATScanPoint()
00139 {
00140 y = 0.0;
00141 z = 0.0;
00142 color = 0;
00143 rotation = 0.0;
00144 }
00145
00146 virtual ~CATScanPoint()
00147 {
00148
00149 }
00150
00151 CATScanPoint& operator=(const CATScanPoint& npoint)
00152 {
00153 y = npoint.y;
00154 z = npoint.z;
00155 rotation = npoint.rotation;
00156 color = npoint.color;
00157 return *this;
00158 }
00159
00160 public:
00161 CATFloat64 y;
00162 CATFloat64 z;
00163 CATFloat64 rotation;
00164 CATUInt32 color;
00165 };
00166
00167
00168
00169
00170
00171 class CATC3DPoint
00172 {
00173 public:
00174 CATC3DPoint( const CATC3DPoint& point)
00175 {
00176 x = point.x;
00177 y = point.y;
00178 z = point.z;
00179 color = point.color;
00180 size = point.size;
00181 }
00182
00183 CATC3DPoint( CATFloat64 xp, CATFloat64 yp, CATFloat64 zp, CATFloat64 sizep = 0, CATUInt32 colorp = 0)
00184 {
00185 x = xp;
00186 y = yp;
00187 z = zp;
00188 color = colorp;
00189 size = sizep;
00190 }
00191
00192 CATC3DPoint()
00193 {
00194 x = 0.0;
00195 y = 0.0;
00196 z = 0.0;
00197 color = 0;
00198 size = 0.0;
00199 }
00200
00201 virtual ~CATC3DPoint()
00202 {
00203
00204 }
00205
00206 CATC3DPoint& FromScannedPolar( CATFloat64 yp, CATFloat64 zp, CATFloat64 theta_degrees, CATUInt32 colorp)
00207 {
00208
00209 color = colorp;
00210
00211
00212 y = yp;
00213
00214
00215 CATFloat64 x1 = 0.0;
00216
00217
00218
00219 CATFloat64 z1 = zp - 6.0;
00220
00221
00222 CATFloat64 thetaRads = theta_degrees*kCATDEGTORAD;
00223
00224
00225 x = z1*sin(thetaRads);
00226 z = z1*cos(thetaRads);
00227
00228 return *this;
00229 }
00230
00231
00232 CATC3DPoint operator+(const CATC3DPoint& npoint)
00233 {
00234 CATC3DPoint point(*this);
00235 point.x += npoint.x;
00236 point.y += npoint.y;
00237 point.z += npoint.z;
00238
00239 return point;
00240 }
00241
00242 CATC3DPoint operator-(const CATC3DPoint& npoint)
00243 {
00244 CATC3DPoint point(*this);
00245 point.x -= npoint.x;
00246 point.y -= npoint.y;
00247 point.z -= npoint.z;
00248
00249 return point;
00250 }
00251
00252 CATC3DPoint& operator=(const CATC3DPoint& npoint)
00253 {
00254 x = npoint.x;
00255 y = npoint.y;
00256 z = npoint.z;
00257 color = npoint.color;
00258 size = npoint.size;
00259 return *this;
00260 }
00261
00262 CATC3DPoint operator*(CATFloat64 scaler)
00263 {
00264 CATC3DPoint point(*this);
00265 point.x *= scaler;
00266 point.y *= scaler;
00267 point.z *= scaler;
00268
00269 return point;
00270 }
00271
00272 CATC3DPoint operator/(CATFloat64 scaler)
00273 {
00274 CATC3DPoint point(*this);
00275 point.x /= scaler;
00276 point.y /= scaler;
00277 point.z /= scaler;
00278
00279 return point;
00280 }
00281
00282 CATC3DPoint operator*(const CATC3DPoint& npoint)
00283 {
00284 CATC3DPoint point(*this);
00285 point.x *= npoint.x;
00286 point.y *= npoint.y;
00287 point.z *= npoint.z;
00288
00289 return point;
00290 }
00291
00292 public:
00293 CATFloat64 x;
00294 CATFloat64 y;
00295 CATFloat64 z;
00296 CATFloat64 size;
00297 CATUInt32 color;
00298 };
00299 #endif // CATPOINT_H