Ejemplo n.º 1
0
 def recreate(self, negMsgHandler, parentKey, offset):
     self.__initBase()
     PartTransform.recreate(self, negMsgHandler, parentKey, offset)
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset, BoundingBox, ['GridIn0'],[],[],[],[],[],[])
     if (self.params.name == "Part3DBoundingBoxVisParams") or (self.params.name == "BoundingBox"):
         # The name of Part3DBoundingBoxVis was never changed in previous versions. Copy it from parent if it's the default name.
         self.params.name = globalKeyHandler().getObject(parentKey).params.name
Ejemplo n.º 2
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coDNAItemParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
     PartTransform.recreate(self, negMsgHandler, parentKey, offset)   
     VisItem.recreate(self, negMsgHandler, parentKey, offset)
     for conn in self.params.connectionPoints:
         self.sendConnections(conn, [self.params.connectionPoints[conn],self.params.connectionPointsDisable[conn]])
     self.sendTransformation()
Ejemplo n.º 3
0
    def __init__(self):
        PartModuleVis.__init__(self, VectorField, VIS_VECTORFIELD, self.__class__.__name__,['meshIn'],[],[],[],['vdataIn'])
        PartColoredVis.__init__(self)
        PartTransform.__init__(self, True)

        self.params = PartVectorFieldVisParams()
        self.__initBase()
Ejemplo n.º 4
0
 def __init__(self):
     PartModuleVis.__init__(self,Collect, VIS_2D_RAW, self.__class__.__name__,['GridIn0'],[],[],[],[],[],[],1,False, False)
     PartColoredVis.__init__(self, False)
     PartTransform.__init__(self)
     self.params = Part2DRawVisParams()
     self.params.isVisible = True
     self.__initBase()
Ejemplo n.º 5
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     PartVectorFieldVisParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
     self.__initBase()
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset, VectorField, ['meshIn'],[],[],[],['vdataIn'] )
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self,True)
     PartTransform.recreate(self, negMsgHandler, parentKey, offset)  
Ejemplo n.º 6
0
    def __init__(self):
        PartModuleVis.__init__(self, VectorField, VIS_VECTORFIELD,
                               self.__class__.__name__, ['meshIn'], [], [], [],
                               ['vdataIn'])
        PartColoredVis.__init__(self)
        PartTransform.__init__(self, True)

        self.params = PartVectorFieldVisParams()
        self.__initBase()
Ejemplo n.º 7
0
 def recreate(self, negMsgHandler, parentKey, offset):
     self.__initBase()
     self.params.mergeDefaultParams()
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self,False)
     PartTransform.recreate(self, negMsgHandler, parentKey, offset)
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset, Collect, ['GridIn0'],[],[],[],[],[],[],1,False, False )
     if (self.params.name == "Part2DRawVisParams") or (self.params.name == "Appearance"):
         # The name of Part2DRawVis was never changed in previous versions. Copy it from parent if it's the default name.
         self.params.name = globalKeyHandler().getObject(parentKey).params.name
Ejemplo n.º 8
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     PartVectorFieldVisParams.mergeDefaultParams(
         self.params)  # explicitly call mergeDefaultParams of this class
     self.__initBase()
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset,
                            VectorField, ['meshIn'], [], [], [],
                            ['vdataIn'])
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self, True)
     PartTransform.recreate(self, negMsgHandler, parentKey, offset)
Ejemplo n.º 9
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coDNAItemParams.mergeDefaultParams(
         self.params)  # explicitly call mergeDefaultParams of this class
     PartTransform.recreate(self, negMsgHandler, parentKey, offset)
     VisItem.recreate(self, negMsgHandler, parentKey, offset)
     for conn in self.params.connectionPoints:
         self.sendConnections(conn, [
             self.params.connectionPoints[conn],
             self.params.connectionPointsDisable[conn]
         ])
     self.sendTransformation()
Ejemplo n.º 10
0
    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(" ")

        realChange = ParamsDiff( self.params, params )
        PartModuleVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
        PartTransform.setParams(self, params, negMsgHandler, sendToCover, realChange)
Ejemplo n.º 11
0
    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)
        PartTransform.setParams(self, params, negMsgHandler, sendToCover, realChange)

        if self.params.coloringOption == RGB_COLOR:
            self.__sendColor()
Ejemplo n.º 12
0
    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)
        PartTransform.setParams(self, params, negMsgHandler, sendToCover,
                                realChange)

        if self.params.coloringOption == RGB_COLOR:
            self.__sendColor()
Ejemplo n.º 13
0
 def __init__(self):
     PartModuleVis.__init__(self, BoundingBox, VIS_3D_BOUNDING_BOX, self.__class__.__name__,['GridIn0'],[],[],[],[],[],[])
     PartTransform.__init__(self)
     self.params = Part3DBoundingBoxVisParams()
     self.__initBase()
Ejemplo n.º 14
0
 def __init__(self):
     VisItem.__init__(self, TYPE_DNA_ITEM, 'DNA')
     PartTransform.__init__(self)
     self.params = coDNAItemParams()
Ejemplo n.º 15
0
 def __init__(self):
     VisItem.__init__(self, TYPE_DNA_ITEM, 'DNA')
     PartTransform.__init__(self)
     self.params = coDNAItemParams()
Ejemplo n.º 16
0
    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()