00001 00042 #ifndef INC_MI32_LIDARLASDATASET_H 00043 #define INC_MI32_LIDARLASDATASET_H 00044 00045 #ifndef INC_MI32_LIDARLASPOINT_H 00046 #include <mi32/lidarlaspoint.h> 00047 #endif 00048 00049 #ifndef INC_MI32_RECT_H 00050 #include <mi32/rect.h> 00051 #endif 00052 00053 #ifndef GENERATING_DOXYGEN_OUTPUT 00054 // Forward declarations. 00055 class UNSIGNEDSET; 00056 class FILEPATH; 00057 class FILEPATHLIST; 00058 class REGION2D; 00059 class STAT_UNIVARIATE; 00060 namespace LIDAR { 00061 class CLASSDESCSET; 00062 namespace LAS { 00063 class FILE; 00064 } 00065 } 00066 namespace SPATREF { 00067 class COORDREFSYS; 00068 } 00069 #endif 00070 00071 namespace LIDAR { 00072 namespace LAS { 00073 00074 00075 //===================================================================================================================== 00076 00078 class DATASET { 00079 public: 00080 00081 00083 class POINTITERATOR { 00084 public: 00085 00087 explicit POINTITERATOR ( 00088 DATASET& dataset 00089 ); 00090 00091 ~POINTITERATOR (); 00092 00094 const POINTRECORD& operator* ( 00095 ) const { return (m_PointRecord); } 00096 00098 POINTRECORD& operator* ( 00099 ) { return (m_PointRecord); } 00100 00102 const POINTRECORD* operator-> ( 00103 ) const { return (&m_PointRecord); } 00104 00106 POINTRECORD* operator-> ( 00107 ) { return (&m_PointRecord); } 00108 00110 POINTITERATOR& operator++ (); 00111 00113 bool AtEnd () const 00114 { return (m_AtEnd); } 00115 00117 ERRVALUE Begin (); 00118 00122 INT64 FindClosest ( 00123 const DPOINT2D& pt, 00124 double SearchDist, 00125 double *pDistFound = 0 00126 ); 00127 00129 INT64 GetPointNum () const; 00130 00132 ERRVALUE Increment (); 00133 00135 void SetDelegateOnReportProgress ( 00136 DELEGATE_ERRVALUE_DOUBLE delegate 00137 ); 00138 00141 void SetExtents ( 00142 const DRECT2D& extents 00143 ); 00144 00147 void SetFilter ( 00148 DELEGATE_BOOL_POINTRECORD delegate 00149 ); 00150 00154 void SetPointSet ( 00155 const UNSIGNEDSET *pPointSet 00156 ); 00157 00159 ERRVALUE UpdateFile (); 00160 00161 private: 00162 #ifndef GENERATING_DOXYGEN_OUTPUT 00163 class PRIV; 00164 PRIV *m_pPriv; 00165 POINTRECORD m_PointRecord; 00166 bool m_AtEnd; 00167 #endif 00168 }; 00169 00171 DATASET (); 00172 00174 ~DATASET (); 00175 00178 void AddDelegateOnChangeClassDescSet ( 00179 DELEGATE_VOID_NOPARMS delegate 00180 ); 00181 00183 ERRVALUE AddFile ( 00184 const FILEPATH& laspath 00185 ); 00186 00188 ERRVALUE AddFiles ( 00189 const FILEPATHLIST& laspathlist 00190 ); 00191 00193 void Clear (); 00194 00196 const CLASSDESCSET& GetClassDescSet () const; 00197 00199 const SPATREF::COORDREFSYS& GetCRS () const; 00200 00202 const DRECT3D& GetExtents () const; 00203 00205 double GetPointDensity () const; 00206 00208 ERRVALUE GetRegion ( 00209 REGION2D& region 00210 ) const; 00211 00213 const STAT_UNIVARIATE& GetStatIntensity () const; 00214 00216 INT64 GetTotalPoints () const; 00217 00219 bool HasTotalPoints () const; 00220 00222 bool IsClassUsed ( 00223 UINT16 ClassNumber 00224 ) const; 00225 00227 ERRVALUE Open ( 00228 const FILEPATH& filepath 00229 ); 00230 00232 ERRVALUE ReadPoint ( 00233 INT64 PointNum, 00234 POINTARRAY& PointArray 00235 ); 00236 00238 void RemoveDelegateOnChangeClassDescSet ( 00239 DELEGATE_VOID_NOPARMS delegate 00240 ); 00241 00243 ERRVALUE Save ( 00244 const FILEPATH& filepath 00245 ); 00246 00248 ERRVALUE Scan ( 00249 ); 00250 00253 ERRVALUE ScanTotalPoints () const; 00254 00256 void SetClassDescSet ( 00257 const CLASSDESCSET& classdesc 00258 ); 00259 00261 void SetClassUsed ( 00262 UINT16 ClassNumber, 00263 bool isused = true, 00264 bool notify = true 00265 ); 00266 00268 void SetCRS ( 00269 const SPATREF::COORDREFSYS& crs 00270 ); 00271 00273 void SetStatIntensity ( 00274 const STAT_UNIVARIATE StatIntensity 00275 ); 00276 00278 ERRVALUE Update ( 00279 ); 00280 00281 private: 00282 #ifndef GENERATING_DOXYGEN_OUTPUT 00283 class FILEITEM; 00284 class PRIV; 00285 PRIV *m_pPriv; 00286 00287 DATASET (DATASET&); 00288 DATASET& operator= (DATASET&); 00289 #endif 00290 }; 00291 00292 //===================================================================================================================== 00293 00294 } // End namespace LAS 00295 } // End namespace LIDAR 00296 00297 #endif // INC_MI32_LIDARLASDATASET_H
1.6.1