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


C++ Point3dVector::clear方法代码示例

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


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

示例1: thermalZone

TEST_F(ModelFixture, Construction_NetArea_SubSurface) {
  Model model;

  ThermalZone thermalZone(model);

  Space space(model);
  space.setThermalZone(thermalZone);

  Construction construction1(model);
  Construction construction2(model);
  EXPECT_DOUBLE_EQ(0.0, construction1.getNetArea());
  EXPECT_DOUBLE_EQ(0.0, construction2.getNetArea());

  Point3dVector points;
  points.push_back(Point3d(0, 0, 10));
  points.push_back(Point3d(0, 0, 0));
  points.push_back(Point3d(0, 10, 0));
  points.push_back(Point3d(0, 10, 10));

  Surface surface(points, model);
  surface.setConstruction(construction1);
  surface.setSpace(space);
  EXPECT_EQ("Wall", surface.surfaceType());
  EXPECT_DOUBLE_EQ(100.0, surface.netArea());
  EXPECT_DOUBLE_EQ(100.0, construction1.getNetArea());
  EXPECT_DOUBLE_EQ(0.0, construction2.getNetArea());
  EXPECT_DOUBLE_EQ(0, surface.windowToWallRatio());

  points.clear();
  points.push_back(Point3d(0, 0, 2));
  points.push_back(Point3d(0, 0, 1));
  points.push_back(Point3d(0, 1, 1));
  points.push_back(Point3d(0, 1, 2));

  SubSurface subSurface(points, model);
  subSurface.setConstruction(construction2);
  subSurface.setSurface(surface);
  EXPECT_EQ("FixedWindow", subSurface.subSurfaceType());
  EXPECT_DOUBLE_EQ(1.0, subSurface.netArea());
  EXPECT_DOUBLE_EQ(99.0, construction1.getNetArea());
  EXPECT_DOUBLE_EQ(1.0, construction2.getNetArea());
  EXPECT_DOUBLE_EQ(1.0/100.0, surface.windowToWallRatio());

  EXPECT_TRUE(subSurface.setMultiplier(4));
  EXPECT_DOUBLE_EQ(1.0, subSurface.netArea());
  EXPECT_DOUBLE_EQ(96.0, construction1.getNetArea());
  EXPECT_DOUBLE_EQ(4.0, construction2.getNetArea());
  EXPECT_DOUBLE_EQ(4.0/100.0, surface.windowToWallRatio());

  EXPECT_TRUE(thermalZone.setMultiplier(4));
  EXPECT_DOUBLE_EQ(1.0, subSurface.netArea());
  EXPECT_DOUBLE_EQ(4*96.0, construction1.getNetArea());
  EXPECT_DOUBLE_EQ(4*4.0, construction2.getNetArea());
  EXPECT_DOUBLE_EQ(4.0/100.0, surface.windowToWallRatio());
}
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:55,代码来源:Construction_GTest.cpp

示例2: material


//.........这里部分代码省略.........
    EXPECT_TRUE(ruleset.rules()[1].actions()[1].optionalCast<ModelObjectActionSetRelationship>());

    // make up a model
    Model model;

    Construction construction(model);
    construction.setName("Construction");
    ASSERT_TRUE(construction.name());
    EXPECT_EQ("Construction", construction.name().get());

    Space space(model);
    space.setName("Space");
    ASSERT_TRUE(space.name());
    EXPECT_EQ("Space", space.name().get());

    Point3dVector points;
    points.push_back(Point3d(0,1,1));
    points.push_back(Point3d(0,0,1));
    points.push_back(Point3d(1,0,1));
    points.push_back(Point3d(1,1,1));

    Surface roof(points, model); 
    EXPECT_TRUE(roof.setAttribute("name", "Roof"));
    roof.setName("Roof");
    roof.setSpace(space);
    roof.setSurfaceType("RoofCeiling");
    roof.setConstruction(construction);

    ASSERT_TRUE(roof.name());
    EXPECT_EQ("Roof", roof.name().get());
    ASSERT_TRUE(roof.construction());
    EXPECT_EQ(construction.handle(), roof.construction()->handle());

    points.clear();
    points.push_back(Point3d(0,0,1));
    points.push_back(Point3d(0,0,0));
    points.push_back(Point3d(0,1,0));
    points.push_back(Point3d(0,1,1));

    Surface wall(points, model);
    EXPECT_TRUE(wall.setAttribute("name", "Wall"));
    wall.setName("Wall");
    wall.setSpace(space);
    wall.setSurfaceType("Wall");
    wall.setConstruction(construction);

    ASSERT_TRUE(wall.name());
    EXPECT_EQ("Wall", wall.name().get());
    ASSERT_TRUE(wall.construction());
    EXPECT_EQ(construction.handle(), wall.construction()->handle());

    points.clear();
    points.push_back(Point3d(0,0.25,0.75));
    points.push_back(Point3d(0,0.25,0.25));
    points.push_back(Point3d(0,0.75,0.25));
    points.push_back(Point3d(0,0.75,0.75));

    SubSurface window(points, model); 
    window.setName("Window");
    window.setSurface(wall);
    window.setSubSurfaceType("FixedWindow");
    window.setConstruction(construction);

    ASSERT_TRUE(window.name());
    EXPECT_EQ("Window", window.name().get());
    ASSERT_TRUE(window.construction());
开发者ID:Rahjou,项目名称:OpenStudio,代码行数:67,代码来源:ModelRuleset_GTest.cpp

示例3: defaultExteriorSurfaceConstructions

TEST_F(ModelFixture, Construction_NetArea_InteriorWall) {
  Model model;

  Construction construction1(model);
  Construction construction2(model);
  EXPECT_DOUBLE_EQ(0.0, construction1.getNetArea());
  EXPECT_DOUBLE_EQ(0.0, construction2.getNetArea());

  // add costs
  boost::optional<LifeCycleCost> cost1 = LifeCycleCost::createLifeCycleCost("Brick", construction1, 3.0, "CostPerArea", "Construction");
  ASSERT_TRUE(cost1);
  boost::optional<LifeCycleCost> cost2 = LifeCycleCost::createLifeCycleCost("Glass", construction2, 5.0, "CostPerArea", "Construction");
  ASSERT_TRUE(cost2);
  EXPECT_DOUBLE_EQ(0, cost1->totalCost());
  EXPECT_DOUBLE_EQ(0, cost2->totalCost());

  Building building = model.getUniqueModelObject<Building>();
  DefaultSurfaceConstructions defaultExteriorSurfaceConstructions(model);
  DefaultSurfaceConstructions defaultInteriorSurfaceConstructions(model);
  DefaultSubSurfaceConstructions defaultExteriorSubSurfaceConstructions(model);
  DefaultSubSurfaceConstructions defaultInteriorSubSurfaceConstructions(model);
  DefaultConstructionSet defaultConstructionSet(model);
  defaultConstructionSet.setDefaultExteriorSurfaceConstructions(defaultExteriorSurfaceConstructions);
  defaultConstructionSet.setDefaultInteriorSurfaceConstructions(defaultInteriorSurfaceConstructions);
  defaultConstructionSet.setDefaultExteriorSubSurfaceConstructions(defaultExteriorSubSurfaceConstructions);
  defaultConstructionSet.setDefaultInteriorSubSurfaceConstructions(defaultInteriorSubSurfaceConstructions);
  building.setDefaultConstructionSet(defaultConstructionSet);

  Space space(model);

  Point3dVector points;
  points.push_back(Point3d(0, 0, 1));
  points.push_back(Point3d(0, 0, 0));
  points.push_back(Point3d(0, 1, 0));
  points.push_back(Point3d(0, 1, 1));

  Surface surface1(points, model);
  surface1.setSpace(space);
  EXPECT_EQ("Wall", surface1.surfaceType());
  EXPECT_EQ("Outdoors", surface1.outsideBoundaryCondition());
  EXPECT_DOUBLE_EQ(1.0, surface1.netArea());

  points.clear();
  points.push_back(Point3d(0, 1, 1));
  points.push_back(Point3d(0, 1, 0));
  points.push_back(Point3d(0, 0, 0));
  points.push_back(Point3d(0, 0, 1));

  Surface surface2(points, model);
  surface2.setSpace(space);
  EXPECT_EQ("Wall", surface2.surfaceType());
  EXPECT_EQ("Outdoors", surface2.outsideBoundaryCondition());
  EXPECT_DOUBLE_EQ(1.0, surface2.netArea());

  EXPECT_DOUBLE_EQ(0.0, construction1.getNetArea());
  EXPECT_DOUBLE_EQ(0.0, construction2.getNetArea());
  EXPECT_DOUBLE_EQ(0, cost1->totalCost());
  EXPECT_DOUBLE_EQ(0, cost2->totalCost());

  defaultExteriorSurfaceConstructions.setWallConstruction(construction1);
  ASSERT_TRUE(surface1.construction());
  ASSERT_TRUE(surface2.construction());
  EXPECT_EQ(surface1.construction()->handle(), construction1.handle());
  EXPECT_EQ(surface2.construction()->handle(), construction1.handle());
  EXPECT_DOUBLE_EQ(2.0, construction1.getNetArea());
  EXPECT_DOUBLE_EQ(0.0, construction2.getNetArea());
  EXPECT_DOUBLE_EQ(6.0, cost1->totalCost());
  EXPECT_DOUBLE_EQ(0, cost2->totalCost());

  surface1.setConstruction(construction1);
  surface2.setConstruction(construction2);
  ASSERT_TRUE(surface1.construction());
  ASSERT_TRUE(surface2.construction());
  EXPECT_EQ(surface1.construction()->handle(), construction1.handle());
  EXPECT_EQ(surface2.construction()->handle(), construction2.handle());
  EXPECT_DOUBLE_EQ(1.0, construction1.getNetArea());
  EXPECT_DOUBLE_EQ(1.0, construction2.getNetArea());
  EXPECT_DOUBLE_EQ(3.0, cost1->totalCost());
  EXPECT_DOUBLE_EQ(5.0, cost2->totalCost());

  surface1.setAdjacentSurface(surface2);
  ASSERT_TRUE(surface1.construction());
  ASSERT_TRUE(surface2.construction());
  EXPECT_EQ(surface1.construction()->handle(), construction1.handle());
  EXPECT_EQ(surface2.construction()->handle(), construction2.handle());
  EXPECT_DOUBLE_EQ(1.0, construction1.getNetArea());
  EXPECT_DOUBLE_EQ(1.0, construction2.getNetArea());
  EXPECT_DOUBLE_EQ(3.0, cost1->totalCost());
  EXPECT_DOUBLE_EQ(5.0, cost2->totalCost());

  surface2.setConstruction(construction1);
  ASSERT_TRUE(surface1.construction());
  ASSERT_TRUE(surface2.construction());
  EXPECT_EQ(surface1.construction()->handle(), construction1.handle());
  EXPECT_EQ(surface2.construction()->handle(), construction1.handle());
  EXPECT_DOUBLE_EQ(1.0, construction1.getNetArea());
  EXPECT_DOUBLE_EQ(0.0, construction2.getNetArea());
  EXPECT_DOUBLE_EQ(3.0, cost1->totalCost());
  EXPECT_DOUBLE_EQ(0.0, cost2->totalCost());
}
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:100,代码来源:Construction_GTest.cpp

示例4: space

TEST_F(ModelFixture, DefaultConstructionSet_InteriorSubSurfaces)
{
  Model model;

  Point3dVector points;
  points.push_back(Point3d(0,1,0));
  points.push_back(Point3d(0,0,0));
  points.push_back(Point3d(1,0,0));
  Space space(model);
  Surface surface(points, model);
  surface.setSpace(space);
  EXPECT_FALSE(surface.setOutsideBoundaryCondition("Surface"));

  points.clear();
  points.push_back(Point3d(1,0,0));
  points.push_back(Point3d(0,0,0));
  points.push_back(Point3d(0,1,0));
  Space space2(model);
  Surface surface2(points, model);
  surface2.setSpace(space2);
  EXPECT_TRUE(surface.setAdjacentSurface(surface2));
  EXPECT_EQ("Surface", surface.outsideBoundaryCondition());
  EXPECT_EQ("Surface", surface2.outsideBoundaryCondition());
  ASSERT_TRUE(surface.adjacentSurface());
  ASSERT_TRUE(surface2.adjacentSurface());
  EXPECT_EQ(surface2.handle(), surface.adjacentSurface()->handle());
  EXPECT_EQ(surface.handle(), surface2.adjacentSurface()->handle());

  SubSurface subSurface(points, model);
  EXPECT_TRUE(subSurface.setSurface(surface));

  DefaultConstructionSet defaultConstructionSet(model);
  DefaultSubSurfaceConstructions defaultSubSurfaceConstructions(model);
  Construction construction(model);

  EXPECT_FALSE(defaultConstructionSet.defaultInteriorSubSurfaceConstructions());
  EXPECT_TRUE(defaultConstructionSet.setDefaultInteriorSubSurfaceConstructions(defaultSubSurfaceConstructions));
  ASSERT_TRUE(defaultConstructionSet.defaultInteriorSubSurfaceConstructions());
  EXPECT_EQ(defaultSubSurfaceConstructions.handle(), defaultConstructionSet.defaultInteriorSubSurfaceConstructions()->handle());

  EXPECT_TRUE(subSurface.setSubSurfaceType("FixedWindow"));
  EXPECT_FALSE(defaultConstructionSet.getDefaultConstruction(subSurface));
  EXPECT_TRUE(defaultSubSurfaceConstructions.setFixedWindowConstruction(construction));
  ASSERT_TRUE(defaultConstructionSet.getDefaultConstruction(subSurface));
  EXPECT_EQ(construction.handle(), defaultConstructionSet.getDefaultConstruction(subSurface)->handle());
  defaultSubSurfaceConstructions.resetFixedWindowConstruction();
  EXPECT_FALSE(defaultConstructionSet.getDefaultConstruction(subSurface));

  EXPECT_TRUE(subSurface.setSubSurfaceType("Door"));
  EXPECT_FALSE(defaultConstructionSet.getDefaultConstruction(subSurface));
  EXPECT_TRUE(defaultSubSurfaceConstructions.setDoorConstruction(construction));
  ASSERT_TRUE(defaultConstructionSet.getDefaultConstruction(subSurface));
  EXPECT_EQ(construction.handle(), defaultConstructionSet.getDefaultConstruction(subSurface)->handle());
  defaultSubSurfaceConstructions.resetDoorConstruction();
  EXPECT_FALSE(defaultConstructionSet.getDefaultConstruction(subSurface));

  EXPECT_TRUE(subSurface.setSubSurfaceType("Skylight"));
  EXPECT_FALSE(defaultConstructionSet.getDefaultConstruction(subSurface));
  EXPECT_TRUE(defaultSubSurfaceConstructions.setSkylightConstruction(construction));
  ASSERT_TRUE(defaultConstructionSet.getDefaultConstruction(subSurface));
  EXPECT_EQ(construction.handle(), defaultConstructionSet.getDefaultConstruction(subSurface)->handle());
  defaultSubSurfaceConstructions.resetSkylightConstruction();
  EXPECT_FALSE(defaultConstructionSet.getDefaultConstruction(subSurface));
}
开发者ID:ChengXinDL,项目名称:OpenStudio,代码行数:64,代码来源:DefaultConstructionSet_GTest.cpp


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