1
#ifndef TS2LAS_HPP_INCLUDED
3
#include <liblas/detail/private_utility.hpp>
5
#include <liblas/liblas.hpp>
9
#define compare_no_case(a,b,n) _strnicmp( (a), (b), (n) )
11
#define compare_no_case(a,b,n) strncasecmp( (a), (b), (n) )
14
using namespace liblas;
29
boost::uint16_t EchoInt;
69
boost::uint16_t Intensity;
89
boost::int32_t HdrSize;
90
boost::int32_t HdrVersion;
91
boost::int32_t Tunniste;
93
boost::int32_t PntCnt;
116
namespace liblas { namespace detail {
121
inline void read_n <ScanRow>(ScanRow& dest, std::istream& src, std::streamsize const& num)
123
// TODO: Review and redesign errors handling logic if necessary
125
throw std::runtime_error("detail::liblas::read_n<ScanRow> input stream is not readable");
127
src.read(detail::as_buffer(dest), num);
128
detail::check_stream_state(src);
131
LIBLAS_SWAP_BYTES(dest.x);
132
LIBLAS_SWAP_BYTES(dest.y);
133
LIBLAS_SWAP_BYTES(dest.z);
134
LIBLAS_SWAP_BYTES(dest.Code);
135
LIBLAS_SWAP_BYTES(dest.Line);
136
LIBLAS_SWAP_BYTES(dest.EchoInt);
141
inline void read_n <ScanPnt>(ScanPnt& dest, std::istream& src, std::streamsize const& num)
143
// TODO: Review and redesign errors handling logic if necessary
145
throw std::runtime_error("detail::liblas::read_n<ScanPnt> input stream is not readable");
147
src.read(detail::as_buffer(dest), num);
148
detail::check_stream_state(src);
151
LIBLAS_SWAP_BYTES(dest.Pnt.x);
152
LIBLAS_SWAP_BYTES(dest.Pnt.y);
153
LIBLAS_SWAP_BYTES(dest.Pnt.z);
154
LIBLAS_SWAP_BYTES(dest.Code);
155
LIBLAS_SWAP_BYTES(dest.Echo);
156
LIBLAS_SWAP_BYTES(dest.Flag);
157
LIBLAS_SWAP_BYTES(dest.Mark);
158
LIBLAS_SWAP_BYTES(dest.Line);
159
LIBLAS_SWAP_BYTES(dest.Intensity);
164
inline void read_n <ScanHdr>(ScanHdr& dest, std::istream& src, std::streamsize const& num)
166
// TODO: Review and redesign errors handling logic if necessary
168
throw std::runtime_error("detail::liblas::read_n<ScanHdr> input stream is not readable");
170
src.read(detail::as_buffer(dest), num);
171
detail::check_stream_state(src);
174
LIBLAS_SWAP_BYTES(dest.HdrSize);
175
LIBLAS_SWAP_BYTES(dest.HdrVersion);
176
LIBLAS_SWAP_BYTES(dest.Tunniste);
177
LIBLAS_SWAP_BYTES(dest.Magic);
178
LIBLAS_SWAP_BYTES(dest.PntCnt);
179
LIBLAS_SWAP_BYTES(dest.Units);
180
LIBLAS_SWAP_BYTES(dest.Time);
181
LIBLAS_SWAP_BYTES(dest.Color);
184
}} // namespace liblas::detail
186
#endif // TS2LAS_HPP_INCLUDED