本文整理汇总了Python中selectionOverlay.hideSelectionGraphicsItems函数的典型用法代码示例。如果您正苦于以下问题:Python hideSelectionGraphicsItems函数的具体用法?Python hideSelectionGraphicsItems怎么用?Python hideSelectionGraphicsItems使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hideSelectionGraphicsItems函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: selectFun
def selectFun(self, event, referer, elementXML, elementParms, elementViewObject):
x, y = elementParms["x"], elementParms["y"]
d.dArgs = [x, y]
d.stage = 1
debugPrint(2, "welding symbol to point at x=%3.1f y=%3.1f" % (x, y))
selectionOverlay.hideSelectionGraphicsItems()
previewDimension.initializePreview(d, self.preview_svgRenderer, self.preview_clickHandler)
开发者ID:ihipi,项目名称:FreeCAD_drawing_dimensioning,代码行数:7,代码来源:unfold_bending_note.py
示例2: selectDimensioningPoint
def selectDimensioningPoint( event, referer, elementXML, elementParms, elementViewObject ):
crudeDebuggerPrint('''linearDimension.py:9 x, y = elementParms['x'], elementParms['y'] ''')
x, y = elementParms['x'], elementParms['y']
crudeDebuggerPrint('''linearDimension.py:10 referer.lockSelection() ''')
referer.lockSelection()
crudeDebuggerPrint('''linearDimension.py:11 if dimensioning.stage == 0: #then selectPoint1 ''')
if dimensioning.stage == 0: #then selectPoint1
crudeDebuggerPrint('''linearDimension.py:12 dimensioning.point1 = x,y ''')
dimensioning.point1 = x,y
crudeDebuggerPrint('''linearDimension.py:13 debugPrint(2, 'point1 set to x=%3.1f y=%3.1f' % (x,y)) ''')
debugPrint(2, 'point1 set to x=%3.1f y=%3.1f' % (x,y))
crudeDebuggerPrint('''linearDimension.py:14 dimensioning.stage = 1 ''')
dimensioning.stage = 1
else:
crudeDebuggerPrint('''linearDimension.py:16 dimensioning.point2 = x,y ''')
dimensioning.point2 = x,y
crudeDebuggerPrint('''linearDimension.py:17 debugPrint(2, 'point2 set to x=%3.1f y=%3.1f' % (x,y)) ''')
debugPrint(2, 'point2 set to x=%3.1f y=%3.1f' % (x,y))
crudeDebuggerPrint('''linearDimension.py:18 dimensioning.stage = 2 ''')
dimensioning.stage = 2
crudeDebuggerPrint('''linearDimension.py:19 dimensioning.dimScale = 1/elementXML.rootNode().scaling() ''')
dimensioning.dimScale = 1/elementXML.rootNode().scaling()
crudeDebuggerPrint('''linearDimension.py:20 selectionOverlay.hideSelectionGraphicsItems() ''')
selectionOverlay.hideSelectionGraphicsItems()
crudeDebuggerPrint('''linearDimension.py:21 previewDimension.initializePreview( dimensioning.drawingVars, clickFunPreview, hoverFunPreview ) ''')
previewDimension.initializePreview( dimensioning.drawingVars, clickFunPreview, hoverFunPreview )
开发者ID:hamish2014,项目名称:FreeCAD_drawing_dimensioning,代码行数:26,代码来源:linearDimension_crudeDebugging.py
示例3: recomputeWithOutViewReset
def recomputeWithOutViewReset( drawingVars ):
'''
By default app.recompute() resets the drawing view, which can be rather frustrating...
'''
printGraphicsViewInfo( drawingVars )
gV = drawingVars.graphicsView
T = gV.transform()
scale = T.m11()
##attempting to find centre of view
#dx = gV.mapToScene( 0,0).x()
#dy = gV.mapToScene( 0,0).y()
## now scene_x = view_x/scale + dx; so
#centerView = [
# 0.5*gV.width(),
# 0.5*gV.height(),
# ]
#centerScene = gV.mapToScene( *centerView )
#centerOn approach did not work rather using scroll bars.
h_scrollValue = gV.horizontalScrollBar().value()
v_scrollValue = gV.verticalScrollBar().value()
import selectionOverlay
selectionOverlay.hideSelectionGraphicsItems()
drawingVars.page.touch()
App.ActiveDocument.recompute()
gV.scale( scale , scale )
#scale correction
for i in range(3):
scale_actual = gV.transform().m11()
debugPrint(4, 'scale_desired %1.3f scale_actual %1.3f' % (scale, scale_actual))
s_correction = scale / scale_actual
gV.scale( s_correction, s_correction )
gV.horizontalScrollBar().setValue( h_scrollValue )
gV.verticalScrollBar().setValue( v_scrollValue )
printGraphicsViewInfo( drawingVars )
开发者ID:badele,项目名称:dotfiles,代码行数:35,代码来源:dimensioning.py
示例4: selectFun
def selectFun(self, event, referer, elementXML, elementParms, elementViewObject ):
viewInfo = selectionOverlay.DrawingsViews_info[elementViewObject.Name]
d.selections = [ PointSelection( elementParms, elementXML, viewInfo) ]
selectionOverlay.hideSelectionGraphicsItems()
previewDimension.initializePreview(
d,
self.preview_svgRenderer,
self.preview_clickHandler )
开发者ID:BKSpurgeon,项目名称:FreeCAD_drawing_dimensioning,代码行数:8,代码来源:weldingSymbols.py
示例5: selectFun
def selectFun( event, referer, elementXML, elementParms, elementViewObject ):
x,y = elementParms['x'], elementParms['y']
debugPrint(2, 'center selected at x=%3.1f y=%3.1f' % (x,y))
d.args = [x, y, elementParms['r']]
d.viewScale = 1/elementXML.rootNode().scaling()
d.stage = 1
selectionOverlay.hideSelectionGraphicsItems()
previewDimension.initializePreview( d, radiusDimensionSVG_preview, radiusDimensionSVG_clickHandler)
开发者ID:ulikoehler,项目名称:FreeCAD_drawing_dimensioning,代码行数:8,代码来源:radiusDimension.py
示例6: selectFun
def selectFun( event, referer, elementXML, elementParms, elementViewObject ):
x,y = elementParms['x'], elementParms['y']
dimensioning.point1 = x, y
debugPrint(2, 'note start point selected at x=%3.1f y=%3.1f' % (x,y))
dimensioning.dimScale = 1/elementXML.rootNode().scaling() / UnitConversionFactor()
dimensioning.stage = 1
selectionOverlay.hideSelectionGraphicsItems()
previewDimension.initializePreview( dimensioning.drawingVars, clickFunPreview, hoverFunPreview )
开发者ID:SebXcxl,项目名称:FreeCAD_drawing_dimensioning,代码行数:8,代码来源:noteCircle.py
示例7: selectFun
def selectFun( event, referer, elementXML, elementParms, elementViewObject ):
x,y = elementParms['x'], elementParms['y']
dimensioning.center = [x, y]
dimensioning.stage = 1
dimensioning.dimScale = elementXML.rootNode().scaling()
debugPrint(3, 'center selected at x=%3.1f y=%3.1f scale %3.1f' % (x,y, dimensioning.dimScale))
selectionOverlay.hideSelectionGraphicsItems()
previewDimension.initializePreview( dimensioning.drawingVars, clickFunPreview, hoverFunPreview )
开发者ID:SebXcxl,项目名称:FreeCAD_drawing_dimensioning,代码行数:8,代码来源:centerLines.py
示例8: linearDimension_points_clickHandler
def linearDimension_points_clickHandler( x, y ):
d.selections.append( PlacementClick( x, y ) )
if isinstance( d.selections[0], LineSelection ):
selectionOverlay.hideSelectionGraphicsItems()
if len(d.selections) == d.max_selections - 1 and d.dimensionConstructorKWs['autoPlaceText']:
d.selections.append( PlacementClick( x, y ) ) #to avoid crash when autoPlaceText switched off
return 'createDimension:%s' % findUnusedObjectName('dim')
elif len(d.selections) == d.max_selections :
return 'createDimension:%s' % findUnusedObjectName('dim')
开发者ID:badele,项目名称:dotfiles,代码行数:9,代码来源:linearDimension.py
示例9: selectFun
def selectFun(self, event, referer, elementXML, elementParms, elementViewObject ):
x,y = elementParms['x'], elementParms['y']
dimensioning.dArgs = [x,y]
dimensioning.stage = 1
debugPrint(2, 'welding symbol to point at x=%3.1f y=%3.1f' % (x,y))
selectionOverlay.hideSelectionGraphicsItems()
previewDimension.initializePreview(
dimensioning.drawingVars,
self.clickFunPreview,
self.hoverFunPreview )
开发者ID:SebXcxl,项目名称:FreeCAD_drawing_dimensioning,代码行数:10,代码来源:weldingSymbols.py
示例10: linearDimension_points_clickHandler
def linearDimension_points_clickHandler( x, y ):
d.args = d.args + [ x, y ]
d.stage = d.stage + 1
if d.stage == 3:
if d.dimensionConstructorKWs['autoPlaceText']:
return 'createDimension:%s' % findUnusedObjectName('dim')
else:
selectionOverlay.hideSelectionGraphicsItems() # for distance between parallels case
elif d.stage == 4 :
return 'createDimension:%s' % findUnusedObjectName('dim')
开发者ID:ulikoehler,项目名称:FreeCAD_drawing_dimensioning,代码行数:10,代码来源:linearDimension.py
示例11: AddToleranceToText
def AddToleranceToText( event, referer, elementXML, elementParms, elementViewObject ):
try :
dimensioning.dimToEdit = elementViewObject
dimensioning.elementXML = elementXML
selectionOverlay.hideSelectionGraphicsItems()
svgText = SvgTextParser( elementXML.XML[elementXML.pStart:elementXML.pEnd] )
dimensioning.svgText = svgText
debugPrint(3,'svgText.width() %s' % svgText.width())
debugPrint(3,'adding tolerance %s' % repr(elementViewObject.Name))
dialog.show()
except:
errorMessagebox_with_traceback()
开发者ID:SebXcxl,项目名称:FreeCAD_drawing_dimensioning,代码行数:12,代码来源:toleranceAdd.py
示例12: MoveDimensionText
def MoveDimensionText( event, referer, elementXML, elementParms, elementViewObject ):
d.dimToEdit = elementViewObject
d.elementXML = elementXML
debugPrint(2, 'moving %s' % elementViewObject.Name)
if elementXML.parms.has_key('transform'):
transform = elementXML.parms['transform']
t = transform[ XMLlib.findOffset(transform,'rotate(',0): ]
d.textRotation = XMLlib.splitMultiSep(t, ', ')[0]
debugPrint(3, 'd.textRotation %s' % d.textRotation)
else:
d.textRotation = None
selectionOverlay.hideSelectionGraphicsItems()
previewDimension.initializePreview( d, moveTextSvg, placeText )
开发者ID:ulikoehler,项目名称:FreeCAD_drawing_dimensioning,代码行数:13,代码来源:textMove.py
示例13: clickFunPreview
def clickFunPreview( x, y ):
if dimensioning.stage == 2 :
dimensioning.point3 = x, y
debugPrint(2, 'point3 set to x=%3.1f y=%3.1f' % (x,y))
dimensioning.stage = 3
selectionOverlay.hideSelectionGraphicsItems() # for distance between parallels case
return None, None
else:
p1,p2,p3 = dimensioning.point1, dimensioning.point2, dimensioning.point3
XML = halfLinearDimensionSVG( p1[0], p1[1], p2[0], p2[1], p3[0], p3[1],
x, y, scale=dimensioning.dimScale,
**dimensioning.dimensionConstructorKWs)
return findUnusedObjectName('dim'), XML
开发者ID:SebXcxl,项目名称:FreeCAD_drawing_dimensioning,代码行数:13,代码来源:halfLinearDimension.py
示例14: selectFun
def selectFun( event, referer, elementXML, elementParms, elementViewObject ):
x1,y1,x2,y2 = [ elementParms[k] for k in [ 'x1', 'y1', 'x2', 'y2' ] ]
debugPrint(2, str(dimensioning) )
debugPrint(2, 'selecting line %i with x1=%3.1f y1=%3.1f, x2=%3.1f y2=%3.1f' % (dimensioning.stage, x1,y1,x2,y2) )
referer.lockSelection()
if dimensioning.stage == 0: #then select line1
dimensioning.line1 = x1,y1,x2,y2
dimensioning.stage = 1
else:
dimensioning.line2 = x1,y1,x2,y2
dimensioning.stage = 2
selectionOverlay.hideSelectionGraphicsItems()
previewDimension.initializePreview( dimensioning.drawingVars, clickFunPreview, hoverFunPreview )
开发者ID:cblt2l,项目名称:FreeCAD_drawing_dimensioning,代码行数:13,代码来源:angularDimension.py
示例15: selectDimensioningPoint
def selectDimensioningPoint( event, referer, elementXML, elementParms, elementViewObject ):
x, y = elementParms['x'], elementParms['y']
referer.lockSelection()
if dimensioning.stage == 0: #then selectPoint1
dimensioning.point1 = x,y
debugPrint(2, 'point1 set to x=%3.1f y=%3.1f' % (x,y))
dimensioning.stage = 1
else:
dimensioning.point2 = x,y
debugPrint(2, 'point2 set to x=%3.1f y=%3.1f' % (x,y))
dimensioning.stage = 2
dimensioning.dimScale = 1/elementXML.rootNode().scaling()
selectionOverlay.hideSelectionGraphicsItems()
previewDimension.initializePreview( dimensioning.drawingVars, clickFunPreview, hoverFunPreview )
开发者ID:cblt2l,项目名称:FreeCAD_drawing_dimensioning,代码行数:14,代码来源:linearDimension.py
示例16: AddToleranceToText
def AddToleranceToText( event, referer, elementXML, elementParms, elementViewObject ):
try :
d.dimToEdit = elementViewObject
d.elementXML = elementXML
selectionOverlay.hideSelectionGraphicsItems()
svgText = SvgTextParser( elementXML.XML[elementXML.pStart:elementXML.pEnd] )
d.svgText = svgText
debugPrint(3,'svgText.width() %s' % svgText.width())
debugPrint(3,'adding tolerance %s' % repr(elementViewObject.Name))
d.textRenderer = SvgTextRenderer(
font_family = svgText.font_family,
fill = svgText.fill,
font_size = svgText.font_size
)
previewDimension.initializePreview(d, toleranceAdd_preview, toleranceAdd_clickHandler)
except:
errorMessagebox_with_traceback()
开发者ID:gokmonk,项目名称:FreeCAD_drawing_dimensioning,代码行数:17,代码来源:toleranceAdd.py
示例17: EditDimensionText
def EditDimensionText( event, referer, elementXML, elementParms, elementViewObject ):
dimensioning.dimToEdit = elementViewObject
dimensioning.elementXML = elementXML
selectionOverlay.hideSelectionGraphicsItems()
e = elementXML
debugPrint(3, e.XML[e.pStart:e.pEnd] )
svgText = SvgTextParser( e.XML[e.pStart:e.pEnd] )
dimensioning.svgText = svgText
debugPrint(3, u'editing %s' % unicode(svgText))
widgets = dict( [c.objectName(), c] for c in dialog.children() )
widgets['textLineEdit'].setText( svgText.text )
widgets['sizeLineEdit'].setText( svgText.font_size)
widgets['colorLineEdit'].setText( svgText.fill )
widgets['familyLineEdit'].setText( svgText.font_family )
widgets['placeButton'].setText('Change')
dialog.setWindowTitle('Editing %s' % elementViewObject.Name)
dialog.show()
开发者ID:SebXcxl,项目名称:FreeCAD_drawing_dimensioning,代码行数:17,代码来源:textEdit.py
示例18: selectFun
def selectFun( event, referer, elementXML, elementParms, elementViewObject ):
crudeDebuggerPrint('''circularDimension.py:9 x,y = elementParms['x'], elementParms['y'] ''')
x,y = elementParms['x'], elementParms['y']
crudeDebuggerPrint('''circularDimension.py:10 dimensioning.point1 = x, y ''')
dimensioning.point1 = x, y
crudeDebuggerPrint('''circularDimension.py:11 debugPrint(2, 'center selected at x=%3.1f y=%3.1f' % (x,y)) ''')
debugPrint(2, 'center selected at x=%3.1f y=%3.1f' % (x,y))
crudeDebuggerPrint('''circularDimension.py:12 dimensioning.radius = elementParms['r'] ''')
dimensioning.radius = elementParms['r']
crudeDebuggerPrint('''circularDimension.py:13 dimensioning.dimScale = 1/elementXML.rootNode().scaling() ''')
dimensioning.dimScale = 1/elementXML.rootNode().scaling()
crudeDebuggerPrint('''circularDimension.py:14 dimensioning.stage = 1 ''')
dimensioning.stage = 1
crudeDebuggerPrint('''circularDimension.py:15 selectionOverlay.hideSelectionGraphicsItems() ''')
selectionOverlay.hideSelectionGraphicsItems()
crudeDebuggerPrint('''circularDimension.py:16 previewDimension.initializePreview( dimensioning.drawingVars, clickFunPreview, hoverFunPreview ) ''')
previewDimension.initializePreview( dimensioning.drawingVars, clickFunPreview, hoverFunPreview )
开发者ID:hamish2014,项目名称:FreeCAD_drawing_dimensioning,代码行数:17,代码来源:circularDimension_crudeDebugging.py
示例19: lineSelected_hideSelectionGraphicsItems
def lineSelected_hideSelectionGraphicsItems(elementParms, elementViewObject):
x1,y1,x2,y2 = [ elementParms[k] for k in [ 'x1', 'y1', 'x2', 'y2' ] ]
d = numpy.array([ x2 - x1, y2 - y1] )
d_ref = d / numpy.linalg.norm(d)
p = numpy.array([ x1, y1] )
def hideFun( gi ):
if isinstance(gi,selectionOverlay.LineSelectionGraphicsItem):
if gi.elementParms <> elementParms:
x1,y1,x2,y2 = [ gi.elementParms[k] for k in [ 'x1', 'y1', 'x2', 'y2' ] ]
d = numpy.array([ x2 - x1, y2 - y1] )
d = d / numpy.linalg.norm(d)
if abs(numpy.dot(d_ref,d)) > 1.0 - 10**-9: #then parallel
d_rotated = rotate2D(d, numpy.pi/2)
offset = numpy.array([ x1, y1] ) - p
if abs(numpy.dot(d_rotated, offset)) > 10**-6: #then not colinear
return False
return True
selectionOverlay.hideSelectionGraphicsItems(hideFun)
开发者ID:SebXcxl,项目名称:FreeCAD_drawing_dimensioning,代码行数:18,代码来源:halfLinearDimension.py
示例20: stack_selectDimensioningPoint
def stack_selectDimensioningPoint( event, referer, elementXML, elementParms, elementViewObject ):
viewInfo = selectionOverlay.DrawingsViews_info[elementViewObject.Name]
if len(d.selections) == 0:
if isinstance(referer, selectionOverlay.PointSelectionGraphicsItem):
d.selections.append( PointSelection( elementParms, elementXML, viewInfo ) )
d.selections[-1].condensed_args = True
selectionOverlay.hideSelectionGraphicsItems(
lambda gi: isinstance(gi, selectionOverlay.LineSelectionGraphicsItem)
)
else:
d.selections.append( LineSelection( elementParms, elementXML, viewInfo ) )
linearDimension_parallels_hide_non_parallel( elementParms, elementViewObject)
d.viewScale = 1 / elementXML.rootNode().scaling()
else:
if isinstance(referer, selectionOverlay.PointSelectionGraphicsItem):
d.selections.append( PointSelection( elementParms, elementXML, viewInfo ) )
d.selections[-1].condensed_args = True
else:
d.selections.append( LineSelection( elementParms, elementXML, viewInfo ) )
if len(d.selections) == 2:
previewDimension.initializePreview(d, linearDimension_stack_preview, linearDimension_stack_clickHandler)
开发者ID:badele,项目名称:dotfiles,代码行数:21,代码来源:linearDimension_stack.py
注:本文中的selectionOverlay.hideSelectionGraphicsItems函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论