Changeset 1613:37cb1f6775c0
- Timestamp:
- 03/05/10 09:10:00 (5 months ago)
- Branch:
- default
- Files:
-
- 43 edited
-
apps/las2oci.cpp (modified) (12 diffs)
-
apps/las2ogr.cpp (modified) (2 diffs)
-
apps/lasindex.cpp (modified) (3 diffs)
-
apps/ts2las.cpp (modified) (5 diffs)
-
include/liblas/detail/fwd.hpp (modified) (1 diff)
-
include/liblas/detail/reader/header.hpp (modified) (2 diffs)
-
include/liblas/detail/reader/point.hpp (modified) (2 diffs)
-
include/liblas/detail/reader/reader.hpp (modified) (2 diffs)
-
include/liblas/detail/writer/header.hpp (modified) (2 diffs)
-
include/liblas/detail/writer/point.hpp (modified) (2 diffs)
-
include/liblas/detail/writer/writer.hpp (modified) (3 diffs)
-
include/liblas/index/datastream.hpp (modified) (2 diffs)
-
include/liblas/index/index.hpp (modified) (2 diffs)
-
include/liblas/index/storage.hpp (modified) (2 diffs)
-
include/liblas/lasclassification.hpp (modified) (9 diffs)
-
include/liblas/lascolor.hpp (modified) (5 diffs)
-
include/liblas/lasformat.hpp (modified) (3 diffs)
-
include/liblas/lasheader.hpp (modified) (6 diffs)
-
include/liblas/laspoint.hpp (modified) (16 diffs)
-
include/liblas/lasreader.hpp (modified) (5 diffs)
-
include/liblas/lasspatialreference.hpp (modified) (5 diffs)
-
include/liblas/lasvariablerecord.hpp (modified) (6 diffs)
-
include/liblas/laswriter.hpp (modified) (4 diffs)
-
include/liblas/liblas.hpp (modified) (3 diffs)
-
src/detail/reader/header.cpp (modified) (2 diffs)
-
src/detail/reader/point.cpp (modified) (5 diffs)
-
src/detail/reader/reader.cpp (modified) (9 diffs)
-
src/detail/writer/header.cpp (modified) (3 diffs)
-
src/detail/writer/point.cpp (modified) (7 diffs)
-
src/detail/writer/writer.cpp (modified) (6 diffs)
-
src/index/datastream.cpp (modified) (2 diffs)
-
src/index/index.cpp (modified) (2 diffs)
-
src/index/storage.cpp (modified) (7 diffs)
-
src/las_c_api.cpp (modified) (153 diffs)
-
src/lasclassification.cpp (modified) (1 diff)
-
src/lascolor.cpp (modified) (4 diffs)
-
src/lasformat.cpp (modified) (5 diffs)
-
src/lasheader.cpp (modified) (29 diffs)
-
src/laspoint.cpp (modified) (11 diffs)
-
src/lasreader.cpp (modified) (11 diffs)
-
src/lasspatialreference.cpp (modified) (22 diffs)
-
src/lasvariablerecord.cpp (modified) (11 diffs)
-
src/laswriter.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
apps/las2oci.cpp
r1611 r1613 313 313 314 314 } 315 bool GetPointData( LASPoint const& p,315 bool GetPointData( liblas::Point const& p, 316 316 bool bTime, 317 317 std::vector<liblas::uint8_t>& point_data) … … 367 367 } 368 368 bool GetResultData( const LASQueryResult& result, 369 LASReader* reader,369 liblas::Reader* reader, 370 370 std::vector<liblas::uint8_t>& data, 371 371 int nDimension) … … 399 399 bool doRead = reader->ReadPointAt(id); 400 400 if (doRead) { 401 LASPoint const& p = reader->GetPoint();401 liblas::Point const& p = reader->GetPoint(); 402 402 403 403 // d 8-byte IEEE big-endian doubles, where d is the PC_TOT_DIMENSIONS value … … 496 496 return e; 497 497 } 498 498 499 blocks* CreateBlock(int size) 499 500 { … … 509 510 510 511 b->element_arrays = (OCIArray**) malloc ( size * sizeof(OCIArray*)); 512 511 513 b->coordinate_arrays = (OCIArray**) malloc ( size * sizeof(OCIArray*)); 512 514 return b; 513 515 } 516 514 517 bool FillBlock( OWConnection* connection, 515 518 OWStatement* statement, 516 519 const LASQueryResult& result, 517 LASReader* reader,520 liblas::Reader* reader, 518 521 blocks* b, 519 522 long index, … … 529 532 530 533 list<SpatialIndex::id_type> const& ids = result.GetIDs(); 531 532 b->pc_ids[index] = pc_id;533 b->srids[index] = srid;534 b->block_ids[index] = result.GetID();535 b->num_points[index] = (long)ids.size();536 534 537 535 // TODO: This probably is a memory leak if the gotdata == false --mloskot 538 536 std::vector<liblas::uint8_t>* blob = new std::vector<liblas::uint8_t>; 539 537 540 bool gotdata = GetResultData(result, reader, *blob, nDimensions); 541 if (! gotdata) throw std::runtime_error("unable to fetch point data byte array"); 542 b->blobs[index] = blob; 543 // FIXME: null srids not supported 544 b->srids[index] = srid; 545 b->gtypes[index] = gtype; 546 547 OCIArray* sdo_elem_info=0; 548 connection->CreateType(&sdo_elem_info, connection->GetElemInfoType()); 549 SetElements(statement, sdo_elem_info, bUseSolidGeometry); 550 551 b->element_arrays[index] = sdo_elem_info; 552 553 OCIArray* sdo_ordinates=0; 554 connection->CreateType(&sdo_ordinates, connection->GetOrdinateType()); 555 556 557 558 extent* e = GetExtent(result.GetBounds(), bUse3d); 559 SetOrdinates(statement, sdo_ordinates, e); 560 561 b->coordinate_arrays[index] = sdo_ordinates; 538 // b->pc_ids[index] = pc_id; 539 printf("Index: %d\n", index); 540 b->srids[index] = (long)srid; 541 // b->block_ids[index] = result.GetID(); 542 // b->num_points[index] = (long)ids.size(); 543 544 // std::vector<liblas::uint8_t>* blob = new std::vector<liblas::uint8_t>; 545 546 // bool gotdata = GetResultData(result, reader, *blob, nDimensions); 547 // if (! gotdata) throw std::runtime_error("unable to fetch point data byte array"); 548 // b->blobs[index] = blob; 549 // // FIXME: null srids not supported 550 // b->srids[index] = srid; 551 // b->gtypes[index] = gtype; 552 // 553 // OCIArray* sdo_elem_info=0; 554 // connection->CreateType(&sdo_elem_info, connection->GetElemInfoType()); 555 // SetElements(statement, sdo_elem_info, bUseSolidGeometry); 556 // 557 // b->element_arrays[index] = sdo_elem_info; 558 // 559 // OCIArray* sdo_ordinates=0; 560 // connection->CreateType(&sdo_ordinates, connection->GetOrdinateType()); 561 // 562 // 563 // 564 // extent* e = GetExtent(result.GetBounds(), bUse3d); 565 // SetOrdinates(statement, sdo_ordinates, e); 566 // 567 // b->coordinate_arrays[index] = sdo_ordinates; 562 568 563 569 return true; … … 643 649 long block_index, 644 650 int srid, 645 LASReader* reader,651 liblas::Reader* reader, 646 652 const char* tableName, 647 653 long precision, … … 758 764 long nCommitInterval, 759 765 int srid, 760 LASReader* reader2,766 liblas::Reader* reader2, 761 767 const std::string& table_name, 762 768 long precision, … … 785 791 long j = 0; 786 792 bool inserted = false; 793 794 795 for (int t = 0; t < commit_interval; t++) { 796 FillBlock( con, 797 statement, 798 *i, 799 reader2, 800 b, 801 t, 802 srid, 803 pc_id, 804 GetGType(bUse3d, bUseSolidGeometry), 805 bUseSolidGeometry, 806 bUse3d, 807 nDimensions 808 ); 809 810 } 811 812 813 787 814 for (i=results.begin(); i!=results.end(); i++) 788 { 789 j++; 790 // 791 // FillBlock( con, 792 // statement, 793 // *i, 794 // reader2, 795 // b, 796 // j, 797 // srid, 798 // pc_id, 799 // GetGType(bUse3d, bUseSolidGeometry), 800 // bUseSolidGeometry, 801 // bUse3d, 802 // nDimensions 803 // ); 804 815 { 805 816 inserted = InsertBlock(con, 806 817 *i, … … 814 825 bUseSolidGeometry, 815 826 bUse3d); 827 j++; 816 828 } 817 829 return inserted; … … 1521 1533 } 1522 1534 1523 LASReader* reader = new LASReader(*istrm);1535 liblas::Reader* reader = new liblas::Reader(*istrm); 1524 1536 LASQuery* query = 0; 1525 1537 if (!KDTreeIndexExists(input)) { … … 1553 1565 std::istream* istrm2; 1554 1566 istrm2 = OpenInput(input, false); 1555 LASReader* reader2 = new LASReader(*istrm2);1567 liblas::Reader* reader2 = new liblas::Reader(*istrm2); 1556 1568 1557 1569 -
apps/las2ogr.cpp
r1409 r1613 296 296 throw std::runtime_error(std::string("Can not open \'") + in_file + "\'"); 297 297 } 298 liblas:: LASReader reader(ifs);298 liblas::Reader reader(ifs); 299 299 300 300 // … … 342 342 while (reader.ReadNextPoint()) 343 343 { 344 liblas:: LASPoint const& p = reader.GetPoint();344 liblas::Point const& p = reader.GetPoint(); 345 345 346 346 OGR_F_SetFieldInteger(feat, 0, p.GetReturnNumber()); -
apps/lasindex.cpp
r1427 r1613 50 50 using namespace liblas; 51 51 52 void LoadIndex (LASIndex* index, LASReader* reader, long dimension)52 void LoadIndex (LASIndex* index, liblas::Reader* reader, long dimension) 53 53 { 54 54 … … 56 56 liblas::int64_t id = 0; 57 57 if (read) { 58 const LASPoint& p = reader->GetPoint();59 index->insert(const_cast< LASPoint&>(p), id);58 const liblas::Point& p = reader->GetPoint(); 59 index->insert(const_cast<liblas::Point&>(p), id); 60 60 } 61 61 while (reader->ReadNextPoint()) { 62 62 id += 1; 63 const LASPoint& p = reader->GetPoint();64 index->insert(const_cast< LASPoint&>(p), id);63 const liblas::Point& p = reader->GetPoint(); 64 index->insert(const_cast<liblas::Point&>(p), id); 65 65 } 66 66 } … … 135 135 // FIXME: Missing RAII and try-catch, no LAS throws exceptions. 136 136 std::istream* istrm = OpenInput(input); 137 LASReader* reader = new LASReader(*istrm);137 liblas::Reader* reader = new liblas::Reader(*istrm); 138 138 std::cout << "Indexing " << input<< " "<<std::endl; 139 139 -
apps/ts2las.cpp
r1512 r1613 67 67 } 68 68 69 LASHeader CreateHeader(ScanHdr* hdr)70 { 71 LASHeader header;69 liblas::Header CreateHeader(ScanHdr* hdr) 70 { 71 liblas::Header header; 72 72 73 73 // Checks for time and color values 74 liblas::PointFormat format = liblas::ePointFormat0;74 liblas::PointFormatName format = liblas::ePointFormat0; 75 75 76 76 if (hdr->Time) { … … 124 124 } 125 125 126 bool WritePoints( LASWriter* writer, std::istream* strm, ScanHdr* hdr)126 bool WritePoints(liblas::Writer* writer, std::istream* strm, ScanHdr* hdr) 127 127 { 128 128 ScanPnt* point = new ScanPnt; … … 148 148 point->Echo = (row->EchoInt >> 14); 149 149 } 150 LASPoint p;150 Point p; 151 151 152 152 p.SetCoordinates(writer->GetHeader(), … … 172 172 if (hdr->Color) { 173 173 liblas::uint8_t r, g, b, a = 0; 174 LASColor color;174 liblas::Color color; 175 175 detail::read_n(r, *strm, sizeof(r)); 176 176 detail::read_n(b, *strm, sizeof(b)); … … 307 307 308 308 // std::cout << "stream position is: " << istrm->tellg() << std::endl; 309 LASHeader header = CreateHeader(hdr);310 LASWriter* writer = new LASWriter(*ostrm, header);309 liblas::Header header = CreateHeader(hdr); 310 liblas::Writer* writer = new liblas::Writer(*ostrm, header); 311 311 312 312 success = WritePoints(writer, istrm, hdr); -
include/liblas/detail/fwd.hpp
r1547 r1613 46 46 namespace liblas { 47 47 48 class LASHeader;49 class LASPoint;50 class LASReader;51 class LASWriter;52 class LASColor;53 class LASSpatialReference;54 class LASPointFormat;48 class Header; 49 class Point; 50 class Reader; 51 class Writer; 52 class Color; 53 class SpatialReference; 54 class PointFormat; 55 55 56 56 namespace detail { -
include/liblas/detail/reader/header.hpp
r1561 r1613 61 61 virtual ~Header(); 62 62 63 const LASHeader& GetHeader() const { return m_header; }63 const liblas::Header& GetHeader() const { return m_header; } 64 64 void read(); 65 65 void readvlrs(); … … 69 69 70 70 std::istream& m_ifs; 71 LASHeader m_header;71 liblas::Header m_header; 72 72 73 73 private: -
include/liblas/detail/reader/point.hpp
r1535 r1613 66 66 public: 67 67 68 Point(std::istream& ifs, const LASHeader& header);68 Point(std::istream& ifs, const liblas::Header& header); 69 69 Point( std::istream& ifs, 70 const LASHeader& header,70 const liblas::Header& header, 71 71 OGRCoordinateTransformationH transform); 72 72 virtual ~Point(); 73 73 74 74 std::istream& GetStream() const; 75 const LASPoint& GetPoint() const { return m_point; }75 const liblas::Point& GetPoint() const { return m_point; } 76 76 void read(); 77 77 … … 91 91 92 92 std::istream& m_ifs; 93 const LASHeader& m_header;94 LASPoint m_point;93 const liblas::Header& m_header; 94 liblas::Point m_point; 95 95 OGRCoordinateTransformationH m_transform; 96 96 -
include/liblas/detail/reader/reader.hpp
r1601 r1613 67 67 ~ReaderImpl(); 68 68 69 LASHeader const& ReadHeader();70 LASPoint const& ReadNextPoint(const LASHeader& header);71 LASPoint const& ReadPointAt(std::size_t n, const LASHeader& header);69 liblas::Header const& ReadHeader(); 70 liblas::Point const& ReadNextPoint(const liblas::Header& header); 71 liblas::Point const& ReadPointAt(std::size_t n, const liblas::Header& header); 72 72 73 73 std::istream& GetStream() const; 74 void Reset( LASHeader const& header);75 void SetSRS(const LASSpatialReference& srs, const LASHeader& header);76 void SetInputSRS(const LASSpatialReference& srs);77 void SetOutputSRS(const LASSpatialReference& srs, const LASHeader& header);74 void Reset(liblas::Header const& header); 75 void SetSRS(const SpatialReference& srs, const liblas::Header& header); 76 void SetInputSRS(const SpatialReference& srs); 77 void SetOutputSRS(const SpatialReference& srs, const liblas::Header& header); 78 78 79 79 protected: … … 85 85 uint32_t m_size; 86 86 uint32_t m_current; 87 LASSpatialReference m_out_srs;88 LASSpatialReference m_in_srs;87 SpatialReference m_out_srs; 88 SpatialReference m_in_srs; 89 89 OGRCoordinateTransformationH m_transform; 90 90 OGRSpatialReferenceH m_in_ref; -
include/liblas/detail/writer/header.hpp
r1573 r1613 60 60 typedef WriterBase Base; 61 61 62 Header(std::ostream& ofs, liblas::uint32_t& count, LASHeader const& header );62 Header(std::ostream& ofs, liblas::uint32_t& count, liblas::Header const& header ); 63 63 64 const LASHeader& GetHeader() const { return m_header; }64 const liblas::Header& GetHeader() const { return m_header; } 65 65 void write(); 66 66 … … 71 71 int32_t WriteVLRs(); 72 72 void WriteLAS10PadSignature(); 73 LASHeader m_header;73 liblas::Header m_header; 74 74 75 75 }; -
include/liblas/detail/writer/point.hpp
r1560 r1613 70 70 typedef WriterBase Base; 71 71 72 Point(std::ostream& ofs, liblas::uint32_t& count, LASHeader const& header);72 Point(std::ostream& ofs, liblas::uint32_t& count, liblas::Header const& header); 73 73 Point( std::ostream& ofs, 74 74 liblas::uint32_t& count, 75 LASHeader const& header,75 liblas::Header const& header, 76 76 OGRCoordinateTransformationH transform); 77 77 virtual ~Point(); 78 78 79 const LASPoint& GetPoint() const { return m_point; }80 void write( const LASPoint& );79 const liblas::Point& GetPoint() const { return m_point; } 80 void write( const liblas::Point& ); 81 81 82 82 protected: … … 95 95 96 96 std::ostream& m_ofs; 97 const LASHeader& m_header;98 LASPoint m_point;97 const liblas::Header& m_header; 98 liblas::Point m_point; 99 99 OGRCoordinateTransformationH m_transform; 100 100 -
include/liblas/detail/writer/writer.hpp
r1601 r1613 59 59 ~WriterImpl(); 60 60 LASVersion GetVersion() const; 61 LASHeader const& WriteHeader(LASHeader const& header);62 void UpdateHeader( LASHeader const& header);63 void WritePoint( LASPoint const& record, const LASHeader& header);61 liblas::Header const& WriteHeader(liblas::Header const& header); 62 void UpdateHeader(liblas::Header const& header); 63 void WritePoint(liblas::Point const& record, const liblas::Header& header); 64 64 65 65 std::ostream& GetStream() const; 66 66 67 void SetInputSRS(const LASSpatialReference& srs);68 void SetOutputSRS(const LASSpatialReference& srs, const LASHeader& header);67 void SetInputSRS(const SpatialReference& srs); 68 void SetOutputSRS(const SpatialReference& srs, const liblas::Header& header); 69 69 70 70 protected: … … 72 72 std::ostream& m_ofs; 73 73 74 LASSpatialReference m_out_srs;75 LASSpatialReference m_in_srs;74 SpatialReference m_out_srs; 75 SpatialReference m_in_srs; 76 76 77 77 OGRCoordinateTransformationH m_transform; … … 92 92 public: 93 93 94 static WriterImpl* Create(std::ostream& ofs, LASHeader const& header);94 static WriterImpl* Create(std::ostream& ofs, liblas::Header const& header); 95 95 static void Destroy(WriterImpl* p); 96 96 }; -
include/liblas/index/datastream.hpp
r1433 r1613 66 66 { 67 67 public: 68 LASIndexDataStream( LASReader* reader, long dimension);68 LASIndexDataStream(Reader* reader, long dimension); 69 69 ~LASIndexDataStream(); 70 70 … … 84 84 85 85 protected: 86 liblas:: LASReader* m_reader;86 liblas::Reader* m_reader; 87 87 SpatialIndex::RTree::Data* m_pNext; 88 88 SpatialIndex::id_type m_id; -
include/liblas/index/index.hpp
r1421 r1613 92 92 93 93 94 /// Inserts a LASPoint into the index with a given id95 /// \param p the LASPoint to insert94 /// Inserts a Point into the index with a given id 95 /// \param p the Point to insert 96 96 /// \param id the id to associate with the point 97 void insert( LASPoint& p, int64_t id);97 void insert(Point& p, int64_t id); 98 98 99 99 /// Intersects the index with the given cube and returns a … … 156 156 uint32_t GetDimension() { return m_idxDimension; } 157 157 158 LASVariableRecord* GetVLR();158 liblas::VariableRecord* GetVLR(); 159 159 160 160 void Query(LASQuery& query); -
include/liblas/index/storage.hpp
r1402 r1613 75 75 virtual void deleteByteArray(const SpatialIndex::id_type id); 76 76 77 LASVariableRecord* getVLR() const;77 liblas::VariableRecord* getVLR() const; 78 78 79 79 private: 80 80 81 LASVariableRecord m_data;82 LASVariableRecord m_ids;81 liblas::VariableRecord m_data; 82 liblas::VariableRecord m_ids; 83 83 84 84 // class Entry … … 97 97 // }; // Entry 98 98 99 typedef std::vector< LASVariableRecord*> vlrbuffer_t;99 typedef std::vector<liblas::VariableRecord*> vlrbuffer_t; 100 100 vlrbuffer_t m_vlrbuffer; 101 101 std::stack<SpatialIndex::id_type> m_emptyPages; 102 102 103 LASVariableRecord* makeVLR(const std::size_t len, const ::uint8_t* data);103 liblas::VariableRecord* makeVLR(const std::size_t len, const ::uint8_t* data); 104 104 105 105 }; // MemoryStorageManager -
include/liblas/lasclassification.hpp
r1577 r1613 57 57 /// Class definition to manipulate properties of point record classification. 58 58 /// 59 class LASClassification59 class Classification 60 60 { 61 61 public: … … 84 84 /// Initializes all flags of classification as set to 0. 85 85 /// Operation semantic is equivalent to bitset_type::reset(). 86 LASClassification() {}86 Classification() {} 87 87 88 88 /// Initializes classification flags using given set of 8 bits. 89 89 /// @param flags [in] - contains 8 bits representing classification flags. 90 explicit LASClassification(bitset_type const& flags)90 explicit Classification(bitset_type const& flags) 91 91 : m_flags(flags) 92 92 {} … … 94 94 /// Initializes classification flags using 8 bits of integral type. 95 95 /// @param flags [in] - contains 8 bits representing classification flags. 96 explicit LASClassification(uint8_t const& flags)96 explicit Classification(uint8_t const& flags) 97 97 : m_flags(flags) 98 98 {} … … 106 106 /// thus generally should not be withheld in a thinning algorithm. 107 107 /// @param w [in] - If set, this point should not be included in processing. 108 LASClassification(uint8_t cls, bool s, bool k, bool w)108 Classification(uint8_t cls, bool s, bool k, bool w) 109 109 { 110 110 SetClass(cls); … … 115 115 116 116 /// Copy constructor. 117 LASClassification(LASClassification const& other)117 Classification(Classification const& other) 118 118 { 119 119 m_flags = other.m_flags; … … 121 121 122 122 /// Assignment operator. 123 LASClassification& operator=(LASClassification const& rhs)123 Classification& operator=(Classification const& rhs) 124 124 { 125 125 if (&rhs != this ) … … 219 219 /// Comparison is preformed against set of bit flags stored 220 220 /// in both objects. 221 bool equal( LASClassification const& other) const221 bool equal(Classification const& other) const 222 222 { 223 223 return (other.m_flags == m_flags); … … 240 240 }; 241 241 242 /// Equal-to operator implemented in terms of LASClassification::equal.243 inline bool operator==( LASClassification const& lhs, LASClassification const& rhs)242 /// Equal-to operator implemented in terms of Classification::equal. 243 inline bool operator==(Classification const& lhs, Classification const& rhs) 244 244 { 245 245 return lhs.equal(rhs); 246 246 } 247 247 248 /// Not-equal-to operator implemented in terms of LASClassification::equal.249 inline bool operator!=( LASClassification const& lhs, LASClassification const& rhs)248 /// Not-equal-to operator implemented in terms of Classification::equal. 249 inline bool operator!=(Classification const& lhs, Classification const& rhs) 250 250 { 251 251 return (!(lhs == rhs)); … … 262 262 /// bit positions. Bit value zero becomes the character 0, bit value one 263 263 /// becomes the character 1. 264 inline std::ostream& operator<<(std::ostream& os, LASClassification const& cls)265 { 266 LASClassification::bitset_type flags(cls);264 inline std::ostream& operator<<(std::ostream& os, Classification const& cls) 265 { 266 Classification::bitset_type flags(cls); 267 267 return (os << flags); 268 268 } 269 269 270 // typedef liblas::Classification LASClassification ; 271 272 270 273 } // namespace liblas 271 274 -
include/liblas/lascolor.hpp
r1577 r1613 54 54 55 55 /// RGB color container 56 class LASColor56 class Color 57 57 { 58 58 public: … … 60 60 /// Default constructor. 61 61 /// Initializes with black color using RGB {0, 0, 0}. 62 LASColor();62 Color(); 63 63 64 64 // User-defined constructor. 65 65 // Initializes object with given RGB values. 66 LASColor(uint16_t red, uint16_t green, uint16_t blue)66 Color(uint16_t red, uint16_t green, uint16_t blue) 67 67 : m_red(red), m_green(green), m_blue(blue) 68 68 {} 69 69 70 70 /// Copy constructor. 71 LASColor(LASColor const& other);71 Color(Color const& other); 72 72 73 73 /// Assignment opreator. 74 LASColor& operator=(LASColor const& rhs);74 Color& operator=(Color const& rhs); 75 75 76 76 /// Comparison operator. 77 bool operator==(const LASColor& other) const;77 bool operator==(const Color& other) const; 78 78 79 79 /// Fetch value of the red image channel … … 119 119 120 120 121 inline uint16_t LASColor::GetRed() const121 inline uint16_t Color::GetRed() const 122 122 { 123 123 return m_red; 124 124 } 125 125 126 inline void LASColor::SetRed(uint16_t const& value)126 inline void Color::SetRed(uint16_t const& value) 127 127 { 128 128 m_red = value; 129 129 } 130 130 131 inline uint16_t LASColor::GetBlue() const131 inline uint16_t Color::GetBlue() const 132 132 { 133 133 return m_blue; 134 134 } 135 135 136 inline void LASColor::SetBlue(uint16_t const& value)136 inline void Color::SetBlue(uint16_t const& value) 137 137 { 138 138 m_blue = value; 139 139 } 140 140 141 inline uint16_t LASColor::GetGreen() const141 inline uint16_t Color::GetGreen() const 142 142 { 143 143 return m_green; 144 144 } 145 145 146 inline void LASColor::SetGreen(uint16_t const& value)146 inline void Color::SetGreen(uint16_t const& value) 147 147 { 148 148 m_green = value; 149 149 } 150 150 151 inline uint16_t& LASColor::operator[](std::size_t const& n)151 inline uint16_t& Color::operator[](std::size_t const& n) 152 152 { 153 153 if (n == 0) { return m_red; } … … 158 158 } 159 159 160 inline uint16_t const& LASColor::operator[](std::size_t const& n) const160 inline uint16_t const& Color::operator[](std::size_t const& n) const 161 161 { 162 162 if (n == 0) { return m_red; } … … 167 167 } 168 168 169 // typedef liblas::Color LASColor; 170 169 171 } // namespace liblas 170 172 -
include/liblas/lasformat.hpp
r1577 r1613 53 53 54 54 55 class LASPointFormat55 class PointFormat 56 56 { 57 57 public: 58 58 59 LASPointFormat( liblas::uint8_t major,59 PointFormat( liblas::uint8_t major, 60 60 liblas::uint8_t minor, 61 61 liblas::uint32_t size); 62 62 63 LASPointFormat( liblas::uint8_t major,63 PointFormat( liblas::uint8_t major, 64 64 liblas::uint8_t minor, 65 65 liblas::uint32_t size, 66 66 bool bColor, 67 67 bool bTime); 68 LASPointFormat& operator=(LASPointFormat const& rhs);69 LASPointFormat(LASPointFormat const& other);68 PointFormat& operator=(PointFormat const& rhs); 69 PointFormat(PointFormat const& other); 70 70 71 ~ LASPointFormat() {};71 ~PointFormat() {}; 72 72 73 73 /// Fetch byte size … … 102 102 }; 103 103 104 inline uint32_t LASPointFormat::GetByteSize() const104 inline uint32_t PointFormat::GetByteSize() const 105 105 { 106 106 return m_size; 107 107 } 108 108 109 inline void LASPointFormat::SetByteSize(uint32_t const& value)109 inline void PointFormat::SetByteSize(uint32_t const& value) 110 110 { 111 111 m_size = value; 112 112 } 113 113 114 inline uint8_t LASPointFormat::GetVersionMajor() const114 inline uint8_t PointFormat::GetVersionMajor() const 115 115 { 116 116 return m_versionmajor; 117 117 } 118 118 119 inline void LASPointFormat::SetVersionMajor(uint8_t const& value)119 inline void PointFormat::SetVersionMajor(uint8_t const& value) 120 120 { 121 121 m_versionmajor = value; 122 122 } 123 123 124 inline uint8_t LASPointFormat::GetVersionMinor() const124 inline uint8_t PointFormat::GetVersionMinor() const 125 125 { 126 126 return m_versionminor; 127 127 } 128 128 129 inline void LASPointFormat::SetVersionMinor(uint8_t const& value)129 inline void PointFormat::SetVersionMinor(uint8_t const& value) 130 130 { 131 131 m_versionminor = value; 132 132 } 133 133 134 inline bool LASPointFormat::HasColor() const134 inline bool PointFormat::HasColor() const 135 135 { 136 136 return m_hasColor; 137 137 } 138 138 139 inline void LASPointFormat::Color(bool const& value)139 inline void PointFormat::Color(bool const& value) 140 140 { 141 141 m_hasColor = value; … … 143 143 } 144 144 145 inline bool LASPointFormat::HasTime() const145 inline bool PointFormat::HasTime() const 146 146 { 147 147 return m_hasTime; 148 148 } 149 149 150 inline void LASPointFormat::Time(bool const& value)150 inline void PointFormat::Time(bool const& value) 151 151 { 152 152 m_hasTime = value; 153 153 updatesize(); 154 154 } 155 156 typedef liblas::PointFormat LASPointFormat ; 155 157 } // namespace liblas 156 158 -
include/liblas/lasheader.hpp
r1577 r1613 68 68 /// with std::string and return const-reference to string object. 69 69 /// 70 class LASHeader70 class Header 71 71 { 72 72 public: … … 90 90 /// LAS 1.2 Specification, point data format set to 0. 91 91 /// Other fields filled with 0. 92 LASHeader();92 Header(); 93 93 94 94 /// Copy constructor. 95 LASHeader(LASHeader const& other);95 Header(Header const& other); 96 96 97 97 /// Assignment operator. 98 LASHeader& operator=(LASHeader const& rhs);98 Header& operator=(Header const& rhs); 99 99 100 100 /// Comparison operator. 101 bool operator==(const LASHeader& other) const;101 bool operator==(const Header& other) const; 102 102 103 103 /// Get ASPRS LAS file signature. … … 222 222 223 223 /// Get identifier of point data (record) format. 224 PointFormat GetDataFormatId() const;224 PointFormatName GetDataFormatId() const; 225 225 226 226 /// Set identifier of point data (record) format. 227 void SetDataFormatId(PointFormat v);227 void SetDataFormatId(PointFormatName v); 228 228 229 229 /// \todo To be documented … … 299 299 300 300 /// Adds a variable length record to the header 301 void AddVLR( LASVariableRecord const& v);301 void AddVLR(VariableRecord const& v); 302 302 303 303 /// Returns a VLR 304 LASVariableRecord const& GetVLR(uint32_t index) const;304 VariableRecord const& GetVLR(uint32_t index) const; 305 305 306 306 /// Returns all of the VLRs 307 const std::vector< LASVariableRecord>& GetVLRs() const;307 const std::vector<VariableRecord>& GetVLRs() const; 308 308 309 309 /// Removes a VLR from the the header. … … 314 314 315 315 /// Fetch the georeference 316 LASSpatialReference GetSRS() const;316 SpatialReference GetSRS() const; 317 317 318 318 /// Set the georeference 319 void SetSRS( LASSpatialReference& srs);320 321 LASPointFormat GetPointFormat() const;322 void SetPointFormat(const LASPointFormat& format);319 void SetSRS(SpatialReference& srs); 320 321 PointFormat GetPointFormat() const; 322 void SetPointFormat(const PointFormat& format); 323 323 324 324 private: … … 375 375 PointOffsets m_offsets; 376 376 PointExtents m_extents; 377 std::vector< LASVariableRecord> m_vlrs;378 LASSpatialReference m_srs;377 std::vector<VariableRecord> m_vlrs; 378 SpatialReference m_srs; 379 379 }; 380 380 381 // typedef liblas::Header LASHeader ; 381 382 } // namespace liblas 382 383 -
include/liblas/laspoint.hpp
r1540 r1613 57 57 58 58 /// Point data record composed with X, Y, Z coordinates and attributes. 59 class LASPoint59 class Point 60 60 { 61 61 public: … … 97 97 }; 98 98 99 LASPoint();100 LASPoint(LASPoint const& other);101 LASPoint& operator=(LASPoint const& rhs);99 Point(); 100 Point(Point const& other); 101 Point& operator=(Point const& rhs); 102 102 103 103 double GetX() const; … … 105 105 double GetZ() const; 106 106 void SetCoordinates(double const& x, double const& y, double const& z); 107 void SetCoordinates( LASHeader const& header, double x, double y, double z);107 void SetCoordinates(Header const& header, double x, double y, double z); 108 108 109 109 void SetX(double const& value); … … 138 138 void SetFlightLineEdge(uint16_t const& edge); 139 139 140 // LASClassification& GetClassification();141 LASClassification const& GetClassification() const;142 void SetClassification( LASClassification const& cls);143 void SetClassification( LASClassification::bitset_type const& flags);140 //Classification& GetClassification(); 141 Classification const& GetClassification() const; 142 void SetClassification(Classification const& cls); 143 void SetClassification(Classification::bitset_type const& flags); 144 144 void SetClassification(liblas::uint8_t const& flags); 145 145 … … 160 160 161 161 /// Fetch color value associated with this point (LAS 1.2) 162 LASColor const& GetColor() const;162 Color const& GetColor() const; 163 163 164 164 /// Set color value associated with this point (LAS 1.2) 165 void SetColor( LASColor const& value);165 void SetColor(Color const& value); 166 166 167 167 … … 180 180 181 181 /// \todo TODO: Should we compare other data members, but not only coordinates? 182 bool equal( LASPoint const& other) const;182 bool equal(Point const& other) const; 183 183 184 184 bool Validate() const; … … 195 195 double m_coords[coords_size]; 196 196 double m_gpsTime; 197 LASColor m_color;198 LASClassification m_cls;197 Color m_color; 198 Classification m_cls; 199 199 uint16_t m_intensity; 200 200 uint16_t m_pointSourceId; … … 211 211 }; 212 212 213 /// Equal-to operator implemented in terms of LASPoint::equal method.214 inline bool operator==( LASPoint const& lhs, LASPoint const& rhs)213 /// Equal-to operator implemented in terms of Point::equal method. 214 inline bool operator==(Point const& lhs, Point const& rhs) 215 215 { 216 216 return lhs.equal(rhs); 217 217 } 218 218 219 /// Not-equal-to operator implemented in terms of LASPoint::equal method.220 inline bool operator!=( LASPoint const& lhs, LASPoint const& rhs)219 /// Not-equal-to operator implemented in terms of Point::equal method. 220 inline bool operator!=(Point const& lhs, Point const& rhs) 221 221 { 222 222 return (!(lhs == rhs)); 223 223 } 224 224 225 inline void LASPoint::SetCoordinates(double const& x, double const& y, double const& z)225 inline void Point::SetCoordinates(double const& x, double const& y, double const& z) 226 226 { 227 227 m_coords[0] = x; … … 230 230 } 231 231 232 inline double LASPoint::GetX() const232 inline double Point::GetX() const 233 233 { 234 234 return m_coords[0]; 235 235 } 236 236 237 inline void LASPoint::SetX( double const& value )237 inline void Point::SetX( double const& value ) 238 238 { 239 239 m_coords[0] = value; 240 240 } 241 241 242 inline double LASPoint::GetY() const242 inline double Point::GetY() const 243 243 { 244 244 return m_coords[1]; 245 245 } 246 246 247 inline void LASPoint::SetY( double const& value )247 inline void Point::SetY( double const& value ) 248 248 { 249 249 m_coords[1] = value; 250 250 } 251 251 252 inline double LASPoint::GetZ() const252 inline double Point::GetZ() const 253 253 { 254 254 return m_coords[2]; 255 255 } 256 256 257 inline void LASPoint::SetZ( double const& value )257 inline void Point::SetZ( double const& value ) 258 258 { 259 259 m_coords[2] = value; 260 260 } 261 261 262 inline uint16_t LASPoint::GetIntensity() const262 inline uint16_t Point::GetIntensity() const 263 263 { 264 264 return m_intensity; 265 265 } 266 266 267 inline void LASPoint::SetIntensity(uint16_t const& intensity)267 inline void Point::SetIntensity(uint16_t const& intensity) 268 268 { 269 269 m_intensity = intensity; 270 270 } 271 271 272 inline uint16_t LASPoint::GetReturnNumber() const272 inline uint16_t Point::GetReturnNumber() const 273 273 { 274 274 // Read bits 1,2,3 (first 3 bits) … … 276 276 } 277 277 278 inline uint16_t LASPoint::GetNumberOfReturns() const278 inline uint16_t Point::GetNumberOfReturns() const 279 279 { 280 280 // Read bits 4,5,6 … … 282 282 } 283 283 284 inline uint16_t LASPoint::GetScanDirection() const284 inline uint16_t Point::GetScanDirection() const 285 285 { 286 286 // Read 7th bit … … 288 288 } 289 289 290 inline uint16_t LASPoint::GetFlightLineEdge() const290 inline uint16_t Point::GetFlightLineEdge() const 291 291 { 292 292 // Read 8th bit … … 294 294 } 295 295 296 inline uint8_t LASPoint::GetScanFlags() const296 inline uint8_t Point::GetScanFlags() const 297 297 { 298 298 return m_flags; 299 299 } 300 300 301 inline void LASPoint::SetScanFlags(uint8_t const& flags)301 inline void Point::SetScanFlags(uint8_t const& flags) 302 302 { 303 303 m_flags = flags; 304 304 } 305 305 306 inline int8_t LASPoint::GetScanAngleRank() const306 inline int8_t Point::GetScanAngleRank() const 307 307 { 308 308 return m_angleRank; 309 309 } 310 310 311 inline uint8_t LASPoint::GetUserData() const311 inline uint8_t Point::GetUserData() const 312 312 { 313 313 return m_userData; 314 314 } 315 315 316 inline uint16_t LASPoint::GetPointSourceID() const316 inline uint16_t Point::GetPointSourceID() const 317 317 { 318 318 return m_pointSourceId; 319 319 } 320 320 321 inline void LASPoint::SetPointSourceID(uint16_t const& id)321 inline void Point::SetPointSourceID(uint16_t const& id) 322 322 { 323 323 m_pointSourceId = id; 324 324 } 325 325 326 inline double LASPoint::GetTime() const326 inline double Point::GetTime() const 327 327 { 328 328 return m_gpsTime; 329 329 } 330 330 331 inline void LASPoint::SetTime(double const& time)331 inline void Point::SetTime(double const& time) 332 332 { 333 333 m_gpsTime = time; 334 334 } 335 335 336 inline LASColor const& LASPoint::GetColor() const336 inline Color const& Point::GetColor() const 337 337 { 338 338 return m_color; 339 339 } 340 340 341 inline void LASPoint::SetColor(LASColor const& value)341 inline void Point::SetColor(Color const& value) 342 342 { 343 343 m_color = value; … … 345 345 346 346 347 inline double& LASPoint::operator[](std::size_t const& n)347 inline double& Point::operator[](std::size_t const& n) 348 348 { 349 349 if (coords_size <= n) … … 353 353 } 354 354 355 inline double const& LASPoint::operator[](std::size_t const& n) const355 inline double const& Point::operator[](std::size_t const& n) const 356 356 { 357 357 if (coords_size <= n) … … 361 361 } 362 362 363 // typedef liblas::Point LASPoint; 364 363 365 } // namespace liblas 364 366 -
include/liblas/lasreader.hpp
r1601 r1613 63 63 64 64 /// Defines public interface to LAS reader implementation. 65 class LASReader65 class Reader 66 66 { 67 67 public: … … 70 70 /// @param ifs - stream used as source of LAS records. 71 71 /// @excepion std::runtime_error - on failure state of the input stream. 72 LASReader(std::istream& ifs);72 Reader(std::istream& ifs); 73 73 74 LASReader(ReaderI* reader);74 Reader(ReaderI* reader); 75 75 76 76 /// User-defined consructor initializes reader with input stream and 77 77 /// a header to override the values in the file 78 78 /// @excepion std::runtime_error - on failure state of the input stream. 79 LASReader(std::istream& ifs, LASHeader& header);79 Reader(std::istream& ifs, Header& header); 80 80 81 81 /// Destructor. 82 82 /// @excepion nothrow 83 ~ LASReader();83 ~Reader(); 84 84 85 85 /// Provides read-only access to header of LAS file being read. 86 86 /// @excepion nothrow 87 LASHeader const& GetHeader() const;87 Header const& GetHeader() const; 88 88 89 89 /// Provides read-only access to current point record. 90 90 /// @excepion nothrow 91 LASPoint const& GetPoint() const;91 Point const& GetPoint() const; 92 92 93 93 /// Provides read-only access to collection of variable-length records. 94 94 /// @excepion nothrow 95 std::vector< LASVariableRecord> const& GetVLRs() const;95 std::vector<VariableRecord> const& GetVLRs() const; 96 96 97 97 /// Allow fetching of the stream attached to the reader. … … 114 114 void Reset(); 115 115 116 /// Reproject data as they are written if the LASReader's reference is117 /// different than the LASHeader's.116 /// Reproject data as they are written if the Reader's reference is 117 /// different than the Header's. 118 118 /// @excepion may throw std::exception 119 bool SetSRS(const LASSpatialReference& ref);119 bool SetSRS(const SpatialReference& ref); 120 120 121 /// Override the spatial reference of the LASReader's LASHeader for121 /// Override the spatial reference of the Reader's Header for 122 122 /// writing purposes. 123 123 /// @excepion may throw std::exception 124 bool SetInputSRS(const LASSpatialReference& ref);124 bool SetInputSRS(const SpatialReference& ref); 125 125 126 /// Override the spatial reference of the LASReader's LASHeader for126 /// Override the spatial reference of the Reader's Header for 127 127 /// writing purposes. 128 128 /// @excepion may throw std::exception 129 bool SetOutputSRS(const LASSpatialReference& ref);129 bool SetOutputSRS(const SpatialReference& ref); 130 130 131 131 /// Provides index-based access to point records. … … 133 133 /// and is not const-qualified because it updates file stream position. 134 134 /// @excepion may throw std::exception 135 LASPoint const& operator[](std::size_t n);135 Point const& operator[](std::size_t n); 136 136 137 137 private: 138 138 139 139 // Blocked copying operations, declared but not defined. 140 LASReader(LASReader const& other);141 LASReader& operator=(LASReader const& rhs);140 Reader(Reader const& other); 141 Reader& operator=(Reader const& rhs); 142 142 143 143 void Init(); // throws on error 144 144 145 145 const std::auto_ptr<ReaderI> m_pimpl; 146 LASHeader m_header;147 LASPoint* m_point;148 LASPoint* m_empty_point;146 Header m_header; 147 Point* m_point; 148 Point* m_empty_point; 149 149 150 150 // Set if the user provides a header to override the header as … … 157 157 158 158 159 // typedef liblas::Reader LASReader; 159 160 160 161 } // namespace liblas -
include/liblas/lasspatialreference.hpp
r1577 r1613 91 91 92 92 /// Spatial Reference System container for libLAS 93 class LASSpatialReference93 class SpatialReference 94 94 { 95 95 public: … … 101 101 102 102 /// Default constructor. 103 LASSpatialReference();103 SpatialReference(); 104 104 105 105 /// Destructor. 106 106 /// If libgeotiff is enabled, deallocates libtiff and libgeotiff objects used internally. 107 ~ LASSpatialReference();108 109 /// Constructor creating LASSpatialReference instance from given Variable-Length Record.110 LASSpatialReference(const std::vector<LASVariableRecord>& vlrs);107 ~SpatialReference(); 108 109 /// Constructor creating SpatialReference instance from given Variable-Length Record. 110 SpatialReference(const std::vector<VariableRecord>& vlrs); 111 111 112 112 /// Copy constryctor. 113 LASSpatialReference(LASSpatialReference const& other);113 SpatialReference(SpatialReference const& other); 114 114 115 115 /// Assignment operator. 116 LASSpatialReference& operator=(LASSpatialReference const& rhs);116 SpatialReference& operator=(SpatialReference const& rhs); 117 117 118 118 /// Returns a pointer to the internal GTIF*. Only available if … … 174 174 void SetProj4(std::string const& v); 175 175 176 /// Set the LASVLRs for the LASSpatialReference. SetVLRs will only copy176 /// Set the LASVLRs for the SpatialReference. SetVLRs will only copy 177 177 /// VLR records that pertain to the GeoTIFF keys, and extraneous 178 178 /// VLR records will not be copied. 179 179 /// \param vlrs - A list of VLRs that contains VLRs describing GeoTIFF keys 180 void SetVLRs(const std::vector< LASVariableRecord>& vlrs);180 void SetVLRs(const std::vector<VariableRecord>& vlrs); 181 181 182 182 /// Add a VLR representing GeoTIFF keys to the SRS 183 void AddVLR(const LASVariableRecord& vlr);184 185 /// Return a copy of the LASVLRs that LASSpatialReference maintains186 std::vector< LASVariableRecord> GetVLRs() const;183 void AddVLR(const VariableRecord& vlr); 184 185 /// Return a copy of the LASVLRs that SpatialReference maintains 186 std::vector<VariableRecord> GetVLRs() const; 187 187 188 188 private: … … 191 191 ST_TIFF* m_tiff; 192 192 193 std::vector< LASVariableRecord> m_vlrs;194 bool IsGeoVLR(const LASVariableRecord& vlr) const;195 196 /// Reset the VLRs of the LASSpatialReference using the existing GTIF* and ST_TIF*193 std::vector<VariableRecord> m_vlrs; 194 bool IsGeoVLR(const VariableRecord& vlr) const; 195 196 /// Reset the VLRs of the SpatialReference using the existing GTIF* and ST_TIF* 197 197 /// Until this method is called, 198 /// the LASSpatialReference will only contain a SRS description using the VLRs198 /// the SpatialReference will only contain a SRS description using the VLRs 199 199 /// that it was first instantiated with. SetWKT and SetProj4 can 200 200 /// be used to change the GTIF* … … 202 202 }; 203 203 204 // typedef liblas::SpatialReference LASSpatialReference; 204 205 } // namespace liblas 205 206 -
include/liblas/lasvariablerecord.hpp
r1577 r1613 55 55 56 56 /// Representation of variable-length record data. 57 class LASVariableRecord57 class VariableRecord 58 58 { 59 59 public: … … 62 62 /// Zero-initialization of record data. 63 63 /// \exception No throw 64 LASVariableRecord();64 VariableRecord(); 65 65 66 66 /// Copy constructor. 67 67 /// Construction of new record object as a copy of existing one. 68 68 /// \exception No throw 69 LASVariableRecord(LASVariableRecord const& other);69 VariableRecord(VariableRecord const& other); 70 70 71 ~ LASVariableRecord();71 ~VariableRecord(); 72 72 73 73 /// Assignment operator. … … 75 75 /// assignment of another one. 76 76 /// \exception No throw 77 LASVariableRecord& operator=(LASVariableRecord const& rhs);77 VariableRecord& operator=(VariableRecord const& rhs); 78 78 79 79 /// Get record signature (LAS 1.0) or reserved bytes (LAS 1.1). … … 117 117 /// Compare actual header object against the other. 118 118 /// \exception No throw 119 bool equal( LASVariableRecord const& other) const;119 bool equal(VariableRecord const& other) const; 120 120 121 121 /// Get the total size of the VLR in bytes … … 141 141 142 142 /// Equality operator. 143 /// Implemented in terms of LASVariableRecord::equal member function.143 /// Implemented in terms of VariableRecord::equal member function. 144 144 /// \exception No throw 145 inline bool operator==( LASVariableRecord const& lhs, LASVariableRecord const& rhs)145 inline bool operator==(VariableRecord const& lhs, VariableRecord const& rhs) 146 146 { 147 147 return lhs.equal(rhs); … … 151 151 /// Implemented in terms of LASRecordHeader::equal member function. 152 152 /// \exception No throw 153 inline bool operator!=( LASVariableRecord const& lhs, LASVariableRecord const& rhs)153 inline bool operator!=(VariableRecord const& lhs, VariableRecord const& rhs) 154 154 { 155 155 return (!(lhs == rhs)); 156 156 } 157 157 158 // typedef liblas::VariableRecord LASVariableRecord ; 159 158 160 } // namespace liblas 159 161 -
include/liblas/laswriter.hpp
r1601 r1613 58 58 { 59 59 60 61 60 62 /// Defines public interface to LAS writer implementation. 61 63 /// This class 62 class LASWriter64 class Writer 63 65 { 64 66 public: … … 68 70 /// @param header - specifies obligatory properties of LAS file. 69 71 /// @excepion std::runtime_error - on failure state of the input stream. 70 LASWriter(std::ostream& ofs, LASHeader const& header);72 Writer(std::ostream& ofs, Header const& header); 71 73 72 74 /// Destructor does not close file attached to the output stream 73 75 /// Header may be updated after writing operation completed, if necessary 74 76 /// in order to maintain data consistency. 75 ~ LASWriter();77 ~Writer(); 76 78 77 79 /// Provides access to header structure. 78 LASHeader const& GetHeader() const;80 Header const& GetHeader() const; 79 81 80 82 /// \todo TODO: Move point record composition deep into writer implementation. 81 83 /// \todo TODO: How to handle point_source_id in portable way, for LAS 1.0 and 1.1 82 bool WritePoint( LASPoint const& point);84 bool WritePoint(Point const& point); 83 85 84 86 /// Allow fetching of the stream … … 86 88 87 89 /// Allow in-place writing of header 88 void WriteHeader( LASHeader& header);90 void WriteHeader(Header& header); 89 91 90 /// Reproject data as they are written if the LASWriter's reference is91 /// different than the LASHeader's92 bool SetSRS(const LASSpatialReference& ref);93 bool SetInputSRS(const LASSpatialReference& ref);94 bool SetOutputSRS(const LASSpatialReference& ref);92 /// Reproject data as they are written if the Writer's reference is 93 /// different than the Header's 94 bool SetSRS(const SpatialReference& ref); 95 bool SetInputSRS(const SpatialReference& ref); 96 bool SetOutputSRS(const SpatialReference& ref); 95 97 96 98 private: 97 99 98 100 // Blocked copying operations, declared but not defined. 99 LASWriter(LASWriter const& other);100 LASWriter& operator=(LASWriter const& rhs);101 Writer(Writer const& other); 102 Writer& operator=(Writer const& rhs); 101 103 102 104 const std::auto_ptr<WriterI> m_pimpl; 103 105 104 LASHeader m_header;106 Header m_header; 105 107 detail::PointRecord m_record; 106 108 std::ostream& m_ofs; … … 108 110 }; 109 111 112 // typedef liblas::Writer LASWriter ; 113 110 114 } // namespace liblas 111 115 -
include/liblas/liblas.hpp
r1601 r1613 129 129 130 130 /// Versions of point record format. 131 enum PointFormat 131 enum PointFormatName 132 132 { 133 133 ePointFormat0 = 0, ///< Point Data Format \e 0 … … 153 153 public: 154 154 155 virtual LASHeader const& ReadHeader() = 0;156 virtual LASPoint const& ReadNextPoint(const LASHeader& header) = 0;157 virtual LASPoint const& ReadPointAt(std::size_t n, const LASHeader& header) = 0;155 virtual Header const& ReadHeader() = 0; 156 virtual Point const& ReadNextPoint(const Header& header) = 0; 157 virtual Point const& ReadPointAt(std::size_t n, const Header& header) = 0; 158 158 159 virtual void Reset(const LASHeader& header) = 0;160 virtual void SetInputSRS(const LASSpatialReference& srs) = 0;161 virtual void SetOutputSRS(const LASSpatialReference& srs, const LASHeader& header) = 0;159 virtual void Reset(const Header& header) = 0; 160 virtual void SetInputSRS(const SpatialReference& srs) = 0; 161 virtual void SetOutputSRS(const SpatialReference& srs, const Header& header) = 0; 162 162 163 163 virtual ~ReaderI() {}; … … 168 168 public: 169 169 170 virtual LASHeader const& WriteHeader(const LASHeader& header) = 0;171 virtual void UpdateHeader(const LASHeader& header) = 0;172 virtual void WritePoint(const LASPoint& point, const LASHeader& header) = 0;170 virtual Header const& WriteHeader(const Header& header) = 0; 171 virtual void UpdateHeader(const Header& header) = 0; 172 virtual void WritePoint(const Point& point, const Header& header) = 0; 173 173 174 virtual void SetInputSRS(const LASSpatialReference& srs) = 0;175 virtual void SetOutputSRS(const LASSpatialReference& srs, const LASHeader& header) = 0;174 virtual void SetInputSRS(const SpatialReference& srs) = 0; 175 virtual void SetOutputSRS(const SpatialReference& srs, const Header& header) = 0; 176 176 177 177 virtual ~WriterI() {}; 178 178 179 179 }; 180 181 182 180 183 } // namespace liblas 181 184 -
src/detail/reader/header.cpp
r1561 r1613 297 297 read_n(data.front(), m_ifs, length); 298 298 299 LASVariableRecord vlr;299 VariableRecord vlr; 300 300 vlr.SetReserved(vlrh.reserved); 301 301 vlr.SetUserId(std::string(vlrh.userId)); … … 308 308 } 309 309 310 LASSpatialReference srs(m_header.GetVLRs());310 liblas::SpatialReference srs(m_header.GetVLRs()); 311 311 m_header.SetSRS(srs); 312 312 -
src/detail/reader/point.cpp
r1562 r1613 44 44 #include <liblas/detail/utility.hpp> 45 45 #include <liblas/lasheader.hpp> 46 #include <liblas/lasvariablerecord.hpp>47 46 48 47 #include <sstream> … … 55 54 } 56 55 57 Point::Point(std::istream& ifs, const LASHeader& header) :58 m_ifs(ifs), m_header(header), m_point( LASPoint()), m_transform(0)56 Point::Point(std::istream& ifs, const liblas::Header& header) : 57 m_ifs(ifs), m_header(header), m_point(liblas::Point()), m_transform(0) 59 58 { 60 59 setup(); … … 62 61 63 62 Point::Point( std::istream& ifs, 64 const LASHeader& header,63 const liblas::Header& header, 65 64 OGRCoordinateTransformationH transform) : 66 m_ifs(ifs), m_header(header), m_point( LASPoint()), m_transform(transform)65 m_ifs(ifs), m_header(header), m_point(liblas::Point()), m_transform(transform) 67 66 { 68 67 setup(); … … 121 120 detail::read_n(blue, m_ifs, sizeof(uint16_t)); 122 121 123 LASColor color(red, green, blue);122 liblas::Color color(red, green, blue); 124 123 m_point.SetColor(color); 125 124 … … 133 132 detail::read_n(blue, m_ifs, sizeof(uint16_t)); 134 133 135 LASColor color(red, green, blue);134 liblas::Color color(red, green, blue); 136 135 m_point.SetColor(color); 137 136 -
src/detail/reader/reader.cpp
r1568 r1613 43 43 44 44 #include <liblas/detail/utility.hpp> 45 #include <liblas/lasvariablerecord.hpp>46 45 #include <liblas/liblas.hpp> 47 46 #include <liblas/lasheader.hpp> … … 94 93 } 95 94 96 void ReaderImpl::Reset( LASHeader const& header)95 void ReaderImpl::Reset(liblas::Header const& header) 97 96 { 98 97 m_ifs.clear(); … … 114 113 } 115 114 116 void ReaderImpl::SetOutputSRS(const LASSpatialReference& srs, const LASHeader& header)115 void ReaderImpl::SetOutputSRS(const SpatialReference& srs, const liblas::Header& header) 117 116 { 118 117 m_out_srs = srs; … … 127 126 } 128 127 129 void ReaderImpl::SetSRS(const LASSpatialReference& srs, const LASHeader& header)128 void ReaderImpl::SetSRS(const SpatialReference& srs, const liblas::Header& header) 130 129 { 131 130 SetOutputSRS(srs, header); 132 131 } 133 132 134 void ReaderImpl::SetInputSRS(const LASSpatialReference& srs)133 void ReaderImpl::SetInputSRS(const SpatialReference& srs) 135 134 { 136 135 m_in_srs = srs; … … 181 180 182 181 183 LASHeader const& ReaderImpl::ReadHeader()182 liblas::Header const& ReaderImpl::ReadHeader() 184 183 { 185 184 m_header_reader->read(); 186 const LASHeader& header = m_header_reader->GetHeader();185 const liblas::Header& header = m_header_reader->GetHeader(); 187 186 188 187 Reset(header); … … 195 194 } 196 195 197 LASPoint const& ReaderImpl::ReadNextPoint(const LASHeader& header)196 liblas::Point const& ReaderImpl::ReadNextPoint(const liblas::Header& header) 198 197 { 199 198 if (0 == m_current) … … 207 206 { 208 207 m_point_reader->read(); 209 const LASPoint& point = m_point_reader->GetPoint();208 const liblas::Point& point = m_point_reader->GetPoint(); 210 209 ++m_current; 211 210 return point; … … 220 219 } 221 220 222 LASPoint const& ReaderImpl::ReadPointAt(std::size_t n, const LASHeader& header)221 liblas::Point const& ReaderImpl::ReadPointAt(std::size_t n, const liblas::Header& header) 223 222 { 224 223 // FIXME: Throw in this case. … … 238 237 239 238 m_point_reader->read(); 240 const LASPoint& point = m_point_reader->GetPoint();239 const liblas::Point& point = m_point_reader->GetPoint(); 241 240 242 241 return point; -
src/detail/writer/header.cpp
r1553 r1613 59 59 namespace liblas { namespace detail { namespace writer { 60 60 61 Header::Header(std::ostream& ofs, liblas::uint32_t& count, LASHeader const& header) :61 Header::Header(std::ostream& ofs, liblas::uint32_t& count, liblas::Header const& header) : 62 62 Base(ofs, count) 63 63 { … … 282 282 for (uint32_t i = 0; i < m_header.GetRecordsCount(); ++i) 283 283 { 284 LASVariableRecord vlr = m_header.GetVLR(i);284 VariableRecord vlr = m_header.GetVLR(i); 285 285 vlr_total_size += vlr.GetTotalSize(); 286 286 } … … 295 295 for (uint32_t i = 0; i < m_header.GetRecordsCount(); ++i) 296 296 { 297 LASVariableRecord vlr = m_header.GetVLR(i);297 VariableRecord vlr = m_header.GetVLR(i); 298 298 299 299 detail::write_n(GetStream(), vlr.GetReserved(), sizeof(uint16_t)); -
src/detail/writer/point.cpp
r1569 r1613 58 58 Point::Point( std::ostream& ofs, 59 59 liblas::uint32_t& count, 60 const LASHeader& header) :60 const liblas::Header& header) : 61 61 Base(ofs, count), 62 62 m_ofs(ofs), 63 63 m_header(header), 64 m_point( LASPoint()),64 m_point(liblas::Point()), 65 65 m_transform(0) 66 66 { … … 70 70 Point::Point( std::ostream& ofs, 71 71 liblas::uint32_t& count, 72 const LASHeader& header,72 const liblas::Header& header, 73 73 OGRCoordinateTransformationH transform) : Base(ofs, count), 74 m_ofs(ofs), m_header(header), m_point( LASPoint()), m_transform(transform)74 m_ofs(ofs), m_header(header), m_point(liblas::Point()), m_transform(transform) 75 75 76 76 { … … 84 84 85 85 86 void Point::write(const LASPoint& point)86 void Point::write(const liblas::Point& point) 87 87 { 88 88 double t = 0; … … 90 90 uint16_t blue = 0; 91 91 uint16_t green = 0; 92 LASColor color;92 liblas::Color color; 93 93 94 94 // std::size_t byteswritten(0); … … 155 155 156 156 int ret = 0; 157 LASPoint& p = m_point;157 liblas::Point& p = m_point; 158 158 159 159 double x = p.GetX(); … … 178 178 void Point::fill() 179 179 { 180 LASPoint& p = m_point;180 liblas::Point& p = m_point; 181 181 if (m_transform) { 182 182 … … 191 191 } 192 192 193 LASClassification::bitset_type clsflags(p.GetClassification());193 Classification::bitset_type clsflags(p.GetClassification()); 194 194 m_record.classification = static_cast<uint8_t>(clsflags.to_ulong()); 195 195 -
src/detail/writer/writer.cpp
r1573 r1613 68 68 69 69 70 LASHeader const& WriterImpl::WriteHeader(LASHeader const& header)70 liblas::Header const& WriterImpl::WriteHeader(liblas::Header const& header) 71 71 { 72 72 m_header_writer = new detail::writer::Header(m_ofs,m_pointCount, header ); … … 75 75 } 76 76 77 void WriterImpl::UpdateHeader( LASHeader const& header)77 void WriterImpl::UpdateHeader(liblas::Header const& header) 78 78 { 79 79 if (m_pointCount != header.GetPointRecordsCount()) … … 87 87 } 88 88 89 void WriterImpl::WritePoint( LASPoint const& point, const LASHeader& header)89 void WriterImpl::WritePoint(liblas::Point const& point, const liblas::Header& header) 90 90 { 91 91 if (m_point_writer == 0) { … … 129 129 130 130 131 void WriterImpl::SetOutputSRS(const LASSpatialReference& srs, const LASHeader& header )131 void WriterImpl::SetOutputSRS(const liblas::SpatialReference& srs, const liblas::Header& header ) 132 132 { 133 133 m_out_srs = srs; … … 143 143 144 144 145 void WriterImpl::SetInputSRS(const LASSpatialReference& srs )145 void WriterImpl::SetInputSRS(const liblas::SpatialReference& srs ) 146 146 { 147 147 m_in_srs = srs; … … 191 191 192 192 193 WriterImpl* WriterFactory::Create(std::ostream& ofs, LASHeader const& header)193 WriterImpl* WriterFactory::Create(std::ostream& ofs, liblas::Header const& header) 194 194 { 195 195 if (!ofs) -
src/index/datastream.cpp
r1433 r1613 58 58 59 59 60 LASIndexDataStream::LASIndexDataStream( LASReader *reader, long dimension) : m_reader(reader), m_pNext(0), m_id(0), m_idxDimension(dimension)60 LASIndexDataStream::LASIndexDataStream(liblas::Reader *reader, long dimension) : m_reader(reader), m_pNext(0), m_id(0), m_idxDimension(dimension) 61 61 { 62 62 bool read = readPoint(); … … 74 74 75 75 bool doRead = m_reader->ReadNextPoint(); 76 LASPoint* p;76 Point* p; 77 77 if (doRead) 78 p = ( LASPoint*) &(m_reader->GetPoint());78 p = (Point*) &(m_reader->GetPoint()); 79 79 else 80 80 return false; -
src/index/index.cpp
r1427 r1613 156 156 } 157 157 158 LASVariableRecord* LASIndex::GetVLR()158 liblas::VariableRecord* LASIndex::GetVLR() 159 159 { 160 160 if (m_idxType == eMemoryIndex) { return static_cast<VLRStorageManager*>(m_storage)->getVLR();} 161 161 else 162 return new LASVariableRecord();162 return new liblas::VariableRecord(); 163 163 } 164 164 … … 343 343 } 344 344 345 void LASIndex::insert( LASPoint& p, int64_t id)345 void LASIndex::insert(Point& p, int64_t id) 346 346 { 347 347 double min[3]; -
src/index/storage.cpp
r1402 r1613 82 82 void VLRStorageManager::loadByteArray(const SpatialIndex::id_type id, ::uint32_t& len, ::uint8_t** data) 83 83 { 84 LASVariableRecord* v = 0;84 liblas::VariableRecord* v = 0; 85 85 try 86 86 { … … 105 105 if (id == SpatialIndex::StorageManager::NewPage) 106 106 { 107 LASVariableRecord* v = makeVLR(len, data);107 liblas::VariableRecord* v = makeVLR(len, data); 108 108 assert(0 != v); 109 109 … … 122 122 else 123 123 { 124 LASVariableRecord* v_old = 0;124 liblas::VariableRecord* v_old = 0; 125 125 try 126 126 { … … 134 134 } 135 135 136 LASVariableRecord* v = makeVLR(len, data);136 liblas::VariableRecord* v = makeVLR(len, data); 137 137 assert(0 != v); 138 138 … … 144 144 void VLRStorageManager::deleteByteArray(const SpatialIndex::id_type id) 145 145 { 146 LASVariableRecord* v = 0;146 liblas::VariableRecord* v = 0; 147 147 try 148 148 { … … 163 163 164 164 165 LASVariableRecord* VLRStorageManager::makeVLR(const std::size_t len, const uint8_t* data)165 liblas::VariableRecord* VLRStorageManager::makeVLR(const std::size_t len, const uint8_t* data) 166 166 { 167 LASVariableRecord* v = new LASVariableRecord();167 liblas::VariableRecord* v = new liblas::VariableRecord(); 168 168 v->SetRecordLength(static_cast<uint16_t>(len)); 169 169 v->SetUserId("liblas.org"); … … 180 180 } 181 181 182 LASVariableRecord* VLRStorageManager::getVLR() const182 liblas::VariableRecord* VLRStorageManager::getVLR() const 183 183 { 184 184 return m_vlrbuffer[0]; -
src/las_c_api.cpp
r1607 r1613 221 221 222 222 std::istream* istrm = OpenInput(std::string(filename)); 223 return (LASReaderH) new LASReader(*istrm);223 return (LASReaderH) new liblas::Reader(*istrm); 224 224 225 225 … … 243 243 std::istream* istrm = OpenInput(std::string(filename)); 244 244 245 LASHeader* header = ((LASHeader*) hHeader);246 return (LASReaderH) new LASReader(*istrm, *header);245 liblas::Header* header = ((liblas::Header*) hHeader); 246 return (LASReaderH) new liblas::Reader(*istrm, *header); 247 247 248 248 … … 260 260 261 261 try { 262 LASReader* reader = (LASReader*)hReader;262 liblas::Reader* reader = (liblas::Reader*)hReader; 263 263 std::istream* istrm = &(reader->GetStream()); 264 264 … … 288 288 289 289 try { 290 LASReader *reader = ((LASReader*) hReader);290 liblas::Reader *reader = ((liblas::Reader*) hReader); 291 291 if (reader->ReadNextPoint()) 292 292 // return (LASPointH) new LASPoint(reader->GetPoint()); … … 309 309 310 310 try { 311 LASReader *reader = ((LASReader*) hReader);311 liblas::Reader *reader = ((liblas::Reader*) hReader); 312 312 if (reader->ReadPointAt((std::size_t) position)) 313 313 // return (LASPointH) new LASPoint(reader->GetPoint()); … … 329 329 VALIDATE_LAS_POINTER1(hReader, "LASReader_GetHeader", NULL); 330 330 331 LASHeader header = ((LASReader*) hReader)->GetHeader();332 return (LASHeaderH) new LASHeader( header );331 liblas::Header header = ((liblas::Reader*) hReader)->GetHeader(); 332 return (LASHeaderH) new liblas::Header( header ); 333 333 } 334 334 … … 339 339 340 340 try { 341 (( LASReader*) hReader)->SetSRS(*((LASSpatialReference*)hSRS));341 ((liblas::Reader*) hReader)->SetSRS(*((liblas::SpatialReference*)hSRS)); 342 342 } 343 343 catch (std::exception const& e) { … … 355 355 356 356 try { 357 (( LASReader*) hReader)->SetInputSRS(*((LASSpatialReference*)hSRS));357 ((liblas::Reader*) hReader)->SetInputSRS(*((liblas::SpatialReference*)hSRS)); 358 358 } 359 359 catch (std::exception const& e) { … … 371 371 372 372 try { 373 (( LASReader*) hReader)->SetOutputSRS(*((LASSpatialReference*)hSRS));373 ((liblas::Reader*) hReader)->SetOutputSRS(*((liblas::SpatialReference*)hSRS)); 374 374 } 375 375 catch (std::exception const& e) { … … 382 382 383 383 LAS_DLL LASHeaderH LASHeader_Create(void) { 384 return (LASHeaderH) new LASHeader();384 return (LASHeaderH) new liblas::Header(); 385 385 } 386 386 387 387 LAS_DLL LASPointH LASPoint_Create(void) { 388 return (LASPointH) new LASPoint();388 return (LASPointH) new liblas::Point(); 389 389 } 390 390 391 391 LAS_DLL LASPointH LASPoint_Copy(const LASPointH hPoint) { 392 return (LASPointH) new LASPoint(*((LASPoint*) hPoint));392 return (LASPointH) new liblas::Point(*((liblas::Point*) hPoint)); 393 393 } 394 394 395 395 LAS_DLL void LASPoint_Destroy(LASPointH hPoint) { 396 396 VALIDATE_LAS_POINTER0(hPoint, "LASPoint_Destroy"); 397 delete ( LASPoint*) hPoint;397 delete (liblas::Point*) hPoint; 398 398 hPoint = NULL; 399 399 } … … 403 403 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetX", 0.0); 404 404 405 double value = (( LASPoint*) hPoint)->GetX();405 double value = ((liblas::Point*) hPoint)->GetX(); 406 406 return value; 407 407 } … … 412 412 413 413 try { 414 (( LASPoint*) hPoint)->SetX(value);414 ((liblas::Point*) hPoint)->SetX(value); 415 415 } catch (std::exception const& e) 416 416 { … … 427 427 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetY", 0.0); 428 428 429 double value = (( LASPoint*) hPoint)->GetY();429 double value = ((liblas::Point*) hPoint)->GetY(); 430 430 return value; 431 431 } … … 436 436 437 437 try { 438 (( LASPoint*) hPoint)->SetY(value);438 ((liblas::Point*) hPoint)->SetY(value); 439 439 } catch (std::exception const& e) 440 440 { … … 451 451 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetZ", 0.0); 452 452 453 double value = (( LASPoint*) hPoint)->GetZ();453 double value = ((liblas::Point*) hPoint)->GetZ(); 454 454 return value; 455 455 } … … 460 460 461 461 try { 462 (( LASPoint*) hPoint)->SetZ(value);462 ((liblas::Point*) hPoint)->SetZ(value); 463 463 } catch (std::exception const& e) 464 464 { … … 475 475 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetIntensity", 0); 476 476 477 liblas::uint16_t value = (( LASPoint*) hPoint)->GetIntensity();477 liblas::uint16_t value = ((liblas::Point*) hPoint)->GetIntensity(); 478 478 return value; 479 479 } … … 484 484 485 485 try { 486 (( LASPoint*) hPoint)->SetIntensity(value);486 ((liblas::Point*) hPoint)->SetIntensity(value); 487 487 } catch (std::exception const& e) 488 488 { … … 499 499 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetReturnNumber", 0); 500 500 501 liblas::uint16_t value = (( LASPoint*) hPoint)->GetReturnNumber();501 liblas::uint16_t value = ((liblas::Point*) hPoint)->GetReturnNumber(); 502 502 return value; 503 503 } … … 508 508 509 509 try { 510 (( LASPoint*) hPoint)->SetReturnNumber(value);510 ((liblas::Point*) hPoint)->SetReturnNumber(value); 511 511 } catch (std::exception const& e) 512 512 { … … 523 523 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetNumberOfReturns", 0); 524 524 525 liblas::uint16_t value = (( LASPoint*) hPoint)->GetNumberOfReturns();525 liblas::uint16_t value = ((liblas::Point*) hPoint)->GetNumberOfReturns(); 526 526 return value; 527 527 } … … 532 532 533 533 try { 534 (( LASPoint*) hPoint)->SetNumberOfReturns(value);534 ((liblas::Point*) hPoint)->SetNumberOfReturns(value); 535 535 } catch (std::exception const& e) 536 536 { … … 547 547 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetScanDirection", 0); 548 548 549 liblas::uint16_t value = (( LASPoint*) hPoint)->GetScanDirection();549 liblas::uint16_t value = ((liblas::Point*) hPoint)->GetScanDirection(); 550 550 return value; 551 551 } … … 556 556 557 557 try { 558 (( LASPoint*) hPoint)->SetScanDirection(value);558 ((liblas::Point*) hPoint)->SetScanDirection(value); 559 559 } catch (std::exception const& e) 560 560 { … … 571 571 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetFlightLineEdge", 0); 572 572 573 liblas::uint16_t value = (( LASPoint*) hPoint)->GetFlightLineEdge();573 liblas::uint16_t value = ((liblas::Point*) hPoint)->GetFlightLineEdge(); 574 574 return value; 575 575 } … … 580 580 581 581 try { 582 (( LASPoint*) hPoint)->SetFlightLineEdge(value);582 ((liblas::Point*) hPoint)->SetFlightLineEdge(value); 583 583 } catch (std::exception const& e) 584 584 { … … 595 595 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetScanFlags", 0); 596 596 597 liblas::uint8_t value = (( LASPoint*) hPoint)->GetScanFlags();597 liblas::uint8_t value = ((liblas::Point*) hPoint)->GetScanFlags(); 598 598 return value; 599 599 } … … 604 604 605 605 try { 606 (( LASPoint*) hPoint)->SetScanFlags(value);606 ((liblas::Point*) hPoint)->SetScanFlags(value); 607 607 } catch (std::exception const& e) 608 608 { … … 619 619 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetClassification", 0); 620 620 621 LASClassification::bitset_type clsflags(((LASPoint*) hPoint)->GetClassification());621 liblas::Classification::bitset_type clsflags(((liblas::Point*) hPoint)->GetClassification()); 622 622 liblas::uint8_t value = static_cast<liblas::uint8_t>(clsflags.to_ulong()); 623 623 return value; … … 629 629 630 630 try { 631 (( LASPoint*) hPoint)->SetClassification(value);631 ((liblas::Point*) hPoint)->SetClassification(value); 632 632 } catch (std::exception const& e) 633 633 { … … 645 645 646 646 try { 647 (( LASPoint*) hPoint)->SetTime(value);647 ((liblas::Point*) hPoint)->SetTime(value); 648 648 } catch (std::exception const& e) 649 649 { … … 660 660 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetTime", 0.0); 661 661 662 double value = (( LASPoint*) hPoint)->GetTime();662 double value = ((liblas::Point*) hPoint)->GetTime(); 663 663 return value; 664 664 } … … 668 668 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetScanAngleRank", 0); 669 669 670 liblas::int8_t value = (( LASPoint*) hPoint)->GetScanAngleRank();670 liblas::int8_t value = ((liblas::Point*) hPoint)->GetScanAngleRank(); 671 671 return value; 672 672 } … … 677 677 678 678 try { 679 (( LASPoint*) hPoint)->SetScanAngleRank(value);679 ((liblas::Point*) hPoint)->SetScanAngleRank(value); 680 680 } catch (std::exception const& e) 681 681 { … … 692 692 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetPointSourceId", 0); 693 693 694 liblas::uint16_t value = (( LASPoint*) hPoint)->GetPointSourceID();694 liblas::uint16_t value = ((liblas::Point*) hPoint)->GetPointSourceID(); 695 695 return value; 696 696 } … … 701 701 702 702 try { 703 (( LASPoint*) hPoint)->SetPointSourceID(value);703 ((liblas::Point*) hPoint)->SetPointSourceID(value); 704 704 } catch (std::exception const& e) 705 705 { … … 717 717 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetUserData", 0); 718 718 719 liblas::uint8_t value = (( LASPoint*) hPoint)->GetUserData();719 liblas::uint8_t value = ((liblas::Point*) hPoint)->GetUserData(); 720 720 return value; 721 721 } … … 726 726 727 727 try { 728 (( LASPoint*) hPoint)->SetUserData(value);728 ((liblas::Point*) hPoint)->SetUserData(value); 729 729 } catch (std::exception const& e) 730 730 { … … 742 742 743 743 try { 744 LASPoint* p = ((LASPoint*) hPoint);744 liblas::Point* p = ((liblas::Point*) hPoint); 745 745 std::vector<liblas::uint8_t> d = p->GetExtraData(); 746 746 *length = d.size(); … … 764 764 765 765 try { 766 LASPoint* p = ((LASPoint*) hPoint);766 liblas::Point* p = ((liblas::Point*) hPoint); 767 767 std::vector<liblas::uint8_t> d; 768 768 d.resize(length); … … 784 784 VALIDATE_LAS_POINTER1(hPoint2, "LASPoint_Equal", 0); 785 785 786 LASPoint* point1 = ((LASPoint*) hPoint1);787 LASPoint* point2 = ((LASPoint*) hPoint2);786 liblas::Point* point1 = ((liblas::Point*) hPoint1); 787 liblas::Point* point2 = ((liblas::Point*) hPoint2); 788 788 789 789 return (point1 == point2); … … 796 796 797 797 try { 798 (( LASPoint*) hPoint)->Validate();798 ((liblas::Point*) hPoint)->Validate(); 799 799 } catch (invalid_point_data const& e /*e */) { 800 800 return e.who(); … … 811 811 812 812 VALIDATE_LAS_POINTER1(hPoint, "LASPoint_IsValid", LE_Failure); 813 return (( LASPoint*) hPoint)->IsValid();813 return ((liblas::Point*) hPoint)->IsValid(); 814 814 } 815 815 … … 818 818 VALIDATE_LAS_POINTER1(hHeader, "LASHeader_GetFileSignature", NULL); 819 819 820 std::string signature = (( LASHeader*) hHeader)->GetFileSignature();820 std::string signature = ((liblas::Header*) hHeader)->GetFileSignature(); 821 821 return strdup(signature.c_str()); 822 822 } … … 825 825 VALIDATE_LAS_POINTER1(hHeader, "LASHeader_GetFileSourceId", 0); 826 826 827 unsigned short value = (( LASHeader*) hHeader)->GetFileSourceId();827 unsigned short value = ((liblas::Header*) hHeader)->GetFileSourceId(); 828 828 return value; 829 829 } … … 831 831 LAS_DLL LASErrorEnum LASHeader_SetFileSourceId(LASHeaderH hHeader, liblas::uint16_t value) { 832 832 VALIDATE_LAS_POINTER1(hHeader, "LASHeader_SetFileSourceId", LE_Failure); 833 (( LASHeader*) hHeader)->SetFileSourceId(value);833 ((liblas::Header*) hHeader)->SetFileSourceId(value); 834 834 return LE_None; 835 835 } … … 839 839 VALIDATE_LAS_POINTER1(hHeader, "LASHeader_GetReserved", 0); 840 840 841 unsigned short value = (( LASHeader*) hHeader)->GetReserved();841 unsigned short value = ((liblas::Header*) hHeader)->GetReserved(); 842 842 return value; 843 843 } … … 845 845 LAS_DLL LASErrorEnum LASHeader_SetReserved(LASHeaderH hHeader, liblas::uint16_t value) { 846 846 VALIDATE_LAS_POINTER1(hHeader, "LASHeader_SetReserved", LE_Failure); 847 (( LASHeader*) hHeader)->SetReserved(value);847 ((liblas::Header*) hHeader)->SetReserved(value); 848 848 return LE_None; 849 849 } … … 852 852 VALIDATE_LAS_POINTER1(hHeader, "LASHeader_GetProjectId", 0); 853 853 854 liblas::guid id = (( LASHeader*) hHeader)->GetProjectId();854 liblas::guid id = ((liblas::Header*) hHeader)->GetProjectId(); 855 855 return strdup(id.to_string().c_str()); 856 856 } … … 862 862 liblas::guid id; 863 863 id = liblas::guid(value); 864 (( LASHeader*) hHeader)->SetProjectId(id);864 ((liblas::Header*) hHeader)->SetProjectId(id); 865 865 } catch (std::exception const& e) 866 866 { … … 875 875 VALIDATE_LAS_POINTER1(hHeader, "LASHeader_GetVersionMajor", 0); 876 876 877 long value = (( LASHeader*) hHeader)->GetVersionMajor();877 long value = ((liblas::Header*) hHeader)->GetVersionMajor(); 878 878 return liblas::uint8_t(value); 879 879 } … … 883 883 884 884 try { 885 (( LASHeader*) hHeader)->SetVersionMajor(value);885 ((liblas::Header*) hHeader)->SetVersionMajor(value); 886 886 } catch (std::exception const& e) 887 887 { … … 896 896 VALIDATE_LAS_POINTER1(hHeader, "LASHeader_GetVersionMinor", 0); 897 897 898 long value = (( LASHeader*) hHeader)->GetVersionMinor();898 long value = ((liblas::Header*) hHeader)->GetVersionMinor(); 899 899 return liblas::uint8_t(value); 900 900 } … … 905 905 // TODO: Maybe this should be a fatal error -- hobu 906 906 try { 907 (( LASHeader*) hHeader)->SetVersionMinor(value);907 ((liblas::Header*) hHeader)->SetVersionMinor(value); 908 908 } catch (std::exception const& e) 909 909 { … … 919 919 920 920 // caller owns it 921 std::string sysid = (( LASHeader*) hHeader)->GetSystemId();921 std::string sysid = ((liblas::Header*) hHeader)->GetSystemId(); 922 922 return strdup(sysid.c_str()); 923 923 } … … 927 927 928 928 try { 929 (( LASHeader*) hHeader)->SetSystemId(value);929 ((liblas::Header*) hHeader)->SetSystemId(value); 930 930 } catch (std::exception const& e) 931 931 { … … 941 941 942 942 // caller owns it 943 std::string softid = (( LASHeader*) hHeader)->GetSoftwareId();943 std::string softid = ((liblas::Header*) hHeader)->GetSoftwareId(); 944 944 return strdup(softid.c_str()); 945 945 } … … 949 949 950 950 try { 951 (( LASHeader*) hHeader)->SetSoftwareId(value);951 ((liblas::Header*) hHeader)->SetSoftwareId(value); 952 952 } catch (std::exception const& e) 953 953 { … … 962 962 VALIDATE_LAS_POINTER1(hHeader, "LASHeader_GetCreationDOY", 0); 963 963 964 unsigned short value = (( LASHeader*) hHeader)->GetCreationDOY();964 unsigned short value = ((liblas::Header*) hHeader)->GetCreationDOY(); 965 965 return value; 966 966 } … … 968 968 LAS_DLL LASErrorEnum LASHeader_SetCreationDOY(LASHeaderH hHeader, liblas::uint16_t value) { 969 969 VALIDATE_LAS_POINTER1(hHeader, "LASHeader_SetCreationDOY", LE_Failure); 970 (( LASHeader*) hHeader)->SetCreationDOY(value);970 ((liblas::Header*) hHeader)->SetCreationDOY(value); 971 971 return LE_None;
