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


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

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


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

示例1: Read3dmUserDataHeader

static
bool Read3dmUserDataHeader( const size_t offset, ON_BinaryArchive& file, ON_TextLog& dump )
{
  // TCODE_OPENNURBS_CLASS_USERDATA chunks have 2 uuids
  // the first identifies the type of ON_Object class
  // the second identifies that kind of user data
  ON_UUID userdata_classid = ON_nil_uuid;
  ON_UUID userdata_itemid = ON_nil_uuid;
  bool rc = file.ReadUuid( userdata_classid );
  if ( !rc )
  {
     ErrorReport(offset,"ReadUuid() failed to read the user data class id.",dump);
  }
  else
  {
    dump.Print("UserData class id = ");
    dump.Print( userdata_classid );
    const ON_ClassId* pUserDataClassId = ON_ClassId::ClassId(userdata_classid);
    if ( pUserDataClassId )
    {
      const char* sClassName = pUserDataClassId->ClassName();
      if ( sClassName )
      {
        dump.Print(" (%s)",sClassName);
      }
    }
    dump.Print("\n");

    rc = file.ReadUuid( userdata_itemid );
    if ( !rc )
    {
       ErrorReport(offset,"ReadUuid() failed to read the user data item id.",dump);
    }
    else
    {
      dump.Print("UserData item id = ");
      dump.Print( userdata_itemid );
      dump.Print("\n");

      int userdata_copycount = -1;
      rc = file.ReadInt( &userdata_copycount );
      if ( !rc )
      {
        ErrorReport(offset,"ReadInt() failed to read the user data copy count.",dump);
      }
      else
      {
        ON_Xform userdata_xform;
        rc = file.ReadXform( userdata_xform );
        if ( !rc )
        {
          ErrorReport(offset,"ReadXform() failed to read the user data xform.",dump);
        }
      }
    }
  }
  return rc;
}
开发者ID:cciechad,项目名称:brlcad,代码行数:58,代码来源:example_dump.cpp

示例2: Read

bool ON_ClippingPlaneInfo::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;

    rc = file.ReadPlaneEquation(m_plane_equation);
    if (!rc) break;

    rc = file.ReadUuid(m_plane_id);
    if (!rc) break;

    rc = file.ReadBool(&m_bEnabled);
    if (!rc) break;

    break;
  }

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

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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: Read

ON_BOOL32 ON_PolyEdgeSegment::Read( ON_BinaryArchive& archive )
{
  Init();
  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.ReadUuid(m_object_id);
    if (!rc) break;
    rc = archive.ReadComponentIndex(m_component_index);
    if (!rc) break;
    rc = archive.ReadInterval(m_edge_domain);
    if (!rc) break;
    rc = archive.ReadInterval(m_trim_domain);
    if (!rc) break;

    // Read ON_ProxyCurve values we need
    bool bReversed = false;
    rc = archive.ReadBool(&bReversed);
    if (!rc) break;
    ON_Interval this_domain;
    rc = archive.ReadInterval(this_domain);
    if (!rc) break;
    ON_Interval real_curve_domain;
    rc = archive.ReadInterval(real_curve_domain);
    if (!rc) break;

    if ( bReversed)
      ON_CurveProxy::Reverse();
    ON_CurveProxy::SetDomain(this_domain);
    ON_CurveProxy::SetProxyCurveDomain(real_curve_domain);

    break;
  }
  if ( !archive.EndRead3dmChunk() )
    rc = false;
  return rc;
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:45,代码来源:opennurbs_polyedgecurve.cpp

示例8: Read

ON_BOOL32 ON_BrepFaceArray::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_BrepFace& face = AppendNew();
          rc = face.Read(file)?true:false;
        }    

        if ( minor_version >= 1 )
        {
          // chunk version 1.1 and later has face uuids
          for ( i = 0; i < count && rc; i++ )
          {
            rc = file.ReadUuid( m_a[i].m_face_uuid );
          }
        }
      }
      else 
      {
        rc = 0;
      }
    }
    if ( !file.EndRead3dmChunk() )
      rc = false;
  }
  return rc;
}
开发者ID:jl2,项目名称:ONView,代码行数:44,代码来源:opennurbs_brep_io.cpp

示例9: Read

ON_BOOL32 ON_InstanceRef::Read(
       ON_BinaryArchive& binary_archive
     )
{
  int major_version = 0;
  int minor_version = 0;
  bool rc = binary_archive.Read3dmChunkVersion(&major_version,&minor_version);
  if ( rc )
  {
    if ( major_version != 1 )
      rc = false;
    if (rc )
      rc = binary_archive.ReadUuid( m_instance_definition_uuid );
    if ( rc )
      rc = binary_archive.ReadXform( m_xform );
    if ( rc )
      rc = binary_archive.ReadBoundingBox( m_bbox );
  }
  return rc;
}
开发者ID:jl2,项目名称:ONView,代码行数:20,代码来源:opennurbs_instance.cpp

示例10: 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

示例11: 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

示例12: Read

BOOL ON_Layer::Read(
       ON_BinaryArchive& file // restore definition from binary archive
     )
{
  int obsolete_value1 = 0; // see ON_Layer::Write
  int major_version=0;
  int minor_version=0;
  int mode = ON::normal_layer;
  Default();
  BOOL rc = file.Read3dmChunkVersion(&major_version,&minor_version);
  if ( rc && major_version == 1 )
  {
    // common to all 1.x formats
    if ( rc ) rc = file.ReadInt( &mode );
    if ( rc )
    {
      switch(mode)
      {
      case 0: // OBSOLETE ON::normal_layer
        m_bVisible = true;
        m_bLocked = false;
        break;
      case 1: // OBSOLETE ON::hidden_layer
        m_bVisible = false;
        m_bLocked = false;
        break;
      case 2: // OBSOLETE ON::locked_layer
        m_bVisible = true;
        m_bLocked = true;
        break;
      default:
        m_bVisible = true;
        m_bLocked = false;
        break;
      }
    }
    if ( rc ) rc = file.ReadInt( &m_layer_index );
    if ( rc ) rc = file.ReadInt( &m_iges_level );
    if ( rc ) rc = file.ReadInt( &m_material_index );
    if ( rc ) rc = file.ReadInt( &obsolete_value1 );
    if ( rc ) rc = file.ReadColor( m_color );

    {
      // OBSOLETE line style was never used - read and discard the next 20 bytes
      short s;
      double x;
      if (rc) file.ReadShort(&s);
      if (rc) file.ReadShort(&s);
      if (rc) file.ReadDouble(&x);
      if (rc) file.ReadDouble(&x);
    }

    if ( rc ) rc = file.ReadString( m_name );
    if ( rc && minor_version >= 1 )
    {
      rc = file.ReadBool(&m_bVisible);
      if ( rc && minor_version >= 2 )
      {
        rc = file.ReadInt( &m_linetype_index);
        if (rc && minor_version >= 3 )
        {
          // 23 March 2005 Dale Lear
          rc = file.ReadColor( m_plot_color);
          if (rc) rc = file.ReadDouble( &m_plot_weight_mm);

          if (rc && minor_version >= 4 )
          {
            rc = file.ReadBool(&m_bLocked);
            if (rc && minor_version >= 5 )
            {
              rc = file.ReadUuid(m_layer_id);
              if ( rc
                   && minor_version >= 6
                   && file.ArchiveOpenNURBSVersion() > 200505110
                 )
              {
                // Some files saved with opennurbs version 200505110
                // do not contain correctly written m_parent_layer_id
                // and m_bExpanded values.
                // It is ok to default these values.
                rc = file.ReadUuid(m_parent_layer_id);
                if (rc)
                  rc = file.ReadBool(&m_bExpanded);

              }

              if ( rc && minor_version >= 7 )
              {
                // 1.7 field - added 6 June 2006
                rc = m_rendering_attributes.Read(file);

                if ( rc && minor_version >= 8 )
                {
                  // 1.8 field - added 19 Sep 2006
                  rc = file.ReadUuid(m_display_material_id);
                }
              }
            }
          }
        }
//.........这里部分代码省略.........
开发者ID:cciechad,项目名称:brlcad,代码行数:101,代码来源:opennurbs_layer.cpp

示例13: if


//.........这里部分代码省略.........
                  else
                  {
                    int anon_typecode =  Dump3dmChunk(file, dump, recursion_depth+1 );
                    if ( TCODE_ANONYMOUS_CHUNK != anon_typecode )
                    {
                      ErrorReport( offset0,"Userdata Expected a TCODE_ANONYMOUS_CHUNK chunk.",dump);
                    }
                  }
                }
                break;
              default:
                if ( major_userdata_version < 3 )
                {
                }
                else
                {
                  dump.Print("New user data format created after this diagnostic tool was written.\n");
                }
                break;
              }
            }

            dump.PopIndent();
          }
        }
        break;

      case TCODE_OPENNURBS_CLASS_UUID:
      case TCODE_USER_TABLE_UUID:
        {
          dump.PushIndent();
          ON_UUID uuid = ON_nil_uuid;
          const ON_ClassId* pClassId = 0;
          if ( !file.ReadUuid( uuid ) ) {
             ErrorReport(offset0,"ReadUuid() failed.",dump);
          }
          else
          {
            if ( typecode == TCODE_OPENNURBS_CLASS_UUID )
            {
              dump.Print("OpenNURBS class id = ");
              pClassId = ON_ClassId::ClassId(uuid);
            }
            else if ( typecode == TCODE_USER_TABLE_UUID )
            {
              dump.Print("User table id = ");
            }
            else {
              dump.Print("UUID = ");
            }
            dump.Print( uuid );
            if ( pClassId )
            {
              const char* sClassName = pClassId->ClassName();
              if ( sClassName )
              {
                dump.Print(" (%s)",sClassName);
              }
            }
            dump.Print("\n");
          }

          dump.PopIndent();
        }
        break;
开发者ID:cciechad,项目名称:brlcad,代码行数:66,代码来源:example_dump.cpp

示例14: Default

ON_BOOL32 ON_3dmObjectAttributes::Read( ON_BinaryArchive& file )
{
  Default();
  if (    file.Archive3dmVersion() >= 5 
       && file.ArchiveOpenNURBSVersion() >= 200712190 )
  {
    return ReadV5Helper(file);
  }
  int i;
  int major_version = 0;
  int minor_version = 0;
  bool rc = file.Read3dmChunkVersion(&major_version,&minor_version);
  if ( rc && major_version == 1 ) 
  {
    if (rc) rc = file.ReadUuid(m_uuid);
    if (rc) rc = file.ReadInt(&m_layer_index);
    if (rc) rc = file.ReadInt(&m_material_index);
    if (rc) rc = file.ReadColor(m_color);
    
    while(rc)
    {
      // OBSOLETE if (rc) rc = file.ReadLineStyle(m_line_style); // 23 March 2005 Dale Lear
      // replaced with
      short s = 0;
      double x;
      rc = file.ReadShort(&s); 
      if (!rc) break;
      if ( file.Archive3dmVersion() < 4 || file.ArchiveOpenNURBSVersion() < 200503170 )
      {
        // ignore unused linestyle info in old files
        // This bit keeps the curve arrowheads from V3 showing up
        // in V4.
        m_object_decoration = ON::ObjectDecoration( (s & ON::both_arrowhead) );
      }
      rc = file.ReadShort(&s);
      if (!rc) break;
      rc = file.ReadDouble(&x);
      if (!rc) break;
      rc = file.ReadDouble(&x);
      break;
    }

    if (rc) rc = file.ReadInt(&m_wire_density);
    if (rc) rc = file.ReadChar(&m_mode);

    if (rc) rc = file.ReadChar(&m_color_source);
    if (rc) m_color_source = (unsigned char)ON::ObjectColorSource(m_color_source);

    if (rc) rc = file.ReadChar(&m_linetype_source);
    if (rc) m_linetype_source = (unsigned char)ON::ObjectLinetypeSource(m_linetype_source);

    if (rc) rc = file.ReadChar(&m_material_source);
    if (rc) m_material_source = (unsigned char)ON::ObjectMaterialSource(m_material_source);

    if (rc) rc = file.ReadString(m_name);
    if (rc) rc = file.ReadString(m_url);

    m_bVisible = (Mode() != ON::hidden_object);
    if ( rc && minor_version >= 1 ) 
    {
      rc = file.ReadArray( m_group );
      if ( rc && minor_version >= 2 )
      {
        rc = file.ReadBool(&m_bVisible);

        if ( rc && minor_version >= 3 )
        {
          rc = file.ReadArray(m_dmref);     

          if (rc && minor_version >= 4 )
          {
            // 23 March 2005 Dale Lear
            //    Added m_plot_color_source and m_plot_color
            i = 0;
            if (rc) rc = file.ReadInt(&i);
            if (rc) m_object_decoration = ON::ObjectDecoration(i);
            if (rc) rc = file.ReadChar(&m_plot_color_source);
            if (rc) m_plot_color_source = (unsigned char)ON::PlotColorSource(m_plot_color_source);
            if (rc) rc = file.ReadColor( m_plot_color );
            if (rc) rc = file.ReadChar(&m_plot_weight_source);
            if (rc) m_plot_weight_source = (unsigned char)ON::PlotWeightSource(m_plot_weight_source);
            if (rc) rc = file.ReadDouble(&m_plot_weight_mm);


            if (rc && minor_version >= 5 )
            {
              // version 1.5 fields 11 April 2005
              if (rc) rc = file.ReadInt(&m_linetype_index);

              // version 1.6 fields 2 September 2005
              if (rc && minor_version >= 6 )
              {
                unsigned char uc = 0;
                rc = file.ReadChar(&uc);
                if (rc)
                {
                  m_space = (1 == uc) ? ON::page_space : ON::model_space;
                  m_dmref.Empty();
                  int i, count=0;
                  rc = file.ReadInt(&count);
//.........这里部分代码省略.........
开发者ID:Bastl34,项目名称:PCL,代码行数:101,代码来源:opennurbs_3dm_attributes.cpp

示例15: while

bool ON_3dmObjectAttributes::ReadV5Helper( ON_BinaryArchive& file )
{
  unsigned char itemid, c;
  int major_version = 0;
  int minor_version = 0;
  bool rc = file.Read3dmChunkVersion(&major_version,&minor_version);
  if ( rc && 2 != major_version )
    rc = false;

  itemid = 0xFF;

  while(rc)
  {
    if (!rc) break;
    rc = file.ReadUuid(m_uuid);
    if (!rc) break;
    rc = file.ReadInt(&m_layer_index);
    if (!rc) break;

    // read non-default settings - skip everything else
    rc = file.ReadChar(&itemid);
    if (!rc) break;
    if ( 0 == itemid )
      break;
    
    if ( 1 == itemid )
    {
      rc = file.ReadString(m_name);
      if (!rc) break;
      rc = file.ReadChar(&itemid);
      if ( !rc || 0 == itemid ) break;
    }
    if ( 2 == itemid )
    {
      rc = file.ReadString(m_url);
      if (!rc) break;
      rc = file.ReadChar(&itemid);
      if ( !rc || 0 == itemid ) break;
    }
    if ( 3 == itemid )
    {
      rc = file.ReadInt(&m_linetype_index);
      if (!rc) break;
      rc = file.ReadChar(&itemid);
      if ( !rc || 0 == itemid ) break;
    }
    if ( 4 == itemid )
    {
      rc = file.ReadInt(&m_material_index);
      if (!rc) break;
      rc = file.ReadChar(&itemid);
      if ( !rc || 0 == itemid ) break;
    }
    if ( 5 == itemid )
    {
      rc = m_rendering_attributes.Read(file);
      if (!rc) break;
      rc = file.ReadChar(&itemid);
      if ( !rc || 0 == itemid ) break;
    }
    if ( 6 == itemid )
    {
      rc = file.ReadColor(m_color);
      if (!rc) break;
      rc = file.ReadChar(&itemid);
      if ( !rc || 0 == itemid ) break;
    }
    if ( 7 == itemid )
    {
      rc = file.ReadColor(m_plot_color);
      if (!rc) break;
      rc = file.ReadChar(&itemid);
      if ( !rc || 0 == itemid ) break;
    }
    if ( 8 == itemid )
    {
      rc = file.ReadDouble(&m_plot_weight_mm);
      if (!rc) break;
      rc = file.ReadChar(&itemid);
      if ( !rc || 0 == itemid ) break;
    }
    if ( 9 == itemid )
    {
      rc = file.ReadChar(&c);
      if (!rc) break;
      m_object_decoration = ON::ObjectDecoration(c);
      rc = file.ReadChar(&itemid);
      if ( !rc || 0 == itemid ) break;
    }
    if ( 10 == itemid )
    {
      rc = file.ReadInt(&m_wire_density);
      if (!rc) break;
      rc = file.ReadChar(&itemid);
      if ( !rc || 0 == itemid ) break;
    }
    if ( 11 == itemid )
    {
      rc = file.ReadBool(&m_bVisible);
      if (!rc) break;
//.........这里部分代码省略.........
开发者ID:Bastl34,项目名称:PCL,代码行数:101,代码来源:opennurbs_3dm_attributes.cpp


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