Skip to content

Commit

Permalink
updated libe57Format from v2.2.1 to 3.1
Browse files Browse the repository at this point in the history
## 3.1.0 - (in progress)

### Added

- {cmake} New option `E57_RELEASE_LTO` controls whether link-time optimization is on for release builds. It defaults to `ON`. ([FreeCAD#254](asmaloney/libE57Format#254))

  CMake forces "thin" LTO (see [this issue](https://gitlab.kitware.com/cmake/cmake/-/issues/23136)) which is a problem if compiling statically for distribution (e.g. in a package manager). Generally you will only want to turn this off for distributing static release builds.

### Changed

- {cmake} Remove `E57_VISIBILITY_HIDDEN` option. ([FreeCAD#259](asmaloney/libE57Format#259))

  I cannot get extern templates to work across all of gcc, clang, apple clang, and MSVC when using "hidden" visibility with shared libraries.

### Fixed

- Fix clang warnings about implicit conversions in _SourceDestBufferImpl.cpp_. Apple's clang doesn't warn about these, but it looks like the official clang releases do. ([FreeCAD#257](asmaloney/libE57Format#257)) (Thanks Martin!)

## [3.0.2](https://github.com/asmaloney/libE57Format/releases/tag/v3.0.2) - 2023-07-22

### Fixed

- Fix `E57_VERBOSE` build. ([FreeCAD#251](asmaloney/libE57Format#251)) (Thanks Jia!)
- {standard conformance} Fix invalid range exception in FloatNode implementation. ([FreeCAD#250](asmaloney/libE57Format#250))
- Fix reading of index packets. ([FreeCAD#249](asmaloney/libE57Format#249))
- Fix several places where we should be checking for MSVC, not WIN32. ([FreeCAD#248](asmaloney/libE57Format#248))
- Fix "unnecessary semicolons" warnings which prevented building with GCC <= 10. ([FreeCAD#241](asmaloney/libE57Format#241)) (Thanks Andre!)

## [3.0.1](https://github.com/asmaloney/libE57Format/releases/tag/v3.0.1) - 2023-03-15

### Added

- {ci} Added an MSVC 32-bit build. ([FreeCAD#235](asmaloney/libE57Format#235))

### Fixed

- {cmake} Turn off inter-procedural optimization in debug builds. Link-time optimization can make debugging more difficult. ([FreeCAD#240](asmaloney/libE57Format#240))
- {cmake} Don't force a debug postfix if `CMAKE_DEBUG_POSTFIX` is defined.([FreeCAD#239](asmaloney/libE57Format#239))
- {cmake} Don't force install locations. This prevents overriding them using `CMAKE_INSTALL_BINDIR` & `CMAKE_INSTALL_LIBDIR`.([FreeCAD#237](asmaloney/libE57Format#237))
- Fix warnings which prevented building on 32-bit systems. ([FreeCAD#233](asmaloney/libE57Format#233), [FreeCAD#234](asmaloney/libE57Format#234))

## [3.0.0](https://github.com/asmaloney/libE57Format/releases/tag/v3.0.0) - 2023-02-23

There have been _many_ changes around the `Simple API` in this release to fix some problems, avoid potential errors, and simplify the use of the API. Where possible these changes are marked as `deprecated` to be removed later. The compiler will produce warnings for these indicating what needs to change. Other changes could not be marked deprecated but will break the API, requiring code changes. The notable ones are marked with 🚧 below.

### Added

- Add address (ASan) and undefined behaviour (UBSan) sanitizers. These are controlled by `E57FORMAT_SANITIZE_ALL`, `E57FORMAT_SANITIZE_ADDRESS` and `E57FORMAT_SANITIZE_ADDRESS`. They are not included when building with MSVC.
- Add new `E57Version.h` header for more convenient access to version information. ([FreeCAD#197](asmaloney/libE57Format#197)).
- Add `ImageFile::extensionsLookupPrefix()` overload for more concise user code. ([FreeCAD#161](asmaloney/libE57Format#161))
- Added a constructor & destructor for **E57SimpleData**'s `Data3DPointsData_t`. This will create all the required buffers based on an `e57::Data3D` struct and handle their cleanup. See the `SimpleWriter` tests for examples. ([FreeCAD#149](asmaloney/libE57Format#149))

  > **Note:** I strongly recommend these new constructors be used to simplify your code and help prevent errors.

- A new **E57SimpleReader** constructor takes a `ReaderOptions` struct which allows setting the checksum policy.
  ```cpp
  Reader( const ustring &filePath, const ReaderOptions &options );
  ```
- {test} Added testing using [GoogleTest](https://github.com/google/googletest). For details, please see [test/README.md](test/README.md) ([FreeCAD#121](asmaloney/libE57Format#121))
- Added `E57Exception::errorStr()` to get the error string directly. ([FreeCAD#128](asmaloney/libE57Format#128))
- {cmake} Use [ccache](https://ccache.dev/) if available. ([FreeCAD#129](asmaloney/libE57Format#129))
- {ci} Added a CI check for proper clang-formatted code. ([FreeCAD#125](asmaloney/libE57Format#125))

### Changed

- Now requires a **[C++14](https://en.cppreference.com/w/cpp/14)** compatible compiler.
- Now requires **[CMake](https://cmake.org/) >= 3.15**. ([FreeCAD#205](asmaloney/libE57Format#205))
- 🚧 **DEBUG** and **VERBOSE** macros were changed to simplify and clarify:
  - New `E57_ENABLE_DIAGNOSTIC_OUTPUT` controls the inclusion of the code for the `dump()` functions on nodes. I don't see any real reason to turn this off, but I left the capability in for compatibility.
  - New `E57_VALIDATION_LEVEL=N` replaces `E57_DEBUG` (N=1) and `E57_MAX_DEBUG` (N=2).
  - `E57_MAX_VERBOSE` was consolidated with `E57_VERBOSE` since they were essentially the same.
- When building itself, warnings are now treated as errors. ([FreeCAD#205](asmaloney/libE57Format#205), [FreeCAD#211](asmaloney/libE57Format#211))
- Clean up global const and enum names to use the `e57` namespace and avoid repetition. ([FreeCAD#176](asmaloney/libE57Format#176))
  - i.e. instead of `e57::E57_STRUCTURE`, we now use `e57::TypeStructure`
- {format} Update clang-format rules for clang-format 15. ([FreeCAD#168](asmaloney/libE57Format#168), [FreeCAD#179](asmaloney/libE57Format#179))
- Change default checksum policies to an enum. ([FreeCAD#166](asmaloney/libE57Format#166))
  Old | New
  --|--
  CHECKSUM_POLICY_NONE | ChecksumPolicy::None
  CHECKSUM_POLICY_SPARSE | ChecksumPolicy::Sparse
  CHECKSUM_POLICY_HALF | ChecksumPolicy::Half
  CHECKSUM_POLICY_ALL | ChecksumPolicy::All
- Avoid implicit conversion in constructors. ([FreeCAD#135](asmaloney/libE57Format#135))
- Update [CRCpp](https://github.com/d-bahr/CRCpp) to 1.2. ([FreeCAD#130](asmaloney/libE57Format#130))
- **E57Exception** changes ([FreeCAD#118](asmaloney/libE57Format#118)):
  - mark methods as `noexcept`
  - use `private` instead of `protected`
- Rename **E57Simple**'s `Data3DPointsData` and `Data3DPointsData_d` structs to `Data3DPointsFloat` and `Data3DPointsDouble` respectively. ([FreeCAD#180](asmaloney/libE57Format#180))
- 🚧 **E57Simple:** Specifying the node type for cartesian & spherical points, time stamp, and intensity is now explicit using new fields (`pointRangeNodeType`, `angleNodeType`, `timeNodeType`, and `intensityNodeType`) and a new enum (`NumericalNodeType`). ([FreeCAD#178](asmaloney/libE57Format#178))
  - For examples, please see _test/src/testSimpleWriter.cpp_.
- Simplify the **E57SimpleWriter** API with `WriteImage2DData()` for images and `WriteData3DData()` for 3D data. This reduces code, hides complexity, and avoids potential errors. ([FreeCAD#171](asmaloney/libE57Format#171))
  - As part of this simplification, `WriteData3DData()` will now fill in any missing min/max values for cartesian & spherical points, intensity, and time stamps by looking at the data.([FreeCAD#175](asmaloney/libE57Format#175))
- 🚧 **E57Simple:** Intensity now uses `double` instead of `float`. ([FreeCAD#178](asmaloney/libE57Format#178))
- 🚧 **E57Simple:** Colours now use `uint16_t` instead of `uint8_t`. ([FreeCAD#167](asmaloney/libE57Format#167))
- 🚧 Change **E57SimpleData**'s Data3D field name from `pointsSize` to `pointCount`. ([FreeCAD#164](asmaloney/libE57Format#164))
- 🚧 Min/max fields in **E57SimpleData**'s Data3D's point fields were a mix of floats and doubles. Since the fields are doubles, set them all to doubles and use the new `Data3DPointsData_t` constructor to set them properly for floats. ([FreeCAD#153](asmaloney/libE57Format#153))
  > **Note:** If you were previously relying on these to be floats and are not using the new `Data3DPointsData_t` constructor, you will need to set these.
- 🚧 Renamed the [E57_EXT_surface_normals](http://www.libe57.org/E57_EXT_surface_normals.txt) extension's fields in **E57SimpleData**'s `PointStandardizedFieldsAvailable` to be in line with existing code. ([FreeCAD#149](asmaloney/libE57Format#149))
  - `normalX` renamed to `normalXField`
  - `normalY` renamed to `normalYField`
  - `normalZ` renamed to `normalZField`

### Deprecated

- `e57::Utilities::getVersions()`. ([FreeCAD#197](asmaloney/libE57Format#197))
- `e57::Data3DPointsData` and `e57::Data3DPointsData_d` types. ([FreeCAD#180](asmaloney/libE57Format#180))
- Many global const and enum names. The compiler will produce warnings including the replacement symbols (note that enumerators will not produce warnings on C++14, but they will on C++17). ([FreeCAD#176](asmaloney/libE57Format#176))
- `e57::Writer::NewImage2D`and `e57::Writer::SetUpData3DPointsData`. ([FreeCAD#171](asmaloney/libE57Format#171))
- Old default checksum policies (`CHECKSUM_POLICY_NONE`, `CHECKSUM_POLICY_SPARSE`, `CHECKSUM_POLICY_HALF`, and `CHECKSUM_POLICY_ALL`). ([FreeCAD#166](asmaloney/libE57Format#166))
- The old `e57::Reader` constructor taking only `filePath`. ([FreeCAD#139](asmaloney/libE57Format#139))
- The old `e57::Writer` constructor taking only `filePath`. ([FreeCAD#117](asmaloney/libE57Format#117))

### Fixed

- Fix several potential divide-by-zero cases. ([FreeCAD#224](asmaloney/libE57Format#224))
- {ci} Now builds shared library versions as well. ([FreeCAD#219](asmaloney/libE57Format#219))
- {win} Fixes shared library build warnings. ([FreeCAD#215](asmaloney/libE57Format#215), [FreeCAD#216](asmaloney/libE57Format#216), [FreeCAD#217](asmaloney/libE57Format#217))
- Fix the code which shortens floating point numbers when converted to strings. The impact of it being incorrect was negligible since it's just the floating point representation in the XML portion of the file. ([FreeCAD#214](asmaloney/libE57Format#214))
- Turned on a lot of compiler warnings and fixed them. ([FreeCAD#201](asmaloney/libE57Format#201), [FreeCAD#202](asmaloney/libE57Format#202), [FreeCAD#203](asmaloney/libE57Format#203), [FreeCAD#204](asmaloney/libE57Format#204), [FreeCAD#205](asmaloney/libE57Format#205), [FreeCAD#207](asmaloney/libE57Format#207), [FreeCAD#209](asmaloney/libE57Format#209))
- Fix writing floating point numbers when `std::locale::global` is set. ([FreeCAD#174](asmaloney/libE57Format#174))
- E57XmlParser: Parse doubles in a locale-independent way. ([FreeCAD#173](asmaloney/libE57Format#173)) (Thanks Hugal31!)
- E57SimpleReader: Ensure scaled integer fields are set as best we can when reading. ([FreeCAD#158](asmaloney/libE57Format#158))
- Fix the [E57_EXT_surface_normals](http://www.libe57.org/E57_EXT_surface_normals.txt) extension's URI in **E57SimpleWriter**. ([FreeCAD#143](asmaloney/libE57Format#143))
- {win} Fix conversion warning when compiling with debug on. ([FreeCAD#124](asmaloney/libE57Format#124))
- Add errno detail to `E57_ERROR_OPEN_FAILED` exception. ([FreeCAD#119](asmaloney/libE57Format#119), [FreeCAD#120](asmaloney/libE57Format#120))

## [2.3.0](https://github.com/asmaloney/libE57Format/releases/tag/v2.3.0) - 2022-10-04

### Added

- {cmake} Added `E57_VISIBILITY_HIDDEN` option to control [CXX_VISIBILITY_PRESET](https://cmake.org/cmake/help/latest/prop_tgt/LANG_VISIBILITY_PRESET.html). Defaults to `ON`. ([FreeCAD#104](asmaloney/libE57Format#104)) (Thanks Nigel!)
- Added BSD support. ([FreeCAD#99](asmaloney/libE57Format#99)) (Thanks Christophe!)

### Changed

- Updated &amp; reorganized the [online API docs](https://asmaloney.github.io/libE57Format-docs/) and changed to a [cleaner theme](https://github.com/jothepro/doxygen-awesome-css).
- Change file creation to use _0666_ permissions on [POSIX](https://en.wikipedia.org/wiki/POSIX) systems. ([FreeCAD#105](asmaloney/libE57Format#105)) (Thanks Nigel!)
- {cmake} [CXX_VISIBILITY_PRESET](https://cmake.org/cmake/help/latest/prop_tgt/LANG_VISIBILITY_PRESET.html) is now set and `ON` by default. ([FreeCAD#104](asmaloney/libE57Format#104)) (Thanks Nigel!)
- A new **E57SimpleWriter** constructor takes a `WriterOptions` struct which allows setting the file's GUID.
  ```cpp
  Writer( const ustring &filePath, const WriterOptions &options );
  ```
  The old constructor taking only `coordinateMetadata` is deprecated and will be removed in the future. ([FreeCAD#96](asmaloney/libE57Format#96)) (Thanks Nigel!)
- Change `E57_DEBUG`, `E57_MAX_DEBUG`, `E57_VERBOSE`, `E57_MAX_VERBOSE`, `E57_WRITE_CRAZY_PACKET_MODE` from **#defines** to cmake options. ([FreeCAD#80](asmaloney/libE57Format#80)) (Thanks Nigel!)

### Fixed

- Fix **E57SimpleWriter**'s writing of invalid quaternions. It now defaults to the identity quaternion. ([FreeCAD#108](asmaloney/libE57Format#108)) (Thanks Nigel!)
- Fix **E57SimpleReader** to handle missing `images2D` and `isAtomicClockReferenced` nodes. ([FreeCAD#90](asmaloney/libE57Format#90)) (Thanks Olli!)
- Fix **BitpackIntegerDecoder** sometimes reading past end of input buffer. ([FreeCAD#87](asmaloney/libE57Format#87)) (Thanks Nigel!)
- Fix compilation when some debug options are set. ([FreeCAD#81](asmaloney/libE57Format#81), [FreeCAD#82](asmaloney/libE57Format#82), [FreeCAD#84](asmaloney/libE57Format#84)) (Thanks Nigel!)
- Fix compilation with [musl libc](https://musl.libc.org/) ([FreeCAD#70](asmaloney/libE57Format#70)) (Thanks Dimitri!)
- Add missing include for [GCC 11](https://gcc.gnu.org/gcc-11/porting_to.html#header-dep-changes) ([FreeCAD#68](asmaloney/libE57Format#68)) (Thanks bartoszek!)

**Note:** The next release will be 3.0 and will require a [C++14](https://en.cppreference.com/w/cpp/14) compiler.

updated libe57Format from v2.2.1 to 3.1

### Added

- {cmake} New option `E57_RELEASE_LTO` controls whether link-time optimization is on for release builds. It defaults to `ON`. ([FreeCAD#254](asmaloney/libE57Format#254))

  CMake forces "thin" LTO (see [this issue](https://gitlab.kitware.com/cmake/cmake/-/issues/23136)) which is a problem if compiling statically for distribution (e.g. in a package manager). Generally you will only want to turn this off for distributing static release builds.

### Changed

- {cmake} Remove `E57_VISIBILITY_HIDDEN` option. ([FreeCAD#259](asmaloney/libE57Format#259))

  I cannot get extern templates to work across all of gcc, clang, apple clang, and MSVC when using "hidden" visibility with shared libraries.

### Fixed

- Fix clang warnings about implicit conversions in _SourceDestBufferImpl.cpp_. Apple's clang doesn't warn about these, but it looks like the official clang releases do. ([FreeCAD#257](asmaloney/libE57Format#257)) (Thanks Martin!)

## [3.0.2](https://github.com/asmaloney/libE57Format/releases/tag/v3.0.2) - 2023-07-22

### Fixed

- Fix `E57_VERBOSE` build. ([FreeCAD#251](asmaloney/libE57Format#251)) (Thanks Jia!)
- {standard conformance} Fix invalid range exception in FloatNode implementation. ([FreeCAD#250](asmaloney/libE57Format#250))
- Fix reading of index packets. ([FreeCAD#249](asmaloney/libE57Format#249))
- Fix several places where we should be checking for MSVC, not WIN32. ([FreeCAD#248](asmaloney/libE57Format#248))
- Fix "unnecessary semicolons" warnings which prevented building with GCC <= 10. ([FreeCAD#241](asmaloney/libE57Format#241)) (Thanks Andre!)

## [3.0.1](https://github.com/asmaloney/libE57Format/releases/tag/v3.0.1) - 2023-03-15

### Added

- {ci} Added an MSVC 32-bit build. ([FreeCAD#235](asmaloney/libE57Format#235))

### Fixed

- {cmake} Turn off inter-procedural optimization in debug builds. Link-time optimization can make debugging more difficult. ([FreeCAD#240](asmaloney/libE57Format#240))
- {cmake} Don't force a debug postfix if `CMAKE_DEBUG_POSTFIX` is defined.([FreeCAD#239](asmaloney/libE57Format#239))
- {cmake} Don't force install locations. This prevents overriding them using `CMAKE_INSTALL_BINDIR` & `CMAKE_INSTALL_LIBDIR`.([FreeCAD#237](asmaloney/libE57Format#237))
- Fix warnings which prevented building on 32-bit systems. ([FreeCAD#233](asmaloney/libE57Format#233), [FreeCAD#234](asmaloney/libE57Format#234))

## [3.0.0](https://github.com/asmaloney/libE57Format/releases/tag/v3.0.0) - 2023-02-23

There have been _many_ changes around the `Simple API` in this release to fix some problems, avoid potential errors, and simplify the use of the API. Where possible these changes are marked as `deprecated` to be removed later. The compiler will produce warnings for these indicating what needs to change. Other changes could not be marked deprecated but will break the API, requiring code changes. The notable ones are marked with 🚧 below.

### Added

- Add address (ASan) and undefined behaviour (UBSan) sanitizers. These are controlled by `E57FORMAT_SANITIZE_ALL`, `E57FORMAT_SANITIZE_ADDRESS` and `E57FORMAT_SANITIZE_ADDRESS`. They are not included when building with MSVC.
- Add new `E57Version.h` header for more convenient access to version information. ([FreeCAD#197](asmaloney/libE57Format#197)).
- Add `ImageFile::extensionsLookupPrefix()` overload for more concise user code. ([FreeCAD#161](asmaloney/libE57Format#161))
- Added a constructor & destructor for **E57SimpleData**'s `Data3DPointsData_t`. This will create all the required buffers based on an `e57::Data3D` struct and handle their cleanup. See the `SimpleWriter` tests for examples. ([FreeCAD#149](asmaloney/libE57Format#149))

  > **Note:** I strongly recommend these new constructors be used to simplify your code and help prevent errors.

- A new **E57SimpleReader** constructor takes a `ReaderOptions` struct which allows setting the checksum policy.
  ```cpp
  Reader( const ustring &filePath, const ReaderOptions &options );
  ```
- {test} Added testing using [GoogleTest](https://github.com/google/googletest). For details, please see [test/README.md](test/README.md) ([FreeCAD#121](asmaloney/libE57Format#121))
- Added `E57Exception::errorStr()` to get the error string directly. ([FreeCAD#128](asmaloney/libE57Format#128))
- {cmake} Use [ccache](https://ccache.dev/) if available. ([FreeCAD#129](asmaloney/libE57Format#129))
- {ci} Added a CI check for proper clang-formatted code. ([FreeCAD#125](asmaloney/libE57Format#125))

### Changed

- Now requires a **[C++14](https://en.cppreference.com/w/cpp/14)** compatible compiler.
- Now requires **[CMake](https://cmake.org/) >= 3.15**. ([FreeCAD#205](asmaloney/libE57Format#205))
- 🚧 **DEBUG** and **VERBOSE** macros were changed to simplify and clarify:
  - New `E57_ENABLE_DIAGNOSTIC_OUTPUT` controls the inclusion of the code for the `dump()` functions on nodes. I don't see any real reason to turn this off, but I left the capability in for compatibility.
  - New `E57_VALIDATION_LEVEL=N` replaces `E57_DEBUG` (N=1) and `E57_MAX_DEBUG` (N=2).
  - `E57_MAX_VERBOSE` was consolidated with `E57_VERBOSE` since they were essentially the same.
- When building itself, warnings are now treated as errors. ([FreeCAD#205](asmaloney/libE57Format#205), [FreeCAD#211](asmaloney/libE57Format#211))
- Clean up global const and enum names to use the `e57` namespace and avoid repetition. ([FreeCAD#176](asmaloney/libE57Format#176))
  - i.e. instead of `e57::E57_STRUCTURE`, we now use `e57::TypeStructure`
- {format} Update clang-format rules for clang-format 15. ([FreeCAD#168](asmaloney/libE57Format#168), [FreeCAD#179](asmaloney/libE57Format#179))
- Change default checksum policies to an enum. ([FreeCAD#166](asmaloney/libE57Format#166))
  Old | New
  --|--
  CHECKSUM_POLICY_NONE | ChecksumPolicy::None
  CHECKSUM_POLICY_SPARSE | ChecksumPolicy::Sparse
  CHECKSUM_POLICY_HALF | ChecksumPolicy::Half
  CHECKSUM_POLICY_ALL | ChecksumPolicy::All
- Avoid implicit conversion in constructors. ([FreeCAD#135](asmaloney/libE57Format#135))
- Update [CRCpp](https://github.com/d-bahr/CRCpp) to 1.2. ([FreeCAD#130](asmaloney/libE57Format#130))
- **E57Exception** changes ([FreeCAD#118](asmaloney/libE57Format#118)):
  - mark methods as `noexcept`
  - use `private` instead of `protected`
- Rename **E57Simple**'s `Data3DPointsData` and `Data3DPointsData_d` structs to `Data3DPointsFloat` and `Data3DPointsDouble` respectively. ([FreeCAD#180](asmaloney/libE57Format#180))
- 🚧 **E57Simple:** Specifying the node type for cartesian & spherical points, time stamp, and intensity is now explicit using new fields (`pointRangeNodeType`, `angleNodeType`, `timeNodeType`, and `intensityNodeType`) and a new enum (`NumericalNodeType`). ([FreeCAD#178](asmaloney/libE57Format#178))
  - For examples, please see _test/src/testSimpleWriter.cpp_.
- Simplify the **E57SimpleWriter** API with `WriteImage2DData()` for images and `WriteData3DData()` for 3D data. This reduces code, hides complexity, and avoids potential errors. ([FreeCAD#171](asmaloney/libE57Format#171))
  - As part of this simplification, `WriteData3DData()` will now fill in any missing min/max values for cartesian & spherical points, intensity, and time stamps by looking at the data.([FreeCAD#175](asmaloney/libE57Format#175))
- 🚧 **E57Simple:** Intensity now uses `double` instead of `float`. ([FreeCAD#178](asmaloney/libE57Format#178))
- 🚧 **E57Simple:** Colours now use `uint16_t` instead of `uint8_t`. ([FreeCAD#167](asmaloney/libE57Format#167))
- 🚧 Change **E57SimpleData**'s Data3D field name from `pointsSize` to `pointCount`. ([FreeCAD#164](asmaloney/libE57Format#164))
- 🚧 Min/max fields in **E57SimpleData**'s Data3D's point fields were a mix of floats and doubles. Since the fields are doubles, set them all to doubles and use the new `Data3DPointsData_t` constructor to set them properly for floats. ([FreeCAD#153](asmaloney/libE57Format#153))
  > **Note:** If you were previously relying on these to be floats and are not using the new `Data3DPointsData_t` constructor, you will need to set these.
- 🚧 Renamed the [E57_EXT_surface_normals](http://www.libe57.org/E57_EXT_surface_normals.txt) extension's fields in **E57SimpleData**'s `PointStandardizedFieldsAvailable` to be in line with existing code. ([FreeCAD#149](asmaloney/libE57Format#149))
  - `normalX` renamed to `normalXField`
  - `normalY` renamed to `normalYField`
  - `normalZ` renamed to `normalZField`

### Deprecated

- `e57::Utilities::getVersions()`. ([FreeCAD#197](asmaloney/libE57Format#197))
- `e57::Data3DPointsData` and `e57::Data3DPointsData_d` types. ([FreeCAD#180](asmaloney/libE57Format#180))
- Many global const and enum names. The compiler will produce warnings including the replacement symbols (note that enumerators will not produce warnings on C++14, but they will on C++17). ([FreeCAD#176](asmaloney/libE57Format#176))
- `e57::Writer::NewImage2D`and `e57::Writer::SetUpData3DPointsData`. ([FreeCAD#171](asmaloney/libE57Format#171))
- Old default checksum policies (`CHECKSUM_POLICY_NONE`, `CHECKSUM_POLICY_SPARSE`, `CHECKSUM_POLICY_HALF`, and `CHECKSUM_POLICY_ALL`). ([FreeCAD#166](asmaloney/libE57Format#166))
- The old `e57::Reader` constructor taking only `filePath`. ([FreeCAD#139](asmaloney/libE57Format#139))
- The old `e57::Writer` constructor taking only `filePath`. ([FreeCAD#117](asmaloney/libE57Format#117))

### Fixed

- Fix several potential divide-by-zero cases. ([FreeCAD#224](asmaloney/libE57Format#224))
- {ci} Now builds shared library versions as well. ([FreeCAD#219](asmaloney/libE57Format#219))
- {win} Fixes shared library build warnings. ([FreeCAD#215](asmaloney/libE57Format#215), [FreeCAD#216](asmaloney/libE57Format#216), [FreeCAD#217](asmaloney/libE57Format#217))
- Fix the code which shortens floating point numbers when converted to strings. The impact of it being incorrect was negligible since it's just the floating point representation in the XML portion of the file. ([FreeCAD#214](asmaloney/libE57Format#214))
- Turned on a lot of compiler warnings and fixed them. ([FreeCAD#201](asmaloney/libE57Format#201), [FreeCAD#202](asmaloney/libE57Format#202), [FreeCAD#203](asmaloney/libE57Format#203), [FreeCAD#204](asmaloney/libE57Format#204), [FreeCAD#205](asmaloney/libE57Format#205), [FreeCAD#207](asmaloney/libE57Format#207), [FreeCAD#209](asmaloney/libE57Format#209))
- Fix writing floating point numbers when `std::locale::global` is set. ([FreeCAD#174](asmaloney/libE57Format#174))
- E57XmlParser: Parse doubles in a locale-independent way. ([FreeCAD#173](asmaloney/libE57Format#173)) (Thanks Hugal31!)
- E57SimpleReader: Ensure scaled integer fields are set as best we can when reading. ([FreeCAD#158](asmaloney/libE57Format#158))
- Fix the [E57_EXT_surface_normals](http://www.libe57.org/E57_EXT_surface_normals.txt) extension's URI in **E57SimpleWriter**. ([FreeCAD#143](asmaloney/libE57Format#143))
- {win} Fix conversion warning when compiling with debug on. ([FreeCAD#124](asmaloney/libE57Format#124))
- Add errno detail to `E57_ERROR_OPEN_FAILED` exception. ([FreeCAD#119](asmaloney/libE57Format#119), [FreeCAD#120](asmaloney/libE57Format#120))

## [2.3.0](https://github.com/asmaloney/libE57Format/releases/tag/v2.3.0) - 2022-10-04

### Added

- {cmake} Added `E57_VISIBILITY_HIDDEN` option to control [CXX_VISIBILITY_PRESET](https://cmake.org/cmake/help/latest/prop_tgt/LANG_VISIBILITY_PRESET.html). Defaults to `ON`. ([FreeCAD#104](asmaloney/libE57Format#104)) (Thanks Nigel!)
- Added BSD support. ([FreeCAD#99](asmaloney/libE57Format#99)) (Thanks Christophe!)

### Changed

- Updated &amp; reorganized the [online API docs](https://asmaloney.github.io/libE57Format-docs/) and changed to a [cleaner theme](https://github.com/jothepro/doxygen-awesome-css).
- Change file creation to use _0666_ permissions on [POSIX](https://en.wikipedia.org/wiki/POSIX) systems. ([FreeCAD#105](asmaloney/libE57Format#105)) (Thanks Nigel!)
- {cmake} [CXX_VISIBILITY_PRESET](https://cmake.org/cmake/help/latest/prop_tgt/LANG_VISIBILITY_PRESET.html) is now set and `ON` by default. ([FreeCAD#104](asmaloney/libE57Format#104)) (Thanks Nigel!)
- A new **E57SimpleWriter** constructor takes a `WriterOptions` struct which allows setting the file's GUID.
  ```cpp
  Writer( const ustring &filePath, const WriterOptions &options );
  ```
  The old constructor taking only `coordinateMetadata` is deprecated and will be removed in the future. ([FreeCAD#96](asmaloney/libE57Format#96)) (Thanks Nigel!)
- Change `E57_DEBUG`, `E57_MAX_DEBUG`, `E57_VERBOSE`, `E57_MAX_VERBOSE`, `E57_WRITE_CRAZY_PACKET_MODE` from **#defines** to cmake options. ([FreeCAD#80](asmaloney/libE57Format#80)) (Thanks Nigel!)

### Fixed

- Fix **E57SimpleWriter**'s writing of invalid quaternions. It now defaults to the identity quaternion. ([FreeCAD#108](asmaloney/libE57Format#108)) (Thanks Nigel!)
- Fix **E57SimpleReader** to handle missing `images2D` and `isAtomicClockReferenced` nodes. ([FreeCAD#90](asmaloney/libE57Format#90)) (Thanks Olli!)
- Fix **BitpackIntegerDecoder** sometimes reading past end of input buffer. ([FreeCAD#87](asmaloney/libE57Format#87)) (Thanks Nigel!)
- Fix compilation when some debug options are set. ([FreeCAD#81](asmaloney/libE57Format#81), [FreeCAD#82](asmaloney/libE57Format#82), [FreeCAD#84](asmaloney/libE57Format#84)) (Thanks Nigel!)
- Fix compilation with [musl libc](https://musl.libc.org/) ([FreeCAD#70](asmaloney/libE57Format#70)) (Thanks Dimitri!)
- Add missing include for [GCC 11](https://gcc.gnu.org/gcc-11/porting_to.html#header-dep-changes) ([FreeCAD#68](asmaloney/libE57Format#68)) (Thanks bartoszek!)

**Note:** The next release will be 3.0 and will require a [C++14](https://en.cppreference.com/w/cpp/14) compiler.
  • Loading branch information
mosfet80 committed Sep 11, 2023
1 parent ebffe55 commit 13805d6
Show file tree
Hide file tree
Showing 154 changed files with 16,739 additions and 13,014 deletions.
155 changes: 151 additions & 4 deletions src/3rdParty/libE57Format/CHANGELOG.md

Large diffs are not rendered by default.

174 changes: 108 additions & 66 deletions src/3rdParty/libE57Format/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#
# Use git blame to see all the changes and who has contributed.
#
# Copyright 2018-2023 Andy Maloney <[email protected]>
# Original work Copyright 2010-2012 Roland Schwarz, Riegl LMS GmbH
# Modified work Copyright 2018-2020 Andy Maloney <[email protected]>
#
# Permission is hereby granted, free of charge, to any person or organization
# obtaining a copy of the software and accompanying documentation covered by
Expand All @@ -28,20 +28,26 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

cmake_minimum_required( VERSION 3.10.0 )
cmake_minimum_required( VERSION 3.15 )

# Set a private module find path
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/" )
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/" )

message( STATUS "Using CMake ${CMAKE_VERSION}" )

project( E57Format
DESCRIPTION
"E57Format is a library to read and write E57 files"
LANGUAGES
CXX
VERSION
2.2.1
3.0.2
)

string( TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE )

# Creates a build tag which is used in the REVISION_ID
# e.g. "x86_64-darwin-AppleClang140"
include( Tags )

# Check if we are building ourself or being included and use this to set some defaults
Expand Down Expand Up @@ -77,90 +83,107 @@ if( BUILD_SHARED_LIBS )
endif()

#########################################################################################

# Various levels of cross checking and verification in the code.
# Cross checking and runtime verification in the code.
# The extra code does not change the file contents.
# Recommend that E57_DEBUG remain defined even for production versions.
# E57_VALIDATION_LEVEL=0 off
# E57_VALIDATION_LEVEL=1 basic
# E57_VALIDATION_LEVEL=2 deep (implies basic) - checks at the packet level, so it will be slower
set( E57_VALIDATION_LEVEL "1" CACHE STRING "Runtime validation level (0 = OFF, 1 = basic, 2 = deep)" )

option( E57_DEBUG "Compile library with minimal debug checking" ON )
option( E57_MAX_DEBUG "Compile library with maximum debug checking" OFF )
# Output detailed logging while processing.
option( E57_VERBOSE "Compile library with verbose logging" OFF )

# Various levels of printing to the console of what is going on in the code.
# Optional

option( E57_VERBOSE "Compile library with verbose logging" OFF )
option( E57_MAX_VERBOSE "Compile library with maximum verbose logging" OFF )
# Enable/disable code which dumps detailed node info to std::ostream. (See NodeImpl::dump())
# Instead of always including this code, it is an option for backwards compatibility.
# The only real reason to turn this off would be for slightly smaller binaries.
option( E57_ENABLE_DIAGNOSTIC_OUTPUT "Include code for diagnostic output using dump() on nodes" ON )

# Enable writing packets that are correct but will stress the reader.

option( E57_WRITE_CRAZY_PACKET_MODE "Compile library to enable reader-stressing packets" OFF )

#########################################################################################
# Other compile options

set( revision_id "${PROJECT_NAME}-${PROJECT_VERSION}-${${PROJECT_NAME}_BUILD_TAG}" )
message( STATUS "[E57] Revison ID: ${revision_id}" )
# Link-time optiomization
# CMake forces "thin" LTO (see https://gitlab.kitware.com/cmake/cmake/-/issues/23136)
# which is a problem if compiling statically for distribution (e.g. in a package manager).
# Generally you will only want to turn this off for distributing static release builds.
option( E57_RELEASE_LTO "Compile release library with link-time optimization" ON )

# Need to explicitly set the source files to add_library()
if(${CMAKE_VERSION} VERSION_LESS "3.11.0")
file(GLOB E57Format_SOURCES src/[^.]*.cpp)
endif()
#########################################################################################

set( REVISION_ID "${PROJECT_NAME}-${PROJECT_VERSION}-${${PROJECT_NAME}_BUILD_TAG}" )
message( STATUS "[${PROJECT_NAME}] Revision ID: ${REVISION_ID}" )

# Target
if ( E57_BUILD_SHARED )
message( STATUS "[E57] Building shared library" )
add_library( E57Format SHARED ${E57Format_SOURCES})
message( STATUS "[${PROJECT_NAME}] Building shared library" )
add_library( E57Format SHARED )
else()
message( STATUS "[E57] Building static library" )
add_library( E57Format STATIC ${E57Format_SOURCES})
message( STATUS "[${PROJECT_NAME}] Building static library" )
add_library( E57Format STATIC )
endif()

include( E57ExportHeader )
include( GitUpdate )

# Main sources and includes
add_subdirectory( extern/CRCpp )
add_subdirectory( include )
add_subdirectory( src )

include( ClangFormat )

# Target properties
set_target_properties( E57Format
PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
DEBUG_POSTFIX "-d"
CXX_EXTENSIONS NO
EXPORT_COMPILE_COMMANDS ON
POSITION_INDEPENDENT_CODE ON
INTERPROCEDURAL_OPTIMIZATION ${E57_RELEASE_LTO}
INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF
)

# Target definitions
target_compile_definitions( E57Format
if( NOT DEFINED CMAKE_DEBUG_POSTFIX )
set_target_properties( E57Format
PROPERTIES
DEBUG_POSTFIX "-d"
)
endif()

target_compile_features( ${PROJECT_NAME}
PRIVATE
CRCPP_USE_CPP11
CRCPP_BRANCHLESS
REVISION_ID="${revision_id}"
cxx_std_14
)

if ( E57_DEBUG )
target_compile_definitions( E57Format PRIVATE E57_DEBUG )
endif()
# Warnings
include( CompilerWarnings )

if ( E57_MAX_DEBUG )
target_compile_definitions( E57Format PRIVATE E57_MAX_DEBUG )
# Treat warnings as errors if we are building ourself.
if ( E57_BUILDING_SELF )
unset( ${PROJECT_NAME_UPPERCASE}_WARNING_AS_ERROR CACHE )
set_warning_as_error()
endif()

if ( E57_VERBOSE )
target_compile_definitions( E57Format PRIVATE E57_VERBOSE )
endif()
# Check our validation level
string( STRIP "${E57_VALIDATION_LEVEL}" E57_VALIDATION_LEVEL )
if ( NOT E57_VALIDATION_LEVEL MATCHES "^[0-2]$" )
message( FATAL_ERROR "[${PROJECT_NAME}] E57_VALIDATION_LEVEL should be 0-2: '${E57_VALIDATION_LEVEL}'" )
else()
message( STATUS "[${PROJECT_NAME}] Setting validation level to ${E57_VALIDATION_LEVEL}" )
endif ()

if ( E57_MAX_VERBOSE )
target_compile_definitions( E57Format PRIVATE E57_MAX_VERBOSE )
endif()
# Target definitions
target_compile_definitions( E57Format
PRIVATE
REVISION_ID="${REVISION_ID}"
E57_VALIDATION_LEVEL=${E57_VALIDATION_LEVEL}
$<$<BOOL:${E57_ENABLE_DIAGNOSTIC_OUTPUT}>:E57_ENABLE_DIAGNOSTIC_OUTPUT>
$<$<BOOL:${E57_VERBOSE}>:E57_VERBOSE>
$<$<BOOL:${E57_WRITE_CRAZY_PACKET_MODE}>:E57_WRITE_CRAZY_PACKET_MODE>
)

if ( E57_WRITE_CRAZY_PACKET_MODE )
target_compile_definitions( E57Format PRIVATE E57_WRITE_CRAZY_PACKET_MODE )
endif()
# sanitizers
include( Sanitizers )

# xerces
if ( WIN32 )
option( USING_STATIC_XERCES "Turn on if you are linking with Xerces as a static lib" OFF )
if ( USING_STATIC_XERCES )
Expand All @@ -180,21 +203,40 @@ install(
E57Format
EXPORT
E57Format-export
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

# ccache
# Turns on ccache if found
include( ccache )

# Formatting
include( ClangFormat )

# Testing
option( E57_BUILD_TEST
"Build tests"
${E57_BUILDING_SELF}
)

if ( E57_BUILD_TEST )
message( STATUS "[${PROJECT_NAME}] Testing enabled" )

enable_testing()

add_subdirectory( test )
endif()

# CMake package files
#install(
# EXPORT
# E57Format-export
# DESTINATION lib/cmake/E57Format
#)

#install(
# FILES
# ${CMAKE_CURRENT_SOURCE_DIR}/cmake/e57format-config.cmake
# DESTINATION
# lib/cmake/E57Format
#)
install(
EXPORT
E57Format-export
DESTINATION
lib/cmake/E57Format
)

install(
FILES
${CMAKE_CURRENT_SOURCE_DIR}/cmake/e57format-config.cmake
DESTINATION
lib/cmake/E57Format
)
28 changes: 22 additions & 6 deletions src/3rdParty/libE57Format/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
# How To Contribute

## Code Changes
These are some of the things you can do to contribute to the project:

## ✍ Write About The Project

If you find the project useful, spread the word! Articles, mastodon posts, tweets, blog posts, instagram photos - whatever you're into. Please include a referral back to the repository page: https://github.com/asmaloney/libE57Format

## ⭐️ Add a Star

If you found this project useful, please consider starring it! It helps me gauge how useful this project is.

## ☝ Raise Issues

If you run into something which doesn't work as expected, raising [an issue](https://github.com/asmaloney/libE57Format/issues) with all the relevant information to reproduce it would be helpful.

## 🐞 Bug Fixes & 🧪 New Things

I am happy to review any [pull requests](https://github.com/asmaloney/libE57Format/pulls). Please keep them as short as possible. Each pull request should be atomic and only address one issue. This helps with the review process.

Note that I will not accept everything, but I welcome discussion. If you are proposing a big change, please raise it as [an issue](https://github.com/asmaloney/libE57Format/issues) first for discussion.

### Formatting

This project uses [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to format the code. There is a cmake target (_format_) - which runs _clang-format_ on the source files. After changes have been made, and before you submit your pull request, please run the following:
This project uses [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to format the code. There is a cmake target (_e57-clang-format_) - which runs _clang-format_ on the source files. After changes have been made, and before you submit your pull request, please run the following:

```sh
cmake --build . --target format
cmake --build . --target e57-clang-format
```

## Documentation
## 📖 Documentation

The [documentation](https://github.com/asmaloney/libE57Format) is a bit old and could use some lovin'. You can submit changes over in the [libE57Format-docs](https://github.com/asmaloney/libE57Format-docs) repository.

## Financial
## 💰 Financial

If you would like to support the project financially, you can use the **Sponsor** button at the top of the [libE57Format](https://github.com/asmaloney/libE57Format) repository page.
Given that I'm an independent developer without funding, financial support is always appreciated. If you would like to support the project financially (especially if you sell a product which uses this library), you can use the [sponsors page](https://github.com/sponsors/asmaloney) for one-off or recurring support. Thank you!
Loading

0 comments on commit 13805d6

Please sign in to comment.