Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions opennurbs_annotationbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,12 @@ class ON_CLASS ON_TextDot : public ON_Geometry
//---------------------------
// ON_Object overrides

// virtual ON_Object::SizeOf override
unsigned int SizeOf() const override;

// virtual ON_Object::DataCRC override
ON__UINT32 DataCRC(ON__UINT32 current_remainder) const override;

bool IsValid( class ON_TextLog* text_log = nullptr ) const override;

/*
Expand Down
10 changes: 8 additions & 2 deletions opennurbs_dimension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,13 @@ ON_TextContent* ON_Dimension::RebuildDimensionText(
}
else
{
displaytext = displaytext + UserText();
// October 2, 2025 - Tim
// As far as I can tell RebuildDimensionText only gets called with
// expandanglebrackets set to false from the acad export plugin otherwise
// I would be jumpy about making these changes.
// These changes fix https://mcneel.myjetbrains.com/youtrack/issue/RH-89323

displaytext = PlainText();
if (dimstyle->Prefix().IsNotEmpty() || dimstyle->Suffix().IsNotEmpty())
{
int ci = displaytext.Find(L"<>");
Expand All @@ -206,7 +212,7 @@ ON_TextContent* ON_Dimension::RebuildDimensionText(
if (displaytext.Length() > ci + 2)
right = displaytext.Right(displaytext.Length() - ci - 2);
displaytext = displaytext.Left(ci);
displaytext = displaytext + dimstyle->Prefix();
displaytext = dimstyle->Prefix() + displaytext;
displaytext = displaytext + L"<>";
displaytext = displaytext + dimstyle->Suffix();
displaytext = displaytext + right;
Expand Down
4 changes: 2 additions & 2 deletions opennurbs_font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5554,7 +5554,7 @@ const ON_ClassArray< ON_FontFaceQuartet >& ON_FontList::QuartetList() const
&& ssw_dex.j >= 0 && ssw_dex.j < 2
&& ssw_dex.k >= 1 && ssw_dex.k < max_weight_dex
)
? fonts_by_ssw[ssw_dex.i][ssw_dex.k][ssw_dex.k]
? fonts_by_ssw[ssw_dex.i][ssw_dex.j][ssw_dex.k]
: nullptr;
if (nullptr != cleanf)
{
Expand Down Expand Up @@ -7638,7 +7638,7 @@ const ON_wString ON_Font::FakeWindowsLogfontNameFromFamilyAndPostScriptNames(
Internal_FakeWindowsLogfontName(L"Avenir", L"Avenir-Heavy", L"Avenir Heavy", ON_FontFaceQuartet::Member::Regular),
Internal_FakeWindowsLogfontName(L"Avenir", L"Avenir-HeavyOblique", L"Avenir Heavy", ON_FontFaceQuartet::Member::Italic),
Internal_FakeWindowsLogfontName(L"Avenir", L"Avenir-Black", L"Avenir Black", ON_FontFaceQuartet::Member::Regular),
Internal_FakeWindowsLogfontName(L"Avenir", L"Avenir-BlackOblique", L"Avenir-Black", ON_FontFaceQuartet::Member::Italic),
Internal_FakeWindowsLogfontName(L"Avenir", L"Avenir-BlackOblique", L"Avenir Black", ON_FontFaceQuartet::Member::Italic),

Internal_FakeWindowsLogfontName(L"Avenir Next", L"AvenirNext-UltraLight", L"Avenir Next Ultralight", ON_FontFaceQuartet::Member::Regular),
Internal_FakeWindowsLogfontName(L"Avenir Next", L"AvenirNext-UltraLightItalic", L"Avenir Next Ultralight", ON_FontFaceQuartet::Member::Italic),
Expand Down
15 changes: 15 additions & 0 deletions opennurbs_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1761,6 +1761,21 @@ bool ON_InstanceRef::IsValid( ON_TextLog* text_log ) const
return true;
}

unsigned int ON_InstanceRef::SizeOf() const
{
unsigned int sz = ON_Geometry::SizeOf();
sz += (sizeof(*this) - sizeof(ON_Geometry));
return sz;
}

ON__UINT32 ON_InstanceRef::DataCRC(ON__UINT32 current_remainder) const
{
current_remainder = ON_CRC32(current_remainder, sizeof(m_instance_definition_uuid), &m_instance_definition_uuid);
current_remainder = ON_CRC32(current_remainder, sizeof(m_xform), &m_xform);
current_remainder = ON_CRC32(current_remainder, sizeof(m_bbox), &m_bbox);
return current_remainder;
}

bool ON_InstanceRef::Write(
ON_BinaryArchive& binary_archive
) const
Expand Down
8 changes: 8 additions & 0 deletions opennurbs_instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -657,14 +657,22 @@ class ON_CLASS ON_InstanceRef : public ON_Geometry
// virtual ON_Object overrides
//
bool IsValid( class ON_TextLog* text_log = nullptr ) const override;

bool Write(
ON_BinaryArchive& binary_archive
) const override;

bool Read(
ON_BinaryArchive& binary_archive
) override;
ON::object_type ObjectType() const override;

// virtual ON_Object::SizeOf override
unsigned int SizeOf() const override;

// virtual ON_Object::DataCRC override
ON__UINT32 DataCRC(ON__UINT32 current_remainder) const override;

/////////////////////////////////////////////////////////////
//
// virtual ON_Geometry overrides
Expand Down
21 changes: 21 additions & 0 deletions opennurbs_internal_V2_annotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5645,6 +5645,27 @@ void ON_TextDot::EmergencyDestroy()
m_display_bits = 0;
}

unsigned int ON_TextDot::SizeOf() const
{
unsigned int sz = ON_Geometry::SizeOf();
sz += (sizeof(*this) - sizeof(ON_Geometry));
sz += m_primary_text.SizeOf();
sz += m_secondary_text.SizeOf();
sz += m_font_face.SizeOf();
return sz;
}

ON__UINT32 ON_TextDot::DataCRC(ON__UINT32 current_remainder) const
{
current_remainder = m_center_point.DataCRC(current_remainder);
current_remainder = m_primary_text.DataCRC(current_remainder);
current_remainder = m_secondary_text.DataCRC(current_remainder);
current_remainder = m_font_face.DataCRC(current_remainder);
current_remainder = ON_CRC32(current_remainder, sizeof(m_display_bits), &m_display_bits);
current_remainder = ON_CRC32(current_remainder, sizeof(m_height_in_points), &m_height_in_points);
return current_remainder;
}

bool ON_TextDot::IsValid(
ON_TextLog* text_log
) const
Expand Down
1 change: 1 addition & 0 deletions opennurbs_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ unsigned int ON_Mesh::SizeOf() const
{
unsigned int sz = ON_Geometry::SizeOf();
sz += m_V.SizeOfArray();
sz += m_dV.SizeOfArray();
sz += m_F.SizeOfArray();
sz += m_N.SizeOfArray();
sz += m_FN.SizeOfArray();
Expand Down
2 changes: 1 addition & 1 deletion opennurbs_mesh_ngon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5241,10 +5241,10 @@ ON_Plane ON_Plane::FromPointList(
//
ON_3dVector N(ON_3dVector::ZeroVector);
ON_3dVector X(ON_3dVector::UnsetVector);
const unsigned int index_0123[4] = { 0,1,2,3 };
if ( point_index_count <= 4 )
{
// use "standard" face normal for quads and triangles.
const unsigned int index_0123[4] = {0,1,2,3};
if ( 0 == point_index_list )
point_index_list = index_0123;
Pi0 = point_list[point_index_list[point_stride*(point_count-1)]];
Expand Down
6 changes: 6 additions & 0 deletions opennurbs_pointcloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ void ON_PointCloud::Dump( ON_TextLog& dump ) const
const bool bHasNormals = HasPointNormals();
const bool bHasColors = HasPointColors();
const bool bHasHiddenPoints = (HiddenPointCount() > 0);
const bool bHasPointValues = HasPointValues();
const int point_count = m_P.Count();
dump.Print("ON_PointCloud: %d points\n",point_count);
dump.PushIndent();
Expand All @@ -156,6 +157,11 @@ void ON_PointCloud::Dump( ON_TextLog& dump ) const
dump.Print(", color = ");
dump.PrintRGB(m_C[i]);
}
if (bHasPointValues) // 20-Jan-2026 show point value
{
dump.Print(", value = ");
dump.Print(m_V[i]);
}
if (bHasHiddenPoints && m_H[i])
{
dump.Print(" (hidden)");
Expand Down
24 changes: 12 additions & 12 deletions opennurbs_public_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

// To update version numbers, edit ..\build\build_dates.msbuild
#define RMA_VERSION_MAJOR 8
#define RMA_VERSION_MINOR 26
#define RMA_VERSION_MINOR 29

////////////////////////////////////////////////////////////////
//
// These are set automatically by the build system as the
// first step in each build.
//
#define RMA_VERSION_YEAR 2025
#define RMA_VERSION_MONTH 12
#define RMA_VERSION_DATE 15
#define RMA_VERSION_HOUR 19
#define RMA_VERSION_YEAR 2026
#define RMA_VERSION_MONTH 3
#define RMA_VERSION_DATE 4
#define RMA_VERSION_HOUR 11
#define RMA_VERSION_MINUTE 0

////////////////////////////////////////////////////////////////
Expand All @@ -35,20 +35,20 @@
// 3 = build system release build
#define RMA_VERSION_BRANCH 0

#define VERSION_WITH_COMMAS 8,26,25349,19000
#define VERSION_WITH_PERIODS 8.26.25349.19000
#define COPYRIGHT "Copyright (C) 1993-2025, Robert McNeel & Associates. All Rights Reserved."
#define VERSION_WITH_COMMAS 8,29,26063,11000
#define VERSION_WITH_PERIODS 8.29.26063.11000
#define COPYRIGHT "Copyright (C) 1993-2026, Robert McNeel & Associates. All Rights Reserved."
#define SPECIAL_BUILD_DESCRIPTION "Public OpenNURBS C++ 3dm file IO library."

#define RMA_VERSION_NUMBER_MAJOR_STRING "8"
#define RMA_VERSION_NUMBER_MAJOR_WSTRING L"8"
#define RMA_PREVIOUS_VERSION_NUMBER_MAJOR_WSTRING L"7"

#define RMA_VERSION_NUMBER_SR_STRING "SR26"
#define RMA_VERSION_NUMBER_SR_WSTRING L"SR26"
#define RMA_VERSION_NUMBER_SR_STRING "SR29"
#define RMA_VERSION_NUMBER_SR_WSTRING L"SR29"

#define RMA_VERSION_WITH_PERIODS_STRING "8.26.25349.19000"
#define RMA_VERSION_WITH_PERIODS_WSTRING L"8.26.25349.19000"
#define RMA_VERSION_WITH_PERIODS_STRING "8.29.26063.11000"
#define RMA_VERSION_WITH_PERIODS_WSTRING L"8.29.26063.11000"



Expand Down
4 changes: 2 additions & 2 deletions opennurbs_quaternion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ bool ON_Quaternion::GetYawPitchRoll(double& yaw, double& pitch, double& roll) co
ON_Xform X;
bool rc = GetRotation(X);
if (rc)
rc = GetYawPitchRoll(yaw, pitch, roll);
rc = X.GetYawPitchRoll(yaw, pitch, roll);
return rc;
}

Expand All @@ -630,7 +630,7 @@ bool ON_Quaternion::GetEulerZYZ(double& alpha, double& beta, double& gamma) con
ON_Xform X;
bool rc = GetRotation(X);
if (rc)
rc = GetEulerZYZ(alpha, beta, gamma);
rc = X.GetEulerZYZ(alpha, beta, gamma);
return rc;

}
Expand Down
38 changes: 38 additions & 0 deletions opennurbs_sectionstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ ON_SectionStyle& ON_SectionStyle::operator=(const ON_SectionStyle& other)
}
return *this;
}

bool ON_SectionStyle::IsValid( ON_TextLog* text_log ) const
{
if (false == ON_ModelComponent::IsValid(text_log))
Expand All @@ -134,6 +135,43 @@ bool ON_SectionStyle::IsValid( ON_TextLog* text_log ) const
return true;
}

const ON_SectionStyle* ON_SectionStyle::FromModelComponentRef(
const class ON_ModelComponentReference& model_component_reference,
const ON_SectionStyle* none_return_value
)
{
const ON_SectionStyle* p = ON_SectionStyle::Cast(model_component_reference.ModelComponent());
return (nullptr != p) ? p : none_return_value;
}

bool ON_SectionStyle::UpdateReferencedComponents(
const class ON_ComponentManifest& source_manifest,
const class ON_ComponentManifest& destination_manifest,
const class ON_ManifestMap& manifest_map
)
{
bool rc = true;
// Update hatch pattern index
int hatch_index = HatchIndex();
if (hatch_index >= 0)
{
int destination_hatch_index = -1;
if (manifest_map.GetAndValidateDestinationIndex(ON_ModelComponent::Type::HatchPattern, hatch_index, destination_manifest, &destination_hatch_index))
{
hatch_index = destination_hatch_index;
}
else
{
ON_ERROR("Unable to update hatch pattern reference.");
rc = false;
hatch_index = DefaultSectionStylePrivate.m_hatch_index;
}
SetHatchIndex(hatch_index);
}
return rc;
}


// 12 Aug 2021 S. Baer
// When adding new fields written to 3dm files, always add information to this
// Dump function. Dump is used by the opennurbs file testing framework to
Expand Down
45 changes: 32 additions & 13 deletions opennurbs_sectionstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,52 @@ class ON_CLASS ON_SectionStyle : public ON_ModelComponent
static const ON_SectionStyle Unset; // index = ON_UNSET_INT_INDEX, id = nil

/*
Description:
Tests that name is set and there is at least one non-zero length segment
Parameters:
model_component_reference - [in]
none_return_value - [in]
value to return if ON_SectionStyle::Cast(model_component_ref.ModelComponent())
is nullptr
Returns:
If ON_SectionStyle::Cast(model_component_ref.ModelComponent()) is not nullptr,
that pointer is returned. Otherwise, none_return_value is returned.
*/
static const ON_SectionStyle* FromModelComponentRef(
const class ON_ModelComponentReference& model_component_reference,
const ON_SectionStyle* none_return_value
);

bool UpdateReferencedComponents(
const class ON_ComponentManifest& source_manifest,
const class ON_ComponentManifest& destination_manifest,
const class ON_ManifestMap& manifest_map
) override;

/*
Description:
Tests that name is set and there is at least one non-zero length segment
*/
bool IsValid( class ON_TextLog* text_log = nullptr ) const override;

void Dump( ON_TextLog& ) const override; // for debugging

/*
Description:
Write to file (serialize definition to binary archive)
Description:
Write to file (serialize definition to binary archive)
*/
bool Write(ON_BinaryArchive&) const override;

/*
Description:
Read from file (restore definition from binary archive)
Description:
Read from file (restore definition from binary archive)
*/
bool Read(ON_BinaryArchive&) override;


/*
Description:
Test only the section style attributes below for equality. Does not
perform any testing of the ON_ModelComponent fields
Parameters:
other: other section style to compare against this
Description:
Test only the section style attributes below for equality. Does not
perform any testing of the ON_ModelComponent fields
Parameters:
other: other section style to compare against this
*/
bool SectionAttributesEqual(const ON_SectionStyle& other) const;

Expand Down Expand Up @@ -89,7 +109,6 @@ class ON_CLASS ON_SectionStyle : public ON_ModelComponent
SectionBackgroundFillMode BackgroundFillMode() const;
void SetBackgroundFillMode(SectionBackgroundFillMode mode);


// Custom background fill color. If unset (default), the object's color or
// material is used for a fill
ON_Color BackgroundFillColor(bool print) const;
Expand Down
2 changes: 2 additions & 0 deletions opennurbs_subd.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ enum class ON_SubDGetControlNetMeshPriority : unsigned char
};


#pragma region RH_C_SHARED_ENUM [ON_SubDTextureCoordinateType] [Rhino.Geometry.SubDTextureCoordinateType] [byte]
/// <summary>
/// ON_SubDTextureCoordinateType identifies the way ON_SubDMeshFragment texture coordinates are set from an ON_SubDFace.
/// </summary>
Expand Down Expand Up @@ -91,6 +92,7 @@ enum class ON_SubDTextureCoordinateType : unsigned char
///</summary>
FromMapping = 7,
};
#pragma endregion

#pragma region RH_C_SHARED_ENUM [ON_SubDVertexTag] [Rhino.Geometry.SubDVertexTag] [byte]
/// <summary>
Expand Down
Loading
Loading