RuledSurface fixes, Switch Part_Mirror to SVG icon
RuledSurface fixes, claim children correct tool tip change default name from "Filled_shape" to "Ruled Surface" Part_Mirror Switched icon in the tool bar, menu, and tree from the existing PNG icon to the also existing SVG icon
This commit is contained in:
committed by
Yorik van Havre
parent
f18ddea1b3
commit
0ccbcffbf5
@@ -30,6 +30,9 @@
|
||||
#include <Base/Parameter.h>
|
||||
|
||||
#include "ViewProviderRuledSurface.h"
|
||||
#include <Mod/Part/App/PartFeatures.h>
|
||||
|
||||
#include <Gui/Application.h>
|
||||
|
||||
|
||||
//#include "Tree.h"
|
||||
@@ -56,6 +59,47 @@ ViewProviderRuledSurface::~ViewProviderRuledSurface()
|
||||
|
||||
}
|
||||
|
||||
std::vector<App::DocumentObject*> ViewProviderRuledSurface::claimChildren() const
|
||||
{
|
||||
std::vector<App::DocumentObject*> temp;
|
||||
temp.push_back(static_cast<Part::RuledSurface*>(getObject())->Curve1.getValue());
|
||||
temp.push_back(static_cast<Part::RuledSurface*>(getObject())->Curve2.getValue());
|
||||
return temp;
|
||||
}
|
||||
|
||||
void ViewProviderRuledSurface::updateData(const App::Property* prop)
|
||||
{
|
||||
PartGui::ViewProviderPart::updateData(prop);
|
||||
if (prop->getTypeId() == Part::PropertyShapeHistory::getClassTypeId()) {
|
||||
const std::vector<Part::ShapeHistory>& hist = static_cast<const Part::PropertyShapeHistory*>
|
||||
(prop)->getValues();
|
||||
}
|
||||
/* //The following hides the Children shapes. If the edges from which the Ruled Surface was created
|
||||
* were selected from the subshapes of another shape, it is likely that one would not want to hide the shape
|
||||
* hence this section is commented out
|
||||
Part::RuledSurface* pRuledSurface = static_cast<Part::RuledSurface*>(getObject());
|
||||
App::DocumentObject *pCurve1 = pRuledSurface->Curve1.getValue();
|
||||
App::DocumentObject *pCurve2 = pRuledSurface->Curve2.getValue();
|
||||
if (pCurve1)
|
||||
Gui::Application::Instance->hideViewProvider(pCurve1);
|
||||
if (pCurve2)
|
||||
Gui::Application::Instance->hideViewProvider(pCurve2);*/
|
||||
|
||||
}
|
||||
|
||||
bool ViewProviderRuledSurface::onDelete(const std::vector<std::string> &)
|
||||
{
|
||||
// get the input shape
|
||||
Part::RuledSurface* pRuledSurface = static_cast<Part::RuledSurface*>(getObject());
|
||||
App::DocumentObject *pCurve1 = pRuledSurface->Curve1.getValue();
|
||||
App::DocumentObject *pCurve2 = pRuledSurface->Curve2.getValue();
|
||||
if (pCurve1)
|
||||
Gui::Application::Instance->showViewProvider(pCurve1);
|
||||
if (pCurve2)
|
||||
Gui::Application::Instance->showViewProvider(pCurve2);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// **********************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user