MCPcopy Create free account
hub / github.com/ThatOpen/engine_web-ifc / GetSurface

Method GetSurface

src/cpp/web-ifc/geometry/IfcGeometryProcessor.cpp:1286–1672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1284 }
1285
1286 IfcSurface IfcGeometryProcessor::GetSurface(uint32_t expressID)
1287 {
1288 spdlog::debug("[GetSurface({})]", expressID);
1289 auto lineType = _loader.GetLineType(expressID);
1290
1291 // TODO: IfcSweptSurface and IfcBSplineSurface still missing
1292 switch (lineType)
1293 {
1294 case schema::IFCPLANE:
1295 {
1296 IfcSurface surface;
1297
1298 _loader.MoveToArgumentOffset(expressID, 0);
1299 uint32_t locationID = _loader.GetRefArgument();
1300 surface.transformation = _geometryLoader.GetLocalPlacement(locationID);
1301
1302 return surface;
1303 }
1304 case schema::IFCBSPLINESURFACE:
1305 {
1306 IfcSurface surface;
1307
1308 std::vector<std::vector<glm::vec<3, glm::f64>>> ctrolPts;
1309
1310 _loader.MoveToArgumentOffset(expressID, 0);
1311 int Udegree = _loader.GetIntArgument();
1312
1313 _loader.MoveToArgumentOffset(expressID, 1);
1314 int Vdegree = _loader.GetIntArgument();
1315
1316 _loader.MoveToArgumentOffset(expressID, 2);
1317 auto ctrlPointGroups = _loader.GetSetListArgument();
1318 for (auto &set : ctrlPointGroups)
1319 {
1320 std::vector<glm::vec<3, glm::f64>> list;
1321 for (auto &token : set)
1322 {
1323 uint32_t pointId = _loader.GetRefArgument(token);
1324 list.push_back(_geometryLoader.GetCartesianPoint3D(pointId));
1325 }
1326 ctrolPts.push_back(list);
1327 }
1328
1329 _loader.MoveToArgumentOffset(expressID, 3);
1330 auto curveType = _loader.GetStringArgument();
1331
1332 _loader.MoveToArgumentOffset(expressID, 4);
1333 auto closedU = _loader.GetStringArgument();
1334
1335 _loader.MoveToArgumentOffset(expressID, 5);
1336 auto closedV = _loader.GetStringArgument();
1337
1338 _loader.MoveToArgumentOffset(expressID, 6);
1339 auto selfIntersect = _loader.GetStringArgument();
1340
1341 surface.BSplineSurface.Active = true;
1342 surface.BSplineSurface.UDegree = Udegree;
1343 surface.BSplineSurface.VDegree = Vdegree;

Callers

nothing calls this directly

Calls 15

debugFunction · 0.85
errorFunction · 0.85
MoveToArgumentOffsetMethod · 0.80
GetRefArgumentMethod · 0.80
GetLocalPlacementMethod · 0.80
GetIntArgumentMethod · 0.80
GetSetListArgumentMethod · 0.80
GetCartesianPoint3DMethod · 0.80
GetStringArgumentMethod · 0.80
GetSetArgumentMethod · 0.80
GetDoubleArgumentMethod · 0.80
GetProfile3DMethod · 0.80

Tested by

no test coverage detected