本文整理汇总了Python中selectionOverlay.hideSelectionGraphicsItems函数的典型用法代码示例。如果您正苦于以下问题:Python hideSelectionGraphicsItems函数的具体用法?Python hideSelectionGraphicsItems怎么用?Python hideSelectionGraphicsItems使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hideSelectionGraphicsItems函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
示例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 )
示例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 )
示例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 )
示例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)
示例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 )
示例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 )
示例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')
示例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 )
示例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')
示例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()
示例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 )
示例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
示例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 )
示例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 )