Extensions: Port ViewProvider of GeoFeatureGroup

This commit is contained in:
Stefan Tröger
2016-08-27 15:14:13 +02:00
committed by wmayer
parent cd53eb2280
commit 261798da2e
14 changed files with 272 additions and 114 deletions

View File

@@ -42,6 +42,7 @@
#include "MDIView.h"
#include "TaskView/TaskAppearance.h"
#include "ViewProviderDocumentObject.h"
#include "ViewProviderExtension.h"
#include <Gui/ViewProviderDocumentObjectPy.h>
@@ -160,7 +161,7 @@ void ViewProviderDocumentObject::attach(App::DocumentObject *pcObj)
{
// save Object pointer
pcObject = pcObj;
// Retrieve the supported display modes of the view provider
aDisplayModesArray = this->getDisplayModes();
@@ -179,6 +180,11 @@ void ViewProviderDocumentObject::attach(App::DocumentObject *pcObj)
const char* defmode = this->getDefaultDisplayMode();
if (defmode)
DisplayMode.setValue(defmode);
//attach the extensions
auto vector = getExtensionsDerivedFromType<Gui::ViewProviderExtension>();
for(Gui::ViewProviderExtension* ext : vector)
ext->extensionAttach(pcObj);
}
Gui::Document* ViewProviderDocumentObject::getDocument() const
@@ -265,18 +271,6 @@ void ViewProviderDocumentObject::setActiveMode()
ViewProvider::hide();
}
const char* ViewProviderDocumentObject::getDefaultDisplayMode() const
{
// We use the first item then
return 0;
}
std::vector<std::string> ViewProviderDocumentObject::getDisplayModes(void) const
{
// empty
return std::vector<std::string>();
}
PyObject* ViewProviderDocumentObject::getPyObject()
{
if (!pyViewObject)