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


C++ Facet::getPointsId方法代码示例

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


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

示例1: neighbours_ofs

  TEST_F(DictionaryTest, FacetLoad){
    string output_file_neighbours = "dictFacetsTestFile_neighbours.dat";
    string output_file_vertexes = "dictFacetsTestFile_vertex.dat";

    ofstream neighbours_ofs(output_file_neighbours.c_str());
    ofstream vertexes_ofs(output_file_vertexes.c_str());

    if(neighbours_ofs.good()){
      neighbours_ofs << "4\n";
      neighbours_ofs << "4 1234 4331 4314 55\n";
      neighbours_ofs << "4 83 7583 38 21\n";
      neighbours_ofs << "4 321 32 1 23\n";
      neighbours_ofs << "4 123 13 22 34\n";
      neighbours_ofs.close(); 
    }

    if(vertexes_ofs.good()){
      vertexes_ofs << "4\n";
      vertexes_ofs << "4 91 89 72 2\n";
      vertexes_ofs << "4 33 123 43 1\n";
      vertexes_ofs << "4 18 22 12 43\n";
      vertexes_ofs << "4 2 32 31 89\n";
      vertexes_ofs.close();
    }

    dictFacets->load("dictFacetsTestFile");

    remove("dictFacetsTestFile_vertex.dat");
    remove("dictFacetsTestFile_neighbours.dat");

    Facet firstFacet = dictFacets->getById(0);
    Facet secondFacet = dictFacets->getById(1);
    //Facet* thirdFacet = dictFacets-> getById(2);
    //Facet* fourthFacet = dictFacets->getById(3);

    // Test firstFacet
    ASSERT_EQ(firstFacet.getNeighboursId()[0],1234);
    ASSERT_EQ(firstFacet.getNeighboursId()[1],4331);
    ASSERT_EQ(firstFacet.getNeighboursId()[2],4314);
    ASSERT_EQ(firstFacet.getNeighboursId()[3],55);

    ASSERT_EQ(firstFacet.getPointsId()[0],91);
    ASSERT_EQ(firstFacet.getPointsId()[1],89);
    ASSERT_EQ(firstFacet.getPointsId()[2],72);
    ASSERT_EQ(firstFacet.getPointsId()[3],2);

    // Test secondFacet
    ASSERT_EQ(secondFacet.getNeighboursId()[0],83);
    ASSERT_EQ(secondFacet.getNeighboursId()[1],7583);
    ASSERT_EQ(secondFacet.getNeighboursId()[2],38);
    ASSERT_EQ(secondFacet.getNeighboursId()[3],21);

    ASSERT_EQ(secondFacet.getPointsId()[0],33);
    ASSERT_EQ(secondFacet.getPointsId()[1],123);
    ASSERT_EQ(secondFacet.getPointsId()[2],43);
    ASSERT_EQ(secondFacet.getPointsId()[3],1);

  }
开发者ID:matbravo,项目名称:voids,代码行数:58,代码来源:DictionaryTest.cpp


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