def stopProcessVisibility(self, clearAll=False, event=None):
        self.ignore(self.cr.StopVisibilityEvent)
        taskMgr.remove(self.taskName("processVisibility"))
        if event is not None:
            eventGroup = EventGroup('DistCartesianGrid.stopProcessVis',
                                    doneEvent=event)
        if self.gridVisContext is not None:
            if event is not None:
                removeEvent = eventGroup.newEvent('%s.removeInterest' %
                                                  self.doId)
            else:
                removeEvent = None
            self.cr.removeInterest(self.gridVisContext, removeEvent)
            self.gridVisContext = None
        else:
            # if we were given an event but we have not interest open,
            # just send the event right away
            if event is not None:
                messenger.send(event)
        self.visAvatar = None
        self.visZone = None

        # sometimes we also need to remove vis avatar from
        # my parent if it is also a grid
        if (clearAll):
            if event is not None:
                parentEvent = eventGroup.newEvent('%s.parent.removeInterest' %
                                                  self.doId)
            else:
                parentEvent = None

            ##HACK BANDAID FOR PVP INSTANCES
            if (hasattr(self.cr.doId2do[self.parentId], "worldGrid")):
                self.cr.doId2do[self.parentId].worldGrid.stopProcessVisibility(
                    event=parentEvent)
Exemple #2
0
 def __init__(self, interestMgr, name, doneEvent=None,
              recurse=True, start=True, mustCollect=False, doCollectionMgr=None):
     DirectObject.__init__(self)
     self._interestMgr = interestMgr
     if doCollectionMgr is None:
         doCollectionMgr = interestMgr
     self._doCollectionMgr = doCollectionMgr
     self._eGroup = EventGroup(name, doneEvent=doneEvent)
     self._doneEvent = self._eGroup.getDoneEvent()
     self._gotEvent = False
     self._recurse = recurse
     if self._recurse:
         # this will hold a dict of parentId to set(zoneIds) that are closing
         self.closingParent2zones = {}
     if start:
         self.startCollect(mustCollect)