From d49e422a37c900ba1af21e624d05b01b52ae5ec5 Mon Sep 17 00:00:00 2001 From: Bozo The Builder Date: Thu, 3 Mar 2022 02:40:57 -0800 Subject: [PATCH] Sync changes from upstream repository Co-authored-by: Jussi Aaltonen Co-authored-by: piac Co-authored-by: Steve Baer --- opennurbs_3dm_settings.cpp | 2 +- opennurbs_archive_manifest.cpp | 2 +- opennurbs_extensions.h | 16 +-- opennurbs_hatch.cpp | 6 - opennurbs_hatch.h | 2 - opennurbs_material.cpp | 193 +++++++++++++++++++++++++++++++ opennurbs_mesh_ngon.cpp | 2 +- opennurbs_public_version.h | 20 ++-- opennurbs_statics.cpp | 204 ++++++++++++++++----------------- opennurbs_string_value.h | 2 +- opennurbs_subd.cpp | 4 +- opennurbs_subd_fragment.cpp | 2 +- opennurbs_subd_frommesh.cpp | 2 +- opennurbs_system_compiler.h | 60 ---------- opennurbs_wip.h | 1 - 15 files changed, 321 insertions(+), 197 deletions(-) diff --git a/opennurbs_3dm_settings.cpp b/opennurbs_3dm_settings.cpp index 1eaaca66..0d34f717 100644 --- a/opennurbs_3dm_settings.cpp +++ b/opennurbs_3dm_settings.cpp @@ -5564,7 +5564,7 @@ void ON_3dmSettings::Dump( ON_TextLog& dump ) const // ON_3dmAnimationProperties // -const ON_3dmAnimationProperties ON_3dmAnimationProperties::Default ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_3dmAnimationProperties); +const ON_3dmAnimationProperties ON_3dmAnimationProperties::Default; bool ON_3dmAnimationProperties::Read(ON_BinaryArchive& archive) { diff --git a/opennurbs_archive_manifest.cpp b/opennurbs_archive_manifest.cpp index a3942aad..a1ea3e32 100644 --- a/opennurbs_archive_manifest.cpp +++ b/opennurbs_archive_manifest.cpp @@ -2540,7 +2540,7 @@ void ON_ComponentManifestItem::Internal_SetDeletedState( //// unsigned int m_manifest_index = ON_ComponentManifest::UnsetManifestItemIndex; ////}; //// -////const ON_ModelComponentIndexChange ON_ModelComponentIndexChange::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_ModelComponentIndexChange); +////const ON_ModelComponentIndexChange ON_ModelComponentIndexChange::Unset; //// ////ON_ModelComponentIndexChange::ON_ModelComponentIndexChange( //// int original_index, diff --git a/opennurbs_extensions.h b/opennurbs_extensions.h index 5543974e..bf236e59 100644 --- a/opennurbs_extensions.h +++ b/opennurbs_extensions.h @@ -2065,18 +2065,18 @@ public: std::shared_ptr ReadWriteReadModel() const; - private: - ONX_ModelTest::Type m_test_type = ONX_ModelTest::Type::Unset; +private: + ONX_ModelTest::Type m_test_type = ONX_ModelTest::Type::Unset; - ON_wString m_source_3dm_file_path; + ON_wString m_source_3dm_file_path; - // if set, used when printing the name of m_source_3dm_file_path in the text - // log so results from different computers can be compared. - ON_wString m_text_log_3dm_file_path; + // if set, used when printing the name of m_source_3dm_file_path in the text + // log so results from different computers can be compared. + ON_wString m_text_log_3dm_file_path; - unsigned int m_model_3dm_file_version[3]; + unsigned int m_model_3dm_file_version[3] = {0}; - unsigned int m_current_test_index = 0; + unsigned int m_current_test_index = 0; ONX_ModelTest::Result m_test_result = ONX_ModelTest::Result::Unset; ONX_ModelTest::Result m_test_results[7] = {}; diff --git a/opennurbs_hatch.cpp b/opennurbs_hatch.cpp index b94a4581..2a22d6df 100644 --- a/opennurbs_hatch.cpp +++ b/opennurbs_hatch.cpp @@ -2057,10 +2057,6 @@ ON_CurveRegionBoundaryElement& ON_CurveRegionBoundaryElement::operator=(const ON return *this; } - -#if defined(OPENNURBS_GRADIENT_WIP) - - class ON_CLASS ON_GradientColorData : public ON_UserData { ON_OBJECT_DECLARE(ON_GradientColorData); @@ -2406,5 +2402,3 @@ bool ON_Hatch::SetGradientEndPoints(ON_3dPoint startpoint, ON_3dPoint endpoint) data->m_end = endpoint; return true; } - -#endif diff --git a/opennurbs_hatch.h b/opennurbs_hatch.h index bbf34f59..05b6f7fb 100644 --- a/opennurbs_hatch.h +++ b/opennurbs_hatch.h @@ -883,7 +883,6 @@ public: */ bool ReplaceLoops(ON_SimpleArray& loops); -#if defined(OPENNURBS_GRADIENT_WIP) /* Description: Returns gradient fill type for this hatch @@ -939,7 +938,6 @@ public: Set the start and end points for gradient drawing */ bool SetGradientEndPoints(ON_3dPoint startpoint, ON_3dPoint endPoint); -#endif private: ON_Plane m_plane; diff --git a/opennurbs_material.cpp b/opennurbs_material.cpp index 4c78dab2..ee17db12 100644 --- a/opennurbs_material.cpp +++ b/opennurbs_material.cpp @@ -3525,6 +3525,48 @@ int ON_TextureMapping::EvaluateBoxMapping( } +static bool ProjectToFaceSpace(const ON_3dPoint & ptV0, const ON_3dPoint & ptV1, const ON_3dPoint & ptV2, const ON_3dPoint & ptP, double & xOut, double & yOut) +{ + const double m00 = (ptV1 - ptV0).LengthSquared(); + const double m01 = ON_DotProduct(ptV1 - ptV0, ptV2 - ptV0); + const double d0 = ON_DotProduct(ptP - ptV0, ptV1 - ptV0); + const double m10 = m01; + const double m11 = (ptV2 - ptV0).LengthSquared(); + const double d1 = ON_DotProduct(ptP - ptV0, ptV2 - ptV0); + double pivot_ratio = 0.0; + + if (2 == ON_Solve2x2(m00, m01, m10, m11, d0, d1, &xOut, &yOut, &pivot_ratio)) + { + if (pivot_ratio < 0.01) + { + const ON_3dPoint ptProjection = ptV0 + xOut * (ptV1 - ptV0) + yOut * (ptV2 - ptV0); + + ON_3dVector vtOffsetDir = ptP - ptProjection; + + const double offsetLength = vtOffsetDir.LengthAndUnitize(); + if (offsetLength < 1e-12) + return true; + + ON_3dVector vtPlaneNormal = ON_CrossProduct(ptV2 - ptV0, ptV2 - ptV1); + + if (false == vtPlaneNormal.Unitize()) + return false; + + const double dOffsetDirDotPlaneNormal = ON_DotProduct(vtPlaneNormal, vtOffsetDir); + + if (-0.99 < dOffsetDirDotPlaneNormal && + dOffsetDirDotPlaneNormal < 0.99) + return false; + } + + return true; + + } + + return false; +} + + int ON_TextureMapping::Evaluate( const ON_3dPoint& P, const ON_3dVector& N, @@ -3923,6 +3965,111 @@ bool GetSPTCHelper( return true; } +#if !defined(OPENNURBS_PLUS) +class ON__MTCBDATA +{ + // DO NOT PUT THIS CLASS IN A HEADER FILE + // IT IS A PRIVATE HELPER CLASS. +public: + const ON_Mesh* m_pMesh; + ON_3dPoint m_pt; + ON_RTreeSphere m_sphere; + int m_face_index; + double m_t[4]; + double m_dist; + bool m_bRestart; +}; + +bool ON_CALLBACK_CDECL MTCB(void* a_context, ON__INT_PTR a_id) +{ + ON__MTCBDATA* pData = (ON__MTCBDATA*)a_context; + if (nullptr == pData) + return true; + pData->m_bRestart = false; + const int fi = (int)a_id; + if (fi < 0 || fi >= pData->m_pMesh->m_F.Count()) + return true; + const ON_MeshFace& face = pData->m_pMesh->m_F[fi]; + const int fcc = face.IsTriangle() ? 3 : 4; + for (int fci = 0; fci < fcc; fci++) + { + // Distance to vertex at corner fci + const ON_3dPoint ptV = pData->m_pMesh->Vertex(face.vi[fci]); + const double distV = ptV.DistanceTo(pData->m_pt); + if (distV < pData->m_dist) + { + pData->m_dist = distV; + pData->m_face_index = fi; + pData->m_t[0] = pData->m_t[1] = pData->m_t[2] = pData->m_t[3] = 0.0; + pData->m_t[fci] = 1.0; + } + + // Distance to edge between corners fci-1 and fci + const int fcip = (fci + fcc - 1) % fcc; + const ON_3dPoint ptPV = pData->m_pMesh->Vertex(face.vi[fcip]); + ON_Line edge(ptPV, ptV); + double t = 0.0; + if (edge.ClosestPointTo(pData->m_pt, &t)) + { + if (t >= 0.0 && t <= 1.0) + { + const ON_3dPoint ptE = edge.PointAt(t); + const double distE = ptE.DistanceTo(pData->m_pt); + if (distE < pData->m_dist) + { + pData->m_dist = distE; + pData->m_face_index = fi; + pData->m_t[0] = pData->m_t[1] = pData->m_t[2] = pData->m_t[3] = 0.0; + pData->m_t[fci] = t; + pData->m_t[fcip] = 1.0 - t; + } + } + } + } + + int tris = 1; + ON_3dex fcis[2] = { {0, 1, 2}, ON_3dex::Unset }; + //int fcis[2][3] = {{0, 1, 2}, {ON_UNSET_INT_INDEX, ON_UNSET_INT_INDEX, ON_UNSET_INT_INDEX}}; + if (face.IsQuad()) + { + fcis[1] = { 0, 3, 2 }; + tris = 2; + } + + for (int ti = 0; ti < tris; ti++) + { + const int vis[3] = { face.vi[fcis[ti].i] , face.vi[fcis[ti].j], face.vi[fcis[ti].k] }; + const ON_3dPoint pts[3] = { pData->m_pMesh->Vertex(vis[0]), pData->m_pMesh->Vertex(vis[1]), pData->m_pMesh->Vertex(vis[2]) }; + double t0 = 0.0, t1 = 0.0; + if (ProjectToFaceSpace(pts[0], pts[1], pts[2], pData->m_pt, t0, t1)) + { + if (0 <= t0 && 0 <= t1 && t0 + t1 <= 1.0) + { + const ON_3dPoint ptF = pts[0] + t0 * (pts[1] - pts[0]) + t1 * (pts[2] - pts[0]); + const double distF = ptF.DistanceTo(pData->m_pt); + if (distF < pData->m_dist) + { + pData->m_dist = distF; + pData->m_face_index = fi; + pData->m_t[0] = pData->m_t[1] = pData->m_t[2] = pData->m_t[3] = 0.0; + pData->m_t[fcis[ti].i] = 1.0 - t0 - t1; + pData->m_t[fcis[ti].j] = t0; + pData->m_t[fcis[ti].k] = t1; + } + } + } + } + + if (pData->m_dist < pData->m_sphere.m_radius) + { + pData->m_sphere.m_radius = pData->m_dist; + pData->m_bRestart = true; + return false; + } + + return true; +} +#endif bool ON_TextureMapping::GetTextureCoordinates( const ON_Mesh& mesh, @@ -4033,6 +4180,52 @@ bool ON_TextureMapping::GetTextureCoordinates( && nullptr != m_mapping_primitive) { rc = false; + if (ON_TextureMapping::TYPE::mesh_mapping_primitive == m_type) + { + const ON_Xform matP = nullptr != PT ? m_Pxyz * ON_Xform(PT) : m_Pxyz; + const ON_Xform matN = nullptr != NT ? m_Nxyz * ON_Xform(NT) : m_Nxyz; + + const ON_Mesh* pMesh = CustomMappingMeshPrimitive(); + if (nullptr != pMesh) + { + ON_RTree faceTree; + if (faceTree.CreateMeshFaceTree(pMesh)) + { + for (int vi = 0; vi < mesh.VertexCount(); vi++) + { + T[vi] = ON_3fPoint::Origin; + + const ON_3dPoint vtx(mesh.m_V[vi]); + const ON_3dPoint ptV = matP * vtx; + const ON_3fVector vtVN = mesh.HasVertexNormals() ? ON_3fVector(matN * ON_3dVector(mesh.m_N[vi])) : ON_3fVector::ZeroVector; + + ON__MTCBDATA data; + data.m_sphere.m_point[0] = ptV.x; + data.m_sphere.m_point[1] = ptV.y; + data.m_sphere.m_point[2] = ptV.z; + data.m_sphere.m_radius = pMesh->BoundingBox().FarPoint(ptV).DistanceTo(ptV); + data.m_pMesh = pMesh; + data.m_pt = ptV; + data.m_dist = DBL_MAX; + do + { + faceTree.Search(&data.m_sphere, MTCB, (void*)&data); + } while (data.m_bRestart); + if (0 <= data.m_face_index && data.m_face_index < pMesh->m_F.Count()) + { + const ON_MeshFace& face = pMesh->m_F[data.m_face_index]; + const ON_3dPoint ptUV = + data.m_t[0] * ON_3dPoint(pMesh->m_T[face.vi[0]]) + + data.m_t[1] * ON_3dPoint(pMesh->m_T[face.vi[1]]) + + data.m_t[2] * ON_3dPoint(pMesh->m_T[face.vi[2]]) + + data.m_t[3] * ON_3dPoint(pMesh->m_T[face.vi[3]]); + const ON_3dPoint vtc = m_uvw * ptUV; + T[vi].Set((float)vtc.x, (float)vtc.y, 0.0f); + } + } + } + } + } } else if ( mesh_N && ( ON_TextureMapping::PROJECTION::ray_projection == m_projection diff --git a/opennurbs_mesh_ngon.cpp b/opennurbs_mesh_ngon.cpp index ac80123b..3b2ba1ae 100644 --- a/opennurbs_mesh_ngon.cpp +++ b/opennurbs_mesh_ngon.cpp @@ -5241,7 +5241,7 @@ ON_Plane ON_Plane::FromPointList( -const ON_MeshNgonIterator ON_MeshNgonIterator::EmptyMeshNgonIterator ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_MeshNgonIterator); +const ON_MeshNgonIterator ON_MeshNgonIterator::EmptyMeshNgonIterator; ON_MeshNgonIterator::ON_MeshNgonIterator( const class ON_Mesh* mesh diff --git a/opennurbs_public_version.h b/opennurbs_public_version.h index 1665b68c..7ba39653 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 7 -#define RMA_VERSION_MINOR 14 +#define RMA_VERSION_MINOR 15 //////////////////////////////////////////////////////////////// // @@ -14,9 +14,9 @@ // first step in each build. // #define RMA_VERSION_YEAR 2022 -#define RMA_VERSION_MONTH 1 -#define RMA_VERSION_DATE 10 -#define RMA_VERSION_HOUR 17 +#define RMA_VERSION_MONTH 2 +#define RMA_VERSION_DATE 8 +#define RMA_VERSION_HOUR 13 #define RMA_VERSION_MINUTE 0 //////////////////////////////////////////////////////////////// @@ -35,8 +35,8 @@ // 3 = build system release build #define RMA_VERSION_BRANCH 0 -#define VERSION_WITH_COMMAS 7,14,22010,17000 -#define VERSION_WITH_PERIODS 7.14.22010.17000 +#define VERSION_WITH_COMMAS 7,15,22039,13000 +#define VERSION_WITH_PERIODS 7.15.22039.13000 #define COPYRIGHT "Copyright (C) 1993-2022, Robert McNeel & Associates. All Rights Reserved." #define SPECIAL_BUILD_DESCRIPTION "Public OpenNURBS C++ 3dm file IO library." @@ -44,11 +44,11 @@ #define RMA_VERSION_NUMBER_MAJOR_WSTRING L"7" #define RMA_PREVIOUS_VERSION_NUMBER_MAJOR_WSTRING L"6" -#define RMA_VERSION_NUMBER_SR_STRING "SR14" -#define RMA_VERSION_NUMBER_SR_WSTRING L"SR14" +#define RMA_VERSION_NUMBER_SR_STRING "SR15" +#define RMA_VERSION_NUMBER_SR_WSTRING L"SR15" -#define RMA_VERSION_WITH_PERIODS_STRING "7.14.22010.17000" -#define RMA_VERSION_WITH_PERIODS_WSTRING L"7.14.22010.17000" +#define RMA_VERSION_WITH_PERIODS_STRING "7.15.22039.13000" +#define RMA_VERSION_WITH_PERIODS_WSTRING L"7.15.22039.13000" diff --git a/opennurbs_statics.cpp b/opennurbs_statics.cpp index bc23eb8f..ed80b8c5 100644 --- a/opennurbs_statics.cpp +++ b/opennurbs_statics.cpp @@ -20,7 +20,7 @@ #pragma ON_PRAGMA_WARNING_POP #endif -const ON_ErrorEvent ON_ErrorEvent::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_ErrorEvent); +const ON_ErrorEvent ON_ErrorEvent::Unset; static unsigned int ON_LibraryStatusInit() { @@ -121,7 +121,7 @@ const double ON_SubDExpandEdgesParameters::MediumOffset = 0.25; const double ON_SubDExpandEdgesParameters::LargeOffset = 0.5; -const ON_SubDExpandEdgesParameters ON_SubDExpandEdgesParameters::Default ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDExpandEdgesParameters); +const ON_SubDExpandEdgesParameters ON_SubDExpandEdgesParameters::Default; const ON_SubDComponentLocation ON_SubD::DefaultSubDAppearance = ON_SubDComponentLocation::Surface; @@ -132,10 +132,10 @@ const ON_SubDTextureCoordinateType ON_SubD::DefaultTextureCoordinateType = ON_Su const double ON_SubDSectorType::MinimumCornerAngleRadians = (2.0*ON_PI)/((double)(ON_SubDSectorType::MaximumCornerAngleIndex)); const double ON_SubDSectorType::MaximumCornerAngleRadians = 2.0*ON_PI - ON_SubDSectorType::MinimumCornerAngleRadians; -const ON_SubDSectorId ON_SubDSectorId::Zero ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDSectorId); +const ON_SubDSectorId ON_SubDSectorId::Zero; const ON_SubDSectorId ON_SubDSectorId::Invalid = ON_SubDSectorId::Create(nullptr, nullptr); -const ON_SubDHash ON_SubDHash::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDHash); +const ON_SubDHash ON_SubDHash::Empty; // {C3D8DD54-F8C8-4455-BB0E-2A2F4988EC81} @@ -160,12 +160,12 @@ const ON_SubDToBrepParameters Internal_SubDToBrepParameters(bool bPackedFaces) return p; } -const ON_SubDToBrepParameters ON_SubDToBrepParameters::Default ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDToBrepParameters); +const ON_SubDToBrepParameters ON_SubDToBrepParameters::Default; const ON_SubDToBrepParameters ON_SubDToBrepParameters::DefaultUnpacked = Internal_SubDToBrepParameters(false); const ON_SubDToBrepParameters ON_SubDToBrepParameters::DefaultPacked = Internal_SubDToBrepParameters(true); -const ON_SubDRTreeVertexFinder ON_SubDRTreeVertexFinder::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDRTreeVertexFinder); +const ON_SubDRTreeVertexFinder ON_SubDRTreeVertexFinder::Unset; ON_ClassId* ON_ClassId::m_p0 = 0; // static pointer to first id in list @@ -493,11 +493,11 @@ const ON_Interval ON_Interval::ZeroToOne(0.0,1.0); const ON_Interval ON_Interval::ZeroToTwoPi(0.0,2.0*ON_PI); const ON_Interval ON_Interval::Nan(ON_DBL_QNAN,ON_DBL_QNAN); -const ON_TextBox ON_TextBox::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_TextBox); +const ON_TextBox ON_TextBox::Unset; const ON_CheckSum ON_CheckSum::UnsetCheckSum; -const ONX_ErrorCounter ONX_ErrorCounter::Zero ON_CLANG_CONSTRUCTOR_BUG_INIT(ONX_ErrorCounter); +const ONX_ErrorCounter ONX_ErrorCounter::Zero; static ON_MD5_Hash ON_MD5_Hash_EmptyContentHash() { @@ -505,7 +505,7 @@ static ON_MD5_Hash ON_MD5_Hash_EmptyContentHash() return md5.Hash(); } const ON_MD5_Hash ON_MD5_Hash::EmptyContentHash = ON_MD5_Hash_EmptyContentHash(); -const ON_MD5_Hash ON_MD5_Hash::ZeroDigest ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_MD5_Hash); +const ON_MD5_Hash ON_MD5_Hash::ZeroDigest; static ON_SHA1_Hash ON_SHA1_Hash_EmptyContentHash() { @@ -513,9 +513,9 @@ static ON_SHA1_Hash ON_SHA1_Hash_EmptyContentHash() return sha1.Hash(); } const ON_SHA1_Hash ON_SHA1_Hash::EmptyContentHash = ON_SHA1_Hash_EmptyContentHash(); -const ON_SHA1_Hash ON_SHA1_Hash::ZeroDigest ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SHA1_Hash); +const ON_SHA1_Hash ON_SHA1_Hash::ZeroDigest; -const ONX_ModelTest ONX_ModelTest::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ONX_ModelTest); +const ONX_ModelTest ONX_ModelTest::Unset; // Works with Microsoft's CL, fails for Apple's CLang //// const struct ON_UnicodeErrorParameters ON_UnicodeErrorParameters::MaskErrors = { 0, 0xFFFFFFFF, ON_UnicodeCodePoint::ON_ReplacementCharacter }; @@ -558,7 +558,7 @@ const ON_String ON_String::ByteOrderMark(ON_Internal_ByteOrderMark()); const ON_wString ON_wString::EmptyString; const ON_wString ON_wString::ByteOrderMark((wchar_t)ON_UnicodeCodePoint::ON_ByteOrderMark); -const ON_NameHash ON_NameHash::UnsetNameHash ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_NameHash); +const ON_NameHash ON_NameHash::UnsetNameHash; const ON_NameHash ON_NameHash::EmptyNameHash = ON_NameHash::CreateIdAndEmptyName(ON_nil_uuid); const ON_wString ON_ModelComponent::ReferencePrefixDelimiter(L" : "); const ON_wString ON_ModelComponent::ReferencePrefixSeparator(L">"); @@ -588,11 +588,11 @@ const wchar_t ON_FileSystemPath::AlternateDirectorySeparator = (wchar_t)ON_FileS -const ON_ContentHash ON_ContentHash::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_ContentHash); -const ON_FileReference ON_FileReference::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_FileReference); +const ON_ContentHash ON_ContentHash::Unset; +const ON_FileReference ON_FileReference::Unset; -const ON_3dmRevisionHistory ON_3dmRevisionHistory::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_3dmRevisionHistory); -const ON_3dmProperties ON_3dmProperties::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_3dmProperties); +const ON_3dmRevisionHistory ON_3dmRevisionHistory::Empty; +const ON_3dmProperties ON_3dmProperties::Empty; @@ -675,14 +675,14 @@ const ON_3fVector ON_3fVector::XAxis(1.0f, 0.0f, 0.0f); const ON_3fVector ON_3fVector::YAxis(0.0f, 1.0f, 0.0f); const ON_3fVector ON_3fVector::ZAxis(0.0f, 0.0f, 1.0f); -const ON_WindingNumber ON_WindingNumber::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_WindingNumber); +const ON_WindingNumber ON_WindingNumber::Unset; // Do not increase this tolerance to fix a specific bug. // This tolerance is used after input has been cleaned up // to detect flaws. const double ON_Symmetry::ZeroTolerance = 1.0e-8; -const ON_Symmetry ON_Symmetry::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Symmetry); +const ON_Symmetry ON_Symmetry::Unset; // {3C6C7ABD-F3D5-41C2-96C9-DB9AEAF06E90} const ON_UUID ON_Symmetry::ReflectId = @@ -738,16 +738,16 @@ const ON_UnitSystem ON_UnitSystem::LightYears(ON::LengthUnitSystem::LightYears); const ON_UnitSystem ON_UnitSystem::Parsecs(ON::LengthUnitSystem::Parsecs); const ON_UnitSystem ON_UnitSystem::Unset(ON::LengthUnitSystem::Unset); -const ON_LengthUnitName ON_LengthUnitName::None ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_LengthUnitName); -const ON_AngleUnitName ON_AngleUnitName::None ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_AngleUnitName); +const ON_LengthUnitName ON_LengthUnitName::None; +const ON_AngleUnitName ON_AngleUnitName::None; -const ON_LengthValue ON_LengthValue::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_LengthValue); +const ON_LengthValue ON_LengthValue::Unset; const ON_LengthValue ON_LengthValue::Zero = ON_LengthValue::Create(0.0, ON::LengthUnitSystem::None, 0, ON_LengthValue::StringFormat::CleanDecimal); -const ON_AngleValue ON_AngleValue::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_AngleValue); +const ON_AngleValue ON_AngleValue::Unset; const ON_AngleValue ON_AngleValue::Zero = ON_AngleValue::Create(0.0, ON::AngleUnitSystem::None, 0, ON_AngleValue::StringFormat::CleanDecimal ); -const ON_ScaleValue ON_ScaleValue::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_ScaleValue); +const ON_ScaleValue ON_ScaleValue::Unset; const ON_ScaleValue ON_ScaleValue::OneToOne = ON_ScaleValue::Create( ON_LengthValue::Create(1.0, ON::LengthUnitSystem::None, 0, ON_LengthValue::StringFormat::CleanDecimal), ON_LengthValue::Create(1.0, ON::LengthUnitSystem::None, 0, ON_LengthValue::StringFormat::CleanDecimal), @@ -782,7 +782,7 @@ const double ON_Viewport::DefaultMinNearOverFar = 0.0001; const ON_3dVector ON_Viewport::Default3dCameraDirection(-0.43301270189221932338186158537647,0.75,-0.5); const ON_3dPoint ON_Viewport::DefaultCameraLocation(0.0, 0.0, 100.0); -const ON_Viewport ON_Viewport::DefaultTopViewYUp ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Viewport); +const ON_Viewport ON_Viewport::DefaultTopViewYUp; static ON_Viewport Internal_ON_Viewport_DefaultPerspectiveView_Init() { ON_Viewport vp; @@ -795,8 +795,8 @@ static ON_Viewport Internal_ON_Viewport_DefaultPerspectiveView_Init() const ON_Viewport ON_Viewport::DefaultPerspectiveViewZUp = Internal_ON_Viewport_DefaultPerspectiveView_Init(); -const ON_3dmIOSettings ON_3dmIOSettings::Default ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_3dmIOSettings); -const ON_3dmConstructionPlaneGridDefaults ON_3dmConstructionPlaneGridDefaults::Default ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_3dmConstructionPlaneGridDefaults); +const ON_3dmIOSettings ON_3dmIOSettings::Default; +const ON_3dmConstructionPlaneGridDefaults ON_3dmConstructionPlaneGridDefaults::Default; ON_EarthAnchorPoint Internal_EarthAnchorPointConstant(int which) { @@ -824,16 +824,16 @@ ON_EarthAnchorPoint Internal_EarthAnchorPointConstant(int which) const ON_EarthAnchorPoint ON_EarthAnchorPoint::Unset = Internal_EarthAnchorPointConstant(0); const ON_EarthAnchorPoint ON_EarthAnchorPoint::SeattleSpaceNeedle = Internal_EarthAnchorPointConstant(1); -const ON_3dmAnnotationSettings ON_3dmAnnotationSettings::Default ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_3dmAnnotationSettings); +const ON_3dmAnnotationSettings ON_3dmAnnotationSettings::Default; -const ON_3dmAnnotationContext ON_3dmAnnotationContext::Default ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_3dmAnnotationContext); +const ON_3dmAnnotationContext ON_3dmAnnotationContext::Default; -const ON_3dmArchiveTableStatus ON_3dmArchiveTableStatus::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_3dmArchiveTableStatus); +const ON_3dmArchiveTableStatus ON_3dmArchiveTableStatus::Unset; const wchar_t* ON_TextDot::DefaultFontFace = L"Arial"; const int ON_TextDot::DefaultHeightInPoints = 14; const int ON_TextDot::MinimumHeightInPoints = 3; -const ON_TextDot ON_TextDot::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_TextDot); +const ON_TextDot ON_TextDot::Unset; const ON_Locale ON_Locale::Ordinal = ON_Locale::FromWindowsLCID(ON_Locale::OrdinalLCID); const ON_Locale ON_Locale::InvariantCulture = ON_Locale::FromWindowsLCID(ON_Locale::InvariantCultureLCID); @@ -933,7 +933,7 @@ static ON_Plane ON_Plane_NanPlane() const ON_Plane ON_Plane::NanPlane(ON_Plane_NanPlane()); // ON_SubDDisplayParameters statics before ON_MeshParamters statics -const ON_SubDDisplayParameters ON_SubDDisplayParameters::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDDisplayParameters); +const ON_SubDDisplayParameters ON_SubDDisplayParameters::Empty; const ON_SubDDisplayParameters ON_SubDDisplayParameters::ExtraCoarse = ON_SubDDisplayParameters::CreateFromDisplayDensity(ON_SubDDisplayParameters::ExtraCoarseDensity); const ON_SubDDisplayParameters ON_SubDDisplayParameters::Coarse = ON_SubDDisplayParameters::CreateFromDisplayDensity(ON_SubDDisplayParameters::CoarseDensity); const ON_SubDDisplayParameters ON_SubDDisplayParameters::Medium = ON_SubDDisplayParameters::CreateFromDisplayDensity(ON_SubDDisplayParameters::MediumDensity); @@ -1147,21 +1147,21 @@ bool ON_MeshParameters_AreValid() const static bool ON_MeshParameters_AreValid_ = ON_MeshParameters_AreValid(); -const ON_3dmUnitsAndTolerances ON_3dmUnitsAndTolerances::Millimeters ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_3dmUnitsAndTolerances); +const ON_3dmUnitsAndTolerances ON_3dmUnitsAndTolerances::Millimeters; -const ON_Circle ON_Circle::UnitCircle ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Circle); -const ON_Arc ON_Arc::UnitCircle ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Arc); +const ON_Circle ON_Circle::UnitCircle; +const ON_Arc ON_Arc::UnitCircle; -const ON_3dmRenderSettings ON_3dmRenderSettings::Default ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_3dmRenderSettings); +const ON_3dmRenderSettings ON_3dmRenderSettings::Default; -const ON_3dmSettings ON_3dmSettings::Default ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_3dmSettings); +const ON_3dmSettings ON_3dmSettings::Default; -const ON_ProgressStepCounter ON_ProgressStepCounter::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_ProgressStepCounter); +const ON_ProgressStepCounter ON_ProgressStepCounter::Empty; -const ON_HistoryRecord ON_HistoryRecord::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_HistoryRecord); +const ON_HistoryRecord ON_HistoryRecord::Empty; -const ON_RTreeMemPool ON_RTreeMemPool::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_RTreeMemPool); -const ON_RTree ON_RTree::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_RTree); +const ON_RTreeMemPool ON_RTreeMemPool::Empty; +const ON_RTree ON_RTree::Empty; // {F5E3BAA9-A7A2-49FD-B8A1-66EB274A5F91} const ON_UUID ON_MeshCache::RenderMeshId = @@ -1187,7 +1187,7 @@ const ON_UUID ON_MeshCache::FineMeshId = const ON_UUID ON_MeshCache::AnyMeshId = { 0xa82c0f1b, 0x13e8, 0x4dec,{ 0xad, 0x35, 0xd3, 0xdd, 0xd2, 0x77, 0x20, 0x3c } }; -const ON_MeshCache ON_MeshCache::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_MeshCache); +const ON_MeshCache ON_MeshCache::Empty; #if defined(OPENNURBS_ANNOTATION_TABLE_WIP) const double ON_Table::MinColWidth = 1.0; @@ -1221,7 +1221,7 @@ const ON_4dRect ON_4dRect::Unset(ON_UNSET_VALUE, ON_UNSET_VALUE, ON_UNSET_VALUE, const ON_OutlineFigure::Orientation ON_Outline::DefaultOuterOrientation = ON_OutlineFigure::Orientation::Clockwise; -const ON_OutlineFigurePoint ON_OutlineFigurePoint::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_OutlineFigurePoint); +const ON_OutlineFigurePoint ON_OutlineFigurePoint::Unset; static ON_OutlineFigurePoint Internal_FontGlyphOutlinePoint() { ON_OutlineFigurePoint p; @@ -1230,17 +1230,17 @@ static ON_OutlineFigurePoint Internal_FontGlyphOutlinePoint() } const ON_OutlineFigurePoint ON_OutlineFigurePoint::Error(Internal_FontGlyphOutlinePoint()); -const ON_OutlineFigure ON_OutlineFigure::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_OutlineFigure); +const ON_OutlineFigure ON_OutlineFigure::Unset; -const ON_Outline ON_Outline::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Outline); +const ON_Outline ON_Outline::Unset; -const ON_FontGlyph ON_FontGlyph::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_FontGlyph); +const ON_FontGlyph ON_FontGlyph::Unset; -const ON_PANOSE1 ON_PANOSE1::Zero ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_PANOSE1); +const ON_PANOSE1 ON_PANOSE1::Zero; const double ON_FontMetrics::DefaultLineFeedRatio = 1.6; const ON__UINT32 ON_FontMetrics::HeightOfCapitalCodePoint = 'I'; -const ON_FontMetrics ON_FontMetrics::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_FontMetrics); +const ON_FontMetrics ON_FontMetrics::Unset; static ON_FontMetrics Internal_LastResortNormalizedFontMetrics() { @@ -1424,11 +1424,11 @@ const ON_Font ON_Font::Unset(*((const ON_Font*)ON_PTR_SEMAPHORE1)); // for implementation details. const ON_Font ON_Font::Default(*((const ON_Font*)ON_PTR_SEMAPHORE2)); -const ON_Geometry ON_Geometry::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Geometry); +const ON_Geometry ON_Geometry::Unset; -const ON_3dmObjectAttributes ON_3dmObjectAttributes::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_3dmObjectAttributes); +const ON_3dmObjectAttributes ON_3dmObjectAttributes::Unset; -const ON_3dmObjectAttributes ON_3dmObjectAttributes::DefaultAttributes ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_3dmObjectAttributes); +const ON_3dmObjectAttributes ON_3dmObjectAttributes::DefaultAttributes; static const ON_ModelComponentTypeIterator ON_ModelComponentIterator_Init( @@ -1508,43 +1508,43 @@ static const ON_ModelComponentTypeIterator ON_ModelComponentIterator_Init( const ON_ModelComponentTypeIterator ON_ModelComponentTypeIterator::ExplicitComponentTypes(ON_ModelComponentIterator_Init(1)); const ON_ModelComponentTypeIterator ON_ModelComponentTypeIterator::TableComponentTypes(ON_ModelComponentIterator_Init(2)); -const ON_ModelComponent ON_ModelComponent::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_ModelComponent); +const ON_ModelComponent ON_ModelComponent::Unset; -const ON_ModelComponentReference ON_ModelComponentReference::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_ModelComponentReference); -const ON_ModelComponentWeakReference ON_ModelComponentWeakReference::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_ModelComponentWeakReference); +const ON_ModelComponentReference ON_ModelComponentReference::Empty; +const ON_ModelComponentWeakReference ON_ModelComponentWeakReference::Empty; -const ON_ModelComponentContentMark ON_ModelComponentContentMark::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_ModelComponentContentMark); +const ON_ModelComponentContentMark ON_ModelComponentContentMark::Unset; // explicit constructor added to work around Apple CLANG bug. const ON_ComponentManifest ON_ComponentManifest::Empty; -const ON_ManifestMapItem ON_ManifestMapItem::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_ManifestMapItem); +const ON_ManifestMapItem ON_ManifestMapItem::Unset; // explicit constructor added to work around Apple CLANG bug. const ON_ManifestMap ON_ManifestMap::Empty; -const ON_ComponentManifestItem ON_ComponentManifestItem::UnsetItem ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_ComponentManifestItem); +const ON_ComponentManifestItem ON_ComponentManifestItem::UnsetItem; -const ON_Bitmap ON_Bitmap::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Bitmap); +const ON_Bitmap ON_Bitmap::Unset; -const ON_EmbeddedBitmap ON_EmbeddedBitmap::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_EmbeddedBitmap); +const ON_EmbeddedBitmap ON_EmbeddedBitmap::Unset; -const ON_WindowsBitmap ON_WindowsBitmap::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_WindowsBitmap); +const ON_WindowsBitmap ON_WindowsBitmap::Unset; -const ON_WindowsBitmapEx ON_WindowsBitmapEx::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_WindowsBitmapEx); +const ON_WindowsBitmapEx ON_WindowsBitmapEx::Unset; -const ON_Light ON_Light::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Light); +const ON_Light ON_Light::Unset; -const ON_InstanceDefinition ON_InstanceDefinition::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_InstanceDefinition); +const ON_InstanceDefinition ON_InstanceDefinition::Unset; const ON_ModelGeometryComponent ON_ModelGeometryComponent::Unset = ON_ModelGeometryComponent(ON_ModelComponent::Type::Unset); -const ON_Texture ON_Texture::Default ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Texture); +const ON_Texture ON_Texture::Default; const double ON_Material::MaxShine = 255.0; -const ON_Material ON_Material::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Material); +const ON_Material ON_Material::Unset; static ON_Material Internal_SystemMaterialInit(int index) { @@ -1580,7 +1580,7 @@ static ON_Material Internal_SystemMaterialInit(int index) const ON_Material ON_Material::Default(Internal_SystemMaterialInit(-1)); const ON_Material ON_Material::DefaultLockedObject(Internal_SystemMaterialInit(-2)); -const ON_TextureMapping ON_TextureMapping::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_TextureMapping); +const ON_TextureMapping ON_TextureMapping::Unset; static ON_TextureMapping SurfaceParameterTextureMappingInitializer() { @@ -1598,16 +1598,16 @@ static ON_TextureMapping SurfaceParameterTextureMappingInitializer() } const ON_TextureMapping ON_TextureMapping::SurfaceParameterTextureMapping(SurfaceParameterTextureMappingInitializer()); -const ON_MappingTag ON_MappingTag::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_MappingTag); +const ON_MappingTag ON_MappingTag::Unset; const ON_MappingTag ON_MappingTag::SurfaceParameterMapping(ON_TextureMapping::SurfaceParameterTextureMapping,nullptr); -const ON_LinetypeSegment ON_LinetypeSegment::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_LinetypeSegment); +const ON_LinetypeSegment ON_LinetypeSegment::Unset; const ON_LinetypeSegment ON_LinetypeSegment::OneMillimeterLine(1.0, ON_LinetypeSegment::eSegType::stLine); -const ON_Group ON_Group::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Group); +const ON_Group ON_Group::Unset; -const ON_Linetype ON_Linetype::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Linetype); +const ON_Linetype ON_Linetype::Unset; static ON_Linetype Internal_BuiltInLinePattern( int index ) { @@ -1822,7 +1822,7 @@ static void TextStyleInit( text_style.LockName(); } -const ON_Layer ON_Layer::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Layer); +const ON_Layer ON_Layer::Unset; static ON_Layer ON_Layer_Default() { @@ -1880,7 +1880,7 @@ const ON_TextStyle ON_TextStyle::Default(DefaultTextStyle()); const ON_TextStyle ON_TextStyle::ByLayer(ByLayerTextStyle()); const ON_TextStyle ON_TextStyle::ByParent(ByParentTextStyle()); -const ON_TextMask ON_TextMask::None ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_TextMask); +const ON_TextMask ON_TextMask::None; //static bool ValidateCpyStuff(const ON_DimStyle& src) //{ @@ -1896,7 +1896,7 @@ const ON_TextMask ON_TextMask::None ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_TextMask); // return rc; //} -const ON_FontFaceQuartet ON_FontFaceQuartet::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_FontFaceQuartet); +const ON_FontFaceQuartet ON_FontFaceQuartet::Empty; static void DimStyleInit( const wchar_t* name, @@ -2377,7 +2377,7 @@ static ON_DimStyle DimStyleModelUnitsEngrave() return dimstyle; } -const ON_DimStyle ON_DimStyle::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_DimStyle); +const ON_DimStyle ON_DimStyle::Unset; const ON_DimStyle ON_DimStyle::Default(DimStyleDefault()); @@ -2396,18 +2396,18 @@ const ON_DimStyle ON_DimStyle::DefaultFeetEngrave(DimStyleFeetEngrave()); const ON_DimStyle ON_DimStyle::DefaultMillimeterEngrave(DimStyleMillimeterEngrave()); const ON_DimStyle ON_DimStyle::DefaultModelUnitsEngrave(DimStyleModelUnitsEngrave()); -const ON_StackedText ON_StackedText::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_StackedText); -const ON_TextRun ON_TextRun::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_TextRun); -const ON_TextRunArray ON_TextRunArray::EmptyArray ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_TextRunArray); -const ON_TextContent ON_TextContent::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_TextContent); +const ON_StackedText ON_StackedText::Empty; +const ON_TextRun ON_TextRun::Empty; +const ON_TextRunArray ON_TextRunArray::EmptyArray; +const ON_TextContent ON_TextContent::Empty; -const ON_Text ON_Text::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Text); -const ON_Leader ON_Leader::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Leader); -const ON_DimLinear ON_DimLinear::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_DimLinear); -const ON_DimAngular ON_DimAngular::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_DimAngular); -const ON_DimRadial ON_DimRadial::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_DimRadial); -const ON_DimOrdinate ON_DimOrdinate::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_DimOrdinate); -const ON_Centermark ON_Centermark::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Centermark); +const ON_Text ON_Text::Empty; +const ON_Leader ON_Leader::Empty; +const ON_DimLinear ON_DimLinear::Empty; +const ON_DimAngular ON_DimAngular::Empty; +const ON_DimRadial ON_DimRadial::Empty; +const ON_DimOrdinate ON_DimOrdinate::Empty; +const ON_Centermark ON_Centermark::Empty; const ON_HatchLine ON_HatchLine::Unset(ON_UNSET_VALUE); // angle = unset const ON_HatchLine ON_HatchLine::SolidHorizontal(0.0); // angle = 0 @@ -2590,7 +2590,7 @@ static ON_HatchPattern Internal_LineHatchPatternInit( return hatch_pattern; } -const ON_HatchPattern ON_HatchPattern::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_HatchPattern); +const ON_HatchPattern ON_HatchPattern::Unset; const ON_HatchPattern ON_HatchPattern::Solid(Internal_SolidHatchPatternInit()); // index = -1, id set, unique and persistent const ON_HatchPattern ON_HatchPattern::Hatch1(Internal_LineHatchPatternInit(-2)); // index = -2, id set, unique and persistent const ON_HatchPattern ON_HatchPattern::Hatch2(Internal_LineHatchPatternInit(-3)); // index = -3, id set, unique and persistent @@ -2602,8 +2602,8 @@ const ON_HatchPattern ON_HatchPattern::Plus(Internal_LineHatchPatternInit(-8)); const ON_HatchPattern ON_HatchPattern::Squares(Internal_LineHatchPatternInit(-9)); // index = -9, id set, unique and persistent -const ON_Mesh ON_Mesh::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Mesh); -const ON_MeshRef ON_MeshRef::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_MeshRef); +const ON_Mesh ON_Mesh::Empty; +const ON_MeshRef ON_MeshRef::Empty; unsigned int ON_SubD::ErrorCount = 0; unsigned int ON_Brep::ErrorCount = 0; @@ -2682,7 +2682,7 @@ void ON_SubD::SetAutomaticMeshToSubD( } -const ON_SubDVertexEdgeProperties ON_SubDVertexEdgeProperties::Zero ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDVertexEdgeProperties); +const ON_SubDVertexEdgeProperties ON_SubDVertexEdgeProperties::Zero; const ON_SubDVertexPtr ON_SubDVertexPtr::Null = { 0 }; const ON_SubDEdgePtr ON_SubDEdgePtr::Null = { 0 }; @@ -2696,8 +2696,8 @@ const ON_SubDComponentAndNumber ON_SubDComponentAndNumber::NullAndZero = ON_SubD const ON_SubDComponentAndPoint ON_SubDComponentAndPoint::NullAndNan = ON_SubDComponentAndPoint::Create(ON_SubDComponentPtr::Null, ON_3dPoint::NanPoint); const ON_SubDComponentAndPoint ON_SubDComponentAndPoint::NullAndOrigin = ON_SubDComponentAndPoint::Create(ON_SubDComponentPtr::Null, ON_3dPoint::Origin); -const ON_SubDComponentList ON_SubDComponentList::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDComponentList); -const ON_SubD_ComponentIdTypeAndTag ON_SubD_ComponentIdTypeAndTag::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubD_ComponentIdTypeAndTag); +const ON_SubDComponentList ON_SubDComponentList::Empty; +const ON_SubD_ComponentIdTypeAndTag ON_SubD_ComponentIdTypeAndTag::Unset; const ON_SubDComponentId ON_SubDComponentIdUnset(ON_SubDComponentPtr::Type::Unset, 0U); @@ -2706,7 +2706,7 @@ const ON_SubDComponentTest ON_SubDComponentTest::AllPass((ON__UINT_PTR)1); const ON_SubDComponentTest ON_SubDComponentTest::AllFail((ON__UINT_PTR)0); -const ON_SubDEdgeChain ON_SubDEdgeChain::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDEdgeChain); +const ON_SubDEdgeChain ON_SubDEdgeChain::Empty; static ON_SubDSectorSurfacePoint ON_SubDSectorLimitPoint_Init(double x) { @@ -2753,7 +2753,7 @@ const double ON_SubDSectorType::UnsetSectorCoefficient = -8883.0; const double ON_SubDSectorType::ErrorSectorCoefficient = -9993.0; -const ON_SubDComponentRegionIndex ON_SubDComponentRegionIndex::Zero ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDComponentRegionIndex); +const ON_SubDComponentRegionIndex ON_SubDComponentRegionIndex::Zero; static ON_SubDComponentRegionIndex InternalON_SubDComponentRegionIndex_Unset() { @@ -2763,8 +2763,8 @@ static ON_SubDComponentRegionIndex InternalON_SubDComponentRegionIndex_Unset() } const ON_SubDComponentRegionIndex ON_SubDComponentRegionIndex::Unset = InternalON_SubDComponentRegionIndex_Unset(); -const ON_SubDComponentRegion ON_SubDComponentRegion::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDComponentRegion); -const ON_SubDFaceRegion ON_SubDFaceRegion::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDFaceRegion); +const ON_SubDComponentRegion ON_SubDComponentRegion::Empty; +const ON_SubDFaceRegion ON_SubDFaceRegion::Empty; const ON_ComponentStatus ON_ComponentStatus::NoneSet = ON_ComponentStatus(ON_ComponentState::Clear); const ON_ComponentStatus ON_ComponentStatus::Selected = ON_ComponentStatus(ON_ComponentState::Selected); @@ -2878,12 +2878,12 @@ const ON_SubDVertex ON_SubDVertex::Empty = EmptyVertexInit(); const ON_SubDEdge ON_SubDEdge::Empty = EmptyEdgeInit(); const ON_SubDFace ON_SubDFace::Empty = EmptyFaceInit(); -const ON_SubD ON_SubD::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubD); -const ON_SubDRef ON_SubDRef::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDRef); -const ON_SubDMesh ON_SubDMesh::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDMesh); -const ON_SubDSectorType ON_SubDSectorType::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDSectorType); -const ON_SubDMatrix ON_SubDMatrix::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDMatrix); -const ON_SubDComponentRef ON_SubDComponentRef::Empty ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDComponentRef); +const ON_SubD ON_SubD::Empty; +const ON_SubDRef ON_SubDRef::Empty; +const ON_SubDMesh ON_SubDMesh::Empty; +const ON_SubDSectorType ON_SubDSectorType::Empty; +const ON_SubDMatrix ON_SubDMatrix::Empty; +const ON_SubDComponentRef ON_SubDComponentRef::Empty; static ON_SubDFromMeshParameters Internal_InteriorCreases() { @@ -2900,11 +2900,11 @@ static ON_SubDFromMeshParameters Internal_ConvexCornersAndInteriorCreases() return cp; } -const ON_SubDFromMeshParameters ON_SubDFromMeshParameters::Smooth ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDFromMeshParameters); +const ON_SubDFromMeshParameters ON_SubDFromMeshParameters::Smooth; const ON_SubDFromMeshParameters ON_SubDFromMeshParameters::InteriorCreases = Internal_InteriorCreases(); const ON_SubDFromMeshParameters ON_SubDFromMeshParameters::ConvexCornersAndInteriorCreases = Internal_ConvexCornersAndInteriorCreases(); -const ON_SubDFromSurfaceParameters ON_SubDFromSurfaceParameters::Default ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDFromSurfaceParameters); +const ON_SubDFromSurfaceParameters ON_SubDFromSurfaceParameters::Default; static const ON_SubDFromSurfaceParameters Internal_InitSubDFromSurfaceParameters( ON_SubDFromSurfaceParameters::Methods method, diff --git a/opennurbs_string_value.h b/opennurbs_string_value.h index 95b712cc..b84e1d07 100644 --- a/opennurbs_string_value.h +++ b/opennurbs_string_value.h @@ -432,7 +432,7 @@ public: private: // parsing context unsigned int m_context_locale_id = 0; - ON::LengthUnitSystem m_context_length_unit_system; + ON::LengthUnitSystem m_context_length_unit_system = ON::LengthUnitSystem::None; ON_AngleValue::StringFormat m_string_format = ON_AngleValue::StringFormat::ExactDecimal; ON::AngleUnitSystem m_angle_unit_system = ON::AngleUnitSystem::Unset; diff --git a/opennurbs_subd.cpp b/opennurbs_subd.cpp index 6db57394..1f1b01b3 100644 --- a/opennurbs_subd.cpp +++ b/opennurbs_subd.cpp @@ -17705,7 +17705,7 @@ public: }; -const ON_Internal_ExtrudedVertex ON_Internal_ExtrudedVertex::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Internal_ExtrudedVertex); +const ON_Internal_ExtrudedVertex ON_Internal_ExtrudedVertex::Unset; /* ON_Internal_ExtrudedVertex manages an edge that is extruded into a "side" face extrusion process. @@ -18152,7 +18152,7 @@ int ON_Internal_ExtrudedEdge::CompareSideGroupId(const ON_Internal_ExtrudedEdge* return 0; } -const ON_Internal_ExtrudedEdge ON_Internal_ExtrudedEdge::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_Internal_ExtrudedEdge); +const ON_Internal_ExtrudedEdge ON_Internal_ExtrudedEdge::Unset; int ON_Internal_ExtrudedVertex::CompareInitialVertexId( const ON_Internal_ExtrudedVertex* lhs, diff --git a/opennurbs_subd_fragment.cpp b/opennurbs_subd_fragment.cpp index e1d2ceef..12b0a8ff 100644 --- a/opennurbs_subd_fragment.cpp +++ b/opennurbs_subd_fragment.cpp @@ -2735,7 +2735,7 @@ public: ON_SubDMeshFragment* m_fragment = nullptr; }; -const ON_SubDLimitMeshSealEdgeInfo ON_SubDLimitMeshSealEdgeInfo::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SubDLimitMeshSealEdgeInfo); +const ON_SubDLimitMeshSealEdgeInfo ON_SubDLimitMeshSealEdgeInfo::Unset; bool ON_SubDLimitMeshSealEdgeInfo::Seal( const ON_SubDLimitMeshSealEdgeInfo& src, diff --git a/opennurbs_subd_frommesh.cpp b/opennurbs_subd_frommesh.cpp index 459d5bf8..1cb5959e 100644 --- a/opennurbs_subd_frommesh.cpp +++ b/opennurbs_subd_frommesh.cpp @@ -1773,7 +1773,7 @@ unsigned int ON_NgonBoundaryComponent::IsBoundaryEdge() const ; } -const ON_NgonBoundaryComponent ON_NgonBoundaryComponent::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_NgonBoundaryComponent); +const ON_NgonBoundaryComponent ON_NgonBoundaryComponent::Unset; void ON_NgonBoundaryChecker::Internal_ReturnIsNotSimple() { diff --git a/opennurbs_system_compiler.h b/opennurbs_system_compiler.h index c03e7694..a71e702d 100644 --- a/opennurbs_system_compiler.h +++ b/opennurbs_system_compiler.h @@ -235,8 +235,6 @@ // ///////////////////////////////////////////////////////////////////////////////////// -#define ON_CLANG_CONSTRUCTOR_BUG - #endif #endif @@ -275,33 +273,6 @@ #define ON_PRAGMA_WARNING_POP clang diagnostic pop // Apple CLang warning state pop #define ON_PRAGMA_WARNING_DISABLE_CLANG(ON_PRAGMA_WARNING_DISABLE_param) clang diagnostic ignored ON_PRAGMA_WARNING_DISABLE_param // Apple CLang warning disable -// clang has a bug that is fails to correctly construct statc const objects -// in the following case -// -// // header file -// class Blah -// { -// public: -// Blah() = default; -// ~Blah() = default; -// Blah(const Blah&) = default; -// Blah& operator=(const Blah&) = default; -// -// static const Blah Zero; -// -// int m_i = 0; -// }; -// -// ... -// -// // cpp file -// const Blah Blah::Zero; // correct C++ 11, Apple's clang fails as of February, 2015 -// const Blah Blah::Zero( Blah() ); // clang fails to use copy constructor -// const Blah Blah::Zero = Blah(); // clang can handle this -// -// When this bug is fixed, delete this define and the places -// in the code that use it. -#define ON_CLANG_CONSTRUCTOR_BUG #if defined(__has_feature) && __has_feature(cxx_noexcept) #undef ON_NOEXCEPT @@ -403,37 +374,6 @@ #endif -#if defined(ON_CLANG_CONSTRUCTOR_BUG) -// Clang as implemented by Apple has a bug and is unable to use -// a default constructor to initialize const statics. -// The Clang error message is -// -// ...: error: default initialization of an object of const type 'const ...' without a user-provided default constructor -// -// The ON_CLANG_CONSTRUCTOR_BUG_INIT function is used to replace the call to a default constructor with call -// to the copy constructor (which can be default). -// -// Example" -// -// class MyClass -// { -// public: -// MyClass() = default; -// ~MyClass() = default; -// MyClass(const MyClass&) = default; -// MyClass& operator=(const MyClass&) = default; -// -// int m_i = 0; -// }; -// ... -// const MyClass c1; // fails with clang, works with gcc, Microsoft CL, ... -// const MyClass c2 ON_CLANG_CONSTRUCTOR_BUG_INIT(MyClass); // works with clang, gcc, Microsoft CL, ... -// -#define ON_CLANG_CONSTRUCTOR_BUG_INIT(ctor) = ctor() -#else -#define ON_CLANG_CONSTRUCTOR_BUG_INIT(ctor) -#endif - /* These defines will be set to something more appropriate when opennurbs_system_compiler detects the compiler and platform. diff --git a/opennurbs_wip.h b/opennurbs_wip.h index 980b12bd..3e7d409f 100644 --- a/opennurbs_wip.h +++ b/opennurbs_wip.h @@ -21,6 +21,5 @@ // until V6 ships. //#define OPENNURBS_ANNOTATION_TABLE_WIP -#define OPENNURBS_GRADIENT_WIP #endif