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

Occt7 #158

Closed
wants to merge 65 commits into from
Closed

Occt7 #158

wants to merge 65 commits into from

Conversation

vejmarie
Copy link
Contributor

This Pull request intend to port FreeCAD to OCCT7 and support new SMESH with VTK data structure. This is a hard dependency and it does include a vagrant directory into which FreeCAD.sh provisioning script is used to help compilation and adaptation

Port_Modification.changlog contains major changes required to make FreeCAD works with OCCT 7, VTK 7 and Salome 7.7.1.

@bblacey
Copy link
Contributor

bblacey commented May 20, 2016

@vejmarie - great work porting to OCCT7! To support your efforts, I have worked on the OS X packaging to provide better support. You can read about the details in this forum post but you already know most of it because much was done for the Salome MESH effort.

I was not able to create a pull request against your repo for some reason so here is a patch that you can apply with git apply to incorporate the changes I mentioned in the post to ensure Travis uses OCCT7 instead of OCE6.

Finally, here is the Travis log for the build on the fork of your occt7 branch.

Thanks again for pushing OCCT7!

@vejmarie
Copy link
Contributor Author

Hi Bruce, I just have applied the patch, thanks a lot for it !. Let me check if I can provide you access to the repo.

@vejmarie
Copy link
Contributor Author

@bblacey @ickby I added you as a collaborator on the repo. The branch is occt7

@bblacey
Copy link
Contributor

bblacey commented May 20, 2016

@vejmarie - Thanks. Right now, this PR is a fairly benign change for OS X because we have implemented proper package support. We need to do the same for Linux because most devs use Linux but that is a bit out of my sweet spot - is that something that you are going to tackle as part of this?

@vejmarie
Copy link
Contributor Author

I made some deb files for linux (have a look inside vagrant/FreeCAD.sh). I am using vagrant to generate them on trusty and put them on our community website through echo "deb http://ruggedpod.qyshare.com/Webdav/Public/deb trusty universe" >> /etc/apt/sources.list
I tried to use launchpad, but either I am too old for it (41), or it is too far from travis for me, I never had been able to make work my first PPA. The linux command to do it is a pain. The current deb are not stripped that is why they are huge, but as this is development files, I thought it might be usefull to keep symbol tables with demangling capabilities. I am ready to help improving the packaging.

@bblacey
Copy link
Contributor

bblacey commented May 20, 2016

Thanks. I'm headed to the MakerFaire for the rest of the day so I will have to look at it either tonight or first thing tomorrow PST. @normandc or @sgrogan would be good resources to reach out to for the PPA work.

@vejmarie
Copy link
Contributor Author

Enjoy the MakerFaire, I couldn't do it this year. I'll be in Texas next week. Anyway I am in the bay area really often, (next trip second half of june), might be great to share a coffee if you are there.

@bblacey
Copy link
Contributor

bblacey commented May 20, 2016

So how about installing open cascade from the .deb files instead of building from source?

Coffee second half of June sounds great! I'm in the San Mateo area - where will you be?

@sgrogan
Copy link
Contributor

sgrogan commented May 20, 2016

So how about installing open cascade from the .deb files instead of building from source?
This is what we need to do. No Debian Folder exists to build this (at least I haven't found one) We'll need to create it ourselves. May plan is to try to modifiy the oce one from debian, but NormandC has warned me I may be living in fantasy land.
I'll start some topics in the forum soon. @f3nix is also knowledgeable about this stuff, and I think @jean.thil has build a Debian package on OBS successfully. OBS has broad support Debian, Ubuntu, Fedora, and OpenSuse.
Is VTK 7 a hard dependency? I've added VTK6 to the daily PPA to build ickby's post processing already in master. I'm using VTK7 on Win because I have to build it anyway.
This future stuff should move to the forum though.
GREAT JOB GUYS, I love this team approach! 1+1+1=7

@vejmarie
Copy link
Contributor Author

@sgrogan this what I do within the build currently. I am not sure about the process of creating the deb file, but they work currently. My travis build download them from a repo I setup on my own server (they are not signed). I tried to setup a PPA, but have never been able to launch a compile.

@bblacey
Copy link
Contributor

bblacey commented May 22, 2016

May plan is to try to modifiy the oce one from debian, but NormandC has warned me I may be living in fantasy land.

@sgrogan, I effectively did the same with the opencascade home-brew formula. The material "build" changes between OCCT 6.9.1 and OCCT 7.0 were very small... Basically, added vtk as a dependency, changed some CMAKE defs (mostly rename) and removed options that no longer exist like OpenCL on OS X. Perhaps these diffs will help.

Jean-Marie Verdun and others added 19 commits June 1, 2016 20:59
THIS FILES REQUIRES OCCT 7.0.0 to properly compile do not try with lower version
you won't be successfull at all
Please read Port_Modification.changlog for remaining BUGS. FeM and Mesher do not work yet
due to class declaration changes into OpenCascade
@andrewanswer
Copy link

Hi, I'm interested in merging OCCT7 with FreeCad main branch. I have several complex 3d-models which break FreeCad completely with OCCT exceptions (in modeling process). Hope what your update will fix these problems. When this merge will be done? Want to test these changes immediately.

@vejmarie
Copy link
Contributor Author

Hi Andrew, which O/S r u running ? I might be able to provide you a temporary version compiled for it to check if it fix your issues

@andrewanswer
Copy link

I currently working on Ubuntu 14.04 LTS.

@ianrrees
Copy link
Contributor

Probably a dumb question (I've been out of the FreeCAD loop lately), but what are all these changes actually meant to fix? I ask because I've been using OCC7 for a while now no problem - had been thinking that you guys merged in the OCC7 changes already, and this PR was either stale or about SMESH.

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.7689 +83 (Git)
Build type: Debug
Branch: 20160605-techdraw
Hash: 61310cf7b2fc2e3a9d0e06e4d1cf84473b11530a
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 7.0.0

@bblacey
Copy link
Contributor

bblacey commented Jun 16, 2016

@ianrrees, @vejmarie is the author and best person to respond but I understand this PR is a blend of SMESH, OCCT7 and some linux packaging improvements. @ickby's SMESH branch that includes OCCT6 compatibility and was merged into master probably obviates much of this PR.

That said, @vejmarie found that he had to patch netgen/nglib in order to build OCCT7. I forked homebrew/science and modified your nglib formula to apply his patches - did you have to modify nglib to build with OCCT7?

Finally, while OCCT7 is smooth sailing on OS X, I think @sgrogan is still wrestling with some Windows build issues that may also be holding OCCT7 back.

@vejmarie, are you thinking about rebasing this PR or closing it and opening another OCCT7 only PR? It is probably best to keep the scope limited in a PR to a specific objective/goal such as OCCT7 only.

@ianrrees
Copy link
Contributor

Sorry about the slow response!

I didn't think to try building with nglib and OCC7, so there may well be some work to do there. Main goal was switching my system over to Homebrew. I'll try to figure it out sometime in the next few days.

@bblacey
Copy link
Contributor

bblacey commented Jun 20, 2016

@vejmarie has already done the work. Given you have switched to home-brew, you can do the following to install nglib and occt7.

brew uninstall nglib oce
brew untap homebrew/science && brew tap bblacey/science
brew install occt7
brew install nglib --with-opencascade

See this forum post for additional details

@ianrrees
Copy link
Contributor

Apologies for another slow response. Do you guys have any plans to clean up and then submit a PR for those nglib changes?

@vejmarie
Copy link
Contributor Author

Hi Ian, all,
Sorry for my long delay, I had been busy handling some situation at work. ian, if you clone master currently it should be working straight forward with bblacey repo.

@bblacey
Copy link
Contributor

bblacey commented Jun 27, 2016

Jean Marie! Welcome back! Anyway, about a week ago I had setup a Travis job to build FreeCAD master against OCCT7 using the bblacey repo but it failed with some SMESH compilation issues. The goal was to produce OCCT7 builds on my repo until such time that we can officially support OCCT7 on the FreeCAD master. So, it seems that some of your SMESH changes may not have made it into @ickby's OCCT6-compatibile SMESH PR? Sounds like you are swamped but perhaps you can take a look at the Travis log when you get a chance to see if you see something obvious that I am doing wrong...

@ickby
Copy link
Contributor

ickby commented Jun 28, 2016

I did check the compilation with occ7 once, but not after the latest changes. Could have happend that something went wrong. I add to my list of things to investigate, it should definitely work out with occ7, that is very important. Together with the FEM mesh issues there is quite some clean up still needed after the transition.

@sgrogan
Copy link
Contributor

sgrogan commented Jun 28, 2016

If it adds any insight, I get very similar errors on win
http://forum.freecadweb.org/viewtopic.php?f=4&t=16288

@vejmarie
Copy link
Contributor Author

Hi bblacey, this issue is "simple" to fix. This is coming from the lack of TKCDF library during the link phase. So within FindOpenCascade.cmake just be sure that TKCDF is referenced and you should be good to go. This probably needs an quick update through a PR. can you request for it ?

if(OCC_FOUND)
set(OCC_LIBRARIES
TKFillet
TKMesh
TKernel
TKG2d
TKG3d
TKMath
TKIGES
TKSTL
TKShHealing
TKXSBase
TKBin
TKBool
TKBO
TKCDF
TKBRep
TKTopAlgo
TKGeomAlgo
TKGeomBase
TKOffset
TKPrim
TKSTEP
TKSTEPBase
TKSTEPAttr
TKHLR
TKFeat
)

@bblacey
Copy link
Contributor

bblacey commented Jun 28, 2016

I have added the TKCDF library, regressed it on OCCT6 & 7 and submitted it as a pull request that @wwmayer has already merged it into master. While this PR served as the foundational work for SMESH & OCCT7, it looks like we can abandon this PR, right? Jean Marie, it is your call however we will ultimately need an OCCT7 PR that modifies .travis.yml to pull in the correct dependencies once the OCCT7 build issues are resolved across platforms.

Finally, as an FYI, I am going to re-enable integration builds on my personal repo that will provide macOS builds with OCCT7 until such time OCCT7 becomes the default on FreeCAD master. This is just an FYI in case any of you would like to grab a latest and greatest macOS build against OCCT7.

@vejmarie
Copy link
Contributor Author

hi bblacey, yes I am closing it now. It is becoming useless, congrats to the team for the integration !

@vejmarie vejmarie closed this Jun 28, 2016
@sgrogan
Copy link
Contributor

sgrogan commented Jun 28, 2016

@bblacey
I think there is no reason to wait. If you can pack the OSX bundle just go for it. I'm gonna distribute win with OCCT7 as soon as it works. I'm just working on the packaging for x64. Having and older occ on linux and a newer on OSX on Travis is a good thing.

@bblacey
Copy link
Contributor

bblacey commented Jun 28, 2016

@sgrogan I like your thinking. I will look into that sometime before the end of the week because I need to ensure the pull request and ports-cache are time-congruent. For now, here are the details from a Travis OCCT 7 build on my repo against the latest master.

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.7802 (Git)
Build type: Release
Branch: (detached from 30b279f)
Hash: 30b279fa0ad25eda5883a0db3afc78b6c8d102c8
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 7.0.0

@andrewanswer
Copy link

Hello,

please tell how I can compile freecad under linux with OCCT 7.0? I currently working on Ubuntu 14.04 LTS. As I wrote here #158 (comment) I want to check some 3d-models with OCCT 7.0.

@vejmarie
Copy link
Contributor Author

Sorry I didn't had seen your comment. If you clone the latest master, you will find a directory called vagrant, within that directory you will find a script called FreeCAD.sh which contains "automatic" procedure to compile FreeCAD. It makes some times that I didn't tested it on Trusty, but it is working on Xenial. Normally it should be working on Trusty. Just ping me if you have issues with that. We shall probably switch this to FreeCAD forum.

@andrewanswer
Copy link

I successfully compile and install freecad on Ubuntu 14.04 LTS with only one thing: it inform me about "broken" package:

Lintian check results for /home/andrewanswer/freecad_deb/freecad-0.17_trusty-amd64.deb:
E: FreeCAD: bad-package-name
E: FreeCAD: package-not-lowercase
E: FreeCAD: maintainer-name-missing vejmarie@ruggedpod.qyshare.com
Use of uninitialized value $name in pattern match (m//) at /usr/share/perl5/Lintian/Check.pm line 203.

Some 3d-models was built successfully, but others are not. I use Rhino 5 for NURBS modeling, as alternative, and it helps. I think what some geometry just too complex for BREP OCCT...

@normandc
Copy link

normandc commented Jul 1, 2016

The error message doesn't say broken package, but bad name. Debian rules
only accepts hyphen in package name, not underscore, and only lowercase
letters.
Le 1 juil. 2016 2:47 PM, "Andrew Answer" notifications@github.com a
écrit :

I successfully compile and install freecad on Ubuntu 14.04 LTS with only
one thing: it inform me about "broken" package:

Lintian check results for /home/andrewanswer/freecad_deb/freecad-0.17_trusty-amd64.deb:
E: FreeCAD: bad-package-name
E: FreeCAD: package-not-lowercase
E: FreeCAD: maintainer-name-missing vejmarie@ruggedpod.qyshare.com
Use of uninitialized value $name in pattern match (m//) at /usr/share/perl5/Lintian/Check.pm line 203.

Some 3d-models was built successfully, but others are not. I use Rhino 5
for NURBS modeling, as alternative, and it helps. I think what some
geometry just too complex for BREP OCCT...


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#158 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/ABQL-fK5cVYdjrjNgjj3lXaFUWulIg7mks5qRWDGgaJpZM4IdXrO
.

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

7 participants