예제 #1
0
    def setParamsByModule( self, mparam, mvalue):
        """ receives parameter changes from the iso cutter module
            return a list of objKey and their parameters to be set by the Neg2Gui class
        """
        _infoer.function = str(self.setParamsByModule)
        _infoer.write("param: %s, value: %s" % (mparam, str(mvalue)))
        pChangeList = []
        newparams = CopyParams(self.params)
        if mparam == 'len':
            try:
                newparams.length= int(mvalue[0])
            except ValueError:
                newparams.length= int(float(mvalue[0]))

        if mparam == 'skip':
            try:
                newparams.skip= int(mvalue[0])
            except ValueError:
                newparams.skip= int(float(mvalue[0]))

        pChangeList.append( (self.key, newparams) )

        return pChangeList
예제 #2
0
    def setParamsByModule(self, mparam, mvalue):
        """ receives parameter changes from the iso cutter module
            return a list of objKey and their parameters to be set by the Neg2Gui class
        """
        _infoer.function = str(self.setParamsByModule)
        _infoer.write("param: %s, value: %s" % (mparam, str(mvalue)))
        pChangeList = []
        newparams = CopyParams(self.params)
        if mparam == 'len':
            try:
                newparams.length = int(mvalue[0])
            except ValueError:
                newparams.length = int(float(mvalue[0]))

        if mparam == 'skip':
            try:
                newparams.skip = int(mvalue[0])
            except ValueError:
                newparams.skip = int(float(mvalue[0]))

        pChangeList.append((self.key, newparams))

        return pChangeList
예제 #3
0
    def setParamsByModule(self, mparam, mvalue):
        """ receives parameter changes from the cutting surface module
            return a list of objKey and their parameters to be set by the Neg2Gui class
        """
        _infoer.function = str(self.setParamsByModule)
        _infoer.write(" ")
        pChangeList = []
        newparams = CopyParams(self.params)
        if mparam == 'point':
            self.__point = mvalue
            return pChangeList
        if mparam == 'vertex':
            aaa = RectangleIn3d1Mid1Norm(
            )  #convertAlignedRectangleToGeneral(self.params.alignedRectangle)
            if self.__point:
                aaa.point = (float(self.__point[0]), float(self.__point[1]),
                             float(self.__point[2]))
            aaa.normal = (float(mvalue[0]), float(mvalue[1]), float(mvalue[2]))
            xxx = convertCutRectangleToAlignedRectangle(
                aaa, self.params.alignedRectangle.orthogonalAxis)
            newparams.alignedRectangle = xxx
            self.__point = None
        if mparam == 'option':
            newparams.option = int(mvalue[0])
        if mparam == 'scale':
            newparams.scale = float(mvalue[2])
        if mparam == 'length':
            newparams.length = int(mvalue[0])

        pChangeList.append((self.key, newparams))

        if mparam == 'Min/Max':
            cTableObject = globalKeyHandler().getObject(
                self.params.colorTableKey[self.currentVariable()])
            if cTableObject.params.baseMin != float(
                    mvalue[0]) or cTableObject.params.baseMax != float(
                        mvalue[1]):
                cTableObject.params.baseObjectName = self.params.name
                cTableObject.params.baseMin = float(mvalue[0])
                cTableObject.params.baseMax = float(mvalue[1])
                if self.key not in cTableObject.params.dependantKeys:
                    cTableObject.params.dependantKeys.append(self.key)
                pChangeList.append((cTableObject.key, cTableObject.params))

        return pChangeList
예제 #4
0
    def setParamsByModule( self, mparam, mvalue):
        """ receives parameter changes from the cutting surface module
            return a list of objKey and their parameters to be set by the Neg2Gui class
        """
        _infoer.function = str(self.setParamsByModule)
        _infoer.write(" ")
        pChangeList = []
        newparams = CopyParams(self.params)
        if mparam == 'point':
            self.__point = mvalue
            return pChangeList
        if mparam == 'vertex':
            aaa = RectangleIn3d1Mid1Norm()#convertAlignedRectangleToGeneral(self.params.alignedRectangle)
            if self.__point:
                aaa.point=(float(self.__point[0]), float(self.__point[1]), float(self.__point[2]) )
            aaa.normal=(float(mvalue[0]), float(mvalue[1]), float(mvalue[2]) )
            xxx=convertCutRectangleToAlignedRectangle(aaa, self.params.alignedRectangle.orthogonalAxis)
            newparams.alignedRectangle=xxx
            self.__point=None
        if mparam == 'option':
            newparams.option= int(mvalue[0])
        if mparam == 'scale':
            newparams.scale= float(mvalue[2])
        if mparam == 'length':
            newparams.length= int(mvalue[0])

        pChangeList.append( (self.key, newparams) )

        if mparam == 'Min/Max':
            cTableObject = globalKeyHandler().getObject(self.params.colorTableKey[self.currentVariable()])
            if cTableObject.params.baseMin != float(mvalue[0]) or cTableObject.params.baseMax != float(mvalue[1]):
                cTableObject.params.baseObjectName = self.params.name
                cTableObject.params.baseMin = float(mvalue[0])
                cTableObject.params.baseMax = float(mvalue[1])
                if self.key not in cTableObject.params.dependantKeys:
                    cTableObject.params.dependantKeys.append(self.key)
                pChangeList.append( (cTableObject.key, cTableObject.params) )

        return pChangeList