[Liblas-commits] hg: rename source files to remove las prefix
liblas-commits at liblas.org
liblas-commits at liblas.org
Wed Dec 22 16:10:22 EST 2010
changeset 4efff1e8affd in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=4efff1e8affd
summary: rename source files to remove las prefix
diffstat:
src/CMakeLists.txt | 32 +-
src/c_api.cpp | 2129 ++++++++++++++++++++++++++++++++++++++++++
src/classification.cpp | 143 ++
src/color.cpp | 99 +
src/dimension.cpp | 199 +++
src/error.cpp | 77 +
src/filter.cpp | 253 +++++
src/header.cpp | 925 ++++++++++++++++++
src/index.cpp | 2156 +++++++++++++++++++++++++++++++++++++++++++
src/las_c_api.cpp | 2129 ------------------------------------------
src/lasclassification.cpp | 143 --
src/lascolor.cpp | 99 -
src/lasdimension.cpp | 199 ---
src/laserror.cpp | 77 -
src/lasfilter.cpp | 253 -----
src/lasheader.cpp | 925 ------------------
src/lasindex.cpp | 2156 -------------------------------------------
src/laspoint.cpp | 953 -------------------
src/lasreader.cpp | 197 ---
src/lasschema.cpp | 778 ---------------
src/lasspatialreference.cpp | 871 -----------------
src/lastransform.cpp | 531 ----------
src/lasvariablerecord.cpp | 246 ----
src/lasversion.cpp | 134 --
src/laswriter.cpp | 126 --
src/point.cpp | 953 +++++++++++++++++++
src/reader.cpp | 197 +++
src/schema.cpp | 778 +++++++++++++++
src/spatialreference.cpp | 871 +++++++++++++++++
src/transform.cpp | 531 ++++++++++
src/variablerecord.cpp | 246 ++++
src/version.cpp | 134 ++
src/writer.cpp | 126 ++
33 files changed, 9833 insertions(+), 9833 deletions(-)
diffs (truncated from 19812 to 300 lines):
diff -r 41a8066d9663 -r 4efff1e8affd src/CMakeLists.txt
--- a/src/CMakeLists.txt Wed Dec 22 15:04:51 2010 -0600
+++ b/src/CMakeLists.txt Wed Dec 22 15:10:15 2010 -0600
@@ -111,22 +111,22 @@
set(LIBLAS_CPP
chipper.cpp
factory.cpp
- lasclassification.cpp
- lascolor.cpp
- lasdimension.cpp
- laserror.cpp
- lasfilter.cpp
- lasheader.cpp
- lasindex.cpp
- laspoint.cpp
- lasreader.cpp
- lasspatialreference.cpp
- lasschema.cpp
- lastransform.cpp
+ classification.cpp
+ color.cpp
+ dimension.cpp
+ error.cpp
+ filter.cpp
+ header.cpp
+ index.cpp
+ point.cpp
+ reader.cpp
+ spatialreference.cpp
+ schema.cpp
+ transform.cpp
utility.cpp
- lasvariablerecord.cpp
- laswriter.cpp
- lasversion.cpp)
+ variablerecord.cpp
+ writer.cpp
+ version.cpp)
set(LIBLAS_DETAIL_CPP
detail/utility.cpp)
@@ -200,7 +200,7 @@
${LIBLAS_HEADERS_DIR}/capi/las_config.h
${LIBLAS_HEADERS_DIR}/capi/las_version.h
${LIBLAS_HEADERS_DIR}/capi/liblas.h
- las_c_api.cpp)
+ c_api.cpp)
# NOTE:
# This hack is required to correctly link static into shared library.
diff -r 41a8066d9663 -r 4efff1e8affd src/c_api.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/c_api.cpp Wed Dec 22 15:10:15 2010 -0600
@@ -0,0 +1,2129 @@
+/******************************************************************************
+ * $Id$
+ *
+ * Project: libLAS - http://liblas.org - A BSD library for LAS format data.
+ * Purpose: C API for libLAS
+ * Author: Howard Butler, hobu.inc at gmail.com, but I'm not proud of it.
+ * I also swiped a lot of it from GDAL.
+ *
+ ******************************************************************************
+ * Copyright (c) 2008, Mateusz Loskot
+ * Copyright (c) 2008, Howard Butler
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of the Martin Isenburg or Iowa Department
+ * of Natural Resources nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ ****************************************************************************/
+
+#ifdef HAVE_LIBGEOTIFF
+// Supress inclusion of cpl_serv.h per #194, perhaps remove one day
+// when libgeotiff 1.4.0+ is widely used
+#define CPL_SERV_H_INCLUDED
+
+#include <geotiff.h>
+#include <geo_simpletags.h>
+#include <geo_normalize.h>
+#endif
+
+#include <liblas/liblas.hpp>
+
+
+typedef struct LASWriterHS *LASWriterH;
+typedef struct LASReaderHS *LASReaderH;
+typedef struct LASPointHS *LASPointH;
+typedef struct LASHeaderHS *LASHeaderH;
+typedef struct LASGuidHS *LASGuidH;
+typedef struct LASVLRHS *LASVLRH;
+typedef struct LASColorHS *LASColorH;
+typedef struct LASSRSHS *LASSRSH;
+typedef struct LASSchemaHS *LASSchemaH;
+
+// boost
+#include <boost/cstdint.hpp>
+// std
+#include <cstdio>
+#include <bitset>
+#include <exception>
+#include <fstream>
+#include <iostream>
+#include <map>
+#include <sstream> // std::stringstream
+#include <string>
+#include <stack>
+#include <typeinfo>
+#include <vector>
+
+using namespace liblas;
+
+#ifdef _WIN32
+#define compare_no_case(a,b,n) _strnicmp( (a), (b), (n) )
+#else
+#define compare_no_case(a,b,n) strncasecmp( (a), (b), (n) )
+#endif
+
+std::istream* OpenInput(std::string filename)
+{
+ std::ios::openmode const mode = std::ios::in | std::ios::binary;
+ std::istream* istrm = 0;
+ if (compare_no_case(filename.c_str(),"STDIN",5) == 0)
+ {
+ istrm = &std::cin;
+ }
+ else
+ {
+ istrm = new std::ifstream(filename.c_str(), mode);
+ }
+
+ if (!istrm->good())
+ {
+ delete istrm;
+ throw std::runtime_error("Reading stream was not able to be created");
+ }
+ return istrm;
+}
+
+
+
+LAS_C_START
+
+#ifndef _WIN32
+#include <stdint.h>
+#endif
+
+
+// Error stuff
+
+
+typedef enum
+{
+ LE_None = 0,
+ LE_Debug = 1,
+ LE_Warning = 2,
+ LE_Failure = 3,
+ LE_Fatal = 4
+} LASErrorEnum;
+
+
+static std::stack<liblas::Error > errors;
+static std::map<liblas::Reader*, std::istream*> readers;
+static std::map<liblas::Writer*, std::ostream*> writers;
+
+#ifdef _MSC_VER
+# pragma warning(disable: 4127) // warning C4127: conditional expression is constant
+#endif
+
+#define VALIDATE_LAS_POINTER0(ptr, func) \
+ do { if( NULL == ptr ) { \
+ LASErrorEnum const ret = LE_Failure; \
+ std::ostringstream msg; \
+ msg << "Pointer \'" << #ptr << "\' is NULL in \'" << (func) <<"\'."; \
+ std::string message(msg.str()); \
+ LASError_PushError( ret, message.c_str(), (func)); \
+ return; \
+ }} while(0)
+
+#define VALIDATE_LAS_POINTER1(ptr, func, rc) \
+ do { if( NULL == ptr ) { \
+ LASErrorEnum const ret = LE_Failure; \
+ std::ostringstream msg; \
+ msg << "Pointer \'" << #ptr << "\' is NULL in \'" << (func) <<"\'."; \
+ std::string message(msg.str()); \
+ LASError_PushError( ret, message.c_str(), (func)); \
+ return (rc); \
+ }} while(0)
+
+LAS_DLL int LAS_IsGDALEnabled(void) {
+ return IsGDALEnabled();
+}
+
+LAS_DLL int LAS_IsLibGeoTIFFEnabled(void) {
+ return IsLibGeoTIFFEnabled();
+}
+
+LAS_DLL void LASError_Reset(void) {
+ if (errors.empty()) return;
+ for (std::size_t i=0;i<errors.size();i++) errors.pop();
+}
+
+LAS_DLL void LASError_Pop(void) {
+ if (errors.empty()) return;
+ errors.pop();
+}
+
+LAS_DLL int LASError_GetLastErrorNum(void){
+ if (errors.empty())
+ return 0;
+ else {
+ liblas::Error err = errors.top();
+ return err.GetCode();
+ }
+}
+
+LAS_DLL char* LASError_GetLastErrorMsg(void){
+ if (errors.empty())
+ return NULL;
+ else {
+ liblas::Error err = errors.top();
+ return LASCopyString(err.GetMessage().c_str());
+ }
+}
+
+LAS_DLL char* LASError_GetLastErrorMethod(void){
+ if (errors.empty())
+ return NULL;
+ else {
+ liblas::Error err = errors.top();
+ return LASCopyString(err.GetMethod().c_str());
+ }
+}
+
+LAS_DLL void LASError_PushError(int code, const char *message, const char *method) {
+ liblas::Error err = liblas::Error(code, std::string(message), std::string(method));
+ errors.push(err);
+}
+
+LAS_DLL int LASError_GetErrorCount(void) {
+ return static_cast<int>(errors.size());
+}
+
+
+
+LAS_DLL LASReaderH LASReader_Create(const char* filename)
+
+{
+ VALIDATE_LAS_POINTER1(filename, "LASReader_Create", NULL);
+
+ try {
+
+ std::istream* istrm = OpenInput(std::string(filename));
+ liblas::Reader* reader = new liblas::Reader(*istrm);
+ readers.insert(std::pair<liblas::Reader*, std::istream*>(reader, istrm));
+ return (LASReaderH) reader;
+
+ } catch (std::exception const& e)
+ {
+ LASError_PushError(LE_Failure, e.what(), "LASReader_Create");
+ return NULL;
+ }
+
+}
+
+LAS_DLL LASReaderH LASReader_CreateWithHeader( const char* filename,
+ LASHeaderH hHeader)
+
+{
+ VALIDATE_LAS_POINTER1(filename, "LASReader_CreateWithHeader", NULL);
+ VALIDATE_LAS_POINTER1(hHeader, "LASReader_CreateWithHeader", NULL);
+
+ try {
+
+ std::istream* istrm = OpenInput(std::string(filename));
More information about the Liblas-commits
mailing list