本文整理汇总了Python中PartColoredVis.PartColoredVis.setParams方法的典型用法代码示例。如果您正苦于以下问题:Python PartColoredVis.setParams方法的具体用法?Python PartColoredVis.setParams怎么用?Python PartColoredVis.setParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PartColoredVis.PartColoredVis
的用法示例。
在下文中一共展示了PartColoredVis.setParams方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setParams
# 需要导入模块: from PartColoredVis import PartColoredVis [as 别名]
# 或者: from PartColoredVis.PartColoredVis import setParams [as 别名]
def setParams( self, params, negMsgHandler=None, sendToCover=True):
""" set parameters from outside
+ init cutting surface module if necessary
+ mainly receive parameter changes from Gui
+ send status messages to COVER if state has changed
"""
_infoer.function = str(self.setParams)
_infoer.write("setParams")
realChange = ParamsDiff( self.params, params )
PartModuleVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
PartColoredVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
PartInteractorVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
if 'isVisible' in realChange:
if self.params.isVisible:
self.sendClipPlane()
else:
self.sendClipPlaneOFF()
if ( ('attachedClipPlane_index' in realChange)
or ('attachedClipPlane_offset' in realChange)
or ('attachedClipPlane_flip' in realChange)):
self.sendClipPlane()
示例2: setParams
# 需要导入模块: from PartColoredVis import PartColoredVis [as 别名]
# 或者: from PartColoredVis.PartColoredVis import setParams [as 别名]
def setParams( self, params, negMsgHandler=None, sendToCover=True):
""" set parameters from outside
+ init module if necessary
+ mainly receive parameter changes from Gui
+ send status messages to COVER if state has changed
"""
realChange = ParamsDiff( self.params, params )
PartModuleVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
PartColoredVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
示例3: setParams
# 需要导入模块: from PartColoredVis import PartColoredVis [as 别名]
# 或者: from PartColoredVis.PartColoredVis import setParams [as 别名]
def setParams( self, params, negMsgHandler=None, sendToCover=True):
""" set parameters from outside
+ init tracer module if necessary
+ mainly receive parameter changes from Gui
+ send status messages to COVER if state has changed
"""
_infoer.function = str(self.setParams)
_infoer.write("setParams")
realChange = ParamsDiff( self.params, params )
PartModuleVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
PartColoredVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
PartInteractorVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
if 'use2DPartKey' in realChange: PartInteractorVis.sendInteractorPosibility(self)
示例4: setParams
# 需要导入模块: from PartColoredVis import PartColoredVis [as 别名]
# 或者: from PartColoredVis.PartColoredVis import setParams [as 别名]
def setParams( self, params, negMsgHandler=None, sendToCover=True):
return # TODO: probe is not working at the moment: stuck in saveExecute (data or grid missing)
""" set parameters from outside
+ init tracer module if necessary
+ mainly receive parameter changes from Gui
+ send status messages to COVER if state has changed
"""
_infoer.function = str(self.setParams)
_infoer.write("setParams")
realChange = ParamsDiff( self.params, params )
PartModuleVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
PartColoredVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
PartInteractorVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
示例5: setParams
# 需要导入模块: from PartColoredVis import PartColoredVis [as 别名]
# 或者: from PartColoredVis.PartColoredVis import setParams [as 别名]
def setParams( self, params, negMsgHandler=None, sendToCover=True):
""" set parameters from outside
+ init tracer module if necessary
+ mainly receive parameter changes from Gui
+ send status messages to COVER if state has changed
"""
_infoer.function = str(self.setParams)
_infoer.write(" ")
# save the old variable to delete from colorTable
oldVariable = self.currentVariable()
oldTable = None
if oldVariable!=None and oldVariable!= 'Select a variable':
if hasattr(self.params.colorTableKey, oldVariable):
oldTable = globalKeyHandler().getObject(self.params.colorTableKey[oldVariable])
realChange = ParamsDiff( self.params, params )
PartModuleVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
if self.params.color == VARIABLE:
PartColoredVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
PartTransform.setParams(self, params, negMsgHandler, sendToCover, realChange)
needsTransparency = False
needsShader = False
if hasattr (params, 'color') and (params.color == NO_COLOR) \
and ('color' in realChange):
# disconnect colors module and run the collect module
# (we dont want to call run since we dont need the children to be executed)
if not self.__lastColorConnection==None:
disconnect(self.__lastColorConnection, ConnectionPoint(self._module, 'DataIn0'))
self.__lastColorConnection=None
PartModuleVis.run(self, RUN_ALL, negMsgHandler)
needsTransparency = True
elif hasattr (params, 'color') and (params.color==RGB_COLOR) \
and (('color' in realChange) or ('r' in realChange) or ('g' in realChange) or ('b' in realChange)):
self.__sendColor()
needsTransparency = True
elif hasattr (params, 'color') and (params.color==MATERIAL) \
and (('color' in realChange) or ('r' in realChange) or ('g' in realChange) or ('b' in realChange) \
or ('ambient' in realChange) or ('specular' in realChange) or ('shininess' in realChange)):
self.__sendMaterial()
needsTransparency = True
elif hasattr(params, 'transparency') and ('transparency' in realChange):
needsTransparency = True
if 'variable' in realChange:
# if variable changed append key to colorTable dependant keys
# make sure this part is updated if colormap changes
if params.variable!=None and params.variable!= 'Select a variable' and params.color == VARIABLE:
# delete key from old colorTable
if not oldTable == None and self.key in oldTable.params.dependantKeys:
oldTable.params.dependantKeys.remove(self.key)
# add key to new colorTable
cTableObject = globalKeyHandler().getObject(params.colorTableKey[params.variable])
params.baseObjectName = params.name
if self.key not in cTableObject.params.dependantKeys:
cTableObject.params.dependantKeys.append(self.key)
if negMsgHandler:
negMsgHandler.internalRecvParams( cTableObject.key, cTableObject.params )
negMsgHandler.sendParams( cTableObject.key, cTableObject.params )
if ('shaderFilename' in realChange):
needsTransparency = True
needsShader = True
# always send transparency before shader:
# sendTransparency will ignore any shader transparency but sendShader respects the regular transparency if possible
if needsTransparency and (params.shaderFilename != ""):
needsShader = True
if needsTransparency:
self.__sendTransparency()
if needsShader:
self.__sendShader()