本文整理汇总了C++中ON_BinaryArchive::BeginRead3dmBigChunk方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_BinaryArchive::BeginRead3dmBigChunk方法的具体用法?C++ ON_BinaryArchive::BeginRead3dmBigChunk怎么用?C++ ON_BinaryArchive::BeginRead3dmBigChunk使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_BinaryArchive
的用法示例。
在下文中一共展示了ON_BinaryArchive::BeginRead3dmBigChunk方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: Read
ON_BOOL32 ON_ClippingPlaneSurface::Read( ON_BinaryArchive& file )
{
Default();
int major_version = 0;
int minor_version = 0;
bool rc = file.BeginRead3dmChunk(TCODE_ANONYMOUS_CHUNK,&major_version,&minor_version);
if (!rc)
return false;
for(;;)
{
rc = ( 1 == major_version );
if (!rc) break;
ON__UINT32 tcode = 0;
ON__INT64 big_value = 0;
rc = file.BeginRead3dmBigChunk(&tcode,&big_value)?true:false;
if (rc)
{
rc = (TCODE_ANONYMOUS_CHUNK == tcode);
if (rc)
rc = (ON_PlaneSurface::Read(file)?true:false);
if (!file.EndRead3dmChunk())
rc = false;
}
if (!rc) break;
rc = m_clipping_plane.Read(file);
if (rc) break;
break;
}
if (!file.EndRead3dmChunk() )
rc = false;
return rc;
}
示例4: Default
ON_BOOL32 ON_3dmProperties::Read(ON_BinaryArchive& file )
{
Default();
ON_BOOL32 rc = true;
unsigned int tcode;
ON__INT64 value;
for(;;) {
rc = file.BeginRead3dmBigChunk( &tcode, &value );
if ( !rc )
break;
switch(tcode) {
case TCODE_PROPERTIES_OPENNURBS_VERSION:
{
int on_version = 0;
if ( value > 299912319 || (value != 0 && value < 200101010) )
{
ON_ERROR("ON_3dmProperties::Read - TCODE_PROPERTIES_OPENNURBS_VERSION corrupt value");
rc = false;
}
else
{
on_version = (int)value;
}
ON_SetBinaryArchiveOpenNURBSVersion(file,on_version);
}
break;
case TCODE_PROPERTIES_REVISIONHISTORY: // file creation/revision information
m_RevisionHistory.Read(file);
break;
case TCODE_PROPERTIES_NOTES: // file notes
m_Notes.Read(file);
break;
case TCODE_PROPERTIES_PREVIEWIMAGE: // uncompressed preview image
m_PreviewImage.ReadUncompressed(file);
break;
case TCODE_PROPERTIES_COMPRESSED_PREVIEWIMAGE: // compressed preview image
m_PreviewImage.ReadCompressed(file);
break;
case TCODE_PROPERTIES_APPLICATION: // application that created 3dm file
m_Application.Read(file);
break;
default:
// information added in future will be skipped by file.EndRead3dmChunk()
break;
}
if ( !file.EndRead3dmChunk() ) {
rc = false;
break;
}
if ( TCODE_ENDOFTABLE == tcode )
break;
}
return rc;
}
示例5: switch
bool ON_3dmProperties::Read(ON_BinaryArchive& file )
{
*this = ON_3dmProperties::Empty;
bool rc = true;
unsigned int tcode;
ON__INT64 value;
for(;;)
{
rc = file.BeginRead3dmBigChunk( &tcode, &value );
if ( !rc )
break;
switch(tcode)
{
case TCODE_PROPERTIES_OPENNURBS_VERSION:
{
unsigned int opennurbs_version = 0;
if ( value > 0 && value <= 0xFFFFFFFFll)
{
opennurbs_version = (unsigned int)((ON__UINT64)value);
}
if ( !ON_VersionNumberIsValid(opennurbs_version)
&& !ON_VersionNumberIsYearMonthDateFormat(file.Archive3dmVersion(),opennurbs_version)
)
{
ON_ERROR("ON_3dmProperties::Read - TCODE_PROPERTIES_OPENNURBS_VERSION corrupt value");
rc = false;
}
ON_SetBinaryArchiveOpenNURBSVersion(file,opennurbs_version);
}
break;
case TCODE_PROPERTIES_AS_FILE_NAME:
rc = file.ReadString(m_3dmArchiveFullPathName);
break;
case TCODE_PROPERTIES_REVISIONHISTORY: // file creation/revision information
rc = m_RevisionHistory.Read(file);
break;
case TCODE_PROPERTIES_NOTES: // file notes
rc = m_Notes.Read(file);
break;
case TCODE_PROPERTIES_PREVIEWIMAGE: // uncompressed preview image
rc = m_PreviewImage.ReadUncompressed(file);
break;
case TCODE_PROPERTIES_COMPRESSED_PREVIEWIMAGE: // compressed preview image
rc = m_PreviewImage.ReadCompressed(file);
break;
case TCODE_PROPERTIES_APPLICATION: // application that created 3dm file
rc = m_Application.Read(file);
break;
default:
// information added in future will be skipped by file.EndRead3dmChunk()
break;
}
if ( !file.EndRead3dmChunk() )
rc = false;
if (!rc)
break;
if ( TCODE_ENDOFTABLE == tcode )
break;
}
return rc;
}