Sync changes from upstream repository

This commit is contained in:
Bozo the Builder
2024-10-09 06:42:31 -07:00
parent 285c43ce2b
commit 26f90e169e
22 changed files with 896 additions and 265 deletions

View File

@@ -780,39 +780,41 @@ void ON_TextLog::PrintPointList( int dim, bool is_rat, int count, int stride, co
if ( count == 0 ) {
Print( "%sEMPTY point list\n", preamble.Array() );
}
else if ( !P ) {
else if ( nullptr == P ) {
Print( "%sNULL point list\n", preamble.Array() );
}
for ( i = 0; i < count; i++ ) {
Print( "%s[%2d] %c", preamble.Array(), i, (is_rat) ? '[' : '(' );
Print( static_cast< const char* >(m_double_format), P[0] );
for ( j = 1; j < cvdim; j++ ) {
Print( ", ");
Print(static_cast< const char* >(m_double_format), P[j] );
}
Print("%c", (is_rat) ? ']' : ')' );
if ( is_rat )
{
w = P[dim];
if ( w != 0.0 )
{
// print euclidean coordinates
w = 1.0/w;
x = w*P[0];
Print( " = (");
Print( static_cast< const char* >(m_double_format), x );
for ( j = 1; j < dim; j++ )
{
x = w*P[j];
Print( ", ");
Print( static_cast< const char* >(m_double_format), x );
}
Print(")");
else
{
for (i = 0; i < count; i++) {
Print("%s[%2d] %c", preamble.Array(), i, (is_rat) ? '[' : '(');
Print(static_cast<const char*>(m_double_format), P[0]);
for (j = 1; j < cvdim; j++) {
Print(", ");
Print(static_cast<const char*>(m_double_format), P[j]);
}
Print("%c", (is_rat) ? ']' : ')');
if (is_rat)
{
w = P[dim];
if (w != 0.0)
{
// print euclidean coordinates
w = 1.0 / w;
x = w * P[0];
Print(" = (");
Print(static_cast<const char*>(m_double_format), x);
for (j = 1; j < dim; j++)
{
x = w * P[j];
Print(", ");
Print(static_cast<const char*>(m_double_format), x);
}
Print(")");
}
}
Print("\n");
P += stride;
}
Print("\n");
P += stride;
}
}