Apollo
6.0
Open source self driving car software
modules
tools
visualizer
fixedaspectratiowidget.h
Go to the documentation of this file.
1
/******************************************************************************
2
* Copyright 2018 The Apollo Authors. All Rights Reserved.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*****************************************************************************/
16
17
#pragma once
18
19
#include <QtCore/QTimer>
20
#include <memory>
21
22
#include "
modules/tools/visualizer/video_image_viewer.h
"
23
24
class
FixedAspectRatioWidget
:
public
QWidget {
25
Q_OBJECT
26
27
public
:
28
explicit
FixedAspectRatioWidget
(QWidget *parent =
nullptr
,
int
index
= 0);
29
30
bool
is_init
(
void
)
const
{
return
viewer_.is_init_; }
31
void
SetupDynamicTexture
(
const
std::shared_ptr<Texture> &textureObj);
32
33
void
set_index
(
int
i) { index_ = i; }
34
int
index
(
void
)
const
{
return
index_; }
35
36
void
StartOrStopUpdate
(
bool
b);
37
int
innerHeight
(
void
) {
return
viewer_.plane_.
texHeight
(); }
38
39
signals:
40
void
focusOnThis
(
FixedAspectRatioWidget
*);
41
42
protected
:
43
void
mouseDoubleClickEvent
(QMouseEvent *event)
override
;
44
void
contextMenuEvent
(QContextMenuEvent *)
override
;
45
void
resizeEvent
(QResizeEvent *)
override
;
46
void
paintEvent
(QPaintEvent *event)
override
;
47
48
private
:
49
int
index_;
50
QTimer refresh_timer_;
51
VideoImgViewer
viewer_;
52
};
VideoImgViewer
Definition:
video_image_viewer.h:28
FixedAspectRatioWidget::set_index
void set_index(int i)
Definition:
fixedaspectratiowidget.h:33
FixedAspectRatioWidget::FixedAspectRatioWidget
FixedAspectRatioWidget(QWidget *parent=nullptr, int index=0)
FixedAspectRatioWidget::SetupDynamicTexture
void SetupDynamicTexture(const std::shared_ptr< Texture > &textureObj)
FixedAspectRatioWidget::is_init
bool is_init(void) const
Definition:
fixedaspectratiowidget.h:30
FixedAspectRatioWidget::StartOrStopUpdate
void StartOrStopUpdate(bool b)
FixedAspectRatioWidget
Definition:
fixedaspectratiowidget.h:24
Plane::texHeight
GLsizei texHeight(void) const
Definition:
plane.h:48
FixedAspectRatioWidget::paintEvent
void paintEvent(QPaintEvent *event) override
FixedAspectRatioWidget::mouseDoubleClickEvent
void mouseDoubleClickEvent(QMouseEvent *event) override
FixedAspectRatioWidget::innerHeight
int innerHeight(void)
Definition:
fixedaspectratiowidget.h:37
FixedAspectRatioWidget::index
int index(void) const
Definition:
fixedaspectratiowidget.h:34
FixedAspectRatioWidget::focusOnThis
void focusOnThis(FixedAspectRatioWidget *)
video_image_viewer.h
FixedAspectRatioWidget::resizeEvent
void resizeEvent(QResizeEvent *) override
FixedAspectRatioWidget::contextMenuEvent
void contextMenuEvent(QContextMenuEvent *) override
Generated by
1.8.13