本文整理汇总了C++中ON_BinaryArchive::WriteChar方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_BinaryArchive::WriteChar方法的具体用法?C++ ON_BinaryArchive::WriteChar怎么用?C++ ON_BinaryArchive::WriteChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_BinaryArchive
的用法示例。
在下文中一共展示了ON_BinaryArchive::WriteChar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Write
BOOL ON_BrepTrim::Write( ON_BinaryArchive& file ) const
{
ON_3dPoint P(0.0,0.0,0.0);
BOOL rc = file.WriteInt( m_trim_index );
int i;
if ( rc )
rc = file.WriteInt( m_c2i );
if ( rc )
rc = file.WriteInterval( ProxyCurveDomain() );
if ( rc )
rc = file.WriteInt( m_ei );
if ( rc )
rc = file.WriteInt( 2, m_vi );
if ( rc )
rc = file.WriteInt( m_bRev3d );
i = m_type;
if ( rc )
rc = file.WriteInt( i );
i = m_iso;
if ( rc )
rc = file.WriteInt( i );
if ( rc )
rc = file.WriteInt( m_li );
if ( rc )
rc = file.WriteDouble( 2, m_tolerance );
if ( file.Archive3dmVersion() < 3 )
{
if ( rc )
rc = file.WritePoint( P ); // m_P[0] );
if ( rc )
rc = file.WritePoint( P ); // m_P[1] );
}
else
{
// trim proxy curve information added in version 200206180
if (rc )
rc = file.WriteInterval( Domain() );
unsigned char b[24];
memset(b,0,sizeof(b));
b[0] = ProxyCurveIsReversed() ? 1 : 0;
if (rc)
rc = file.WriteChar(8,b);
b[0] = 0;
if (rc)
rc = file.WriteChar(24,b);
}
if ( rc )
rc = file.WriteDouble( m__legacy_2d_tol );
if ( rc )
rc = file.WriteDouble( m__legacy_3d_tol );
return rc;
}
示例2: 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;
}
示例3: while
bool ON_3dmObjectAttributes::WriteV5Helper( ON_BinaryArchive& file ) const
{
unsigned char c;
// 29 Nov. 2009 S. Baer
// Chunk version updated to 2.1 in order to support m_display_order
bool rc = file.Write3dmChunkVersion(2,1);
while(rc)
{
if (!rc) break;
rc = file.WriteUuid(m_uuid);
if (!rc) break;
rc = file.WriteInt(m_layer_index);
if (!rc) break;
// write non-default settings - skip everything else
if ( !m_name.IsEmpty() )
{
c = 1;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteString(m_name);
if (!rc) break;
}
if ( !m_url.IsEmpty() )
{
c = 2;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteString(m_url);
if (!rc) break;
}
if ( -1 != m_linetype_index )
{
c = 3;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteInt(m_linetype_index);
if (!rc) break;
}
if ( -1 != m_material_index )
{
c = 4;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteInt(m_material_index);
if (!rc) break;
}
if ( m_rendering_attributes.m_mappings.Count() > 0
|| m_rendering_attributes.m_materials.Count() > 0
|| true != m_rendering_attributes.m_bCastsShadows
|| true != m_rendering_attributes.m_bReceivesShadows
|| false != m_rendering_attributes.AdvancedTexturePreview()
)
{
c = 5;
rc = file.WriteChar(c);
if (!rc) break;
rc = m_rendering_attributes.Write(file);
if (!rc) break;
}
if ( 0 != m_color )
{
c = 6;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteColor(m_color);
if (!rc) break;
}
if ( 0 != m_plot_color )
{
c = 7;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteColor(m_plot_color);
if (!rc) break;
}
if ( 0.0 != m_plot_weight_mm )
{
c = 8;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteDouble(m_plot_weight_mm);
if (!rc) break;
}
if ( ON::no_object_decoration != m_object_decoration )
{
c = 9;
rc = file.WriteChar(c);
if (!rc) break;
c = (unsigned char)m_object_decoration;
rc = file.WriteChar(c);
if (!rc) break;
}
if ( 1 != m_wire_density )
{
c = 10;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteInt(m_wire_density);
if (!rc) break;
//.........这里部分代码省略.........