44 #ifndef LIBLAS_HPP_INCLUDED 45 #define LIBLAS_HPP_INCLUDED 66 #include <liblas/detail/endian.hpp> 67 #include <liblas/detail/private_utility.hpp> 73 #include <boost/array.hpp> 74 #include <boost/concept_check.hpp> 76 #include <boost/shared_ptr.hpp> 81 #include <boost/iostreams/device/file.hpp> 82 #include <boost/iostreams/stream.hpp> 83 #include <boost/iostreams/stream_buffer.hpp> 112 inline bool Open(std::ifstream& ifs, std::string
const& filename)
114 ifs.open(filename.c_str(), std::ios::in | std::ios::binary);
115 return ifs.is_open();
118 inline std::istream*
Open(std::string
const& filename, std::ios::openmode mode)
121 namespace io = boost::iostreams;
122 io::stream<io::file_source>* ifs =
NULL;
125 ifs =
new io::stream<io::file_source>();
126 ifs->open(filename.c_str(), mode);
127 if (ifs->is_open() ==
false)
return NULL;
135 std::ifstream* ifs =
NULL;
138 ifs =
new std::ifstream();
139 ifs->open(filename.c_str(), mode);
140 if (ifs->is_open() ==
false) {
162 inline bool Create(std::ofstream& ofs, std::string
const& filename)
164 ofs.open(filename.c_str(), std::ios::out | std::ios::binary);
165 return ofs.is_open();
168 inline std::ostream*
Create(std::string
const& filename, std::ios::openmode mode)
171 namespace io = boost::iostreams;
172 io::stream<io::file_sink>* ofs =
new io::stream<io::file_sink>();
173 ofs->open(filename.c_str(), mode);
174 if (ofs->is_open() ==
false)
return NULL;
177 std::ofstream* ofs =
new std::ofstream();
178 ofs->open(filename.c_str(), mode);
179 if (ofs->is_open() ==
false)
return NULL;
190 namespace io = boost::iostreams;
191 namespace io = boost::iostreams;
192 io::stream<io::file_sink>* source =
dynamic_cast<io::stream<io::file_sink>*
>(ofs);
200 std::ofstream* source =
dynamic_cast<std::ofstream*
>(ofs);
216 namespace io = boost::iostreams;
217 io::stream<io::file_source>* source =
dynamic_cast<io::stream<io::file_source>*
>(ifs);
224 std::ifstream* source =
dynamic_cast<std::ifstream*
>(ifs);
245 virtual void Seek(std::size_t n) = 0;
247 virtual void Reset() = 0;
249 virtual void SetFilters(std::vector<liblas::FilterPtr>
const& filters) = 0;
250 virtual void SetTransforms(std::vector<liblas::TransformPtr>
const& transforms) = 0;
252 virtual std::vector<liblas::TransformPtr>
GetTransforms()
const = 0;
253 virtual std::vector<liblas::FilterPtr>
GetFilters()
const = 0;
264 virtual void WriteHeader() = 0;
267 virtual void UpdatePointCount(uint32_t count) = 0;
268 virtual void WritePoint(
const Point& point) = 0;
270 virtual void SetFilters(std::vector<liblas::FilterPtr>
const& filters) = 0;
271 virtual void SetTransforms(std::vector<liblas::TransformPtr>
const& transforms) = 0;
273 virtual std::vector<liblas::TransformPtr>
GetTransforms()
const = 0;
274 virtual std::vector<liblas::FilterPtr>
GetFilters()
const = 0;
283 #endif // LIBLAS_HPP_INCLUDED virtual Point const & ReadPointAt(std::size_t n)=0
#define NULL
Definition: las_config.h:63
virtual ~WriterI()
Definition: liblas.hpp:277
void Cleanup(std::ostream *ofs)
Definition: liblas.hpp:184
virtual std::vector< liblas::FilterPtr > GetFilters() const =0
Definition: liblas.hpp:235
bool Open(std::ifstream &ifs, std::string const &filename)
Open file to read in binary mode.
Definition: liblas.hpp:112
virtual liblas::Point const & GetPoint() const =0
virtual void SetHeader(liblas::Header const &header)=0
Definition: liblas.hpp:258
bool Create(std::ofstream &ofs, std::string const &filename)
Create file and open to write in binary mode.
Definition: liblas.hpp:162
Namespace grouping all elements of libLAS public interface.
Definition: bounds.hpp:60
Point data record composed with X, Y, Z coordinates and attributes.
Definition: point.hpp:68
virtual ~ReaderI()
Definition: liblas.hpp:255
virtual std::vector< liblas::TransformPtr > GetTransforms() const =0
virtual void Seek(std::size_t n)=0
virtual void ReadHeader()=0
virtual void ReadNextPoint()=0
virtual liblas::Header const & GetHeader() const =0
virtual void SetTransforms(std::vector< liblas::TransformPtr > const &transforms)=0
virtual void SetFilters(std::vector< liblas::FilterPtr > const &filters)=0