[Liblas-commits] hg: ignore cmake stuff
liblas-commits at liblas.org
liblas-commits at liblas.org
Wed Sep 30 16:28:03 EDT 2009
changeset f96fb478a808 in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=f96fb478a808
summary: ignore cmake stuff
diffstat:
.hgignore | 7 ++++++-
include/liblas/detail/reader.hpp | 3 +++
include/liblas/detail/writer.hpp | 3 +++
include/liblas/lasreader.hpp | 13 ++++++++++++-
include/liblas/laswriter.hpp | 2 ++
src/detail/reader.cpp | 32 +++++++++++++++++++++++++++++++-
src/detail/writer.cpp | 27 +++++++++++++++++++++++++++
src/lasreader.cpp | 14 +++++++++++++-
src/laswriter.cpp | 12 +++++++++++-
9 files changed, 108 insertions(+), 5 deletions(-)
diffs (228 lines):
diff -r 47aa99c03689 -r f96fb478a808 .hgignore
--- a/.hgignore Wed Sep 30 11:05:27 2009 -0500
+++ b/.hgignore Wed Sep 30 15:25:21 2009 -0500
@@ -36,4 +36,9 @@
python/build/*
python/dist/*
python/libLAS.egg-info/*
-python/liblas/*.pyc
\ No newline at end of file
+python/liblas/*.pyc
+src/CMakeFiles
+CMakeFiles
+CMakeCache.txt
+cmake_install.cmake
+src/liblas.a
\ No newline at end of file
diff -r 47aa99c03689 -r f96fb478a808 include/liblas/detail/reader.hpp
--- a/include/liblas/detail/reader.hpp Wed Sep 30 11:05:27 2009 -0500
+++ b/include/liblas/detail/reader.hpp Wed Sep 30 15:25:21 2009 -0500
@@ -74,6 +74,8 @@
bool ReadGeoreference(LASHeader& header);
void Reset(LASHeader const& header);
void SetSRS(const LASSpatialReference& srs);
+ void SetInputSRS(const LASSpatialReference& srs);
+ void SetOutputSRS(const LASSpatialReference& srs);
protected:
@@ -97,6 +99,7 @@
// Blocked copying operations, declared but not defined.
Reader(Reader const& other);
Reader& operator=(Reader const& rhs);
+ void CreateTransform();
};
class ReaderFactory
diff -r 47aa99c03689 -r f96fb478a808 include/liblas/detail/writer.hpp
--- a/include/liblas/detail/writer.hpp Wed Sep 30 11:05:27 2009 -0500
+++ b/include/liblas/detail/writer.hpp Wed Sep 30 15:25:21 2009 -0500
@@ -70,6 +70,8 @@
uint32_t WriteVLR(LASHeader const& header);
void SetSRS(const LASSpatialReference& srs);
+ void SetInputSRS(const LASSpatialReference& srs);
+ void SetOutputSRS(const LASSpatialReference& srs);
protected:
PointRecord m_record;
@@ -90,6 +92,7 @@
// Blocked copying operations, declared but not defined.
Writer(Writer const& other);
Writer& operator=(Writer const& rhs);
+ void CreateTransform();
};
diff -r 47aa99c03689 -r f96fb478a808 include/liblas/lasreader.hpp
--- a/include/liblas/lasreader.hpp Wed Sep 30 11:05:27 2009 -0500
+++ b/include/liblas/lasreader.hpp Wed Sep 30 15:25:21 2009 -0500
@@ -110,10 +110,21 @@
/// @excepion may throw std::exception
void Reset();
- /// Reproject data as they are written if the LASWriter's reference is
+ /// Reproject data as they are written if the LASReader's reference is
/// different than the LASHeader's.
/// @excepion may throw std::exception
bool SetSRS(const LASSpatialReference& ref);
+
+ /// Override the spatial reference of the LASReader's LASHeader for
+ /// writing purposes.
+ /// @excepion may throw std::exception
+ bool SetInputSRS(const LASSpatialReference& ref);
+
+
+ /// Override the spatial reference of the LASReader's LASHeader for
+ /// writing purposes.
+ /// @excepion may throw std::exception
+ bool SetOutputSRS(const LASSpatialReference& ref);
/// Provides index-based access to point records.
/// The operator is implemented in terms of ReadPointAt method
diff -r 47aa99c03689 -r f96fb478a808 include/liblas/laswriter.hpp
--- a/include/liblas/laswriter.hpp Wed Sep 30 11:05:27 2009 -0500
+++ b/include/liblas/laswriter.hpp Wed Sep 30 15:25:21 2009 -0500
@@ -78,6 +78,8 @@
// Reproject data as they are written if the LASWriter's reference is
// different than the LASHeader's
bool SetSRS(const LASSpatialReference& ref);
+ bool SetInputSRS(const LASSpatialReference& ref);
+ bool SetOutputSRS(const LASSpatialReference& ref);
private:
diff -r 47aa99c03689 -r f96fb478a808 src/detail/reader.cpp
--- a/src/detail/reader.cpp Wed Sep 30 11:05:27 2009 -0500
+++ b/src/detail/reader.cpp Wed Sep 30 15:25:21 2009 -0500
@@ -182,10 +182,40 @@
m_size = header.GetPointRecordsCount();
}
+void Reader::SetOutputSRS(const LASSpatialReference& srs)
+{
+ m_out_srs = srs;
+ CreateTransform();
+}
+
void Reader::SetSRS(const LASSpatialReference& srs)
{
- m_out_srs = srs;
+ SetOutputSRS(srs);
+}
+
+void Reader::SetInputSRS(const LASSpatialReference& srs)
+{
+ m_in_srs = srs;
+ CreateTransform();
+}
+
+
+void Reader::CreateTransform(){
#ifdef HAVE_GDAL
+
+ if (m_transform)
+ {
+ OCTDestroyCoordinateTransformation(m_transform);
+ }
+ if (m_in_ref)
+ {
+ OSRDestroySpatialReference(m_in_ref);
+ }
+ if (m_out_ref)
+ {
+ OSRDestroySpatialReference(m_out_ref);
+ }
+
m_in_ref = OSRNewSpatialReference(0);
m_out_ref = OSRNewSpatialReference(0);
diff -r 47aa99c03689 -r f96fb478a808 src/detail/writer.cpp
--- a/src/detail/writer.cpp Wed Sep 30 11:05:27 2009 -0500
+++ b/src/detail/writer.cpp Wed Sep 30 15:25:21 2009 -0500
@@ -165,9 +165,36 @@
}
+void Writer::SetOutputSRS(const LASSpatialReference& srs )
+{
+ m_out_srs = srs;
+}
+
void Writer::SetSRS(const LASSpatialReference& srs )
{
m_out_srs = srs;
+}
+
+void Writer::SetInputSRS(const LASSpatialReference& srs )
+{
+ m_in_srs = srs;
+}
+
+void Writer::CreateTransform(){
+
+ if (m_transform)
+ {
+ OCTDestroyCoordinateTransformation(m_transform);
+ }
+ if (m_in_ref)
+ {
+ OSRDestroySpatialReference(m_in_ref);
+ }
+ if (m_out_ref)
+ {
+ OSRDestroySpatialReference(m_out_ref);
+ }
+
#ifdef HAVE_GDAL
m_in_ref = OSRNewSpatialReference(0);
m_out_ref = OSRNewSpatialReference(0);
diff -r 47aa99c03689 -r f96fb478a808 src/lasreader.cpp
--- a/src/lasreader.cpp Wed Sep 30 11:05:27 2009 -0500
+++ b/src/lasreader.cpp Wed Sep 30 15:25:21 2009 -0500
@@ -141,7 +141,19 @@
bool LASReader::SetSRS(const LASSpatialReference& srs)
{
- m_pimpl->SetSRS(srs);
+ m_pimpl->SetOutputSRS(srs);
+ return true;
+}
+
+bool LASReader::SetInputSRS(const LASSpatialReference& srs)
+{
+ m_pimpl->SetInputSRS(srs);
+ return true;
+}
+
+bool LASReader::SetOutputSRS(const LASSpatialReference& srs)
+{
+ m_pimpl->SetOutputSRS(srs);
return true;
}
diff -r 47aa99c03689 -r f96fb478a808 src/laswriter.cpp
--- a/src/laswriter.cpp Wed Sep 30 11:05:27 2009 -0500
+++ b/src/laswriter.cpp Wed Sep 30 15:25:21 2009 -0500
@@ -99,10 +99,20 @@
bool LASWriter::SetSRS(const LASSpatialReference& srs)
{
- m_pimpl->SetSRS(srs);
+ m_pimpl->SetOutputSRS(srs);
return true;
}
+bool LASWriter::SetInputSRS(const LASSpatialReference& srs)
+{
+ m_pimpl->SetInputSRS(srs);
+ return true;
+}
+bool LASWriter::SetOutputSRS(const LASSpatialReference& srs)
+{
+ m_pimpl->SetOutputSRS(srs);
+ return true;
+}
} // namespace liblas
More information about the Liblas-commits
mailing list