Sketcher: Snap: Add 'Snap at angle' support to DrawSketchHandler.
This commit is contained in:
@@ -114,6 +114,11 @@ inline int ViewProviderSketchDrawSketchHandlerAttorney::getPreselectCross(const
|
||||
return vp.getPreselectCross();
|
||||
}
|
||||
|
||||
inline void ViewProviderSketchDrawSketchHandlerAttorney::setAngleSnapping(ViewProviderSketch &vp, bool enable, Base::Vector2d referencePoint)
|
||||
{
|
||||
vp.setAngleSnapping(enable, referencePoint);
|
||||
}
|
||||
|
||||
|
||||
/**************************** CurveConverter **********************************************/
|
||||
|
||||
@@ -250,6 +255,7 @@ void DrawSketchHandler::deactivate()
|
||||
drawEditMarkers(std::vector<Base::Vector2d>());
|
||||
resetPositionText();
|
||||
unsetCursor();
|
||||
setAngleSnapping(false);
|
||||
}
|
||||
|
||||
void DrawSketchHandler::preActivated()
|
||||
@@ -992,3 +998,7 @@ Sketcher::SketchObject * DrawSketchHandler::getSketchObject()
|
||||
return sketchgui->getSketchObject();
|
||||
}
|
||||
|
||||
void DrawSketchHandler::setAngleSnapping(bool enable, Base::Vector2d referencePoint)
|
||||
{
|
||||
ViewProviderSketchDrawSketchHandlerAttorney::setAngleSnapping(*sketchgui, enable, referencePoint);
|
||||
}
|
||||
@@ -86,11 +86,13 @@ private:
|
||||
static inline void setAxisPickStyle(ViewProviderSketch &vp, bool on);
|
||||
static inline void moveCursorToSketchPoint(ViewProviderSketch &vp, Base::Vector2d point);
|
||||
static inline void preselectAtPoint(ViewProviderSketch &vp, Base::Vector2d point);
|
||||
static inline void setAngleSnapping(ViewProviderSketch &vp, bool enable, Base::Vector2d referencePoint = Base::Vector2d(0., 0.));
|
||||
|
||||
static inline int getPreselectPoint(const ViewProviderSketch &vp);
|
||||
static inline int getPreselectCurve(const ViewProviderSketch &vp);
|
||||
static inline int getPreselectCross(const ViewProviderSketch &vp);
|
||||
|
||||
|
||||
friend class DrawSketchHandler;
|
||||
};
|
||||
|
||||
@@ -203,6 +205,8 @@ protected:
|
||||
|
||||
Sketcher::SketchObject * getSketchObject();
|
||||
|
||||
void setAngleSnapping(bool enable, Base::Vector2d referencePoint = Base::Vector2d(0., 0.));
|
||||
|
||||
private:
|
||||
void setSvgCursor(const QString &svgName, int x, int y,
|
||||
const std::map<unsigned long, unsigned long>& colorMapping = std::map<unsigned long, unsigned long>());
|
||||
|
||||
Reference in New Issue
Block a user