Changeset 1571:205c10bd248d
- Timestamp:
- 02/12/10 10:47:52 (6 months ago)
- Branch:
- default
- Children:
- 1572:91621a850c3b, 1573:6c8a83eaffdc
- Location:
- include
- Files:
-
- 3 edited
- 1 copied
-
Makefile.am (modified) (1 diff)
-
liblas/detail/reader/reader.hpp (modified) (1 diff)
-
liblas/interfaces.hpp (copied) (copied from include/liblas/lasreader.hpp) (4 diffs)
-
liblas/lasreader.hpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
include/Makefile.am
r1561 r1571 5 5 liblas/exception.hpp \ 6 6 liblas/guid.hpp \ 7 liblas/interfaces.hpp \ 7 8 liblas/iterator.hpp \ 8 9 liblas/lasclassification.hpp \ -
include/liblas/detail/reader/reader.hpp
r1568 r1571 46 46 #include <liblas/detail/reader/point.hpp> 47 47 #include <liblas/detail/reader/header.hpp> 48 #include <liblas/ lasreader.hpp>48 #include <liblas/interfaces.hpp> 49 49 50 50 // std -
include/liblas/interfaces.hpp
r1568 r1571 3 3 * 4 4 * Project: libLAS - http://liblas.org - A BSD library for LAS format data. 5 * Purpose: LAS reader class6 * Author: Mateusz Loskot, mateusz@loskot.net5 * Purpose: LAS interface declarations 6 * Author: Howard Butler, hobu.inc@gmail.com 7 7 * 8 8 ****************************************************************************** 9 * Copyright (c) 2008, Mateusz Loskot 10 * Copyright (c) 2008, Phil Vachon 9 * Copyright (c) 2010, Howard Butler 11 10 * 12 11 * All rights reserved. … … 41 40 ****************************************************************************/ 42 41 43 #ifndef LIBLAS_ LASREADER_HPP_INCLUDED44 #define LIBLAS_ LASREADER_HPP_INCLUDED42 #ifndef LIBLAS_INTERFACES_HPP_INCLUDED 43 #define LIBLAS_INTERFACES_HPP_INCLUDED 45 44 46 45 #include <liblas/lasversion.hpp> … … 59 58 60 59 namespace liblas { 61 62 class ReaderI;63 64 /// Defines public interface to LAS reader implementation.65 class LASReader66 {67 public:68 69 /// Consructor initializes reader with input stream as source of LAS records.70 /// @param ifs - stream used as source of LAS records.71 /// @excepion std::runtime_error - on failure state of the input stream.72 LASReader(std::istream& ifs);73 74 LASReader(ReaderI* reader);75 76 /// User-defined consructor initializes reader with input stream and77 /// a header to override the values in the file78 /// @excepion std::runtime_error - on failure state of the input stream.79 LASReader(std::istream& ifs, LASHeader& header);80 81 /// Destructor.82 /// @excepion nothrow83 ~LASReader();84 85 /// Provides read-only access to header of LAS file being read.86 /// @excepion nothrow87 LASHeader const& GetHeader() const;88 89 /// Provides read-only access to current point record.90 /// @excepion nothrow91 LASPoint const& GetPoint() const;92 93 /// Provides read-only access to collection of variable-length records.94 /// @excepion nothrow95 std::vector<LASVariableRecord> const& GetVLRs() const;96 97 /// Allow fetching of the stream attached to the reader.98 /// @excepion nothrow99 std::istream& GetStream() const;100 101 /// Checks if end-of-file has been reached.102 bool IsEOF() const;103 104 /// Fetches next point record in file.105 /// @excepion may throw std::exception106 bool ReadNextPoint();107 108 /// Fetches n-th point record from file.109 /// @excepion may throw std::exception110 bool ReadPointAt(std::size_t n);111 112 /// Reinitializes state of the reader.113 /// @excepion may throw std::exception114 void Reset();115 116 /// Reproject data as they are written if the LASReader's reference is117 /// different than the LASHeader's.118 /// @excepion may throw std::exception119 bool SetSRS(const LASSpatialReference& ref);120 121 /// Override the spatial reference of the LASReader's LASHeader for122 /// writing purposes.123 /// @excepion may throw std::exception124 bool SetInputSRS(const LASSpatialReference& ref);125 126 /// Override the spatial reference of the LASReader's LASHeader for127 /// writing purposes.128 /// @excepion may throw std::exception129 bool SetOutputSRS(const LASSpatialReference& ref);130 131 /// Provides index-based access to point records.132 /// The operator is implemented in terms of ReadPointAt method133 /// and is not const-qualified because it updates file stream position.134 /// @excepion may throw std::exception135 LASPoint const& operator[](std::size_t n);136 137 private:138 139 // Blocked copying operations, declared but not defined.140 LASReader(LASReader const& other);141 LASReader& operator=(LASReader const& rhs);142 143 void Init(); // throws on error144 145 const std::auto_ptr<detail::ReaderImpl> m_pimpl;146 LASHeader m_header;147 LASPoint* m_point;148 LASPoint* m_empty_point;149 // std::vector<LASVariableRecord> m_vlrs;150 151 // Set if the user provides a header to override the header as152 // read from the istream153 bool bCustomHeader;154 155 };156 157 60 158 61 class ReaderI … … 173 76 } // namespace liblas 174 77 175 #endif // ndef LIBLAS_ LASREADER_HPP_INCLUDED78 #endif // ndef LIBLAS_INTERFACES_HPP_INCLUDED -
include/liblas/lasreader.hpp
r1568 r1571 51 51 #include <liblas/detail/fwd.hpp> 52 52 53 #include <liblas/interfaces.hpp> 54 53 55 // std 54 56 #include <iosfwd> … … 60 62 namespace liblas { 61 63 62 class ReaderI;63 64 64 /// Defines public interface to LAS reader implementation. 65 65 class LASReader … … 156 156 157 157 158 class ReaderI159 {160 public:161 162 virtual LASHeader const& ReadHeader() = 0;163 virtual LASPoint const& ReadNextPoint(const LASHeader& header) = 0;164 virtual LASPoint const& ReadPointAt(std::size_t n, const LASHeader& header) = 0;165 166 virtual void Reset(const LASHeader& header) = 0;167 virtual void SetInputSRS(const LASSpatialReference& srs) = 0;168 virtual void SetOutputSRS(const LASSpatialReference& srs, const LASHeader& header) = 0;169 170 virtual ~ReaderI() {};171 };172 158 173 159 } // namespace liblas
Note: See TracChangeset
for help on using the changeset viewer.
