BOOL ON_BrepEdge::Read( ON_BinaryArchive& file ) { int bReversed = false; ON_Interval proxy_domain; BOOL rc = file.ReadInt( &m_edge_index ); if (rc) rc = file.ReadInt( &m_c3i ); if (rc) rc = file.ReadInt( &bReversed ); if (rc) rc = file.ReadInterval( proxy_domain ); if (rc) rc = file.ReadInt( 2, m_vi ); if (rc) rc = file.ReadArray( m_ti ); if (rc) rc = file.ReadDouble( &m_tolerance ); ON_Interval domain = proxy_domain; if ( file.Archive3dmVersion() >= 3 && file.ArchiveOpenNURBSVersion() >= 200206180 ) { if (rc) { rc = file.ReadInterval(domain); if ( !rc) domain = proxy_domain; } } SetProxyCurve( NULL, proxy_domain ); if ( bReversed ) ON_CurveProxy::Reverse(); SetDomain(domain); return rc; }
void ON_CurveProxy::SetProxyCurve( const ON_Curve* real_curve ) { // setting m_real_curve=0 prevents crashes if user has deleted // the "real" curve before calling SetProxyCurve(). m_real_curve = 0; if ( real_curve ) SetProxyCurve( real_curve, real_curve->Domain() ); else { m_real_curve_domain.Destroy(); m_this_domain.Destroy(); m_bReversed = false; } }