When I use this code ,i am getting output like this
i cant see renderd output window , what is the reason
#include <vtk-9.1/vtkVersion.h>
#include <vtk-9.1/vtkActor.h>
#include <vtk-9.1/vtkDiskSource.h>
#include <vtk-9.1/vtkPolyDataMapper.h>
#include <vtk-9.1/vtkRenderer.h>
#include <vtk-9.1/vtkRenderWindow.h>
#include <vtk-9.1/vtkRenderWindowInteractor.h>
#include <vtk-9.1/vtkSmartPointer.h>
#include <vtk-9.1/vtkNamedColors.h>
#include <iostream>
int main() {
// Print the VTK version
std::cout << "VTK Version: " << vtkVersion::GetVTKVersion() << std::endl;
// Create a disk source to generate a circle (a disk)
vtkSmartPointer<vtkDiskSource> diskSource = vtkSmartPointer<vtkDiskSource>::New();
diskSource->SetOuterRadius(5.0);
diskSource->SetRadialResolution(100); // Resolution of the circle
// Create a mapper to map the disk data to graphics
vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputConnection(diskSource->GetOutputPort());
// Create an actor to represent the circle in the window
vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);
// Create a renderer
vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
// Create a render window
vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
renderWindow->AddRenderer(renderer);
// Create a render window interactor to interact with the window
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
renderWindowInteractor->SetRenderWindow(renderWindow);
// Add the actor to the renderer
renderer->AddActor(actor);
// Set the background color to white
vtkSmartPointer<vtkNamedColors> colors = vtkSmartPointer<vtkNamedColors>::New();
renderer->SetBackground(colors->GetColor3d("White").GetData());
// Start the rendering loop
renderWindow->Render();
renderWindowInteractor->Start();
return 0;
}
here i attaching makefile, in this makfile i included deepstream and opencv for developing my application
# Set CUDA version
CUDA_VER ?= 12.2
# Application name
APP := deepstream-test3-app
# Set the DeepStream version
NVDS_VERSION := 7.0
# Directories for libraries and binaries
LIB_INSTALL_DIR ?= /opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/lib/
APP_INSTALL_DIR ?= /opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/bin/
# Source and header files
SRCS := $(wildcard *.c)
INCS := $(wildcard *.h)
# Required packages
PKGS := gstreamer-1.0
# Object files
OBJS := $(SRCS:.c=.o)
# Include directories
CXXFLAGS += -I../../../includes \
-I /usr/local/cuda-$(CUDA_VER)/include \
-I /usr/include/gstreamer-1.0 \
-I /usr/include/aarch64-linux-gnu \
-I /usr/include/glib-2.0 \
-I /usr/lib/aarch64-linux-gnu/glib-2.0/include \
-I /usr/include/opencv4 \
-I/usr/include/vtk-9.1 \
-I/usr/include/OpenGL \
-I/usr/include/GL
# Compiler flags (pkg-config for GStreamer)
CXXFLAGS += $(shell pkg-config --cflags $(PKGS))
# Linking libraries
LIBS := $(shell pkg-config --libs $(PKGS))
LIBS += /lib/aarch64-linux-gnu/libGeographic.so.19.2.0
# Add VTK libraries
LIBS += -L/usr/lib/aarch64-linux-gnu -lvtkCommonCore-9.1 -lvtkRenderingCore-9.1 \
-lvtkIOCore-9.1 -lvtkCommonDataModel-9.1 -lvtkIOGeometry-9.1 \
-lvtkCommonColor-9.1 -lvtkCommonExecutionModel-9.1 -lvtkIOImage-9.1 \
-lvtkFiltersSources-9.1 -lvtkInteractionStyle-9.1 -lvtkRenderingOpenGL2-9.1 \
-lvtkRenderingFreeType-9.1
LIBS += -L/usr/local/cuda-$(CUDA_VER)/lib64 -lcudart -lcuda
LIBS += -L/usr/lib/aarch64-linux-gnu -lGL -lGLU
LIBS += -lvtkpng-9.4
LIBS += $(shell pkg-config --libs opencv4)
LIBS += -lgdal
LIBS += -L/usr/lib/aarch64-linux-gnu -lsqlite3
LIBS += -L/usr/lib/aarch64-linux-gnu -lproj
# All target
all: $(APP)
# Rule to compile object files from source
%.o: %.c $(INCS) Makefile
$(CXX) -c -o $@ $(CXXFLAGS) $<
# Linking object files to create the final executable
$(APP): $(OBJS) Makefile
$(CXX) -o $(APP) $(OBJS) $(LIBS)
# Install rule
install: $(APP)
cp -rv $(APP) $(APP_INSTALL_DIR)
# Clean up generated files
clean:
rm -rf $(OBJS) $(APP)
These are the Installed packages related to VTK
paar-orin1@ubuntu:~/DiffuseSpheres/test$ dpkg-query -l | grep vtk
ii libvtk9-dev 9.1.0+really9.1.0+dfsg2-3build1 arm64 VTK header files
ii libvtk9-java 9.1.0+really9.1.0+dfsg2-3build1 arm64 VTK - Java language support
ii libvtk9.1:arm64 9.1.0+really9.1.0+dfsg2-3build1 arm64 VTK libraries
ii libvtk9.1-qt:arm64 9.1.0+really9.1.0+dfsg2-3build1 arm64 VTK libraries, Qt files
ii python3-vtk9 9.1.0+really9.1.0+dfsg2-3build1 arm64 Python bindings for VTK
ii vtk9 9.1.0+really9.1.0+dfsg2-3build1 arm64 Binaries for VTK9