本文整理汇总了Python中PathScripts.PathPreferences.PathPreferences.preferences方法的典型用法代码示例。如果您正苦于以下问题:Python PathPreferences.preferences方法的具体用法?Python PathPreferences.preferences怎么用?Python PathPreferences.preferences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathScripts.PathPreferences.PathPreferences
的用法示例。
在下文中一共展示了PathPreferences.preferences方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: saveSettings
# 需要导入模块: from PathScripts.PathPreferences import PathPreferences [as 别名]
# 或者: from PathScripts.PathPreferences.PathPreferences import preferences [as 别名]
def saveSettings(self):
pref = PathPreferences.preferences()
pref.SetFloat(self.DefaultHoldingTagWidth, FreeCAD.Units.Quantity(self.form.ifWidth.text()).Value)
pref.SetFloat(self.DefaultHoldingTagHeight, FreeCAD.Units.Quantity(self.form.ifHeight.text()).Value)
pref.SetFloat(self.DefaultHoldingTagAngle, self.form.dsbAngle.value())
pref.SetFloat(self.DefaultHoldingTagRadius, FreeCAD.Units.Quantity(self.form.ifRadius.text()))
pref.SetUnsigned(self.DefaultHoldingTagCount, self.form.sbCount.value())
示例2: setupColors
# 需要导入模块: from PathScripts.PathPreferences import PathPreferences [as 别名]
# 或者: from PathScripts.PathPreferences.PathPreferences import preferences [as 别名]
def setupColors(self):
def colorForColorValue(val):
v = [((val >> n) & 0xff) / 255. for n in [24, 16, 8, 0]]
return coin.SbColor(v[0], v[1], v[2])
pref = PathPreferences.preferences()
# R G B A
npc = pref.GetUnsigned('DefaultPathMarkerColor', ((85*256 + 255)*256 + 0) * 256 + 255)
hpc = pref.GetUnsigned('DefaultHighlightPathColor', ((255*256 + 125)*256 + 0)*256 + 255)
dpc = pref.GetUnsigned('DefaultDisabledPathColor', ((205*256 + 205)*256 + 205)*256 + 154)
self.colors = [colorForColorValue(npc), colorForColorValue(dpc), colorForColorValue(hpc)]
示例3: defaultRadius
# 需要导入模块: from PathScripts.PathPreferences import PathPreferences [as 别名]
# 或者: from PathScripts.PathPreferences.PathPreferences import preferences [as 别名]
def defaultRadius(cls, ifNotSet = 0.0):
return PathPreferences.preferences().GetFloat(cls.DefaultHoldingTagRadius, ifNotSet)
示例4: defaultCount
# 需要导入模块: from PathScripts.PathPreferences import PathPreferences [as 别名]
# 或者: from PathScripts.PathPreferences.PathPreferences import preferences [as 别名]
def defaultCount(cls, ifNotSet = 4):
value = PathPreferences.preferences().GetUnsigned(cls.DefaultHoldingTagCount, ifNotSet)
if value < 2:
return float(ifNotSet)
return float(value)
示例5: defaultAngle
# 需要导入模块: from PathScripts.PathPreferences import PathPreferences [as 别名]
# 或者: from PathScripts.PathPreferences.PathPreferences import preferences [as 别名]
def defaultAngle(cls, ifNotSet = 45.0):
value = PathPreferences.preferences().GetFloat(cls.DefaultHoldingTagAngle, ifNotSet)
if value < 10.0:
return ifNotSet
return value
示例6: defaultHeight
# 需要导入模块: from PathScripts.PathPreferences import PathPreferences [as 别名]
# 或者: from PathScripts.PathPreferences.PathPreferences import preferences [as 别名]
def defaultHeight(cls, ifNotSet):
value = PathPreferences.preferences().GetFloat(cls.DefaultHoldingTagHeight, ifNotSet)
if value == 0.0:
return ifNotSet
return value