+ add toggle action to context-menu of spline view provider
This commit is contained in:
parent
ff320f465f
commit
71be79e09e
|
@ -42,11 +42,16 @@
|
|||
# include <Inventor/nodes/SoCoordinate3.h>
|
||||
# include <Inventor/nodes/SoSeparator.h>
|
||||
# include <Inventor/nodes/SoSwitch.h>
|
||||
# include <QAction>
|
||||
# include <QMenu>
|
||||
#endif
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
|
||||
#include <App/PropertyStandard.h>
|
||||
#include <Mod/Part/App/PartFeature.h>
|
||||
#include <Gui/ActionFunction.h>
|
||||
#include "SoFCShapeObject.h"
|
||||
#include "ViewProviderSpline.h"
|
||||
|
||||
|
@ -66,6 +71,23 @@ ViewProviderSpline::~ViewProviderSpline()
|
|||
{
|
||||
}
|
||||
|
||||
void ViewProviderSpline::setupContextMenu(QMenu* menu, QObject* receiver, const char* member)
|
||||
{
|
||||
ViewProviderPartExt::setupContextMenu(menu, receiver, member);
|
||||
|
||||
// toggle command to display components
|
||||
Gui::ActionFunction* func = new Gui::ActionFunction(menu);
|
||||
QAction* act = menu->addAction(QObject::tr("Show control points"));
|
||||
act->setCheckable(true);
|
||||
act->setChecked(ControlPoints.getValue());
|
||||
func->toggle(act, boost::bind(&ViewProviderSpline::toggleControlPoints, this, _1));
|
||||
}
|
||||
|
||||
void ViewProviderSpline::toggleControlPoints(bool on)
|
||||
{
|
||||
ControlPoints.setValue(on);
|
||||
}
|
||||
|
||||
void ViewProviderSpline::updateData(const App::Property* prop)
|
||||
{
|
||||
ViewProviderPartExt::updateData(prop);
|
||||
|
|
|
@ -44,9 +44,11 @@ public:
|
|||
App::PropertyBool ControlPoints;
|
||||
|
||||
void updateData(const App::Property* prop);
|
||||
void setupContextMenu(QMenu* menu, QObject* receiver, const char* member);
|
||||
|
||||
protected:
|
||||
void onChanged(const App::Property* prop);
|
||||
void toggleControlPoints(bool);
|
||||
void showControlPoints(bool, const App::Property* prop);
|
||||
void showControlPointsOfEdge(const TopoDS_Edge&);
|
||||
void showControlPointsOfFace(const TopoDS_Face&);
|
||||
|
|
Loading…
Reference in New Issue
Block a user