Core: move getPlacementProperty to be more accessible (#26088)
* Core: move getPlacementProperty to be more accessible * Update DocumentObject.h * Update DocumentObject.cpp * Update ViewProviderDragger.h * Update ViewProviderDragger.cpp * Update DocumentObject.h * Update DocumentObject.cpp * Update ViewProviderLink.cpp * Update DocumentObject.h * Update DocumentObject.cpp * Update DocumentObject.h
This commit is contained in:
@@ -1644,3 +1644,26 @@ Base::Placement DocumentObject::getPlacementOf(const std::string& sub, DocumentO
|
||||
return plc * subObj->getPlacementOf(newSub, targetObj);
|
||||
}
|
||||
|
||||
Base::Placement DocumentObject::getPlacement() const
|
||||
{
|
||||
Base::Placement plc;
|
||||
if (auto* prop = getPlacementProperty()) {
|
||||
plc = prop->getValue();
|
||||
}
|
||||
return plc;
|
||||
}
|
||||
|
||||
App::PropertyPlacement* DocumentObject::getPlacementProperty() const
|
||||
{
|
||||
if (auto linkExtension = getExtensionByType<App::LinkBaseExtension>(true)) {
|
||||
if (auto linkPlacementProp = linkExtension->getLinkPlacementProperty()) {
|
||||
return linkPlacementProp;
|
||||
}
|
||||
|
||||
return linkExtension->getPlacementProperty();
|
||||
}
|
||||
|
||||
return getPropertyByName<App::PropertyPlacement>("Placement");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user