Merge pull request #1 from madduci/development

repository refactoring, modernisation of CMake
This commit is contained in:
Michele Adduci
2020-06-22 07:10:04 +02:00
committed by GitHub
41 changed files with 780 additions and 541 deletions

73
.clang-format Normal file
View File

@@ -0,0 +1,73 @@
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: All
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakStringLiterals: false
ColumnLimit: 160
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DerivePointerAlignment: false
FixNamespaceComments: true
IncludeBlocks: Preserve
IndentCaseLabels: false
IndentPPDirectives: AfterHash
IndentWidth: 2
IndentWrappedFunctionNames: true
KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp
MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner
PenaltyBreakBeforeFirstCallParameter: 19937
PenaltyReturnTypeOnItsOwnLine: 19937
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 2
UseTab: Never

5
.gitignore vendored
View File

@@ -30,3 +30,8 @@
*.exe
*.out
*.app
# Build folders
build/
bin/*
.vscode/

View File

@@ -1,3 +1,8 @@
2020-06-22 madduci
added support for conan, reorganisation of code
update codebase to c++17
updated CMake project
added LICENSE, CONTRIBUTORS files
2013-08-29 roland_schwarz
SVN commit test
2013-04-03 roland_schwarz

View File

@@ -1,283 +1,225 @@
# $Id: CMakeLists.txt 332 2013-04-03 14:24:08Z roland_schwarz $
# This is the CMake project file for the libe57 reference implementation
# This is an update version of the CMake project file for the libe57 reference
# implementation, with support for Conan targets, to make the dependency
# management easier and reproducible on all the supported platforms
#
# Copyright 2010-2012 Roland Schwarz, Riegl LMS GmbH
# Original work Copyright 2010-2012 Roland Schwarz, Riegl LMS GmbH
# Modified work Copyright 2020 Michele Adduci <adduci@tutanota.com>
#
# Permission is hereby granted, free of charge, to any person or organization
# obtaining a copy of the software and accompanying documentation covered by
# this license (the "Software") to use, reproduce, display, distribute,
# execute, and transmit the Software, and to prepare derivative works of the
# Software, and to permit third-parties to whom the Software is furnished to
# do so, all subject to the following:
# this license (the "Software") to use, reproduce, display, distribute, execute,
# and transmit the Software, and to prepare derivative works of the Software,
# and to permit third-parties to whom the Software is furnished to do so, all
# subject to the following:
#
# The copyright notices in the Software and this entire statement, including
# the above license grant, this restriction and the following disclaimer,
# must be included in all copies of the Software, in whole or in part, and
# all derivative works of the Software, unless such copies or derivative
# works are solely in the form of machine-executable object code generated by
# a source language processor.
# The copyright notices in the Software and this entire statement, including the
# above license grant, this restriction and the following disclaimer, must be
# included in all copies of the Software, in whole or in part, and all
# derivative works of the Software, unless such copies or derivative works are
# solely in the form of machine-executable object code generated by a source
# language processor.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR
# ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
# Requirements:
# Xerces library: http://xerces.apache.org/
# Boost library: http://www.boost.org
# Notes:
# Since there is not standard cmake module to find the xerces library
# we provide one with this distribution. It should be able to find
# the library from the XERCES_ROOT cmake variable. Standard layout, as
# with the binary packages from apache is assumed.
# If you find any errors or have suggestion to improve the build script:
# patches are most welcome! Please send them to the development mailing list.
# Requirements:
# * Xerces library: http://xerces.apache.org/
# * Boost library: http://www.boost.org
#
# Notes: Since there is not standard cmake module to find the xerces library we
# provide one with this distribution. It should be able to find the library from
# the XERCES_ROOT cmake variable. Standard layout, as with the binary packages
# from apache is assumed. If you find any errors or have suggestion to improve
# the build script: patches are most welcome!
cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR)
cmake_minimum_required(VERSION 2.8.2)
# Enables the MSVC_RUNTIME_LIBRARY property on targets
cmake_policy(SET CMP0091 NEW)
# Override flags to enable prepare for linking to static runtime
set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/c_flag_overrides.cmake)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cxx_flag_overrides.cmake)
project(openE57 VERSION 1.2.0 LANGUAGES C CXX DESCRIPTION "openE57 is a library for handling e57 files")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/redist-${PROJECT_NAME}-v${PROJECT_VERSION})
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif("${isSystemDir}" STREQUAL "-1")
option(BUILD_EXAMPLES "Build e57 examples" FALSE)
option(BUILD_TOOLS "Build e57 tools" FALSE)
option(BUILD_TESTS "Build e57 tests" FALSE)
option(BUILD_SHARED_LIBS "Build e57 shared libraries" FALSE)
option(BUILD_WITH_MT "Build e57 libraries as MultiThreaded DLL" FALSE)
if(BUILD_SHARED_LIBS)
message(FATAL_ERROR "Shared Libraries are not supported due to missing exported symbols")
else(BUILD_SHARED_LIBS)
set(LIBRARY_TYPE STATIC)
endif()
if(EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
endif()
# Set a private module find path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
project(E57RefImpl)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(InstallRequiredSystemLibraries)
include(GenerateExportHeader)
include(${CMAKE_SOURCE_DIR}/cmake/compiler_options.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/dependencies.cmake)
# developer adjustable version numbers
set(${PROJECT_NAME}_MAJOR_VERSION 1)
set(${PROJECT_NAME}_MINOR_VERSION 1)
set(CONFIG_PACKAGE_INSTALL_DIR lib/cmake/${PROJECT_NAME})
include(Tags)
# propose a default installation directory
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
string(REGEX REPLACE "/${PROJECT_NAME}" "" CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(T_ ${PROJECT_NAME})
set(T_ ${T_}-${${PROJECT_NAME}_MAJOR_VERSION})
set(T_ ${T_}.${${PROJECT_NAME}_MINOR_VERSION})
set(T_ ${T_}.${${PROJECT_NAME}_BUILD_VERSION})
set(T_ ${T_}-${${PROJECT_NAME}_BUILD_TAG})
set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/${T_}
CACHE PATH
"Install path prefix, prepended onto install directories."
FORCE
)
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
find_package(Threads REQUIRED)
# Find the Boost and Xerces libraries
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost
COMPONENTS
program_options
system
thread
filesystem
QUIET
)
if (NOT Boost_FOUND)
set(BOOST_ROOT CACHE PATH "Location of the boost root directory" )
message(FATAL_ERROR
"Unable to find boost library.
Please set the BOOST_ROOT to point to the boost distribution files."
)
endif(NOT Boost_FOUND)
set(Xerces_USE_STATIC_LIBS On)
find_package(Xerces QUIET)
if (NOT Xerces_FOUND)
set(XERCES_ROOT CACHE PATH "Location of the xerces library")
message(FATAL_ERROR
"Unable to find xerces library.
Please set the the XERCES_ROOT to point to the root of the xerces directory."
)
endif (NOT Xerces_FOUND)
set(XML_LIBRARIES ${Xerces_LIBRARY})
set(XML_INCLUDE_DIRS ${Xerces_INCLUDE_DIR})
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_definitions(-DLINUX)
find_package(ICU REQUIRED)
set(XML_LIBRARIES ${XML_LIBRARIES} ${ICU_LIBRARIES})
set(XML_INCLUDE_DIRS ${XML_INCLUDE_DIRS} ${ICU_INCLUDE_DIRS})
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
add_definitions(-DWINDOWS)
endif()
add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
add_definitions(-DBOOST_ALL_NO_LIB -DXERCES_STATIC_LIBRARY)
add_definitions(-DE57_REFIMPL_REVISION_ID=${PROJECT_NAME}-${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_BUILD_VERSION}-${${PROJECT_NAME}_BUILD_TAG})
configure_file (
"${PROJECT_SOURCE_DIR}/include/config.h.in"
"${PROJECT_BINARY_DIR}/include/config.h"
)
include_directories(
${PROJECT_BINARY_DIR}/include
include
include/time_conversion
src/refimpl
${XML_INCLUDE_DIRS}
${Boost_INCLUDE_DIR}
)
link_directories(
${Boost_LIBRARY_DIRS}
)
list(APPEND compiler_definitions
E57_REFIMPL_REVISION_ID=${PROJECT_NAME}-${PROJECT_VERSION})
configure_file("${PROJECT_SOURCE_DIR}/include/config.h.in"
"${PROJECT_BINARY_DIR}/include/config.h")
#
# The reference implementation
# The main library
#
add_library(
${PROJECT_NAME} ${LIBRARY_TYPE}
${CMAKE_SOURCE_DIR}/src/E57Simple.cpp
${CMAKE_SOURCE_DIR}/src/E57SimpleImpl.cpp
${CMAKE_SOURCE_DIR}/src/E57Foundation.cpp
${CMAKE_SOURCE_DIR}/src/E57FoundationImpl.cpp
${CMAKE_SOURCE_DIR}/include/openE57/impl/E57FoundationImpl.h
${CMAKE_SOURCE_DIR}/include/openE57/impl/E57SimpleImpl.h
${CMAKE_SOURCE_DIR}/include/openE57/E57Foundation.h
${CMAKE_SOURCE_DIR}/include/openE57/E57Simple.h)
add_library( E57RefImpl STATIC
src/refimpl/E57Foundation.cpp
src/refimpl/E57FoundationImpl.cpp
src/refimpl/E57FoundationImpl.h
include/E57Foundation.h
)
set_target_properties( E57RefImpl
PROPERTIES DEBUG_POSTFIX "-d"
generate_export_header(${PROJECT_NAME})
set_target_properties(${PROJECT_NAME} PROPERTIES
DEBUG_POSTFIX "-d"
MSVC_RUNTIME_LIBRARY "${MSVC_RUNTIME_TYPE}")
target_compile_options(${PROJECT_NAME} PUBLIC ${compiler_options})
target_compile_definitions(${PROJECT_NAME} PUBLIC ${compiler_definitions})
target_link_options(${PROJECT_NAME} PUBLIC ${linker_flags})
target_include_directories(${PROJECT_NAME}
PRIVATE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
${CMAKE_SOURCE_DIR}/include
${XML_INCLUDE_DIRS}
${Boost_INCLUDE_DIR}
)
#
# Files for LAS format support
#
target_link_libraries(${PROJECT_NAME} PUBLIC ${Boost_LIBRARY_DIRS} ${XML_LIBRARIES})
add_library( LASReader STATIC
src/LASReader/LASReader.cpp
include/LASReader.h
#
# Library for LAS I/O support
#
add_library(LASReader ${LIBRARY_TYPE}
${CMAKE_SOURCE_DIR}/src/LAS/LASReader.cpp
${CMAKE_SOURCE_DIR}/include/openE57/LAS/LASReader.h)
set_target_properties(LASReader PROPERTIES
DEBUG_POSTFIX "-d"
MSVC_RUNTIME_LIBRARY "${MSVC_RUNTIME_TYPE}")
target_compile_options(LASReader PUBLIC ${compiler_options})
target_compile_definitions(LASReader PUBLIC ${compiler_definitions})
target_link_options(LASReader PUBLIC ${linker_flags})
target_include_directories(LASReader
PRIVATE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
${CMAKE_SOURCE_DIR}/include
${XML_INCLUDE_DIRS}
${Boost_INCLUDE_DIR}
)
target_link_libraries(LASReader PUBLIC ${Boost_LIBRARY_DIRS} ${XML_LIBRARIES})
#
# Time conversion utilities
#
add_library(time_conversion ${LIBRARY_TYPE}
${CMAKE_SOURCE_DIR}/src/time_conversion/time_conversion.c
${CMAKE_SOURCE_DIR}/include/openE57/time_conversion/time_conversion.h
${CMAKE_SOURCE_DIR}/include/openE57/time_conversion/basictypes.h
${CMAKE_SOURCE_DIR}/include/openE57/time_conversion/constants.h
${CMAKE_SOURCE_DIR}/include/openE57/time_conversion/gnss_error.h)
add_library( time_conversion STATIC
src/time_conversion/time_conversion.c
include/time_conversion/time_conversion.h
include/time_conversion/basictypes.h
include/time_conversion/constants.h
include/time_conversion/gnss_error.h
set_target_properties(time_conversion PROPERTIES
DEBUG_POSTFIX "-d"
MSVC_RUNTIME_LIBRARY "${MSVC_RUNTIME_TYPE}")
target_compile_options(time_conversion PUBLIC ${compiler_options})
target_compile_definitions(time_conversion PUBLIC ${compiler_definitions})
target_link_options(time_conversion PUBLIC ${linker_flags})
target_include_directories(time_conversion
PRIVATE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
${CMAKE_SOURCE_DIR}/include
)
#
# Example programs
#
add_executable( DemoWrite01
src/examples/DemoWrite01.cpp
)
target_link_libraries( DemoWrite01
E57RefImpl
target_link_libraries(time_conversion
PUBLIC
${Boost_LIBRARY_DIRS}
${XML_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
add_executable( DemoRead01
src/examples/DemoRead01.cpp
)
target_link_libraries( DemoRead01
E57RefImpl
${XML_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
$<$<OR:$<C_COMPILER_ID:GNU>,$<C_COMPILER_ID:Clang>>:dl>
$<$<OR:$<C_COMPILER_ID:GNU>,$<C_COMPILER_ID:Clang>>:m>
$<$<OR:$<C_COMPILER_ID:GNU>,$<C_COMPILER_ID:Clang>>:c>
)
#
# E57-4 Tools
#
if(${BUILD_EXAMPLES})
add_subdirectory(${CMAKE_SOURCE_DIR}/examples)
endif()
add_executable( las2e57
src/tools/las2e57.cpp
)
target_link_libraries( las2e57
E57RefImpl
if(${BUILD_TESTS})
add_subdirectory(${CMAKE_SOURCE_DIR}/tests)
endif()
if(${BUILD_TOOLS})
add_subdirectory(${CMAKE_SOURCE_DIR}/tools)
endif()
#
# Install Artifacts
#
install(
TARGETS
${PROJECT_NAME}
LASReader
time_conversion
${XML_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
add_executable( e57fields
src/tools/e57fields.cpp
)
target_link_libraries( e57fields
E57RefImpl
${XML_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
add_executable( e57xmldump
src/tools/e57xmldump.cpp
)
target_link_libraries( e57xmldump
E57RefImpl
${XML_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
add_executable( e57validate
src/tools/e57validate.cpp
)
target_link_libraries( e57validate
E57RefImpl
${XML_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
add_executable( e57unpack
src/tools/e57unpack.cpp
)
target_link_libraries( e57unpack
E57RefImpl
${XML_LIBRARIES}
${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
#
# Install section
#
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib)
install(
TARGETS
E57RefImpl
e57fields
e57xmldump
e57unpack
e57validate
las2e57
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
)
install(
FILES
include/E57Foundation.h
DESTINATION include/e57
)
FILES
${CMAKE_SOURCE_DIR}/include/openE57/E57Foundation.h
${CMAKE_SOURCE_DIR}/include/openE57/E57Simple.h
${CMAKE_BINARY_DIR}/opene57_export.h
DESTINATION
include/e57)
install(
FILES
CHANGES.TXT
README.TXT
src/refimpl/E57RefImplConfig.cmake
DESTINATION .
)
install(FILES
${CMAKE_SOURCE_DIR}/CHANGES.TXT
DESTINATION .)
#include (InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_VENDOR "Michele Adduci <adduci@tutanota.com>")
set(CPACK_PACKAGE_VERSION_MAJOR "${${PROJECT_NAME}_MAJOR_VERSION}")
set(CPACK_PACKAGE_VERSION_MINOR "${${PROJECT_NAME}_MINOR_VERSION}")
set(CPACK_PACKAGE_VERSION_PATCH "${${PROJECT_NAME}_BUILD_VERSION}")
set(CPACK_SYSTEM_NAME "${${PROJECT_NAME}_BUILD_TAG}")
set(CPACK_GENERATOR "ZIP")
set(CPACK_STRIP_FILES "TRUE")
set (CPACK_PACKAGE_VENDOR "Riegl LMS GmbH")
set (CPACK_PACKAGE_VERSION_MAJOR "${${PROJECT_NAME}_MAJOR_VERSION}")
set (CPACK_PACKAGE_VERSION_MINOR "${${PROJECT_NAME}_MINOR_VERSION}")
set (CPACK_PACKAGE_VERSION_PATCH "${${PROJECT_NAME}_BUILD_VERSION}")
set (CPACK_SYSTEM_NAME "${${PROJECT_NAME}_BUILD_TAG}")
set (CPACK_GENERATOR "ZIP")
set (CPACK_STRIP_FILES "TRUE")
include (CPack)
include(CPack)

9
CONTRIBUTORS.txt Normal file
View File

@@ -0,0 +1,9 @@
Contributors
-------------
This is the list of contributors to this project source code, in alphabetical order.
- Kevin Ackley (kackley@e57consulting.com)
- Michele Adduci (adduci@tutanota.com)
- Roland Schwarz (rschwarz@riegl.co.at)
- Stan Coleby (stan.coleby@gmail.com)

11
LICENSE Normal file
View File

@@ -0,0 +1,11 @@
MIT License
openE57
Copyright (c) 2020 Michele Adduci (adduci@tutanota.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

31
LICENSE.libE57 Normal file
View File

@@ -0,0 +1,31 @@
# E57 Software Licenses
## E57 Foundation API
Copyright 2009 - 2010 Kevin Ackley (kackley@e57consulting.com), All Rights Reserved.
Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:
The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## E57 Simple API
Copyright (c) 2010 Stan Coleby (stan.coleby@gmail.com), All Rights Reserved.
Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:
The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## CMake project libe57
Copyright 2010 Roland Schwarz (rschwarz@riegl.co.at), Riegl LMS GmbH, All Rights Reserved.
Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:
The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,8 +0,0 @@
2011-03-10: roland_schwarz
Added E57RefImplConfig.cmake for user project configuration.
The build instructions can be found inside the CMakeLists.txt file.
See doc\libe57ReleaseNotes.doc for:
- release notes
- instructions on compiling/linking applications
- instructions on validating .e57 files

55
README.md Normal file
View File

@@ -0,0 +1,55 @@
# openE57
openE57 is a forked version of the original LibE57 (http://www.libe57.org) project, with the intent to refine and optimize the source code in a modern C++ idiomatic way and remove unnecessary dependencies (e.g. Boost) in favour of the C++ Standard Library.
The library is compiled as C++17, since some of following language intrinsics and libraries are used:
* constexpr values
* enum classes
* filesystem (replaces boost::filesystem)
* thread (replaces boost::thread)
* memory (replaces boost::shared_ptr and std::auto_ptr)
## Requirements
You need the following tools to build this library:
* A C++17 compiler (MSVC 2017+, gcc 7+, clang 7+)
* A recent version of CMake (3.15+)
* A recent version of conan (1.25+)
## How to build it
On Linux:
```shell
git clone https://github.com/madduci/openE57.git
cd open57
mkdir -p build/linux && cd build/linux
conan install ../.. --build=missing
cmake ../.. -DCMAKE_BUILD_TYPE=Release
cmake --build .
cmake --install .
```
On Windows:
```cmd
git clone https://github.com/madduci/openE57.git
cd open57
md build\windows && cd build\windows
conan install ..\.. --build=missing
cmake ..\.. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
cmake --install . --config Release
```
Available CMake options (but disabled by default) are the following onews:
* BUILD_EXAMPLES
* BUILD_TOOLS
* BUILD_TESTS
* BUILD_WITH_MT (MSVC Only)
* BUILD_SHARED_LIBS (Not supported at the moment - no symbol is exported yet)
The dependencies are now managed with conan and integrated in CMake, without the need of compiling the required libraries by yourself.

View File

@@ -1,60 +0,0 @@
# This file defines the variables
# ${PROJECT_NAME}_BUILD_VERSION
# ${PROJECT_NAME}_BUILD_TAG
# try to find subversion revision number
execute_process(
COMMAND svnversion
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ${PROJECT_NAME}_BUILD_VERSION
)
if (NOT ${PROJECT_NAME}_BUILD_VERSION)
set(${PROJECT_NAME}_BUILD_VERSION "unknown")
else()
string(REGEX MATCH " " F ${${PROJECT_NAME}_BUILD_VERSION})
if (F) # a valid build number does not contain a space
set(${PROJECT_NAME}_BUILD_VERSION "unknown")
endif()
string(STRIP ${${PROJECT_NAME}_BUILD_VERSION} ${PROJECT_NAME}_BUILD_VERSION)
endif ()
# calculate the tag
set(T_ ${CMAKE_SYSTEM_PROCESSOR})
if (CMAKE_CL_64)
set(T_ ${T_}_64)
endif (CMAKE_CL_64)
string(TOLOWER ${CMAKE_SYSTEM_NAME} T1_)
set(T_ ${T_}-${T1_})
if (MSVC90)
set(T1_ "-vc90")
elseif (MSVC10)
set(T1_ "-vc100")
elseif (MSVC10)
set(T1_ "-vc100")
elseif (MSVC80)
set(T1_ "-vc80")
elseif (MSVC71)
set(T1_ "-vc711")
elseif (MSVC70)
set(T1_ "-vc7")
elseif (MINGW)
set(T1_ "-mgw")
exec_program(${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE T2_
)
string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" T2_ ${T2_})
set(T1_ ${T1_}${T2_})
elseif (CMAKE_COMPILER_IS_GNUCXX)
set(T1_ "-gcc")
exec_program(${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE T2_
)
string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" T2_ ${T2_})
set(T1_ ${T1_}${T2_})
else()
set(T1_)
endif()
set(T_ ${T_}${T1_})
set(${PROJECT_NAME}_BUILD_TAG ${T_})

View File

@@ -1,18 +0,0 @@
if (MSVC)
set(CMAKE_C_FLAGS_DEBUG_INIT "/MTd /D_DEBUG /Zi /Ob0 /Od /RTC1")
set(CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
set(CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
endif (MSVC)
if (MINGW)
# GCC Linker switches for static runtime linking
set(CMAKE_EXE_LINKER_FLAGS_INIT "-static-libgcc")
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_GREATER 4.5 OR GCC_VERSION VERSION_EQUAL 4.5)
set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} -static-libstdc++")
endif()
set(CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
endif (MINGW)

View File

@@ -0,0 +1,57 @@
if(MSVC)
list(APPEND compiler_options
/W4
/permissive-
$<$<CONFIG:RELEASE>:/O2 /Ob2 >
$<$<CONFIG:MINSIZEREL>:/O1 /Ob1>
$<$<CONFIG:RELWITHDEBINFO>:/Zi /O2 /Ob1>
$<$<CONFIG:DEBUG>:/Zi /Ob0 /Od /RTC1>)
list(APPEND compiler_definitions
_UNICODE
WINDOWS
$<$<OR:$<CONFIG:RELEASE>,$<CONFIG:RELWITHDEBINFO>,$<CONFIG:MINSIZEREL>>:NDEBUG>
$<$<CONFIG:DEBUG>:_DEBUG>)
list(APPEND linker_flags
$<$<BOOL:${BUILD_SHARED_LIBS}>:/LTCG>
)
set(MSVC_RUNTIME_TYPE $<IF:$<BOOL:${BUILD_WITH_MT}>,MultiThreaded$<$<CONFIG:Debug>:Debug>,MultiThreaded$<$<CONFIG:Debug>:Debug>>DLL)
else(MSVC)
list(APPEND compiler_options
-Wall
-Wextra
-Wpedantic
$<$<CONFIG:RELEASE>:-O2>
$<$<CONFIG:DEBUG>:-O0>
$<$<CONFIG:DEBUG>:-g>
$<$<CONFIG:DEBUG>:-p>
$<$<CONFIG:DEBUG>:-pg>
$<$<CXX_COMPILER_ID:Clang>:-stdlib=libc++>)
list(APPEND compiler_definitions
$<$<OR:$<CONFIG:RELEASE>,$<CONFIG:MINSIZEREL>>:_FORTIFY_SOURCE=2>
)
list(APPEND linker_flags
-Wl,-z,defs
-Wl,-z,now
-Wl,-z,relro
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:-Wl,-pie>
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:-fpie>
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:-pipe>
$<$<BOOL:${BUILD_SHARED_LIBS}>:-static-libstdc++>
$<$<CONFIG:DEBUG>:-fno-omit-frame-pointer>
$<$<CONFIG:DEBUG>:-fsanitize=address>
$<$<CONFIG:DEBUG>:-fsanitize=leak>
$<$<CONFIG:DEBUG>:-fsanitize=undefined>
-fstack-protector
-fbounds-check
-fstack-clash-protection
-fPIC)
endif()

View File

@@ -1,7 +0,0 @@
if (MSVC)
# Compiler switches for C++, needed for static runtime linking
set(CMAKE_CXX_FLAGS_DEBUG_INIT "/MTd /D_DEBUG /Zi /Ob0 /Od /RTC1")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
endif (MSVC)

58
cmake/dependencies.cmake Normal file
View File

@@ -0,0 +1,58 @@
find_package(Threads REQUIRED)
# Find the Boost and Xerces libraries
# Find the Boost and Xerces libraries
if(NOT EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.73.0 COMPONENTS program_options system thread filesystem
QUIET)
if(NOT Boost_FOUND)
set(BOOST_ROOT CACHE PATH "Location of the boost root directory")
message(FATAL_ERROR "Unable to find boost library.
Please set the BOOST_ROOT to point to the boost distribution files.")
endif(NOT Boost_FOUND)
set(Xerces_USE_STATIC_LIBS On)
find_package(Xerces 3.2.2 QUIET)
if(NOT Xerces_FOUND)
set(XERCES_ROOT CACHE PATH "Location of the xerces library")
message(
FATAL_ERROR
"Unable to find xerces library.
Please set the the XERCES_ROOT to point to the root of the xerces directory."
)
endif(NOT Xerces_FOUND)
set(XML_LIBRARIES ${Xerces_LIBRARY})
set(XML_INCLUDE_DIRS ${Xerces_INCLUDE_DIR})
list(APPEND compiler_definitions
BOOST_ALL_NO_LIB
XERCES_STATIC_LIBRARY
$<$<CONFIG:RELWITHDEBINFO>:${Boost_LIB_DIAGNOSTIC_DEFINITIONS}>
$<$<CONFIG:DEBUG>:${Boost_LIB_DIAGNOSTIC_DEFINITIONS}>)
else()
set(Boost_INCLUDE_DIR ${CONAN_INCLUDE_DIRS_BOOST})
set(Boost_LIBRARY_DIRS CONAN_PKG::boost)
set(XML_LIBRARIES CONAN_PKG::xerces-c)
set(XML_INCLUDE_DIRS ${CONAN_INCLUDE_DIRS_XERCES-C})
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
list(APPEND compiler_definitions LINUX)
if(NOT EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
find_package(ICU 67.1 REQUIRED)
set(XML_LIBRARIES ${XML_LIBRARIES} ${ICU_LIBRARIES})
set(XML_INCLUDE_DIRS ${XML_INCLUDE_DIRS} ${ICU_INCLUDE_DIRS})
else()
set(XML_LIBRARIES ${XML_LIBRARIES} CONAN_PKG::icu)
set(XML_INCLUDE_DIRS ${XML_INCLUDE_DIRS} ${CONAN_INCLUDE_DIRS_ICU})
endif()
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
list(APPEND compiler_definitions WINDOWS)
endif()

13
conanfile.txt Normal file
View File

@@ -0,0 +1,13 @@
[requires]
icu/67.1
xerces-c/3.2.2
boost/1.73.0
[generators]
cmake
[options]
boost:multithreading=True
boost:shared=False
xerces-c:shared=False
icu:shared=False

22
examples/CMakeLists.txt Normal file
View File

@@ -0,0 +1,22 @@
list(APPEND EXAMPLES
DemoWrite01
DemoRead01
)
foreach(EXAMPLE ${EXAMPLES})
add_executable(${EXAMPLE} ${CMAKE_CURRENT_SOURCE_DIR}/${EXAMPLE}.cpp)
set_target_properties(${EXAMPLE} PROPERTIES
DEBUG_POSTFIX "-d"
MSVC_RUNTIME_LIBRARY "${MSVC_RUNTIME_TYPE}")
target_compile_options(${EXAMPLE} PUBLIC ${compiler_options})
target_compile_definitions(${EXAMPLE} PUBLIC ${compiler_definitions})
target_link_options(${EXAMPLE} PUBLIC ${linker_flags})
target_include_directories(${EXAMPLE} PRIVATE ${CMAKE_SOURCE_DIR}/include)
target_link_libraries(${EXAMPLE}
PRIVATE
${PROJECT_NAME}
${XML_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
endforeach()

View File

@@ -26,7 +26,7 @@
* DEALINGS IN THE SOFTWARE.
*/
#include <iostream>
#include "E57Foundation.h"
#include <openE57/E57Foundation.h>
using namespace e57;
using namespace std;

View File

@@ -25,7 +25,7 @@
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include "E57Foundation.h"
#include <openE57/E57Foundation.h>
using namespace e57;
using namespace std;

View File

@@ -158,13 +158,13 @@ class ImageFile;
#ifdef E57_INTERNAL_IMPLEMENTATION_ENABLE
# define E57_OBJECT_IMPLEMENTATION(T) \
public: \
boost::shared_ptr<T##Impl> impl() const {return(impl_);}; \
std::shared_ptr<T##Impl> impl() const {return(impl_);}; \
protected: \
boost::shared_ptr<T##Impl> impl_;
std::shared_ptr<T##Impl> impl_;
#else
# define E57_OBJECT_IMPLEMENTATION(T) \
protected: \
boost::shared_ptr<T##Impl> impl_;
std::shared_ptr<T##Impl> impl_;
#endif
//! @endcond
@@ -198,7 +198,7 @@ public:
//! \cond documentNonPublic The following isn't part of the API, and isn't documented.
#ifdef E57_INTERNAL_IMPLEMENTATION_ENABLE
explicit Node(boost::shared_ptr<NodeImpl>); // internal use only
explicit Node(std::shared_ptr<NodeImpl>); // internal use only
#endif
private: //=================
Node(); // No default constructor is defined for Node
@@ -241,8 +241,8 @@ private: //=================
protected: //=================
friend class ImageFile;
StructureNode(boost::shared_ptr<StructureNodeImpl> ni); // internal use only
StructureNode(boost::weak_ptr<ImageFileImpl> fileParent); // internal use only
StructureNode(std::shared_ptr<StructureNodeImpl> ni); // internal use only
StructureNode(std::weak_ptr<ImageFileImpl> fileParent); // internal use only
E57_OBJECT_IMPLEMENTATION(StructureNode) // Internal implementation details, not part of API, must be last in object
//! \endcond
@@ -283,7 +283,7 @@ private: //=================
protected: //=================
friend class CompressedVectorNode;
VectorNode(boost::shared_ptr<VectorNodeImpl> ni); // internal use only
VectorNode(std::shared_ptr<VectorNodeImpl> ni); // internal use only
E57_OBJECT_IMPLEMENTATION(VectorNode) // Internal implementation details, not part of API, must be last in object
//! \endcond
@@ -352,7 +352,7 @@ private: //=================
protected: //=================
friend class CompressedVectorNode;
CompressedVectorReader(boost::shared_ptr<CompressedVectorReaderImpl> ni);
CompressedVectorReader(std::shared_ptr<CompressedVectorReaderImpl> ni);
E57_OBJECT_IMPLEMENTATION(CompressedVectorReader) // Internal implementation details, not part of API, must be last in object
//! \endcond
@@ -375,7 +375,7 @@ private: //=================
protected: //=================
friend class CompressedVectorNode;
CompressedVectorWriter(boost::shared_ptr<CompressedVectorWriterImpl> ni);
CompressedVectorWriter(std::shared_ptr<CompressedVectorWriterImpl> ni);
E57_OBJECT_IMPLEMENTATION(CompressedVectorWriter) // Internal implementation details, not part of API, must be last in object
//! \endcond
@@ -417,7 +417,7 @@ protected: //=================
friend class CompressedVectorWriter;
friend class E57XmlParser;
CompressedVectorNode(boost::shared_ptr<CompressedVectorNodeImpl> ni); // internal use only
CompressedVectorNode(std::shared_ptr<CompressedVectorNodeImpl> ni); // internal use only
E57_OBJECT_IMPLEMENTATION(CompressedVectorNode) // Internal implementation details, not part of API, must be last in object
//! \endcond
@@ -452,7 +452,7 @@ private: //=================
IntegerNode(); // No default constructor is defined for IntegerNode
protected: //=================
IntegerNode(boost::shared_ptr<IntegerNodeImpl> ni); // internal use only
IntegerNode(std::shared_ptr<IntegerNodeImpl> ni); // internal use only
E57_OBJECT_IMPLEMENTATION(IntegerNode) // Internal implementation details, not part of API, must be last in object
//! \endcond
@@ -499,7 +499,7 @@ private: //=================
ScaledIntegerNode(); // No default constructor is defined for ScaledIntegerNode
protected: //=================
ScaledIntegerNode(boost::shared_ptr<ScaledIntegerNodeImpl> ni); // internal use only
ScaledIntegerNode(std::shared_ptr<ScaledIntegerNodeImpl> ni); // internal use only
E57_OBJECT_IMPLEMENTATION(ScaledIntegerNode) // Internal implementation details, not part of API, must be last in object
//! \endcond
@@ -536,7 +536,7 @@ private: //=================
FloatNode(); // No default constructor is defined for FloatNode
protected: //=================
FloatNode(boost::shared_ptr<FloatNodeImpl> ni); // internal use only
FloatNode(std::shared_ptr<FloatNodeImpl> ni); // internal use only
E57_OBJECT_IMPLEMENTATION(FloatNode) // Internal implementation details, not part of API, must be last in object
//! \endcond
@@ -570,7 +570,7 @@ private: //=================
StringNode(); // No default constructor is defined for StringNode
protected: //=================
friend class StringNodeImpl;
StringNode(boost::shared_ptr<StringNodeImpl> ni); // internal use only
StringNode(std::shared_ptr<StringNodeImpl> ni); // internal use only
E57_OBJECT_IMPLEMENTATION(StringNode) // Internal implementation details, not part of API, must be last in object
//! \endcond
@@ -606,7 +606,7 @@ private: //=================
protected: //=================
friend class E57XmlParser;
BlobNode(boost::shared_ptr<BlobNodeImpl> ni); // internal use only
BlobNode(std::shared_ptr<BlobNodeImpl> ni); // internal use only
// Internal use only, create blob already in a file
BlobNode(ImageFile destImageFile, int64_t fileOffset, int64_t length);
@@ -661,7 +661,7 @@ protected: //=================
friend class StringNode;
friend class BlobNode;
ImageFile(boost::shared_ptr<ImageFileImpl> imfi); // internal use only
ImageFile(std::shared_ptr<ImageFileImpl> imfi); // internal use only
E57_OBJECT_IMPLEMENTATION(ImageFile) // Internal implementation details, not part of API, must be last in object
//! \endcond

View File

@@ -54,11 +54,11 @@
#define E57SIMPLE_H_INCLUDED
#ifndef E57FOUNDATION_H_INCLUDED
#include "E57Foundation.h"
#include <openE57/E57Foundation.h>
#endif
#ifndef _C_TIMECONV_H_
#include "time_conversion.h"
#include <openE57/time_conversion/time_conversion.h>
#endif
using namespace std;
@@ -252,7 +252,7 @@ public:
//! @brief This function clears all the data members of the E57Root class
void Reset(void);
ustring formatName; //!< Contains the string ASTM E57 3D Image File
ustring formatName; //!< Contains the string <EFBFBD>ASTM E57 3D Image File<EFBFBD>
ustring guid; //!< A globally unique identification string for the current version of the file
uint32_t versionMajor; //!< Major version number, should be 1
uint32_t versionMinor; //!< Minor version number, should be 0
@@ -286,7 +286,7 @@ public:
class GroupingByLine {
public:
ustring idElementName; //!< The name of the PointRecord element that identifies which group the point is in. The value of this string must be rowIndex or columnIndex
ustring idElementName; //!< The name of the PointRecord element that identifies which group the point is in. The value of this string must be <EFBFBD>rowIndex<EFBFBD> or <EFBFBD>columnIndex<EFBFBD>
int64_t groupsSize; //!< Size of the groups compressedVector of LineGroupRecord structures
int64_t pointCountSize; //!< This is the size value for the e57::LineGroupRecord::pointCount.
};
@@ -421,7 +421,7 @@ public:
ustring sensorSoftwareVersion; //!< The version number for the software used for the data collection.
ustring sensorFirmwareVersion; //!< The version number for the firmware installed in the sensor at the time of data collection.
float temperature; //!< The ambient temperature, measured at the sensor, at the time of data collection (in degrees Celsius). Shall be ? ?273.15° (absolute zero).
float temperature; //!< The ambient temperature, measured at the sensor, at the time of data collection (in degrees Celsius). Shall be ? ?273.15<EFBFBD> (absolute zero).
float relativeHumidity; //!< The percentage relative humidity, measured at the sensor, at the time of data collection. Shall be in the interval [0, 100].
float atmosphericPressure; //!< The atmospheric pressure, measured at the sensor, at the time of data collection (in Pascals). Shall be positive.

View File

@@ -32,7 +32,7 @@
#include <iostream>
#include <vector>
#ifndef E57FOUNDATIONIMPL_H_INCLUDED
# include "E57FoundationImpl.h"
# include <openE57/impl/E57FoundationImpl.h>
#endif
namespace e57 {

View File

@@ -48,7 +48,7 @@
#define E57_INTERNAL_IMPLEMENTATION_ENABLE 1
#ifndef E57FOUNDATION_H_INCLUDED
# include "E57Foundation.h"
# include <openE57/E57Foundation.h>
#endif
// Uncomment the lines below to enable various levels of cross checking and verification in the code.
@@ -293,35 +293,35 @@ inline uint64_t CheckedFile::physicalToLogical(uint64_t physicalOffset)
//================================================================
class NodeImpl : public boost::enable_shared_from_this<NodeImpl> {
class NodeImpl : public std::enable_shared_from_this<NodeImpl> {
public:
virtual NodeType type() = 0;
void checkImageFileOpen(const char* srcFileName, int srcLineNumber, const char* srcFunctionName);
virtual bool isTypeEquivalent(boost::shared_ptr<NodeImpl> ni) = 0;
virtual bool isTypeEquivalent(std::shared_ptr<NodeImpl> ni) = 0;
bool isRoot();
boost::shared_ptr<NodeImpl> parent();
std::shared_ptr<NodeImpl> parent();
ustring pathName();
ustring relativePathName(boost::shared_ptr<NodeImpl> origin, ustring childPathName = ustring());
ustring relativePathName(std::shared_ptr<NodeImpl> origin, ustring childPathName = ustring());
ustring elementName();
boost::shared_ptr<ImageFileImpl> destImageFile();
std::shared_ptr<ImageFileImpl> destImageFile();
ustring imageFileName();
virtual bool isDefined(const ustring& pathName) = 0;
bool isAttached();
virtual void setAttachedRecursive();
void setParent(boost::shared_ptr<NodeImpl> parent, const ustring& elementName);
void setParent(std::shared_ptr<NodeImpl> parent, const ustring& elementName);
bool isTypeConstrained();
virtual boost::shared_ptr<NodeImpl> get(const ustring& pathName);
virtual void set(const ustring& pathName, boost::shared_ptr<NodeImpl> ni, bool autoPathCreate = false);
virtual void set(const std::vector<ustring>& fields, unsigned level, boost::shared_ptr<NodeImpl> ni, bool autoPathCreate = false);
virtual std::shared_ptr<NodeImpl> get(const ustring& pathName);
virtual void set(const ustring& pathName, std::shared_ptr<NodeImpl> ni, bool autoPathCreate = false);
virtual void set(const std::vector<ustring>& fields, unsigned level, std::shared_ptr<NodeImpl> ni, bool autoPathCreate = false);
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, boost::shared_ptr<NodeImpl> origin) = 0;
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, std::shared_ptr<NodeImpl> origin) = 0;
void checkBuffers(const std::vector<SourceDestBuffer>& sdbufs, bool allowMissing);
bool findTerminalPosition(boost::shared_ptr<NodeImpl> ni, uint64_t& countFromLeft);
bool findTerminalPosition(std::shared_ptr<NodeImpl> ni, uint64_t& countFromLeft);
virtual void writeXml(boost::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL) = 0;
virtual void writeXml(std::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL) = 0;
virtual ~NodeImpl() {};
@@ -339,38 +339,38 @@ protected: //=================
friend class Decoder; //???
friend class Encoder; //???
NodeImpl(boost::weak_ptr<ImageFileImpl> destImageFile);
NodeImpl(std::weak_ptr<ImageFileImpl> destImageFile);
NodeImpl& operator=(NodeImpl& n);
virtual boost::shared_ptr<NodeImpl> lookup(const ustring& /*pathName*/) {return(boost::shared_ptr<NodeImpl>());}; //???
boost::shared_ptr<NodeImpl> getRoot();
virtual std::shared_ptr<NodeImpl> lookup(const ustring& /*pathName*/) {return(std::shared_ptr<NodeImpl>());}; //???
std::shared_ptr<NodeImpl> getRoot();
boost::weak_ptr<ImageFileImpl> destImageFile_;
boost::weak_ptr<NodeImpl> parent_;
std::weak_ptr<ImageFileImpl> destImageFile_;
std::weak_ptr<NodeImpl> parent_;
ustring elementName_;
bool isAttached_;
};
class StructureNodeImpl : public NodeImpl {
public:
StructureNodeImpl(boost::weak_ptr<ImageFileImpl> destImageFile);
StructureNodeImpl(std::weak_ptr<ImageFileImpl> destImageFile);
virtual ~StructureNodeImpl() {};
virtual NodeType type();
virtual bool isTypeEquivalent(boost::shared_ptr<NodeImpl> ni);
virtual bool isTypeEquivalent(std::shared_ptr<NodeImpl> ni);
virtual bool isDefined(const ustring& pathName);
virtual void setAttachedRecursive();
virtual int64_t childCount();
virtual boost::shared_ptr<NodeImpl> get(int64_t index);
virtual boost::shared_ptr<NodeImpl> get(const ustring& pathName);
virtual void set(int64_t index, boost::shared_ptr<NodeImpl> ni);
virtual void set(const ustring& pathName, boost::shared_ptr<NodeImpl> ni, bool autoPathCreate = false);
virtual void set(const std::vector<ustring>& fields, unsigned level, boost::shared_ptr<NodeImpl> ni, bool autoPathCreate = false);
virtual void append(boost::shared_ptr<NodeImpl> ni);
virtual std::shared_ptr<NodeImpl> get(int64_t index);
virtual std::shared_ptr<NodeImpl> get(const ustring& pathName);
virtual void set(int64_t index, std::shared_ptr<NodeImpl> ni);
virtual void set(const ustring& pathName, std::shared_ptr<NodeImpl> ni, bool autoPathCreate = false);
virtual void set(const std::vector<ustring>& fields, unsigned level, std::shared_ptr<NodeImpl> ni, bool autoPathCreate = false);
virtual void append(std::shared_ptr<NodeImpl> ni);
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, boost::shared_ptr<NodeImpl> origin);
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, std::shared_ptr<NodeImpl> origin);
virtual void writeXml(boost::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
virtual void writeXml(std::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
#ifdef E57_DEBUG
void dump(int indent = 0, std::ostream& os = std::cout);
@@ -381,27 +381,27 @@ public:
protected: //=================
friend class CompressedVectorReaderImpl;
virtual boost::shared_ptr<NodeImpl> lookup(const ustring& pathName);
virtual std::shared_ptr<NodeImpl> lookup(const ustring& pathName);
std::vector<boost::shared_ptr<NodeImpl> > children_;
std::vector<std::shared_ptr<NodeImpl> > children_;
};
class VectorNodeImpl : public StructureNodeImpl {
public:
explicit VectorNodeImpl(boost::weak_ptr<ImageFileImpl> destImageFile, bool allowHeteroChildren);
explicit VectorNodeImpl(std::weak_ptr<ImageFileImpl> destImageFile, bool allowHeteroChildren);
virtual ~VectorNodeImpl() {};
virtual NodeType type();
virtual bool isTypeEquivalent(boost::shared_ptr<NodeImpl> ni);
virtual bool isTypeEquivalent(std::shared_ptr<NodeImpl> ni);
bool allowHeteroChildren();
//???virtual Node get(int64_t index);
//???virtual Node get(const ustring& pathName);
virtual void set(int64_t index, boost::shared_ptr<NodeImpl> ni);
//???virtual void set(const ustring& pathName, boost::shared_ptr<NodeImpl> ni);
//???virtual void append(boost::shared_ptr<NodeImpl> ni);
virtual void set(int64_t index, std::shared_ptr<NodeImpl> ni);
//???virtual void set(const ustring& pathName, std::shared_ptr<NodeImpl> ni);
//???virtual void append(std::shared_ptr<NodeImpl> ni);
virtual void writeXml(boost::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
virtual void writeXml(std::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
#ifdef E57_DEBUG
void dump(int indent = 0, std::ostream& os = std::cout);
@@ -413,29 +413,29 @@ protected: //=================
bool allowHeteroChildren_;
};
class SourceDestBufferImpl : public boost::enable_shared_from_this<SourceDestBufferImpl> {
class SourceDestBufferImpl : public std::enable_shared_from_this<SourceDestBufferImpl> {
public:
SourceDestBufferImpl(boost::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, int8_t* b, const size_t capacity, bool doConversion = false,
SourceDestBufferImpl(std::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, int8_t* b, const size_t capacity, bool doConversion = false,
bool doScaling = false, size_t stride = sizeof(int8_t));
SourceDestBufferImpl(boost::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, uint8_t* b, const size_t capacity, bool doConversion = false,
SourceDestBufferImpl(std::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, uint8_t* b, const size_t capacity, bool doConversion = false,
bool doScaling = false, size_t stride = sizeof(uint8_t));
SourceDestBufferImpl(boost::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, int16_t* b, const size_t capacity, bool doConversion = false,
SourceDestBufferImpl(std::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, int16_t* b, const size_t capacity, bool doConversion = false,
bool doScaling = false, size_t stride = sizeof(int16_t));
SourceDestBufferImpl(boost::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, uint16_t* b, const size_t capacity, bool doConversion = false,
SourceDestBufferImpl(std::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, uint16_t* b, const size_t capacity, bool doConversion = false,
bool doScaling = false, size_t stride = sizeof(uint16_t));
SourceDestBufferImpl(boost::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, int32_t* b, const size_t capacity, bool doConversion = false,
SourceDestBufferImpl(std::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, int32_t* b, const size_t capacity, bool doConversion = false,
bool doScaling = false, size_t stride = sizeof(int32_t));
SourceDestBufferImpl(boost::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, uint32_t* b, const size_t capacity, bool doConversion = false,
SourceDestBufferImpl(std::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, uint32_t* b, const size_t capacity, bool doConversion = false,
bool doScaling = false, size_t stride = sizeof(uint32_t));
SourceDestBufferImpl(boost::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, int64_t* b, const size_t capacity, bool doConversion = false,
SourceDestBufferImpl(std::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, int64_t* b, const size_t capacity, bool doConversion = false,
bool doScaling = false, size_t stride = sizeof(int64_t));
SourceDestBufferImpl(boost::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, bool* b, const size_t capacity, bool doConversion = false,
SourceDestBufferImpl(std::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, bool* b, const size_t capacity, bool doConversion = false,
bool doScaling = false, size_t stride = sizeof(bool));
SourceDestBufferImpl(boost::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, float* b, const size_t capacity, bool doConversion = false,
SourceDestBufferImpl(std::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, float* b, const size_t capacity, bool doConversion = false,
bool doScaling = false, size_t stride = sizeof(float));
SourceDestBufferImpl(boost::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, double* b, const size_t capacity, bool doConversion = false,
SourceDestBufferImpl(std::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, double* b, const size_t capacity, bool doConversion = false,
bool doScaling = false, size_t stride = sizeof(double));
SourceDestBufferImpl(boost::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, std::vector<ustring>* b);
SourceDestBufferImpl(std::weak_ptr<ImageFileImpl> destImageFile, const ustring pathName, std::vector<ustring>* b);
ustring pathName() {return(pathName_);}
MemoryRepresentation memoryRepresentation() {return(memoryRepresentation_);};
@@ -460,7 +460,7 @@ public:
void setNextDouble(double value);
void setNextString(const ustring& value);
void checkCompatible(boost::shared_ptr<SourceDestBufferImpl> newBuf);
void checkCompatible(std::shared_ptr<SourceDestBufferImpl> newBuf);
#ifdef E57_DEBUG
void dump(int indent = 0, std::ostream& os = std::cout);
@@ -482,7 +482,7 @@ friend class BitpackIntegerDecoder<uint64_t>; //??? needed?
void checkState_(); /// Common routine to check that constructor arguments were ok, throws if not
//??? verify alignment
boost::weak_ptr<ImageFileImpl> destImageFile_;
std::weak_ptr<ImageFileImpl> destImageFile_;
ustring pathName_; /// Pathname from CompressedVectorNode to source/dest object, e.g. "Indices/0"
MemoryRepresentation memoryRepresentation_; /// Type of element (e.g. E57_INT8, E57_UINT64, DOUBLE...)
char* base_; /// Address of first element, for non-ustring buffers
@@ -498,28 +498,28 @@ friend class BitpackIntegerDecoder<uint64_t>; //??? needed?
class CompressedVectorNodeImpl : public NodeImpl {
public:
CompressedVectorNodeImpl(boost::weak_ptr<ImageFileImpl> destImageFile);
CompressedVectorNodeImpl(std::weak_ptr<ImageFileImpl> destImageFile);
virtual ~CompressedVectorNodeImpl() {};
virtual NodeType type();
virtual bool isTypeEquivalent(boost::shared_ptr<NodeImpl> ni);
virtual bool isTypeEquivalent(std::shared_ptr<NodeImpl> ni);
virtual bool isDefined(const ustring& pathName);
virtual void setAttachedRecursive();
void setPrototype(boost::shared_ptr<NodeImpl> prototype);
boost::shared_ptr<NodeImpl> getPrototype();
void setCodecs(boost::shared_ptr<VectorNodeImpl> codecs);
boost::shared_ptr<VectorNodeImpl> getCodecs();
void setPrototype(std::shared_ptr<NodeImpl> prototype);
std::shared_ptr<NodeImpl> getPrototype();
void setCodecs(std::shared_ptr<VectorNodeImpl> codecs);
std::shared_ptr<VectorNodeImpl> getCodecs();
virtual int64_t childCount();
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, boost::shared_ptr<NodeImpl> origin);
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, std::shared_ptr<NodeImpl> origin);
virtual void writeXml(boost::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
virtual void writeXml(std::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
/// Iterator constructors
boost::shared_ptr<CompressedVectorWriterImpl> writer(std::vector<SourceDestBuffer> sbufs);
boost::shared_ptr<CompressedVectorReaderImpl> reader(std::vector<SourceDestBuffer> dbufs);
std::shared_ptr<CompressedVectorWriterImpl> writer(std::vector<SourceDestBuffer> sbufs);
std::shared_ptr<CompressedVectorReaderImpl> reader(std::vector<SourceDestBuffer> dbufs);
int64_t getRecordCount() {return(recordCount_);};
int64_t getBinarySectionLogicalStart() {return(binarySectionLogicalStart_);};
@@ -536,8 +536,8 @@ public:
protected: //=================
friend class CompressedVectorReaderImpl; //???
boost::shared_ptr<NodeImpl> prototype_;
boost::shared_ptr<VectorNodeImpl> codecs_;
std::shared_ptr<NodeImpl> prototype_;
std::shared_ptr<VectorNodeImpl> codecs_;
//??? bool writeCompleted_;
int64_t recordCount_;
@@ -546,20 +546,20 @@ protected: //=================
class IntegerNodeImpl : public NodeImpl {
public:
IntegerNodeImpl(boost::weak_ptr<ImageFileImpl> destImageFile, int64_t value = 0, int64_t minimum = 0, int64_t maximum = 0);
IntegerNodeImpl(std::weak_ptr<ImageFileImpl> destImageFile, int64_t value = 0, int64_t minimum = 0, int64_t maximum = 0);
virtual ~IntegerNodeImpl() {};
virtual NodeType type();
virtual bool isTypeEquivalent(boost::shared_ptr<NodeImpl> ni);
virtual bool isTypeEquivalent(std::shared_ptr<NodeImpl> ni);
virtual bool isDefined(const ustring& pathName);
int64_t value();
int64_t minimum();
int64_t maximum();
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, boost::shared_ptr<NodeImpl> origin);
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, std::shared_ptr<NodeImpl> origin);
virtual void writeXml(boost::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
virtual void writeXml(std::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
#ifdef E57_DEBUG
void dump(int indent = 0, std::ostream& os = std::cout);
@@ -576,18 +576,18 @@ protected: //=================
class ScaledIntegerNodeImpl : public NodeImpl {
public:
ScaledIntegerNodeImpl(boost::weak_ptr<ImageFileImpl> destImageFile,
ScaledIntegerNodeImpl(std::weak_ptr<ImageFileImpl> destImageFile,
int64_t value = 0, int64_t minimum = 0, int64_t maximum = 0,
double scale = 1.0, double offset = 0.0);
ScaledIntegerNodeImpl(boost::weak_ptr<ImageFileImpl> destImageFile, //Added by SC
ScaledIntegerNodeImpl(std::weak_ptr<ImageFileImpl> destImageFile, //Added by SC
double scaledValue = 0., double scaledMinimum = 0., double scaledMaximum = 0.,
double scale = 1.0, double offset = 0.0);
virtual ~ScaledIntegerNodeImpl() {};
virtual NodeType type();
virtual bool isTypeEquivalent(boost::shared_ptr<NodeImpl> ni);
virtual bool isTypeEquivalent(std::shared_ptr<NodeImpl> ni);
virtual bool isDefined(const ustring& pathName);
int64_t rawValue();
@@ -599,9 +599,9 @@ public:
double scale();
double offset();
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, boost::shared_ptr<NodeImpl> origin);
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, std::shared_ptr<NodeImpl> origin);
virtual void writeXml(boost::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
virtual void writeXml(std::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
#ifdef E57_DEBUG
@@ -621,13 +621,13 @@ protected: //=================
class FloatNodeImpl : public NodeImpl {
public:
FloatNodeImpl(boost::weak_ptr<ImageFileImpl> destImageFile,
FloatNodeImpl(std::weak_ptr<ImageFileImpl> destImageFile,
double value = 0, FloatPrecision precision = E57_DOUBLE,
double minimum = E57_DOUBLE_MIN, double maximum = E57_DOUBLE_MAX);
virtual ~FloatNodeImpl() {};
virtual NodeType type();
virtual bool isTypeEquivalent(boost::shared_ptr<NodeImpl> ni);
virtual bool isTypeEquivalent(std::shared_ptr<NodeImpl> ni);
virtual bool isDefined(const ustring& pathName);
double value();
@@ -635,9 +635,9 @@ public:
double minimum();
double maximum();
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, boost::shared_ptr<NodeImpl> origin);
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, std::shared_ptr<NodeImpl> origin);
virtual void writeXml(boost::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
virtual void writeXml(std::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
#ifdef E57_DEBUG
void dump(int indent = 0, std::ostream& os = std::cout);
@@ -655,18 +655,18 @@ protected: //=================
class StringNodeImpl : public NodeImpl {
public:
explicit StringNodeImpl(boost::weak_ptr<ImageFileImpl> destImageFile, const ustring value = "");
explicit StringNodeImpl(std::weak_ptr<ImageFileImpl> destImageFile, const ustring value = "");
virtual ~StringNodeImpl() {};
virtual NodeType type();
virtual bool isTypeEquivalent(boost::shared_ptr<NodeImpl> ni);
virtual bool isTypeEquivalent(std::shared_ptr<NodeImpl> ni);
virtual bool isDefined(const ustring& pathName);
ustring value();
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, boost::shared_ptr<NodeImpl> origin);
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, std::shared_ptr<NodeImpl> origin);
virtual void writeXml(boost::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
virtual void writeXml(std::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
#ifdef E57_DEBUG
void dump(int indent = 0, std::ostream& os = std::cout);
@@ -681,21 +681,21 @@ protected: //=================
class BlobNodeImpl : public NodeImpl {
public:
BlobNodeImpl(boost::weak_ptr<ImageFileImpl> destImageFile, int64_t byteCount);
BlobNodeImpl(boost::weak_ptr<ImageFileImpl> destImageFile, int64_t fileOffset, int64_t length);
BlobNodeImpl(std::weak_ptr<ImageFileImpl> destImageFile, int64_t byteCount);
BlobNodeImpl(std::weak_ptr<ImageFileImpl> destImageFile, int64_t fileOffset, int64_t length);
virtual ~BlobNodeImpl();
virtual NodeType type();
virtual bool isTypeEquivalent(boost::shared_ptr<NodeImpl> ni);
virtual bool isTypeEquivalent(std::shared_ptr<NodeImpl> ni);
virtual bool isDefined(const ustring& pathName);
int64_t byteCount();
void read(uint8_t* buf, int64_t start, size_t count);
void write(uint8_t* buf, int64_t start, size_t count);
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, boost::shared_ptr<NodeImpl> origin);
virtual void checkLeavesInSet(const std::set<ustring>& pathNames, std::shared_ptr<NodeImpl> origin);
virtual void writeXml(boost::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
virtual void writeXml(std::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName=NULL);
#ifdef E57_DEBUG
void dump(int indent = 0, std::ostream& os = std::cout);
@@ -731,11 +731,11 @@ struct E57FileHeader {
#endif
};
class ImageFileImpl : public boost::enable_shared_from_this<ImageFileImpl> {
class ImageFileImpl : public std::enable_shared_from_this<ImageFileImpl> {
public:
ImageFileImpl();
void construct2(const ustring& fileName, const ustring& mode, const ustring& configuration);
boost::shared_ptr<StructureNodeImpl> root();
std::shared_ptr<StructureNodeImpl> root();
void close();
void cancel();
bool isOpen();
@@ -816,7 +816,7 @@ protected: //=================
std::vector<NameSpace> nameSpaces_;
/// Smart pointer to metadata tree
boost::shared_ptr<StructureNodeImpl> root_;
std::shared_ptr<StructureNodeImpl> root_;
};
//================================================================
@@ -921,7 +921,7 @@ struct EmptyPacketHeader {
class Decoder;
struct DecodeChannel {
SourceDestBuffer dbuf; //??? for now, one input per channel
boost::shared_ptr<Decoder> decoder;
std::shared_ptr<Decoder> decoder;
unsigned bytestreamNumber;
uint64_t maxRecordCount;
uint64_t currentPacketLogicalOffset;
@@ -929,7 +929,7 @@ struct DecodeChannel {
size_t currentBytestreamBufferLength;
bool inputFinished;
DecodeChannel(SourceDestBuffer dbuf_arg, boost::shared_ptr<Decoder> decoder_arg, unsigned bytestreamNumber_arg, uint64_t maxRecordCount_arg);
DecodeChannel(SourceDestBuffer dbuf_arg, std::shared_ptr<Decoder> decoder_arg, unsigned bytestreamNumber_arg, uint64_t maxRecordCount_arg);
~DecodeChannel();
bool isOutputBlocked();
bool isInputBlocked(); /// has exhausted data in the current packet
@@ -944,13 +944,13 @@ class PacketReadCache;
class CompressedVectorReaderImpl {
public:
CompressedVectorReaderImpl(boost::shared_ptr<CompressedVectorNodeImpl> ni, std::vector<SourceDestBuffer>& dbufs);
CompressedVectorReaderImpl(std::shared_ptr<CompressedVectorNodeImpl> ni, std::vector<SourceDestBuffer>& dbufs);
~CompressedVectorReaderImpl();
unsigned read();
unsigned read(std::vector<SourceDestBuffer>& dbufs);
void seek(uint64_t recordNumber);
bool isOpen();
boost::shared_ptr<CompressedVectorNodeImpl> compressedVectorNode();
std::shared_ptr<CompressedVectorNodeImpl> compressedVectorNode();
void close();
#ifdef E57_DEBUG
@@ -972,8 +972,8 @@ protected: //=================
bool isOpen_;
std::vector<SourceDestBuffer> dbufs_;
boost::shared_ptr<CompressedVectorNodeImpl> cVector_;
boost::shared_ptr<NodeImpl> proto_;
std::shared_ptr<CompressedVectorNodeImpl> cVector_;
std::shared_ptr<NodeImpl> proto_;
std::vector<DecodeChannel> channels_;
PacketReadCache* cache_;
@@ -986,12 +986,12 @@ protected: //=================
class CompressedVectorWriterImpl {
public:
CompressedVectorWriterImpl(boost::shared_ptr<CompressedVectorNodeImpl> ni, std::vector<SourceDestBuffer>& sbufs);
CompressedVectorWriterImpl(std::shared_ptr<CompressedVectorNodeImpl> ni, std::vector<SourceDestBuffer>& sbufs);
~CompressedVectorWriterImpl();
void write(const size_t requestedRecordCount);
void write(std::vector<SourceDestBuffer>& sbufs, const size_t requestedRecordCount);
bool isOpen();
boost::shared_ptr<CompressedVectorNodeImpl> compressedVectorNode();
std::shared_ptr<CompressedVectorNodeImpl> compressedVectorNode();
void close();
#ifdef E57_DEBUG
@@ -1013,10 +1013,10 @@ protected: //=================
//??? no default ctor, copy, assignment?
std::vector<SourceDestBuffer> sbufs_;
boost::shared_ptr<CompressedVectorNodeImpl> cVector_;
boost::shared_ptr<NodeImpl> proto_;
std::shared_ptr<CompressedVectorNodeImpl> cVector_;
std::shared_ptr<NodeImpl> proto_;
std::vector<boost::shared_ptr<Encoder> > bytestreams_;
std::vector<std::shared_ptr<Encoder> > bytestreams_;
SeekIndex seekIndex_;
DataPacket dataPacket_;
@@ -1034,8 +1034,8 @@ protected: //=================
class Encoder {
public:
static boost::shared_ptr<Encoder> EncoderFactory(unsigned bytestreamNumber,
boost::shared_ptr<CompressedVectorNodeImpl> cVector,
static std::shared_ptr<Encoder> EncoderFactory(unsigned bytestreamNumber,
std::shared_ptr<CompressedVectorNodeImpl> cVector,
std::vector<SourceDestBuffer>& sbuf,
ustring& codecPath);
@@ -1092,7 +1092,7 @@ protected: //================
void outBufferShiftDown();
boost::shared_ptr<SourceDestBufferImpl> sourceBuffer_;
std::shared_ptr<SourceDestBufferImpl> sourceBuffer_;
std::vector<char> outBuffer_;
size_t outBufferFirst_;
@@ -1190,7 +1190,7 @@ public:
virtual void dump(int indent = 0, std::ostream& os = std::cout);
#endif
protected: //================
boost::shared_ptr<SourceDestBufferImpl> sourceBuffer_;
std::shared_ptr<SourceDestBufferImpl> sourceBuffer_;
uint64_t currentRecordIndex_;
int64_t minimum_;
};
@@ -1199,8 +1199,8 @@ protected: //================
class Decoder {
public:
static boost::shared_ptr<Decoder> DecoderFactory(unsigned bytestreamNumber,
boost::shared_ptr<CompressedVectorNodeImpl> cVector,
static std::shared_ptr<Decoder> DecoderFactory(unsigned bytestreamNumber,
std::shared_ptr<CompressedVectorNodeImpl> cVector,
std::vector<SourceDestBuffer>& dbufs,
const ustring& codecPath);
virtual ~Decoder() {};
@@ -1247,7 +1247,7 @@ protected: //================
uint64_t currentRecordIndex_;
uint64_t maxRecordCount_;
boost::shared_ptr<SourceDestBufferImpl> destBuffer_;
std::shared_ptr<SourceDestBufferImpl> destBuffer_;
std::vector<char> inBuffer_;
size_t inBufferFirstBit_;
@@ -1333,7 +1333,7 @@ protected: //================
uint64_t currentRecordIndex_;
uint64_t maxRecordCount_;
boost::shared_ptr<SourceDestBufferImpl> destBuffer_;
std::shared_ptr<SourceDestBufferImpl> destBuffer_;
bool isScaledInteger_;
int64_t minimum_;
@@ -1368,7 +1368,7 @@ public:
PacketReadCache(CheckedFile* cFile, unsigned packetCount);
~PacketReadCache();
std::auto_ptr<PacketLock> lock(uint64_t packetLogicalOffset, char* &pkt); //??? pkt could be const
std::unique_ptr<PacketLock> lock(uint64_t packetLogicalOffset, char* &pkt); //??? pkt could be const
void markDiscarable(uint64_t packetLogicalOffset);
#ifdef E57_DEBUG
@@ -1710,7 +1710,7 @@ uint64_t SeekIndexWriter::levelWrite(unsigned levelNumber)
void SeekIndexWriter::dump(int indent, std::ostream& os)
{
bool isOpen_;
boost::shared_ptr<ImageFileImpl> imf_;
std::shared_ptr<ImageFileImpl> imf_;
CompressedVectorWriter cvWriter_;
uint64_t sectionPhysicalOffset_;
vector<LevelInfo> levels_;
@@ -1773,7 +1773,7 @@ void SeekIndexReader::lookup(uint64_t recordNumber, uint64_t& foundRecordNumber,
for (unsigned level = indexDepth_-1; level >= 0; level--) {
/// Get index packet at packetOffset into cache and get pointer
char* pkt;
auto_ptr<PacketLock> plock = imf_->cache()->lock(nextPacketOffset, pkt);
std::unique_ptr<PacketLock> plock = imf_->cache()->lock(nextPacketOffset, pkt);
IndexPacket* ipkt = reinterpret_cast<IndexPacket*>(pkt);
/// Quick check that packet looks ok
@@ -1848,7 +1848,7 @@ void SeekIndexReader::lookup(uint64_t recordNumber, uint64_t& foundRecordNumber,
for (unsigned level = indexDepth_-1; level >= 0; level--) {
/// Get index packet at packetOffset into cache and get pointer
char* pkt;
auto_ptr<PacketLock> plock = imf_->cache()->lock(nextPacketOffset, pkt);
std::unique_ptr<PacketLock> plock = imf_->cache()->lock(nextPacketOffset, pkt);
IndexPacket* ipkt = reinterpret_cast<IndexPacket*>(pkt);
/// Quick check that packet looks ok

View File

@@ -61,7 +61,7 @@
#define E57_INTERNAL_IMPLEMENTATION_ENABLE 1
#ifndef E57SIMPLE_H_INCLUDED
# include "E57Simple.h"
# include <openE57/E57Simple.h>
#endif
namespace e57 {
@@ -104,7 +104,7 @@ void GetSystemTimeFromGPSDateTime(
//! This is the E57 Reader class
class ReaderImpl : public boost::enable_shared_from_this<ReaderImpl> {
class ReaderImpl : public std::enable_shared_from_this<ReaderImpl> {
private:
@@ -281,7 +281,7 @@ virtual ImageFile GetRawIMF(void); //!< /return Returns the raw ImageFile
//! This is the E57 Writer class
class WriterImpl : public boost::enable_shared_from_this<WriterImpl> {
class WriterImpl : public std::enable_shared_from_this<WriterImpl> {
private:
ImageFile imf_;

View File

@@ -188,14 +188,14 @@ DEALINGS IN THE SOFTWARE.
//! @file E57Foundation.cpp
#include "E57FoundationImpl.h"
#include <openE57/impl/E57FoundationImpl.h>
using namespace e57;
//using namespace std;
using std::endl;
//using namespace boost;
using boost::shared_ptr;
using boost::weak_ptr;
using std::shared_ptr;
using std::weak_ptr;
using boost::dynamic_pointer_cast;
//=====================================================================================
@@ -2060,7 +2060,7 @@ StructureNode::StructureNode(const Node& n)
}
//! @cond documentNonPublic The following isn't part of the API, and isn't documented.
StructureNode::StructureNode(boost::weak_ptr<ImageFileImpl> fileParent)
StructureNode::StructureNode(std::weak_ptr<ImageFileImpl> fileParent)
: impl_(new StructureNodeImpl(fileParent))
{}

View File

@@ -75,7 +75,7 @@ using std::endl;
using std::cerr;
#endif
#include "E57FoundationImpl.h"
#include <openE57/impl/E57FoundationImpl.h>
using namespace e57;
//using namespace std;
using std::cerr;
@@ -88,13 +88,13 @@ using std::ios_base;
using std::scientific;
using std::setprecision;
using std::string;
using std::auto_ptr;
using std::unique_ptr;
using std::min;
using std::max;
//using namespace boost;
using boost::weak_ptr;
using boost::shared_ptr;
using std::weak_ptr;
using std::shared_ptr;
using boost::dynamic_pointer_cast;
#include <xercesc/util/TransService.hpp>
@@ -239,14 +239,14 @@ bool NodeImpl::isRoot()
return(parent_.expired());
};
boost::shared_ptr<NodeImpl> NodeImpl::parent()
std::shared_ptr<NodeImpl> NodeImpl::parent()
{
checkImageFileOpen(__FILE__, __LINE__, __FUNCTION__);
if (isRoot()) {
/// If is root, then has self as parent (by convention)
return(shared_from_this());
} else {
boost::shared_ptr<NodeImpl> myParent(parent_);
std::shared_ptr<NodeImpl> myParent(parent_);
return(myParent);
}
}
@@ -383,7 +383,7 @@ bool NodeImpl::isTypeConstrained()
return(false);
}
boost::shared_ptr<NodeImpl> NodeImpl::get(const ustring& pathName)
std::shared_ptr<NodeImpl> NodeImpl::get(const ustring& pathName)
{
/// This is common virtual function for terminal E57 element types: Integer, ScaledInteger, Float, Blob.
/// The non-terminal types override this virtual function.
@@ -451,7 +451,7 @@ void NodeImpl::set(const ustring& pathName, shared_ptr<NodeImpl> ni, bool autoPa
root->set(pathName, ni, autoPathCreate);
}
void NodeImpl::set(const std::vector<ustring>& /*fields*/, unsigned /*level*/, boost::shared_ptr<NodeImpl> /*ni*/, bool /*autoPathCreate*/)
void NodeImpl::set(const std::vector<ustring>& /*fields*/, unsigned /*level*/, std::shared_ptr<NodeImpl> /*ni*/, bool /*autoPathCreate*/)
{
/// If get here, then tried to call set(fields...) on NodeImpl that wasn't a StructureNodeImpl, so that's an error
throw E57_EXCEPTION1(E57_ERROR_BAD_PATH_NAME); //???
@@ -829,7 +829,7 @@ void StructureNodeImpl::checkLeavesInSet(const std::set<ustring>& pathNames, sha
}
//??? use visitor?
void StructureNodeImpl::writeXml(boost::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName)
void StructureNodeImpl::writeXml(std::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName)
{
/// don't checkImageFileOpen
@@ -954,7 +954,7 @@ void VectorNodeImpl::set(int64_t index64, shared_ptr<NodeImpl> ni)
StructureNodeImpl::set(index64, ni);
}
void VectorNodeImpl::writeXml(boost::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName)
void VectorNodeImpl::writeXml(std::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName)
{
/// don't checkImageFileOpen
@@ -1980,7 +1980,7 @@ void CompressedVectorNodeImpl::checkLeavesInSet(const std::set<ustring>& /*pathN
throw E57_EXCEPTION2(E57_ERROR_INTERNAL, "this->pathName=" + this->pathName());
}
void CompressedVectorNodeImpl::writeXml(boost::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName)
void CompressedVectorNodeImpl::writeXml(std::shared_ptr<ImageFileImpl> imf, CheckedFile& cf, int indent, const char* forcedFieldName)
{
// don't checkImageFileOpen
@@ -2201,7 +2201,7 @@ void IntegerNodeImpl::checkLeavesInSet(const std::set<ustring>& pathNames, share
throw E57_EXCEPTION2(E57_ERROR_NO_BUFFER_FOR_ELEMENT, "this->pathName=" + this->pathName());
}
void IntegerNodeImpl::writeXml(boost::shared_ptr<ImageFileImpl> /*imf???*/, CheckedFile& cf, int indent, const char* forcedFieldName)
void IntegerNodeImpl::writeXml(std::shared_ptr<ImageFileImpl> /*imf???*/, CheckedFile& cf, int indent, const char* forcedFieldName)
{
// don't checkImageFileOpen
@@ -2382,7 +2382,7 @@ void ScaledIntegerNodeImpl::checkLeavesInSet(const std::set<ustring>& pathNames,
throw E57_EXCEPTION2(E57_ERROR_NO_BUFFER_FOR_ELEMENT, "this->pathName=" + this->pathName());
}
void ScaledIntegerNodeImpl::writeXml(boost::shared_ptr<ImageFileImpl> /*imf*/, CheckedFile& cf, int indent, const char* forcedFieldName)
void ScaledIntegerNodeImpl::writeXml(std::shared_ptr<ImageFileImpl> /*imf*/, CheckedFile& cf, int indent, const char* forcedFieldName)
{
// don't checkImageFileOpen
@@ -2533,7 +2533,7 @@ void FloatNodeImpl::checkLeavesInSet(const std::set<ustring>& pathNames, shared_
throw E57_EXCEPTION2(E57_ERROR_NO_BUFFER_FOR_ELEMENT, "this->pathName=" + this->pathName());
}
void FloatNodeImpl::writeXml(boost::shared_ptr<ImageFileImpl> /*imf*/, CheckedFile& cf, int indent, const char* forcedFieldName)
void FloatNodeImpl::writeXml(std::shared_ptr<ImageFileImpl> /*imf*/, CheckedFile& cf, int indent, const char* forcedFieldName)
{
// don't checkImageFileOpen
@@ -2653,7 +2653,7 @@ void StringNodeImpl::checkLeavesInSet(const std::set<ustring>& pathNames, shared
throw E57_EXCEPTION2(E57_ERROR_NO_BUFFER_FOR_ELEMENT, "this->pathName=" + this->pathName());
}
void StringNodeImpl::writeXml(boost::shared_ptr<ImageFileImpl> /*imf*/, CheckedFile& cf, int indent, const char* forcedFieldName)
void StringNodeImpl::writeXml(std::shared_ptr<ImageFileImpl> /*imf*/, CheckedFile& cf, int indent, const char* forcedFieldName)
{
// don't checkImageFileOpen
@@ -2853,7 +2853,7 @@ void BlobNodeImpl::checkLeavesInSet(const std::set<ustring>& pathNames, shared_p
throw E57_EXCEPTION2(E57_ERROR_NO_BUFFER_FOR_ELEMENT, "this->pathName=" + this->pathName());
}
void BlobNodeImpl::writeXml(boost::shared_ptr<ImageFileImpl> /*imf*/, CheckedFile& cf, int indent, const char* forcedFieldName)
void BlobNodeImpl::writeXml(std::shared_ptr<ImageFileImpl> /*imf*/, CheckedFile& cf, int indent, const char* forcedFieldName)
{
// don't checkImageFileOpen
@@ -3009,7 +3009,7 @@ namespace e57 {
class E57XmlParser : public DefaultHandler
{
public:
E57XmlParser(boost::shared_ptr<ImageFileImpl> imf);
E57XmlParser(std::shared_ptr<ImageFileImpl> imf);
~E57XmlParser();
/// SAX interface
@@ -3031,7 +3031,7 @@ private:
ustring lookupAttribute(const Attributes& attributes, const XMLCh* attribute_name);
bool isAttributeDefined(const Attributes& attributes, const XMLCh* attribute_name);
boost::shared_ptr<ImageFileImpl> imf_; /// Image file we are reading
std::shared_ptr<ImageFileImpl> imf_; /// Image file we are reading
struct ParseInfo {
/// All the fields need to remember while parsing the XML
@@ -3100,7 +3100,7 @@ void E57XmlParser::ParseInfo::dump(int indent, ostream& os)
} /// end namespace e57
E57XmlParser::E57XmlParser(boost::shared_ptr<ImageFileImpl> imf)
E57XmlParser::E57XmlParser(std::shared_ptr<ImageFileImpl> imf)
: imf_(imf)
{
}
@@ -3807,7 +3807,7 @@ void ImageFileImpl::construct2(const ustring& fileName, const ustring& mode, con
throw E57_EXCEPTION2(E57_ERROR_XML_PARSER_INIT, "parserMessage=" + ustring(XMLString::transcode(ex.getMessage())));
}
xmlReader = XMLReaderFactory::createXMLReader(); //??? auto_ptr?
xmlReader = XMLReaderFactory::createXMLReader(); //??? std::unique_ptr?
//??? check these are right
xmlReader->setFeature(XMLUni::fgSAX2CoreValidation, true);
@@ -5797,7 +5797,7 @@ bool CompressedVectorWriterImpl::isOpen()
return(isOpen_);
}
boost::shared_ptr<CompressedVectorNodeImpl> CompressedVectorWriterImpl::compressedVectorNode()
std::shared_ptr<CompressedVectorNodeImpl> CompressedVectorWriterImpl::compressedVectorNode()
{
return(cVector_);
}
@@ -6277,7 +6277,7 @@ CompressedVectorReaderImpl::CompressedVectorReaderImpl(shared_ptr<CompressedVect
/// Verify that packet given by dataPhysicalOffset is actually a data packet, init channels
{
char* anyPacket = NULL;
auto_ptr<PacketLock> packetLock = cache_->lock(dataLogicalOffset, anyPacket);
std::unique_ptr<PacketLock> packetLock = cache_->lock(dataLogicalOffset, anyPacket);
DataPacket* dpkt = reinterpret_cast<DataPacket*>(anyPacket);
@@ -6440,7 +6440,7 @@ void CompressedVectorReaderImpl::feedPacketToDecoders(uint64_t currentPacketLogi
{
/// Get packet at currentPacketLogicalOffset into memory.
char* anyPacket = NULL;
auto_ptr<PacketLock> packetLock = cache_->lock(currentPacketLogicalOffset, anyPacket);
std::unique_ptr<PacketLock> packetLock = cache_->lock(currentPacketLogicalOffset, anyPacket);
DataPacket* dpkt = reinterpret_cast<DataPacket*>(anyPacket);
/// Double check that have a data packet. Should have already determined this.
@@ -6507,7 +6507,7 @@ void CompressedVectorReaderImpl::feedPacketToDecoders(uint64_t currentPacketLogi
if (nextPacketLogicalOffset < E57_UINT64_MAX) { //??? huh?
/// Get packet at nextPacketLogicalOffset into memory.
char* anyPacket = NULL;
auto_ptr<PacketLock> packetLock = cache_->lock(nextPacketLogicalOffset, anyPacket);
std::unique_ptr<PacketLock> packetLock = cache_->lock(nextPacketLogicalOffset, anyPacket);
DataPacket* dpkt = reinterpret_cast<DataPacket*>(anyPacket);
/// Got a data packet, update the channels with exhausted input
@@ -6556,7 +6556,7 @@ uint64_t CompressedVectorReaderImpl::findNextDataPacket(uint64_t nextPacketLogic
/// Starting at nextPacketLogicalOffset, search for next data packet until hit end of binary section.
while (nextPacketLogicalOffset < sectionEndLogicalOffset_) {
char* anyPacket = NULL;
auto_ptr<PacketLock> packetLock = cache_->lock(nextPacketLogicalOffset, anyPacket);
std::unique_ptr<PacketLock> packetLock = cache_->lock(nextPacketLogicalOffset, anyPacket);
/// Guess it's a data packet, if not continue to next packet
DataPacket* dpkt = reinterpret_cast<DataPacket*>(anyPacket);
@@ -6589,7 +6589,7 @@ bool CompressedVectorReaderImpl::isOpen()
return(isOpen_);
}
boost::shared_ptr<CompressedVectorNodeImpl> CompressedVectorReaderImpl::compressedVectorNode()
std::shared_ptr<CompressedVectorNodeImpl> CompressedVectorReaderImpl::compressedVectorNode()
{
return(cVector_);
}
@@ -7806,7 +7806,7 @@ PacketReadCache::~PacketReadCache()
}
}
auto_ptr<PacketLock> PacketReadCache::lock(uint64_t packetLogicalOffset, char* &pkt)
std::unique_ptr<PacketLock> PacketReadCache::lock(uint64_t packetLogicalOffset, char* &pkt)
{
#ifdef E57_MAX_VERBOSE
cout << "PacketReadCache::lock() called, packetLogicalOffset=" << packetLogicalOffset << endl;
@@ -7834,7 +7834,7 @@ auto_ptr<PacketLock> PacketReadCache::lock(uint64_t packetLogicalOffset, char* &
pkt = entries_[i].buffer_;
/// Create lock so we are sure that we will be unlocked when use is finished.
auto_ptr<PacketLock> plock(new PacketLock(this, i));
std::unique_ptr<PacketLock> plock(new PacketLock(this, i));
/// Increment cache lock just before return
lockCount_++;
@@ -7862,7 +7862,7 @@ auto_ptr<PacketLock> PacketReadCache::lock(uint64_t packetLogicalOffset, char* &
pkt = entries_[oldestEntry].buffer_;
/// Create lock so we are sure we will be unlocked when use is finished.
auto_ptr<PacketLock> plock(new PacketLock(this, oldestEntry));
std::unique_ptr<PacketLock> plock(new PacketLock(this, oldestEntry));
/// Increment cache lock just before return
lockCount_++;

View File

@@ -804,8 +804,8 @@ DEALINGS IN THE SOFTWARE.
# error "no supported OS platform defined"
#endif
#include "E57Simple.h"
#include "E57SimpleImpl.h"
#include <openE57/E57Simple.h>
#include <openE57/impl/E57SimpleImpl.h>
using namespace e57;
using namespace std;

View File

@@ -81,8 +81,8 @@
#endif
#include <sstream>
#include "E57SimpleImpl.h"
#include "time_conversion.h"
#include <openE57/impl/E57SimpleImpl.h>
#include <openE57/time_conversion/time_conversion.h>
using namespace e57;
using namespace std;

View File

@@ -25,8 +25,8 @@
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include "LASReader.h"
#include "E57FoundationImpl.h"
#include <openE57/LAS/LASReader.h>
#include <openE57/impl/E57FoundationImpl.h>
#include <algorithm>

View File

@@ -46,9 +46,9 @@ SUCH DAMAGE.
#include <sys/timeb.h>
#include <time.h>
#include <math.h> /* for fmod() */
#include "gnss_error.h"
#include "time_conversion.h"
#include "constants.h"
#include <openE57/time_conversion/gnss_error.h>
#include <openE57/time_conversion/time_conversion.h>
#include <openE57/time_conversion/constants.h>
#if 0
#ifndef WIN32

66
tools/CMakeLists.txt Normal file
View File

@@ -0,0 +1,66 @@
list(APPEND TOOLS
e57fields
e57unpack
e57validate
e57xmldump
)
foreach(TOOL ${TOOLS})
add_executable(${TOOL} ${CMAKE_CURRENT_SOURCE_DIR}/${TOOL}.cpp)
set_target_properties(${TOOL} PROPERTIES
DEBUG_POSTFIX "-d"
MSVC_RUNTIME_LIBRARY "${MSVC_RUNTIME_TYPE}")
target_compile_options(${TOOL} PUBLIC ${compiler_options})
target_compile_definitions(${TOOL} PUBLIC ${compiler_definitions})
target_link_options(${TOOL} PUBLIC ${linker_flags})
target_include_directories(${TOOL}
PRIVATE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
${CMAKE_SOURCE_DIR}/include
)
target_link_libraries(${TOOL}
PRIVATE
${PROJECT_NAME}
${XML_LIBRARIES}
${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
endforeach()
# Handle las2e57 differently
add_executable(las2e57 ${CMAKE_CURRENT_SOURCE_DIR}/las2e57.cpp)
set_target_properties(las2e57 PROPERTIES
DEBUG_POSTFIX "-d"
MSVC_RUNTIME_LIBRARY "${MSVC_RUNTIME_TYPE}")
target_compile_options(las2e57 PUBLIC ${compiler_options})
target_compile_definitions(las2e57 PUBLIC ${compiler_definitions})
target_link_options(las2e57 PUBLIC ${linker_flags})
target_include_directories(las2e57
PRIVATE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
${CMAKE_SOURCE_DIR}/include
)
target_link_libraries(las2e57
PRIVATE
${PROJECT_NAME}
LASReader
time_conversion
${XML_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
install(
TARGETS
e57fields
e57xmldump
e57unpack
e57validate
las2e57
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
)

View File

@@ -30,20 +30,16 @@
#include <iomanip>
#include <float.h>
#include <map>
#if defined(_MSC_VER)
# include <memory>
#else
# include <tr1/memory>
#endif
#include "E57Foundation.h"
#include "E57FoundationImpl.h" //??? for exceptions, should be in separate file
#include <memory>
#include <openE57/E57Foundation.h>
#include <openE57/impl/E57FoundationImpl.h> //??? for exceptions, should be in separate file
#include <boost/math/special_functions/fpclassify.hpp>
using boost::math::fpclassify;
using namespace e57;
using namespace std;
using namespace std::tr1;
//!!! prologue, file name, date, version#, total # elements
//!!! doc
@@ -446,9 +442,9 @@ struct CVElementInfo {
/// Only one is used, depending on the type of the E57 element.
/// One of these three should be resized to BUFFER_ELEMENT_COUNT.
/// These are smart pointers to avoid the copying (and the moving) when put on the cvElements list.
shared_ptr<vector<int64_t> > iBuffer;
shared_ptr<vector<double> > dBuffer;
shared_ptr<vector<string> > sBuffer;
std::shared_ptr<vector<int64_t> > iBuffer;
std::shared_ptr<vector<double> > dBuffer;
std::shared_ptr<vector<string> > sBuffer;
/// The precalculated parts of the element path name.
/// The only part that is missing is the record number which goes in between.

View File

@@ -10,7 +10,7 @@
#define STRING_HELPER1(a) STRING_HELPER2(a)
#define BUILD_VERSION STRING_HELPER1(SVN_VERSION)
#include <E57Foundation.h>
#include <openE57/E57Foundation.h>
using e57::Node;
using e57::ImageFile;
using e57::StructureNode;
@@ -45,12 +45,7 @@ using std::exception;
#include <stdexcept>
using std::runtime_error;
#if defined(_MSC_VER)
# include <memory>
#else
# include <tr1/memory>
#endif
using std::tr1::shared_ptr;
#include <memory>
#include <string>
using std::string;
@@ -101,9 +96,7 @@ print_version(
cout
<< PROGRAM_NAME" (" << BOOST_PLATFORM << ") "
<< PROGRAM_VERSION
<< "." << BUILD_VERSION
<< endl
;
<< "." << '\n';
int astmMajor;
int astmMinor;

View File

@@ -66,18 +66,14 @@
================================================================*/
#if defined(_MSC_VER)
# include <unordered_map>
#else
# include <tr1/unordered_map>
using std::tr1::unordered_map;
#endif
#include <unordered_map>
using std::unordered_map;
#include <cstring>
using std::strlen;
#include <cmath>
using std::fabs;
#include "E57Foundation.h"
#include <openE57/E57Foundation.h>
using namespace e57;
using namespace std;
@@ -694,7 +690,7 @@ public:
void dump(int indent = 0, std::ostream& os = std::cout);
//================
private:
typedef std::tr1::unordered_map<int64_t, LineGroup> GroupsMap;
typedef std::unordered_map<int64_t, LineGroup> GroupsMap;
bool isDefined_;
bool isByRow_;

View File

@@ -26,8 +26,8 @@
* DEALINGS IN THE SOFTWARE.
*/
#include <iostream>
#include "E57Foundation.h"
#include "E57FoundationImpl.h" //??? for exceptions, should be in separate file
#include <openE57/E57Foundation.h>
#include <openE57/impl/E57FoundationImpl.h> //??? for exceptions, should be in separate file
using namespace e57;
using namespace std;
//using namespace std::tr1; //??? is this really needed, gives error on gcc <roland>

View File

@@ -25,9 +25,9 @@
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include "E57Foundation.h"
#include "LASReader.h"
#include "time_conversion.h" // code from Essential GNSS Project
#include <openE57/E57Foundation.h>
#include <openE57//LAS/LASReader.h>
#include <openE57/time_conversion/time_conversion.h> // code from Essential GNSS Project
#include <math.h>
#include <fstream> // std::ifstream