• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python vtk.vtkGenericEnSightReader函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中vtk.vtkGenericEnSightReader函数的典型用法代码示例。如果您正苦于以下问题:Python vtkGenericEnSightReader函数的具体用法?Python vtkGenericEnSightReader怎么用?Python vtkGenericEnSightReader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了vtkGenericEnSightReader函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: create_reader

 def create_reader (self): 
     "Create the corresponding reader."
     debug ("In VtkEnSightReader::create_reader ()")
     # set up the reader     
     if self.file_name == "":
         raise IOError, "No filename specifed for the data handler!"
     self.reader = vtk.vtkGenericEnSightReader()
开发者ID:sldion,项目名称:DNACC,代码行数:7,代码来源:VtkEnSightReader.py


示例2: __init__

 def __init__(self, module_manager):
     SimpleVTKClassModuleBase.__init__(
         self, module_manager,
         vtk.vtkGenericEnSightReader(), 'Reading vtkGenericEnSight.',
         (), ('vtkGenericEnSight',),
         replaceDoc=True,
         inputFunctions=None, outputFunctions=None)
开发者ID:fvpolpeta,项目名称:devide,代码行数:7,代码来源:vtkGenericEnSightReader.py


示例3: readData

    def readData(self, ntime = -1.):
        """
        Return the mesh vtkDataSet with the associated scalars for a single time step.
        """
        p = os.path.abspath(self.opt.f_name)
        path, case = os.path.dirname(p), os.path.basename(p)
        ens = vtk.vtkGenericEnSightReader()
        ens.SetByteOrderToLittleEndian()
        ens.SetFilePath(path)
        ens.SetCaseFileName(case)
        ens.ReadAllVariablesOn()
        ens.Update()

        times = ens.GetTimeSets().GetItem(0)

        # last result by default
        if ntime == -1.:
            ntime = times.GetSize() - 1

        ens.SetTimeValue(times.GetTuple1(ntime))
        ens.Update()
        return ens.GetOutput().GetBlock(0) # Now multiblock objet with 0 for volume, 1 for bord !
开发者ID:paulochon8616,项目名称:CS4.0-EDL,代码行数:22,代码来源:PlotVTK.py


示例4: readEnsightFile

    def readEnsightFile(self, fileName):
        """
        Read Ensight file. Writes a VTK file with fileName+'.vtk'.
        :param str filename: Input filename
        """
        #read the ensight file
        reader = vtk.vtkGenericEnSightReader()
        reader.SetCaseFileName(fileName)
        reader.Update()

        output = reader.GetOutput()
        num_blocks =  output.GetNumberOfBlocks()  

        #blocks_unstructured is a list of objects of vtkUnstructuredGrid
        blocks_unstructured = []
        for i in range(num_blocks):
            blocks_unstructured.append(output.GetBlock(i))

        appendFilter = vtk.vtkAppendFilter()
        i = 0
        while i < len(blocks_unstructured):
            if(vtk.VTK_MAJOR_VERSION <= 5):
                appendFilter.AddInput(blocks_unstructured[i])
            else:
                appendFilter.AddInputData(blocks_unstructured[i])
            i=i+1
        appendFilter.Update();

        unstructuredGrid=vtk.vtkUnstructuredGrid()
        unstructuredGrid.ShallowCopy(appendFilter.GetOutput());
        w = vtk.vtkUnstructuredGridWriter()
        if(vtk.VTK_MAJOR_VERSION <= 5):
            w.SetInput(unstructuredGrid)
        else:
            w.SetInputData(unstructuredGrid)
        w.SetFileName(fileName+'.vtk')
        w.Write()
        self.readVtkFile(fileName+'.vtk')
开发者ID:mmp-project,项目名称:mupif,代码行数:38,代码来源:EnsightReader.py


示例5: vtkGetDataRoot

#!/usr/bin/env python
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()

# create a rendering window and renderer
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
renWin.StereoCapableWindowOn()
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
reader = vtk.vtkGenericEnSightReader()
# Make sure all algorithms use the composite data pipeline
cdp = vtk.vtkCompositeDataPipeline()
reader.SetDefaultExecutivePrototype(cdp)
reader.SetCaseFileName("" + str(VTK_DATA_ROOT) + "/Data/EnSight/blow2_bin.case")
reader.SetTimeValue(1)
geom = vtk.vtkGeometryFilter()
geom.SetInputConnection(reader.GetOutputPort())
mapper = vtk.vtkHierarchicalPolyDataMapper()
mapper.SetInputConnection(geom.GetOutputPort())
mapper.SetColorModeToMapScalars()
mapper.SetScalarModeToUsePointFieldData()
mapper.ColorByArrayComponent("displacement",0)
mapper.SetScalarRange(0,2.08)
actor = vtk.vtkActor()
actor.SetMapper(mapper)
# assign our actor to the renderer
ren1.AddActor(actor)
# enable user interface interactor
开发者ID:ElsevierSoftwareX,项目名称:SOFTX-D-15-00004,代码行数:31,代码来源:EnSightBlow2Bin.py



注:本文中的vtk.vtkGenericEnSightReader函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python vtk.vtkGenericRenderWindowInteractor函数代码示例发布时间:2022-05-26
下一篇:
Python vtk.vtkFollower函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap