def getBox(self, forceExecute = False): """ return the bounding box """ if self._bb==None: self._bb = BoundingBox() theNet().add( self._bb) connect( self.geoConnectionPoint(), ConnectionPoint( self._bb, 'GridIn0' ) ) # Clear info queue so we dont read a previous BB output. # (If something goes wrong with the queue, this could be the reason.) coviseStartup.globalReceiverThread.infoQueue.clear() if not self.executeGeo(): saveExecute(self._bb) boxParser = BoundingBoxParser() boxParser.parseQueue(coviseStartup.globalReceiverThread.infoQueue) self._boundingBox = boxParser.getBox() elif forceExecute: # Clear info queue so we dont read a previous BB output. # (If something goes wrong with the queue, this could be the reason.) coviseStartup.globalReceiverThread.infoQueue.clear() if not self.executeGeo(): saveExecute(self._bb) boxParser = BoundingBoxParser() boxParser.parseQueue(coviseStartup.globalReceiverThread.infoQueue) try: oldbb = self._boundingBox self._boundingBox = boxParser.getBox() except (ValueError): self._boundingBox = oldbb return self._boundingBox
def getBoxFromGeoRWCovise(self): """ return the bounding box from the originally unfiltered geometry """ if self.__boundingBoxFromGeoRWCovise == None: self.__bbFromGeoRWCovise = BoundingBox() theNet().add(self.__bbFromGeoRWCovise) connect( self._geo.connectionPoint(), ConnectionPoint(self.__bbFromGeoRWCovise, 'GridIn0')) # Clear info queue so we dont read a previous BB output. # (If something goes wrong with the queue, this could be the reason.) coviseStartup.globalReceiverThread.infoQueue_.clear() saveExecute(self.__bbFromGeoRWCovise) boxParser = BoundingBoxParser() boxParser.parseQueue(coviseStartup.globalReceiverThread.infoQueue_) self.__boundingBoxFromGeoRWCovise = boxParser.getBox() return self.__boundingBoxFromGeoRWCovise
def getBoxFromGeoRWCovise(self): """ return the bounding box from the originally unfiltered geometry """ if self.__boundingBoxFromGeoRWCovise == None: self.__bbFromGeoRWCovise = BoundingBox() theNet().add(self.__bbFromGeoRWCovise) connect(self._geo.connectionPoint(), ConnectionPoint(self.__bbFromGeoRWCovise, 'GridIn0')) # Clear info queue so we dont read a previous BB output. # (If something goes wrong with the queue, this could be the reason.) coviseStartup.globalReceiverThread.infoQueue_.clear() saveExecute(self.__bbFromGeoRWCovise) boxParser = BoundingBoxParser() boxParser.parseQueue(coviseStartup.globalReceiverThread.infoQueue_) self.__boundingBoxFromGeoRWCovise = boxParser.getBox() return self.__boundingBoxFromGeoRWCovise