vtk

VTKCamera difference between focal point and position

試著忘記壹切 提交于 2019-12-05 12:32:09
I am using the vtkCamera and would am trying to move it around and make it look at a certain point. For example, if I want to put the camera at position (x,y,z) and make it look at (0,0,0) for example with gluLookAt in openGL we would set the eye coordinates to (x,y,z) and the centre coordinates to (0,0,0) and the up vector to (0,1,0) . In vtk however, using the vtkCamera we have three separate methods, namely setPosition , setFocalPoint and setViewUp my question is what do setPositon and setFocalPoint correspond to? Thanks setPosition corresponds to eye coordinates. setFocalPoint corresponds

ITK, VTK, QT 安装与配置问题记录

放肆的年华 提交于 2019-12-05 11:47:14
问题参考: 问题一:配置完成,运行程序总提示缺少ITKCommon4_*.dll,QVTK.dll等问题: 一 般这种情况是找不到dll所在的路径,环境变量没有设置。在环境变量_path中加入ITK,VTK的bin路径,这样一般就没有什么问题了。bin路径就是自己编译时设置的INSTALL_PREFIX下的bin。 (原以为这些路径的事情Cmake里已经配置了,我还是想多了;为此我还去看了findITK.cmake这类的文件,他确实让VS在编译的时候能够从ITKSrc/Build(Cmake编译处的项目)下寻找了Debug/Release的dll,但找不到执行需要的dll) 问题二:将QT与VTK整合后,QTDesigner不能正常启动了: 网络上提供的教程,一般是将“QVTKWdigetPlugin.dll/.lib”和“QVTK.dll/.lib”四个文件放在/path/to/QT /plugin/designer下面。但是如果四个文件的来源是来自VS编译后的Debug文件夹,就会出现上述的问题。解决方案是在VS中以 Release再次编译VTK,然后将如/bin/release文件夹下的四个文件复制到上述的目录。(本人只编译了QVTK和QVTKWidget也成功了,且如果可以从别的地方拷贝Release版本的也是可以的,没有必要重新编译) //文章转移录,参见: http:/

Where can i find vtk documentation for python?

白昼怎懂夜的黑 提交于 2019-12-04 22:50:11
I am trying to use VTK from python. I tried to find and could not realy find anything on the web which can be used for documentation. I tried looking at the c++ documentation but the methods are very different. Thanks a lot You could see the python examples at VTK's wiki . There is another resource by going to the official nightly documentation and looking for a particular class; in the section examples for many (not all) classes you can find implementations in python (also in c++ and tcl). A third option is to go to the source folder of your last downloaded release of VTK; look for the folder

create multiple polylines given a set of points using vtk

时间秒杀一切 提交于 2019-12-04 16:59:23
I need to display the trajectories in space of 50 particles using vtk and paraview. Currently my data is pos(x,y,t,n) where n is the label of the n-th particle. I have saved all my data in a vtk file which is organized as: # vtk DataFile Version 3.0 VTK from Matlab BINARY DATASET POLYDATA POINTS 199250 double [PROPERLY ORGANIZED BINARY COORDINATES OF THE 199250 POINTS] The above file can be imported correctly into ParaView, and at a first glance I can apply the following programmagle filter pdi = self.GetPolyDataInput() pdo = self.GetPolyDataOutput() newPoints = vtk.vtkPoints() numPoints = pdi

VTK: Rotate actor programmatically while vtkRenderWindowInteractor is active

喜夏-厌秋 提交于 2019-12-04 13:38:32
I'm trying to rotate a vtkActor using vtkActor::RotateZ and then calling vtkRenderWindow::Render . It works fine (it rotates the actor) but I can't move, resize, or even focus the window. I suspected this was caused due to something not catching operating system events, so I added a vtkRenderWindowInteractor to the mix. Now I can move, resize and focus the window, but the actor is not rotating anymore. I've isolated the code in the snippet below, comment line 43 to see both effects: renderWindowInteractor->Start(); I'm compiling VTK 6.2 with mingw-w64 (GCC 4.9.1), running in Windows 8.1. I've

Composing VTK file from multiple MPI outputs

陌路散爱 提交于 2019-12-04 13:12:03
问题 For a Lattice Boltzmann simulation of a lid-driven cavity (CFD) I'm decomposing my cubic domain into (also cubic) 8 subdomains, which are computed independently by 8 ranks. Each MPI rank is producing a VTK file for each timestep and since I'm using ParaView I want to visualize the whole thing as one cube. To be more specific about what I am trying to achieve: I have a cube with length 8 (number of elements for each direction) => 8x8x8 = 512 elements. Each dimension is distributed to 2 ranks,

Paraview “possible mismatch of datasize with declaration” error

女生的网名这么多〃 提交于 2019-12-04 12:40:46
Paraview (v4.1.0 64-bit, OSX 10.9.2) is giving me the following error: Generic Warning: In /Users/kitware/Dashboards/MyTests/NightlyMaster/ParaViewSuperbuild-Release/paraview/src/paraview/VTK/IO/Legacy/vtkDataReader.cxx, line 1388 Error reading ascii data. Possible mismatch of datasize with declaration. I'm not sure why. I've double-checked that fields are all of the expected lengths, and none of the values are NaN, inf, or otherwise extremely large. The issue starts with the output from timestep 16 (0-15 produces no error). Graphically, steps 0-15 produce plots of my data as expected; step 16

GLIBCXX not found when compiling vtk example under mex

南楼画角 提交于 2019-12-04 10:54:24
I have been trying to follow this example for compiling vtk in MATLAB using mex, on an Ubuntu 11.10. The mex command I used is as follows: mex -I/usr/include/vtk-5.6 vtk_file.cpp -L/usr/lib/ -lvtkFiltering -lvtkRendering -lvtkCommon After compilation I have a .mexa64 file. However, when I try to run the file I end up with the following error: Invalid MEX-file '/home/bill/Documents/MATLAB/vtk/vtk_file.mexa64': /usr/local/MATLAB/R2011b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/lib/libvtkFiltering.so.5.6) How can I ensure that glibcxx is

How to convert a mesh to VTK format?

这一生的挚爱 提交于 2019-12-04 10:12:27
I have a mesh in my own format and I want export it to a .vtk file. How do I do this? The original mesh is in the following format: (Pseudocode) class Mesh { List<Float[3]> _coordinates List<int[4]> _tetra //(elements, Faces, etc.) } I hope this clarify my problem. I just want load it with Paraview so I don't care if it is structured, poly, etc. You may create a vtkUnstructuredGrid: //vtkPolyData *data = vtkPolyData::New(); vtkUnstructuredGrid *mesh = vtkUnstructuredGrid::New(); vtkPoints *points = vtkPoints::New(); vtkCellArray *cells = vtkCellArray::New(); //vtkIdType pointIDs[4]; std:

用cmake生成利用VTK库类的visual studio 2010 MFC工程

≯℡__Kan透↙ 提交于 2019-12-04 10:02:45
最近在学习利用VTK三维编程,但是发现,在国内,相关的知识真的很少,在学习的过程中,遇到了很大的困难,所以就想着把我学到的一些有用的知识写出来,供以后的学习的人参考,我也是一个新手,有不到之处,希望读者不吝赐教。这就是我写这些的动机。以下的所有的所用的环境的操作系统是windows xp sp3. 一,cmake简介: cmake 即是cmake - Cross-Platform Makefile Generator.是一个跨平台的安装(编译)工具,可以用简单的语句来描述所有平台的安装(编译过程),能够输出各种各样的makefile或者project文件。 用cmake生成工程的时候主要的依据是CMakeLists.txt文件,其是一种脚本文件,有很简单的语法,cmake就是根据该文件的相关指示生成相应的工程的。 二,用cmake生成visual studio 2010 MFC工程的步骤和方法 1,首先用visual studio 2010新建一个MFC工程,可以是基于对话框的或者是基于文档的。 2,将生成的工程的目录下的<工程名>.sln和<工程名>.sdf 删除,PS:不删除也没有什么问题的,我建立的是工程的名字是VtkMFC,多文档的。 3,编辑CMakeLists.txt 文件,就是一个文本文件。 #cmake版本的最低要求 cmake_minimum_required