def __setParams( self, params ):
        _infoer.function = str(self.__setParams)
        _infoer.write("")

        PartVisualizationPanelBlockSignals(self, True)
        self.TransformManagerBlockSignals(True)

        if isinstance( params, int):
            self.__keys[0] = params
            return

        # rgb color
        self.__r=params.r
        self.__g=params.g
        self.__b=params.b
        # material
        self.floatInRangeShininess_2.setValue(params.shininess)
        self.__ambient = params.ambient
        self.__specular = params.specular
        # transparency
        self.vrpCheckBoxTransparency.setChecked(params.transparencyOn)
        self.floatInRangeTrans.setEnabled(params.transparencyOn)
        self.floatInRangeTrans.setValue(params.transparency)

        if len(params.allVariables)>0:
            self.vrpComboBoxVariable_2.clear()
            index = 0
            for var in params.allVariables:
                self.vrpComboBoxVariable_2.insertItem(index, var)
                if var == params.variable:
                    self.vrpComboBoxVariable_2.setCurrentIndex(index)
                index+= 1

        # colortable
        currentVariable = params.variable
        self.__baseVariable = currentVariable
        currentColorTableKey = None
        if currentVariable!=None and params.colorTableKey!=None and currentVariable in params.colorTableKey:
            currentColorTableKey = params.colorTableKey[currentVariable]
        MainWindow.globalColorManager.update( self.vrpComboboxColorMap_2, currentVariable, currentColorTableKey )

        self.colorCreator=params.colorTableKey

        # set the radio buttons
        self.color = params.color
        if self.color == NO_COLOR:
            self.vrpRadioButtonNoColor.setChecked(True)
            self.vrpRadioButtonColorRGB.setChecked(False)
            self.vrpRadioButtonColorMaterial_2.setChecked(False)
            self.vrpRadioButtonColorVariable_2.setChecked(False)
            self.__changeNoColor(True)
            self.__changeRGB(False)
            self.__changeMaterial(False)
            self.__changeVariable(False)
        elif self.color == RGB_COLOR:
            self.vrpRadioButtonNoColor.setChecked(False)
            self.vrpRadioButtonColorRGB.setChecked(True)
            self.vrpRadioButtonColorMaterial_2.setChecked(False)
            self.vrpRadioButtonColorVariable_2.setChecked(False)
            self.__changeNoColor(False)
            self.__changeRGB(True)
            self.__changeMaterial(False)
            self.__changeVariable(False)
        elif self.color == MATERIAL:
            self.vrpRadioButtonNoColor.setChecked(False)
            self.vrpRadioButtonColorRGB.setChecked(False)
            self.vrpRadioButtonColorMaterial_2.setChecked(True)
            self.vrpRadioButtonColorVariable_2.setChecked(False)
            self.__changeNoColor(False)
            self.__changeRGB(False)
            self.__changeMaterial(True)
            self.__changeVariable(False)
        elif self.color == VARIABLE:
            self.vrpRadioButtonNoColor.setChecked(False)
            self.vrpRadioButtonColorRGB.setChecked(False)
            self.vrpRadioButtonColorMaterial_2.setChecked(False)
            self.vrpRadioButtonColorVariable_2.setChecked(True)
            self.__changeNoColor(False)
            self.__changeRGB(False)
            self.__changeMaterial(False)
            self.__changeVariable(True)

        #transform card
        self.TransformManagerSetParams(params)

        # shader
        selectInShaderList(self.shaderList, params.shaderFilename)

        self.TransformManagerBlockSignals(False)
        PartVisualizationPanelBlockSignals(self, False)

        # for multi selection
        if len(self.__keys)>1 :
            self.oldPanelParams = params
Example #2
0
    def __setParams( self, params ):
        _infoer.function = str(self.__setParams)
        _infoer.write("")

        SceneGraphItemPanelBlockSignals(self, True)
        self.TransformManagerBlockSignals(True)

        if isinstance( params, int):
            self.__keys[0] = params
            return

        self.nameWidget.setText(params.name)
        self.nodeTypeWidget.setText(params.nodeClassName)
        # enable coloring-tab only for geodes or multiselection
        if params.nodeClassName == "Geode" or len(self.__keys) > 1:
            self.groupBox.setEnabled(True)
        else:
            self.groupBox.setEnabled(False)

        # TODO: these parameters are currently not used
        # rgb color
        self.__r=params.r
        self.__g=params.g
        self.__b=params.b
        # material
        self.floatInRangeShininess_2.setValue(params.shininess)
        self.__ambient = params.ambient
        self.__specular = params.specular

        # transparency
        self.vrpCheckBoxTransparency.setChecked(params.transparencyOn)
        self.floatInRangeTrans.setEnabled(params.transparencyOn)
        self.floatInRangeTrans.setValue(params.transparency)

        # set the radio buttons
        self.color = params.color
        if self.color == NO_COLOR:
            self.vrpRadioButtonNoColor.setChecked(True)
            self.vrpRadioButtonColorRGB.setChecked(False)
            self.vrpRadioButtonColorMaterial_2.setChecked(False)
            self.__changeNoColor(True)
            self.__changeRGB(False)
            self.__changeMaterial(False)
        elif self.color == RGB_COLOR:
            self.vrpRadioButtonNoColor.setChecked(False)
            self.vrpRadioButtonColorRGB.setChecked(True)
            self.vrpRadioButtonColorMaterial_2.setChecked(False)
            self.__changeNoColor(False)
            self.__changeRGB(True)
            self.__changeMaterial(False)
        elif self.color == MATERIAL:
            self.vrpRadioButtonNoColor.setChecked(False)
            self.vrpRadioButtonColorRGB.setChecked(False)
            self.vrpRadioButtonColorMaterial_2.setChecked(True)
            self.__changeNoColor(False)
            self.__changeRGB(False)
            self.__changeMaterial(True)
        elif self.color == VARIABLE:
            self.vrpRadioButtonNoColor.setChecked(False)
            self.vrpRadioButtonColorRGB.setChecked(False)
            self.vrpRadioButtonColorMaterial_2.setChecked(False)
            self.__changeNoColor(False)
            self.__changeRGB(False)
            self.__changeMaterial(False)

        # set moveable checkbox
        self.vrpCheckBoxIsMoveable.setChecked(params.isMoveable)

        # set checkbox for selection in renderer
        self.vrpCheckBoxIsMoveSelected.setChecked(params.isMoveSelected)
        self.vrpCheckBoxIsMoveSelected.setEnabled(params.isMoveable)

        #transform card
        self.TransformManagerSetParams(params)
        
        # shader
        selectInShaderList(self.shaderList, params.shaderFilename)

        self.TransformManagerBlockSignals(False)
        SceneGraphItemPanelBlockSignals(self, False)

        # for multi selection
        if len(self.__keys)>1 :
            self.oldPanelParams = params
Example #3
0
    def __setParams(self, params):
        _infoer.function = str(self.__setParams)
        _infoer.write("")

        SceneGraphItemPanelBlockSignals(self, True)
        self.TransformManagerBlockSignals(True)

        if isinstance(params, int):
            self.__keys[0] = params
            return

        self.nameWidget.setText(params.name)
        self.nodeTypeWidget.setText(params.nodeClassName)
        # enable coloring-tab only for geodes or multiselection
        if params.nodeClassName == "Geode" or len(self.__keys) > 1:
            self.groupBox.setEnabled(True)
        else:
            self.groupBox.setEnabled(False)

        # TODO: these parameters are currently not used
        # rgb color
        self.__r = params.r
        self.__g = params.g
        self.__b = params.b
        # material
        self.floatInRangeShininess_2.setValue(params.shininess)
        self.__ambient = params.ambient
        self.__specular = params.specular

        # transparency
        self.vrpCheckBoxTransparency.setChecked(params.transparencyOn)
        self.floatInRangeTrans.setEnabled(params.transparencyOn)
        self.floatInRangeTrans.setValue(params.transparency)

        # set the radio buttons
        self.color = params.color
        if self.color == NO_COLOR:
            self.vrpRadioButtonNoColor.setChecked(True)
            self.vrpRadioButtonColorRGB.setChecked(False)
            self.vrpRadioButtonColorMaterial_2.setChecked(False)
            self.__changeNoColor(True)
            self.__changeRGB(False)
            self.__changeMaterial(False)
        elif self.color == RGB_COLOR:
            self.vrpRadioButtonNoColor.setChecked(False)
            self.vrpRadioButtonColorRGB.setChecked(True)
            self.vrpRadioButtonColorMaterial_2.setChecked(False)
            self.__changeNoColor(False)
            self.__changeRGB(True)
            self.__changeMaterial(False)
        elif self.color == MATERIAL:
            self.vrpRadioButtonNoColor.setChecked(False)
            self.vrpRadioButtonColorRGB.setChecked(False)
            self.vrpRadioButtonColorMaterial_2.setChecked(True)
            self.__changeNoColor(False)
            self.__changeRGB(False)
            self.__changeMaterial(True)
        elif self.color == VARIABLE:
            self.vrpRadioButtonNoColor.setChecked(False)
            self.vrpRadioButtonColorRGB.setChecked(False)
            self.vrpRadioButtonColorMaterial_2.setChecked(False)
            self.__changeNoColor(False)
            self.__changeRGB(False)
            self.__changeMaterial(False)

        # set moveable checkbox
        self.vrpCheckBoxIsMoveable.setChecked(params.isMoveable)

        # set checkbox for selection in renderer
        self.vrpCheckBoxIsMoveSelected.setChecked(params.isMoveSelected)
        self.vrpCheckBoxIsMoveSelected.setEnabled(params.isMoveable)

        #transform card
        self.TransformManagerSetParams(params)

        # shader
        selectInShaderList(self.shaderList, params.shaderFilename)

        self.TransformManagerBlockSignals(False)
        SceneGraphItemPanelBlockSignals(self, False)

        # for multi selection
        if len(self.__keys) > 1:
            self.oldPanelParams = params