Sync changes from upstream repository

Co-authored-by: Andrew Le Bihan <andy@mcneel.com>
Co-authored-by: Bozo <bozo@mcneel.com>
Co-authored-by: Bozo the Builder <bozo@mcneel.com>
Co-authored-by: croudyj <croudyj@gmail.com>
Co-authored-by: Dale Lear <dalelear@mcneel.com>
Co-authored-by: piac <giulio@mcneel.com>
This commit is contained in:
Bozo the Builder
2023-08-21 06:01:25 -07:00
parent 6e754fbf6d
commit cb1994195e
30 changed files with 1892 additions and 299 deletions

View File

@@ -54,6 +54,22 @@ ON_TextLogLevelOfDetail::ON_TextLogLevelOfDetail(
m_text_log.SetLevelOfDetail(level_of_detail);
}
ON_TextLogLevelOfDetail::ON_TextLogLevelOfDetail(
class ON_TextLog& text_log,
int delta_lod
)
: m_text_log(text_log)
, m_saved_level_of_detail(text_log.GetLevelOfDetail())
{
const int new_lod = ((int)static_cast<unsigned>(m_saved_level_of_detail)) + delta_lod;
if (new_lod <= 0)
m_text_log.SetLevelOfDetail(ON_TextLog::LevelOfDetail::Minimum);
else if (((unsigned)new_lod) >= static_cast<unsigned>(ON_TextLog::LevelOfDetail::Maximum))
m_text_log.SetLevelOfDetail(ON_TextLog::LevelOfDetail::Maximum);
else
m_text_log.SetLevelOfDetail(ON_TextLog::LevelOfDetailFromUnsigned((unsigned)new_lod));
}
ON_TextLogLevelOfDetail::~ON_TextLogLevelOfDetail()
{
m_text_log.SetLevelOfDetail(m_saved_level_of_detail);
@@ -130,6 +146,22 @@ ON_TextLog::LevelOfDetail ON_TextLog::GetLevelOfDetail() const
return m_level_of_detail;
}
ON_TextLog::LevelOfDetail ON_TextLog::IncreaseLevelOfDetail()
{
ON_TextLog::LevelOfDetail prev_lod = m_level_of_detail;
if (prev_lod < ON_TextLog::LevelOfDetail::Maximum)
SetLevelOfDetail(ON_TextLog::LevelOfDetailFromUnsigned(static_cast<unsigned>(prev_lod) + 1u));
return prev_lod;
}
ON_TextLog::LevelOfDetail ON_TextLog::DecreaseLevelOfDetail()
{
ON_TextLog::LevelOfDetail prev_lod = m_level_of_detail;
if (prev_lod > ON_TextLog::LevelOfDetail::Minimum)
SetLevelOfDetail(ON_TextLog::LevelOfDetailFromUnsigned(static_cast<unsigned>(prev_lod) - 1u));
return prev_lod;
}
bool ON_TextLog::LevelOfDetailIsAtLeast(ON_TextLog::LevelOfDetail level_of_detail)
{
return static_cast<unsigned int>(m_level_of_detail) >= static_cast<unsigned int>(level_of_detail);
@@ -440,14 +472,22 @@ void ON_TextLog::Print( const ON_3dVector& p )
void ON_TextLog::Print( const ON_Xform& xform )
{
if ( xform.IsIdentity() )
if (ON_Xform::IdentityTransformation == xform)
{
Print("ON_Xform::IdentityTransformation\n");
}
else if ( xform.IsZero() )
else if (ON_Xform::ZeroTransformation == xform)
{
Print("ON_Xform::ZeroTransformation\n");
}
else if (ON_Xform::Zero4x4 == xform)
{
Print("ON_Xform::Zero4x4\n");
}
else if (ON_Xform::Unset == xform)
{
Print("ON_Xform::Unset\n");
}
else
{
Print(static_cast< const char* >(m_double4_format),xform[0][0],xform[0][1],xform[0][2],xform[0][3]);