Move isLink and isLinkGroup from AssemblyObject to DocumentObject

This commit is contained in:
Bas Ruigrok
2024-09-08 11:56:14 +02:00
parent 8db7191084
commit cb98abcc42
5 changed files with 34 additions and 40 deletions

View File

@@ -2282,6 +2282,16 @@ bool Link::canLinkProperties() const {
return true;
}
bool Link::isLink() const
{
return ElementCount.getValue() == 0;
}
bool Link::isLinkGroup() const
{
return ElementCount.getValue() > 0;
}
//////////////////////////////////////////////////////////////////////////////////////////
namespace App {
@@ -2309,6 +2319,11 @@ bool LinkElement::canDelete() const {
return !owner || !owner->getDocument()->getObjectByID(_LinkOwner.getValue());
}
bool LinkElement::isLink() const
{
return true;
}
App::Link* LinkElement::getLinkGroup() const
{
std::vector<App::DocumentObject*> inList = getInList();