[Liblas-commits] hg: add GetFilters and GetTransforms methods to
liblas::WriterI ...
liblas-commits at liblas.org
liblas-commits at liblas.org
Tue Jan 18 14:28:24 EST 2011
details: http://hg.liblas.orghg/rev/7e40c8e1bf33
changeset: 2779:7e40c8e1bf33
user: Howard Butler <hobu.inc at gmail.com>
date: Tue Jan 18 13:28:11 2011 -0600
description:
add GetFilters and GetTransforms methods to liblas::WriterI and liblas::ReaderI for symmetry
diffstat:
include/liblas/detail/reader/cachedreader.hpp | 3 +++
include/liblas/detail/reader/reader.hpp | 3 +++
include/liblas/detail/reader/zipreader.hpp | 3 +++
include/liblas/detail/writer/writer.hpp | 5 ++++-
include/liblas/detail/writer/zipwriter.hpp | 3 +++
include/liblas/liblas.hpp | 8 +++++++-
include/liblas/reader.hpp | 13 ++++++-------
include/liblas/writer.hpp | 13 +++++++------
src/detail/reader/cachedreader.cpp | 8 ++++++++
src/detail/reader/reader.cpp | 10 ++++++++++
src/detail/reader/zipreader.cpp | 9 +++++++++
src/detail/writer/writer.cpp | 8 ++++++++
src/detail/writer/zipwriter.cpp | 8 ++++++++
src/reader.cpp | 10 ++++++++++
src/writer.cpp | 9 ++++++++-
15 files changed, 97 insertions(+), 16 deletions(-)
diffs (truncated from 320 to 300 lines):
diff -r a8d635156691 -r 7e40c8e1bf33 include/liblas/detail/reader/cachedreader.hpp
--- a/include/liblas/detail/reader/cachedreader.hpp Tue Jan 18 11:24:20 2011 -0600
+++ b/include/liblas/detail/reader/cachedreader.hpp Tue Jan 18 13:28:11 2011 -0600
@@ -67,7 +67,10 @@
void Seek(std::size_t n);
void Reset();
void SetFilters(std::vector<liblas::FilterPtr> const& filters);
+ std::vector<liblas::FilterPtr> GetFilters() const;
+
void SetTransforms(std::vector<liblas::TransformPtr> const& transforms);
+ std::vector<liblas::TransformPtr> GetTransforms() const;
protected:
diff -r a8d635156691 -r 7e40c8e1bf33 include/liblas/detail/reader/reader.hpp
--- a/include/liblas/detail/reader/reader.hpp Tue Jan 18 11:24:20 2011 -0600
+++ b/include/liblas/detail/reader/reader.hpp Tue Jan 18 13:28:11 2011 -0600
@@ -74,7 +74,10 @@
void Reset();
void SetFilters(std::vector<liblas::FilterPtr> const& filters);
+ std::vector<liblas::FilterPtr> GetFilters() const;
+
void SetTransforms(std::vector<liblas::TransformPtr> const& transforms);
+ std::vector<liblas::TransformPtr> GetTransforms() const;
protected:
diff -r a8d635156691 -r 7e40c8e1bf33 include/liblas/detail/reader/zipreader.hpp
--- a/include/liblas/detail/reader/zipreader.hpp Tue Jan 18 11:24:20 2011 -0600
+++ b/include/liblas/detail/reader/zipreader.hpp Tue Jan 18 13:28:11 2011 -0600
@@ -83,7 +83,10 @@
void Reset();
void SetFilters(std::vector<liblas::FilterPtr> const& filters);
+ std::vector<liblas::FilterPtr> GetFilters() const;
+
void SetTransforms(std::vector<liblas::TransformPtr> const& transforms);
+ std::vector<liblas::TransformPtr> GetTransforms() const;
protected:
bool FilterPoint(liblas::Point const& p);
diff -r a8d635156691 -r 7e40c8e1bf33 include/liblas/detail/writer/writer.hpp
--- a/include/liblas/detail/writer/writer.hpp Tue Jan 18 11:24:20 2011 -0600
+++ b/include/liblas/detail/writer/writer.hpp Tue Jan 18 13:28:11 2011 -0600
@@ -71,8 +71,11 @@
void SetHeader(liblas::Header const& header);
void SetFilters(std::vector<liblas::FilterPtr> const& filters);
+ std::vector<liblas::FilterPtr> GetFilters() const;
+
void SetTransforms(std::vector<liblas::TransformPtr> const& transforms);
-
+ std::vector<liblas::TransformPtr> GetTransforms() const;
+
protected:
std::ostream& m_ofs;
diff -r a8d635156691 -r 7e40c8e1bf33 include/liblas/detail/writer/zipwriter.hpp
--- a/include/liblas/detail/writer/zipwriter.hpp Tue Jan 18 11:24:20 2011 -0600
+++ b/include/liblas/detail/writer/zipwriter.hpp Tue Jan 18 13:28:11 2011 -0600
@@ -78,7 +78,10 @@
void SetHeader(liblas::Header const& header);
void SetFilters(std::vector<liblas::FilterPtr> const& filters);
+ std::vector<liblas::FilterPtr> GetFilters() const;
+
void SetTransforms(std::vector<liblas::TransformPtr> const& transforms);
+ std::vector<liblas::TransformPtr> GetTransforms() const;
protected:
diff -r a8d635156691 -r 7e40c8e1bf33 include/liblas/liblas.hpp
--- a/include/liblas/liblas.hpp Tue Jan 18 11:24:20 2011 -0600
+++ b/include/liblas/liblas.hpp Tue Jan 18 13:28:11 2011 -0600
@@ -201,7 +201,10 @@
virtual void SetFilters(std::vector<liblas::FilterPtr> const& filters) = 0;
virtual void SetTransforms(std::vector<liblas::TransformPtr> const& transforms) = 0;
-
+
+ virtual std::vector<liblas::TransformPtr> GetTransforms() const = 0;
+ virtual std::vector<liblas::FilterPtr> GetFilters() const = 0;
+
virtual ~ReaderI() {}
};
@@ -220,6 +223,9 @@
virtual void SetFilters(std::vector<liblas::FilterPtr> const& filters) = 0;
virtual void SetTransforms(std::vector<liblas::TransformPtr> const& transforms) = 0;
+ virtual std::vector<liblas::TransformPtr> GetTransforms() const = 0;
+ virtual std::vector<liblas::FilterPtr> GetFilters() const = 0;
+
virtual ~WriterI() {}
diff -r a8d635156691 -r 7e40c8e1bf33 include/liblas/reader.hpp
--- a/include/liblas/reader.hpp Tue Jan 18 11:24:20 2011 -0600
+++ b/include/liblas/reader.hpp Tue Jan 18 13:28:11 2011 -0600
@@ -120,18 +120,17 @@
/// They only affect reading ReadNextPoint-style operations
/// Filters are applied *before* transforms.
void SetFilters(std::vector<liblas::FilterPtr> const& filters);
+
+ /// Gets the list of filters to be applied to points as they are read
+ std::vector<liblas::FilterPtr> GetFilters() const;
/// Sets transforms to apply to points. Points are transformed in
/// place *in the order* of the transform list.
- /// Filters are applied *before* transforms. If an input/output SRS
- /// is set on the reader, the reprojection transform will happen *first*
- /// before any other transforms are applied. This transform is a
- /// special case. You can define your own reprojection transforms and add
- /// it to the list, but be sure to not issue a SetOutputSRS to trigger
- /// the internal transform creation
+ /// Filters are applied *before* transforms.
void SetTransforms(std::vector<liblas::TransformPtr> const& transforms);
-
+ /// Gets the list of transforms to be applied to points as they are read
+ std::vector<liblas::TransformPtr> GetTransforms() const;
private:
diff -r a8d635156691 -r 7e40c8e1bf33 include/liblas/writer.hpp
--- a/include/liblas/writer.hpp Tue Jan 18 11:24:20 2011 -0600
+++ b/include/liblas/writer.hpp Tue Jan 18 13:28:11 2011 -0600
@@ -95,15 +95,16 @@
/// Filters are applied *before* transforms.
void SetFilters(std::vector<liblas::FilterPtr> const& filters);
+ /// Gets the list of filters to be applied to points as they are written
+ std::vector<liblas::FilterPtr> GetFilters() const;
+
/// Sets transforms to apply to points. Points are transformed in
/// place *in the order* of the transform list.
- /// Filters are applied *before* transforms. If an input/output SRS
- /// is set on the writer, the reprojection transform will happen *first*
- /// before any other transforms are applied. This transform is a
- /// special case. You can define your own reprojection transforms and add
- /// it to the list, but be sure to not issue a SetOutputSRS to trigger
- /// the internal transform creation
+ /// Filters are applied *before* transforms.
void SetTransforms(std::vector<liblas::TransformPtr> const& transforms);
+
+ /// Gets the list of transforms to be applied to points as they are read
+ std::vector<liblas::TransformPtr> GetTransforms() const;
private:
diff -r a8d635156691 -r 7e40c8e1bf33 src/detail/reader/cachedreader.cpp
--- a/src/detail/reader/cachedreader.cpp Tue Jan 18 11:24:20 2011 -0600
+++ b/src/detail/reader/cachedreader.cpp Tue Jan 18 13:28:11 2011 -0600
@@ -323,6 +323,10 @@
Reset();
ReaderImpl::SetFilters(filters);
}
+std::vector<liblas::FilterPtr> CachedReaderImpl::GetFilters() const
+{
+ return ReaderImpl::GetFilters();
+}
void CachedReaderImpl::SetTransforms(std::vector<liblas::TransformPtr> const& transforms)
{
@@ -332,5 +336,9 @@
}
+std::vector<liblas::TransformPtr> CachedReaderImpl::GetTransforms() const
+{
+ return ReaderImpl::GetTransforms();
+}
}} // namespace liblas::detail
diff -r a8d635156691 -r 7e40c8e1bf33 src/detail/reader/reader.cpp
--- a/src/detail/reader/reader.cpp Tue Jan 18 11:24:20 2011 -0600
+++ b/src/detail/reader/reader.cpp Tue Jan 18 13:28:11 2011 -0600
@@ -259,6 +259,11 @@
m_filters = filters;
}
+std::vector<liblas::FilterPtr> ReaderImpl::GetFilters() const
+{
+ return m_filters;
+}
+
void ReaderImpl::SetTransforms(std::vector<liblas::TransformPtr> const& transforms)
{
m_transforms = transforms;
@@ -270,5 +275,10 @@
bNeedHeaderCheck = true;
}
+std::vector<liblas::TransformPtr> ReaderImpl::GetTransforms() const
+{
+ return m_transforms;
+}
+
}} // namespace liblas::detail
diff -r a8d635156691 -r 7e40c8e1bf33 src/detail/reader/zipreader.cpp
--- a/src/detail/reader/zipreader.cpp Tue Jan 18 11:24:20 2011 -0600
+++ b/src/detail/reader/zipreader.cpp Tue Jan 18 13:28:11 2011 -0600
@@ -383,6 +383,10 @@
{
m_filters = filters;
}
+std::vector<liblas::FilterPtr> ZipReaderImpl::GetFilters() const
+{
+ return m_filters;
+}
void ZipReaderImpl::SetTransforms(std::vector<liblas::TransformPtr> const& transforms)
{
@@ -395,6 +399,11 @@
bNeedHeaderCheck = true;
}
+std::vector<liblas::TransformPtr> ZipReaderImpl::GetTransforms() const
+{
+ return m_transforms;
+}
+
}} // namespace liblas::detail
#endif // HAVE_LASZIP
diff -r a8d635156691 -r 7e40c8e1bf33 src/detail/writer/writer.cpp
--- a/src/detail/writer/writer.cpp Tue Jan 18 11:24:20 2011 -0600
+++ b/src/detail/writer/writer.cpp Tue Jan 18 13:28:11 2011 -0600
@@ -112,11 +112,19 @@
{
m_filters = filters;
}
+std::vector<liblas::FilterPtr> WriterImpl::GetFilters() const
+{
+ return m_filters;
+}
void WriterImpl::SetTransforms(std::vector<liblas::TransformPtr> const& transforms)
{
m_transforms = transforms;
}
+std::vector<liblas::TransformPtr> WriterImpl::GetTransforms() const
+{
+ return m_transforms;
+}
liblas::Header& WriterImpl::GetHeader() const
{
diff -r a8d635156691 -r 7e40c8e1bf33 src/detail/writer/zipwriter.cpp
--- a/src/detail/writer/zipwriter.cpp Tue Jan 18 11:24:20 2011 -0600
+++ b/src/detail/writer/zipwriter.cpp Tue Jan 18 13:28:11 2011 -0600
@@ -179,11 +179,19 @@
{
m_filters = filters;
}
+std::vector<liblas::FilterPtr> ZipWriterImpl::GetFilters() const
+{
+ return m_filters;
+}
void ZipWriterImpl::SetTransforms(std::vector<liblas::TransformPtr> const& transforms)
{
m_transforms = transforms;
}
+std::vector<liblas::TransformPtr> ZipWriterImpl::GetTransforms() const
+{
+ return m_transforms;
+}
liblas::Header& ZipWriterImpl::GetHeader() const
{
diff -r a8d635156691 -r 7e40c8e1bf33 src/reader.cpp
--- a/src/reader.cpp Tue Jan 18 11:24:20 2011 -0600
+++ b/src/reader.cpp Tue Jan 18 13:28:11 2011 -0600
@@ -188,10 +188,20 @@
m_pimpl->SetFilters(filters);
}
+std::vector<liblas::FilterPtr> Reader::GetFilters() const
+{
+ return m_pimpl->GetFilters();
+}
+
void Reader::SetTransforms(std::vector<liblas::TransformPtr> const& transforms)
{
m_pimpl->SetTransforms(transforms);
}
+std::vector<liblas::TransformPtr> Reader::GetTransforms() const
+{
+ return m_pimpl->GetTransforms();
+}
+
} // namespace liblas
diff -r a8d635156691 -r 7e40c8e1bf33 src/writer.cpp
--- a/src/writer.cpp Tue Jan 18 11:24:20 2011 -0600
+++ b/src/writer.cpp Tue Jan 18 13:28:11 2011 -0600
More information about the Liblas-commits
mailing list