+ add toggle action to context-menu of spline view provider
This commit is contained in:
parent
ff320f465f
commit
71be79e09e
|
@ -20,7 +20,7 @@
|
||||||
* *
|
* *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#include "PreCompiled.h"
|
#include "PreCompiled.h"
|
||||||
#ifndef _PreComp_
|
#ifndef _PreComp_
|
||||||
# include <BRepAdaptor_Curve.hxx>
|
# include <BRepAdaptor_Curve.hxx>
|
||||||
|
@ -42,11 +42,16 @@
|
||||||
# include <Inventor/nodes/SoCoordinate3.h>
|
# include <Inventor/nodes/SoCoordinate3.h>
|
||||||
# include <Inventor/nodes/SoSeparator.h>
|
# include <Inventor/nodes/SoSeparator.h>
|
||||||
# include <Inventor/nodes/SoSwitch.h>
|
# include <Inventor/nodes/SoSwitch.h>
|
||||||
|
# include <QAction>
|
||||||
|
# include <QMenu>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <boost/bind.hpp>
|
||||||
|
|
||||||
|
|
||||||
#include <App/PropertyStandard.h>
|
#include <App/PropertyStandard.h>
|
||||||
#include <Mod/Part/App/PartFeature.h>
|
#include <Mod/Part/App/PartFeature.h>
|
||||||
|
#include <Gui/ActionFunction.h>
|
||||||
#include "SoFCShapeObject.h"
|
#include "SoFCShapeObject.h"
|
||||||
#include "ViewProviderSpline.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)
|
void ViewProviderSpline::updateData(const App::Property* prop)
|
||||||
{
|
{
|
||||||
ViewProviderPartExt::updateData(prop);
|
ViewProviderPartExt::updateData(prop);
|
||||||
|
|
|
@ -44,9 +44,11 @@ public:
|
||||||
App::PropertyBool ControlPoints;
|
App::PropertyBool ControlPoints;
|
||||||
|
|
||||||
void updateData(const App::Property* prop);
|
void updateData(const App::Property* prop);
|
||||||
|
void setupContextMenu(QMenu* menu, QObject* receiver, const char* member);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onChanged(const App::Property* prop);
|
void onChanged(const App::Property* prop);
|
||||||
|
void toggleControlPoints(bool);
|
||||||
void showControlPoints(bool, const App::Property* prop);
|
void showControlPoints(bool, const App::Property* prop);
|
||||||
void showControlPointsOfEdge(const TopoDS_Edge&);
|
void showControlPointsOfEdge(const TopoDS_Edge&);
|
||||||
void showControlPointsOfFace(const TopoDS_Face&);
|
void showControlPointsOfFace(const TopoDS_Face&);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user