本文整理汇总了C++中ON_NurbsSurface::Read方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_NurbsSurface::Read方法的具体用法?C++ ON_NurbsSurface::Read怎么用?C++ ON_NurbsSurface::Read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_NurbsSurface
的用法示例。
在下文中一共展示了ON_NurbsSurface::Read方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool ON_Brep::ReadOld200( ON_BinaryArchive& file, int minor_version )
{
bool rc = true;
// read legacy trimmed surface collection from Rhino 2.0
int face_count = 0;
int edge_count = 0;
int loop_count = 0;
int trim_count = 0;
int outer_flag = 0;
ON_BoundingBox bnd_2d_bbox;
int i, fi, fbi, fbcnt, bti, btcnt, twin_index;
int ftype_flag, btype_flag, gcon_flag, mono_flag;
char b;
if (rc) rc = file.ReadInt( &face_count );
if (rc) rc = file.ReadInt( &edge_count );
if (rc) rc = file.ReadInt( &loop_count );
if (rc) rc = file.ReadInt( &trim_count );
if ( face_count < 1 || edge_count < 1 || loop_count < 1 || trim_count < 1 )
rc = false;
if (rc) rc = file.ReadInt( &outer_flag );
if (rc) rc = file.ReadPoint( m_bbox.m_min );
if (rc) rc = file.ReadPoint( m_bbox.m_max );
// 2d curves
m_C2.Reserve(trim_count);
for ( i = 0; rc && i < trim_count; i++ ) {
ON_PolyCurve* curve = new ON_PolyCurve();
rc = curve->Read( file )?true:false;
if ( curve->Count() == 1 ) {
m_C2.Append( curve->HarvestSegment(0) );
delete curve;
}
else
m_C2.Append( curve );
}
const int c2_count = m_C2.Count();
// 3d curves
m_C3.Reserve(edge_count);
for ( i = 0; rc && i < edge_count; i++ ) {
ON_PolyCurve* curve = new ON_PolyCurve();
rc = curve->Read( file )?true:false;
if ( curve->Count() == 1 ) {
m_C3.Append( curve->HarvestSegment(0) );
delete curve;
}
else
m_C3.Append( curve );
}
const int c3_count = m_C3.Count();
// make a new edge for each 3d curve
m_E.Reserve(c3_count);
for ( i = 0; i < c3_count && rc; i++ )
{
NewEdge(i);
}
// 3d surfaces
m_S.Reserve(face_count);
for ( i = 0; rc && i < face_count; i++ ) {
ON_NurbsSurface* surface = new ON_NurbsSurface();
rc = surface->Read( file )?true:false;
m_S.Append( surface );
}
ON_SimpleArray<int> te_index(trim_count);
ON_SimpleArray<int> te_twin_index(trim_count);
m_F.Reserve(face_count);
m_L.Reserve(loop_count);
m_T.Reserve(trim_count);
for ( fi = 0; rc && fi < face_count; fi++ )
{
ftype_flag = 0;
fbcnt = 0;
ON_BrepFace& f = NewFace(fi);
if (rc) rc = file.ReadInt( &i ); // legacy face index
if (rc) rc = file.ReadInt( &i ); // OBSOLETE f.m_material_index
int k = f.m_bRev;
if (rc) rc = file.ReadInt( &k );
if (rc) f.m_bRev = (k!=0);
if (rc) rc = file.ReadInt( &ftype_flag );
if (rc) rc = file.ReadPoint( f.m_bbox.m_min );
if (rc) rc = file.ReadPoint( f.m_bbox.m_max );
if (rc) rc = file.ReadInt( &fbcnt);
if (fbcnt < 1 )
rc = false;
for ( fbi = 0; rc && fbi < fbcnt; fbi++ ) {
btype_flag = 0;
ON_BrepLoop::TYPE looptype = ON_BrepLoop::unknown;
if (rc) rc = file.ReadInt( &i ); // legacy loop index
if (rc) rc = file.ReadInt( &btype_flag );
//.........这里部分代码省略.........