MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / relativeTo

Method relativeTo

src/App/ObjectIdentifier.cpp:1155–1175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1153}
1154
1155ObjectIdentifier ObjectIdentifier::relativeTo(const ObjectIdentifier& other) const
1156{
1157 ObjectIdentifier result(other.getOwner());
1158 ResolveResults thisresult(*this);
1159 ResolveResults otherresult(other);
1160
1161 if (otherresult.resolvedDocument != thisresult.resolvedDocument) {
1162 result.setDocumentName(std::move(thisresult.resolvedDocumentName), true);
1163 }
1164 if (otherresult.resolvedDocumentObject != thisresult.resolvedDocumentObject) {
1165 result.setDocumentObjectName(std::move(thisresult.resolvedDocumentObjectName),
1166 true,
1167 String(subObjectName));
1168 }
1169
1170 for (std::size_t i = thisresult.propertyIndex; i < components.size(); ++i) {
1171 result << components[i];
1172 }
1173
1174 return result;
1175}
1176
1177ObjectIdentifier ObjectIdentifier::parse(const DocumentObject* docObj, const std::string& str)
1178{

Callers 2

createBindingVarSetMethod · 0.80

Calls 6

setDocumentObjectNameMethod · 0.80
StringClass · 0.70
moveFunction · 0.50
getOwnerMethod · 0.45
setDocumentNameMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected