예제 #1
0
파일: VrmlVis.py 프로젝트: nixz/covise
    def setParams(self, params, negMsgHandler=None, sendToCover=True):
        """ set parameters from outside """
        _infoer.function = str(self.setParams)
        _infoer.write("setParams")

        if not params.isVisible == self.params.isVisible:
            if params.isVisible and not self.__connected:
                connect(self.connectionPoint(), globalRenderer().connectionPoint())
                self.__connected = True
            elif not params.isVisible and self.__connected:
                disconnect(self.connectionPoint(), globalRenderer().connectionPoint())
                self.__connected = False

        realChange = ParamsDiff(self.params, params)
        VisItem.setParams(self, params, negMsgHandler, sendToCover)

        if params.clickedSensorID != None:
            msg = coGRObjSensorEventMsg(coGRMsg.SENSOR_EVENT, params.filename, params.clickedSensorID, True, True)
            covise.sendRendMsg(msg.c_str())
            msg = coGRObjSensorEventMsg(coGRMsg.SENSOR_EVENT, params.filename, params.clickedSensorID, True, False)
            covise.sendRendMsg(msg.c_str())

            # clickedSensorButtonEvent was handled and can be removed
            self.params.clickedSensorID = None
            self.sendParams()
예제 #2
0
    def setParams(self, params, negMsgHandler=None, sendToCover=True):
        """ set parameters from outside """
        _infoer.function = str(self.setParams)
        _infoer.write("setParams")

        if not params.isVisible == self.params.isVisible:
            if params.isVisible and not self.__connected:
                connect(self.connectionPoint(),
                        globalRenderer().connectionPoint())
                self.__connected = True
            elif not params.isVisible and self.__connected:
                disconnect(self.connectionPoint(),
                           globalRenderer().connectionPoint())
                self.__connected = False

        realChange = ParamsDiff(self.params, params)
        VisItem.setParams(self, params, negMsgHandler, sendToCover)

        if params.clickedSensorID != None:
            msg = coGRObjSensorEventMsg(coGRMsg.SENSOR_EVENT, params.filename,
                                        params.clickedSensorID, True, True)
            covise.sendRendMsg(msg.c_str())
            msg = coGRObjSensorEventMsg(coGRMsg.SENSOR_EVENT, params.filename,
                                        params.clickedSensorID, True, False)
            covise.sendRendMsg(msg.c_str())

            # clickedSensorButtonEvent was handled and can be removed
            self.params.clickedSensorID = None
            self.sendParams()
예제 #3
0
def suite():
    def loadTests(testCaseClass):
        return unittest.defaultTestLoader.loadTestsFromTestCase(testCaseClass)

    # Create Renderer (Use VRPCoviseNetAccess._globalRenderer, so saveExecute works correctly)
    globalRenderer()
    # Use the same Renderer for all tests!
    # There seems to be a problem when creating and deleting a Renderer for each test individually.
    # If the Renderer is deleted immediatelly after the test, the finishedBarrier doesn't work anymore.
    # (Maybe that's because the Renderer is still receiving geometry while it's beeing removed.)

    testSuite = unittest.TestSuite()
    testSuite.addTests(loadTests(ImportModuleTestCase))

    return testSuite
예제 #4
0
def suite():
    def loadTests(testCaseClass):
        return unittest.defaultTestLoader.loadTestsFromTestCase(testCaseClass)

    # Create Renderer (Use VRPCoviseNetAccess._globalRenderer, so saveExecute works correctly)
    globalRenderer()
    # Use the same Renderer for all tests!
    # There seems to be a problem when creating and deleting a Renderer for each test individually.
    # If the Renderer is deleted immediatelly after the test, the finishedBarrier doesn't work anymore.
    # (Maybe that's because the Renderer is still receiving geometry while it's beeing removed.)

    testSuite = unittest.TestSuite()
    testSuite.addTests(loadTests(ImportModuleTestCase))

    return testSuite
예제 #5
0
 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)
예제 #6
0
 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)
예제 #7
0
파일: VisItem.py 프로젝트: nixz/covise
    def connectToCover( self, visConnectionModule ):
        self.__creationModule = visConnectionModule
        VRPCoviseNetAccess.connect(
            visConnectionModule.connectionPoint(),
            globalRenderer().connectionPoint() )

        if os.getenv('VR_PREPARE_DEBUG_VISITEMS_DIR'):
            #filename = os.getenv('VR_PREPARE_DEBUG_VISITEMS_DIR') + '/' + self.params.name + "_%s.covise" % self.key
            #rw = RWCoviseModule(filename, True)
            #filename = rw.gridPath()
            #connect( visConnectionModule.connectionPoint(), rw.inConnectionPoint() )
            filename = os.getenv('VR_PREPARE_DEBUG_VISITEMS_DIR') + '/' \
                       + self.params.name + "_" + str(self.key) + ".covise"
            self.__debugRwModule = RWCoviseModule(filename, True)
            connect( visConnectionModule.connectionPoint(), self.__debugRwModule.inConnectionPoint() )
예제 #8
0
파일: VisItem.py 프로젝트: zyzwhdx/covise
    def connectToCover(self, visConnectionModule):
        self.__creationModule = visConnectionModule
        VRPCoviseNetAccess.connect(visConnectionModule.connectionPoint(),
                                   globalRenderer().connectionPoint())

        if os.getenv('VR_PREPARE_DEBUG_VISITEMS_DIR'):
            #filename = os.getenv('VR_PREPARE_DEBUG_VISITEMS_DIR') + '/' + self.params.name + "_%s.covise" % self.key
            #rw = RWCoviseModule(filename, True)
            #filename = rw.gridPath()
            #connect( visConnectionModule.connectionPoint(), rw.inConnectionPoint() )
            filename = os.getenv('VR_PREPARE_DEBUG_VISITEMS_DIR') + '/' \
                       + self.params.name + "_" + str(self.key) + ".covise"
            self.__debugRwModule = RWCoviseModule(filename, True)
            connect(visConnectionModule.connectionPoint(),
                    self.__debugRwModule.inConnectionPoint())
예제 #9
0
 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)
예제 #10
0
 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)
예제 #11
0
파일: VisItem.py 프로젝트: nixz/covise
 def disconnectFromCover(self, visConnectionModule):
     coverModule = globalRenderer().connectionPoint().module
     visItemModule = visConnectionModule.connectionPoint().module
     theNet().disconnectModuleModule(coverModule, visItemModule)
예제 #12
0
파일: VisItem.py 프로젝트: zyzwhdx/covise
 def disconnectFromCover(self, visConnectionModule):
     coverModule = globalRenderer().connectionPoint().module
     visItemModule = visConnectionModule.connectionPoint().module
     theNet().disconnectModuleModule(coverModule, visItemModule)