CAM: apply precommit
This commit is contained in:
@@ -38,13 +38,12 @@ ViewProviderArea::ViewProviderArea()
|
||||
}
|
||||
|
||||
ViewProviderArea::~ViewProviderArea()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
std::vector<App::DocumentObject*> ViewProviderArea::claimChildren() const
|
||||
{
|
||||
return std::vector<App::DocumentObject*>(
|
||||
static_cast<Path::FeatureArea*>(getObject())->Sources.getValues());
|
||||
static_cast<Path::FeatureArea*>(getObject())->Sources.getValues());
|
||||
}
|
||||
|
||||
bool ViewProviderArea::canDragObjects() const
|
||||
@@ -61,7 +60,8 @@ void ViewProviderArea::dragObject(App::DocumentObject* obj)
|
||||
{
|
||||
Path::FeatureArea* area = static_cast<Path::FeatureArea*>(getObject());
|
||||
std::vector<App::DocumentObject*> sources = area->Sources.getValues();
|
||||
for (std::vector<App::DocumentObject*>::iterator it = sources.begin(); it != sources.end(); ++it) {
|
||||
for (std::vector<App::DocumentObject*>::iterator it = sources.begin(); it != sources.end();
|
||||
++it) {
|
||||
if (*it == obj) {
|
||||
sources.erase(it);
|
||||
area->Sources.setValues(sources);
|
||||
@@ -92,22 +92,27 @@ void ViewProviderArea::updateData(const App::Property* prop)
|
||||
{
|
||||
PartGui::ViewProviderPart::updateData(prop);
|
||||
if (prop->isDerivedFrom<App::PropertyLinkList>()) {
|
||||
std::vector<App::DocumentObject*> pShapes = static_cast<const App::PropertyLinkList*>(prop)->getValues();
|
||||
for (std::vector<App::DocumentObject*>::iterator it = pShapes.begin(); it != pShapes.end(); ++it) {
|
||||
if (*it)
|
||||
std::vector<App::DocumentObject*> pShapes =
|
||||
static_cast<const App::PropertyLinkList*>(prop)->getValues();
|
||||
for (std::vector<App::DocumentObject*>::iterator it = pShapes.begin(); it != pShapes.end();
|
||||
++it) {
|
||||
if (*it) {
|
||||
Gui::Application::Instance->hideViewProvider(*it);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ViewProviderArea::onDelete(const std::vector<std::string> &)
|
||||
bool ViewProviderArea::onDelete(const std::vector<std::string>&)
|
||||
{
|
||||
// get the input shapes
|
||||
Path::FeatureArea* area = static_cast<Path::FeatureArea*>(getObject());
|
||||
std::vector<App::DocumentObject*> pShapes =area->Sources.getValues();
|
||||
for (std::vector<App::DocumentObject*>::iterator it = pShapes.begin(); it != pShapes.end(); ++it) {
|
||||
if (*it)
|
||||
std::vector<App::DocumentObject*> pShapes = area->Sources.getValues();
|
||||
for (std::vector<App::DocumentObject*>::iterator it = pShapes.begin(); it != pShapes.end();
|
||||
++it) {
|
||||
if (*it) {
|
||||
Gui::Application::Instance->showViewProvider(*it);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -122,15 +127,15 @@ ViewProviderAreaView::ViewProviderAreaView()
|
||||
}
|
||||
|
||||
ViewProviderAreaView::~ViewProviderAreaView()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
std::vector<App::DocumentObject*> ViewProviderAreaView::claimChildren() const
|
||||
{
|
||||
std::vector<App::DocumentObject*> ret;
|
||||
Path::FeatureAreaView* feature = static_cast<Path::FeatureAreaView*>(getObject());
|
||||
if(feature->Source.getValue())
|
||||
if (feature->Source.getValue()) {
|
||||
ret.push_back(feature->Source.getValue());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -144,7 +149,7 @@ bool ViewProviderAreaView::canDragObject(App::DocumentObject* obj) const
|
||||
return obj && obj->isDerivedFrom<Path::FeatureArea>();
|
||||
}
|
||||
|
||||
void ViewProviderAreaView::dragObject(App::DocumentObject* )
|
||||
void ViewProviderAreaView::dragObject(App::DocumentObject*)
|
||||
{
|
||||
Path::FeatureAreaView* feature = static_cast<Path::FeatureAreaView*>(getObject());
|
||||
feature->Source.setValue(nullptr);
|
||||
@@ -169,12 +174,13 @@ void ViewProviderAreaView::dropObject(App::DocumentObject* obj)
|
||||
void ViewProviderAreaView::updateData(const App::Property* prop)
|
||||
{
|
||||
PartGui::ViewProviderPlaneParametric::updateData(prop);
|
||||
if (prop->isDerivedFrom<App::PropertyLink>())
|
||||
if (prop->isDerivedFrom<App::PropertyLink>()) {
|
||||
Gui::Application::Instance->hideViewProvider(
|
||||
static_cast<const App::PropertyLink*>(prop)->getValue());
|
||||
static_cast<const App::PropertyLink*>(prop)->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
bool ViewProviderAreaView::onDelete(const std::vector<std::string> &)
|
||||
bool ViewProviderAreaView::onDelete(const std::vector<std::string>&)
|
||||
{
|
||||
Path::FeatureAreaView* feature = static_cast<Path::FeatureAreaView*>(getObject());
|
||||
Gui::Application::Instance->showViewProvider(feature->Source.getValue());
|
||||
@@ -183,7 +189,8 @@ bool ViewProviderAreaView::onDelete(const std::vector<std::string> &)
|
||||
|
||||
// Python object -----------------------------------------------------------------------
|
||||
|
||||
namespace Gui {
|
||||
namespace Gui
|
||||
{
|
||||
/// @cond DOXERR
|
||||
PROPERTY_SOURCE_TEMPLATE(PathGui::ViewProviderAreaPython, PathGui::ViewProviderArea)
|
||||
PROPERTY_SOURCE_TEMPLATE(PathGui::ViewProviderAreaViewPython, PathGui::ViewProviderAreaView)
|
||||
@@ -192,5 +199,4 @@ PROPERTY_SOURCE_TEMPLATE(PathGui::ViewProviderAreaViewPython, PathGui::ViewProvi
|
||||
// explicit template instantiation
|
||||
template class PathGuiExport ViewProviderFeaturePythonT<PathGui::ViewProviderArea>;
|
||||
template class PathGuiExport ViewProviderFeaturePythonT<PathGui::ViewProviderAreaView>;
|
||||
}
|
||||
|
||||
} // namespace Gui
|
||||
|
||||
Reference in New Issue
Block a user