Public Member Functions | |
def | addHoldPoint (self) |
def | constrain (self, point, basepoint=None, axis=None) |
def | cstr (self, lastpoint, constrain, point) |
def | cycleSnapObject (self) |
def | get_snap_toolbar (self) |
def | getApparentPoint (self, x, y) |
def | getPerpendicular (self, edge, pt) |
def | getPoint (self, last=None, callback=None, movecallback=None, extradlg=None, title=None, mode="point") |
def | getScreenDist (self, dist, cursor) |
def | hide (self) |
def | init_active_snaps (self) |
def | init_draft_snap_buttons (self, commands, context, button_suffix) |
def | init_grid_button (self, context) |
def | isEnabled (self, snap) |
def | makeSnapToolBar (self) |
def | off (self, hideSnapBar=False) |
def | restack (self) |
def | restore_snap_buttons_state (self, toolbar, button_suffix) |
def | save_snap_state (self) |
def | setAngle (self, delta=None) |
def | setArchDims (self, p1, p2) |
def | setCursor (self, mode=None) |
def | setGrid (self) |
def | setSelectMode (self, mode) |
def | setTrackers (self) |
def | show (self) |
def | showradius (self) |
def | snap (self, screenpos, lastpoint=None, active=True, constrain=False, noTracker=False) |
def | snapToAngles (self, shape) |
def | snapToCenter (self, shape) |
def | snapToCrossExtensions (self, point) |
def | snapToDim (self, obj) |
def | snapToElines (self, e1, e2) |
def | snapToEndpoints (self, shape) |
def | snapToExtensions (self, point, last, constrain, eline) |
def | snapToExtOrtho (self, last, constrain, eline) |
def | snapToExtPerpendicular (self, last) |
def | snapToFace (self, shape) |
def | snapToGrid (self, point) |
def | snapToHold (self, point) |
def | snapToIntersection (self, shape) |
def | snapToMidpoint (self, shape) |
def | snapToObject (self, lastpoint, active, constrain, eline, point, oldActive) |
def | snapToOrtho (self, shape, last, constrain) |
def | snapToPerpendicular (self, shape, last) |
def | snapToPolar (self, point, last) |
def | snapToPolygon (self, obj) |
def | snapToSpecials (self, obj, lastpoint=None, eline=None) |
def | snapToVertex (self, info, active=False) |
def | toggle_snap (self, snap, set_to=None) |
def | toggleGrid (self) |
def | toWP (self, point) |
def | unconstrain (self) |
Detailed Description
Classes to manage snapping in Draft and Arch. The Snapper objects contains all the functionality used by draft and arch module to manage object snapping. It is responsible for finding snap points and displaying snap markers. Usually You only need to invoke it's snap() function, all the rest is taken care of. 3 functions are useful for the scriptwriter: snap(), constrain() or getPoint() which is an all-in-one combo. The individual snapToXXX() functions return a snap definition in the form [real_point,marker_type,visual_point], and are not meant to be used directly, they are all called when necessary by the general snap() function. The Snapper lives inside FreeCADGui once the Draft module has been loaded.
Member Function Documentation
◆ addHoldPoint()
def draftguitools.gui_snapper.Snapper.addHoldPoint | ( | self | ) |
Add hold snap point to list of hold points.
References draftguitools.gui_snapper.Snapper.holdPoints, draftguitools.gui_snapper.Snapper.holdTracker, and draftguitools.gui_snapper.Snapper.spoint.
◆ constrain()
def draftguitools.gui_snapper.Snapper.constrain | ( | self, | |
point, | |||
basepoint = None , |
|||
axis = None |
|||
) |
Return a constrained point. constrain(point,basepoint=None,axis=None: Returns a constrained point. Axis can be "x","y" or "z" or a custom vector. If None, the closest working plane axis will be picked. Basepoint is the base point used to figure out from where the point must be constrained. If no basepoint is given, the current point is used as basepoint.
References draftguitools.gui_snapper.Snapper.affinity, draftguitools.gui_snapper.Snapper.basepoint, draftguitools.gui_snapper.Snapper.constrainLine, draftguitools.gui_snapper.Snapper.constraintAxis, draftguitools.gui_snapper.Snapper.mask, DraftGui.DraftToolBar.mask, draftguitools.gui_snapper.Snapper.off(), DraftVecUtils.project(), and draftguitools.gui_snapper.Snapper.snapStyle.
Referenced by draftguitools.gui_snapper.Snapper.cstr().
◆ cstr()
def draftguitools.gui_snapper.Snapper.cstr | ( | self, | |
lastpoint, | |||
constrain, | |||
point | |||
) |
Return constraints if needed.
References draftguitools.gui_base_original.DraftTool.constrain, draftguitools.gui_snapper.Snapper.constrain(), DraftGui.DraftToolBar.constrain(), draftguitools.gui_snapper.Snapper.mask, DraftGui.DraftToolBar.mask, draftguitools.gui_snapper.Snapper.radiusTracker, and draftguitools.gui_snapper.Snapper.unconstrain().
Referenced by draftguitools.gui_snapper.Snapper.snapToObject().
◆ cycleSnapObject()
def draftguitools.gui_snapper.Snapper.cycleSnapObject | ( | self | ) |
Increse the index of the snap object by one.
References draftguitools.gui_snapper.Snapper.snapObjectIndex.
◆ get_snap_toolbar()
def draftguitools.gui_snapper.Snapper.get_snap_toolbar | ( | self | ) |
Returns snap toolbar object.
References Gui.getMainWindow().
Referenced by draftguitools.gui_snapper.Snapper.show().
◆ getApparentPoint()
def draftguitools.gui_snapper.Snapper.getApparentPoint | ( | self, | |
x, | |||
y | |||
) |
Return a 3D point, projected on the current working plane.
References draftguitools.gui_snapper.Snapper.mask, and DraftGui.DraftToolBar.mask.
◆ getPerpendicular()
def draftguitools.gui_snapper.Snapper.getPerpendicular | ( | self, | |
edge, | |||
pt | |||
) |
Return a point on an edge, perpendicular to the given point.
References DraftVecUtils.project().
Referenced by draftguitools.gui_snapper.Snapper.snapToExtensions(), draftguitools.gui_snapper.Snapper.snapToExtPerpendicular(), draftguitools.gui_snapper.Snapper.snapToPerpendicular(), and draftguitools.gui_snapper.Snapper.snapToPolar().
◆ getPoint()
def draftguitools.gui_snapper.Snapper.getPoint | ( | self, | |
last = None , |
|||
callback = None , |
|||
movecallback = None , |
|||
extradlg = None , |
|||
title = None , |
|||
mode = "point" |
|||
) |
Get a 3D point from the screen. getPoint([last],[callback],[movecallback],[extradlg],[title]): gets a 3D point from the screen. You can provide an existing point, in that case additional snap options and a tracker are available. You can also pass a function as callback, which will get called with the resulting point as argument, when a point is clicked, and optionally another callback which gets called when the mouse is moved. If the operation gets cancelled (the user pressed Escape), no point is returned. Example: def cb(point): if point: print "got a 3D point: ",point Gui.Snapper.getPoint(callback=cb) If the callback function accepts more than one argument, it will also receive the last snapped object. Finally, a qt widget can be passed as an extra taskbox. title is the title of the point task box mode is the dialog box you want (default is point, you can also use wire and line) If getPoint() is invoked without any argument, nothing is done but the callbacks are removed, so it can be used as a cancel function.
◆ getScreenDist()
def draftguitools.gui_snapper.Snapper.getScreenDist | ( | self, | |
dist, | |||
cursor | |||
) |
Return a distance in 3D space from a screen pixels distance.
Referenced by draftguitools.gui_snapper.Snapper.showradius().
◆ hide()
def draftguitools.gui_snapper.Snapper.hide | ( | self | ) |
Hide the toolbar.
References draftguitools.gui_snapper.Snapper.toolbar.
Referenced by Mod.Show.mTempoVis.TempoVis.hide_all_dependencies(), Mod.Show.mTempoVis.TempoVis.hide_all_dependent(), and draftguitools.gui_snapper.Snapper.off().
◆ init_active_snaps()
def draftguitools.gui_snapper.Snapper.init_active_snaps | ( | self | ) |
set self.active_snaps according to user prefs
◆ init_draft_snap_buttons()
def draftguitools.gui_snapper.Snapper.init_draft_snap_buttons | ( | self, | |
commands, | |||
context, | |||
button_suffix | |||
) |
Init Draft Snap toolbar buttons. Parameters: commands Snap command list, use: get_draft_snap_commands(): context The toolbar or action group the buttons have to be added to button_suffix The suffix that have to be applied to the command name to define the button name
References draftguitools.gui_snapper.Snapper.init_grid_button(), and draftguitools.gui_snapper.Snapper.toolbar.
◆ init_grid_button()
def draftguitools.gui_snapper.Snapper.init_grid_button | ( | self, | |
context | |||
) |
Add grid button to the given toolbar
Referenced by draftguitools.gui_snapper.Snapper.init_draft_snap_buttons().
◆ isEnabled()
def draftguitools.gui_snapper.Snapper.isEnabled | ( | self, | |
snap | |||
) |
Returns true if the given snap is on
References draftguitools.gui_snapper.Snapper.active_snaps.
Referenced by draftguitools.gui_snapper.Snapper.setArchDims(), draftguitools.gui_snapper.Snapper.snapToAngles(), draftguitools.gui_snapper.Snapper.snapToCenter(), draftguitools.gui_snapper.Snapper.snapToCrossExtensions(), draftguitools.gui_snapper.Snapper.snapToElines(), draftguitools.gui_snapper.Snapper.snapToEndpoints(), draftguitools.gui_snapper.Snapper.snapToExtensions(), draftguitools.gui_snapper.Snapper.snapToExtOrtho(), draftguitools.gui_snapper.Snapper.snapToExtPerpendicular(), draftguitools.gui_snapper.Snapper.snapToFace(), draftguitools.gui_snapper.Snapper.snapToGrid(), draftguitools.gui_snapper.Snapper.snapToHold(), draftguitools.gui_snapper.Snapper.snapToIntersection(), draftguitools.gui_snapper.Snapper.snapToMidpoint(), draftguitools.gui_snapper.Snapper.snapToObject(), draftguitools.gui_snapper.Snapper.snapToOrtho(), draftguitools.gui_snapper.Snapper.snapToPerpendicular(), draftguitools.gui_snapper.Snapper.snapToPolar(), draftguitools.gui_snapper.Snapper.snapToPolygon(), draftguitools.gui_snapper.Snapper.snapToSpecials(), draftguitools.gui_snapper.Snapper.snapToVertex(), and draftguitools.gui_snapper.Snapper.toWP().
◆ makeSnapToolBar()
def draftguitools.gui_snapper.Snapper.makeSnapToolBar | ( | self | ) |
Build the Snap toolbar.
References Gui.getMainWindow().
Referenced by draftguitools.gui_snapper.Snapper.show().
◆ off()
def draftguitools.gui_snapper.Snapper.off | ( | self, | |
hideSnapBar = False |
|||
) |
Finish snapping.
References draftguitools.gui_snapper.Snapper.dim1, draftguitools.gui_snapper.Snapper.dim2, draftguitools.gui_snapper.Snapper.extLine, draftguitools.gui_snapper.Snapper.extLine2, FaceQuadStruct::Side.grid, draftguitools.gui_snapper.Snapper.grid, ArchCutPlane._CutPlaneTaskPanel.grid, ArchAxis._AxisTaskPanel.grid, ArchPrecast._PrecastTaskPanel.grid, ArchRoof._RoofTaskPanel.grid, ArchAxis.AxisSystemTaskPanel.grid, ArchWindow._ArchWindowTaskPanel.grid, ArchPrecast._DentsTaskPanel.grid, ArchSectionPlane.SectionPlaneTaskPanel.grid, ArchComponent.ComponentTaskPanel.grid, DraftGui.FacebinderTaskPanel.grid, draftguitools.gui_snapper.Snapper.hide(), draftguitools.gui_snapper.Snapper.holdPoints, draftguitools.gui_snapper.Snapper.holdTracker, draftguitools.gui_snapper.Snapper.mask, DraftGui.DraftToolBar.mask, draftguitools.gui_snapper.Snapper.radius, DraftGui.DraftToolBar.radius, draftguitools.gui_snapper.Snapper.radiusTracker, draftguitools.gui_line_add_delete.AddPoint.running, ArchNesting.Nester.running, draftguitools.gui_offset.Offset.running, draftguitools.gui_line_add_delete.DelPoint.running, draftguitools.gui_snapper.Snapper.running, App::PropertyExpressionEngine.running, draftguitools.gui_edit.Edit.running, Gui::GUISingleApplication::Private.running, Gui::PythonDebuggerP.running, draftguitools.gui_snapper.Snapper.selectMode, draftguitools.gui_snapper.Snapper.setCursor(), draftguitools.gui_snapper.Snapper.toolbar, draftguitools.gui_snapper.Snapper.tracker, ArchPanel.CommandPanel.tracker, ArchWindow._CommandWindow.tracker, ArchStructure._CommandStructure.tracker, ArchWall._CommandWall.tracker, draftguitools.gui_arcs.Arc_3Points.tracker, draftguitools.gui_snapper.Snapper.trackLine, and draftguitools.gui_snapper.Snapper.unconstrain().
Referenced by draftguitools.gui_snapper.Snapper.constrain(), draftguitools.gui_snapper.Snapper.setSelectMode(), and draftguitools.gui_snapper.Snapper.unconstrain().
◆ restack()
def draftguitools.gui_snapper.Snapper.restack | ( | self | ) |
Lower the grid tracker so it doesn't obscure other objects.
References FaceQuadStruct::Side.grid, draftguitools.gui_snapper.Snapper.grid, ArchCutPlane._CutPlaneTaskPanel.grid, ArchAxis._AxisTaskPanel.grid, ArchPrecast._PrecastTaskPanel.grid, ArchRoof._RoofTaskPanel.grid, ArchAxis.AxisSystemTaskPanel.grid, ArchWindow._ArchWindowTaskPanel.grid, ArchPrecast._DentsTaskPanel.grid, ArchSectionPlane.SectionPlaneTaskPanel.grid, ArchComponent.ComponentTaskPanel.grid, and DraftGui.FacebinderTaskPanel.grid.
◆ restore_snap_buttons_state()
def draftguitools.gui_snapper.Snapper.restore_snap_buttons_state | ( | self, | |
toolbar, | |||
button_suffix | |||
) |
Restore toolbar button's checked state according to "snapModes" saved in preferences
◆ save_snap_state()
def draftguitools.gui_snapper.Snapper.save_snap_state | ( | self | ) |
Save snap state to user preferences to be restored in next session.
References draftguitools.gui_snapper.Snapper.active_snaps, and draftguitools.gui_snapper.Snapper.snaps.
Referenced by draftguitools.gui_snapper.Snapper.toggle_snap().
◆ setAngle()
def draftguitools.gui_snapper.Snapper.setAngle | ( | self, | |
delta = None |
|||
) |
Keep the current angle.
References draftguitools.gui_snapper.Snapper.mask, DraftGui.DraftToolBar.mask, and draftguitools.gui_snapper.Snapper.trackLine.
◆ setArchDims()
def draftguitools.gui_snapper.Snapper.setArchDims | ( | self, | |
p1, | |||
p2 | |||
) |
Show arc dimensions between 2 points.
References draftguitools.gui_snapper.Snapper.dim1, draftguitools.gui_snapper.Snapper.dim2, Base::LogLevel.isEnabled(), and draftguitools.gui_snapper.Snapper.isEnabled().
Referenced by draftguitools.gui_snapper.Snapper.snapToObject().
◆ setCursor()
def draftguitools.gui_snapper.Snapper.setCursor | ( | self, | |
mode = None |
|||
) |
Set or reset the cursor to the given mode or resets.
References draftguitools.gui_snapper.Snapper.cursorMode, draftguitools.gui_snapper.Snapper.cursors, Gui.getMainWindow(), and draftguitools.gui_snapper.Snapper.selectMode.
Referenced by draftguitools.gui_snapper.Snapper.off(), draftguitools.gui_snapper.Snapper.setSelectMode(), draftguitools.gui_snapper.Snapper.snapToCrossExtensions(), draftguitools.gui_snapper.Snapper.snapToExtensions(), draftguitools.gui_snapper.Snapper.snapToGrid(), draftguitools.gui_snapper.Snapper.snapToObject(), and draftguitools.gui_snapper.Snapper.snapToPolar().
◆ setGrid()
def draftguitools.gui_snapper.Snapper.setGrid | ( | self | ) |
Set the grid, if visible.
References draftguitools.gui_snapper.Snapper.forceGridOff, FaceQuadStruct::Side.grid, draftguitools.gui_snapper.Snapper.grid, ArchCutPlane._CutPlaneTaskPanel.grid, ArchAxis._AxisTaskPanel.grid, ArchPrecast._PrecastTaskPanel.grid, ArchRoof._RoofTaskPanel.grid, ArchAxis.AxisSystemTaskPanel.grid, ArchWindow._ArchWindowTaskPanel.grid, ArchPrecast._DentsTaskPanel.grid, ArchSectionPlane.SectionPlaneTaskPanel.grid, ArchComponent.ComponentTaskPanel.grid, DraftGui.FacebinderTaskPanel.grid, draftguitools.gui_edit.Edit.setTrackers(), and draftguitools.gui_snapper.Snapper.setTrackers().
◆ setSelectMode()
def draftguitools.gui_snapper.Snapper.setSelectMode | ( | self, | |
mode | |||
) |
Set the snapper into select mode (hides snapping temporarily).
References draftguitools.gui_snapper.Snapper.off(), draftguitools.gui_snapper.Snapper.selectMode, draftguitools.gui_snapper.Snapper.setCursor(), and draftguitools.gui_snapper.Snapper.trackLine.
◆ setTrackers()
def draftguitools.gui_snapper.Snapper.setTrackers | ( | self | ) |
Set the trackers.
References draftguitools.gui_snapper.Snapper.activeview, draftguitools.gui_snapper.Snapper.dim1, draftguitools.gui_snapper.Snapper.dim2, draftguitools.gui_snapper.Snapper.extLine, draftguitools.gui_snapper.Snapper.extLine2, draftguitools.gui_snapper.Snapper.forceGridOff, FaceQuadStruct::Side.grid, draftguitools.gui_snapper.Snapper.grid, ArchCutPlane._CutPlaneTaskPanel.grid, ArchAxis._AxisTaskPanel.grid, ArchPrecast._PrecastTaskPanel.grid, ArchRoof._RoofTaskPanel.grid, ArchAxis.AxisSystemTaskPanel.grid, ArchWindow._ArchWindowTaskPanel.grid, ArchPrecast._DentsTaskPanel.grid, ArchSectionPlane.SectionPlaneTaskPanel.grid, ArchComponent.ComponentTaskPanel.grid, DraftGui.FacebinderTaskPanel.grid, draftguitools.gui_snapper.Snapper.holdTracker, draftguitools.gui_snapper.Snapper.radiusTracker, draftguitools.gui_snapper.Snapper.snapStyle, draftguitools.gui_snapper.Snapper.tracker, ArchPanel.CommandPanel.tracker, ArchWindow._CommandWindow.tracker, ArchStructure._CommandStructure.tracker, ArchWall._CommandWall.tracker, draftguitools.gui_arcs.Arc_3Points.tracker, draftguitools.gui_snapper.Snapper.trackers, draftguitools.gui_edit.Edit.trackers, and draftguitools.gui_snapper.Snapper.trackLine.
Referenced by draftguitools.gui_snapper.Snapper.setGrid(), and draftguitools.gui_snapper.Snapper.show().
◆ show()
def draftguitools.gui_snapper.Snapper.show | ( | self | ) |
Show the toolbar and the grid.
References draftguitools.gui_snapper.Snapper.get_snap_toolbar(), Gui.getMainWindow(), draftguitools.gui_snapper.Snapper.makeSnapToolBar(), draftguitools.gui_edit.Edit.setTrackers(), draftguitools.gui_snapper.Snapper.setTrackers(), and draftguitools.gui_snapper.Snapper.toolbar.
Referenced by Mod.Show.mTempoVis.TempoVis.show_all_dependencies(), and Mod.Show.mTempoVis.TempoVis.show_all_dependent().
◆ showradius()
def draftguitools.gui_snapper.Snapper.showradius | ( | self | ) |
Show the snap radius indicator.
References draftguitools.gui_snapper.Snapper.getScreenDist(), draftguitools.gui_snapper.Snapper.radius, DraftGui.DraftToolBar.radius, and draftguitools.gui_snapper.Snapper.radiusTracker.
◆ snap()
def draftguitools.gui_snapper.Snapper.snap | ( | self, | |
screenpos, | |||
lastpoint = None , |
|||
active = True , |
|||
constrain = False , |
|||
noTracker = False |
|||
) |
Return a snapped point from the given (x, y) screen position. snap(screenpos,lastpoint=None,active=True,constrain=False, noTracker=False): returns a snapped point from the given (x,y) screenpos (the position of the mouse cursor), active is to activate active point snapping or not (passive), lastpoint is an optional other point used to draw an imaginary segment and get additional snap locations. Constrain can be True to constrain the point against the closest working plane axis. Screenpos can be a list, a tuple or a coin.SbVec2s object. If noTracker is True, the tracking line is not displayed.
References draftguitools.gui_line_add_delete.AddPoint.running, ArchNesting.Nester.running, draftguitools.gui_offset.Offset.running, draftguitools.gui_line_add_delete.DelPoint.running, draftguitools.gui_snapper.Snapper.running, App::PropertyExpressionEngine.running, draftguitools.gui_edit.Edit.running, Gui::GUISingleApplication::Private.running, and Gui::PythonDebuggerP.running.
◆ snapToAngles()
def draftguitools.gui_snapper.Snapper.snapToAngles | ( | self, | |
shape | |||
) |
Return a list of angle snap locations.
References Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), and draftguitools.gui_snapper.Snapper.toWP().
Referenced by draftguitools.gui_snapper.Snapper.snapToObject().
◆ snapToCenter()
def draftguitools.gui_snapper.Snapper.snapToCenter | ( | self, | |
shape | |||
) |
Return a list of center snap locations.
References Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), and draftguitools.gui_snapper.Snapper.toWP().
Referenced by draftguitools.gui_snapper.Snapper.snapToObject().
◆ snapToCrossExtensions()
def draftguitools.gui_snapper.Snapper.snapToCrossExtensions | ( | self, | |
point | |||
) |
Snap to the intersection of the last 2 extension lines.
References DraftVecUtils.equals(), draftguitools.gui_snapper.Snapper.extLine, draftguitools.gui_snapper.Snapper.extLine2, Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), draftguitools.gui_snapper.Snapper.lastExtensions, draftguitools.gui_snapper.Snapper.mk, draftguitools.gui_snapper.Snapper.radius, DraftGui.DraftToolBar.radius, draftguitools.gui_snapper.Snapper.selectMode, draftguitools.gui_snapper.Snapper.setCursor(), draftguitools.gui_snapper.Snapper.snapStyle, draftguitools.gui_snapper.Snapper.tracker, ArchPanel.CommandPanel.tracker, ArchWindow._CommandWindow.tracker, ArchStructure._CommandStructure.tracker, ArchWall._CommandWall.tracker, and draftguitools.gui_arcs.Arc_3Points.tracker.
◆ snapToDim()
def draftguitools.gui_snapper.Snapper.snapToDim | ( | self, | |
obj | |||
) |
References draftguitools.gui_snapper.Snapper.toWP().
Referenced by draftguitools.gui_snapper.Snapper.snapToObject().
◆ snapToElines()
def draftguitools.gui_snapper.Snapper.snapToElines | ( | self, | |
e1, | |||
e2 | |||
) |
Return a snap at the infinite intersection of the given edges.
References Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), and draftguitools.gui_snapper.Snapper.toWP().
Referenced by draftguitools.gui_snapper.Snapper.snapToObject(), and draftguitools.gui_snapper.Snapper.snapToSpecials().
◆ snapToEndpoints()
def draftguitools.gui_snapper.Snapper.snapToEndpoints | ( | self, | |
shape | |||
) |
Return a list of endpoints snap locations.
References Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), and draftguitools.gui_snapper.Snapper.toWP().
Referenced by draftguitools.gui_snapper.Snapper.snapToObject(), and draftguitools.gui_snapper.Snapper.snapToSpecials().
◆ snapToExtensions()
def draftguitools.gui_snapper.Snapper.snapToExtensions | ( | self, | |
point, | |||
last, | |||
constrain, | |||
eline | |||
) |
Return a point snapped to extension or parallel line. The parallel line of the last object, if any.
References draftguitools.gui_snapper.Snapper.extLine, ArchRoof._Roof.getPerpendicular(), draftguitools.gui_snapper.Snapper.getPerpendicular(), Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), DraftVecUtils.isNull(), draftguitools.gui_snapper.Snapper.lastExtensions, draftguitools.gui_snapper.Snapper.lastObj, draftguitools.gui_snapper.Snapper.maxEdges, draftguitools.gui_snapper.Snapper.mk, draftguitools.gui_snapper.Snapper.radius, DraftGui.DraftToolBar.radius, draftguitools.gui_snapper.Snapper.selectMode, draftguitools.gui_snapper.Snapper.setCursor(), draftguitools.gui_snapper.Snapper.snapStyle, draftguitools.gui_snapper.Snapper.snapToExtOrtho(), draftguitools.gui_snapper.Snapper.snapToExtPerpendicular(), draftguitools.gui_snapper.Snapper.snapToHold(), draftguitools.gui_snapper.Snapper.tracker, ArchPanel.CommandPanel.tracker, ArchWindow._CommandWindow.tracker, ArchStructure._CommandStructure.tracker, ArchWall._CommandWall.tracker, and draftguitools.gui_arcs.Arc_3Points.tracker.
◆ snapToExtOrtho()
def draftguitools.gui_snapper.Snapper.snapToExtOrtho | ( | self, | |
last, | |||
constrain, | |||
eline | |||
) |
Return an ortho X extension snap location.
References draftguitools.gui_snapper.Snapper.constraintAxis, draftguitools.gui_snapper.Snapper.extLine, Base::LogLevel.isEnabled(), and draftguitools.gui_snapper.Snapper.isEnabled().
Referenced by draftguitools.gui_snapper.Snapper.snapToExtensions().
◆ snapToExtPerpendicular()
def draftguitools.gui_snapper.Snapper.snapToExtPerpendicular | ( | self, | |
last | |||
) |
Return a perpendicular X extension snap location.
References draftguitools.gui_snapper.Snapper.extLine, ArchRoof._Roof.getPerpendicular(), draftguitools.gui_snapper.Snapper.getPerpendicular(), Base::LogLevel.isEnabled(), and draftguitools.gui_snapper.Snapper.isEnabled().
Referenced by draftguitools.gui_snapper.Snapper.snapToExtensions().
◆ snapToFace()
def draftguitools.gui_snapper.Snapper.snapToFace | ( | self, | |
shape | |||
) |
Return a face center snap location.
References Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), and draftguitools.gui_snapper.Snapper.toWP().
Referenced by draftguitools.gui_snapper.Snapper.snapToObject().
◆ snapToGrid()
def draftguitools.gui_snapper.Snapper.snapToGrid | ( | self, | |
point | |||
) |
Return a grid snap point if available.
References FaceQuadStruct::Side.grid, draftguitools.gui_snapper.Snapper.grid, ArchCutPlane._CutPlaneTaskPanel.grid, ArchAxis._AxisTaskPanel.grid, ArchPrecast._PrecastTaskPanel.grid, ArchRoof._RoofTaskPanel.grid, ArchAxis.AxisSystemTaskPanel.grid, ArchWindow._ArchWindowTaskPanel.grid, ArchPrecast._DentsTaskPanel.grid, ArchSectionPlane.SectionPlaneTaskPanel.grid, ArchComponent.ComponentTaskPanel.grid, DraftGui.FacebinderTaskPanel.grid, Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), draftguitools.gui_snapper.Snapper.mk, draftguitools.gui_snapper.Snapper.radius, DraftGui.DraftToolBar.radius, draftguitools.gui_snapper.Snapper.selectMode, draftguitools.gui_snapper.Snapper.setCursor(), draftguitools.gui_snapper.Snapper.tracker, ArchPanel.CommandPanel.tracker, ArchWindow._CommandWindow.tracker, ArchStructure._CommandStructure.tracker, ArchWall._CommandWall.tracker, and draftguitools.gui_arcs.Arc_3Points.tracker.
◆ snapToHold()
def draftguitools.gui_snapper.Snapper.snapToHold | ( | self, | |
point | |||
) |
Return a snap location that is orthogonal to hold points. Or if possible at crossings.
References draftguitools.gui_snapper.Snapper.holdPoints, Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), draftguitools.gui_snapper.Snapper.radius, and DraftGui.DraftToolBar.radius.
Referenced by draftguitools.gui_snapper.Snapper.snapToExtensions().
◆ snapToIntersection()
def draftguitools.gui_snapper.Snapper.snapToIntersection | ( | self, | |
shape | |||
) |
Return a list of intersection snap locations.
References Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), draftguitools.gui_snapper.Snapper.lastObj, draftguitools.gui_snapper.Snapper.maxEdges, and draftguitools.gui_snapper.Snapper.toWP().
Referenced by draftguitools.gui_snapper.Snapper.snapToObject(), and draftguitools.gui_snapper.Snapper.snapToSpecials().
◆ snapToMidpoint()
def draftguitools.gui_snapper.Snapper.snapToMidpoint | ( | self, | |
shape | |||
) |
Return a list of midpoints snap locations.
References Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), and draftguitools.gui_snapper.Snapper.toWP().
Referenced by draftguitools.gui_snapper.Snapper.snapToObject(), and draftguitools.gui_snapper.Snapper.snapToSpecials().
◆ snapToObject()
def draftguitools.gui_snapper.Snapper.snapToObject | ( | self, | |
lastpoint, | |||
active, | |||
constrain, | |||
eline, | |||
point, | |||
oldActive | |||
) |
Snap to an object.
References draftguitools.gui_snapper.Snapper.cstr(), Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), draftguitools.gui_snapper.Snapper.lastObj, draftguitools.gui_snapper.Snapper.lastSnappedObject, draftguitools.gui_snapper.Snapper.maxEdges, draftguitools.gui_snapper.Snapper.mk, draftguitools.gui_snapper.Snapper.radius, DraftGui.DraftToolBar.radius, draftguitools.gui_line_add_delete.AddPoint.running, ArchNesting.Nester.running, draftguitools.gui_offset.Offset.running, draftguitools.gui_line_add_delete.DelPoint.running, draftguitools.gui_snapper.Snapper.running, App::PropertyExpressionEngine.running, draftguitools.gui_edit.Edit.running, Gui::GUISingleApplication::Private.running, Gui::PythonDebuggerP.running, draftguitools.gui_snapper.Snapper.selectMode, draftguitools.gui_snapper.Snapper.setArchDims(), draftguitools.gui_snapper.Snapper.setCursor(), draftguitools.gui_snapper.Snapper.snapInfo, draftguitools.gui_snapper.Snapper.snapToAngles(), draftguitools.gui_snapper.Snapper.snapToCenter(), draftguitools.gui_snapper.Snapper.snapToDim(), draftguitools.gui_snapper.Snapper.snapToElines(), draftguitools.gui_snapper.Snapper.snapToEndpoints(), draftguitools.gui_snapper.Snapper.snapToFace(), draftguitools.gui_snapper.Snapper.snapToIntersection(), draftguitools.gui_snapper.Snapper.snapToMidpoint(), draftguitools.gui_snapper.Snapper.snapToPerpendicular(), draftguitools.gui_snapper.Snapper.snapToPolygon(), draftguitools.gui_snapper.Snapper.snapToSpecials(), draftguitools.gui_snapper.Snapper.snapToVertex(), draftguitools.gui_snapper.Snapper.spoint, draftguitools.gui_snapper.Snapper.toWP(), draftguitools.gui_snapper.Snapper.tracker, ArchPanel.CommandPanel.tracker, ArchWindow._CommandWindow.tracker, ArchStructure._CommandStructure.tracker, ArchWall._CommandWall.tracker, draftguitools.gui_arcs.Arc_3Points.tracker, and draftguitools.gui_snapper.Snapper.trackLine.
◆ snapToOrtho()
def draftguitools.gui_snapper.Snapper.snapToOrtho | ( | self, | |
shape, | |||
last, | |||
constrain | |||
) |
Return a list of ortho snap locations.
References draftguitools.gui_snapper.Snapper.constraintAxis, Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), and draftguitools.gui_snapper.Snapper.toWP().
◆ snapToPerpendicular()
def draftguitools.gui_snapper.Snapper.snapToPerpendicular | ( | self, | |
shape, | |||
last | |||
) |
Return a list of perpendicular snap locations.
References ArchRoof._Roof.getPerpendicular(), draftguitools.gui_snapper.Snapper.getPerpendicular(), Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), DraftVecUtils.scaleTo(), and draftguitools.gui_snapper.Snapper.toWP().
Referenced by draftguitools.gui_snapper.Snapper.snapToObject(), and draftguitools.gui_snapper.Snapper.snapToSpecials().
◆ snapToPolar()
def draftguitools.gui_snapper.Snapper.snapToPolar | ( | self, | |
point, | |||
last | |||
) |
Snap to polar lines from the given point.
References ArchRoof._Roof.getPerpendicular(), draftguitools.gui_snapper.Snapper.getPerpendicular(), Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), DraftVecUtils.isNull(), draftguitools.gui_snapper.Snapper.mask, DraftGui.DraftToolBar.mask, draftguitools.gui_snapper.Snapper.mk, draftguitools.gui_snapper.Snapper.polarAngles, draftguitools.gui_snapper.Snapper.radius, DraftGui.DraftToolBar.radius, DraftVecUtils.rotate(), draftguitools.gui_snapper.Snapper.selectMode, draftguitools.gui_snapper.Snapper.setCursor(), draftguitools.gui_snapper.Snapper.tracker, ArchPanel.CommandPanel.tracker, ArchWindow._CommandWindow.tracker, ArchStructure._CommandStructure.tracker, ArchWall._CommandWall.tracker, and draftguitools.gui_arcs.Arc_3Points.tracker.
◆ snapToPolygon()
def draftguitools.gui_snapper.Snapper.snapToPolygon | ( | self, | |
obj | |||
) |
Return a list of polygon center snap locations.
References Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), and draftguitools.gui_snapper.Snapper.toWP().
Referenced by draftguitools.gui_snapper.Snapper.snapToObject().
◆ snapToSpecials()
def draftguitools.gui_snapper.Snapper.snapToSpecials | ( | self, | |
obj, | |||
lastpoint = None , |
|||
eline = None |
|||
) |
Return special snap locations, if any.
References Base::LogLevel.isEnabled(), draftguitools.gui_snapper.Snapper.isEnabled(), draftguitools.gui_snapper.Snapper.snapToElines(), draftguitools.gui_snapper.Snapper.snapToEndpoints(), draftguitools.gui_snapper.Snapper.snapToIntersection(), draftguitools.gui_snapper.Snapper.snapToMidpoint(), draftguitools.gui_snapper.Snapper.snapToPerpendicular(), and draftguitools.gui_snapper.Snapper.toWP().
Referenced by draftguitools.gui_snapper.Snapper.snapToObject().
◆ snapToVertex()
def draftguitools.gui_snapper.Snapper.snapToVertex | ( | self, | |
info, | |||
active = False |
|||
) |
◆ toggle_snap()
def draftguitools.gui_snapper.Snapper.toggle_snap | ( | self, | |
snap, | |||
set_to = None |
|||
) |
Sets the given snap on/off according to the given parameter
References draftguitools.gui_snapper.Snapper.active_snaps, and draftguitools.gui_snapper.Snapper.save_snap_state().
◆ toggleGrid()
def draftguitools.gui_snapper.Snapper.toggleGrid | ( | self | ) |
Toggle FreeCAD Draft Grid.
◆ toWP()
def draftguitools.gui_snapper.Snapper.toWP | ( | self, | |
point | |||
) |
Project the given point on the working plane, if needed.
References Base::LogLevel.isEnabled(), and draftguitools.gui_snapper.Snapper.isEnabled().
Referenced by draftguitools.gui_snapper.Snapper.snapToAngles(), draftguitools.gui_snapper.Snapper.snapToCenter(), draftguitools.gui_snapper.Snapper.snapToDim(), draftguitools.gui_snapper.Snapper.snapToElines(), draftguitools.gui_snapper.Snapper.snapToEndpoints(), draftguitools.gui_snapper.Snapper.snapToFace(), draftguitools.gui_snapper.Snapper.snapToIntersection(), draftguitools.gui_snapper.Snapper.snapToMidpoint(), draftguitools.gui_snapper.Snapper.snapToObject(), draftguitools.gui_snapper.Snapper.snapToOrtho(), draftguitools.gui_snapper.Snapper.snapToPerpendicular(), draftguitools.gui_snapper.Snapper.snapToPolygon(), draftguitools.gui_snapper.Snapper.snapToSpecials(), and draftguitools.gui_snapper.Snapper.snapToVertex().
◆ unconstrain()
def draftguitools.gui_snapper.Snapper.unconstrain | ( | self | ) |
Unset the basepoint and the constrain line.
References draftguitools.gui_snapper.Snapper.affinity, draftguitools.gui_snapper.Snapper.basepoint, draftguitools.gui_snapper.Snapper.constrainLine, and draftguitools.gui_snapper.Snapper.off().
Referenced by draftguitools.gui_snapper.Snapper.cstr(), and draftguitools.gui_snapper.Snapper.off().
Member Data Documentation
◆ active
draftguitools.gui_snapper.Snapper.active |
Referenced by draftguitools.gui_texts.Text.action().
◆ active_snaps
draftguitools.gui_snapper.Snapper.active_snaps |
◆ activeview
draftguitools.gui_snapper.Snapper.activeview |
Referenced by draftguitools.gui_snapper.Snapper.setTrackers().
◆ affinity
draftguitools.gui_snapper.Snapper.affinity |
◆ basepoint
draftguitools.gui_snapper.Snapper.basepoint |
◆ callbackClick
draftguitools.gui_snapper.Snapper.callbackClick |
◆ callbackMove
draftguitools.gui_snapper.Snapper.callbackMove |
◆ constrainLine
draftguitools.gui_snapper.Snapper.constrainLine |
◆ constraintAxis
draftguitools.gui_snapper.Snapper.constraintAxis |
◆ cursorMode
draftguitools.gui_snapper.Snapper.cursorMode |
Referenced by draftguitools.gui_snapper.Snapper.setCursor().
◆ cursors
draftguitools.gui_snapper.Snapper.cursors |
Referenced by draftguitools.gui_snapper.Snapper.setCursor().
◆ dim1
draftguitools.gui_snapper.Snapper.dim1 |
◆ dim2
draftguitools.gui_snapper.Snapper.dim2 |
◆ extLine
draftguitools.gui_snapper.Snapper.extLine |
Referenced by draftguitools.gui_snapper.Snapper.off(), draftguitools.gui_snapper.Snapper.setTrackers(), draftguitools.gui_snapper.Snapper.snapToCrossExtensions(), draftguitools.gui_snapper.Snapper.snapToExtensions(), draftguitools.gui_snapper.Snapper.snapToExtOrtho(), and draftguitools.gui_snapper.Snapper.snapToExtPerpendicular().
◆ extLine2
draftguitools.gui_snapper.Snapper.extLine2 |
◆ forceGridOff
draftguitools.gui_snapper.Snapper.forceGridOff |
◆ grid
draftguitools.gui_snapper.Snapper.grid |
Referenced by ArchAxis.CommandArchGrid.IsActive(), Plot.Plot.isGrid(), draftguitools.gui_snapper.Snapper.off(), draftguitools.gui_snapper.Snapper.restack(), draftguitools.gui_snapper.Snapper.setGrid(), draftguitools.gui_snapper.Snapper.setTrackers(), and draftguitools.gui_snapper.Snapper.snapToGrid().
◆ holdPoints
draftguitools.gui_snapper.Snapper.holdPoints |
◆ holdTracker
draftguitools.gui_snapper.Snapper.holdTracker |
◆ lastExtensions
draftguitools.gui_snapper.Snapper.lastExtensions |
◆ lastObj
draftguitools.gui_snapper.Snapper.lastObj |
◆ lastSnappedObject
draftguitools.gui_snapper.Snapper.lastSnappedObject |
Referenced by draftguitools.gui_snapper.Snapper.snapToObject().
◆ mask
draftguitools.gui_snapper.Snapper.mask |
Referenced by draftguitools.gui_snapper.Snapper.constrain(), draftguitools.gui_snapper.Snapper.cstr(), drafttaskpanels.task_polararray.TaskPanelPolarArray.display_point(), drafttaskpanels.task_circulararray.TaskPanelCircularArray.display_point(), draftguitools.gui_snapper.Snapper.getApparentPoint(), draftguitools.gui_snapper.Snapper.off(), draftguitools.gui_snapper.Snapper.setAngle(), and draftguitools.gui_snapper.Snapper.snapToPolar().
◆ maxEdges
draftguitools.gui_snapper.Snapper.maxEdges |
◆ mk
draftguitools.gui_snapper.Snapper.mk |
◆ polarAngles
draftguitools.gui_snapper.Snapper.polarAngles |
Referenced by draftguitools.gui_snapper.Snapper.snapToPolar().
◆ pt
draftguitools.gui_snapper.Snapper.pt |
◆ radius
draftguitools.gui_snapper.Snapper.radius |
Referenced by PathScripts.PathPocketBase.ObjectPocket.areaOpAreaParams(), PathScripts.PathProfile.ObjectProfile.areaOpAreaParams(), PathScripts.PathPocketBase.ObjectPocket.areaOpPathParams(), PathScripts.PathAreaOp.ObjectOp.areaOpSetDefaultValues(), PathScripts.PathMillFace.ObjectFace.areaOpShapes(), PathScripts.PathHelix.ObjectHelix.circularHoleExecute(), PathScripts.PathDressupHoldingTags.Tag.createSolidsAt(), PathScripts.PathWaterline.ObjectWaterline.deleteOpVariables(), PathScripts.PathSurface.ObjectSurface.deleteOpVariables(), PathScripts.PathOp.ObjectOp.execute(), PathScripts.PathHelix.ObjectHelix.helix_cut(), ifc4.ifcsweptdisksolid.innerradiussize(), draftguitools.gui_snapper.Snapper.off(), PathScripts.PathSurfaceSupport.ProcessSelectedFaces.preProcessModel(), draftguitools.gui_snapper.Snapper.showradius(), draftguitools.gui_snapper.Snapper.snapToCrossExtensions(), draftguitools.gui_snapper.Snapper.snapToExtensions(), draftguitools.gui_snapper.Snapper.snapToGrid(), draftguitools.gui_snapper.Snapper.snapToHold(), draftguitools.gui_snapper.Snapper.snapToObject(), draftguitools.gui_snapper.Snapper.snapToPolar(), config_control_design.conical_surface.wr1(), automotive_design.right_circular_cone.wr1(), automotive_design.conical_surface.wr1(), automotive_design.swept_disk_solid.wr2(), and ifc2x3.ifcsweptdisksolid.wr2().
◆ radiusTracker
draftguitools.gui_snapper.Snapper.radiusTracker |
◆ running
draftguitools.gui_snapper.Snapper.running |
Referenced by shipHydrostatics.TaskPanel.TaskPanel.accept(), draftguitools.gui_wire2spline.WireToBSpline.Activated(), shipHydrostatics.TaskPanel.TaskPanel.externalFaces(), draftguitools.gui_snapper.Snapper.off(), shipHydrostatics.TaskPanel.TaskPanel.reject(), draftguitools.gui_snapper.Snapper.snap(), draftguitools.gui_snapper.Snapper.snapToObject(), and femsolver.task.Task.start().
◆ selectMode
draftguitools.gui_snapper.Snapper.selectMode |
Referenced by draftguitools.gui_snapper.Snapper.off(), draftguitools.gui_snapper.Snapper.setCursor(), draftguitools.gui_snapper.Snapper.setSelectMode(), draftguitools.gui_snapper.Snapper.snapToCrossExtensions(), draftguitools.gui_snapper.Snapper.snapToExtensions(), draftguitools.gui_snapper.Snapper.snapToGrid(), draftguitools.gui_snapper.Snapper.snapToObject(), and draftguitools.gui_snapper.Snapper.snapToPolar().
◆ snapInfo
draftguitools.gui_snapper.Snapper.snapInfo |
Referenced by draftguitools.gui_snapper.Snapper.snapToObject().
◆ snapObjectIndex
draftguitools.gui_snapper.Snapper.snapObjectIndex |
Referenced by draftguitools.gui_snapper.Snapper.cycleSnapObject().
◆ snaps
draftguitools.gui_snapper.Snapper.snaps |
Referenced by draftguitools.gui_snapper.Snapper.save_snap_state().
◆ snapStyle
draftguitools.gui_snapper.Snapper.snapStyle |
◆ spoint
draftguitools.gui_snapper.Snapper.spoint |
◆ toolbar
draftguitools.gui_snapper.Snapper.toolbar |
◆ tracker
draftguitools.gui_snapper.Snapper.tracker |
Referenced by draftguitools.gui_snapper.Snapper.off(), draftguitools.gui_snapper.Snapper.setTrackers(), draftguitools.gui_snapper.Snapper.snapToCrossExtensions(), draftguitools.gui_snapper.Snapper.snapToExtensions(), draftguitools.gui_snapper.Snapper.snapToGrid(), draftguitools.gui_snapper.Snapper.snapToObject(), and draftguitools.gui_snapper.Snapper.snapToPolar().
◆ trackers
draftguitools.gui_snapper.Snapper.trackers |
Referenced by draftguitools.gui_snapper.Snapper.setTrackers().
◆ trackLine
draftguitools.gui_snapper.Snapper.trackLine |
◆ ui
draftguitools.gui_snapper.Snapper.ui |
Referenced by DraftGui.DraftToolBar.changeEvent().
◆ view
draftguitools.gui_snapper.Snapper.view |
The documentation for this class was generated from the following file:
- src/Mod/Draft/draftguitools/gui_snapper.py