示例#1
0
    def recreate(self, negMsgHandler, parentKey, offset):
        coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
        coGenericObjectParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class

        # The path is missing in old projects. Since the name was used before, we just copy it.
        if (self.params.path == ""):
            self.params.path = self.params.name
示例#2
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coTrackingMgrParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
     globalKeyHandler().globalTrackingMgrKey = self.key
     self.__readButtonConfig()
     self.__setupTimeout()
     self.sendParamsToCover()
示例#3
0
    def recreate(self, negMsgHandler, parentKey, offset):
        coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
        coGenericObjectParams.mergeDefaultParams(
            self.params)  # explicitly call mergeDefaultParams of this class

        # The path is missing in old projects. Since the name was used before, we just copy it.
        if (self.params.path == ""):
            self.params.path = self.params.name
示例#4
0
    def recreate(self, negMsgHandler, parentKey, offset):
        coProjectMgrParams.mergeDefaultParams(
            self.params)  # explicitly call mergeDefaultParams of this class
        # force overwriting of old globalKeyHandler
        globalKeyHandler(self.__keyHandler, (offset == 0))

        # work around
        """
        Utils.addServerHostFromConfig()
        """
        coKeydObject.recreate(self, negMsgHandler, parentKey, offset)

        existingTrackingManager = False
        existingDNAManager = False
        existingGenericObjectManager = False

        for key in globalKeyHandler().getAllElements():
            obj = globalKeyHandler().getObject(key)
            if obj:
                # set crop min/max and selectionString (GetSubset) for all recreated parts of project
                if obj.typeNr in [TYPE_3D_PART, TYPE_2D_PART]:
                    # set params for import
                    globalKeyHandler().getObject(key).importModule.setCropMin(
                        self.params.cropMin[0], self.params.cropMin[1],
                        self.params.cropMin[2])
                    globalKeyHandler().getObject(key).importModule.setCropMax(
                        self.params.cropMax[0], self.params.cropMax[1],
                        self.params.cropMax[2])

                    if self.params.filterChoice == SELECTION_STRING:
                        globalKeyHandler().getObject(
                            key).importModule.setSelectionString(
                                self.params.selectionString)
                    if self.params.filterChoice == REDUCTION_FACTOR:
                        globalKeyHandler().getObject(
                            key).importModule.setReductionFactor(
                                self.params.reductionFactor)
                if obj.typeNr == TYPE_TRACKING_MGR:
                    existingTrackingManager = True
                if obj.typeNr == TYPE_DNA_MGR:
                    existingDNAManager = True
                if obj.typeNr == TYPE_GENERIC_OBJECT_MGR:
                    existingGenericObjectManager = True

        if not existingTrackingManager:  # create TrackingManager if it's an old project without TrackingManager
            negMsgHandler.internalRequestObjectDuringRecreate(
                TYPE_TRACKING_MGR, self.key)

        if not existingDNAManager:  # create DNAManager if it's an old project without TrackingManager
            negMsgHandler.internalRequestObjectDuringRecreate(
                TYPE_DNA_MGR, self.key)

        if not existingGenericObjectManager:  # create GenericObjectManager if it's an old project without GenericObjectManager
            negMsgHandler.internalRequestObjectDuringRecreate(
                TYPE_GENERIC_OBJECT_MGR, self.key)

        self.sendMessages()
示例#5
0
 def recreate(self, negMsgHandler, parentKey, offset):
     self.redFactor = False
     if not negMsgHandler.setReductionFactor:
         if not self.init( self.params.partcase ):
             raise  TimestepFoundError()
     else:
         self.init(self.params.partcase, negMsgHandler.reductionFactor)
     for visItem in self.objects:
         visItem.setImport( self.importModule )
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
示例#6
0
    def recreate(self, negMsgHandler, parentKey, offset):
        class Helper:
            pass
        helper = Helper()
        helper.filename = self.params.filename
        helper.index = self.params.index

        self.init( helper )
        for visItem in self.objects:
            visItem.setImport( self.importModule )
        coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
示例#7
0
    def recreate(self, negMsgHandler, parentKey, offset):
        class Helper:
            pass

        helper = Helper()
        helper.filename = self.params.filename
        helper.index = self.params.index

        self.init(helper)
        for visItem in self.objects:
            visItem.setImport(self.importModule)
        coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
示例#8
0
 def recreate(self, negMsgHandler, parentKey, offset):
     self.redFactor = False
     if not self.init( self.params.partcase ):
         if not negMsgHandler.setReductionFactor:
             raise  TimestepFoundError()
         else:
             self.setReductionFactor(negMsgHandler.reductionFactor)
     for visItem in self.objects:
         #check if visItem is a copy
         if not visItem.name == self.name and type(visItem) == Part3DBoundingBoxVis.Part3DBoundingBoxVis:
             visItem.setImport( self.importModule )
         elif  not type(visItem) == Part3DBoundingBoxVis.Part3DBoundingBoxVis and not type(visItem) == co3DPartMgr:
             visItem.setImport( self.importModule )
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
示例#9
0
    def recreate(self, negMsgHandler, parentKey, offset):
        coPresentationStepParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
        self.__correctParams()
        coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
        if offset>0:
            # change keys in params.status according to offset (i.e. add the offset)
            self.params.status = dict([(key+offset, value) for (key, value) in self.params.status.items()])

        # recreated presentation steps have unconfirmed viewpoints
        for k in self.params.status:
            params = self.params.status[k]
            if hasattr(params, 'view'):
                params.confirmed = False
        if self.params.timeout == 0:
            self.params.timeout = 10
示例#10
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coColorTableParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
     if (self.params.dependantKeys == None): # There are projects with dependantKeys==None instead of an empty list.
         self.params.dependantKeys = []      # We fix that here.
     savedList = self.params.colorMapList
     if len(savedList)==0 :
         savedList = coColorTableParams.defaultColorMapList ######["Standard", "Star", "ITMS", "Rainbow"]
     self.__initColorMapsFromConfig()
     if savedList and (self.params.colorMapIdx-1 >= 0) and (self.params.colorMapIdx-1 <= len(savedList)-1):
         if savedList[self.params.colorMapIdx-1] in self.params.colorMapList:
             self.params.colorMapIdx = self.params.colorMapList.index( savedList[self.params.colorMapIdx-1] )+1
     if offset>0 :
         for i in range( len(self.params.dependantKeys)):
             self.params.dependantKeys[i] += offset
         #check if species already exists
         self.params.name = globalKeyHandler().getObject(globalColorMgrKey).getRightName(self.params.species)
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
示例#11
0
    def recreate(self, negMsgHandler, parentKey, offset):
        coProjectMgrParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
        # force overwriting of old globalKeyHandler
        globalKeyHandler(self.__keyHandler, (offset==0) )

        # work around
        """
        Utils.addServerHostFromConfig()
        """
        coKeydObject.recreate(self, negMsgHandler, parentKey, offset)

        existingTrackingManager = False
        existingDNAManager = False
        existingGenericObjectManager = False

        for key in globalKeyHandler().getAllElements():
            obj = globalKeyHandler().getObject(key)
            if obj:
                # set crop min/max and selectionString (GetSubset) for all recreated parts of project
                if obj.typeNr in [TYPE_3D_PART, TYPE_2D_PART]:
                    # set params for import
                    globalKeyHandler().getObject(key).importModule.setCropMin(self.params.cropMin[0], self.params.cropMin[1], self.params.cropMin[2])
                    globalKeyHandler().getObject(key).importModule.setCropMax(self.params.cropMax[0], self.params.cropMax[1], self.params.cropMax[2])

                    if self.params.filterChoice == SELECTION_STRING:
                        globalKeyHandler().getObject(key).importModule.setSelectionString(self.params.selectionString)
                    if self.params.filterChoice == REDUCTION_FACTOR:
                        globalKeyHandler().getObject(key).importModule.setReductionFactor(self.params.reductionFactor)
                if obj.typeNr == TYPE_TRACKING_MGR:
                    existingTrackingManager = True
                if obj.typeNr == TYPE_DNA_MGR:
                    existingDNAManager = True
                if obj.typeNr == TYPE_GENERIC_OBJECT_MGR:
                    existingGenericObjectManager = True

        if not existingTrackingManager: # create TrackingManager if it's an old project without TrackingManager
            negMsgHandler.internalRequestObjectDuringRecreate(TYPE_TRACKING_MGR, self.key)

        if not existingDNAManager: # create DNAManager if it's an old project without TrackingManager
            negMsgHandler.internalRequestObjectDuringRecreate(TYPE_DNA_MGR, self.key)

        if not existingGenericObjectManager: # create GenericObjectManager if it's an old project without GenericObjectManager
            negMsgHandler.internalRequestObjectDuringRecreate(TYPE_GENERIC_OBJECT_MGR, self.key)

        self.sendMessages()
示例#12
0
 def recreate(self, negMsgHandler, parentKey, offset):
     self.redFactor = False
     if not self.init(self.params.partcase):
         if not negMsgHandler.setReductionFactor:
             raise TimestepFoundError()
         else:
             self.setReductionFactor(negMsgHandler.reductionFactor)
     for visItem in self.objects:
         #check if visItem is a copy
         if not visItem.name == self.name and type(
                 visItem) == Part3DBoundingBoxVis.Part3DBoundingBoxVis:
             visItem.setImport(self.importModule)
         elif not type(
                 visItem
         ) == Part3DBoundingBoxVis.Part3DBoundingBoxVis and not type(
                 visItem) == co3DPartMgr:
             visItem.setImport(self.importModule)
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
示例#13
0
    def recreate(self, negMsgHandler, parentKey, offset):
        coPresentationStepParams.mergeDefaultParams(
            self.params)  # explicitly call mergeDefaultParams of this class
        self.__correctParams()
        coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
        if offset > 0:
            # change keys in params.status according to offset (i.e. add the offset)
            self.params.status = dict([
                (key + offset, value)
                for (key, value) in self.params.status.items()
            ])

        # recreated presentation steps have unconfirmed viewpoints
        for k in self.params.status:
            params = self.params.status[k]
            if hasattr(params, 'view'):
                params.confirmed = False
        if self.params.timeout == 0:
            self.params.timeout = 10
示例#14
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coColorTableParams.mergeDefaultParams(
         self.params)  # explicitly call mergeDefaultParams of this class
     if (
             self.params.dependantKeys == None
     ):  # There are projects with dependantKeys==None instead of an empty list.
         self.params.dependantKeys = []  # We fix that here.
     savedList = self.params.colorMapList
     if len(savedList) == 0:
         savedList = coColorTableParams.defaultColorMapList  ######["Standard", "Star", "ITMS", "Rainbow"]
     self.__initColorMapsFromConfig()
     if savedList and (self.params.colorMapIdx - 1 >= 0) and (
             self.params.colorMapIdx - 1 <= len(savedList) - 1):
         if savedList[self.params.colorMapIdx -
                      1] in self.params.colorMapList:
             self.params.colorMapIdx = self.params.colorMapList.index(
                 savedList[self.params.colorMapIdx - 1]) + 1
     if offset > 0:
         for i in range(len(self.params.dependantKeys)):
             self.params.dependantKeys[i] += offset
         #check if species already exists
         self.params.name = globalKeyHandler().getObject(
             globalColorMgrKey).getRightName(self.params.species)
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
示例#15
0
文件: VisItem.py 项目: nixz/covise
 def recreate(self, negMsgHandler, parentKey, offset):
     VisItemParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
     self.__init()
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
示例#16
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     self.receivedParts = False
     self.partList = []
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
示例#17
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coGenericObjectMgrParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
     globalKeyHandler().globalGenericObjectMgrKey = self.key
示例#18
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
     globalKeyHandler().globalJournalMgrKey = self.key
示例#19
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
示例#20
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coPresentationMgrParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
     if offset>0 :
         globalKeyHandler().getObject(globalPresentationMgrKey).merge(self)
示例#21
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coCaseMgrParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
     if offset>0 :
         globalKeyHandler().getObject(0).addObject(self)
示例#22
0
文件: VisItem.py 项目: zyzwhdx/covise
 def recreate(self, negMsgHandler, parentKey, offset):
     VisItemParams.mergeDefaultParams(
         self.params)  # explicitly call mergeDefaultParams of this class
     self.__init()
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
示例#23
0
文件: coCADMgr.py 项目: nixz/covise
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     self.receivedParts = False
     self.partList = []
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
示例#24
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
     globalKeyHandler().globalJournalMgrKey = self.key
示例#25
0
 def recreate(self, negMsgHandler, parentKey, offset):        
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
     if offset>0 :
         globalKeyHandler().getObject(globalColorMgrKey).merge(self)
示例#26
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coPresentationMgrParams.mergeDefaultParams(
         self.params)  # explicitly call mergeDefaultParams of this class
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
     if offset > 0:
         globalKeyHandler().getObject(globalPresentationMgrKey).merge(self)
示例#27
0
 def recreate(self, negMsgHandler, parentKey, offset):
     self.importModule = None
     self.__initSubParts()
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
     for visItem in self.objects:
         visItem.setImport( self.importModule )
示例#28
0
 def recreate(self, negMsgHandler, parentKey, offset):
     self.importModule = None
     self.__initSubParts()
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
     for visItem in self.objects:
         visItem.setImport(self.importModule)
示例#29
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
示例#30
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
     if offset > 0:
         globalKeyHandler().getObject(globalColorMgrKey).merge(self)
示例#31
0
 def recreate(self, negMsgHandler, parentKey, offset):
     coGenericObjectMgrParams.mergeDefaultParams(
         self.params)  # explicitly call mergeDefaultParams of this class
     coKeydObject.recreate(self, negMsgHandler, parentKey, offset)
     globalKeyHandler().globalGenericObjectMgrKey = self.key