Shell – Use cmake.exe and devenv.exe to build CPP project

Initial developing environment: “C:Program Files (x86)Microsoft Visual Studio 12.0VCvcvarsall.bat” x86 Use cmake to generate a project file. E:projectprivatedoubleView2>cmake ./ — Building for: Visual Studio 16 2019 — Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134. — The C compiler identification is MSVC 19.21.27702.2 — The CXX compiler identification is Read more…

Use vtkAxesActor To Show Three Axes In The World Coordinate System

I wanted to explore vtkPlaneSource’s interfaces SetPoint1 and SetPoint2 with visible 3D Axes. It’s awkward to find that it’s difficult to control plane’s shape by interfaces SetPoint1 and SetPoint2 directly. So I used vtkAxesActor to show three axes in the world coordinate system. #include <iostream> #include <vtkSmartPointer.h> #include <vtkSphereSource.h> #include Read more…

CPP – copy_if

The algorithm copy_if is useful, it can help us to get all elements that meet special conditions. C++ template OutputIt copy_if( InputIt first, InputIt last, OutputIt d_first, UnaryPredicate pred ); Possible implement: C++ template OutputIt copy_if(InputIt first, InputIt last, OutputIt d_first, UnaryPredicate pred) { while (first != last) { if Read more…

VTK – Debug And Print VTK Object

Print debug info by vtk macro How to show vtk object’s debug information? I introduce how to show vtk object’s debug information by the custom class which inherits vtkPolyDataAlgorithm, relevant article: 【VTK】Create source class which is derived from vtkPolyDataAlgorithm We just need to Star->DebugOn() and use vtkDebugMacro as std::cout. vtkDebugMacro( Read more…

VTK – Decimate Polydata With Scalar

How to decimate a PolyData without changing pointData’s scalar’s position? Two classes vtkQuadricDecimation and vtkDecimatePro are worth discussing. vtkQuadricDecimation can decimate pointdata’s scalar. We have to set AttributeErrorMetric true to handle it. #include <iostream> #include <vtkSmartPointer.h> #include <vtkSphereSource.h> #include <vtkActor.h> #include <vtkConeSource.h> #include <vtkRenderer.h> #include <vtkRenderWindow.h> #include <vtkPolyDataMapper.h> #include <vtkProperty.h> Read more…

vtkCutter Find The Intersections Between Bounding Box Plane And Polydata

Create a simple cone and plane. #include <iostream> #include <vtkSmartPointer.h> #include <vtkSphereSource.h> #include <vtkActor.h> #include <vtkConeSource.h> #include <vtkRenderer.h> #include <vtkRenderWindow.h> #include <vtkPolyDataMapper.h> #include <vtkProperty.h> #include <vtkRenderWindowInteractor.h> #include <vtkLight.h> #include <vtkCamera.h> #include <vtkOBBTree.h> #include <vtkActor2D.h> #include <vtkMath.h> #include <vtkTransform.h> #include <vtkTransformFilter.h> #include <vtkMatrix4x4.h> #include <vtkInteractorObserver.h> #include <vtkPolyDataNormals.h> #include <vtkOutlineFilter.h> #include <vtkPlaneSource.h> Read more…

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

X