本文整理汇总了C++中ON_BinaryArchive::ReadArray方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_BinaryArchive::ReadArray方法的具体用法?C++ ON_BinaryArchive::ReadArray怎么用?C++ ON_BinaryArchive::ReadArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_BinaryArchive
的用法示例。
在下文中一共展示了ON_BinaryArchive::ReadArray方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Read
BOOL ON_BrepLoop::Read( ON_BinaryArchive& file )
{
int i;
BOOL rc = file.ReadInt( & m_loop_index );
if (rc)
rc = file.ReadArray( m_ti );
i = unknown;
if (rc)
rc = file.ReadInt( &i );
switch(i) {
case unknown:
m_type = unknown;
break;
case outer:
m_type = outer;
break;
case inner:
m_type = inner;
break;
case slit:
m_type = slit;
break;
}
if (rc)
rc = file.ReadInt( &m_fi );
return rc;
}
示例2: Read
ON_BOOL32 ON_BrepRegion::Read(ON_BinaryArchive& file)
{
int major_version = 0;
int minor_version = 0;
bool rc = file.BeginRead3dmChunk(TCODE_ANONYMOUS_CHUNK,&major_version,&minor_version);
if ( !rc )
return false;
for(;;)
{
rc = (1==major_version);
if (!rc) break;
rc = file.ReadInt( &m_region_index );
if (!rc) break;
rc = file.ReadInt( &m_type );
if (!rc) break;
rc = file.ReadArray( m_fsi );
if (!rc) break;
rc = file.ReadBoundingBox( m_bbox );
if (!rc) break;
break;
}
if (!file.EndRead3dmChunk())
rc = false;
return rc;
}
示例3: Read
// virtual ON_Object override
ON_BOOL32 ON__IDefLayerSettingsUserData::Read(ON_BinaryArchive& binary_archive)
{
DestroyHelper();
int major_version = 0;
int minor_version = 0;
bool rc = binary_archive.BeginRead3dmChunk(TCODE_ANONYMOUS_CHUNK,&major_version,&minor_version);
if ( !rc )
return false;
rc = false;
while ( 1 == major_version )
{
if ( !binary_archive.ReadArray(m_layers) )
break;
if ( minor_version <= 0 )
{
rc = true;
break;
}
// added in version 1.1 chunks
bool bHaveParentLayer = false;
if ( !binary_archive.ReadBool(&bHaveParentLayer) )
break;
if ( bHaveParentLayer )
{
ON_Object* p = 0;
if ( !binary_archive.ReadObject(&p) || 0 == p )
{
if (p)
{
delete p;
break;
}
}
m_idef_layer_table_parent_layer = ON_Layer::Cast(p);
if ( 0 == m_idef_layer_table_parent_layer )
{
delete p;
break;
}
}
rc = true;
break;
}
if ( !binary_archive.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:
BOOL
ON_BrepVertex::Read( ON_BinaryArchive& file )
{
BOOL rc = file.ReadInt( &m_vertex_index );
if ( rc )
rc = file.ReadPoint( point );
if ( rc )
rc = file.ReadArray( m_ei );
if ( rc )
rc = file.ReadDouble( &m_tolerance );
return rc;
}
示例6: Read
BOOL ON_HatchLine::Read( ON_BinaryArchive& ar)
{
m_angle = 0.0;
m_base.Set( 0.0, 0.0);
m_offset.Set( 0.0, 1.0);
m_dashes.Empty();
int major_version = 0;
int minor_version = 0;
BOOL rc = ar.Read3dmChunkVersion( &major_version, &minor_version);
if ( major_version == 1 )
{
if ( rc) rc = ar.ReadDouble( &m_angle);
if ( rc) rc = ar.ReadPoint( m_base);
if ( rc) rc = ar.ReadVector( m_offset);
if ( rc) rc = ar.ReadArray( m_dashes);
}
return rc;
}
示例7: Read
ON_BOOL32 ON_Annotation::Read( ON_BinaryArchive& file )
{
Destroy();
int major_version = 0;
int minor_version = 0;
ON_BOOL32 rc = file.Read3dmChunkVersion(&major_version,&minor_version);
if ( rc && major_version == 1 )
{
int i;
if (rc)
{
rc = file.ReadInt( &i );
if (rc)
m_type = ON::AnnotationType(i);
}
if (rc)
rc = file.ReadPlane( m_plane );
if (rc)
rc = file.ReadArray( m_points );
if (rc)
rc = file.ReadString( m_usertext );
if (rc)
rc = file.ReadString( m_defaulttext );
if( rc )
{
rc = file.ReadInt( &i );
if (rc) m_userpositionedtext = i ? true : false;
}
}
if( fabs( m_plane.origin.x) > REALLY_BIG_NUMBER || fabs( m_plane.origin.y) > REALLY_BIG_NUMBER || fabs( m_plane.origin.z) > REALLY_BIG_NUMBER)
return false;
for( int i = 0; i < m_points.Count(); i++)
{
if( fabs( m_points[i].x) > REALLY_BIG_NUMBER || fabs( m_points[i].y) > REALLY_BIG_NUMBER)
return false;
}
return rc;
}
示例8: 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;
}
示例9: Default
ON_BOOL32 ON_3dmObjectAttributes::Read( ON_BinaryArchive& file )
{
Default();
if ( file.Archive3dmVersion() >= 5
&& file.ArchiveOpenNURBSVersion() >= 200712190 )
{
return ReadV5Helper(file);
}
int i;
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.ReadUuid(m_uuid);
if (rc) rc = file.ReadInt(&m_layer_index);
if (rc) rc = file.ReadInt(&m_material_index);
if (rc) rc = file.ReadColor(m_color);
while(rc)
{
// OBSOLETE if (rc) rc = file.ReadLineStyle(m_line_style); // 23 March 2005 Dale Lear
// replaced with
short s = 0;
double x;
rc = file.ReadShort(&s);
if (!rc) break;
if ( file.Archive3dmVersion() < 4 || file.ArchiveOpenNURBSVersion() < 200503170 )
{
// ignore unused linestyle info in old files
// This bit keeps the curve arrowheads from V3 showing up
// in V4.
m_object_decoration = ON::ObjectDecoration( (s & ON::both_arrowhead) );
}
rc = file.ReadShort(&s);
if (!rc) break;
rc = file.ReadDouble(&x);
if (!rc) break;
rc = file.ReadDouble(&x);
break;
}
if (rc) rc = file.ReadInt(&m_wire_density);
if (rc) rc = file.ReadChar(&m_mode);
if (rc) rc = file.ReadChar(&m_color_source);
if (rc) m_color_source = (unsigned char)ON::ObjectColorSource(m_color_source);
if (rc) rc = file.ReadChar(&m_linetype_source);
if (rc) m_linetype_source = (unsigned char)ON::ObjectLinetypeSource(m_linetype_source);
if (rc) rc = file.ReadChar(&m_material_source);
if (rc) m_material_source = (unsigned char)ON::ObjectMaterialSource(m_material_source);
if (rc) rc = file.ReadString(m_name);
if (rc) rc = file.ReadString(m_url);
m_bVisible = (Mode() != ON::hidden_object);
if ( rc && minor_version >= 1 )
{
rc = file.ReadArray( m_group );
if ( rc && minor_version >= 2 )
{
rc = file.ReadBool(&m_bVisible);
if ( rc && minor_version >= 3 )
{
rc = file.ReadArray(m_dmref);
if (rc && minor_version >= 4 )
{
// 23 March 2005 Dale Lear
// Added m_plot_color_source and m_plot_color
i = 0;
if (rc) rc = file.ReadInt(&i);
if (rc) m_object_decoration = ON::ObjectDecoration(i);
if (rc) rc = file.ReadChar(&m_plot_color_source);
if (rc) m_plot_color_source = (unsigned char)ON::PlotColorSource(m_plot_color_source);
if (rc) rc = file.ReadColor( m_plot_color );
if (rc) rc = file.ReadChar(&m_plot_weight_source);
if (rc) m_plot_weight_source = (unsigned char)ON::PlotWeightSource(m_plot_weight_source);
if (rc) rc = file.ReadDouble(&m_plot_weight_mm);
if (rc && minor_version >= 5 )
{
// version 1.5 fields 11 April 2005
if (rc) rc = file.ReadInt(&m_linetype_index);
// version 1.6 fields 2 September 2005
if (rc && minor_version >= 6 )
{
unsigned char uc = 0;
rc = file.ReadChar(&uc);
if (rc)
{
m_space = (1 == uc) ? ON::page_space : ON::model_space;
m_dmref.Empty();
int i, count=0;
rc = file.ReadInt(&count);
//.........这里部分代码省略.........
示例10: while
//.........这里部分代码省略.........
rc = file.ReadChar(&itemid);
if ( !rc || 0 == itemid ) break;
}
if ( 14 == itemid )
{
rc = file.ReadChar(&m_plot_color_source);
if (!rc) break;
rc = file.ReadChar(&itemid);
if ( !rc || 0 == itemid ) break;
}
if ( 15 == itemid )
{
rc = file.ReadChar(&m_plot_weight_source);
if (!rc) break;
rc = file.ReadChar(&itemid);
if ( !rc || 0 == itemid ) break;
}
if ( 16 == itemid )
{
rc = file.ReadChar(&m_material_source);
if (!rc) break;
rc = file.ReadChar(&itemid);
if ( !rc || 0 == itemid ) break;
}
if ( 17 == itemid )
{
rc = file.ReadChar(&m_linetype_source);
if (!rc) break;
rc = file.ReadChar(&itemid);
if ( !rc || 0 == itemid ) break;
}
if ( 18 == itemid )
{
rc = file.ReadArray(m_group);
if (!rc) break;
rc = file.ReadChar(&itemid);
if ( !rc || 0 == itemid ) break;
}
if ( 19 == itemid )
{
rc = file.ReadChar(&c);
if (!rc) break;
m_space = ON::ActiveSpace(c);
rc = file.ReadChar(&itemid);
if ( !rc || 0 == itemid ) break;
}
if ( 20 == itemid )
{
rc = file.ReadUuid(m_viewport_id);
if (!rc) break;
rc = file.ReadChar(&itemid);
if ( !rc || 0 == itemid ) break;
}
if ( 21 == itemid )
{
rc = file.ReadArray(m_dmref);
if (!rc) break;
rc = file.ReadChar(&itemid);
if ( !rc || 0 == itemid ) break;
}
// items 1 - 21 are in chunk version 2.0 files
if ( minor_version <= 0 )
break;
// 28 Nov. 2009 - S. Baer
示例11: Read
ON_BOOL32 ON_InstanceDefinition::Read(
ON_BinaryArchive& binary_archive
)
{
int major_version = 0;
int minor_version = 0;
m_us.m_custom_unit_scale = 0.0;
m_us.m_custom_unit_name.Destroy();
m_us.m_unit_system = ON::no_unit_system;
m_source_bRelativePath = false;
m_source_archive.Destroy();
bool rc = binary_archive.Read3dmChunkVersion(&major_version,&minor_version);
if ( rc )
{
if ( major_version != 1 )
rc = false;
// version 1.0 fields
if ( rc )
rc = binary_archive.ReadUuid( m_uuid );
if ( rc )
rc = binary_archive.ReadArray( m_object_uuid );
if ( rc )
rc = binary_archive.ReadString( m_name );
if ( rc )
rc = binary_archive.ReadString( m_description );
if ( rc )
rc = binary_archive.ReadString( m_url );
if ( rc )
rc = binary_archive.ReadString( m_url_tag );
if ( rc )
rc = binary_archive.ReadBoundingBox( m_bbox );
// m_idef_update_type was an unsigned int and got changed to an enum. Read and write
// as an unsigned int to support backwards compatibility
unsigned int source = m_idef_update_type;
if ( rc )
rc = binary_archive.ReadInt( &source );
if( rc)
m_idef_update_type = ON_InstanceDefinition::IdefUpdateType(source);
if ( rc )
rc = binary_archive.ReadString( m_source_archive );
// version 1.1 fields
if ( minor_version >= 1 )
{
if ( rc )
rc = m_source_archive_checksum.Read( binary_archive );
}
// version 1.2 fields
if ( minor_version >= 2 )
{
int us = ON::no_unit_system;
if ( rc )
rc = binary_archive.ReadInt( &us );
m_us.m_unit_system = ON::UnitSystem(us);
if ( ON::custom_unit_system != m_us.m_unit_system && ON::no_unit_system != m_us.m_unit_system )
{
m_us.m_custom_unit_scale = ON::UnitScale( m_us.m_unit_system, ON::meters );
}
else
{
m_us.m_custom_unit_scale = 0.0;
}
if ( minor_version >= 3 )
{
// version 1.3 fields - added 6 March 2006
//int us = ON::no_unit_system;
if ( rc )
rc = binary_archive.ReadDouble( &m_us.m_custom_unit_scale );
if ( rc )
rc = binary_archive.ReadBool( &m_source_bRelativePath );
if ( rc && minor_version >= 4 )
{
rc = m_us.Read(binary_archive);
if (rc && minor_version >= 5 )
{
rc = binary_archive.ReadInt(&m_idef_update_depth);
}
}
}
}
}
return rc;
}
示例12: Read
ON_BOOL32 ON_InstanceDefinition::Read(
ON_BinaryArchive& binary_archive
)
{
int major_version = 0;
int minor_version = 0;
m_idef_layer_style = 0;
m_us.m_custom_unit_scale = 0.0;
m_us.m_custom_unit_name.Destroy();
m_us.m_unit_system = ON::no_unit_system;
m_source_bRelativePath = false;
m_source_archive.Destroy();
bool rc = binary_archive.Read3dmChunkVersion(&major_version,&minor_version);
if ( rc )
{
if ( major_version != 1 )
rc = false;
// version 1.0 fields
if ( rc )
rc = binary_archive.ReadUuid( m_uuid );
if ( rc )
rc = binary_archive.ReadArray( m_object_uuid );
if ( rc )
rc = binary_archive.ReadString( m_name );
if ( rc )
rc = binary_archive.ReadString( m_description );
if ( rc )
rc = binary_archive.ReadString( m_url );
if ( rc )
rc = binary_archive.ReadString( m_url_tag );
if ( rc )
rc = binary_archive.ReadBoundingBox( m_bbox );
// m_idef_update_type was an unsigned int and got changed to an enum. Read and write
// as an unsigned int to support backwards compatibility
unsigned int source = m_idef_update_type;
if ( rc )
rc = binary_archive.ReadInt( &source );
if( rc)
m_idef_update_type = ON_InstanceDefinition::IdefUpdateType(source);
if ( rc )
rc = binary_archive.ReadString( m_source_archive );
// version 1.1 fields
if ( minor_version >= 1 )
{
if ( rc )
rc = m_source_archive_checksum.Read( binary_archive );
}
// version 1.2 fields
if ( minor_version >= 2 )
{
int us = ON::no_unit_system;
if ( rc )
rc = binary_archive.ReadInt( &us );
m_us.m_unit_system = ON::UnitSystem(us);
if ( ON::custom_unit_system != m_us.m_unit_system && ON::no_unit_system != m_us.m_unit_system )
{
m_us.m_custom_unit_scale = ON::UnitScale( m_us.m_unit_system, ON::meters );
}
else
{
m_us.m_custom_unit_scale = 0.0;
}
if ( minor_version >= 3 )
{
// version 1.3 fields - added 6 March 2006
//int us = ON::no_unit_system;
if ( rc )
rc = binary_archive.ReadDouble( &m_us.m_custom_unit_scale );
if ( rc )
rc = binary_archive.ReadBool( &m_source_bRelativePath );
if ( rc && minor_version >= 4 )
{
rc = m_us.Read(binary_archive);
if (rc && minor_version >= 5 )
{
rc = binary_archive.ReadInt(&m_idef_update_depth);
if ( rc && minor_version >= 6 )
{
unsigned int i = 0;
rc = binary_archive.ReadInt(&i);
if ( i && i > 0 && i < 256 )
m_idef_layer_style = (unsigned char)i;
}
}
}
}
}
if ( ON_InstanceDefinition::embedded_def == m_idef_update_type )
{
// 7 February 2012
// "embedded_def" is obsolete.
if (m_source_archive.Length() > 0 )
//.........这里部分代码省略.........