All: Reformat according to new standard
This commit is contained in:
committed by
Kacper Donat
parent
ef997f2259
commit
9fe130cd73
@@ -23,7 +23,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
|
||||
#include <Inventor/nodes/SoSeparator.h>
|
||||
|
||||
|
||||
@@ -63,9 +62,10 @@ ViewProviderGeoFeatureGroupExtension::~ViewProviderGeoFeatureGroupExtension()
|
||||
}
|
||||
|
||||
|
||||
std::vector<App::DocumentObject*> ViewProviderGeoFeatureGroupExtension::extensionClaimChildren3D() const {
|
||||
std::vector<App::DocumentObject*> ViewProviderGeoFeatureGroupExtension::extensionClaimChildren3D() const
|
||||
{
|
||||
|
||||
//all object in the group must be claimed in 3D, as we are a coordinate system for all of them
|
||||
// all object in the group must be claimed in 3D, as we are a coordinate system for all of them
|
||||
auto* obj = getExtendedViewProvider()->getObject();
|
||||
auto* ext = obj ? obj->getExtensionByType<App::GeoFeatureGroupExtension>() : nullptr;
|
||||
if (ext) {
|
||||
@@ -75,7 +75,8 @@ std::vector<App::DocumentObject*> ViewProviderGeoFeatureGroupExtension::extensio
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<App::DocumentObject*> ViewProviderGeoFeatureGroupExtension::extensionClaimChildren() const {
|
||||
std::vector<App::DocumentObject*> ViewProviderGeoFeatureGroupExtension::extensionClaimChildren() const
|
||||
{
|
||||
|
||||
auto* obj = getExtendedViewProvider()->getObject();
|
||||
if (!obj) {
|
||||
@@ -83,30 +84,37 @@ std::vector<App::DocumentObject*> ViewProviderGeoFeatureGroupExtension::extensio
|
||||
}
|
||||
|
||||
auto* group = obj->getExtensionByType<App::GeoFeatureGroupExtension>();
|
||||
const std::vector<App::DocumentObject*> &model = group->Group.getValues ();
|
||||
std::set<App::DocumentObject*> outSet; //< set of objects not to claim (childrens of childrens)
|
||||
const std::vector<App::DocumentObject*>& model = group->Group.getValues();
|
||||
std::set<App::DocumentObject*> outSet; //< set of objects not to claim (childrens of childrens)
|
||||
|
||||
// search for objects handled (claimed) by the features
|
||||
for (auto obj: model) {
|
||||
//stuff in another geofeaturegroup is not in the model anyway
|
||||
if (!obj || obj->hasExtension(App::GeoFeatureGroupExtension::getExtensionClassTypeId())) { continue; }
|
||||
for (auto obj : model) {
|
||||
// stuff in another geofeaturegroup is not in the model anyway
|
||||
if (!obj || obj->hasExtension(App::GeoFeatureGroupExtension::getExtensionClassTypeId())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider ( obj );
|
||||
if (!vp || vp == getExtendedViewProvider()) { continue; }
|
||||
Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider(obj);
|
||||
if (!vp || vp == getExtendedViewProvider()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto children = vp->claimChildren();
|
||||
std::remove_copy ( children.begin (), children.end (), std::inserter (outSet, outSet.begin () ), nullptr);
|
||||
std::remove_copy(children.begin(), children.end(), std::inserter(outSet, outSet.begin()), nullptr);
|
||||
}
|
||||
|
||||
// remove the otherwise handled objects, preserving their order so the order in the TreeWidget is correct
|
||||
// remove the otherwise handled objects, preserving their order so the order in the TreeWidget
|
||||
// is correct
|
||||
std::vector<App::DocumentObject*> Result;
|
||||
for(auto obj : model) {
|
||||
if(!obj || !obj->isAttachedToDocument())
|
||||
for (auto obj : model) {
|
||||
if (!obj || !obj->isAttachedToDocument()) {
|
||||
continue;
|
||||
if(outSet.contains(obj))
|
||||
obj->setStatus(App::ObjectStatus::GeoExcluded,true);
|
||||
}
|
||||
if (outSet.contains(obj)) {
|
||||
obj->setStatus(App::ObjectStatus::GeoExcluded, true);
|
||||
}
|
||||
else {
|
||||
obj->setStatus(App::ObjectStatus::GeoExcluded,false);
|
||||
obj->setStatus(App::ObjectStatus::GeoExcluded, false);
|
||||
Result.push_back(obj);
|
||||
}
|
||||
}
|
||||
@@ -128,10 +136,11 @@ void ViewProviderGeoFeatureGroupExtension::extensionAttach(App::DocumentObject*
|
||||
|
||||
void ViewProviderGeoFeatureGroupExtension::extensionSetDisplayMode(const char* ModeName)
|
||||
{
|
||||
if ( strcmp("Group",ModeName)==0 )
|
||||
if (strcmp("Group", ModeName) == 0) {
|
||||
getExtendedViewProvider()->setDisplayMaskMode("Group");
|
||||
}
|
||||
|
||||
ViewProviderGroupExtension::extensionSetDisplayMode( ModeName );
|
||||
ViewProviderGroupExtension::extensionSetDisplayMode(ModeName);
|
||||
}
|
||||
|
||||
std::vector<std::string> ViewProviderGeoFeatureGroupExtension::extensionGetDisplayModes() const
|
||||
@@ -150,16 +159,20 @@ void ViewProviderGeoFeatureGroupExtension::extensionUpdateData(const App::Proper
|
||||
auto obj = getExtendedViewProvider()->getObject();
|
||||
auto grp = obj ? obj->getExtensionByType<App::GeoFeatureGroupExtension>() : nullptr;
|
||||
if (grp && prop == &grp->placement()) {
|
||||
getExtendedViewProvider()->setTransformation ( grp->placement().getValue().toMatrix() );
|
||||
getExtendedViewProvider()->setTransformation(grp->placement().getValue().toMatrix());
|
||||
}
|
||||
else {
|
||||
ViewProviderGroupExtension::extensionUpdateData ( prop );
|
||||
ViewProviderGroupExtension::extensionUpdateData(prop);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Gui {
|
||||
EXTENSION_PROPERTY_SOURCE_TEMPLATE(Gui::ViewProviderGeoFeatureGroupExtensionPython, Gui::ViewProviderGeoFeatureGroupExtension)
|
||||
namespace Gui
|
||||
{
|
||||
EXTENSION_PROPERTY_SOURCE_TEMPLATE(
|
||||
Gui::ViewProviderGeoFeatureGroupExtensionPython,
|
||||
Gui::ViewProviderGeoFeatureGroupExtension
|
||||
)
|
||||
|
||||
// explicit template instantiation
|
||||
template class GuiExport ViewProviderExtensionPythonT<ViewProviderGeoFeatureGroupExtension>;
|
||||
}
|
||||
} // namespace Gui
|
||||
|
||||
Reference in New Issue
Block a user