VTK – Combine Two Mesh Objects To One

The article shows how to combine two mesh objects to one based on VTK. The code snippet is in the following part. #include <iostream> #include <vtkSmartPointer.h> #include <vtkSphereSource.h> #include <vtkActor.h> #include <vtkConeSource.h> #include <vtkRenderer.h> #include <vtkRenderWindow.h> #include <vtkPolyDataMapper.h> #include <vtkRenderWindowInteractor.h> #define vtkPtr( var, className ) vtkSmartPointer<className> var = \ vtkSmartPointer<className>::New() Read more…

C++ : Create Same BasicIO Functions For Cross-platform Compatibility

I write a few file IO functions which are used in windows and mac os x. bool CopyAFile(const std::string inFile, const std::string outFile); bool RemoveFile(const std::string filePath); void RemoveDir(const std::string folderPath); void MoveAFile(const std::string oldFile, const std::string newFile); void CheckFolderExist(const std::string folderPath); bool FileExists( const std::string path ); void HandleLastSlash( Read more…

Simple Example Using OpenCV By CPP And Python

The article introduces how to display an image by OpenCV in CPlusPlus and Python language. The user can exit the whole program when he presses the ESC key. CPP CMakeLists.txt macro(use_cxx11) if (CMAKE_VERSION VERSION_LESS “3.1”) if (CMAKE_CXX_COMPILER_ID STREQUAL “GNU”) set (CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} -std=gnu++11”) endif () else () set (CMAKE_CXX_STANDARD 11) Read more…

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

X