Gui: add new API ViewProviderDocumentObject::allowOverride()

This API is used to delcare if a view provider can be used as an
override for a give object.

Conflicts:
	src/App/DocumentObject.h
This commit is contained in:
Zheng, Lei
2019-09-22 21:18:54 +08:00
committed by wmayer
parent 7305343e10
commit 2df3052ecf
10 changed files with 89 additions and 103 deletions

View File

@@ -467,6 +467,12 @@ void ViewProviderPartExt::onChanged(const App::Property* prop)
ViewProviderGeometryObject::onChanged(prop);
}
bool ViewProviderPartExt::allowOverride(const App::DocumentObject &) const {
// Many derived view providers still uses static_cast to get object
// pointer, so check for exact type here.
return getTypeId() == ViewProviderPartExt::getClassTypeId();
}
void ViewProviderPartExt::attach(App::DocumentObject *pcFeat)
{
// call parent attach method