vtk

Disable or Catch VTK warnings in vtkOutputWindow when embedding Mayavi

江枫思渺然 提交于 2019-12-04 05:23:23
I'd like to either disable the VTK warning window or, better yet, catch them to handle with my application's logging system. My application is using an embedded mayavi view, and I don't want error windows popping up that I have no control over. The following code demonstrates the warning window. import numpy as np from mayavi import mlab x1 = np.array([1, 1, 2, 3]) y1 = np.array([1, 1, 4, 2]) z1 = np.array([1, 1, 5, 1]) mlab.plot3d(x1, y1, z1) mlab.show() Ok, I've done some research and discovered that vtk.vtkObject.GlobalWarningDisplayOff() will disable the window completely, which is nice.

vtkRenderWindowInteractor event loop and threading

℡╲_俬逩灬. 提交于 2019-12-04 04:16:01
问题 What I am trying to do in an application using vtk for both interacting and rendering is to have two different parts: 1 - A thread with Rendering and vtkRenderWindowInteractor for interaction with mouse. 2 - A thread that call some modifier functions of the data defined in the VTK Thread. From what I've gotten so far in my research it seems rather complicated and VTK is not thread safe. Now I've stumbled upon this post (http://vtk.1045678.n5.nabble.com/Multi-threaded-VTK-td4514620.html) on

MSB6006: “cmd.exe” exited with code 9009

不想你离开。 提交于 2019-12-03 17:31:25
问题 When I try to build VTK on VS 2010, I get this error error MSB6006: "cmd.exe" exited with code 9009. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets 151 6 vtkhdf5 Before this, I build QT successfully from VS command prompt. My opinion is that there's something wrong with the paths of directories. I've been searching on the internet for a while but couldn't find a way to fix. 回答1: You should first check the output window message of your VS2010 rather than just

VTK图像遮罩(vtkImageMask)

走远了吗. 提交于 2019-12-03 17:19:32
#!/usr/bin/env python import vtk reader = vtk.vtkJPEGReader() reader.SetFileName("Pygoscelis adeliae.jpg") reader.Update() extent = reader.GetOutput().GetExtent() # Create a rectanglular mask maskSource = vtk.vtkImageCanvasSource2D() maskSource.SetScalarTypeToUnsignedChar() maskSource.SetNumberOfScalarComponents(1) maskSource.SetExtent(extent) # Initialize the mask to black maskSource.SetDrawColor(0,0,0); maskSource.FillBox(extent[0],extent[1],extent[2],extent[3]) # Anything non-zero means "make the output pixel equal the input pixel." # If the mask is zero, the output pixel is set to

VTK window thread from main thread, C++

老子叫甜甜 提交于 2019-12-03 16:20:37
I am just learning VTK (and C++ GUI programming) and have hopefully simple question. The main application launches rendered window at some point in application. Would like to be able for the main thread to continue, while VTK window is displayed. Is there a particular method to launch VTK window as a thread? My environment is Linux, with boost and pthreads at my disposal. Thanks. VTK is visualization toolkit, see vtk.org You can call vtkRenderWindowInteractor->Start() method. (Get the interactor from your renderer if you didn't create one). There are tons of examples included with VTK; you

Binary VTK for RECTILINEAR_GRID from fortran code

匿名 (未验证) 提交于 2019-12-03 09:10:12
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am having a fortran code to generate a grid in binary VTK format. This code produces a binary VTK file like this one: # vtk DataFile Version 3.0 vtk output BINARY DATASET RECTILINEAR_GRID DIMENSIONS 2 2 1 X_COORDINATES 2 float ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ Y_COORDINATES 2 float ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ Z_COORDINATES 1 float ^@^@^@^@^@^@^@^@ When, I try to open it with ParaView it crashes with the following error message: ERROR: In /home/athanasios/OpenFOAM/ThirdParty-2.3.0/ParaView-4.1.0/VTK/IO/Legacy/vtkRectilinearGridReader

MSB6006: “cmd.exe” exited with code 9009

白昼怎懂夜的黑 提交于 2019-12-03 05:35:53
When I try to build VTK on VS 2010, I get this error error MSB6006: "cmd.exe" exited with code 9009. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets 151 6 vtkhdf5 Before this, I build QT successfully from VS command prompt. My opinion is that there's something wrong with the paths of directories. I've been searching on the internet for a while but couldn't find a way to fix. zionpi You should first check the output window message of your VS2010 rather than just error list window . After that, you can find some hint on your errors, like missing executable files or

vtk msvc14 installation fails when building INSTALL

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have successfully built the VTK libraries: using the cmake configure and generate, plus the building in release and debug of the msvc 14 solution. More precisely I was able to build the ALL BUILD project. But when it comes to building the INSTALL project it fails. the error is: Severity Code Description Project File Line Suppression State Error MSB3073 The command "setlocal "C:\Program Files (x86)\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake if %errorlevel% neq 0 goto :cmEnd :cmEnd endlocal & call :cmErrorLevel

Install VTK with anaconda 3.6

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to install VTK and mayavi on Ubuntu 16. I have Anaconda with Python 3.6. If I run: conda install -c menpo vtk=7.0.0 vtk I get: Fetching package metadata ........... Solving package specifications: . UnsatisfiableError: The following specifications were found to be in conflict: - python 3.6* - vtk 7.0.0* -> python 3.5* -> openssl 1.0.1* - vtk 7.0.0* -> python 3.5* -> xz 5.0.5 Use "conda info <package>" to see the dependencies for each package. Apparently, I need Anaconda with Python3.5, but it's not availabe. Any idea? :) 回答1: You can

CMake: Run-time error (dyld: Library not loaded) for dynamically linked resources on MacOS

匿名 (未验证) 提交于 2019-12-03 02:28:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Problem $ ./testapp Hello world! $ $INSTALLDIR/testapp dyld: Library not loaded: @rpath/libvtkDomainsChemistryOpenGL2-7.1.1.dylib Referenced from: /Users/normanius/workspace/installdir/testapp Reason: image not found [1] 76964 trace trap /Users/normanius/workspace/installdir/testapp Minimum example I am able to reproduce the problem in a minimal setup consisting of CMakeLists.txt and main.cpp . The library I am linking to is called VTK (v7.1.1) which has been built with shared libs (see below for further details). # CMakeLists.txt cmake