欢迎来到天天文库
浏览记录
ID:40569994
大小:16.64 KB
页数:4页
时间:2019-08-04
《VTK大数据集操作》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、HowtohandlelargedatasetsinVTKOneofthechallengesinVTKistoefficientlyhandlelargedatasets.BydefaultVTKistunedtowardssmallerdatasets.Forlargedatasetsthereareacoupleofchangesyoucanmakethatshouldyieldamuchsmallermemoryfootprint(lessswapping)andalsoimproverenderingperformance.Theso
2、lutionisto:1.UseReleaseDataFlag,2.TurnonImmediateModeRendering3.UsetrianglestripsviavtkStripper4.UseadifferentfilterormapperEachofthesewillbediscussedbelow.UsingReleaseDataFlagBydefaultVTKkeepsacopyofallintermediateresultsbetweenfiltersinapipeline.Forapipelinewithfivefilters
3、thiscanresultinhavingsixcopiesofthedatainmemoryatonce.ThiscanbecontrolledusingReleaseDataFlagandGlobalReleaseDataFlag.IfReleaseDataFlagissettooneonadataobject,thenonceafilterhasfinishedusingthatdataobject,itwillreleaseitsmemory.Likewise,ifGlobalReleaseDataFlagissetonANYdatao
4、bject,alldataobjectswillreleasetheirmemoryoncetheirdependentfilterhasfinishedexecuting.ForexampleinTclandC++#TclvtkPolyDataReaderreader[readerGetOutput]ReleaseDataFlagOn//C++vtkPolyDataReader*reader=vtkPolyDataReader::New();reader->GetOutput()->ReleaseDataFlagOn();or//C++vtk
5、PolyDataReader*reader=vtkPolyDataReader::New();reader->GetOutput()->GlobalReleaseDataFlagOn();WhileturningontheReleaseDataFlagwillreduceyourmemoryfootprint,thedisadvantageisthatnoneoftheintermediateresultsarekeptinmemory.Soifyouinteractivelychangeaparameterofafilter(suchasth
6、eisosurfacevalue),allthefilterswillhavetore-executetoproducethenewresult.Whentheintermediateresultsarestoredinmemory,onlythedownstreamfilterswouldhavetore-execute.Onehintforgoodinteractiveperformance.Ifonlyonestageofthepipelinecanhaveitsparameterschangedinteractively(suchast
7、hetargetreductioninadecimationfilter),onlyretainthedatajustpriortothatstep(whichisthedefault)andturnReleaseDataFlagonforallothersteps.UseImmediateModeRenderingBydefault,VTKusesOpenGLdisplaylistswhichresultsinanothercopyofthedatabeingstoredinmemory.Formostlargedatasetsyouwill
8、bebetteroffsavingmemorybynotusingdisplaylists.Youcanturnoffdisplaylistsbytu
此文档下载收益归作者所有