Coordinate Transformation For Different Systems

We can use vtkCoordinate and vtkRenderer objects to convert point’s coordinate from a system to another one. I found vtkCoordinate called the functions of vtkViewport (vtkRenderer is child class of vtkViewport) to accomplish coordinate transformation. class vtkViewport: virtual void LocalDisplayToDisplay(double &x, double &y); virtual void DisplayToNormalizedDisplay(double &u, double &v); virtual Read more…

Show Image By vtkActor2D

I want to show png picture by vtkActor2D rather than vtkImageActor or vtkImageViewer. There is not rotating and scaling for the picture when move mouse and click if the vtkActor2D object works. But how to do it? The following project shows axes and a png picture in the window, the Read more…

Configure TBB – VTK Environment For Mac

Development environment: VTK-8.1.1 macOS Catalina 10.15 Python 2.7.10 Configure variables about Qt in CMake GUi fristly. Some details are in the following script file configure.sh. cmake ./ -G “Unix Makefiles” \ -DVTK_USE_QVTK:BOOL=ON \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DVTK_USE_GUISUPPORT:BOOL=ON \ -DVTK_QT_VERSION=5 \ -DModule_vtkGUISupportQt:BOOL=ON \ -DModule_vtkGUISupportQtOpenGL:BOOL=ON \ -DModule_vtkGUISupportQtSQL:BOOL=ON \ -DModule_vtkGUISupportQtWebkit:BOOL=OFF \ -DModule_vtkRenderingQt:BOOL=ON \ -DModule_vtkViewsQt:BOOL=ON Read more…

Create And Export Curve

I write a small project to create a curve that can be changed and export. The class vtkContourWidget is used to re-construct the curve, vtkXMLPolyDataWriter object helps us to store the polydata. All details for the project had been pushed to GitHub, link: CreateCurve If you fork the repository and Read more…

Store Polydata By vtkXMLPolyDataWriter

Store Polydata Some Special polydata can’t be stored by vtkSTLWriter. The following polydata contains points and a line in its structure, it can’t be saved by vtkSTLWriter, but vtkXMLPolyDataWriter works. vtkObject::GlobalWarningDisplayOn(); int numPts = 10; vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New(); int offset = numPts / 4; for (int i = 0; Read more…

What Does The vtkImageData Looks Like

What does the vtkImageData look like? It has a multi-layered point set. In the following example, I show all points in a vtkImageData object in the left reader and its polydata in the right render. #define vtkSPtr vtkSmartPointer #define vtkSPtrNew(Var, Type) vtkSPtr<Type> Var = vtkSPtr<Type>::New(); unsigned char inval = 255; Read more…

XML To JSON
: Input your strings, the tool can convert XML to JSON for you.

X