TinyURDF 1.0.0
A Modern C++ Library for Parsing and Visualizing URDF Model Files
Loading...
Searching...
No Matches
vtk_model_renderer.h
Go to the documentation of this file.
1#ifndef TINYURDF_URDF_RENDER_H
2#define TINYURDF_URDF_RENDER_H
3
4// Copyright 2025 Wissem CHIHA
5#include <vtkNew.h>
6#include <vtkActor.h>
7#include <vtkCamera.h>
8#include <vtkConeSource.h>
9#include <vtkArrowSource.h>
10#include <vtkSphereSource.h>
11#include <vtkCylinderSource.h>
12#include <vtkNamedColors.h>
13#include <vtkTransformFilter.h>
14#include <vtkElevationFilter.h>
15#include <vtkPolyDataMapper.h>
16#include <vtkProperty.h>
17#include <vtkSTLReader.h>
18#include <vtkRenderWindow.h>
19#include <vtkAxesActor.h>
20#include <vtkRenderer.h>
21#include <vtkTransform.h>
22#include <vtkCallbackCommand.h>
23#include <vtkDataSetMapper.h>
24#include <vtkCubeSource.h>
25#include <vtkRenderWindowInteractor.h>
26#include <vtkCallbackCommand.h>
27#include <vtkRenderWindowInteractor.h>
28#include <vtkCaptionActor2D.h>
29#include <vtkTextProperty.h>
30#include <vtkMath.h>
31
32#include "model.h"
33#include "renderer_base.h"
34#include "vtk_link_renderer.h"
35#include "vtk_joint_renderer.h"
36
44class VtkModelRenderer : public RendererBase<Model>
45{
46public:
48 void show() override;
49 void update() override;
50 void setLabelsVisibility(bool isVisible) override;
51 void setRenderer(vtkSmartPointer<vtkRenderer> renderer);
52 void setWindowSize(const int32_t width, const int32_t height) override;
53 void setBackrgournd(double r, double g, double b, double a) override;
54 vtkSmartPointer<vtkRenderer> getRenderer();
55 void setModel(const Model& model);
56 void clear() override;
57 bool isA(const char* name) override;
58 void print(std::ostream& os) override;
59 bool empty() const override;
60 const char* getTypename() override;
61 void setModels(const std::vector<Model>& models);
63private:
64 int32_t width_ = 800;
65 int32_t height_ = 600;
66 vtkSmartPointer<vtkRenderer> renderer_;
67 vtkSmartPointer<vtkRenderWindow> window_;
68 std::vector<Model> models_;
69 bool labels_ = false;
70};
71#endif // TINYURDF_URDF_RENDER_H
base class for representing a multi-body system
Definition model.h:23
this is a base class for all renderers all renderers impentation should inherit from this class at th...
Definition renderer_base.h:15
this is the main renderer for models
Definition vtk_model_renderer.h:45
const char * getTypename() override
Definition vtk_model_renderer.cc:114
void setModels(const std::vector< Model > &models)
Definition vtk_model_renderer.cc:119
void setBackrgournd(double r, double g, double b, double a) override
Definition vtk_model_renderer.cc:74
void print(std::ostream &os) override
Definition vtk_model_renderer.cc:101
void setRenderer(vtkSmartPointer< vtkRenderer > renderer)
Definition vtk_model_renderer.cc:62
void clear() override
Definition vtk_model_renderer.cc:91
~VtkModelRenderer()
Definition vtk_model_renderer.cc:124
VtkModelRenderer()
Definition vtk_model_renderer.cc:3
void setLabelsVisibility(bool isVisible) override
Definition vtk_model_renderer.cc:37
bool empty() const override
Definition vtk_model_renderer.cc:109
void update() override
Definition vtk_model_renderer.cc:9
vtkSmartPointer< vtkRenderer > getRenderer()
Definition vtk_model_renderer.cc:81
void show() override
Definition vtk_model_renderer.cc:42
bool isA(const char *name) override
Definition vtk_model_renderer.cc:96
void setModel(const Model &model)
Definition vtk_model_renderer.cc:86
void setWindowSize(const int32_t width, const int32_t height) override
Definition vtk_model_renderer.cc:67