MultiSessionLocSubView.cpp
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 
30 #include "ui_multiSessionLocSubView.h"
31 
32 namespace rtabmap {
33 
34 MultiSessionLocSubView::MultiSessionLocSubView(ImageView * mainView, int mapId, QWidget * parent) :
35  QWidget(parent),
36  mapId_(mapId)
37 {
38  ui_ = new Ui_multiSessionLocSubView();
39  ui_->setupUi(this);
40  ui_->imageView->setFeaturesShown(mainView->isFeaturesShown());
41  ui_->imageView->setFeaturesSize(mainView->getFeaturesSize());
42  ui_->imageView->setAlpha(mainView->getAlpha());
43  ui_->imageView->setDefaultMatchingFeatureColor(mainView->getDefaultMatchingFeatureColor());
44 }
46 
48  int nodeId,
49  const QImage & image,
50  const std::multimap<int, cv::KeyPoint> & features,
51  float locRatio,
52  const QColor & bgColor)
53 {
54  if(image.isNull())
55  {
56  ui_->imageView->clear();
57  }
58  else
59  {
60  ui_->imageView->setImage(image);
61  ui_->imageView->setFeatures(features, cv::Mat(), ui_->imageView->getDefaultMatchingFeatureColor());
62  ui_->imageView->setBackgroundColor(bgColor);
63  }
64  ui_->label->setText(QString("%1 [%2]").arg(nodeId).arg(mapId_));
65  ui_->locProgressBar->setValue(locRatio * 100);
66 }
67 
69 {
70  ui_->imageView->clear();
71  ui_->label->setText(QString("[%1]").arg(mapId_));
72 }
73 
74 } /* namespace rtabmap */
75 
rtabmap::MultiSessionLocSubView::clear
void clear()
Definition: MultiSessionLocSubView.cpp:68
rtabmap::MultiSessionLocSubView::MultiSessionLocSubView
MultiSessionLocSubView(ImageView *mainView, int mapId, QWidget *parent=0)
Definition: MultiSessionLocSubView.cpp:34
MultiSessionLocSubView.h
rtabmap::MultiSessionLocSubView::mapId_
int mapId_
Definition: MultiSessionLocSubView.h:60
rtabmap::MultiSessionLocSubView::~MultiSessionLocSubView
virtual ~MultiSessionLocSubView()
Definition: MultiSessionLocSubView.cpp:45
rtabmap::ImageView::getFeaturesSize
int getFeaturesSize() const
Definition: ImageView.h:66
arg
rtabmap::ImageView::getDefaultMatchingFeatureColor
const QColor & getDefaultMatchingFeatureColor() const
Definition: ImageView.cpp:394
rtabmap::MultiSessionLocSubView::ui_
Ui_multiSessionLocSubView * ui_
Definition: MultiSessionLocSubView.h:59
rtabmap::ImageView::getAlpha
int getAlpha() const
Definition: ImageView.h:65
rtabmap::ImageView::isFeaturesShown
bool isFeaturesShown() const
Definition: ImageView.cpp:366
rtabmap::ImageView
Definition: ImageView.h:49
rtabmap
Definition: CameraARCore.cpp:35
rtabmap::MultiSessionLocSubView::updateView
void updateView(int nodeId, const QImage &image, const std::multimap< int, cv::KeyPoint > &features, float locRatio, const QColor &bgColor)
Definition: MultiSessionLocSubView.cpp:47


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:13