Changeset 537:63b51a661d40


Ignore:
Timestamp:
04/28/08 11:35:58 (2 years ago)
Author:
Howard Butler <hobu.inc@…>
Branch:
default
Convert:
svn:1766ff46-f334-0410-ab20-d63176f87757/trunk@603
Message:

a first cut at a LASPoint::Validate() method

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/liblas/laspoint.hpp

    r525 r537  
    9999    bool equal(LASPoint const& other) const; 
    100100 
     101    bool Validate() const; 
     102     
    101103private: 
    102104 
  • src/laspoint.cpp

    r536 r537  
    142142} 
    143143 
     144bool LASPoint::Validate() const 
     145{ 
     146     
     147    if (eScanAngleRankMin > this->GetScanAngleRank() || this->GetScanAngleRank() > eScanAngleRankMax) 
     148        throw std::out_of_range("scan angle rank out of range"); 
     149 
     150    if (this->GetFlightLineEdge() > 0x01) 
     151        throw std::out_of_range("edge of flight line out of range"); 
     152 
     153    if (this->GetScanDirection() > 0x01) 
     154        throw std::out_of_range("scan direction flag out of range"); 
     155 
     156    if (this->GetNumberOfReturns() > 0x07) 
     157        throw std::out_of_range("number of returns out of range"); 
     158 
     159    if (this->GetReturnNumber() > 0x07) 
     160        throw std::out_of_range("return number out of range"); 
     161 
     162    if (this->GetTime() < 0.0) 
     163        throw std::out_of_range("time value is < 0 "); 
     164     
     165    if (this->GetClassification() > 31) 
     166        throw std::out_of_range("classification value is > 31"); 
     167 
     168 
     169    return true; 
     170} 
    144171} // namespace liblas 
Note: See TracChangeset for help on using the changeset viewer.