46 {
47 initializeOpenGLFunctions();
48
49 glPointSize(1.0f);
50 glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
51
52 QImage noImage;
53 if (!noImage.load(tr(":/images/no_image.png"))) {
54 std::cout << "--------can not load the default texture------------"
55 << std::endl;
56 return;
57 }
58
59 default_image_ = std::make_shared<Texture>();
60 if (default_image_ == nullptr || !default_image_->UpdateData(noImage)) {
61 std::cout << "--------can not create the default texture------------"
62 << std::endl;
63 return;
64 }
65
67 tr("/apollo/modules/tools/visualizer/shaders/video_image_plane.vert"),
68 tr("/apollo/modules/tools/visualizer/shaders/video_image_plane.frag"));
69 if (video_image_shader_prog_ == nullptr) {
70 return;
71 }
72
74 if (!plane_.
Init(video_image_shader_prog_)) {
75 return;
76 }
77
80
84
87
88 QMatrix4x4 mvp =
90
91 video_image_shader_prog_->bind();
92 video_image_shader_prog_->setUniformValue(mvp_id_, mvp);
93 video_image_shader_prog_->release();
94
95 is_init_ = true;
96}
void set_near_plane_width(const float npWidth)
void set_position(const QVector3D &pos)
const QMatrix4x4 & model_view_matrix(void) const
void UpdateProjection(void)
const QMatrix4x4 & projection_matrix(void) const
void set_camera_mode(CameraMode cm)
void set_fov(const float fovInDegrees)
void set_near_plane_height(const float npHeight)
virtual void UpdateWorld(void)
void set_texture(const std::shared_ptr< Texture > &t)
bool Init(std::shared_ptr< QOpenGLShaderProgram > &shaderProgram=NullRenderableObj)
static std::shared_ptr< QOpenGLShaderProgram > CreateShaderProgram(const QString &vertexShaderFileName, const QString &fragShaderFileName)
uint32_t height
Height of point cloud
uint32_t width
Width of point cloud