[Liblas-commits] hg-main-tree: throw a connection_error in the
event we are unabl...
liblas-commits at liblas.org
liblas-commits at liblas.org
Wed Apr 13 13:51:10 EDT 2011
details: http://hg.libpc.orghg-main-tree/rev/69c7899d8852
changeset: 549:69c7899d8852
user: Howard Butler <hobu.inc at gmail.com>
date: Wed Apr 13 09:11:56 2011 -0500
description:
throw a connection_error in the event we are unable to connect
Subject: hg-main-tree: use LasWriter instead of LiblasWriter
details: http://hg.libpc.orghg-main-tree/rev/d7283099e233
changeset: 550:d7283099e233
user: Howard Butler <hobu.inc at gmail.com>
date: Wed Apr 13 12:50:00 2011 -0500
description:
use LasWriter instead of LiblasWriter
Subject: hg-main-tree: merge
details: http://hg.libpc.orghg-main-tree/rev/6734e5219ffc
changeset: 551:6734e5219ffc
user: Howard Butler <hobu.inc at gmail.com>
date: Wed Apr 13 12:50:41 2011 -0500
description:
merge
Subject: hg-main-tree: merge
details: http://hg.libpc.orghg-main-tree/rev/30133f0b8538
changeset: 552:30133f0b8538
user: Howard Butler <hobu.inc at gmail.com>
date: Wed Apr 13 12:50:55 2011 -0500
description:
merge
diffstat:
CMakeLists.txt | 2 +-
apps/pc2pc.cpp | 2 +-
apps/pcview/main.cpp | 6 +++---
include/libpc/drivers/oci/Common.hpp | 9 +++++++++
src/drivers/oci/common.cpp | 6 ++++--
5 files changed, 18 insertions(+), 7 deletions(-)
diffs (84 lines):
diff -r 2b9203550cf5 -r 30133f0b8538 CMakeLists.txt
--- a/CMakeLists.txt Tue Apr 12 15:11:31 2011 -0500
+++ b/CMakeLists.txt Wed Apr 13 12:50:55 2011 -0500
@@ -328,7 +328,7 @@
endif()
# LIBLAS support - optional, default=OFF
-set(WITH_LIBLAS FALSE CACHE BOOL "Choose if libLAS support should be built")
+set(WITH_LIBLAS TRUE CACHE BOOL "Choose if libLAS support should be built")
set(WITH_STATIC_LIBLAS FALSE CACHE BOOL "Choose if libLAS should be statically linked")
mark_as_advanced(WITH_STATIC_LIBLAS)
diff -r 2b9203550cf5 -r 30133f0b8538 apps/pc2pc.cpp
--- a/apps/pc2pc.cpp Tue Apr 12 15:11:31 2011 -0500
+++ b/apps/pc2pc.cpp Wed Apr 13 12:50:55 2011 -0500
@@ -182,7 +182,7 @@
- libpc::drivers::liblas::LiblasWriter writer(reader, *ofs);
+ libpc::drivers::las::LasWriter writer(reader, *ofs);
// writer.setPointFormat( 3);
writer.write(numPoints);
#else
diff -r 2b9203550cf5 -r 30133f0b8538 apps/pcview/main.cpp
--- a/apps/pcview/main.cpp Tue Apr 12 15:11:31 2011 -0500
+++ b/apps/pcview/main.cpp Wed Apr 13 12:50:55 2011 -0500
@@ -140,9 +140,9 @@
const boost::int32_t yraw = buffer.getField<boost::int32_t>(i, offsetY);
const boost::int32_t zraw = buffer.getField<boost::int32_t>(i, offsetZ);
- const double x = schema.getDimension(offsetX).getNumericValue<boost::int32_t>(xraw);
- const double y = schema.getDimension(offsetY).getNumericValue<boost::int32_t>(yraw);
- const double z = schema.getDimension(offsetZ).getNumericValue<boost::int32_t>(zraw);
+ const double x = schema.getDimension(offsetX).applyScaling(xraw);
+ const double y = schema.getDimension(offsetY).applyScaling(yraw);
+ const double z = schema.getDimension(offsetZ).applyScaling(zraw);
points[cnt++] = (float)x;
points[cnt++] = (float)y;
diff -r 2b9203550cf5 -r 30133f0b8538 include/libpc/drivers/oci/Common.hpp
--- a/include/libpc/drivers/oci/Common.hpp Tue Apr 12 15:11:31 2011 -0500
+++ b/include/libpc/drivers/oci/Common.hpp Wed Apr 13 12:50:55 2011 -0500
@@ -36,6 +36,7 @@
#define INCLUDED_DRIVER_OCI_COMMON_HPP
#include <libpc/libpc.hpp>
+#include <libpc/exceptions.hpp>
#include "oci_wrapper.h"
#include "Endian.hpp"
@@ -59,6 +60,14 @@
typedef boost::shared_ptr<OWStatement> Statement ;
+// use this for code still under development
+class connection_failed : public libpc_error
+{
+public:
+ connection_failed(std::string const& msg)
+ : libpc_error(msg)
+ {}
+};
#ifdef LIBPC_COMPILER_MSVC
diff -r 2b9203550cf5 -r 30133f0b8538 src/drivers/oci/common.cpp
--- a/src/drivers/oci/common.cpp Tue Apr 12 15:11:31 2011 -0500
+++ b/src/drivers/oci/common.cpp Wed Apr 13 12:50:55 2011 -0500
@@ -199,10 +199,12 @@
Connection con = boost::make_shared<OWConnection>(username.c_str(),password.c_str(),instance.c_str());
if (con->Succeeded())
+ {
if (verbose)
- std::cout << "Oracle connection succeeded" << std::endl;
+ std::cout << "Oracle connection succeeded" << std::endl;
+ }
else
- throw libpc_error("Oracle connection failed");
+ throw connection_failed("Oracle connection failed");
return con;
More information about the Liblas-commits
mailing list