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


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

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


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

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

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

示例3: Read


//.........这里部分代码省略.........
    // faces
    if (rc)
    {
      rc = m_F.Read(file);
      if (rc) {
        for ( i = 0; i < m_F.Count(); i++ ) {
          ON_BrepFace& f = m_F[i];
          f.m_brep = this;
          if ( f.m_si >= 0 && f.m_si < S_count )
            f.SetProxySurface(m_S[f.m_si]);
        }
      }
    }

    // bounding box
    if (rc)
      rc = file.ReadPoint( m_bbox.m_min );
    if (rc)
      rc = file.ReadPoint( m_bbox.m_max );

    // fill in missing information
    ReadFillInMissingBoxes(*this);

    // end of chunk version 3.0

    if (rc && minor_version >= 1 )
    {
      // added for chunk version 3.1

      ON_Object* obj;
      unsigned int tcode;
      int value, fi;
      unsigned char b;

      const int face_count = m_F.Count();

      // read render meshes
      rc = file.BeginRead3dmChunk( &tcode, &value );
      if ( rc )
      {
        if ( tcode != TCODE_ANONYMOUS_CHUNK )
          rc = false;
        else
        {
          for ( fi = 0; rc && fi < face_count; fi++ )
          {
            rc = file.ReadChar(&b);
            if (rc && b)
            {
              rc = file.ReadObject(&obj);
              m_F[fi].m_render_mesh = ON_Mesh::Cast(obj);
              if ( !m_F[fi].m_render_mesh )
                delete obj;
            }
          }
        }
        if ( !file.EndRead3dmChunk() )
          rc = false;
      }

      // read analysis meshes
      rc = file.BeginRead3dmChunk( &tcode, &value );
      if ( rc )
      {
        if ( tcode != TCODE_ANONYMOUS_CHUNK )
          rc = false;
        else
        {
          for ( fi = 0; rc && fi < face_count; fi++ )
          {
            rc = file.ReadChar(&b);
            if (rc && b)
            {
              rc = file.ReadObject(&obj);
              m_F[fi].m_analysis_mesh = ON_Mesh::Cast(obj);
              if ( !m_F[fi].m_analysis_mesh )
                delete obj;
            }
          }
        }
        if ( !file.EndRead3dmChunk() )
          rc = false;
      }
    }

    if ( rc && minor_version >= 2 )
    {
      rc =  file.ReadInt( &m_is_solid );
      if ( m_is_solid < 0 || m_is_solid >= 3 )
        m_is_solid = 0;
    }
  }

  if ( file.ArchiveOpenNURBSVersion() < 20021002 )
  {
    m_is_solid = 0;
  }

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

示例4: if


//.........这里部分代码省略.........
      case 0:
        looptype = ON_BrepLoop::outer;
        break;
      case 1:
        looptype = ON_BrepLoop::inner;
        break;
      case -1:
        looptype = ON_BrepLoop::slit;
        break;
      default:
        looptype = ON_BrepLoop::unknown;
        break;
      }
      if (rc) rc = file.ReadDouble( 2, &bnd_2d_bbox.m_min.x );
      if (rc) rc = file.ReadDouble( 2, &bnd_2d_bbox.m_max.x );
      btcnt = 0;
      if (rc) rc = file.ReadInt( &btcnt );
      if (btcnt < 1 )
        rc = false;
      ON_BrepLoop& bnd = NewLoop(looptype,f);
      for ( bti = 0; rc && bti < btcnt; bti++ ) {
        ON_BrepTrim& trim = NewTrim(false,bnd,m_T.Count());
        te_index.Append(trim.m_trim_index);
        if (rc) rc = file.ReadInt( &i ); // legacy trim index
        if ( trim.m_trim_index != i )
        {
          ON_ERROR("ON_Brep::ReadOld200 - trim.m_trim_index out of synch.");
          //rc = false;
          //break;
        }
        if (rc) rc = file.ReadInt( &twin_index );
        te_twin_index.Append(twin_index);
        b = 0;
        if (rc) rc = file.ReadChar( &b ); // true if legacy trim managed 3d edge
        if (rc) rc = file.ReadInt( &trim.m_ei );
        if (b) {
          if ( trim.m_ei < 0 || trim.m_ei >= c3_count )
          {
            trim.m_ei = -1;
            ON_ERROR("ON_Brep::ReadOld201 - trim.m_ei out of range.");
            rc = false;
            break;
          }
        }
        if ( trim.m_trim_index >= 0 && trim.m_trim_index < c2_count )
          trim.m_c2i = trim.m_trim_index;
        else {
          ON_ERROR("ON_Brep::ReadOld200 - trim.m_trim_index out of range.");
          rc = false;
          trim.m_c2i = -1;
          break;
        }
        int k = trim.m_bRev3d;
        if (rc) rc = file.ReadInt(&k);
        if (rc) trim.m_bRev3d = (k!=0);
        if (rc) rc = file.ReadInt(&gcon_flag);
        if (rc) rc = file.ReadInt(&mono_flag);
        if (rc) rc = file.ReadDouble(&trim.m__legacy_3d_tol);
        if (rc) rc = file.ReadDouble(&trim.m__legacy_2d_tol);
      }
    }
  }

  // finish hooking trims to edges
  if (rc) {
    int trim_index;
开发者ID:cciechad,项目名称:brlcad,代码行数:67,代码来源:opennurbs_brep_io.cpp


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