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

Method removeView

src/Mod/TechDraw/App/DrawPage.cpp:281–309  ·  view source on GitHub ↗

Note Views might be removed from document elsewhere so need to check if a View is still in Document here

Source from the content-addressed store, hash-verified

279
280//Note Views might be removed from document elsewhere so need to check if a View is still in Document here
281int DrawPage::removeView(App::DocumentObject* docObj)
282{
283 if (!docObj->isDerivedFrom<DrawView>() && !docObj->isDerivedFrom<App::Link>()) {
284 return -1;
285 }
286
287 App::Document* doc = docObj->getDocument();
288 if (!doc) {
289 return -1;
290 }
291
292 if (!docObj->isAttachedToDocument()) {
293 return -1;
294 }
295 std::vector<App::DocumentObject*> newViews;
296 for (auto* view : Views.getValues()) {
297 App::Document* viewDoc = view->getDocument();
298 if (!viewDoc) {
299 continue;
300 }
301
302 std::string viewName = docObj->getNameInDocument();
303 if (viewName.compare(view->getNameInDocument()) != 0) {
304 newViews.push_back(view);
305 }
306 }
307 Views.setValues(newViews);
308 return Views.getSize();
309}
310
311void DrawPage::requestPaint(void) { signalGuiPaint(this); }
312

Callers 9

unsetupObjectMethod · 0.45
simpleViewMoveFunction · 0.45
projGroupMoveFunction · 0.45
turnViewToProjGroupMethod · 0.45
turnProjGroupToViewMethod · 0.45
dragObjectMethod · 0.45
dropObjectMethod · 0.45
dropObjectMethod · 0.45
proceedMethod · 0.45

Calls 8

getDocumentMethod · 0.45
isAttachedToDocumentMethod · 0.45
getValuesMethod · 0.45
getNameInDocumentMethod · 0.45
compareMethod · 0.45
push_backMethod · 0.45
setValuesMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected