Ejemplo n.º 1
0
 def duplicateVisualizer(self, objKey):
     # get the typ of the object
     typeNr = self.__objects[objKey].type
     # copy only 2d and 3d parts
     if not typeNr in [
             VIS_STREAMLINE, VIS_MOVING_POINTS, VIS_PATHLINES, VIS_ISOPLANE,
             VIS_VECTORFIELD, VIS_PLANE, VIS_VECTOR
     ]:
         return
     # get the parent of the object
     parent = self.getParentOfObject(objKey)
     # get the name of the object
     name = self.getParamsOfObject(objKey).name
     # copy the params
     newParams = CopyParams(self.getParamsOfObject(objKey))
     # create new name with copy at the end
     newName = name + '(Copy)'
     i = 2
     while newName in self.__copyNames:
         newName = name + '(Copy ' + str(i) + ')'
         i = i + 1
     # set the new params
     newParams.name = newName
     # send duplicate message
     request = theGuiMsgHandler().requestDuplicateObject(
         objKey, newName, typeNr, None, parent, newParams)
     theGuiMsgHandler().waitforAnswer(request)
Ejemplo n.º 2
0
    def __init__(self):
        QtCore.QObject.__init__(self)
        self.__objects = {}
        # whether init of an object was already done
        self.__initHistory = {}
        self.__projectKey = None
        self.__lastCaseKey = None
        self.__presentationKey = None
        self.__viewpointMgrKey = None
        self.__trackingMgrKey = None
        

        # which variable to set if a new visItem was requested from gui
        self.__initVariable = None

        # list of names used for copy
        self.__copyNames = []

        # last request number for object creation
        self.__newObjReqNr = -1
        self.__newObjKey = -1

        #todo remove
        self.newCoviseFileName=None

        theGuiMsgHandler().registerAddCallback(SESSION_KEY, self.addObjCB)
        theGuiMsgHandler().registerFinishLoadingCallback(self.finishLoading)
        theGuiMsgHandler().registerReduceTimestepCallback(self.reduceTimestep)
        theGuiMsgHandler().registerIsTransientCallback(self.isTransientCB)
        theGuiMsgHandler().registerKeyWordCallback('DELETE_OBJECT', self.deleteObject)        
Ejemplo n.º 3
0
def createStaticColorVis(requestNr, typeNr, key, parentKey, params):
    print("create static color panel with key %s of parent %s " %
          (key, parentKey))
    global VisColor_key
    if VisColor_key == -1:
        VisColor_key = key
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 4
0
    def initProject(self):
        # delete old project
        self.deleteProject()
        # create new project
        print('new project')
        reqId = theGuiMsgHandler().requestObject(typeNr=TYPE_PROJECT,
                                                 callback=None,
                                                 parentKey=SESSION_KEY)

        print('wait')
        theGuiMsgHandler().waitforAnswer(reqId)
        print('waitDone')
        # reset Navigation Mode
        navMode = covise.getCoConfigEntry("COVER.NavigationMode")
        if (navMode == "NavNone"):
            Application.vrpApp.mw.navigationModeNone()
        if (navMode == "Transform"):
            Application.vrpApp.mw.navigationModeTransform()
        if (navMode == "Measure"):
            Application.vrpApp.mw.navigationModeMeasure()

        # add Coxml Intitial File
        # NOTE: might be better in negotiator but the current file importing process does not easily allow that
        if (covise.getCoConfigEntry("vr-prepare.Coxml.InitialFile", "") != ""):
            resourceDir = covise.getCoConfigEntry(
                "vr-prepare.Coxml.ResourceDirectory")
            initFile = covise.getCoConfigEntry("vr-prepare.Coxml.InitialFile")
            if (resourceDir != None) and (initFile != None):
                if os.path.exists(resourceDir + "/coxml/" + initFile):
                    self.importFile(initFile)
                else:
                    print("Error: Initial coxml file does not exist (%s)" %
                          initFile)
Ejemplo n.º 5
0
    def __init__(self):
        QtCore.QObject.__init__(self)
        self.__objects = {}
        # whether init of an object was already done
        self.__initHistory = {}
        self.__projectKey = None
        self.__lastCaseKey = None
        self.__presentationKey = None
        self.__viewpointMgrKey = None
        self.__trackingMgrKey = None

        # which variable to set if a new visItem was requested from gui
        self.__initVariable = None

        # list of names used for copy
        self.__copyNames = []

        # last request number for object creation
        self.__newObjReqNr = -1
        self.__newObjKey = -1

        #todo remove
        self.newCoviseFileName = None

        theGuiMsgHandler().registerAddCallback(SESSION_KEY, self.addObjCB)
        theGuiMsgHandler().registerFinishLoadingCallback(self.finishLoading)
        theGuiMsgHandler().registerReduceTimestepCallback(self.reduceTimestep)
        theGuiMsgHandler().registerIsTransientCallback(self.isTransientCB)
        theGuiMsgHandler().registerKeyWordCallback('DELETE_OBJECT',
                                                   self.deleteObject)
Ejemplo n.º 6
0
    def initProject(self):
        # delete old project
        self.deleteProject()
        # create new project
        print('new project')
        reqId = theGuiMsgHandler().requestObject(typeNr = TYPE_PROJECT, callback = None, parentKey = SESSION_KEY)
        
        print('wait')
        theGuiMsgHandler().waitforAnswer(reqId)
        print('waitDone')
        # reset Navigation Mode
        navMode = covise.getCoConfigEntry("COVER.NavigationMode")
        if (navMode == "NavNone"):
            Application.vrpApp.mw.navigationModeNone()
        if (navMode == "Transform"):
            Application.vrpApp.mw.navigationModeTransform()
        if (navMode == "Measure"):
            Application.vrpApp.mw.navigationModeMeasure()

        # add Coxml Intitial File
        # NOTE: might be better in negotiator but the current file importing process does not easily allow that
        if (covise.getCoConfigEntry("vr-prepare.Coxml.InitialFile", "") != ""):
            resourceDir = covise.getCoConfigEntry("vr-prepare.Coxml.ResourceDirectory")
            initFile = covise.getCoConfigEntry("vr-prepare.Coxml.InitialFile")
            if (resourceDir != None) and (initFile != None):
                if os.path.exists(resourceDir + "/coxml/" + initFile):
                    self.importFile(initFile)
                else:
                    print("Error: Initial coxml file does not exist (%s)" % initFile)
Ejemplo n.º 7
0
 def deleteObject(self, key):
     if key in Application.vrpApp.visuKey2GuiKey:
         key = Application.vrpApp.visuKey2GuiKey[key]
     if key in self.__objects:
         parentKey = self.getParentOfObject(key)
         theGuiMsgHandler().requestDelObject(key)
         if (parentKey != -1):
             Application.vrpApp.mw.raisePanelForKey(parentKey)
Ejemplo n.º 8
0
 def setParams( self, key, params ):
     """ params changed in gui """
     if not key in self.__objects:
         return
     self.__objects[key].params = params
     self.sigGuiParamChanged.emit( key ) # we need this, for example to update the tree checkboxes in case of contextMenu/hideParts
     Application.vrpApp.mw.updatePanel(key)
     theGuiMsgHandler().setParams(key, params)
Ejemplo n.º 9
0
 def deleteObject(self, key):
     if key in Application.vrpApp.visuKey2GuiKey:
         key = Application.vrpApp.visuKey2GuiKey[key]
     if key in self.__objects:
         parentKey = self.getParentOfObject(key)
         theGuiMsgHandler().requestDelObject(key)
         if (parentKey != -1):
             Application.vrpApp.mw.raisePanelForKey(parentKey)
Ejemplo n.º 10
0
 def checkForUpdate(self, key, params):
     if hasattr(params, 'variable') and params.variable != 'unset':
         Application.vrpApp.key2params[key] = params
     elif self.__initVariable != None:
         params.variable = self.__initVariable
         # remark:  init params must have been deposited streamlineInitParams
         theGuiMsgHandler().setParams(key, params)
         theGuiMsgHandler().runObject(key)
         self.__initVariable = None
Ejemplo n.º 11
0
 def checkForUpdate( self, key, params ):
     if hasattr(params, 'variable') and params.variable!='unset' :
         Application.vrpApp.key2params[key] = params
     elif self.__initVariable!=None:
         params.variable = self.__initVariable
         # remark:  init params must have been deposited streamlineInitParams
         theGuiMsgHandler().setParams( key, params )
         theGuiMsgHandler().runObject(key)
         self.__initVariable = None
Ejemplo n.º 12
0
    def refactoringThing02(self, requestNr, key, params):
        # propagate visibility-state to gui
        class ParamDeliverer(object):
            pass
        paramsForTreeView = ParamDeliverer()
        paramsForTreeView.isChecked = params.isVisible
        Application.vrpApp.mw.globalAccessToTreeView().setItemData(
            Application.vrpApp.visuKey2GuiKey[key], paramsForTreeView)

        theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 13
0
 def setParams(self, key, params):
     """ params changed in gui """
     if not key in self.__objects:
         return
     self.__objects[key].params = params
     self.sigGuiParamChanged.emit(
         key
     )  # we need this, for example to update the tree checkboxes in case of contextMenu/hideParts
     Application.vrpApp.mw.updatePanel(key)
     theGuiMsgHandler().setParams(key, params)
Ejemplo n.º 14
0
    def refactoringThing02(self, requestNr, key, params):
        # propagate visibility-state to gui
        class ParamDeliverer(object):
            pass

        paramsForTreeView = ParamDeliverer()
        paramsForTreeView.isChecked = params.isVisible
        Application.vrpApp.mw.globalAccessToTreeView().setItemData(
            Application.vrpApp.visuKey2GuiKey[key], paramsForTreeView)

        theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 15
0
def setPartPanelParams(requestNr, key, params):
    print("setPartPanelParams : ")
    global scalar_variable
    global vector_variable
    scalar_variable = None
    for v in params.partcase.variables:
        print("Variable %s in file %s " % (v.name, v.filename))
        if scalar_variable == None:
            scalar_variable = v.name
        if v.variableDimension == 3:
            print("Choose Velocity ", v.filename)
            vector_variable = v.name
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 16
0
def setPartPanelParams(requestNr, key, params):
    print("setPartPanelParams : ")
    global scalar_variable
    global vector_variable
    scalar_variable = None
    for v in params.partcase.variables:
        print("Variable %s in file %s " % ( v.name, v.filename ))
        if scalar_variable==None:
            scalar_variable=v.name
        if v.variableDimension==3:
            print("Choose Velocity ", v.filename)
            vector_variable=v.name
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 17
0
def testGuiForObjectTree():
    keepReference = QApplication(sys.argv)

    global global_tree
    global_tree = KeyedTreeView()

    initHandlers()

    g = theGuiMsgHandler()

    g.registerAddCallback(SESSION_KEY, childInitCB)
    reqId = g.requestObject(
        typeNr = TYPE_PROJECT, callback = None, parentKey = SESSION_KEY)
    g.waitforAnswer(reqId)

    reqId = g.requestObject(
        typeNr = TYPE_CASE, callback = None, parentKey = project_key)
    g.waitforAnswer(reqId)

    caseP = coCaseMgrParams()
    nameAndCase = NameAndCoviseCase()
    nameAndCase.setFromFile('/work/common/Projekte/DC-CFDGui/datasets/'
                            'TINY/CoviseDaten/TINY.cocase')
    caseP.dsc = coviseCase2DimensionSeperatedCase(
        nameAndCase.case, nameAndCase.name)
    g.setParams(case_key, caseP)

    qApp.setMainWidget(global_tree)
    global_tree.show()
    qApp.exec_loop()
Ejemplo n.º 18
0
def testGuiForObjectTree():
    keepReference = QApplication(sys.argv)

    global global_tree
    global_tree = KeyedTreeView()

    initHandlers()

    g = theGuiMsgHandler()

    g.registerAddCallback(SESSION_KEY, childInitCB)
    reqId = g.requestObject(typeNr=TYPE_PROJECT,
                            callback=None,
                            parentKey=SESSION_KEY)
    g.waitforAnswer(reqId)

    reqId = g.requestObject(typeNr=TYPE_CASE,
                            callback=None,
                            parentKey=project_key)
    g.waitforAnswer(reqId)

    caseP = coCaseMgrParams()
    nameAndCase = NameAndCoviseCase()
    nameAndCase.setFromFile('/work/common/Projekte/DC-CFDGui/datasets/'
                            'TINY/CoviseDaten/TINY.cocase')
    caseP.dsc = coviseCase2DimensionSeperatedCase(nameAndCase.case,
                                                  nameAndCase.name)
    g.setParams(case_key, caseP)

    qApp.setMainWidget(global_tree)
    global_tree.show()
    qApp.exec_loop()
Ejemplo n.º 19
0
 def importFile(self, filename ):
     self.newCoviseFileName = filename
     if filename.lower().endswith('.covise'):
         theGuiMsgHandler().requestObject( VIS_COVISE, callback = None, parentKey = self.__projectKey)
     elif filename.lower().endswith('.tif') or filename.lower().endswith('.tiff') or filename.lower().endswith('.png'):
         theGuiMsgHandler().requestObject( VIS_DOCUMENT, callback = None, parentKey = self.__projectKey)
     elif filename.lower().endswith('.coxml') :
         theGuiMsgHandler().requestObject( VIS_SCENE_OBJECT, callback = None, parentKey = self.__projectKey)
     else:
         theGuiMsgHandler().requestObject( VIS_VRML, callback = None, parentKey = self.__projectKey)
Ejemplo n.º 20
0
 def importCases(self, dscsFineRaw):
     for dsc, rawDsc in zip(*dscsFineRaw):
         reqId = theGuiMsgHandler().requestObject(typeNr = TYPE_CASE, callback = None, parentKey = self.__projectKey)
         theGuiMsgHandler().waitforAnswer(reqId)
         case_key = self.getLastCaseKey() 
         caseP = coCaseMgrParams()
         caseP.filteredDsc = dsc
         caseP.origDsc = rawDsc
         theGuiMsgHandler().setParams(case_key, caseP)
         # start geo reading and octtree building
         reqId = theGuiMsgHandler().runObject(case_key, RUN_OCT)
         theGuiMsgHandler().waitforAnswer(reqId)
         # start all vis items
         reqId = theGuiMsgHandler().runObject(case_key, RUN_ALL)
Ejemplo n.º 21
0
 def importCases(self, dscsFineRaw):
     for dsc, rawDsc in zip(*dscsFineRaw):
         reqId = theGuiMsgHandler().requestObject(
             typeNr=TYPE_CASE, callback=None, parentKey=self.__projectKey)
         theGuiMsgHandler().waitforAnswer(reqId)
         case_key = self.getLastCaseKey()
         caseP = coCaseMgrParams()
         caseP.filteredDsc = dsc
         caseP.origDsc = rawDsc
         theGuiMsgHandler().setParams(case_key, caseP)
         # start geo reading and octtree building
         reqId = theGuiMsgHandler().runObject(case_key, RUN_OCT)
         theGuiMsgHandler().waitforAnswer(reqId)
         # start all vis items
         reqId = theGuiMsgHandler().runObject(case_key, RUN_ALL)
Ejemplo n.º 22
0
 def requestObjForVariable(self, typeNr, parentKey, variable):
     # request for the visualization objects panel
     self.__initVariable = variable
     requestNr = theGuiMsgHandler().requestObject(typeNr, None, parentKey)
     _infoer.write('requestObjForVariable (requestNr %s) ' % str(requestNr))
     # ATTENTION: the call requestObject returns AFTER new AddObj and Param signals are received.
     # => self.__newObjNr is set in addObjCB
     # HINT:  This timing can be different on different computers
     if self.__newObjReqNr == requestNr:
         Application.vrpApp.mw.raisePanelForKey(self.__newObjKey)
         self.__newObjReqNr = -1
Ejemplo n.º 23
0
 def requestObjForVariable( self, typeNr, parentKey, variable):
     # request for the visualization objects panel
     self.__initVariable = variable
     requestNr = theGuiMsgHandler().requestObject( typeNr, None, parentKey )
     _infoer.write('requestObjForVariable (requestNr %s) ' %  str(requestNr))
     # ATTENTION: the call requestObject returns AFTER new AddObj and Param signals are received. 
     # => self.__newObjNr is set in addObjCB
     # HINT:  This timing can be different on different computers
     if self.__newObjReqNr==requestNr:
         Application.vrpApp.mw.raisePanelForKey(self.__newObjKey)
         self.__newObjReqNr=-1
Ejemplo n.º 24
0
 def duplicatePart(self, objKey, rotX, rotY, rotZ, rotAngle, transX, transY,
                   transZ):
     # get the typ of the object
     typeNr = self.__objects[objKey].type
     # copy only 2d and 3d parts
     if not typeNr in [TYPE_2D_PART, TYPE_3D_PART]:
         return
     # get the parent of the object
     # parent means 2d_group odr 3d_group
     parent = self.getParentOfObject(objKey)
     while not (self.__objects[parent].type == TYPE_2D_GROUP
                or self.__objects[parent].type == TYPE_3D_GROUP):
         parent = self.getParentOfObject(parent)
     # get the name of the object
     name = self.getParamsOfObject(objKey).name
     # copy the params
     newParams = CopyParams(self.getParamsOfObject(objKey))
     # create new name with copy at the end
     newName = name + '(Copy)'
     i = 2
     while newName in self.__copyNames:
         newName = name + '(Copy ' + str(i) + ')'
         i = i + 1
     # set the new params
     newParams.name = newName
     newParams.rotX = rotX
     newParams.rotY = rotY
     newParams.rotZ = rotZ
     newParams.rotAngle = rotAngle
     if hasattr(newParams, 'transX'):
         newParams.transX = newParams.transX + transX
         newParams.transY = newParams.transY + transY
         newParams.transZ = newParams.transZ + transZ
     else:
         newParams.transX = transX
         newParams.transY = transY
         newParams.transZ = transZ
     # send duplicate message
     request = theGuiMsgHandler().requestDuplicateObject(
         objKey, newName, typeNr, None, parent, newParams)
     theGuiMsgHandler().waitforAnswer(request)
Ejemplo n.º 25
0
def createCasePanel(requestNr, typeNr, key, parentKey, params):
    print("create Case panel with key %s of parent %s " % (key, parentKey))
    global case_key1
    case_key1 = key
    theGuiMsgHandler().registerParamCallback(key, setCasePanelParams)
    theGuiMsgHandler().registerAddCallback(key, createGroupPanel)
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 26
0
def createCasePanel(requestNr, typeNr, key, parentKey, params):
    print("create Case panel with key %s of parent %s " % (key,parentKey))
    global case_key1
    case_key1 = key
    theGuiMsgHandler().registerParamCallback(key, setCasePanelParams)
    theGuiMsgHandler().registerAddCallback(key, createGroupPanel)
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 27
0
def createProjectPanel(requestNr, typeNr, key, parentKey, params):
    print("create project panel with key %s of parent %s " % (key,parentKey))
    global project_key
    project_key = key
    theGuiMsgHandler().registerParamCallback(key, setProjectPanelParams)
    theGuiMsgHandler().registerAddCallback(key, createCasePanel)
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 28
0
def createProjectPanel(requestNr, typeNr, key, parentKey, params):
    print("create project panel with key %s of parent %s " % (key, parentKey))
    global project_key
    project_key = key
    theGuiMsgHandler().registerParamCallback(key, setProjectPanelParams)
    theGuiMsgHandler().registerAddCallback(key, createCasePanel)
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 29
0
 def duplicatePart(self, objKey, rotX, rotY, rotZ, rotAngle, transX, transY, transZ):
     # get the typ of the object
     typeNr = self.__objects[objKey].type
     # copy only 2d and 3d parts
     if not typeNr in [TYPE_2D_PART, TYPE_3D_PART]:
         return
     # get the parent of the object
     # parent means 2d_group odr 3d_group
     parent = self.getParentOfObject(objKey)
     while not (self.__objects[parent].type == TYPE_2D_GROUP or self.__objects[parent].type == TYPE_3D_GROUP):
         parent = self.getParentOfObject(parent)
     # get the name of the object
     name = self.getParamsOfObject(objKey).name
     # copy the params 
     newParams = CopyParams(self.getParamsOfObject(objKey))
     # create new name with copy at the end
     newName = name + '(Copy)'
     i = 2
     while newName in self.__copyNames:
         newName = name+'(Copy '+str(i)+')'
         i = i+1
     # set the new params
     newParams.name = newName
     newParams.rotX = rotX
     newParams.rotY = rotY
     newParams.rotZ = rotZ
     newParams.rotAngle = rotAngle
     if hasattr(newParams, 'transX'):
         newParams.transX = newParams.transX + transX
         newParams.transY = newParams.transY + transY
         newParams.transZ = newParams.transZ + transZ
     else:
         newParams.transX = transX
         newParams.transY = transY
         newParams.transZ = transZ
     # send duplicate message
     request = theGuiMsgHandler().requestDuplicateObject( objKey, newName, typeNr, None, parent, newParams)
     theGuiMsgHandler().waitforAnswer(request)
Ejemplo n.º 30
0
 def duplicateVisualizer(self, objKey):
     # get the typ of the object
     typeNr = self.__objects[objKey].type
     # copy only 2d and 3d parts
     if not typeNr in [VIS_STREAMLINE, VIS_MOVING_POINTS, VIS_PATHLINES, VIS_ISOPLANE, VIS_VECTORFIELD, VIS_PLANE, VIS_VECTOR]:
         return
     # get the parent of the object
     parent = self.getParentOfObject(objKey)
     # get the name of the object
     name = self.getParamsOfObject(objKey).name
     # copy the params 
     newParams = CopyParams(self.getParamsOfObject(objKey))
     # create new name with copy at the end
     newName = name + '(Copy)'
     i = 2
     while newName in self.__copyNames:
         newName = name+'(Copy '+str(i)+')'
         i = i+1
     # set the new params
     newParams.name = newName
     # send duplicate message
     request = theGuiMsgHandler().requestDuplicateObject( objKey, newName, typeNr, None, parent, newParams)
     theGuiMsgHandler().waitforAnswer(request)
Ejemplo n.º 31
0
def testCAD():
    """test reading covise"""
    keepReference = QApplication(sys.argv)
    initHandlers()
    g = theGuiMsgHandler()

    g.registerAddCallback(SESSION_KEY, createProjectPanel)
    reqId = g.requestObject(TYPE_PROJECT)
    g.waitforAnswer(reqId)

    time.sleep(2)

    reqId = g.requestObject(TYPE_CAD_PRODUCT, None, project_key)
    g.waitforAnswer(reqId)

    print("ICI")
    coviseP = coCADMgrParams()
    coviseP.filename = '/data/Kunden/Kaercher/catiav5/Wagen/Reifen.CATPart'
    reqId = g.setParams(4, coviseP)

    reqId = theGuiMsgHandler().requestObject(VIS_2D_RAW, None, 5)
    g.waitforAnswer(reqId)

    g.runObject(4)
Ejemplo n.º 32
0
def testCAD():
    """test reading covise"""
    keepReference = QApplication(sys.argv)
    initHandlers()
    g = theGuiMsgHandler()

    g.registerAddCallback(SESSION_KEY, createProjectPanel)
    reqId = g.requestObject(TYPE_PROJECT)
    g.waitforAnswer(reqId)

    time.sleep(2)

    reqId = g.requestObject(TYPE_CAD_PRODUCT, None, project_key)
    g.waitforAnswer(reqId)

    print("ICI")
    coviseP = coCADMgrParams()
    coviseP.filename = '/data/Kunden/Kaercher/catiav5/Wagen/Reifen.CATPart'
    reqId = g.setParams(4, coviseP)

    reqId = theGuiMsgHandler().requestObject( VIS_2D_RAW, None, 5 )
    g.waitforAnswer(reqId)

    g.runObject(4)
Ejemplo n.º 33
0
 def importFile(self, filename):
     self.newCoviseFileName = filename
     if filename.lower().endswith('.covise'):
         theGuiMsgHandler().requestObject(VIS_COVISE,
                                          callback=None,
                                          parentKey=self.__projectKey)
     elif filename.lower().endswith('.tif') or filename.lower().endswith(
             '.tiff') or filename.lower().endswith('.png'):
         theGuiMsgHandler().requestObject(VIS_DOCUMENT,
                                          callback=None,
                                          parentKey=self.__projectKey)
     elif filename.lower().endswith('.coxml'):
         theGuiMsgHandler().requestObject(VIS_SCENE_OBJECT,
                                          callback=None,
                                          parentKey=self.__projectKey)
     else:
         theGuiMsgHandler().requestObject(VIS_VRML,
                                          callback=None,
                                          parentKey=self.__projectKey)
Ejemplo n.º 34
0
def testCovise():
    """test reading covise"""
    keepReference = QApplication(sys.argv)

    initHandlers()

    g = theGuiMsgHandler()

    g.registerAddCallback(SESSION_KEY, createProjectPanel)
    reqId = g.requestObject(TYPE_PROJECT)
    g.waitforAnswer(reqId)

    reqId = g.requestObject(VIS_COVISE, None, project_key)
    g.waitforAnswer(reqId)

    coviseP = CoviseVisParams()
    coviseP.grid_path = '/data/general/examples/Covise/airbag.covise'
    g.setParams(case_key1, coviseP)
    g.runObject(case_key1)

    theNet().save("/work/ko_te/testCovise.net")
Ejemplo n.º 35
0
def testVRML():
    """test reading vrml"""
    keepReference = QApplication(sys.argv)

    initHandlers()

    g = theGuiMsgHandler()

    g.registerAddCallback(SESSION_KEY, createProjectPanel)
    reqId = g.requestObject(TYPE_PROJECT)
    g.waitforAnswer(reqId)

    reqId = g.requestObject(VIS_VRML, None, project_key)
    g.waitforAnswer(reqId)

    vrmlP = VrmlVisParams()
    vrmlP.modelPath = '/work/ko_te/test.wrl'
    g.setParams(case_key1, vrmlP)
    g.runObject(case_key1)

    theNet().save("/work/ko_te/testVrml.net")
Ejemplo n.º 36
0
def testVRML():
    """test reading vrml"""
    keepReference = QApplication(sys.argv)

    initHandlers()

    g = theGuiMsgHandler()

    g.registerAddCallback(SESSION_KEY, createProjectPanel)
    reqId = g.requestObject(TYPE_PROJECT)
    g.waitforAnswer(reqId)

    reqId = g.requestObject(VIS_VRML, None, project_key)
    g.waitforAnswer(reqId)

    vrmlP = VrmlVisParams()
    vrmlP.modelPath='/work/ko_te/test.wrl'
    g.setParams(case_key1, vrmlP)
    g.runObject(case_key1)

    theNet().save("/work/ko_te/testVrml.net")
Ejemplo n.º 37
0
def testCovise():
    """test reading covise"""
    keepReference = QApplication(sys.argv)

    initHandlers()

    g = theGuiMsgHandler()

    g.registerAddCallback(SESSION_KEY, createProjectPanel)
    reqId = g.requestObject(TYPE_PROJECT)
    g.waitforAnswer(reqId)

    reqId = g.requestObject(VIS_COVISE, None, project_key)
    g.waitforAnswer(reqId)

    coviseP = CoviseVisParams()
    coviseP.grid_path='/data/general/examples/Covise/airbag.covise'
    g.setParams(case_key1, coviseP)
    g.runObject(case_key1)

    theNet().save("/work/ko_te/testCovise.net")
Ejemplo n.º 38
0
def testDocument():
    """test reading covise"""
    keepReference = QApplication(sys.argv)

    initHandlers()

    g = theGuiMsgHandler()

    g.registerAddCallback(SESSION_KEY, createProjectPanel)
    reqId = g.requestObject(TYPE_PROJECT)
    g.waitforAnswer(reqId)

    time.sleep(2)

    reqId = g.requestObject(VIS_DOCUMENT, None, project_key)
    g.waitforAnswer(reqId)

    coviseP = coDocumentMgrParams()
    coviseP.pos = (100., 0., 100.)
    coviseP.isVisible = True
    coviseP.documentName = 'Mein Auge'
    coviseP.imageName = '/data/general/examples/Images/auge_blau.tif'
    g.setParams(4, coviseP)
Ejemplo n.º 39
0
def testDocument():
    """test reading covise"""
    keepReference = QApplication(sys.argv)

    initHandlers()

    g = theGuiMsgHandler()

    g.registerAddCallback(SESSION_KEY, createProjectPanel)
    reqId = g.requestObject(TYPE_PROJECT)
    g.waitforAnswer(reqId)

    time.sleep(2)

    reqId = g.requestObject(VIS_DOCUMENT, None, project_key)
    g.waitforAnswer(reqId)

    coviseP = coDocumentMgrParams()
    coviseP.pos = (100., 0., 100.)
    coviseP.isVisible = True
    coviseP.documentName = 'Mein Auge'
    coviseP.imageName    = '/data/general/examples/Images/auge_blau.tif'
    g.setParams(4, coviseP)
Ejemplo n.º 40
0
    def addObjCB (self, requestNr, typeNr, key, parentKey, params):
        """Set up right initializations when object key comes to existance.

        """
        _infoer.write('addObjCB(requestNr %s, typeNr %s, key %s, parentKey %s)  '
                      'Element has just been created.' % (
            str(requestNr), str(typeNr), str(key), str(parentKey)))
        self.__objects[key] = GuiObj( key, parentKey, typeNr )
        if requestNr>0:
            self.__newObjKey = key
            self.__newObjReqNr = requestNr

        # for compat
        Application.vrpApp.key2type[key] = typeNr

        theGuiMsgHandler().registerAddCallback(key, self.addObjCB)
        theGuiMsgHandler().registerDelCallback(key, self.deleteObjCB)
        theGuiMsgHandler().registerParamCallback(key, self.setParamsCB)
        theGuiMsgHandler().registerBBoxForChildrenCallback(key, self.setBBoxForChildrenCB)

        self.sigGuiObjectAdded.emit(key, parentKey, typeNr )

        # type depending actions
        if TYPE_PROJECT == typeNr:
            self.__projectKey = key
        elif TYPE_CASE == typeNr:
            self.__lastCaseKey = key
        elif TYPE_2D_PART == typeNr or TYPE_CAD_PART == typeNr:
            #move to negotiator    
            reqId = theGuiMsgHandler().requestObject(VIS_2D_RAW, parentKey=key , params=params)
            theGuiMsgHandler().waitforAnswer(reqId)
        elif TYPE_3D_PART == typeNr:
            #move to negotiator
            reqId = theGuiMsgHandler().requestObject(VIS_3D_BOUNDING_BOX, None, key, params=params)
            theGuiMsgHandler().waitforAnswer(reqId)
        elif TYPE_PRESENTATION == typeNr:
            self.__presentationKey = key
            Application.vrpApp.mw.presenterManager.setPresentationMgrKey(key)
        elif TYPE_JOURNAL == typeNr:
            Application.vrpApp.globalJournalMgrKey = key
        elif TYPE_PRESENTATION_STEP == typeNr:
            Application.vrpApp.mw.presenterManager.addStep(key)
        elif VIS_2D_RAW == typeNr:
            Application.vrpApp.visuKey2GuiKey[key] = parentKey
            Application.vrpApp.guiKey2visuKey[parentKey] = key
        elif VIS_3D_BOUNDING_BOX == typeNr:
            Application.vrpApp.visuKey2GuiKey[key] = parentKey
            Application.vrpApp.guiKey2visuKey[parentKey] = key
        elif TYPE_COLOR_TABLE==typeNr:
            Application.vrpApp.mw.globalColorManager().setNewKey(key)
            #VRPMainWindow.globalColorManager.setNewKey(key)  
        elif TYPE_VIEWPOINT_MGR == typeNr:
            self.__viepointMgrKey = key
            Application.vrpApp.mw.viewpointManager.setViewpointMgrKey(key)
        elif TYPE_TRACKING_MGR == typeNr:
            self.__trackingMgrKey = key
            Application.vrpApp.mw.trackingManager.setTrackingMgrKey(key)
        elif VIS_DOMAINLINES==typeNr: 
            theGuiMsgHandler().answerOk(requestNr)
            theGuiMsgHandler().runObject(key)
        theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 41
0
def setCaseParams(requestNr, key, params):
    setNameForObjectInTree(key, params.name)
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 42
0
def setCasePanelParams(requestNr, key, params):
    print("setCasePanelParams; name is now : %s " % params.name)
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 43
0
def testRequest():
    """Example for requesting something at the theGuiMsgHandler()."""
    keepReference = QApplication(sys.argv)

    initHandlers()

    g = theGuiMsgHandler()

    g.registerAddCallback(SESSION_KEY, createProjectPanel)
    reqId = g.requestObject(TYPE_PROJECT)
    g.waitforAnswer(reqId)

    reqId = g.requestObject(TYPE_CASE, None, project_key)
    g.waitforAnswer(reqId)

    caseP = coCaseMgrParams()
    nameAndCase = NameAndCoviseCase()
    nameAndCase.setFromFile('/work/common/Projekte/DC-CFDGui/datasets/'
                            'TINY/CoviseDaten/TINY.cocase')
    #nameAndCase.setFromFile(
    #        '/work/common/Projekte/DC-CFDGui/datasets/'
    #        'msport/CoviseDaten/msport.cocase')

    caseP.origDsc = caseP.filteredDsc = coviseCase2DimensionSeperatedCase(nameAndCase.case, nameAndCase.name, nameAndCase.pathToCaseFile)
    g.setParams(case_key1, caseP)

    # testing static coloring
    if testMode==VIS_2D_STATIC_COLOR:
        colP = Part2DStaticColorVisParams()
        colP.g = 0
        g.setParams( VisColor_key, colP )

        status()

        reqId = g.runObject( case_key1 )
        g.waitforAnswer(reqId)

        colP.r = 255
        colP.g = 0
        colP.b = 0
        g.setParams( VisColor_key, colP )
        g.runObject( case_key1 )


    #testing scalar coloring
    elif testMode==VIS_2D_SCALAR_COLOR:
        colP = Part2DScalarColorVisParams()
        colP.variable = scalar_variable
        g.setParams( VisColor_key, colP )
        g.runObject( case_key1 )

    elif testMode==VIS_STREAMLINE:
        streamP = PartStreamlineVisParams()
        streamP.variable = vector_variable
        """
        colorP = coColorCreator()
        ctableP = coColorTableParams()
        ctableP.min = 98
        ctableP.max = 100
        ctableP.colorMapIdx = 2

        ctable = coColorTable()
        ctable.params = ctableP
        colorP.params.colorTable = ctable
        streamP.colorCreator = colorP
        colorP.run(RUN_ALL)
        """
        g.setParams( Tracer_key, streamP )
        r = g.runObject( case_key1, RUN_OCT )
        g.waitforAnswer(r)
        g.runObject( Tracer_key )

        #g.saveObject(0, "/work/sk_te/test.coprj")
        theNet().save("/work/ko_te/testgui.net")
    
    elif testMode==VIS_STREAMLINE_2D:
        streamP = PartStreamline2DVisParams()
        streamP.variable = vector_variable
        streamP.alignedRectangle = Line3D()
        streamP.alignedRectangle.setStartEndPoint(0.1, -0.6, 0., 0.5, -0.8, 0. )
        
        g.setParams( Tracer_key, streamP )
        r = g.runObject( case_key1, RUN_OCT )
        g.waitforAnswer(r)
        g.runObject( Tracer_key )
        theNet().save("/work/sk_te/test.net")
        status()
        
    elif testMode==VIS_PLANE:
        planeP = PartPlaneVisParams()
        planeP.variable = vector_variable
        planeP.alignedRectangle.middle = (0, 0, 1)
        """
        colorP = coColorCreator()
        ctableP = coColorTableParams()
        ctableP.min = 98
        ctableP.max = 100
        ctableP.colorMapIdx = 2

        ctable = coColorTable()
        ctable.params = ctableP
        colorP.params.colorTable = ctable
        streamP.colorCreator = colorP
        colorP.run(RUN_ALL)
        """
        g.setParams( Tracer_key, planeP )
        r = g.runObject( case_key1, RUN_OCT )
        g.waitforAnswer(r)
        g.runObject( Tracer_key )

        #g.saveObject(0, "/work/ko_te/test.coprj")
        theNet().save("/work/ko_te/testgui.net")

    elif testMode==VIS_VECTOR:
        vectorP = PartVectorVisParams()
        vectorP.variable = vector_variable
        """
        colorP = coColorCreator()
        ctableP = coColorTableParams()
        ctableP.min = 98
        ctableP.max = 100
        ctableP.colorMapIdx = 2

        ctable = coColorTable()
        ctable.params = ctableP
        colorP.params.colorTable = ctable
        streamP.colorCreator = colorP
        colorP.run(RUN_ALL)
        """
        g.setParams( Tracer_key, vectorP )
        r = g.runObject( case_key1, RUN_OCT )
        g.waitforAnswer(r)
        g.runObject( Tracer_key )

        #g.saveObject(0, "/work/ko_te/test.coprj")
        theNet().save("/work/ko_te/testgui.net")

    elif testMode==VIS_ISOPLANE:
        isoplaneP = PartIsoSurfaceVisParams()
        isoplaneP.variable = vector_variable
        """
        colorP = coColorCreator()
        ctableP = coColorTableParams()
        ctableP.min = 98
        ctableP.max = 100
        ctableP.colorMapIdx = 2

        ctable = coColorTable()
        ctable.params = ctableP
        colorP.params.colorTable = ctable
        streamP.colorCreator = colorP
        colorP.run(RUN_ALL)
        """
        g.setParams( Tracer_key, isoplaneP )
        r = g.runObject( case_key1, RUN_OCT )
        g.waitforAnswer(r)
        g.runObject( Tracer_key )

        #g.saveObject(0, "/work/ko_te/test.coprj")
        theNet().save("/work/ko_te/testgui.net")

    else :
        status()
        g.runObject( case_key1 )
        vP = VisItemParams()
        vP.isVisible=True
        g.setParams( VisColor_key, vP )
        theNet().save("/work/sk_te/testgui.net")

    if False: # True:
        reqId = g.requestObject(TYPE_CASE, None, project_key)
        g.waitforAnswer(reqId)
        caseP = coCaseMgrParams()
        caseP.filename = (
            '/work/common/Projekte/DC-CFDGui/datasets/'
            'msport/CoviseDaten/msport.cocase')
        g.setParams(case_key1, caseP)
Ejemplo n.º 44
0
def setProjectPanelParams(requestNr, key, params):
    print("setProjectPanelParams; date is now : %s " % params.creation_date)
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 45
0
def createTracePanel(requestNr, typeNr, key, parentKey, params):
    print("create trace panel with key %s of parent %s " % (key, parentKey))
    global Tracer_key
    if Tracer_key == -1:
        Tracer_key = key
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 46
0
def createPartPanel(requestNr, typeNr, key, parentKey, params):
    print("create Part panel with key %s of parent %s " % (key, parentKey))
    global Part_Key
    global Part_Key_3D
    if Part_Key == -1:
        Part_Key = key
        if not (testMode == VIS_3D_BOUNDING_BOX or testMode == VIS_STREAMLINE
                or testMode == VIS_PLANE or testMode == VIS_VECTOR
                or testMode == VIS_ISOPLANE):
            if testMode == VIS_STREAMLINE_2D:
                theGuiMsgHandler().registerAddCallback(key, createTracePanel)
            else:
                theGuiMsgHandler().registerAddCallback(key,
                                                       createStaticColorVis)
            theGuiMsgHandler().registerParamCallback(key, setPartPanelParams)
            theGuiMsgHandler().answerOk(requestNr)
            # test object testMode
            reqId = theGuiMsgHandler().requestObject(testMode, None, Part_Key)
            theGuiMsgHandler().waitforAnswer(reqId)
    elif typeNr == TYPE_3D_PART:
        Part_Key_3D = key
        if not testMode == VIS_STREAMLINE_2D:
            if testMode == VIS_3D_BOUNDING_BOX or testMode == VIS_DOMAINLINES or testMode == VIS_STREAMLINE or testMode == VIS_PLANE or testMode == VIS_VECTOR or testMode == VIS_ISOPLANE:
                theGuiMsgHandler().registerParamCallback(
                    key, setPartPanelParams)
                if testMode == VIS_STREAMLINE or testMode == VIS_PLANE or testMode == VIS_VECTOR or testMode == VIS_ISOPLANE:
                    theGuiMsgHandler().registerAddCallback(
                        key, createTracePanel)
                reqId = theGuiMsgHandler().requestObject(testMode, None, key)
                theGuiMsgHandler().waitforAnswer(reqId)
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 47
0
def set3d_partParams(requestNr, key, params):
    global_tree.setItemData(key, params.name)
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 48
0
def childInitCB(requestNr, typeNr, key, parentKey):
    theGuiMsgHandler().registerAddCallback(key, childInitCB)
    if TYPE_PROJECT == typeNr:
        global project_key
        project_key = key
        pass
    elif TYPE_CASE == typeNr:
        global case_key
        case_key = key
        theGuiMsgHandler().registerParamCallback(key, setCaseParams)
        global_tree.insert(None, key, 'casefile-entry')
    elif TYPE_2D_GROUP == typeNr:
        theGuiMsgHandler().registerParamCallback(key, set2d_groupParams)
        global_tree.insert(parentKey, key, 'sub-casefile-entry')
    elif TYPE_3D_GROUP == typeNr:
        theGuiMsgHandler().registerParamCallback(key, set3d_groupParams)
        global_tree.insert(parentKey, key, 'sub-casefile-entry')
    elif TYPE_2D_PART == typeNr:
        theGuiMsgHandler().registerParamCallback(key, set2d_partParams)
        global_tree.insert(parentKey, key, 'sub-casefile-entry')
        # TODO  insert check box
    elif TYPE_3D_PART == typeNr:
        theGuiMsgHandler().registerParamCallback(key, set3d_partParams)
        global_tree.insert(parentKey, key, 'sub-casefile-entry')
        # TODO  insert check box
    else:
##         assert False, 'unknown type'
        print('HERE IS AN UNHANDLED OR UNKNOW TYPE.  (AND THIS IS IGNORED FOR NOW.)')
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 49
0
def setProjectPanelParams(requestNr, key, params):
    print("setProjectPanelParams; date is now : %s " % params.creation_date)
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 50
0
def testRequest():
    """Example for requesting something at the theGuiMsgHandler()."""
    keepReference = QApplication(sys.argv)

    initHandlers()

    g = theGuiMsgHandler()

    g.registerAddCallback(SESSION_KEY, createProjectPanel)
    reqId = g.requestObject(TYPE_PROJECT)
    g.waitforAnswer(reqId)

    reqId = g.requestObject(TYPE_CASE, None, project_key)
    g.waitforAnswer(reqId)

    caseP = coCaseMgrParams()
    nameAndCase = NameAndCoviseCase()
    nameAndCase.setFromFile('/work/common/Projekte/DC-CFDGui/datasets/'
                            'TINY/CoviseDaten/TINY.cocase')
    #nameAndCase.setFromFile(
    #        '/work/common/Projekte/DC-CFDGui/datasets/'
    #        'msport/CoviseDaten/msport.cocase')

    caseP.origDsc = caseP.filteredDsc = coviseCase2DimensionSeperatedCase(
        nameAndCase.case, nameAndCase.name, nameAndCase.pathToCaseFile)
    g.setParams(case_key1, caseP)

    # testing static coloring
    if testMode == VIS_2D_STATIC_COLOR:
        colP = Part2DStaticColorVisParams()
        colP.g = 0
        g.setParams(VisColor_key, colP)

        status()

        reqId = g.runObject(case_key1)
        g.waitforAnswer(reqId)

        colP.r = 255
        colP.g = 0
        colP.b = 0
        g.setParams(VisColor_key, colP)
        g.runObject(case_key1)

    #testing scalar coloring
    elif testMode == VIS_2D_SCALAR_COLOR:
        colP = Part2DScalarColorVisParams()
        colP.variable = scalar_variable
        g.setParams(VisColor_key, colP)
        g.runObject(case_key1)

    elif testMode == VIS_STREAMLINE:
        streamP = PartStreamlineVisParams()
        streamP.variable = vector_variable
        """
        colorP = coColorCreator()
        ctableP = coColorTableParams()
        ctableP.min = 98
        ctableP.max = 100
        ctableP.colorMapIdx = 2

        ctable = coColorTable()
        ctable.params = ctableP
        colorP.params.colorTable = ctable
        streamP.colorCreator = colorP
        colorP.run(RUN_ALL)
        """
        g.setParams(Tracer_key, streamP)
        r = g.runObject(case_key1, RUN_OCT)
        g.waitforAnswer(r)
        g.runObject(Tracer_key)

        #g.saveObject(0, "/work/sk_te/test.coprj")
        theNet().save("/work/ko_te/testgui.net")

    elif testMode == VIS_STREAMLINE_2D:
        streamP = PartStreamline2DVisParams()
        streamP.variable = vector_variable
        streamP.alignedRectangle = Line3D()
        streamP.alignedRectangle.setStartEndPoint(0.1, -0.6, 0., 0.5, -0.8, 0.)

        g.setParams(Tracer_key, streamP)
        r = g.runObject(case_key1, RUN_OCT)
        g.waitforAnswer(r)
        g.runObject(Tracer_key)
        theNet().save("/work/sk_te/test.net")
        status()

    elif testMode == VIS_PLANE:
        planeP = PartPlaneVisParams()
        planeP.variable = vector_variable
        planeP.alignedRectangle.middle = (0, 0, 1)
        """
        colorP = coColorCreator()
        ctableP = coColorTableParams()
        ctableP.min = 98
        ctableP.max = 100
        ctableP.colorMapIdx = 2

        ctable = coColorTable()
        ctable.params = ctableP
        colorP.params.colorTable = ctable
        streamP.colorCreator = colorP
        colorP.run(RUN_ALL)
        """
        g.setParams(Tracer_key, planeP)
        r = g.runObject(case_key1, RUN_OCT)
        g.waitforAnswer(r)
        g.runObject(Tracer_key)

        #g.saveObject(0, "/work/ko_te/test.coprj")
        theNet().save("/work/ko_te/testgui.net")

    elif testMode == VIS_VECTOR:
        vectorP = PartVectorVisParams()
        vectorP.variable = vector_variable
        """
        colorP = coColorCreator()
        ctableP = coColorTableParams()
        ctableP.min = 98
        ctableP.max = 100
        ctableP.colorMapIdx = 2

        ctable = coColorTable()
        ctable.params = ctableP
        colorP.params.colorTable = ctable
        streamP.colorCreator = colorP
        colorP.run(RUN_ALL)
        """
        g.setParams(Tracer_key, vectorP)
        r = g.runObject(case_key1, RUN_OCT)
        g.waitforAnswer(r)
        g.runObject(Tracer_key)

        #g.saveObject(0, "/work/ko_te/test.coprj")
        theNet().save("/work/ko_te/testgui.net")

    elif testMode == VIS_ISOPLANE:
        isoplaneP = PartIsoSurfaceVisParams()
        isoplaneP.variable = vector_variable
        """
        colorP = coColorCreator()
        ctableP = coColorTableParams()
        ctableP.min = 98
        ctableP.max = 100
        ctableP.colorMapIdx = 2

        ctable = coColorTable()
        ctable.params = ctableP
        colorP.params.colorTable = ctable
        streamP.colorCreator = colorP
        colorP.run(RUN_ALL)
        """
        g.setParams(Tracer_key, isoplaneP)
        r = g.runObject(case_key1, RUN_OCT)
        g.waitforAnswer(r)
        g.runObject(Tracer_key)

        #g.saveObject(0, "/work/ko_te/test.coprj")
        theNet().save("/work/ko_te/testgui.net")

    else:
        status()
        g.runObject(case_key1)
        vP = VisItemParams()
        vP.isVisible = True
        g.setParams(VisColor_key, vP)
        theNet().save("/work/sk_te/testgui.net")

    if False:  # True:
        reqId = g.requestObject(TYPE_CASE, None, project_key)
        g.waitforAnswer(reqId)
        caseP = coCaseMgrParams()
        caseP.filename = ('/work/common/Projekte/DC-CFDGui/datasets/'
                          'msport/CoviseDaten/msport.cocase')
        g.setParams(case_key1, caseP)
Ejemplo n.º 51
0
    def setParamsCB(self, requestNr, key, params):
        """ received params from negotiator """
        _infoer.write('setParamsCB(requestNr %s, key %s, paramName= %s)' %
                      (str(requestNr), str(key), str(params.name)))

        if not key in self.__objects:
            return

        self.__objects[key].params = params

        self.sigGuiParamChanged.emit(key)
        #for compatibility
        Application.vrpApp.key2params[key] = params
        typeNr = self.__objects[key].type

        if (typeNr in [
                TYPE_SCENEGRAPH_ITEM, TYPE_COLOR_CREATOR, TYPE_COLOR_MGR,
                VIS_DOMAINLINES, TYPE_SCENEGRAPH_MGR, TYPE_DNA_MGR,
                TYPE_DNA_ITEM, TYPE_GENERIC_OBJECT_MGR, TYPE_GENERIC_OBJECT,
                TYPE_JOURNAL_STEP, TYPE_PROJECT, TYPE_CASE, TYPE_2D_GROUP,
                TYPE_3D_GROUP, TYPE_2D_CUTGEOMETRY_PART
        ]):
            pass
        elif typeNr in [
                VIS_STREAMLINE, VIS_MOVING_POINTS, VIS_PATHLINES,
                VIS_STREAMLINE_2D, VIS_PLANE, VIS_VECTOR, VIS_ISOPLANE,
                VIS_ISOCUTTER, VIS_CLIPINTERVAL, VIS_VECTORFIELD,
                VIS_DOMAINSURFACE
        ]:  #, VIS_POINTPROBING, VIS_MAGMATRACE
            #Application.vrpApp.mw.raisePanelForKey(key)
            theGuiMsgHandler().answerOk(requestNr)
            self.checkForUpdate(key, params)
        elif TYPE_CAD_PART == typeNr:  #TYPE_2D_PART == typeNr or
            """ CAD Change"
            if hasattr(params, 'featureAngleDefault'):
                VRPMainWindow.tesselationPanel.setParams(key)
                VRPMainWindow.tesselationPanel.setParams(params)
            """
            # vis = VRPMainWindow.globalAccessToTreeView.getItemData(key).isChecked
            vis = False
            paramsForTree = NamedCheckable(params.name, vis)
            Application.vrpApp.key2params[key] = params
            #Application.vrpApp.mw.raisePanelForKey(key)
        elif TYPE_2D_PART == typeNr:
            self.__copyNames.append(params.name)
        elif TYPE_2D_COMPOSED_PART == typeNr:
            if self.__objects[key].params.name == 'Composed.2DPart':
                parentPanelParams = Application.vrpApp.mw.getPanelForKey(
                    self.getParentOfObject(key)).getParams()
                self.__objects[key].params.name = parentPanelParams.name
                self.__objects[key].params.subKeys = parentPanelParams.subKeys
                self.__objects[
                    key].params.definitions = parentPanelParams.definitions
                #VRPMainWindow.globalAccessToTreeView.setItemData(key, parentPanelParams.name)
                Application.vrpApp.mw.globalAccessToTreeView().setItemData(
                    key, parentPanelParams.name)
                theGuiMsgHandler().setParams(key, params)
            #Application.vrpApp.mw.raisePanelForKey(key)
            theGuiMsgHandler().answerOk(requestNr)
            theGuiMsgHandler().runObject(key)
        elif TYPE_3D_PART == typeNr:
            self.__copyNames.append(params.name)
        elif TYPE_3D_COMPOSED_PART == typeNr:
            if self.__objects[key].params.name == 'Composed.3DPart':
                parentPanelParams = Application.vrpApp.mw.getPanelForKey(
                    self.getParentOfObject(key)).getParams()
                self.__objects[key].params.name = parentPanelParams.name
                self.__objects[key].params.subKeys = parentPanelParams.subKeys
                self.__objects[
                    key].params.velDefinitions = parentPanelParams.velDefinitions
                #VRPMainWindow.globalAccessToTreeView.setItemData(key, parentPanelParams.name)
                Application.vrpApp.mw.globalAccessToTreeView().setItemData(
                    key, parentPanelParams.name)
                theGuiMsgHandler().setParams(key, params)
            #Application.vrpApp.mw.raisePanelForKey(key)
            theGuiMsgHandler().answerOk(requestNr)
            theGuiMsgHandler().runObject(key)
        elif TYPE_PRESENTATION == typeNr:
            Application.vrpApp.mw.presenterManager.updateForObject(key)
            #Application.vrpApp.mw.raisePanelForKey(key)
        elif TYPE_JOURNAL == typeNr:
            Application.vrpApp.globalJournalMgrParams = params
            """
            if params.currentIdx==params.maxIdx:
                Application.vrpApp.mw.editRedoAction.setEnabled(False)
                Application.vrpApp.mw.editUndoAction.setEnabled(True)
            else:
                Application.vrpApp.mw.editUndoAction.setEnabled(True)
                Application.vrpApp.mw.editRedoAction.setEnabled(True)
            if params.currentIdx<=0:
                Application.vrpApp.mw.editUndoAction.setEnabled(False)
            """
        elif TYPE_PRESENTATION_STEP == typeNr:
            Application.vrpApp.mw.presenterManager.setParams(key, params)
        elif TYPE_VIEWPOINT == typeNr:
            # do not add the default viewpoints to listview
            if not params.view == None and not params.view == 'default':
                Application.vrpApp.mw.viewpointManager.addViewpoint(key)
            Application.vrpApp.mw.viewpointManager.setParams(key, params)
            #VRPMainWindow.globalAccessToTreeView.setItemSelected(key, True)
        elif TYPE_VIEWPOINT_MGR == typeNr:
            Application.vrpApp.mw.viewpointManager.updateForObject(key)
        elif TYPE_TRACKING_MGR == typeNr:
            Application.vrpApp.mw.trackingManager.updateForObject(key)
        elif VIS_2D_RAW == typeNr:
            """ CAD Change
            paramsForTreeView = NamedCheckable(params.name, params.isVisible)
            VRPMainWindow.globalAccessToTreeView.setItemData(key, paramsForTreeView)
            """
            self.refactoringThing02(requestNr, key, params)
            self.checkForUpdate(key, params)
            #need to do this for copieing 2d parts
            self.setParams(key, params)
        elif VIS_3D_BOUNDING_BOX == typeNr:
            self.refactoringThing02(requestNr, key, params)
        elif VIS_COVISE == typeNr or VIS_DOCUMENT == typeNr or TYPE_CAD_PRODUCT == typeNr:
            if not self.newCoviseFileName == None:
                if hasattr(params, 'documentName'):
                    # check if document exists
                    filename = self.newCoviseFileName
                    if getExistingFilename(filename) == None:
                        raise CoviseFileNotFoundError(filename)

                    params.documentName = os.path.basename(
                        filename)  #(self.newCoviseFileName)
                    params.documentName = params.documentName[:len(
                        params.documentName) - 4]
                    params.imageName = filename  #self.newCoviseFileName
                    params.name = params.documentName
                else:
                    params.filename = self.newCoviseFileName
                    params.name = os.path.basename(self.newCoviseFileName)
                self.newCoviseFileName = None
            if hasattr(params, 'documentName'):
                #Application.vrpApp.mw.raisePanelForKey(key)
                theGuiMsgHandler().answerOk(requestNr)
                # check if document exists
                filename = params.imageName
                if getExistingFilename(filename) == None:
                    raise CoviseFileNotFoundError(filename)
                params.imageName = filename
            if hasattr(params, 'isVisible'):
                p = NamedCheckable(params.name, params.isVisible)
            else:
                p = params.name
            Application.vrpApp.mw.globalAccessToTreeView().setItemData(key, p)
            theGuiMsgHandler().setParams(key, params)
            theGuiMsgHandler().runObject(key)
        elif VIS_VRML == typeNr:
            if not self.newCoviseFileName == None:
                params.filename = self.newCoviseFileName
                params.name = os.path.basename(self.newCoviseFileName)
                self.newCoviseFileName = None
                theGuiMsgHandler().setParams(key, params)
            p = params.name
            Application.vrpApp.mw.globalAccessToTreeView().setItemData(key, p)
        elif VIS_SCENE_OBJECT == typeNr:
            if not self.newCoviseFileName == None:
                params.filename = self.newCoviseFileName
                params.name = os.path.basename(self.newCoviseFileName)
                self.newCoviseFileName = None
                theGuiMsgHandler().setParams(key, params)
                theGuiMsgHandler().runObject(key)
            p = params.name
            Application.vrpApp.mw.globalAccessToTreeView().setItemData(key, p)
        elif TYPE_COLOR_TABLE == typeNr:
            Application.vrpApp.mw.globalColorManager().setParams(key, params)
        else:
            assert False, 'unknown type'

        if key in Application.vrpApp.guiKey2visuKey:
            visKey = Application.vrpApp.guiKey2visuKey[key]
            self.__objects[visKey].params.name = params.name
            theGuiMsgHandler().setParams(visKey, self.__objects[visKey].params)

        theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 52
0
def set3d_partParams(requestNr, key, params):
    global_tree.setItemData(key, params.name)
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 53
0
def setCasePanelParams(requestNr, key, params):
    print("setCasePanelParams; name is now : %s " % params.name)
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 54
0
def createTracePanel( requestNr, typeNr, key, parentKey, params):
    print("create trace panel with key %s of parent %s " % (key,parentKey))
    global Tracer_key
    if Tracer_key==-1:
        Tracer_key = key
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 55
0
    def setParamsCB(self, requestNr, key, params):
        """ received params from negotiator """
        _infoer.write('setParamsCB(requestNr %s, key %s, paramName= %s)' % ( str(requestNr), str(key), str(params.name)))

        if not key in self.__objects:
            return

        self.__objects[key].params = params

        self.sigGuiParamChanged.emit(key )
        #for compatibility
        Application.vrpApp.key2params[key] = params
        typeNr = self.__objects[key].type

        if (typeNr in [TYPE_SCENEGRAPH_ITEM, TYPE_COLOR_CREATOR, TYPE_COLOR_MGR, VIS_DOMAINLINES, TYPE_SCENEGRAPH_MGR, TYPE_DNA_MGR, TYPE_DNA_ITEM, TYPE_GENERIC_OBJECT_MGR, TYPE_GENERIC_OBJECT, TYPE_JOURNAL_STEP, TYPE_PROJECT, TYPE_CASE, TYPE_2D_GROUP, TYPE_3D_GROUP, TYPE_2D_CUTGEOMETRY_PART]):
            pass
        elif typeNr in [VIS_STREAMLINE, VIS_MOVING_POINTS, VIS_PATHLINES, VIS_STREAMLINE_2D, VIS_PLANE, VIS_VECTOR, VIS_ISOPLANE, VIS_ISOCUTTER, VIS_CLIPINTERVAL, VIS_VECTORFIELD, VIS_DOMAINSURFACE]: #, VIS_POINTPROBING, VIS_MAGMATRACE
            #Application.vrpApp.mw.raisePanelForKey(key)
            theGuiMsgHandler().answerOk(requestNr)
            self.checkForUpdate( key, params)
        elif TYPE_CAD_PART == typeNr:#TYPE_2D_PART == typeNr or 
            """ CAD Change"
            if hasattr(params, 'featureAngleDefault'):
                VRPMainWindow.tesselationPanel.setParams(key)
                VRPMainWindow.tesselationPanel.setParams(params)
            """
            # vis = VRPMainWindow.globalAccessToTreeView.getItemData(key).isChecked
            vis = False
            paramsForTree = NamedCheckable(params.name, vis)
            Application.vrpApp.key2params[key] = params
            #Application.vrpApp.mw.raisePanelForKey(key)
        elif TYPE_2D_PART == typeNr:
            self.__copyNames.append(params.name)
        elif TYPE_2D_COMPOSED_PART == typeNr:
            if self.__objects[key].params.name == 'Composed.2DPart':
                parentPanelParams = Application.vrpApp.mw.getPanelForKey(self.getParentOfObject(key)).getParams()
                self.__objects[key].params.name = parentPanelParams.name
                self.__objects[key].params.subKeys = parentPanelParams.subKeys
                self.__objects[key].params.definitions = parentPanelParams.definitions
                #VRPMainWindow.globalAccessToTreeView.setItemData(key, parentPanelParams.name)
                Application.vrpApp.mw.globalAccessToTreeView().setItemData(key, parentPanelParams.name)
                theGuiMsgHandler().setParams( key, params )
            #Application.vrpApp.mw.raisePanelForKey(key)
            theGuiMsgHandler().answerOk(requestNr)
            theGuiMsgHandler().runObject(key)
        elif TYPE_3D_PART == typeNr:
            self.__copyNames.append(params.name)
        elif TYPE_3D_COMPOSED_PART == typeNr:
            if self.__objects[key].params.name == 'Composed.3DPart':
                parentPanelParams = Application.vrpApp.mw.getPanelForKey(self.getParentOfObject(key)).getParams()
                self.__objects[key].params.name = parentPanelParams.name
                self.__objects[key].params.subKeys = parentPanelParams.subKeys
                self.__objects[key].params.velDefinitions = parentPanelParams.velDefinitions
                #VRPMainWindow.globalAccessToTreeView.setItemData(key, parentPanelParams.name)
                Application.vrpApp.mw.globalAccessToTreeView().setItemData(key, parentPanelParams.name)
                theGuiMsgHandler().setParams( key, params )
            #Application.vrpApp.mw.raisePanelForKey(key)
            theGuiMsgHandler().answerOk(requestNr)
            theGuiMsgHandler().runObject(key)
        elif TYPE_PRESENTATION == typeNr:
            Application.vrpApp.mw.presenterManager.updateForObject(key)
            #Application.vrpApp.mw.raisePanelForKey(key)
        elif TYPE_JOURNAL == typeNr:
            Application.vrpApp.globalJournalMgrParams = params
            """
            if params.currentIdx==params.maxIdx:
                Application.vrpApp.mw.editRedoAction.setEnabled(False)
                Application.vrpApp.mw.editUndoAction.setEnabled(True)
            else:
                Application.vrpApp.mw.editUndoAction.setEnabled(True)
                Application.vrpApp.mw.editRedoAction.setEnabled(True)
            if params.currentIdx<=0:
                Application.vrpApp.mw.editUndoAction.setEnabled(False)
            """
        elif TYPE_PRESENTATION_STEP == typeNr:
            Application.vrpApp.mw.presenterManager.setParams( key, params )
        elif TYPE_VIEWPOINT == typeNr:
            # do not add the default viewpoints to listview
            if not params.view == None and not params.view == 'default':
                Application.vrpApp.mw.viewpointManager.addViewpoint(key)
            Application.vrpApp.mw.viewpointManager.setParams( key, params )
            #VRPMainWindow.globalAccessToTreeView.setItemSelected(key, True)
        elif TYPE_VIEWPOINT_MGR == typeNr: 
            Application.vrpApp.mw.viewpointManager.updateForObject(key)
        elif TYPE_TRACKING_MGR == typeNr: 
            Application.vrpApp.mw.trackingManager.updateForObject(key)
        elif VIS_2D_RAW == typeNr:
            """ CAD Change
            paramsForTreeView = NamedCheckable(params.name, params.isVisible)
            VRPMainWindow.globalAccessToTreeView.setItemData(key, paramsForTreeView)
            """
            self.refactoringThing02(requestNr, key, params)
            self.checkForUpdate( key, params)
            #need to do this for copieing 2d parts
            self.setParams(key, params)
        elif VIS_3D_BOUNDING_BOX == typeNr:
            self.refactoringThing02(requestNr, key, params)
        elif VIS_COVISE==typeNr or VIS_DOCUMENT==typeNr or TYPE_CAD_PRODUCT==typeNr:
            if not self.newCoviseFileName==None:
                if hasattr( params, 'documentName' ):
                    # check if document exists
                    filename = self.newCoviseFileName
                    if getExistingFilename(filename) == None:
                        raise CoviseFileNotFoundError(filename)

                    params.documentName = os.path.basename(filename)#(self.newCoviseFileName)
                    params.documentName = params.documentName[:len(params.documentName)-4]
                    params.imageName = filename#self.newCoviseFileName
                    params.name = params.documentName
                else :
                    params.filename = self.newCoviseFileName
                    params.name = os.path.basename(self.newCoviseFileName)
                self.newCoviseFileName=None
            if hasattr( params, 'documentName' ):
                #Application.vrpApp.mw.raisePanelForKey(key)
                theGuiMsgHandler().answerOk(requestNr)
                # check if document exists
                filename = params.imageName
                if getExistingFilename(filename) == None:
                    raise CoviseFileNotFoundError(filename)
                params.imageName = filename
            if hasattr( params, 'isVisible'):
                p = NamedCheckable(params.name, params.isVisible)
            else:
                p = params.name
            Application.vrpApp.mw.globalAccessToTreeView().setItemData(key, p)
            theGuiMsgHandler().setParams( key, params )
            theGuiMsgHandler().runObject(key)
        elif VIS_VRML==typeNr:
            if not self.newCoviseFileName==None:
                params.filename = self.newCoviseFileName
                params.name = os.path.basename(self.newCoviseFileName)
                self.newCoviseFileName=None
                theGuiMsgHandler().setParams( key, params )
            p = params.name
            Application.vrpApp.mw.globalAccessToTreeView().setItemData(key, p)
        elif VIS_SCENE_OBJECT==typeNr:
            if not self.newCoviseFileName==None:
                params.filename = self.newCoviseFileName
                params.name = os.path.basename(self.newCoviseFileName)
                self.newCoviseFileName=None
                theGuiMsgHandler().setParams( key, params )
                theGuiMsgHandler().runObject(key)
            p = params.name
            Application.vrpApp.mw.globalAccessToTreeView().setItemData(key, p)
        elif TYPE_COLOR_TABLE==typeNr:
            Application.vrpApp.mw.globalColorManager().setParams( key, params)
        else:
            assert False, 'unknown type'

        if key in Application.vrpApp.guiKey2visuKey:
            visKey = Application.vrpApp.guiKey2visuKey[key]
            self.__objects[visKey].params.name = params.name
            theGuiMsgHandler().setParams( visKey, self.__objects[visKey].params )

        theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 56
0
def createStaticColorVis( requestNr, typeNr, key, parentKey, params):
    print("create static color panel with key %s of parent %s " % (key,parentKey))
    global VisColor_key
    if VisColor_key==-1:
        VisColor_key = key
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 57
0
def setCaseParams(requestNr, key, params):
    setNameForObjectInTree(key, params.name)
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 58
0
    def addObjCB(self, requestNr, typeNr, key, parentKey, params):
        """Set up right initializations when object key comes to existance.

        """
        _infoer.write(
            'addObjCB(requestNr %s, typeNr %s, key %s, parentKey %s)  '
            'Element has just been created.' %
            (str(requestNr), str(typeNr), str(key), str(parentKey)))
        self.__objects[key] = GuiObj(key, parentKey, typeNr)
        if requestNr > 0:
            self.__newObjKey = key
            self.__newObjReqNr = requestNr

        # for compat
        Application.vrpApp.key2type[key] = typeNr

        theGuiMsgHandler().registerAddCallback(key, self.addObjCB)
        theGuiMsgHandler().registerDelCallback(key, self.deleteObjCB)
        theGuiMsgHandler().registerParamCallback(key, self.setParamsCB)
        theGuiMsgHandler().registerBBoxForChildrenCallback(
            key, self.setBBoxForChildrenCB)

        self.sigGuiObjectAdded.emit(key, parentKey, typeNr)

        # type depending actions
        if TYPE_PROJECT == typeNr:
            self.__projectKey = key
        elif TYPE_CASE == typeNr:
            self.__lastCaseKey = key
        elif TYPE_2D_PART == typeNr or TYPE_CAD_PART == typeNr:
            #move to negotiator
            reqId = theGuiMsgHandler().requestObject(VIS_2D_RAW,
                                                     parentKey=key,
                                                     params=params)
            theGuiMsgHandler().waitforAnswer(reqId)
        elif TYPE_3D_PART == typeNr:
            #move to negotiator
            reqId = theGuiMsgHandler().requestObject(VIS_3D_BOUNDING_BOX,
                                                     None,
                                                     key,
                                                     params=params)
            theGuiMsgHandler().waitforAnswer(reqId)
        elif TYPE_PRESENTATION == typeNr:
            self.__presentationKey = key
            Application.vrpApp.mw.presenterManager.setPresentationMgrKey(key)
        elif TYPE_JOURNAL == typeNr:
            Application.vrpApp.globalJournalMgrKey = key
        elif TYPE_PRESENTATION_STEP == typeNr:
            Application.vrpApp.mw.presenterManager.addStep(key)
        elif VIS_2D_RAW == typeNr:
            Application.vrpApp.visuKey2GuiKey[key] = parentKey
            Application.vrpApp.guiKey2visuKey[parentKey] = key
        elif VIS_3D_BOUNDING_BOX == typeNr:
            Application.vrpApp.visuKey2GuiKey[key] = parentKey
            Application.vrpApp.guiKey2visuKey[parentKey] = key
        elif TYPE_COLOR_TABLE == typeNr:
            Application.vrpApp.mw.globalColorManager().setNewKey(key)
            #VRPMainWindow.globalColorManager.setNewKey(key)
        elif TYPE_VIEWPOINT_MGR == typeNr:
            self.__viepointMgrKey = key
            Application.vrpApp.mw.viewpointManager.setViewpointMgrKey(key)
        elif TYPE_TRACKING_MGR == typeNr:
            self.__trackingMgrKey = key
            Application.vrpApp.mw.trackingManager.setTrackingMgrKey(key)
        elif VIS_DOMAINLINES == typeNr:
            theGuiMsgHandler().answerOk(requestNr)
            theGuiMsgHandler().runObject(key)
        theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 59
0
def createPartPanel( requestNr, typeNr, key, parentKey, params):
    print("create Part panel with key %s of parent %s " % (key,parentKey))
    global Part_Key
    global Part_Key_3D
    if Part_Key==-1:
        Part_Key = key
        if not ( testMode==VIS_3D_BOUNDING_BOX or testMode==VIS_STREAMLINE or testMode==VIS_PLANE or testMode==VIS_VECTOR or testMode==VIS_ISOPLANE):
            if testMode==VIS_STREAMLINE_2D:
                theGuiMsgHandler().registerAddCallback(key, createTracePanel)
            else:
                theGuiMsgHandler().registerAddCallback(key, createStaticColorVis)
            theGuiMsgHandler().registerParamCallback(key, setPartPanelParams)
            theGuiMsgHandler().answerOk(requestNr)
            # test object testMode
            reqId = theGuiMsgHandler().requestObject(
                testMode, None, Part_Key )
            theGuiMsgHandler().waitforAnswer(reqId)
    elif typeNr==TYPE_3D_PART :
        Part_Key_3D = key
        if not testMode==VIS_STREAMLINE_2D:
            if testMode==VIS_3D_BOUNDING_BOX or testMode==VIS_DOMAINLINES or testMode==VIS_STREAMLINE or testMode==VIS_PLANE or testMode==VIS_VECTOR or testMode==VIS_ISOPLANE:
                theGuiMsgHandler().registerParamCallback(key, setPartPanelParams)
                if testMode==VIS_STREAMLINE or testMode==VIS_PLANE or testMode==VIS_VECTOR or testMode==VIS_ISOPLANE:
                    theGuiMsgHandler().registerAddCallback(key, createTracePanel)
                reqId = theGuiMsgHandler().requestObject(
                    testMode, None, key )
                theGuiMsgHandler().waitforAnswer(reqId)
    theGuiMsgHandler().answerOk(requestNr)
Ejemplo n.º 60
0
def childInitCB(requestNr, typeNr, key, parentKey):
    theGuiMsgHandler().registerAddCallback(key, childInitCB)
    if TYPE_PROJECT == typeNr:
        global project_key
        project_key = key
        pass
    elif TYPE_CASE == typeNr:
        global case_key
        case_key = key
        theGuiMsgHandler().registerParamCallback(key, setCaseParams)
        global_tree.insert(None, key, 'casefile-entry')
    elif TYPE_2D_GROUP == typeNr:
        theGuiMsgHandler().registerParamCallback(key, set2d_groupParams)
        global_tree.insert(parentKey, key, 'sub-casefile-entry')
    elif TYPE_3D_GROUP == typeNr:
        theGuiMsgHandler().registerParamCallback(key, set3d_groupParams)
        global_tree.insert(parentKey, key, 'sub-casefile-entry')
    elif TYPE_2D_PART == typeNr:
        theGuiMsgHandler().registerParamCallback(key, set2d_partParams)
        global_tree.insert(parentKey, key, 'sub-casefile-entry')
        # TODO  insert check box
    elif TYPE_3D_PART == typeNr:
        theGuiMsgHandler().registerParamCallback(key, set3d_partParams)
        global_tree.insert(parentKey, key, 'sub-casefile-entry')
        # TODO  insert check box
    else:
        ##         assert False, 'unknown type'
        print(
            'HERE IS AN UNHANDLED OR UNKNOW TYPE.  (AND THIS IS IGNORED FOR NOW.)'
        )
    theGuiMsgHandler().answerOk(requestNr)