当前位置: 首页>>代码示例>>C++>>正文


C++ ON_BinaryArchive::Save3dmPreviewImage方法代码示例

本文整理汇总了C++中ON_BinaryArchive::Save3dmPreviewImage方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_BinaryArchive::Save3dmPreviewImage方法的具体用法?C++ ON_BinaryArchive::Save3dmPreviewImage怎么用?C++ ON_BinaryArchive::Save3dmPreviewImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ON_BinaryArchive的用法示例。


在下文中一共展示了ON_BinaryArchive::Save3dmPreviewImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

bool ON_3dmProperties::Write(ON_BinaryArchive& file) const
{
  bool rc = true;

  // This short chunk identifies the version of OpenNURBS that was used to write this file.
  const unsigned int version_number_to_write = ON_BinaryArchive::ArchiveOpenNURBSVersionToWrite(file.Archive3dmVersion(), ON::Version());
  rc = file.BeginWrite3dmChunk(TCODE_PROPERTIES_OPENNURBS_VERSION, version_number_to_write);
  if (rc)
    rc = file.EndWrite3dmChunk();
  if (!rc)
    return false;

  // This chunk added November 5, 2015
  const ON_wString archive_full_path
    = file.ArchiveFullPath().IsEmpty()
    ? m_3dmArchiveFullPathName
    : file.ArchiveFullPath();
  if (archive_full_path.IsNotEmpty())
  {
    if (!file.BeginWrite3dmChunk(TCODE_PROPERTIES_AS_FILE_NAME, 0))
      return false;
    rc = file.WriteString(file.ArchiveFullPath());
    if (!file.EndWrite3dmChunk())
      rc = false;
    if (!rc)
      return false;
  }


  // optional TCODE_PROPERTIES_REVISIONHISTORY chunk - file creation/revision information
  if ( rc && m_RevisionHistory.IsValid() ) {
    rc = file.BeginWrite3dmChunk(TCODE_PROPERTIES_REVISIONHISTORY,0);
    if ( rc ) {
      rc = m_RevisionHistory.Write(file);
      if ( !file.EndWrite3dmChunk() )
        rc = false;
    }
  }

  // optional TCODE_PROPERTIES_NOTES chunk - file notes
  if ( rc && m_Notes.IsValid() ) {
    rc = file.BeginWrite3dmChunk(TCODE_PROPERTIES_NOTES,0);
    if ( rc ) {
      rc = m_Notes.Write(file);
      if ( !file.EndWrite3dmChunk() )
        rc = false;
    }
  }

  //// When merging Mac code please note that the
  //// TCODE_PROPERTIES_PREVIEWIMAGE chunk is OBSOLETE.
  //// DO NOT WRITE THEM IN V6 FILES.  If performance is an
  //// issue, we will address it some other way.

  // optional TCODE_PROPERTIES_COMPRESSED_PREVIEWIMAGE chunk - bitmap preview
  if ( rc && m_PreviewImage.IsValid() && file.Save3dmPreviewImage()) 
  {
    rc = file.BeginWrite3dmChunk(TCODE_PROPERTIES_COMPRESSED_PREVIEWIMAGE,0);
    if ( rc ) 
    {
      rc = m_PreviewImage.WriteCompressed(file);
      if ( !file.EndWrite3dmChunk() )
        rc = false;
    }
  }

  // optional TCODE_PROPERTIES_APPLICATION chunk - application information
  if ( rc && m_Application.IsValid() ) 
  {
    rc = file.BeginWrite3dmChunk(TCODE_PROPERTIES_APPLICATION,0);
    if ( rc ) 
    {
      rc = m_Application.Write(file);
      if ( !file.EndWrite3dmChunk() )
        rc = false;
    }
  }

  // required TCODE_ENDOFTABLE chunk - marks end of properties table
  if ( rc ) {
    rc = file.BeginWrite3dmChunk( TCODE_ENDOFTABLE, 0 );
    if ( rc ) {
      if ( !file.EndWrite3dmChunk() )
        rc = false;
    }
  }

  return rc;
}
开发者ID:jiapei100,项目名称:opennurbs,代码行数:89,代码来源:opennurbs_3dm_properties.cpp


注:本文中的ON_BinaryArchive::Save3dmPreviewImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。