MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / addPrimitiveToEntity

Method addPrimitiveToEntity

radiantcore/map/algorithm/MapImporter.cpp:79–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79bool MapImporter::addPrimitiveToEntity(const scene::INodePtr& primitive, const scene::INodePtr& entity)
80{
81 _nodes.insert(NodeIndexMap::value_type(
82 NodeIndexPair(_entityCount, _primitiveCount), primitive));
83
84 _primitiveCount++;
85
86 if (_dialogEventLimiter.readyForEvent())
87 {
88 // Update the dialog text
89 FileOperation msg(FileOperation::Type::Import, FileOperation::Progress, _fileSize > 0, getProgressFraction());
90 msg.setText(_dlgEntityText + fmt::format(_("Primitive {0:d}"), _primitiveCount));
91 GlobalRadiantCore().getMessageBus().sendMessage(msg);
92 }
93
94 if (Node_getEntity(entity)->isContainer())
95 {
96 entity->addChildNode(primitive);
97 return true;
98 }
99 else
100 {
101 return false;
102 }
103}
104
105const NodeIndexMap& MapImporter::getNodeMap() const
106{

Callers 4

parsePrimitiveMethod · 0.45
parsePrimitiveMethod · 0.45
readBrushMethod · 0.45
readPatchMethod · 0.45

Calls 10

value_typeClass · 0.85
Node_getEntityFunction · 0.85
readyForEventMethod · 0.80
sendMessageMethod · 0.80
isContainerMethod · 0.80
addChildNodeMethod · 0.80
formatFunction · 0.50
_Function · 0.50
insertMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected