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

Method activateView

src/Gui/Application.cpp:1532–1548  ·  view source on GitHub ↗

* @brief Application::activateView * Activates a view of the given type of the active document. * If a view of this type doesn't exist and \a create is true * a new view of this type will be created. * @param type * @param create */

Source from the content-addressed store, hash-verified

1530 * @param create
1531 */
1532void Application::activateView(const Base::Type& type, bool create)
1533{
1534 Document* doc = activeDocument();
1535 if (doc) {
1536 MDIView* mdiView = doc->getActiveView();
1537 if (mdiView && mdiView->isDerivedFrom(type)) {
1538 return;
1539 }
1540 std::list<MDIView*> mdiViews = doc->getMDIViewsOfType(type);
1541 if (!mdiViews.empty()) {
1542 doc->setActiveWindow(mdiViews.back());
1543 }
1544 else if (create) {
1545 doc->createView(type);
1546 }
1547 }
1548}
1549
1550/// Getter for the active view
1551Gui::Document* Application::activeDocument() const

Callers 8

sActiveViewMethod · 0.45
sActivateViewMethod · 0.45
exerciseFunction · 0.45
testMoveSingleFeatureMethod · 0.45
testPDCreateSketchMethod · 0.45
testPartBodyMethod · 0.45
setUpMethod · 0.45

Calls 7

getMDIViewsOfTypeMethod · 0.80
getActiveViewMethod · 0.45
isDerivedFromMethod · 0.45
emptyMethod · 0.45
setActiveWindowMethod · 0.45
backMethod · 0.45
createViewMethod · 0.45

Tested by 5

testMoveSingleFeatureMethod · 0.36
testPDCreateSketchMethod · 0.36
testPartBodyMethod · 0.36
setUpMethod · 0.36