本文整理汇总了C++中ON_BinaryArchive::ReadInt方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_BinaryArchive::ReadInt方法的具体用法?C++ ON_BinaryArchive::ReadInt怎么用?C++ ON_BinaryArchive::ReadInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_BinaryArchive
的用法示例。
在下文中一共展示了ON_BinaryArchive::ReadInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Read
ON_BOOL32 ON_LineCurve::Read(
ON_BinaryArchive& file // open binary file
)
{
int major_version = 0;
int minor_version = 0;
ON_BOOL32 rc = file.Read3dmChunkVersion(&major_version,&minor_version);
if (rc && major_version==1) {
// common to all 1.x versions
rc = file.ReadLine( m_line );
if (rc) rc = file.ReadInterval( m_t );
if (rc) rc = file.ReadInt(&m_dim);
}
return rc;
}
示例2: Read
ON_BOOL32 ON_TextEntity::Read( ON_BinaryArchive& file )
{
ON_BOOL32 rc = ON_Annotation::Read( file );
if( rc )
rc = file.ReadString( m_facename );
if( rc )
rc = file.ReadInt( &m_fontweight );
if( rc )
rc = file.ReadDouble( &m_height );
if( fabs( m_height) > REALLY_BIG_NUMBER)
return false;
return rc;
}
示例3: Read
ON_BOOL32 ON_BrepFaceArray::Read( ON_BinaryArchive& file )
{
Empty();
ON__UINT32 tcode = 0;
ON__INT64 length_TCODE_ANONYMOUS_CHUNK = 0;
int count = 0;
int i;
int major_version = 0;
int minor_version = 0;
bool rc = file.BeginRead3dmBigChunk( &tcode, &length_TCODE_ANONYMOUS_CHUNK );
if (rc) {
if (tcode != TCODE_ANONYMOUS_CHUNK)
rc = false;
if (rc) rc = file.Read3dmChunkVersion(&major_version,&minor_version);
if (rc) {
if ( major_version==1 )
{
if (rc) rc = file.ReadInt(&count);
SetCapacity(count);
for ( i = 0; i < count && rc ; i++ )
{
ON_BrepFace& face = AppendNew();
rc = face.Read(file)?true:false;
}
if ( minor_version >= 1 )
{
// chunk version 1.1 and later has face uuids
for ( i = 0; i < count && rc; i++ )
{
rc = file.ReadUuid( m_a[i].m_face_uuid );
}
}
}
else
{
rc = 0;
}
}
if ( !file.EndRead3dmChunk() )
rc = false;
}
return rc;
}
示例4: Read
ON_BOOL32 ON_PointCloud::Read( ON_BinaryArchive& file )
{
int major_version = 0;
int minor_version = 0;
bool rc = file.Read3dmChunkVersion(&major_version,&minor_version);
if (rc && major_version == 1 )
{
if (rc) rc = file.ReadArray( m_P );
if (rc) rc = file.ReadPlane( m_plane );
if (rc) rc = file.ReadBoundingBox( m_bbox );
if (rc) rc = file.ReadInt( &m_flags);
if (rc && minor_version >= 1 )
{
if (rc) rc = file.ReadArray( m_N );
if (rc) rc = file.ReadArray( m_C );
}
}
return rc;
}
示例5: Read
BOOL ON_HatchLoop::Read( ON_BinaryArchive& ar)
{
m_type = ltOuter;
delete m_p2dCurve;
m_p2dCurve = NULL;
int major_version = 0;
int minor_version = 0;
BOOL rc = ar.Read3dmChunkVersion( &major_version, &minor_version);
if ( major_version == 1 )
{
int type;
if( rc) rc = ar.ReadInt( &type);
if( rc)
{
switch( type)
{
case ltOuter: m_type = ltOuter; break;
case ltInner: m_type = ltInner; break;
default: rc = false; break;
}
}
if( rc)
{
ON_Object* pObj = NULL;
rc = ar.ReadObject( &pObj);
if( pObj)
{
m_p2dCurve = ON_Curve::Cast( pObj);
if( !m_p2dCurve) // read something, but it wasn't right
{
rc = false;
delete pObj;
}
}
}
}
return rc;
}
示例6: Read
ON_BOOL32 ON_Linetype::Read( ON_BinaryArchive& file)
{
Default();
m_linetype_index = -1;
int major_version=0;
int minor_version=0;
bool rc = file.BeginRead3dmChunk( TCODE_ANONYMOUS_CHUNK, &major_version, &minor_version );
if (rc)
{
if( 1 == major_version )
{
// chunk version 1.0 fields
if( rc)
rc = file.ReadInt( &m_linetype_index );
if( rc)
rc = file.ReadString( m_linetype_name );
if( rc)
rc = file.ReadArray( m_segments );
if ( minor_version >= 1 )
{
if (rc)
rc = file.ReadUuid( m_linetype_id );
}
}
else
{
rc = false;
}
if ( !file.EndRead3dmChunk() )
rc = false;
}
return rc;
}
示例7: Read
ON_BOOL32 ON_Group::Read(
ON_BinaryArchive& file // restore definition from binary archive
)
{
m_group_index = -1;
m_group_name.Empty();
memset(&m_group_id,0,sizeof(m_group_id));
int major_version = 0;
int minor_version = 0;
ON_BOOL32 rc = file.Read3dmChunkVersion(&major_version,&minor_version);
if ( major_version == 1 )
{
if (rc) rc = file.ReadInt( &m_group_index );
if (rc) rc = file.ReadString( m_group_name );
if ( minor_version >= 1 )
{
if (rc) rc = file.ReadUuid( m_group_id );
}
}
else
rc = false;
return rc;
}
示例8: Default
ON_BOOL32 ON_3dmNotes::Read( ON_BinaryArchive& file )
{
Default();
int major_version = 0;
int minor_version = 0;
ON_BOOL32 rc = file.Read3dmChunkVersion( &major_version, &minor_version );
if ( rc && major_version == 1 ) {
m_notes.Destroy();
rc = file.ReadInt( &m_bHTML );
if ( rc ) rc = file.ReadString( m_notes );
if ( rc ) rc = file.ReadInt( &m_bVisible );
if ( rc ) rc = file.ReadInt( &m_window_left );
if ( rc ) rc = file.ReadInt( &m_window_top );
if ( rc ) rc = file.ReadInt( &m_window_right );
if ( rc ) rc = file.ReadInt( &m_window_bottom );
}
return rc;
}
示例9: Read
BOOL ON_UserStringList::Read(ON_BinaryArchive& archive)
{
int major_version = 0;
int minor_version = 0;
bool rc = archive.BeginRead3dmChunk(TCODE_ANONYMOUS_CHUNK,&major_version,&minor_version);
if ( !rc )
return false;
for(;;)
{
rc = (1 == major_version);
if (!rc) break;
int count = 0;
rc = archive.ReadInt(&count);
if(!rc) break;
for ( int i = 0; i < count; i++ )
{
rc = m_e.AppendNew().Read(archive);
if ( !rc)
{
m_e.Remove();
break;
}
}
if (!rc) break;
break;
}
if ( !archive.EndRead3dmChunk() )
rc = false;
return rc;
}
示例10: Read
bool ON_CheckSum::Read(ON_BinaryArchive& archive)
{
bool rc;
Zero();
rc = archive.ReadBigSize(&m_size);
if (rc)
rc = archive.ReadBigTime(&m_time);
if (rc)
rc = archive.ReadInt(8,&m_crc[0]);
if ( archive.ArchiveOpenNURBSVersion() < 200603100
|| archive.Archive3dmVersion() < 4
)
{
// ON_CheckSums in V3 archives and V4 archives with
// version < 200603100 have the same size but an
// incompatible format. These were not used.
Zero();
}
return rc;
}
示例11:
bool ON_3dmNotes::Read( ON_BinaryArchive& file )
{
*this = ON_3dmNotes::Empty;
bool rc = false;
for(;;)
{
int i;
int major_version = 0;
int minor_version = 0;
if ( !file.Read3dmChunkVersion( &major_version, &minor_version ) )
break;
if ( 1 != major_version == 1 )
break;
i = m_bHTML;
if ( !file.ReadInt( &i ) )
break;
m_bHTML = i ? true : false;
if (!file.ReadString( m_notes ))
break;
i = m_bVisible;
if (!file.ReadInt( &i ))
break;
m_bVisible = i ? true : false;
if (!file.ReadInt( &m_window_left ))
break;
if (!file.ReadInt( &m_window_top ))
break;
if (!file.ReadInt( &m_window_right ))
break;
if (!file.ReadInt( &m_window_bottom ))
break;
rc = true;
break;
}
return rc;
}
示例12: 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 );
//.........这里部分代码省略.........
示例13: Read
//.........这里部分代码省略.........
// faces
if (rc)
{
rc = m_F.Read(file);
if (rc) {
for ( i = 0; i < m_F.Count(); i++ ) {
ON_BrepFace& f = m_F[i];
f.m_brep = this;
if ( f.m_si >= 0 && f.m_si < S_count )
f.SetProxySurface(m_S[f.m_si]);
}
}
}
// bounding box
if (rc)
rc = file.ReadPoint( m_bbox.m_min );
if (rc)
rc = file.ReadPoint( m_bbox.m_max );
// fill in missing information
ReadFillInMissingBoxes(*this);
// end of chunk version 3.0
if (rc && minor_version >= 1 )
{
// added for chunk version 3.1
ON_Object* obj;
unsigned int tcode;
int value, fi;
unsigned char b;
const int face_count = m_F.Count();
// read render meshes
rc = file.BeginRead3dmChunk( &tcode, &value );
if ( rc )
{
if ( tcode != TCODE_ANONYMOUS_CHUNK )
rc = false;
else
{
for ( fi = 0; rc && fi < face_count; fi++ )
{
rc = file.ReadChar(&b);
if (rc && b)
{
rc = file.ReadObject(&obj);
m_F[fi].m_render_mesh = ON_Mesh::Cast(obj);
if ( !m_F[fi].m_render_mesh )
delete obj;
}
}
}
if ( !file.EndRead3dmChunk() )
rc = false;
}
// read analysis meshes
rc = file.BeginRead3dmChunk( &tcode, &value );
if ( rc )
{
if ( tcode != TCODE_ANONYMOUS_CHUNK )
rc = false;
else
{
for ( fi = 0; rc && fi < face_count; fi++ )
{
rc = file.ReadChar(&b);
if (rc && b)
{
rc = file.ReadObject(&obj);
m_F[fi].m_analysis_mesh = ON_Mesh::Cast(obj);
if ( !m_F[fi].m_analysis_mesh )
delete obj;
}
}
}
if ( !file.EndRead3dmChunk() )
rc = false;
}
}
if ( rc && minor_version >= 2 )
{
rc = file.ReadInt( &m_is_solid );
if ( m_is_solid < 0 || m_is_solid >= 3 )
m_is_solid = 0;
}
}
if ( file.ArchiveOpenNURBSVersion() < 20021002 )
{
m_is_solid = 0;
}
return rc;
}
示例14: ReadFillInMissingBoxes
bool ON_Brep::ReadOld101( ON_BinaryArchive& file )
{
ON_Object* pO = NULL;
ON_Curve* pC = NULL;
ON_Surface* pS = NULL;
int i, count;
// 2d curves
file.ReadInt( &count );
m_C2.Reserve(count);
for ( i = 0; i < count; i++ )
{
pO = NULL;
file.ReadObject( &pO );
pC = ON_Curve::Cast(pO);
if ( !pC )
delete pO; // ERROR!
m_C2.Append( pC );
pC = NULL;
pO = NULL;
}
// 3d curves
file.ReadInt( &count );
m_C3.Reserve(count);
for ( i = 0; i < count; i++ )
{
pO = NULL;
file.ReadObject( &pO );
pC = ON_Curve::Cast(pO);
if ( !pC )
delete pO; // ERROR!
m_C3.Append( pC );
pC = NULL;
pO = NULL;
}
// untrimmed surfaces
file.ReadInt( &count );
m_S.Reserve(count);
for ( i = 0; i < count; i++ )
{
pO = NULL;
file.ReadObject( &pO );
pS = ON_Surface::Cast(pO);
if ( !pS )
delete pO; // ERROR!
m_S.Append( pS );
pS = NULL;
pO = NULL;
}
// vertices
file.ReadInt( &count );
m_V.Reserve(count);
m_V.SetCount(count);
for ( i = 0; i < count; i++ )
{
m_V[i].Read(file);
}
// edges
file.ReadInt( &count );
m_E.Reserve(count);
m_E.SetCount(count);
for ( i = 0; i < count; i++ )
{
ON_BrepEdge& edge = m_E[i];
edge.Read(file);
edge.SetProxyCurve( edge.m_c3i >= 0 ? m_C3[edge.m_c3i] : 0 );
edge.m_brep = this;
}
// trims
file.ReadInt( &count );
m_T.Reserve(count);
m_T.SetCount(count);
for ( i = 0; i < count; i++ )
{
m_T[i].Read(file);
ON_BrepTrim& trim = m_T[i];
trim.SetProxyCurve( trim.m_c2i >= 0 ? m_C2[trim.m_c2i] : 0 );
trim.m_brep = this;
}
// loops
file.ReadInt( &count );
m_L.Reserve(count);
m_L.SetCount(count);
for ( i = 0; i < count; i++ )
{
m_L[i].Read(file);
m_L[i].m_brep = this;
}
// faces
file.ReadInt( &count );
m_F.Reserve(count);
m_F.SetCount(count);
for ( i = 0; i < count; i++ )
//.........这里部分代码省略.........
示例15: if
//.........这里部分代码省略.........
{
}
else
{
dump.Print("New user data format created after this diagnostic tool was written.\n");
}
break;
}
}
dump.PopIndent();
}
}
break;
case TCODE_OPENNURBS_CLASS_UUID:
case TCODE_USER_TABLE_UUID:
{
dump.PushIndent();
ON_UUID uuid = ON_nil_uuid;
const ON_ClassId* pClassId = 0;
if ( !file.ReadUuid( uuid ) ) {
ErrorReport(offset0,"ReadUuid() failed.",dump);
}
else
{
if ( typecode == TCODE_OPENNURBS_CLASS_UUID )
{
dump.Print("OpenNURBS class id = ");
pClassId = ON_ClassId::ClassId(uuid);
}
else if ( typecode == TCODE_USER_TABLE_UUID )
{
dump.Print("User table id = ");
}
else {
dump.Print("UUID = ");
}
dump.Print( uuid );
if ( pClassId )
{
const char* sClassName = pClassId->ClassName();
if ( sClassName )
{
dump.Print(" (%s)",sClassName);
}
}
dump.Print("\n");
}
dump.PopIndent();
}
break;
case TCODE_OPENNURBS_CLASS_USERDATA_HEADER:
{
if ( !Read3dmUserDataHeader( offset0, file, dump ) )
{
ErrorReport(offset0,"Unable to read userdata header.",dump);
}
}
break;
case TCODE_ENDOFFILE:
case TCODE_ENDOFFILE_GOO:
{
dump.PushIndent();
if ( value < 4 ) {
ErrorReport(offset0,"TCODE_ENDOFFILE chunk withlength < 4.",dump);
}
else {
int sizeof_file = 0;
file.ReadInt(&sizeof_file);
dump.Print("current position = %d stored size = %d\n",
file.CurrentPosition(),
sizeof_file);
}
dump.PopIndent();
}
break;
}
}
const size_t offset1 = file.CurrentPosition();
if ( !file.EndRead3dmChunk() )
{
ErrorReport(offset1,"EndRead3dmChunk() failed.",dump);
rc = FALSE;
}
else if (!bShortChunk)
{
const size_t extra = value - (offset1-offset0-8);
if ( extra < 0 ) {
ErrorReport(offset0,"Read beyond end of chunk.",dump);
}
}
}
return typecode;
}