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

Function WriteLine

src/cpp/wasm/web-ifc-wasm.cpp:631–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629}
630
631bool WriteLine(uint32_t modelID, uint32_t expressID, uint32_t type, emscripten::val parameters)
632{
633 if (!manager.IsModelOpen(modelID))
634 return false;
635 auto loader = manager.GetIfcLoader(modelID);
636 uint32_t start = loader->GetTotalSize();
637
638 // line ID
639 loader->Push<uint8_t>(webifc::parsing::IfcTokenType::REF);
640 loader->Push<uint32_t>(expressID);
641
642 // line TYPE
643 std::string ifcName = manager.GetSchemaManager().IfcTypeCodeToType(type);
644 std::transform(ifcName.begin(), ifcName.end(), ifcName.begin(), ::toupper);
645 loader->Push<uint8_t>(webifc::parsing::IfcTokenType::LABEL);
646 loader->Push<uint16_t>((uint16_t)ifcName.size());
647 loader->Push((void *)ifcName.data(), ifcName.size());
648 bool responseCode = WriteSet(modelID, parameters);
649 // end line
650 loader->Push<uint8_t>(webifc::parsing::IfcTokenType::LINE_END);
651
652 loader->UpdateLineTape(expressID, type, start);
653 return responseCode;
654}
655
656emscripten::val ReadValue(uint32_t modelID, webifc::parsing::IfcTokenType t)
657{

Callers

nothing calls this directly

Calls 8

WriteSetFunction · 0.85
GetIfcLoaderMethod · 0.80
IfcTypeCodeToTypeMethod · 0.80
sizeMethod · 0.80
UpdateLineTapeMethod · 0.80
IsModelOpenMethod · 0.45
GetTotalSizeMethod · 0.45
PushMethod · 0.45

Tested by

no test coverage detected