Exemplo n.º 1
0
    def __init(self):
        """ start COVISE ReadCAD Module """
        if self.__readCad == None:
            self.__readCad = ReadCAD()
            theNet().add(self.__readCad)
            self.__readCadPolyOut = ConnectionPoint(self.__readCad, 'mesh')
            self.__readCadNormalsOut = ConnectionPoint(self.__readCad,
                                                       'Normals')
            self.__readCadColorsOut = ConnectionPoint(self.__readCad,
                                                      'colorOut')
            self.__readCad.set_catia_server('obie')
            self.__readCad.set_catia_server_port('7000')
            self.__readCad.set_partIndex(self.__index)
            self.__readCad.set_file_path(self.__filename)

            self.__collect = Collect()
            theNet().add(self.__collect)
            connect(self.__readCadPolyOut,
                    ConnectionPoint(self.__collect, 'GridIn0'))
            connect(self.__readCadNormalsOut,
                    ConnectionPoint(self.__collect, 'DataIn1'))
            connect(self.__readCadColorsOut,
                    ConnectionPoint(self.__collect, 'DataIn0'))
            self.__connectGeoOut = ConnectionPoint(self.__collect,
                                                   'GeometryOut0')
Exemplo n.º 2
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)
Exemplo n.º 3
0
    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 here
        self.__myCollect = Collect()
        theNet().add(self.__myCollect)
Exemplo n.º 4
0
    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)
Exemplo n.º 5
0
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()
Exemplo n.º 6
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)