本文整理汇总了C++中ON_BinaryArchive::Save3dmAnalysisMeshes方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_BinaryArchive::Save3dmAnalysisMeshes方法的具体用法?C++ ON_BinaryArchive::Save3dmAnalysisMeshes怎么用?C++ ON_BinaryArchive::Save3dmAnalysisMeshes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_BinaryArchive
的用法示例。
在下文中一共展示了ON_BinaryArchive::Save3dmAnalysisMeshes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
//.........这里部分代码省略.........