def run(self, runmode): _infoer.function = str(self.run) _infoer.write("go") self.__update() self.importModule.executeGeo() if not self.importModule.executeData(self.params.variable): saveExecute(self.__colors)
def executeData(self, varName): self.__initData(varName) # reconnect data if varName in self.__dataConnectionPoints.keys(): theNet().disconnectAllFromModulePort(self.__dataInConnectionPoints[varName].module, self.__dataInConnectionPoints[varName].port) theNet().connect(ParentClass.dataConnectionPoint(self, varName).module, ParentClass.dataConnectionPoint(self, varName).port, self.__dataInConnectionPoints[varName].module, self.__dataInConnectionPoints[varName].port) # reconnect geometry port theNet().disconnectAllFromModulePort(self.__dataInConnectionPoints[varName].module, 'GridIn0') theNet().connect(ParentClass.geoConnectionPoint(self).module, ParentClass.geoConnectionPoint(self).port, self.__dataInConnectionPoints[varName].module, 'GridIn0') # wenn voriges Modul tatsaechlich executed wurde, dann nicht mehr selbst executen if ParentClass.executeData(self, varName) == True: self.__needExecuteData[varName] = False return True if not self.__needExecuteData[varName]: return False self.__needExecuteData[varName] = False if varName in self.__dataInConnectionPoints.keys(): saveExecute(self.__dataInConnectionPoints[varName].module) return True
def run(self, runmode, negMsgHandler=None): if runmode == RUN_ALL: _infoer.function = str(self.run) _infoer.write("go") self.__update() if not self.__connected and self.params.isVisible: VisItem.connectToCover(self, self) self.__connected = True if not self.__loaded: saveExecute(self.performerScene) self.__loaded = True # dont auto-activate sensors in recreation if negMsgHandler and negMsgHandler.getInRecreation() == False: # bei run() die sensoren starten # wird (ausserhalb von recreate) nur vom presentation manager aufgerufen for sensorID in self.params.autoActiveSensorIDs: msg = coGRObjSensorEventMsg(coGRMsg.SENSOR_EVENT, self.params.filename, sensorID, True, True) covise.sendRendMsg(msg.c_str()) msg = coGRObjSensorEventMsg(coGRMsg.SENSOR_EVENT, self.params.filename, sensorID, True, False) covise.sendRendMsg(msg.c_str())
def executeData(self, varName): self.__initData(varName) # reconnect data if varName in self.__dataInConnectionPoints.keys(): theNet().disconnectAllFromModulePort( self.__dataInConnectionPoints[varName].module, self.__dataInConnectionPoints[varName].port) connect(ParentClass.dataConnectionPoint(self, varName), self.__dataInConnectionPoints[varName]) # wenn voriges Modul tatsaechlich executed wurde, dann nicht mehr selbst executen if ParentClass.executeData(self, varName) == True: self.__needExecuteData[varName] = False return True if not self.__needExecuteData[varName]: return False self.__needExecuteData[varName] = False if varName in self.__dataInConnectionPoints.keys(): saveExecute(self.__dataInConnectionPoints[varName].module) return True return False
def run(self, runmode, negMsgHandler): if os.getenv('VR_PREPARE_DEBUG_RUN'): print("PartModuleVis.run") ''' create a new visulisation + register for events from Covise if not done yet + runmode RUN_GEO and RUN_OCT are ignored + update module parameter should be done in parentClass + exec the module ''' #assert negMsgHandler if runmode==RUN_ALL: _infoer.function = str(self.run) _infoer.write("go") if not hasattr(self, 'importModule'): return self._update(negMsgHandler) # to be sure that the import module loaded all data if (self.__createOcttree): self.importModule.executeOct() geoExecuted = self.importModule.executeGeo() colorExecute = (hasattr(self.params, 'color') and self.params.color == VARIABLE) or (not hasattr(self.params, 'color')) if hasattr(self.params, 'variable') and self.params.variable and self.params.variable!='Select a variable' and self.params.variable != 'unset' and colorExecute: dataExecuted = self.importModule.executeData(self.params.variable) if not dataExecuted and not geoExecuted: saveExecute(self._module) elif self._dataInputNames==[] and not geoExecuted: saveExecute(self._module)
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 executeSampleData(self, varname, bbox=None, outside=USER_DEFINED): if not covise.coConfigIsOn("vr-prepare.UseSamplingModules", False): return self._updateSample(2, varname, bbox, outside) sample = self._sample saveExecute(sample)
def executeSampleGeo( self, dim ): if not covise.coConfigIsOn("vr-prepare.UseSamplingModules", False): return self._updateSample( dim ) # if not Import2DModule.executeGeo(self): if not ParentClass2D.executeGeo(self): saveExecute(self._sample)
def executeOct(self): self._initOct() if not self._oct_ready: if enableCachedOctTrees == True and self._octTreeFileExists == True: # cached octtrees aren't connected to the geo-RWCovise saveExecute(self._oct) elif not self.executeGeo(): saveExecute(self._oct) self._oct_ready = True return True return False
def run(self, runmode, negMsgHandler=None): if runmode == RUN_ALL: _infoer.function = str(self.run) _infoer.write("go") self.__update(negMsgHandler) if not self.__connected: VisItem.connectToCover(self, self) self.__connected = True if self.__loaded == None or self.__loaded != self.params.filename: saveExecute(self.rwCovise) self.__loaded = self.params.filename
def run(self, runmode, negMsgHandler=None): if runmode==RUN_ALL: _infoer.function = str(self.run) _infoer.write("go") self.__update() if not self.__connected :#and self.params.isVisible: VisItem.connectToCover( self, self ) self.__connected=True if not self.__loaded: saveExecute(self.coverDocument) self.__loaded=True
def run(self, runmode, negMsgHandler=None): if runmode == RUN_ALL: _infoer.function = str(self.run) _infoer.write("go") self.__update() if not self.__connected: #and self.params.isVisible: VisItem.connectToCover(self, self) self.__connected = True if not self.__loaded: saveExecute(self.coverDocument) self.__loaded = True
def executeSampleData(self, varname, bbox=None, outside=USER_DEFINED): if not covise.coConfigIsOn("vr-prepare.UseSamplingModules", False): return if bbox==None: if not (varname,outside) in self._bbox: self._bbox[(varname,outside)] = Box() box = self._bbox[(varname,outside)] else: box = bbox self._updateSample( varname, box, outside) sample = self._sample[(varname,outside)] saveExecute(sample)
def getDataMinMax( self, variable): """ return min and max value of variable """ if variable==None: return if self._minMax==None: self._minMax = Colors() theNet().add(self._minMax) theNet().disconnectAllFromModulePort( self._minMax, 'DataIn0' ) connect(self.dataConnectionPoint(variable), ConnectionPoint(self._minMax, 'DataIn0')) if not self.executeData( variable ): saveExecute(self._minMax) return ( float(self._minMax.getParamValue('MinMax')[0]),\ float(self._minMax.getParamValue('MinMax')[1]) )
def getDataMinMax(self, variable): """ return min and max value of variable """ if variable==None: return if self._minMax==None: self._minMax = Colors() theNet().add(self._minMax) theNet().disconnectAllFromModulePort( self._minMax, 'DataIn0' ) connect(self.dataConnectionPoint(variable), ConnectionPoint(self._minMax, 'DataIn0')) self.executeData( variable ) saveExecute(self._minMax) return ( float(self._minMax.getParamValue('MinMax')[0]),\ float(self._minMax.getParamValue('MinMax')[1]) )
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
def _initSample(self, varname=None, outside=USER_DEFINED): if self._sample==None: self._sample = Sample() theNet().add(self._sample) # connect( Import2DModule.geoConnectionPoint(self), ConnectionPoint(self._sample, 'GridIn') ) connect( ParentClass2D.geoConnectionPoint(self), ConnectionPoint(self._sample, 'GridIn') ) self._showgrid = ShowGrid() theNet().add(self._showgrid) connect( ConnectionPoint(self._sample, 'GridOut'), ConnectionPoint(self._showgrid, 'meshIn') ) sample = self._sample if not ParentClass2D.executeOct(self) and not ParentClass2D.executeData(self, varname): saveExecute(sample) # reconnect Sample # print "RECONNECTING 2D SAMPLE" theNet().disconnectAllFromModulePort(self._sample, 'GridIn') connect( ParentClass2D.geoConnectionPoint(self), ConnectionPoint(self._sample, 'GridIn') )
def executeGeo(self): self.__initGeo() # reconnect geometry if self.__geoInConnectionPoint != None: theNet().disconnectAllFromModulePort(self.__geoInConnectionPoint.module, self.__geoInConnectionPoint.port) connect(ParentClass.geoConnectionPoint(self), self.__geoInConnectionPoint) # wenn voriges Modul tatsaechlich executed wurde, dann nicht mehr selbst executen if ParentClass.executeGeo(self) == True: self.__needExecuteGeo = False return True if not self.__needExecuteGeo: return False self.__needExecuteGeo = False if self.__geoInConnectionPoint != None: saveExecute(self.__geoInConnectionPoint.module) return False
def _initSample( self, varname, outside ): if not (varname,outside) in self._sample: self._sample[(varname,outside)] = Sample() theNet().add(self._sample[(varname,outside)]) self._bbox[(varname,USER_DEFINED)] = Box() self._bbox[(varname,MAX_FLT)] = Box() # connect( Import3DModule.geoConnectionPoint(self), ConnectionPoint(self._sample[(varname,outside)], 'GridIn') ) # connect( Import3DModule.dataConnectionPoint(self, varname), ConnectionPoint(self._sample[(varname,outside)], 'DataIn') ) connect( ParentClass3D.geoConnectionPoint(self), ConnectionPoint(self._sample[(varname,outside)], 'GridIn') ) connect( ParentClass3D.dataConnectionPoint(self, varname), ConnectionPoint(self._sample[(varname,outside)], 'DataIn') ) sample = self._sample[(varname,outside)] sample.set_outside(outside) if not ParentClass3D.executeOct(self) and not ParentClass3D.executeData(self, varname): saveExecute(sample) # reconnect Sample # print "RECONNECTING 3D SAMPLE" theNet().disconnectAllFromModulePort(self._sample[(varname,outside)], 'GridIn') theNet().disconnectAllFromModulePort(self._sample[(varname,outside)], 'DataIn') connect( ParentClass3D.geoConnectionPoint(self), ConnectionPoint(self._sample[(varname,outside)], 'GridIn') ) connect( ParentClass3D.dataConnectionPoint(self, varname), ConnectionPoint(self._sample[(varname,outside)], 'DataIn') )
def executeGeo(self): self.__initGeo() # reconnect geometry if self.__geoInConnectionPoint != None: theNet().disconnectAllFromModulePort( self.__geoInConnectionPoint.module, self.__geoInConnectionPoint.port) connect(ParentClass.geoConnectionPoint(self), self.__geoInConnectionPoint) # wenn voriges Modul tatsaechlich executed wurde, dann nicht mehr selbst executen if ParentClass.executeGeo(self) == True: self.__needExecuteGeo = False return True if not self.__needExecuteGeo: return False self.__needExecuteGeo = False if self.__geoInConnectionPoint != None: saveExecute(self.__geoInConnectionPoint.module) return False
def run(self, runmode, negMsgHandler): if os.getenv('VR_PREPARE_DEBUG_RUN'): print("PartModuleVis.run") ''' create a new visulisation + register for events from Covise if not done yet + runmode RUN_GEO and RUN_OCT are ignored + update module parameter should be done in parentClass + exec the module ''' #assert negMsgHandler if runmode == RUN_ALL: _infoer.function = str(self.run) _infoer.write("go") if not hasattr(self, 'importModule'): return self._update(negMsgHandler) # to be sure that the import module loaded all data if (self.__createOcttree): self.importModule.executeOct() geoExecuted = self.importModule.executeGeo() colorExecute = (hasattr(self.params, 'color') and self.params.color == VARIABLE) or (not hasattr(self.params, 'color')) if hasattr( self.params, 'variable' ) and self.params.variable and self.params.variable != 'Select a variable' and self.params.variable != 'unset' and colorExecute: dataExecuted = self.importModule.executeData( self.params.variable) if not dataExecuted and not geoExecuted: saveExecute(self._module) elif self._dataInputNames == [] and not geoExecuted: saveExecute(self._module)
def run(self, runmode): _infoer.function = str(self.run) _infoer.write("go") self.__update() if not self.importModule.executeGeo(): saveExecute(self.__addAttribute)
def execute(self): self.__init() saveExecute(self.__readCad)
def executeOct(self): self.octTreeConnectionPoint() saveExecute(self._oct)