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++ Exercises: Data Structure II

Exercises: 232. Implement Queue using Stacks Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, and empty). Solution: take advantage of the features of both stacks #include <iostream> #include <set> #include <vector> #include <algorithm> #include <stack> Read more…

C++ Exercises: Data Structure I

Exercises: 448. Find All Numbers Disappeared in an Array Given an array nums of n integers where nums[i] is in the range [1, n], return an array of all the integers in the range [1, n] that do not appear in nums.Solution: use set to record all numbers had showed and find the the rest disappeared numbers. Tips: you can also increase Read more…

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

X