本文整理汇总了C++中ON_BinaryArchive::Read3dmChunkVersion方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_BinaryArchive::Read3dmChunkVersion方法的具体用法?C++ ON_BinaryArchive::Read3dmChunkVersion怎么用?C++ ON_BinaryArchive::Read3dmChunkVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_BinaryArchive
的用法示例。
在下文中一共展示了ON_BinaryArchive::Read3dmChunkVersion方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Read
BOOL ON_BrepLoopArray::Read( ON_BinaryArchive& file )
{
Empty();
unsigned int tcode = 0;
int count = 0;
int i;
int major_version = 0;
int minor_version = 0;
BOOL rc = file.BeginRead3dmChunk( &tcode, &i );
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_BrepLoop& loop = AppendNew();
rc = loop.Read(file);
}
}
else {
rc = 0;
}
}
if ( !file.EndRead3dmChunk() )
rc = false;
}
return rc;
}
示例2: Read
ON_BOOL32 ON__OBSOLETE__CircleCurve::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)
{
if (major_version==1)
{
// common to all 1.x versions
ON_Circle circle;
rc = file.ReadCircle( circle );
m_arc = circle;
if (rc)
rc = file.ReadInterval( m_t );
if (rc)
rc = file.ReadInt(&m_dim);
if ( m_dim != 2 && m_dim != 3 )
m_dim = 3;
}
}
return rc;
}
示例3: Read
ON_BOOL32 ON_BrepLoopArray::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_BrepLoop& loop = AppendNew();
rc = loop.Read(file) ? true : false;
}
}
else {
rc = 0;
}
}
if ( !file.EndRead3dmChunk() )
rc = false;
}
return rc;
}
示例4: Index
bool ON_Group::Internal_ReadV5(
ON_BinaryArchive& file // restore definition from binary archive
)
{
*this = ON_Group::Unset;
int major_version = 0;
int minor_version = 0;
bool rc = file.Read3dmChunkVersion(&major_version,&minor_version);
if ( major_version == 1 )
{
int group_index = Index();
if (rc) rc = file.ReadInt( &group_index );
if (rc) SetIndex(group_index);
ON_wString group_name;
if (rc) rc = file.ReadString( group_name );
if (rc)
SetName(group_name);
if ( minor_version >= 1 )
{
ON_UUID group_id = ON_nil_uuid;
if (rc) rc = file.ReadUuid( group_id );
if (rc) SetId(group_id);
}
if (rc && IdIsNil() )
{
// modern times require unique ids.
SetId();
}
}
else
rc = false;
return rc;
}
示例5:
ON_BOOL32
ON_PlaneSurface::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 formats
if (rc)
rc = file.ReadPlane( m_plane );
if (rc)
rc = file.ReadInterval( m_domain[0] );
if (rc)
rc = file.ReadInterval( m_domain[1] );
m_extents[0] = m_domain[0];
m_extents[1] = m_domain[1];
if ( minor_version >= 1 )
{
if (rc)
rc = file.ReadInterval( m_extents[0] );
if (rc)
rc = file.ReadInterval( m_extents[1] );
}
}
return rc;
}
示例6: Read
ON_BOOL32 ON_HatchPattern::Read( ON_BinaryArchive& ar)
{
m_hatchpattern_index = -1;
memset(&m_hatchpattern_id,0,sizeof(m_hatchpattern_id));
m_type = ftSolid;
m_hatchpattern_name.Empty();
m_description.Empty();
m_lines.Empty();
int i;
int major_version = 0;
int minor_version = 0;
ON_BOOL32 rc = ar.Read3dmChunkVersion( &major_version, &minor_version);
if ( major_version == 1 )
{
if( rc) rc = ar.ReadInt( &m_hatchpattern_index);
i = 0;
if( rc) rc = ar.ReadInt( &i);
if( rc)
{
switch( i)
{
case 0: m_type = ftSolid; break;
case 1: m_type = ftLines; break;
case 2: m_type = ftGradient; break;
default: rc = false; break;
}
}
if( rc) rc = ar.ReadString( m_hatchpattern_name);
if( rc) rc = ar.ReadString( m_description);
if( rc)
{
if( m_type == ftLines)
{
m_lines.Empty();
int count = 0;
rc = ar.ReadInt( &count);
if( rc && count > 0 )
{
m_lines.SetCapacity( count);
int i;
for( i = 0; rc && i < count; i++)
{
ON_HatchLine& line = m_lines.AppendNew();
rc = line.Read( ar);
}
}
}
}
if ( minor_version >= 2 )
{
rc = ar.ReadUuid(m_hatchpattern_id);
}
}
return rc;
}
示例7:
ON_BOOL32 ON_3dmApplication::Read( ON_BinaryArchive& file )
{
int major_version = 0;
int minor_version = 0;
ON_BOOL32 rc = file.Read3dmChunkVersion( &major_version, &minor_version );
if (rc) rc = file.ReadString( m_application_name );
if (rc) rc = file.ReadString( m_application_URL );
if (rc) rc = file.ReadString( m_application_details );
return rc;
}
示例8: ReadDocument
BOOL CSampleDocumentUserDataPlugIn::ReadDocument( CRhinoDoc& doc, ON_BinaryArchive& archive, const CRhinoFileReadOptions& options )
{
// Read plug-in document data. See rhinoSdkPlugIn.h details.
// If our document data is found in a 3DM file, we are
// required to read it. But, we don't necessarily want
// to use it.
BOOL bKeepData = FALSE;
BOOL bNewMode = options.Mode( CRhinoFileReadOptions::NewMode );
BOOL bOpenMode = options.Mode( CRhinoFileReadOptions::OpenMode );
// If the user is creating a new model, or opening an existing
// model, we'll want to keep the document data that we read.
// Otherwise, we'll read the data, but not use it. This way,
// we won't overwrite out data if the user is importing geometry,
// from another 3DM file.
if( bNewMode || bOpenMode )
bKeepData = TRUE;
if( bKeepData )
m_string_table.Empty();
// Read the major and minor version of the document data
int major = 0, minor = 0;
if( !archive.Read3dmChunkVersion(&major, &minor) )
return FALSE;
// At this point, if we've changed the format of
// our document data, we'll want to compare the
// major and minor revision numbers and read our
// data accordingly.
if( 1 != major && 0 != minor )
return FALSE;
// Read the number of string we intend to read as document data
int count = 0;
if( !archive.ReadInt(&count) )
return FALSE;
// Read our string table as document data
ON_wString str;
for( int i = 0; i < count; i++ )
{
if( !archive.ReadString(str) )
return FALSE;
// Only append the string if we are
// supposed to
if( bKeepData )
m_string_table.Append(str);
}
return TRUE;
}
示例9: Read
ON_BOOL32 ON_Point::Read( ON_BinaryArchive& 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.ReadPoint(point);
}
return rc;
}
示例10: Read
ON_BOOL32 ON_Light::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 ) {
int i;
// version 1.0 fields
i = 0;
if ( rc ) rc = file.ReadInt( &i );
if ( rc ) Enable(i);
if ( rc ) rc = file.ReadInt( &i );
if ( rc ) SetStyle(ON::LightStyle(i));
if ( rc ) rc = file.ReadDouble( &m_intensity );
if ( rc ) rc = file.ReadDouble( &m_watts );
if ( rc ) rc = file.ReadColor( m_ambient );
if ( rc ) rc = file.ReadColor( m_diffuse );
if ( rc ) rc = file.ReadColor( m_specular );
if ( rc ) rc = file.ReadVector( m_direction );
if ( rc ) rc = file.ReadPoint( m_location );
if ( rc ) rc = file.ReadDouble( &m_spot_angle );
if ( rc ) rc = file.ReadDouble( &m_spot_exponent );
if ( rc ) rc = file.ReadVector( m_attenuation );
if ( rc ) rc = file.ReadDouble( &m_shadow_intensity );
if ( rc ) rc = file.ReadInt( &m_light_index );
if ( rc ) rc = file.ReadUuid( m_light_id );
if ( rc ) rc = file.ReadString( m_light_name );
if ( minor_version < 2 ) {
// set hotspot from 1.0 or 1.1 m_spot_exponent
double h = 1.0 - m_spot_exponent/128.0;
if ( h < 0.0 )
h = 0.0;
else if ( h > 1.0 )
h = 1.0;
m_hotspot = h;
m_spot_exponent = 0.0;
}
if ( minor_version >= 1 ) {
// version 1.1 fields
if ( rc ) rc = file.ReadVector( m_length );
if ( rc ) rc = file.ReadVector( m_width );
if ( minor_version >= 2 ) {
// version 1.2 fields
if ( rc ) rc = file.ReadDouble( &m_hotspot );
}
}
}
return rc;
}
示例11: 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;
}
示例12: Read
ON_BOOL32 ON_AnnotationTextDot::Read( ON_BinaryArchive& file )
{
m_text.Destroy();
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.ReadPoint( point );
if (rc) rc = file.ReadString( m_text );
}
else {
rc = false;
}
return rc;
}
示例13: Default
ON_BOOL32 ON_3dmRevisionHistory::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 ) {
rc = file.ReadString( m_sCreatedBy );
if (rc) rc = file.ReadTime( m_create_time );
if (rc) rc = file.ReadString( m_sLastEditedBy );
if (rc) rc = file.ReadTime(m_last_edit_time );
if (rc) rc = file.ReadInt( &m_revision_count );
}
return rc;
}
示例14: 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;
}
示例15: Read
ON_BOOL32 ON_SurfaceArray::Read( ON_BinaryArchive& file )
{
int major_version = 0;
int minor_version = 0;
ON__UINT32 tcode = 0;
ON__INT64 big_value = 0;
int flag;
Destroy();
ON_BOOL32 rc = file.BeginRead3dmBigChunk( &tcode, &big_value );
if (rc)
{
rc = ( tcode == TCODE_ANONYMOUS_CHUNK );
if (rc) rc = file.Read3dmChunkVersion(&major_version,&minor_version);
if (rc && major_version == 1) {
ON_Object* p;
int count;
ON_BOOL32 rc = file.ReadInt( &count );
if (rc) {
SetCapacity(count);
SetCount(count);
Zero();
int i;
for ( i = 0; rc && i < count && rc; i++ ) {
flag = 0;
rc = file.ReadInt(&flag);
if (rc && flag==1) {
p = 0;
rc = file.ReadObject( &p ); // polymorphic surfaces
m_a[i] = ON_Surface::Cast(p);
if ( !m_a[i] )
delete p;
}
}
}
}
else {
rc = false;
}
if ( !file.EndRead3dmChunk() )
rc = false;
}
return rc;
}