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…

Why Concatenate User Transform When Scale Object

I write the reason why concatenate transform and its inversed transform for offTrans in scale operation based on the article Rotate, Translate And Scale For Camera vtkSPtrNew( scaleTrans, vtkTransform ); scaleTrans->Scale( factor, factor, 1 ); scaleTrans->Update(); vtkSPtrNew( offTrans, vtkTransform ); offTrans->Concatenate( worldTrans ); offTrans->Concatenate( scaleTrans ); offTrans->Concatenate( worldInversedTrans ); offTrans->Update(); Read more…

Tex To PDF
: convert the Latex file which suffix is tex to a PDF file

X