本文整理汇总了C++中ON_BinaryArchive::WriteObject方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_BinaryArchive::WriteObject方法的具体用法?C++ ON_BinaryArchive::WriteObject怎么用?C++ ON_BinaryArchive::WriteObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_BinaryArchive
的用法示例。
在下文中一共展示了ON_BinaryArchive::WriteObject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsValid
ON_BOOL32
ON_CurveOnSurface::Write(
ON_BinaryArchive& file // open binary file
) const
{
ON_BOOL32 rc = IsValid();
if (rc)
rc = file.WriteObject(*m_c2);
if (rc)
rc = file.WriteInt( m_c3?1:0 );
if ( rc && m_c3 )
rc = file.WriteObject(*m_c3);
if (rc)
rc = file.WriteObject(*m_s);
return rc;
}
示例2: Write
ON_BOOL32 ON_SurfaceArray::Write( ON_BinaryArchive& file ) const
{
ON_BOOL32 rc = file.BeginWrite3dmChunk( TCODE_ANONYMOUS_CHUNK, 0 );
if (rc) rc = file.Write3dmChunkVersion(1,0);
if (rc )
{
int i;
rc = file.WriteInt( Count() );
for ( i = 0; rc && i < Count(); i++ ) {
if ( m_a[i] )
{
rc = file.WriteInt(1);
if ( rc )
rc = file.WriteObject( *m_a[i] ); // polymorphic surfaces
}
else
{
// NULL surface
rc = file.WriteInt(0);
}
}
if ( !file.EndWrite3dmChunk() )
rc = false;
}
return rc;
}
示例3: Write
BOOL ON_HatchLoop::Write( ON_BinaryArchive& ar) const
{
BOOL rc = ar.Write3dmChunkVersion(1,1);
if( rc) rc = ar.WriteInt( m_type);
if( rc) rc = ar.WriteObject( m_p2dCurve);
return rc;
}
示例4: 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;
}
示例5: Write
BOOL ON_Brep::Write( ON_BinaryArchive& file ) const
{
const ON_Brep* brep = this;
ON_Brep* v2brep = 0;
if ( file.Archive3dmVersion() <= 2 && !IsValidForV2() )
{
v2brep = ON_Brep::New(*this);
v2brep->MakeValidForV2();
brep = v2brep;
}
//BOOL rc = file.Write3dmChunkVersion(3,0); // serialization version
//BOOL rc = file.Write3dmChunkVersion(3,1); // added meshes
BOOL rc = file.Write3dmChunkVersion(3,2); // added m_is_solid
// 2d curves
if (rc) rc = brep->m_C2.Write(file);
// 3d curves
if (rc) rc = brep->m_C3.Write(file);
// untrimmed surfaces
if (rc) rc = brep->m_S.Write(file);
// vertices
if (rc) rc = brep->m_V.Write(file);
// edges
if (rc) rc = brep->m_E.Write(file);
// trims
if (rc) rc = brep->m_T.Write(file);
// loops
if (rc) rc = brep->m_L.Write(file);
// faces
if (rc) rc = brep->m_F.Write(file);
// bounding box
if (rc) rc = file.WritePoint( brep->m_bbox.m_min );
if (rc) rc = file.WritePoint( brep->m_bbox.m_max );
// end of chunk version 3.0
if (rc)
{
// added for chunk version 3.1
const int face_count = brep->m_F.Count();
int fi;
unsigned char b;
// write render meshes
rc = file.BeginWrite3dmChunk( TCODE_ANONYMOUS_CHUNK, 0 );
if ( rc )
{
for ( fi = 0; rc && fi < face_count; fi++ ) {
const ON_Mesh* mesh = file.Save3dmRenderMeshes() ? brep->m_F[fi].m_render_mesh : 0;
b = mesh ? 1 : 0;
file.WriteChar(b);
if (mesh) {
rc = file.WriteObject(*mesh);
}
}
if ( !file.EndWrite3dmChunk() )
{
rc = false;
}
}
// write analysis meshes
rc = file.BeginWrite3dmChunk( TCODE_ANONYMOUS_CHUNK, 0 );
if ( rc )
{
for ( fi = 0; rc && fi < face_count; fi++ ) {
const ON_Mesh* mesh = file.Save3dmAnalysisMeshes() ? brep->m_F[fi].m_analysis_mesh : 0;
b = mesh ? 1 : 0;
file.WriteChar(b);
if (mesh) {
rc = file.WriteObject(*mesh);
}
}
if ( !file.EndWrite3dmChunk() )
rc = false;
}
}
// end of chunk version 3.1
// use value of "this" m_is_solid to avoid expensive
// calculation on the v2brep
if ( !file.WriteInt( m_is_solid ) )
rc = false;
// end of chunk version 3.2
if ( 0 != v2brep )
delete v2brep;
return rc;
//.........这里部分代码省略.........