def testTransientReduceSetData(self): moduleCount = theNet().moduleCount() gip_core = self._TransientGroup() gip = ImportGroupReduceSet(gip_core) gip.setReductionFactor(2) value = 'Pressure' c = Colors() theNet().add(c) connect(gip.dataConnectionPoint(value), ConnectionPoint(c, 'Data')) coll = Collect() theNet().add(coll) connect(gip.geoConnectionPoint(), ConnectionPoint(coll, 'grid')) theNet().connect(c, 'texture', coll, 'textures') theNet().connect(coll, 'geometry', globalRenderer()._module, 'RenderData') gip.executeGeo() gip.executeData(value) (a, b) = gip.getDataMinMax(value) self.assertEqual((a, b), (-0.018360999999999999, 2.0)) # delete theNet().remove(c) theNet().remove(coll) gip.delete() gip_core.delete() self._RemoveImportGroupModules() self.assertEqual(theNet().moduleCount(), moduleCount)
def __initBase(self): """ + __initBase is called from the constructor and after the class was unpickled + add privately created modules here """ self.__firstTime = True # create custom modules self.__myCollect = Collect() self.__myColors = Colors() theNet().add(self.__myCollect) theNet().add(self.__myColors)
def __init(self): """ start COVISE modules and connect output to COVER """ if self.__colors == None and self.__collect == None: self.__colors = Colors() theNet().add(self.__colors) self.__colorsIn = ConnectionPoint(self.__colors, 'GridIn0') self.__collect = Collect() theNet().add(self.__collect) self.__collectOut = ConnectionPoint(self.__collect, 'GeometryOut0') connect(self.importModule.geoConnectionPoint(), ConnectionPoint(self.__collect, 'GridIn0')) VisItem.connectToCover(self, self)
def testGroupData(gip): value = 'Temperature' c = Colors() theNet().add(c) connect( gip.dataConnectionPoint(value), ConnectionPoint( c, 'Data' ) ) gip.executeData(value) coll = Collect() theNet().add(coll) connect( gip.geoConnectionPoint(value), ConnectionPoint( coll, 'grid' ) ) theNet().connect( c, 'texture', coll, 'textures' ) r = Renderer() theNet().add(r) theNet().connect( coll, 'geometry', r, 'RenderData') c.execute()
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 testGroupData(self): moduleCount = theNet().moduleCount() gip = self._LargeSimpleGroup() value = 'Temperature' c = Colors() theNet().add(c) connect(gip.dataConnectionPoint(value), ConnectionPoint(c, 'Data')) coll = Collect() theNet().add(coll) connect(gip.geoConnectionPoint(), ConnectionPoint(coll, 'grid')) theNet().connect(c, 'texture', coll, 'textures') theNet().connect(coll, 'geometry', globalRenderer()._module, 'RenderData') gip.executeGeo() gip.executeData(value) # delete theNet().remove(c) theNet().remove(coll) gip.delete() self._RemoveImportGroupModules() self.assertEqual(theNet().moduleCount(), moduleCount)