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

Method extensionCanDropObject

src/Gui/ViewProviderGroupExtension.cpp:129–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129bool ViewProviderGroupExtension::extensionCanDropObject(App::DocumentObject* obj) const
130{
131#ifdef FC_DEBUG
132 Base::Console().log("Check ViewProviderGroupExtension\n");
133#endif
134
135 auto extobj = getExtendedViewProvider()->getObject();
136 auto group = extobj->getExtensionByType<App::GroupExtension>();
137
138 // we cannot drop thing of this group into it again if it does not allow reorder
139 if (group->hasObject(obj) && !getExtendedViewProvider()->acceptReorderingObjects()) {
140 return false;
141 }
142
143 // Check for possible cyclic dependencies if we allowed to drop the object
144 const auto& list = obj->getOutList();
145 if (std::ranges::find(list, extobj) != list.end()) {
146 Base::Console().warning("Do not add cyclic dependency to %s\n", extobj->Label.getValue());
147 return false;
148 }
149
150 return group->allowObject(obj);
151}
152
153void ViewProviderGroupExtension::extensionDropObject(App::DocumentObject* obj)
154{

Callers 3

canDropObjectMethod · 0.45
dropObjectMethod · 0.45
replaceObjectMethod · 0.45

Calls 10

findFunction · 0.50
logMethod · 0.45
getObjectMethod · 0.45
hasObjectMethod · 0.45
getOutListMethod · 0.45
endMethod · 0.45
warningMethod · 0.45
getValueMethod · 0.45
allowObjectMethod · 0.45

Tested by

no test coverage detected