From 644a953e8ab97d82fa703634a977355410945651 Mon Sep 17 00:00:00 2001 From: Bozo the Builder Date: Wed, 5 Nov 2025 03:37:16 -0800 Subject: [PATCH] Sync changes from upstream repository --- opennurbs_3dm_attributes.cpp | 2 +- opennurbs_array.h | 50 ++++++++++++++++++++++++++++++++++++ opennurbs_hatch.cpp | 4 +-- opennurbs_mesh.h | 14 ++++++---- opennurbs_model_component.h | 4 +-- opennurbs_public_version.h | 23 ++++++++--------- 6 files changed, 75 insertions(+), 22 deletions(-) diff --git a/opennurbs_3dm_attributes.cpp b/opennurbs_3dm_attributes.cpp index a0ed640b..c6dafe5c 100644 --- a/opennurbs_3dm_attributes.cpp +++ b/opennurbs_3dm_attributes.cpp @@ -227,7 +227,7 @@ bool ON_3dmObjectAttributes::operator==(const ON_3dmObjectAttributes& other) con if ( m_viewport_id != other.m_viewport_id ) return false; - if ( m_dmref != other.m_dmref ) + if (!ON_SimpleArray_IsEqual(m_dmref, other.m_dmref)) return false; if (m_object_frame != other.m_object_frame) diff --git a/opennurbs_array.h b/opennurbs_array.h index d5fef2f9..1adf2907 100644 --- a/opennurbs_array.h +++ b/opennurbs_array.h @@ -380,6 +380,12 @@ public: */ void SetArray(T*, int, int); + //Deleted these two functions because the compiler was actually using pointer + //comparison on m_a. Adding implementations for these in Rhino 8 is cumbersome because + //of the template initialization stuff, so use ON_SimpleArray_IsEqual for now. + bool operator==(const ON_SimpleArray& other) const = delete; + bool operator!=(const ON_SimpleArray& other) const = delete; + protected: // implementation ////////////////////////////////////////////////////// void Move( int /* dest index*/, int /* src index */, int /* element count*/ ); @@ -388,6 +394,24 @@ protected: int m_capacity; // actual length of m_a[] }; +template +bool ON_SimpleArray_IsEqual(const ON_SimpleArray& first, const ON_SimpleArray& second) +{ + if (first.Count() != second.Count()) + return false; + + const int count = first.Count(); + + for (int i = 0; i < count; i++) + { + //Use operator== because it's more common + if (!(first[i] == second[i])) + return false; + } + + return true; +} + //////////////////////////////////////////////////////////////// // @@ -733,6 +757,14 @@ public: */ void SetArray(T*, int, int); + //Deleted these two functions because the compiler was actually using pointer + //comparison on m_a. Adding implementations for these in Rhino 8 is cumbersome because + //of the template initialization stuff, so use ON_ClassArray_IsEqual for now. + bool operator==(const ON_ClassArray& other) const = delete; + bool operator!=(const ON_ClassArray& other) const = delete; + + + protected: // implementation ////////////////////////////////////////////////////// void Move( int /* dest index*/, int /* src index */, int /* element count*/ ); @@ -743,6 +775,24 @@ protected: int m_capacity; // actual length of m_a[] }; +template +bool ON_ClassArray_IsEqual(const ON_ClassArray& first, const ON_ClassArray& second) +{ + if (first.Count() != second.Count()) + return false; + + const int count = first.Count(); + + for (int i = 0; i < count; i++) + { + //Use operator== because it's more common + if (!(first[i] == second[i])) + return false; + } + + return true; +} + #if defined(ON_DLL_TEMPLATE) ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray; diff --git a/opennurbs_hatch.cpp b/opennurbs_hatch.cpp index a3972584..25c6a26d 100644 --- a/opennurbs_hatch.cpp +++ b/opennurbs_hatch.cpp @@ -231,7 +231,7 @@ bool ON_HatchLine::operator==(const ON_HatchLine& src) const m_angle_radians == src.m_angle_radians && m_base == src.m_base && m_offset == src.m_offset - && m_dashes == src.m_dashes + && ON_SimpleArray_IsEqual(m_dashes, src.m_dashes) ); } @@ -241,7 +241,7 @@ bool ON_HatchLine::operator!=(const ON_HatchLine& src) const m_angle_radians != src.m_angle_radians || m_base != src.m_base || m_offset != src.m_offset - || m_dashes != src.m_dashes + || !ON_SimpleArray_IsEqual(m_dashes, src.m_dashes) ); } diff --git a/opennurbs_mesh.h b/opennurbs_mesh.h index a749b36f..c13ba909 100644 --- a/opennurbs_mesh.h +++ b/opennurbs_mesh.h @@ -5208,21 +5208,25 @@ Returns: bool HasSinglePrecisionVertices() const; - /* Description: - If you modify the values of double precision vertices, - then you must call UpdateSinglePrecisionVertices(). + Copies the values of the double precision vertices array to the + single precision array. + If you modify the values of double precision vertices only, + then you must call UpdateSinglePrecisionVertices(). Remarks: If double precision vertices are not present, this function - does nothing. + empties the single precision vertices array. */ void UpdateSinglePrecisionVertices(); /* Description: + Copies the values of the single precision vertices array to the + double precision array. If you modify the values of the single precision vertices - in m_V[], then you must call UpdateDoublePrecisionVertices(). + in m_V[], and double precision vertices are present, + then you must call UpdateDoublePrecisionVertices(). Remarks: If double precision vertices are not present, this function creates them. diff --git a/opennurbs_model_component.h b/opennurbs_model_component.h index 6d397a66..e29ad9af 100644 --- a/opennurbs_model_component.h +++ b/opennurbs_model_component.h @@ -1659,12 +1659,12 @@ private: unsigned int m_reserved4 = 0; }; -bool operator==( +ON_DECL bool operator==( const ON_ModelComponentContentMark& lhs, const ON_ModelComponentContentMark& rhs ); -bool operator!=( +ON_DECL bool operator!=( const ON_ModelComponentContentMark& lhs, const ON_ModelComponentContentMark& rhs ); diff --git a/opennurbs_public_version.h b/opennurbs_public_version.h index 47e2030a..9dd43ad7 100644 --- a/opennurbs_public_version.h +++ b/opennurbs_public_version.h @@ -6,7 +6,7 @@ // To update version numbers, edit ..\build\build_dates.msbuild #define RMA_VERSION_MAJOR 8 -#define RMA_VERSION_MINOR 21 +#define RMA_VERSION_MINOR 24 //////////////////////////////////////////////////////////////// // @@ -14,9 +14,9 @@ // first step in each build. // #define RMA_VERSION_YEAR 2025 -#define RMA_VERSION_MONTH 7 -#define RMA_VERSION_DATE 7 -#define RMA_VERSION_HOUR 17 +#define RMA_VERSION_MONTH 10 +#define RMA_VERSION_DATE 8 +#define RMA_VERSION_HOUR 15 #define RMA_VERSION_MINUTE 0 //////////////////////////////////////////////////////////////// @@ -35,8 +35,8 @@ // 3 = build system release build #define RMA_VERSION_BRANCH 0 -#define VERSION_WITH_COMMAS 8,21,25188,17000 -#define VERSION_WITH_PERIODS 8.21.25188.17000 +#define VERSION_WITH_COMMAS 8,24,25281,15000 +#define VERSION_WITH_PERIODS 8.24.25281.15000 #define COPYRIGHT "Copyright (C) 1993-2025, Robert McNeel & Associates. All Rights Reserved." #define SPECIAL_BUILD_DESCRIPTION "Public OpenNURBS C++ 3dm file IO library." @@ -44,14 +44,13 @@ #define RMA_VERSION_NUMBER_MAJOR_WSTRING L"8" #define RMA_PREVIOUS_VERSION_NUMBER_MAJOR_WSTRING L"7" -#define RMA_VERSION_NUMBER_SR_STRING "SR21" -#define RMA_VERSION_NUMBER_SR_WSTRING L"SR21" +#define RMA_VERSION_NUMBER_SR_STRING "SR24" +#define RMA_VERSION_NUMBER_SR_WSTRING L"SR24" + +#define RMA_VERSION_WITH_PERIODS_STRING "8.24.25281.15000" +#define RMA_VERSION_WITH_PERIODS_WSTRING L"8.24.25281.15000" -#define RMA_VERSION_WITH_PERIODS_STRING "8.21.25188.17000" -#define RMA_VERSION_WITH_PERIODS_WSTRING L"8.21.25188.17000" -#define RMA_VERSION_WITH_PERIODS_STRING "8.20.25157.13000" -#define RMA_VERSION_WITH_PERIODS_WSTRING L"8.20.25157.13000" // git revision SHA-1 hash as char hexadecimal string #define RMA_GIT_REVISION_HASH_STRING ""