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


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

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


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

示例1: Read

bool ON_UserString::Read(ON_BinaryArchive& archive)
{
  m_key.Empty();
  m_string_value.Empty();

  int major_version = 0;
  int minor_version = 0;
  bool rc = archive.BeginRead3dmChunk(TCODE_ANONYMOUS_CHUNK,&major_version,&minor_version);
  if (!rc)
    return false;

  for(;;)
  {
    rc = ( 1 == major_version );
    if (!rc) break;
    rc = archive.ReadString(m_key);
    if (!rc) break;
    rc = archive.ReadString(m_string_value);
    if (!rc) break;

    break;
  }

  if ( !archive.EndRead3dmChunk() )
    rc = false;

  return rc;
}
开发者ID:cciechad,项目名称:brlcad,代码行数:28,代码来源:opennurbs_userdata.cpp

示例2: Read

ON_BOOL32 ON_HatchPattern::Read( ON_BinaryArchive& ar)
{
  m_hatchpattern_index = -1;
  memset(&m_hatchpattern_id,0,sizeof(m_hatchpattern_id));
  m_type = ftSolid;
  m_hatchpattern_name.Empty();
  m_description.Empty();
  m_lines.Empty();
  int i;

  int major_version = 0;
  int minor_version = 0;
  ON_BOOL32 rc = ar.Read3dmChunkVersion( &major_version, &minor_version);
  if ( major_version == 1 ) 
  {
    if( rc) rc = ar.ReadInt( &m_hatchpattern_index);
    i = 0;
    if( rc) rc = ar.ReadInt( &i);
    if( rc) 
    {
      switch( i)
      {
      case 0:  m_type = ftSolid;    break;
      case 1:  m_type = ftLines;    break;
      case 2:  m_type = ftGradient; break;
      default: rc = false;          break;
      }
    }
    if( rc) rc = ar.ReadString( m_hatchpattern_name);
    if( rc) rc = ar.ReadString( m_description);
    if( rc)
    {
      if( m_type == ftLines)
      {
        m_lines.Empty();
        int count = 0;
        rc = ar.ReadInt( &count);
        if( rc && count > 0 ) 
        {
          m_lines.SetCapacity( count);
          int i;
          for( i = 0; rc && i < count; i++)
          {
            ON_HatchLine& line = m_lines.AppendNew();
            rc = line.Read( ar);
          }
        }
      }
    }
    if ( minor_version >= 2 )
    {
      rc = ar.ReadUuid(m_hatchpattern_id);
    }
  }
  return rc;
}
开发者ID:ToMadoRe,项目名称:v4r,代码行数:56,代码来源:opennurbs_hatch.cpp

示例3:

ON_BOOL32 ON_3dmApplication::Read( ON_BinaryArchive& file )
{
    int major_version = 0;
    int minor_version = 0;
    ON_BOOL32 rc = file.Read3dmChunkVersion( &major_version, &minor_version );
    if (rc) rc = file.ReadString( m_application_name );
    if (rc) rc = file.ReadString( m_application_URL );
    if (rc) rc = file.ReadString( m_application_details );
    return rc;
}
开发者ID:raazui,项目名称:3D-Surface-Reconstruction,代码行数:10,代码来源:opennurbs_3dm_properties.cpp

示例4: Default

ON_BOOL32 ON_3dmRevisionHistory::Read( ON_BinaryArchive& file )
{
    Default();
    int major_version = 0;
    int minor_version = 0;
    ON_BOOL32 rc = file.Read3dmChunkVersion( &major_version, &minor_version );
    if ( rc && major_version == 1 ) {
        rc = file.ReadString( m_sCreatedBy );
        if (rc) rc = file.ReadTime( m_create_time );
        if (rc) rc = file.ReadString( m_sLastEditedBy );
        if (rc) rc = file.ReadTime(m_last_edit_time );
        if (rc) rc = file.ReadInt( &m_revision_count );
    }
    return rc;
}
开发者ID:raazui,项目名称:3D-Surface-Reconstruction,代码行数:15,代码来源:opennurbs_3dm_properties.cpp

示例5: Read

bool ON_PlugInRef::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)
  {
    if( 1 == major_version && minor_version >= 0 )
    {
      //version 1.0 fields
      if (rc) rc = file.ReadUuid(m_plugin_id);
      if (rc) rc = file.ReadInt(&m_plugin_type);
      if (rc) rc = file.ReadString(m_plugin_name);
      if (rc) rc = file.ReadString(m_plugin_version);
      if (rc) rc = file.ReadString(m_plugin_filename);

      if ( minor_version >= 1)
      {
        // version 1.1 fields
        if (rc) rc = file.ReadString(m_developer_organization);
        if (rc) rc = file.ReadString(m_developer_address);
        if (rc) rc = file.ReadString(m_developer_country);
        if (rc) rc = file.ReadString(m_developer_phone);
        if (rc) rc = file.ReadString(m_developer_email);
        if (rc) rc = file.ReadString(m_developer_website);
        if (rc) rc = file.ReadString(m_developer_updateurl);
        if (rc) rc = file.ReadString(m_developer_fax);

        if ( minor_version >= 2 )
        {
          if (rc) rc = file.ReadInt(&m_plugin_platform);
          if (rc) rc = file.ReadInt(&m_plugin_sdk_version);
          if (rc) rc = file.ReadInt(&m_plugin_sdk_service_release);
        }
      }
    }
    else
    {
      rc = false;
    }

    if( !file.EndRead3dmChunk() )
      rc = false;
  }
  return rc;
}
开发者ID:jl2,项目名称:ONView,代码行数:53,代码来源:opennurbs_pluginlist.cpp

示例6: Index

bool ON_Group::Internal_ReadV5(
       ON_BinaryArchive& file // restore definition from binary archive
     )
{
  *this = ON_Group::Unset;

  int major_version = 0;
  int minor_version = 0;
  bool rc = file.Read3dmChunkVersion(&major_version,&minor_version);
  if ( major_version == 1 ) 
  {
    int group_index = Index();
    if (rc) rc = file.ReadInt( &group_index );
    if (rc) SetIndex(group_index);
    ON_wString group_name;
    if (rc) rc = file.ReadString( group_name );
    if (rc)
      SetName(group_name);
    if ( minor_version >= 1 )
    {
      ON_UUID group_id = ON_nil_uuid;
      if (rc) rc = file.ReadUuid( group_id );
      if (rc) SetId(group_id);
    }
    if (rc && IdIsNil() )
    {
      // modern times require unique ids.
      SetId();
    }
  }
  else
    rc = false;
  return rc;
}
开发者ID:jiapei100,项目名称:opennurbs,代码行数:34,代码来源:opennurbs_group.cpp

示例7: Read

// virtual ON_Object override
ON_BOOL32 ON__IDefAlternativePathUserData::Read(ON_BinaryArchive& binary_archive)
{
  DestroyHelper();

  int major_version = 0;
  int minor_version = 0;
  bool rc = binary_archive.BeginRead3dmChunk(TCODE_ANONYMOUS_CHUNK,&major_version,&minor_version);
  if ( !rc )
    return false;

  rc = false;
  while ( 1 == major_version )
  {
    if ( !binary_archive.ReadString(m_alternate_path) )
      break;
    if ( !binary_archive.ReadBool(&m_bRelativePath) )
      break;
    rc = true;
    break;
  }

  if ( !binary_archive.EndRead3dmChunk() )
    rc = false;

  return rc;
}
开发者ID:Bastl34,项目名称:PCL,代码行数:27,代码来源:opennurbs_instance.cpp

示例8: ReadDocument

BOOL CSampleDocumentUserDataPlugIn::ReadDocument( CRhinoDoc& doc, ON_BinaryArchive& archive, const CRhinoFileReadOptions& options )
{
  // Read plug-in document data.  See rhinoSdkPlugIn.h details.

  // If our document data is found in a 3DM file, we are 
  // required to read it. But, we don't necessarily want
  // to use it.

  BOOL bKeepData = FALSE;
  BOOL bNewMode = options.Mode( CRhinoFileReadOptions::NewMode );
  BOOL bOpenMode = options.Mode( CRhinoFileReadOptions::OpenMode );

  // If the user is creating a new model, or opening an existing
  // model, we'll want to keep the document data that we read.
  // Otherwise, we'll read the data, but not use it.  This way,
  // we won't overwrite out data if the user is importing geometry,
  // from another 3DM file.
  if( bNewMode || bOpenMode )
    bKeepData = TRUE;

  if( bKeepData )
    m_string_table.Empty();

  // Read the major and minor version of the document data
  int major = 0, minor = 0;
  if( !archive.Read3dmChunkVersion(&major, &minor) )
    return FALSE;

  // At this point, if we've changed the format of
  // our document data, we'll want to compare the
  // major and minor revision numbers and read our
  // data accordingly.
  if( 1 != major && 0 != minor )
    return FALSE;

  // Read the number of string we intend to read as document data
  int count = 0;
  if( !archive.ReadInt(&count) )
    return FALSE;

  // Read our string table as document data
  ON_wString str;
  for( int i = 0; i < count; i++ )
  {
    if( !archive.ReadString(str) )
      return FALSE;
    
    // Only append the string if we are
    // supposed to
    if( bKeepData )
      m_string_table.Append(str);
  }

  return TRUE;
}
开发者ID:619486,项目名称:Rhino5Samples_CPP,代码行数:55,代码来源:SampleDocumentUserDataPlugIn.cpp

示例9: Read

ON_BOOL32 ON_Annotation::Read( ON_BinaryArchive& file )
{
  Destroy();
  int major_version = 0;
  int minor_version = 0;
  ON_BOOL32 rc = file.Read3dmChunkVersion(&major_version,&minor_version);
  if ( rc && major_version == 1 ) 
  {
    int i;
    if (rc)
    {
      rc = file.ReadInt( &i );
      if (rc)
        m_type = ON::AnnotationType(i);
    }
    if (rc)
      rc = file.ReadPlane( m_plane );
    if (rc)
      rc = file.ReadArray( m_points );
    if (rc)
      rc = file.ReadString( m_usertext );
    if (rc)
      rc = file.ReadString( m_defaulttext );
    if( rc )
    {
      rc = file.ReadInt( &i );
      if (rc) m_userpositionedtext = i ? true : false;
    }
  }

  if( fabs( m_plane.origin.x) > REALLY_BIG_NUMBER || fabs( m_plane.origin.y) > REALLY_BIG_NUMBER || fabs( m_plane.origin.z) > REALLY_BIG_NUMBER)
    return false;

  for( int i = 0; i < m_points.Count(); i++)
  {
    if( fabs( m_points[i].x) > REALLY_BIG_NUMBER || fabs( m_points[i].y) > REALLY_BIG_NUMBER)
      return false;
  }


  return rc;
}
开发者ID:2php,项目名称:pcl,代码行数:42,代码来源:opennurbs_annotation.cpp

示例10: Read

BOOL CSampleObjectUserData::Read( ON_BinaryArchive& binary_archive )
{
  int major_version = 0;
  int minor_version = 0;
  bool rc = binary_archive.BeginRead3dmChunk( TCODE_ANONYMOUS_CHUNK, &major_version, &minor_version );
  if( !rc )
    return false;

  // Read class members like this
  for(;;)
  {
    rc = ( 1 == major_version );
    if( !rc ) break;

    // version 1.0 fields
    rc = binary_archive.ReadPoint( m_point );
    if( !rc ) break;

    rc = binary_archive.ReadString( m_string );
    if( !rc ) break;


    // The code in the comment below demonstrates how to
    // correctly read information added in later releases
    // of your product.
    //if ( minor_version >= 1 )
    //{
    //  // version 1.1 fields added DD MMM YYYY
    //  rc = binary_archive.ReadSomethingNew( ... );
    //  if (!rc) break;
    //  rc = binary_archive.ReadSomethingElseNew( ... );
    //  if (!rc) break;
    //  
    //  if ( minor_version >= 2 )
    //  {
    //    // version 1.2 fields added DD MMM YYYY
    //    rc = binary_archive.ReadAnotherSomethingNew( ... );
    //    if (!rc) break;
    //    rc = binary_archive.ReadAnotherSomethingElseNew( ... );
    //    if (!rc) break;
    //  }
    //}

    break;
  }

  // If BeginRead3dmChunk() returns true,
  // then EndRead3dmChunk() must be called, 
  // even if a read operation failed.
  if( !binary_archive.EndRead3dmChunk() )
    rc = false;

  return rc;
}
开发者ID:619486,项目名称:Rhino5Samples_CPP,代码行数:54,代码来源:SampleObjectUserData.cpp

示例11: Read

ON_BOOL32 ON_Light::Read(
       ON_BinaryArchive&  file
     )
{
  Default();
  int major_version = 0;
  int minor_version = 0;
  ON_BOOL32 rc = file.Read3dmChunkVersion(&major_version,&minor_version);
  if ( rc && major_version == 1 ) {
    int i;
    // version 1.0 fields
    i = 0;
    if ( rc ) rc = file.ReadInt( &i );
    if ( rc ) Enable(i);
    if ( rc ) rc = file.ReadInt( &i );
    if ( rc ) SetStyle(ON::LightStyle(i));
    if ( rc ) rc = file.ReadDouble( &m_intensity );
    if ( rc ) rc = file.ReadDouble( &m_watts );
    if ( rc ) rc = file.ReadColor( m_ambient );
    if ( rc ) rc = file.ReadColor( m_diffuse );
    if ( rc ) rc = file.ReadColor( m_specular );
    if ( rc ) rc = file.ReadVector( m_direction );
    if ( rc ) rc = file.ReadPoint( m_location );
    if ( rc ) rc = file.ReadDouble( &m_spot_angle );
    if ( rc ) rc = file.ReadDouble( &m_spot_exponent );
    if ( rc ) rc = file.ReadVector( m_attenuation );
    if ( rc ) rc = file.ReadDouble( &m_shadow_intensity );
    if ( rc ) rc = file.ReadInt( &m_light_index );
    if ( rc ) rc = file.ReadUuid( m_light_id );
    if ( rc ) rc = file.ReadString( m_light_name );

    if ( minor_version < 2 ) {
      // set hotspot from 1.0 or 1.1 m_spot_exponent
      double h = 1.0 - m_spot_exponent/128.0;
      if ( h < 0.0 ) 
        h = 0.0;
      else if ( h > 1.0 )
        h = 1.0;
      m_hotspot = h;
      m_spot_exponent = 0.0;
    }

    if ( minor_version >= 1 ) {
      // version 1.1 fields
      if ( rc ) rc = file.ReadVector( m_length );
      if ( rc ) rc = file.ReadVector( m_width );
      if ( minor_version >= 2 ) {
        // version 1.2 fields
        if ( rc ) rc = file.ReadDouble( &m_hotspot );
      }
    }
  }
  return rc;
}
开发者ID:ckvk,项目名称:opennurbs,代码行数:54,代码来源:opennurbs_light.cpp

示例12: Read

ON_BOOL32 MyUserData::Read( ON_BinaryArchive& file )
{
  ON_BOOL32 rc = true;
  if ( rc ) 
    rc = file.ReadInt(&m_my_int);
  if ( rc ) 
    rc = file.ReadLine(m_my_line);
  if ( rc ) 
    rc = file.ReadString(m_my_string);
  return rc;
}
开发者ID:behollis,项目名称:brlcad-svn-rev65072-gsoc2015,代码行数:11,代码来源:example_userdata.cpp

示例13: Read

BOOL MyUserData::Read( ON_BinaryArchive& file )
{
  BOOL rc = TRUE;
  if ( rc )
    rc = file.ReadInt(&m_my_int);
  if ( rc )
    rc = file.ReadLine(m_my_line);
  if ( rc )
    rc = file.ReadString(m_my_string);
  return rc;
}
开发者ID:cciechad,项目名称:brlcad,代码行数:11,代码来源:example_userdata.cpp

示例14: Read

ON_BOOL32 ON_Linetype::Read( ON_BinaryArchive& file)
{
  Default();
  m_linetype_index = -1;

  int major_version=0;
  int minor_version=0;
  bool rc = file.BeginRead3dmChunk( TCODE_ANONYMOUS_CHUNK, &major_version, &minor_version );

  if (rc)
  {
    if( 1 == major_version ) 
    {
      // chunk version 1.0 fields
      if( rc) 
        rc = file.ReadInt( &m_linetype_index );
      if( rc) 
        rc = file.ReadString( m_linetype_name );
      if( rc) 
        rc = file.ReadArray( m_segments );

      if ( minor_version >= 1 )
      {
        if (rc)
          rc = file.ReadUuid( m_linetype_id );
      }
    }
    else
    {
      rc = false;
    }

    if ( !file.EndRead3dmChunk() )
      rc = false;
  }

  return rc;
}
开发者ID:ckvk,项目名称:opennurbs,代码行数:38,代码来源:opennurbs_linetype.cpp

示例15: Read

ON_BOOL32 ON_Group::Read(
       ON_BinaryArchive& file // restore definition from binary archive
     )
{
  m_group_index = -1;
  m_group_name.Empty();
  memset(&m_group_id,0,sizeof(m_group_id));
  int major_version = 0;
  int minor_version = 0;
  ON_BOOL32 rc = file.Read3dmChunkVersion(&major_version,&minor_version);
  if ( major_version == 1 ) 
  {
    if (rc) rc = file.ReadInt( &m_group_index );
    if (rc) rc = file.ReadString( m_group_name );
    if ( minor_version >= 1 )
    {
      if (rc) rc = file.ReadUuid( m_group_id );
    }
  }
  else
    rc = false;
  return rc;
}
开发者ID:2php,项目名称:pcl,代码行数:23,代码来源:opennurbs_group.cpp


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