Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find Netgen/nglib on MacOS with MacPorts #96

Closed
wants to merge 1 commit into from

Conversation

ianrrees
Copy link
Contributor

This should allow for building in netgen support on Macs using MacPorts, assuming the ticket at https://trac.macports.org/ticket/50687 is accepted. It's not intended to change any behaviour unless MACPORTS_PREFIX is defined.

@peterl94 - Let me know if you run into problems making up a Homebrew recipe. I ended up making the MacPorts port just copy the entire libsrc directory to the MacPorts equivalent of /share/netgen/libsrc .

@peterlama
Copy link
Contributor

Great! I'm a bit curious why there are multiple libraries? Seems like there was only one shared library last time I built it on a mac, maybe I'm confusing that with windows. Also, /share/netgen/libsrc is a debian thing. I guess maybe it is because the libsrc headers weren't meant to be public headers, but putting them in /share seems wrong to me. It looks like the fedora package puts them /usr/include/netgen-mesher/private, same level as nglib.h. Anyway, not saying it is worth changing, just I personally find the debian choice strange.

@ianrrees
Copy link
Contributor Author

The extra libraries are there because I ran into missing symbols when linking FreeCAD against just the one library. I started modifying the Netgen source to fix the exports, but then realised that it was just putting the 'missing' objects in those additional libraries. I didn't want to change the Netgen source too much since there was already a Netgen Portfile in MacPorts (for the application but not nglib), and it was starting to seem like more work, but either way is probably possible.

Agree that /share seems a bit weird, but in a way it fits because the Netgen #include scheme is also a bit weird ;). I was just following what the FreeCAD cmake file appeared to have done before, but am not attached to using that directory.

@peterlama
Copy link
Contributor

Ah, makes sense. Now I know the cause of the missing symbols.

One more thing (not related to this patch), are you copying everything in the libsrc folder? I remember only copying *.h and *.hpp for the windows lib pack.

@ianrrees
Copy link
Contributor Author

Hmm, well let's just say it's not copying anything but headers now :). I'm just doing a quick test and will submit a new patch and also move the headers into include/netgen . Thanks for catching that!

@ianrrees ianrrees force-pushed the 20160221-netgen-macports branch 3 times, most recently from 0d2dee3 to 1190eca Compare March 5, 2016 05:39
@ianrrees
Copy link
Contributor Author

@peterl94 Sorry I haven't had any time to work on the Homebrew side of this in a ~week.

If you get some time, mind having a look at this PR in conjunction with https://github.com/ianrrees/homebrew-science/tree/20160320-add-nglib ?

Edit: Updated URL (and fixed a couple things about the formula)

@peterlama
Copy link
Contributor

I won't be able to try it until Sunday. So far it looks fine to me.

@ianrrees
Copy link
Contributor Author

Sounds good, no rush! I finally got a formula for nglib to work, pass the audits, and pass the Homebrew CI stuff - https://github.com/Homebrew/homebrew-science/pull/3455 . Had a bunch of headaches with line endings in the netgen source code making patches difficult, but think the current version should work OK unless people want to use old opencascade versions for some reason.

@wwmayer
Copy link
Contributor

wwmayer commented Mar 22, 2016

I have tested it on Ubuntu 12.04, Ubuntu 14.04 and Windows and there it works fine.
However, on OSX when using netgen 4.9.13 it does not work.
The version 4.9.13 only creates a single shared library "libnglib.dylib" so it would suffice to offer only one entry in the CMake settings. However, it also works to set all entries to the same library.

But the real problem then appears when trying to build the netgen plugin of the smesh sources. Here I get a compiler error:
NETGENPlugin_Mesher.cpp:694:28: error: too many arguments to function call, expected 0, have 1
which happens because the preprocessor macro NETGEN_V5 is set.

When using netgen 5.1 instead then everything works fine, too.

IMO, both netgen versions should be supported because on Windows and Ubuntu the default version is also 4.9.13 IIRC. If it's too complicated for cmake to automatically find the used netgen version then I think it is OK to make an option and let the user decide if it's version 4.9.x or 5.x.

@wwmayer
Copy link
Contributor

wwmayer commented Mar 22, 2016

Two more remarks:
IMO it's plain wrong to add any entries to ADD_DEFINITIONS inside the FindNetgen file. The proper way is to set it to a variable and let the programmer add this variable to ADD_DEFINITIONS where needed.
It can be done like this:
SET(NETGEN_DEFINITIONS "-DNETGEN_V5")
...
ADD_DEFINITIONS(${NETGEN_DEFINITIONS})

Second remark:
This was already wrong in the original file. Preprocessor macros must not be added to the list NETGEN_INCLUDE_DIRS which you then add to include_directories() because this may easily fail with future cmake versions. The correct way is to add them to the variable NETGEN_DEFINITIONS.

@ianrrees
Copy link
Contributor Author

Thanks for looking at this Werner, I'll make some changes soon.

Where did you find the netgen 4.9.13 library? I'm thinking that you must have gotten it from outside of Homebrew/MacPorts, so the approach I'd be tempted to use for determining whether it's version 5 or not wouldn't work in your case.

Still haven't heard back regarding the Homebrew or MacPorts scripts to install nglib. But, since we can host the Homebrew formula on a separate github (I'm doing that already), we could make use of these changes as soon as they're merged into FreeCAD.

@wwmayer
Copy link
Contributor

wwmayer commented Mar 22, 2016

Where did you find the netgen 4.9.13 library?

It was definitely outside from MacPorts/HomeBrew. IIRC it was from taken from Sourceforge.
Anyway, if it's too difficult or too much work to support 4.9 then just leave it since I got it already working with 5 (also self-compiled). Since there is now also a MacPorts/HomeBrew recipe I can switch to that.

Nevertheless, it would be cool if you could fix the other two issues.

@@ -57,7 +57,9 @@
namespace nglib {
#include <nglib.h>
}
#define OCCGEOMETRY
#ifndef OCCGEOMETRY
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes compile warning.

@ianrrees
Copy link
Contributor Author

I've made some quick edits to implement those changes - only tested on my MacPorts system so far.

Didn't get a chance to look into detecting the netgen version, but we'll almost certainly need to do some more work in this area whenever we are using nglib >5 so could address it then. FWIW, it looks like that -DNETGEN_V5 is used for the WIN32 target in the salome CMakeLists.txt

${OCC_OCAF_DEBUG_LIBRARIES}
${OCC_OCAF_LIBRARIES}
)
ADD_DEFINITIONS(${NETGEN_DEFINITIONS})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my OCD made me clean up the tabs...

@ianrrees
Copy link
Contributor Author

@wwmayer - the nglib recipe has been merged in to homebrew-science, so if you and @peterl94 are OK with the changes here, could we pull this in to master before 0.16? -Ian-

@wwmayer
Copy link
Contributor

wwmayer commented Mar 28, 2016

Works well on Ubuntu and Windows using netgen 4.9.13. Merged now.

@wwmayer wwmayer closed this Mar 28, 2016
@ianrrees
Copy link
Contributor Author

Thanks Werner!

@bblacey - Next step with this is to add nglib (--with-oce or --with-opencascade depending on which we're using) to the homebrew dependencies, and -DBUILD_FEM_NETGEN=1 to the cmake args.

@bblacey
Copy link
Contributor

bblacey commented Mar 28, 2016

Cool! I will take are of enabling this in the build integration today/tonight. I'm sure the OS X community will appreciate your efforts to close another OS X gap.

That said, the logic here seems a bit convoluted given netgen/nglib mesher support across platforms. Currently, it is:

  1. Turn on FEM by default (all platforms)
  2. Turn on FEM for Windows (why?)
  3. If not Windows, turn NETGEN mesher off

Shouldn't this coalesce to:

  1. Turn on FEM (for all) by default. (provide override to turn FEM off)
  2. If FEM on, enable NETGEN mesher

IMHO, you should be able to build out-of-the-box with default options. While it is manageable on Travis, it is harder for NOOBs who come along and want to bootstrap and environment to contribute (reduce/eliminate the "Sherlock Holming" they would need to do in order to achieve local build parity with downloaded build/PPA)

@sgrogan
Copy link
Contributor

sgrogan commented Mar 28, 2016

I think.
At the start FEM worked windows only. Then FEM worked on all platforms, but without netgen support.
At present netgen support works out of the box on windows using the FreeCAD provided libpack.
Hopefully ian's work makes netgen support work out of the box on Mac.
On linux netgen support is still sketchy. Works for ubuntu using the netgen headers and oce from the FreeCAD PPA but not for the default nglib and oce from the Ubuntu repos.
This is a tough nut to crack. The nglib library(s) seem to be differently named and installed for different versions and different distros, and nglib depends on the oce version.
TLDR

  1. I think this is correct
  2. I think this is probably redundant, I'll try to confirm
  3. Should be if linux NETGEN off

for coalesce

  1. Should be possible now
  2. As wmayer has pointed out in the past, we need a smart (call it genius) cmake to work this out for linux especially, but for anyone on windows not using the libpacks or on mac not using ian's work.

@ianrrees
Copy link
Contributor Author

I like the idea of having the default options produce something like the nightly downloads too, but more importantly align with the compile instructions on the wiki (I'll update the Mac ones to reflect these changes soon).

Would personally prefer to have a few more people confirm the BUILD_FEM_NETGEN works OK on MacOS before enabling it by default, but would be nice to have that default set by 0.16 too...

@bblacey
Copy link
Contributor

bblacey commented Mar 29, 2016

Ok, I have integrated the netgen/nglib into the integration branch on my forked repo (also into the FreeCAD/FreeCAD-ports-cache. Barring any unforeseens, Travis should crank out build 6669 under the Releases section of the forked repo - feel free to take it for a spin.

@ianrrees ianrrees deleted the 20160221-netgen-macports branch April 18, 2016 21:46
ipatch pushed a commit to ipatch/FreeCAD that referenced this pull request Apr 28, 2021
ipatch pushed a commit to ipatch/FreeCAD that referenced this pull request Apr 28, 2021
mosfet80 added a commit to mosfet80/FreeCAD that referenced this pull request Sep 11, 2023
## 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.
mosfet80 added a commit to mosfet80/FreeCAD that referenced this pull request Sep 11, 2023
## 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.
mosfet80 added a commit to mosfet80/FreeCAD that referenced this pull request Sep 11, 2023
## 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.
ebffe5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants