MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / create_testcase

Function create_testcase

src/examples/faces.cpp:37–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35static int x = 0;
36
37void create_testcase(IfcHierarchyHelper<IfcSchema>& file, IfcSchema::IfcFace* face, const std::string& name) {
38 IfcSchema::IfcFace::list::ptr faces(new IfcSchema::IfcFace::list);
39 faces->push(face);
40 IfcSchema::IfcOpenShell* shell = new IfcSchema::IfcOpenShell(faces);
41
42 IfcSchema::IfcConnectedFaceSet::list::ptr shells(new IfcSchema::IfcConnectedFaceSet::list);
43 shells->push(shell);
44 IfcSchema::IfcFaceBasedSurfaceModel* model = new IfcSchema::IfcFaceBasedSurfaceModel(shells);
45
46 IfcSchema::IfcBuildingElementProxy* product = new IfcSchema::IfcBuildingElementProxy(
47 guid(), 0, name, null, null, 0, 0, null, null);
48 file.addBuildingProduct(product);
49 product->setOwnerHistory(file.getSingle<IfcSchema::IfcOwnerHistory>());
50
51 product->setObjectPlacement(file.addLocalPlacement(0, 1000 * x++, 0));
52
53 IfcSchema::IfcRepresentation::list::ptr reps (new IfcSchema::IfcRepresentation::list);
54 IfcSchema::IfcRepresentationItem::list::ptr items (new IfcSchema::IfcRepresentationItem::list);
55
56 items->push(model);
57 IfcSchema::IfcShapeRepresentation* rep = new IfcSchema::IfcShapeRepresentation(
58 file.getRepresentationContext("Model"), S("Body"), S("SurfaceModel"), items);
59 reps->push(rep);
60
61 IfcSchema::IfcProductDefinitionShape* shape = new IfcSchema::IfcProductDefinitionShape(boost::none, boost::none, reps);
62 file.addEntity(shape);
63
64 product->setRepresentation(shape);
65}
66
67int main(int argc, char** argv) {
68 IfcHierarchyHelper<IfcSchema> file;

Callers 1

mainFunction · 0.85

Calls 5

addBuildingProductMethod · 0.80
addLocalPlacementMethod · 0.80
addEntityMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected