スポンサーリンク
// VTK_MODULE_INITに必要 #include <vtkAutoInit.h> #include <vtkSmartPointer.h> #include <vtkTextActor.h> #include <vtkRenderer.h> #include <vtkRenderWindow.h> #include <vtkRenderWindowInteractor.h> #pragma comment(lib,"vtkCommonCore-9.0.lib") #pragma comment(lib,"vtkRenderingCore-9.0.lib") #pragma comment(lib,"vtkInteractionStyle-9.0.lib") #pragma comment(lib,"vtkFiltersSources-9.0.lib") #pragma comment(lib,"vtkCommonExecutionModel-9.0.lib") #pragma comment(lib,"vtkRenderingOpenGL2-9.0.lib") #pragma comment(lib,"vtkRenderingFreeType-9.0.lib") VTK_MODULE_INIT(vtkRenderingOpenGL2); VTK_MODULE_INIT(vtkRenderingFreeType); VTK_MODULE_INIT(vtkInteractionStyle); int main(int /*argc*/, char ** /*argv*/) { auto textActor = vtkSmartPointer<vtkTextActor>::New(); textActor->SetInput("Hello World"); auto renderer = vtkSmartPointer<vtkRenderer>::New(); renderer->AddActor(textActor); renderer->ResetCamera(); auto interactor = vtkSmartPointer<vtkRenderWindowInteractor>::New(); auto renderWindow = vtkSmartPointer<vtkRenderWindow>::New(); renderWindow->AddRenderer(renderer); renderWindow->SetInteractor(interactor); renderWindow->Render(); interactor->Start(); return 0; }