本文整理汇总了C++中ON_BinaryArchive::WriteArray方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_BinaryArchive::WriteArray方法的具体用法?C++ ON_BinaryArchive::WriteArray怎么用?C++ ON_BinaryArchive::WriteArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_BinaryArchive
的用法示例。
在下文中一共展示了ON_BinaryArchive::WriteArray方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Write
ON_BOOL32 ON_PointCloud::Write( ON_BinaryArchive& file ) const
{
bool rc = file.Write3dmChunkVersion(1,1);
if (rc) rc = file.WriteArray( m_P );
if (rc) rc = file.WritePlane( m_plane );
if (rc) rc = file.WriteBoundingBox( m_bbox );
if (rc) rc = file.WriteInt( m_flags);
// added for 1.1 (7 December 2005)
if (rc) rc = file.WriteArray(m_N);
if (rc) rc = file.WriteArray(m_C);
return rc;
}
示例2: Write
ON_BOOL32 ON_Linetype::Write( ON_BinaryArchive& file) const
{
bool rc = file.BeginWrite3dmChunk(TCODE_ANONYMOUS_CHUNK,1,1);
if (rc)
{
for(;;)
{
// chunk version 1.0 fields
rc = file.WriteInt( LinetypeIndex());
if(!rc) break;
rc = file.WriteString( m_linetype_name );
if (!rc) break;
rc = file.WriteArray( m_segments );
if(!rc) break;
// chunk version 1.1 fields
rc = file.WriteUuid( m_linetype_id );
if (!rc) break;
break;
}
if ( !file.EndWrite3dmChunk() )
rc = false;
}
return rc;
}
示例3: Write
// virtual ON_Object override
ON_BOOL32 ON__IDefLayerSettingsUserData::Write(ON_BinaryArchive& binary_archive) const
{
bool rc = binary_archive.BeginWrite3dmChunk(TCODE_ANONYMOUS_CHUNK,1,1);
if ( !rc )
return false;
rc = false;
for(;;)
{
if ( !binary_archive.WriteArray(m_layers.Count(),m_layers.Array()) )
break;
// added in version 1.1 chunks
bool bHaveParentLayer = ( 0 != m_idef_layer_table_parent_layer );
if ( !binary_archive.WriteBool(bHaveParentLayer) )
break;
if ( bHaveParentLayer )
{
if ( !binary_archive.WriteObject(m_idef_layer_table_parent_layer) )
break;
}
rc = true;
break;
}
if ( !binary_archive.EndWrite3dmChunk() )
rc = false;
return rc;
}
示例4: Write
BOOL ON_HatchLine::Write( ON_BinaryArchive& ar) const
{
BOOL rc = ar.Write3dmChunkVersion(1,1);
if (rc) rc = ar.WriteDouble( m_angle);
if (rc) rc = ar.WritePoint( m_base);
if (rc) rc = ar.WriteVector( m_offset);
if (rc) rc = ar.WriteArray( m_dashes);
return rc;
}
示例5:
BOOL
ON_BrepVertex::Write( ON_BinaryArchive& file ) const
{
BOOL rc = file.WriteInt( m_vertex_index );
if ( rc )
rc = file.WritePoint( point );
if ( rc )
rc = file.WriteArray( m_ei );
if ( rc )
rc = file.WriteDouble( m_tolerance );
return rc;
}
示例6: Write
BOOL ON_BrepFace::Write( ON_BinaryArchive& file ) const
{
bool rc = file.WriteInt( m_face_index );
if ( rc )
rc = file.WriteArray( m_li );
if ( rc )
rc = file.WriteInt( m_si );
if ( rc )
rc = file.WriteInt( m_bRev );
if ( rc )
rc = file.WriteInt( m_face_material_channel );
return rc;
}
示例7: Write
ON_BOOL32 ON_BrepRegion::Write(ON_BinaryArchive& file) const
{
bool rc = file.BeginWrite3dmChunk(TCODE_ANONYMOUS_CHUNK,1,0);
if ( !rc )
return false;
for(;;)
{
rc = file.WriteInt( m_region_index );
if (!rc) break;
rc = file.WriteInt( m_type );
if (!rc) break;
rc = file.WriteArray( m_fsi );
if (!rc) break;
rc = file.WriteBoundingBox( m_bbox );
if (!rc) break;
break;
}
if (!file.EndWrite3dmChunk())
rc = false;
return rc;
}
示例8: Write
ON_BOOL32 ON_Annotation::Write( ON_BinaryArchive& file ) const
{
int i;
ON_BOOL32 rc = file.Write3dmChunkVersion( 1, 0 );
// TODO: use
// if (rc) rc = file.WritePoint(....);
// if (rc) rc = file.WriteString(....);
// if (rc) rc = file.WriteDouble(....);
// to write object.
i = m_type;
if (rc)
rc = file.WriteInt( i );
if (rc)
rc = file.WritePlane( m_plane );
if (rc)
rc = file.WriteArray( m_points );
if (rc)
rc = file.WriteString( m_usertext );
if (rc)
rc = file.WriteString( m_defaulttext );
if( rc )
rc = file.WriteInt( m_userpositionedtext );
return rc;
}
示例9: switch
ON_BOOL32 ON_3dmObjectAttributes::Write( ON_BinaryArchive& file ) const
{
if ( file.Archive3dmVersion() >= 5 )
{
// added at opennurbs version 200712190
return WriteV5Helper(file);
}
bool rc = file.Write3dmChunkVersion(1,7);
// version 1.0 fields
if (rc) rc = file.WriteUuid(m_uuid);
if (rc) rc = file.WriteInt(m_layer_index);
if (rc) rc = file.WriteInt(m_material_index);
if (rc) rc = file.WriteColor(m_color);
if (rc)
{
// OBSOLETE if (rc) rc = file.WriteLineStyle(m_line_style); // 23 March 2005 Dale Lear
short s;
s = (short)m_object_decoration;
if (rc) rc = file.WriteShort(s);
s = 0;
if (rc) rc = file.WriteShort(s);
if (rc) rc = file.WriteDouble(0.0);
if (rc) rc = file.WriteDouble(1.0);
}
if (rc) rc = file.WriteInt(m_wire_density);
if (rc) rc = file.WriteChar(m_mode);
if (rc) rc = file.WriteChar(m_color_source);
if (rc) rc = file.WriteChar(m_linetype_source);
if (rc) rc = file.WriteChar(m_material_source);
if (rc) rc = file.WriteString(m_name);
if (rc) rc = file.WriteString(m_url);
// version 1.1 fields
if (rc) rc = file.WriteArray(m_group);
// version 1.2 fields
if (rc) rc = file.WriteBool(m_bVisible);
// version 1.3 fields
if (rc) rc = file.WriteArray(m_dmref);
// version 1.4 fields - 23 March 2005 Dale Lear
if (rc) rc = file.WriteInt(m_object_decoration);
if (rc) rc = file.WriteChar(m_plot_color_source);
if (rc) rc = file.WriteColor(m_plot_color);
if (rc) rc = file.WriteChar(m_plot_weight_source);
if (rc) rc = file.WriteDouble(m_plot_weight_mm);
// version 1.5 fields 11 April 2005
if (rc) rc = file.WriteInt(m_linetype_index);
// version 1.6 fields 2 September 2005
if (rc)
{
unsigned char uc = 0;
switch(m_space)
{
case ON::no_space: uc = 0; break;
case ON::model_space: uc = 0; break;
case ON::page_space: uc = 1; break;
}
rc = file.WriteChar(uc);
}
if (rc)
{
// 22 Sep 2006 - the way ON_3dmObjectAttiributes indicates
// that an object is put on a particular page view changed
// from being saved in the m_dmref[] list to using the
// m_space and m_viewport_id settings. But the file format
// cannot change at this point. So, the bAddPagespaceDMR
// is here to save the page info in the old dmr format.
int count = m_dmref.Count();
if ( count < 0 )
count = 0;
bool bAddPagespaceDMR = ( ON::page_space == m_space && !ON_UuidIsNil(m_viewport_id) );
rc = file.WriteInt( bAddPagespaceDMR ? (count+1) : count );
if ( rc && bAddPagespaceDMR )
{
rc = file.WriteUuid(m_viewport_id);
if (rc) rc = file.WriteUuid(ON_ObsoletePageSpaceObjectId);
}
int i;
for ( i = 0; i < count && rc; i++ )
{
const ON_DisplayMaterialRef& dmr = m_dmref[i];
rc = file.WriteUuid(dmr.m_viewport_id);
if (rc) rc = file.WriteUuid(dmr.m_display_material_id);
}
}
// version 1.7 fields 6 June 2006
if (rc) rc = m_rendering_attributes.Write(file);
return rc;
}
示例10: while
//.........这里部分代码省略.........
{
c = 12;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteChar(m_mode);
if (!rc) break;
}
if ( ON::color_from_layer != m_color_source )
{
c = 13;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteChar(m_color_source);
if (!rc) break;
}
if ( ON::plot_color_from_layer != m_plot_color_source )
{
c = 14;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteChar(m_plot_color_source);
if (!rc) break;
}
if ( ON::plot_weight_from_layer != m_plot_weight_source )
{
c = 15;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteChar(m_plot_weight_source);
if (!rc) break;
}
if ( ON::material_from_layer != m_material_source )
{
c = 16;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteChar(m_material_source);
if (!rc) break;
}
if ( ON::linetype_from_layer != m_linetype_source )
{
c = 17;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteChar(m_linetype_source);
if (!rc) break;
}
if ( m_group.Count() > 0 )
{
c = 18;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteArray(m_group);
if (!rc) break;
}
if ( ON::model_space != m_space )
{
c = 19;
rc = file.WriteChar(c);
if (!rc) break;
c = (unsigned char)m_space;
rc = file.WriteChar(c);
if (!rc) break;
}
if ( !ON_UuidIsNil(m_viewport_id) )
{
c = 20;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteUuid(m_viewport_id);
if (!rc) break;
}
if ( m_dmref.Count() > 0 )
{
c = 21;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteArray(m_dmref);
if (!rc) break;
}
// 29 Nov. 2009 - S. Baer
// Only write m_display_order if it's value!=0
// m_display_order is written to version 2.1 files
if ( 0 != m_display_order )
{
c = 22;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteInt(m_display_order);
if (!rc) break;
}
// 0 indicates end of attributes;
c = 0;
rc = file.WriteChar(c);
break;
}
return rc;
}
示例11: Write
ON_BOOL32 ON_InstanceDefinition::Write(
ON_BinaryArchive& binary_archive
) const
{
bool rc = binary_archive.Write3dmChunkVersion(1,5);
// version 1.0 fields
if ( rc )
rc = binary_archive.WriteUuid( m_uuid );
if ( rc )
{
if ( binary_archive.Archive3dmVersion() >= 4
&& ON_InstanceDefinition::linked_def == m_idef_update_type )
{
// linked instance definition geometry is never in the file
ON_SimpleArray<ON_UUID> empty_uuid_list;
rc = binary_archive.WriteArray( empty_uuid_list );
}
else
{
rc = binary_archive.WriteArray( m_object_uuid );
}
}
if ( rc )
rc = binary_archive.WriteString( m_name );
if ( rc )
rc = binary_archive.WriteString( m_description );
if ( rc )
rc = binary_archive.WriteString( m_url );
if ( rc )
rc = binary_archive.WriteString( m_url_tag );
if ( rc )
rc = binary_archive.WriteBoundingBox( 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
if ( rc )
rc = binary_archive.WriteInt( (unsigned int)m_idef_update_type );
if ( rc )
rc = binary_archive.WriteString( m_source_archive );
// version 1.1 fields
if (rc)
rc = m_source_archive_checksum.Write( binary_archive );
// version 1.2 fields
if (rc)
rc = binary_archive.WriteInt( m_us.m_unit_system );
// version 1.3 fields - added 6 March 2006
if (rc)
rc = binary_archive.WriteDouble( m_us.m_custom_unit_scale );
if ( rc )
rc = binary_archive.WriteBool( m_source_bRelativePath );
// version 1.4 fields
if (rc)
rc = m_us.Write(binary_archive);
// version 1.5 fields
if (rc)
rc = binary_archive.WriteInt(m_idef_update_depth);
return rc;
}
示例12: Write
ON_BOOL32 ON_InstanceDefinition::Write(
ON_BinaryArchive& binary_archive
) const
{
bool rc = binary_archive.Write3dmChunkVersion(1,6);
// version 1.0 fields
if ( rc )
rc = binary_archive.WriteUuid( m_uuid );
if ( rc )
{
if ( binary_archive.Archive3dmVersion() >= 4
&& ON_InstanceDefinition::linked_def == m_idef_update_type )
{
// linked instance definition geometry is never in the file
ON_SimpleArray<ON_UUID> empty_uuid_list;
rc = binary_archive.WriteArray( empty_uuid_list );
}
else
{
rc = binary_archive.WriteArray( m_object_uuid );
}
}
if ( rc )
rc = binary_archive.WriteString( m_name );
if ( rc )
rc = binary_archive.WriteString( m_description );
if ( rc )
rc = binary_archive.WriteString( m_url );
if ( rc )
rc = binary_archive.WriteString( m_url_tag );
if ( rc )
rc = binary_archive.WriteBoundingBox( 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
const unsigned int idef_update_type = (unsigned int)this->IdefUpdateType();
if ( rc )
rc = binary_archive.WriteInt( idef_update_type );
if ( rc )
{
// 7 February 2012
// Purge source archive information from static_defs
if ( ON_InstanceDefinition::static_def == idef_update_type )
{
ON_wString empty_string;
rc = binary_archive.WriteString( empty_string );
}
else
rc = binary_archive.WriteString( m_source_archive );
}
// version 1.1 fields
if (rc)
{
// 7 February 2012
// Purge source archive information from static_defs
if ( ON_InstanceDefinition::static_def == idef_update_type )
ON_CheckSum::UnsetCheckSum.Write(binary_archive);
else
rc = m_source_archive_checksum.Write( binary_archive );
}
// version 1.2 fields
if (rc)
rc = binary_archive.WriteInt( m_us.m_unit_system );
// version 1.3 fields - added 6 March 2006
if (rc)
rc = binary_archive.WriteDouble( m_us.m_custom_unit_scale );
if ( rc )
{
bool b = (ON_InstanceDefinition::static_def == idef_update_type)
? false
: m_source_bRelativePath;
rc = binary_archive.WriteBool( b );
}
// version 1.4 fields
if (rc)
rc = m_us.Write(binary_archive);
// version 1.5 fields
if (rc)
rc = binary_archive.WriteInt(m_idef_update_depth);
// version 1.6 fields ( added 14 February 2012 )
if (rc)
rc = binary_archive.WriteInt( m_idef_layer_style );
return rc;
}