mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[traff_assessment_tool] Rename TrafficMode to TrafficModel
Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
@@ -8,8 +8,8 @@ set(SRC
|
|||||||
map_widget.hpp
|
map_widget.hpp
|
||||||
points_controller_delegate_base.hpp
|
points_controller_delegate_base.hpp
|
||||||
traffic_drawer_delegate_base.hpp
|
traffic_drawer_delegate_base.hpp
|
||||||
traffic_mode.cpp
|
traffic_model.cpp
|
||||||
traffic_mode.hpp
|
traffic_model.hpp
|
||||||
traffic_panel.cpp
|
traffic_panel.cpp
|
||||||
traffic_panel.hpp
|
traffic_panel.hpp
|
||||||
trafficmodeinitdlg.cpp
|
trafficmodeinitdlg.cpp
|
||||||
|
|||||||
@@ -274,10 +274,10 @@ MainWindow::MainWindow(Framework & framework)
|
|||||||
fileMenu->addSeparator();
|
fileMenu->addSeparator();
|
||||||
|
|
||||||
#ifdef openlr_obsolete
|
#ifdef openlr_obsolete
|
||||||
m_goldifyMatchedPathAction = fileMenu->addAction("Goldify", QKeySequence("Ctrl+G"), [this] { m_trafficMode->GoldifyMatchedPath(); });
|
m_goldifyMatchedPathAction = fileMenu->addAction("Goldify", QKeySequence("Ctrl+G"), [this] { m_trafficModel->GoldifyMatchedPath(); });
|
||||||
m_startEditingAction = fileMenu->addAction("Edit", QKeySequence("Ctrl+E"),
|
m_startEditingAction = fileMenu->addAction("Edit", QKeySequence("Ctrl+E"),
|
||||||
[this] {
|
[this] {
|
||||||
m_trafficMode->StartBuildingPath();
|
m_trafficModel->StartBuildingPath();
|
||||||
m_mapWidget->SetMode(MapWidget::Mode::TrafficMarkup);
|
m_mapWidget->SetMode(MapWidget::Mode::TrafficMarkup);
|
||||||
m_commitPathAction->setEnabled(true /* enabled */);
|
m_commitPathAction->setEnabled(true /* enabled */);
|
||||||
m_cancelPathAction->setEnabled(true /* enabled */);
|
m_cancelPathAction->setEnabled(true /* enabled */);
|
||||||
@@ -285,19 +285,19 @@ MainWindow::MainWindow(Framework & framework)
|
|||||||
m_commitPathAction = fileMenu->addAction("Accept path",
|
m_commitPathAction = fileMenu->addAction("Accept path",
|
||||||
QKeySequence("Ctrl+A"),
|
QKeySequence("Ctrl+A"),
|
||||||
[this] {
|
[this] {
|
||||||
m_trafficMode->CommitPath();
|
m_trafficModel->CommitPath();
|
||||||
m_mapWidget->SetMode(MapWidget::Mode::Normal);
|
m_mapWidget->SetMode(MapWidget::Mode::Normal);
|
||||||
});
|
});
|
||||||
m_cancelPathAction = fileMenu->addAction("Revert path",
|
m_cancelPathAction = fileMenu->addAction("Revert path",
|
||||||
QKeySequence("Ctrl+R"),
|
QKeySequence("Ctrl+R"),
|
||||||
[this] {
|
[this] {
|
||||||
m_trafficMode->RollBackPath();
|
m_trafficModel->RollBackPath();
|
||||||
m_mapWidget->SetMode(MapWidget::Mode::Normal);
|
m_mapWidget->SetMode(MapWidget::Mode::Normal);
|
||||||
});
|
});
|
||||||
m_ignorePathAction = fileMenu->addAction("Ignore path",
|
m_ignorePathAction = fileMenu->addAction("Ignore path",
|
||||||
QKeySequence("Ctrl+I"),
|
QKeySequence("Ctrl+I"),
|
||||||
[this] {
|
[this] {
|
||||||
m_trafficMode->IgnorePath();
|
m_trafficModel->IgnorePath();
|
||||||
m_mapWidget->SetMode(MapWidget::Mode::Normal);
|
m_mapWidget->SetMode(MapWidget::Mode::Normal);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -313,22 +313,22 @@ MainWindow::MainWindow(Framework & framework)
|
|||||||
|
|
||||||
void MainWindow::CreateTrafficPanel(std::string const & dataFilePath)
|
void MainWindow::CreateTrafficPanel(std::string const & dataFilePath)
|
||||||
{
|
{
|
||||||
m_trafficMode = new TrafficMode(dataFilePath,
|
m_trafficModel = new TrafficModel(dataFilePath,
|
||||||
m_framework.GetDataSource(),
|
m_framework.GetDataSource(),
|
||||||
std::make_unique<TrafficDrawerDelegate>(m_framework),
|
std::make_unique<TrafficDrawerDelegate>(m_framework),
|
||||||
std::make_unique<PointsControllerDelegate>(m_framework));
|
std::make_unique<PointsControllerDelegate>(m_framework));
|
||||||
|
|
||||||
connect(m_mapWidget, &MapWidget::TrafficMarkupClick,
|
connect(m_mapWidget, &MapWidget::TrafficMarkupClick,
|
||||||
m_trafficMode, &TrafficMode::OnClick);
|
m_trafficModel, &TrafficModel::OnClick);
|
||||||
connect(m_trafficMode, &TrafficMode::EditingStopped,
|
connect(m_trafficModel, &TrafficModel::EditingStopped,
|
||||||
this, &MainWindow::OnPathEditingStop);
|
this, &MainWindow::OnPathEditingStop);
|
||||||
connect(m_trafficMode, &TrafficMode::SegmentSelected,
|
connect(m_trafficModel, &TrafficModel::SegmentSelected,
|
||||||
[](int segmentId) { QApplication::clipboard()->setText(QString::number(segmentId)); });
|
[](int segmentId) { QApplication::clipboard()->setText(QString::number(segmentId)); });
|
||||||
|
|
||||||
m_docWidget = new QDockWidget(tr("Routes"), this);
|
m_docWidget = new QDockWidget(tr("Routes"), this);
|
||||||
addDockWidget(Qt::DockWidgetArea::RightDockWidgetArea, m_docWidget);
|
addDockWidget(Qt::DockWidgetArea::RightDockWidgetArea, m_docWidget);
|
||||||
|
|
||||||
m_docWidget->setWidget(new TrafficPanel(m_trafficMode, m_docWidget));
|
m_docWidget->setWidget(new TrafficPanel(m_trafficModel, m_docWidget));
|
||||||
|
|
||||||
m_docWidget->adjustSize();
|
m_docWidget->adjustSize();
|
||||||
m_docWidget->setMinimumWidth(400);
|
m_docWidget->setMinimumWidth(400);
|
||||||
@@ -341,8 +341,8 @@ void MainWindow::DestroyTrafficPanel()
|
|||||||
delete m_docWidget;
|
delete m_docWidget;
|
||||||
m_docWidget = nullptr;
|
m_docWidget = nullptr;
|
||||||
|
|
||||||
delete m_trafficMode;
|
delete m_trafficModel;
|
||||||
m_trafficMode = nullptr;
|
m_trafficModel = nullptr;
|
||||||
|
|
||||||
m_mapWidget->SetMode(MapWidget::Mode::Normal);
|
m_mapWidget->SetMode(MapWidget::Mode::Normal);
|
||||||
}
|
}
|
||||||
@@ -392,7 +392,7 @@ void MainWindow::OnOpenTrafficSample()
|
|||||||
{
|
{
|
||||||
CreateTrafficPanel(dlg.GetDataFilePath());
|
CreateTrafficPanel(dlg.GetDataFilePath());
|
||||||
}
|
}
|
||||||
catch (TrafficModeError const & e)
|
catch (TrafficModelError const & e)
|
||||||
{
|
{
|
||||||
QMessageBox::critical(this, "Data loading error", QString("Can't load data file."));
|
QMessageBox::critical(this, "Data loading error", QString("Can't load data file."));
|
||||||
LOG(LERROR, (e.Msg()));
|
LOG(LERROR, (e.Msg()));
|
||||||
@@ -453,7 +453,7 @@ void MainWindow::OnSaveTrafficSample()
|
|||||||
document.save_file(fileName.toStdString().data(), " " /* indent */);
|
document.save_file(fileName.toStdString().data(), " " /* indent */);
|
||||||
|
|
||||||
#ifdef openlr_obsolete
|
#ifdef openlr_obsolete
|
||||||
if (!m_trafficMode->SaveSampleAs(fileName.toStdString()))
|
if (!m_trafficModel->SaveSampleAs(fileName.toStdString()))
|
||||||
{
|
{
|
||||||
QMessageBox::critical(
|
QMessageBox::critical(
|
||||||
this, "Saving error",
|
this, "Saving error",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class QHBoxLayout;
|
|||||||
namespace traffxml
|
namespace traffxml
|
||||||
{
|
{
|
||||||
class MapWidget;
|
class MapWidget;
|
||||||
class TrafficMode;
|
class TrafficModel;
|
||||||
class WebView;
|
class WebView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ private:
|
|||||||
|
|
||||||
Framework & m_framework;
|
Framework & m_framework;
|
||||||
|
|
||||||
traffxml::TrafficMode * m_trafficMode = nullptr;
|
traffxml::TrafficModel * m_trafficModel = nullptr;
|
||||||
QDockWidget * m_docWidget = nullptr;
|
QDockWidget * m_docWidget = nullptr;
|
||||||
|
|
||||||
#ifdef openlr_obsolete
|
#ifdef openlr_obsolete
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "traffic_mode.hpp"
|
#include "traffic_model.hpp"
|
||||||
|
|
||||||
#ifdef openlr_obsolete
|
#ifdef openlr_obsolete
|
||||||
#include "openlr/openlr_model_xml.hpp"
|
#include "openlr/openlr_model_xml.hpp"
|
||||||
@@ -99,8 +99,8 @@ void RoadPointCandidate::SetActivePoint(FeatureID const & fid)
|
|||||||
} // namespace impl
|
} // namespace impl
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TrafficMode -------------------------------------------------------------------------------------
|
// TrafficModel -------------------------------------------------------------------------------------
|
||||||
TrafficMode::TrafficMode(std::string const & dataFileName, DataSource const & dataSource,
|
TrafficModel::TrafficModel(std::string const & dataFileName, DataSource const & dataSource,
|
||||||
std::unique_ptr<TrafficDrawerDelegateBase> drawerDelegate,
|
std::unique_ptr<TrafficDrawerDelegateBase> drawerDelegate,
|
||||||
std::unique_ptr<PointsControllerDelegateBase> pointsDelegate,
|
std::unique_ptr<PointsControllerDelegateBase> pointsDelegate,
|
||||||
QObject * parent)
|
QObject * parent)
|
||||||
@@ -112,7 +112,7 @@ TrafficMode::TrafficMode(std::string const & dataFileName, DataSource const & da
|
|||||||
// TODO(mgsergio): Collect stat how many segments of each kind were parsed.
|
// TODO(mgsergio): Collect stat how many segments of each kind were parsed.
|
||||||
pugi::xml_document doc;
|
pugi::xml_document doc;
|
||||||
if (!doc.load_file(dataFileName.data()))
|
if (!doc.load_file(dataFileName.data()))
|
||||||
MYTHROW(TrafficModeError, ("Can't load file:", strerror(errno)));
|
MYTHROW(TrafficModelError, ("Can't load file:", strerror(errno)));
|
||||||
|
|
||||||
// Save root node without children.
|
// Save root node without children.
|
||||||
{
|
{
|
||||||
@@ -141,7 +141,7 @@ TrafficMode::TrafficMode(std::string const & dataFileName, DataSource const & da
|
|||||||
// TODO(mgsergio): Unify error handling interface of openlr_xml_mode and decoded_path parsers.
|
// TODO(mgsergio): Unify error handling interface of openlr_xml_mode and decoded_path parsers.
|
||||||
auto const partnerSegmentXML = xmlSegment.child("reportSegments");
|
auto const partnerSegmentXML = xmlSegment.child("reportSegments");
|
||||||
if (!openlr::SegmentFromXML(partnerSegmentXML, segment))
|
if (!openlr::SegmentFromXML(partnerSegmentXML, segment))
|
||||||
MYTHROW(TrafficModeError, ("An error occurred while parsing: can't parse segment"));
|
MYTHROW(TrafficModelError, ("An error occurred while parsing: can't parse segment"));
|
||||||
|
|
||||||
if (auto const route = xmlSegment.child("Route"))
|
if (auto const route = xmlSegment.child("Route"))
|
||||||
openlr::PathFromXML(route, m_dataSource, matchedPath);
|
openlr::PathFromXML(route, m_dataSource, matchedPath);
|
||||||
@@ -182,7 +182,7 @@ TrafficMode::TrafficMode(std::string const & dataFileName, DataSource const & da
|
|||||||
}
|
}
|
||||||
catch (openlr::DecodedPathLoadError const & e)
|
catch (openlr::DecodedPathLoadError const & e)
|
||||||
{
|
{
|
||||||
MYTHROW(TrafficModeError, ("An exception occurred while parsing", dataFileName, e.Msg()));
|
MYTHROW(TrafficModelError, ("An exception occurred while parsing", dataFileName, e.Msg()));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ TrafficMode::TrafficMode(std::string const & dataFileName, DataSource const & da
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO(mgsergio): Check if a path was committed, or commit it.
|
// TODO(mgsergio): Check if a path was committed, or commit it.
|
||||||
bool TrafficMode::SaveSampleAs(std::string const & fileName) const
|
bool TrafficModel::SaveSampleAs(std::string const & fileName) const
|
||||||
{
|
{
|
||||||
CHECK(!fileName.empty(), ("Can't save to an empty file."));
|
CHECK(!fileName.empty(), ("Can't save to an empty file."));
|
||||||
|
|
||||||
@@ -230,7 +230,7 @@ bool TrafficMode::SaveSampleAs(std::string const & fileName) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TrafficMode::rowCount(const QModelIndex & parent) const
|
int TrafficModel::rowCount(const QModelIndex & parent) const
|
||||||
{
|
{
|
||||||
#ifdef openlr_obsolete
|
#ifdef openlr_obsolete
|
||||||
return static_cast<int>(m_segments.size());
|
return static_cast<int>(m_segments.size());
|
||||||
@@ -240,9 +240,9 @@ int TrafficMode::rowCount(const QModelIndex & parent) const
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int TrafficMode::columnCount(const QModelIndex & parent) const { return 4; }
|
int TrafficModel::columnCount(const QModelIndex & parent) const { return 4; }
|
||||||
|
|
||||||
QVariant TrafficMode::data(const QModelIndex & index, int role) const
|
QVariant TrafficModel::data(const QModelIndex & index, int role) const
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return QVariant();
|
return QVariant();
|
||||||
@@ -270,7 +270,7 @@ QVariant TrafficMode::data(const QModelIndex & index, int role) const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant TrafficMode::headerData(int section, Qt::Orientation orientation,
|
QVariant TrafficModel::headerData(int section, Qt::Orientation orientation,
|
||||||
int role /* = Qt::DisplayRole */) const
|
int role /* = Qt::DisplayRole */) const
|
||||||
{
|
{
|
||||||
if (orientation != Qt::Horizontal && role != Qt::DisplayRole)
|
if (orientation != Qt::Horizontal && role != Qt::DisplayRole)
|
||||||
@@ -286,7 +286,7 @@ QVariant TrafficMode::headerData(int section, Qt::Orientation orientation,
|
|||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrafficMode::OnItemSelected(QItemSelection const & selected, QItemSelection const &)
|
void TrafficModel::OnItemSelected(QItemSelection const & selected, QItemSelection const &)
|
||||||
{
|
{
|
||||||
#ifdef openlr_obsolete
|
#ifdef openlr_obsolete
|
||||||
ASSERT(!selected.empty(), ());
|
ASSERT(!selected.empty(), ());
|
||||||
@@ -314,7 +314,7 @@ void TrafficMode::OnItemSelected(QItemSelection const & selected, QItemSelection
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::ItemFlags TrafficMode::flags(QModelIndex const & index) const
|
Qt::ItemFlags TrafficModel::flags(QModelIndex const & index) const
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return Qt::ItemIsEnabled;
|
return Qt::ItemIsEnabled;
|
||||||
@@ -323,7 +323,7 @@ Qt::ItemFlags TrafficMode::flags(QModelIndex const & index) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef openlr_obsolete
|
#ifdef openlr_obsolete
|
||||||
void TrafficMode::GoldifyMatchedPath()
|
void TrafficModel::GoldifyMatchedPath()
|
||||||
{
|
{
|
||||||
if (!m_currentSegment->HasMatchedPath())
|
if (!m_currentSegment->HasMatchedPath())
|
||||||
{
|
{
|
||||||
@@ -340,7 +340,7 @@ void TrafficMode::GoldifyMatchedPath()
|
|||||||
m_drawerDelegate->DrawGoldenPath(GetPoints(m_currentSegment->GetGoldenPath()));
|
m_drawerDelegate->DrawGoldenPath(GetPoints(m_currentSegment->GetGoldenPath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrafficMode::StartBuildingPath()
|
void TrafficModel::StartBuildingPath()
|
||||||
{
|
{
|
||||||
if (!StartBuildingPathChecks())
|
if (!StartBuildingPathChecks())
|
||||||
return;
|
return;
|
||||||
@@ -352,7 +352,7 @@ void TrafficMode::StartBuildingPath()
|
|||||||
m_drawerDelegate->VisualizePoints(m_pointsDelegate->GetAllJunctionPointsInViewport());
|
m_drawerDelegate->VisualizePoints(m_pointsDelegate->GetAllJunctionPointsInViewport());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrafficMode::PushPoint(m2::PointD const & coord, std::vector<FeaturePoint> const & points)
|
void TrafficModel::PushPoint(m2::PointD const & coord, std::vector<FeaturePoint> const & points)
|
||||||
{
|
{
|
||||||
impl::RoadPointCandidate point(points, coord);
|
impl::RoadPointCandidate point(points, coord);
|
||||||
if (!m_goldenPath.empty())
|
if (!m_goldenPath.empty())
|
||||||
@@ -360,18 +360,18 @@ void TrafficMode::PushPoint(m2::PointD const & coord, std::vector<FeaturePoint>
|
|||||||
m_goldenPath.push_back(point);
|
m_goldenPath.push_back(point);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrafficMode::PopPoint()
|
void TrafficModel::PopPoint()
|
||||||
{
|
{
|
||||||
CHECK(!m_goldenPath.empty(), ("Attempt to pop point from an empty path."));
|
CHECK(!m_goldenPath.empty(), ("Attempt to pop point from an empty path."));
|
||||||
m_goldenPath.pop_back();
|
m_goldenPath.pop_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrafficMode::CommitPath()
|
void TrafficModel::CommitPath()
|
||||||
{
|
{
|
||||||
CHECK(m_currentSegment, ("No segments selected"));
|
CHECK(m_currentSegment, ("No segments selected"));
|
||||||
|
|
||||||
if (!m_buildingPath)
|
if (!m_buildingPath)
|
||||||
MYTHROW(TrafficModeError, ("Path building is not started"));
|
MYTHROW(TrafficModelError, ("Path building is not started"));
|
||||||
|
|
||||||
SCOPE_GUARD(guard, [this] { emit EditingStopped(); });
|
SCOPE_GUARD(guard, [this] { emit EditingStopped(); });
|
||||||
|
|
||||||
@@ -412,7 +412,7 @@ void TrafficMode::CommitPath()
|
|||||||
m_goldenPath.clear();
|
m_goldenPath.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrafficMode::RollBackPath()
|
void TrafficModel::RollBackPath()
|
||||||
{
|
{
|
||||||
CHECK(m_currentSegment, ("No segments selected"));
|
CHECK(m_currentSegment, ("No segments selected"));
|
||||||
CHECK(m_buildingPath, ("No path building is in progress."));
|
CHECK(m_buildingPath, ("No path building is in progress."));
|
||||||
@@ -429,7 +429,7 @@ void TrafficMode::RollBackPath()
|
|||||||
emit EditingStopped();
|
emit EditingStopped();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrafficMode::IgnorePath()
|
void TrafficModel::IgnorePath()
|
||||||
{
|
{
|
||||||
CHECK(m_currentSegment, ("No segments selected"));
|
CHECK(m_currentSegment, ("No segments selected"));
|
||||||
|
|
||||||
@@ -453,23 +453,23 @@ void TrafficMode::IgnorePath()
|
|||||||
emit EditingStopped();
|
emit EditingStopped();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t TrafficMode::GetPointsCount() const
|
size_t TrafficModel::GetPointsCount() const
|
||||||
{
|
{
|
||||||
return m_goldenPath.size();
|
return m_goldenPath.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
m2::PointD const & TrafficMode::GetPoint(size_t const index) const
|
m2::PointD const & TrafficModel::GetPoint(size_t const index) const
|
||||||
{
|
{
|
||||||
return m_goldenPath[index].GetCoordinate();
|
return m_goldenPath[index].GetCoordinate();
|
||||||
}
|
}
|
||||||
|
|
||||||
m2::PointD const & TrafficMode::GetLastPoint() const
|
m2::PointD const & TrafficModel::GetLastPoint() const
|
||||||
{
|
{
|
||||||
CHECK(!m_goldenPath.empty(), ("Attempt to get point from an empty path."));
|
CHECK(!m_goldenPath.empty(), ("Attempt to get point from an empty path."));
|
||||||
return m_goldenPath.back().GetCoordinate();
|
return m_goldenPath.back().GetCoordinate();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<m2::PointD> TrafficMode::GetGoldenPathPoints() const
|
std::vector<m2::PointD> TrafficModel::GetGoldenPathPoints() const
|
||||||
{
|
{
|
||||||
std::vector<m2::PointD> coordinates;
|
std::vector<m2::PointD> coordinates;
|
||||||
for (auto const & roadPoint : m_goldenPath)
|
for (auto const & roadPoint : m_goldenPath)
|
||||||
@@ -478,7 +478,7 @@ std::vector<m2::PointD> TrafficMode::GetGoldenPathPoints() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO(mgsergio): Draw the first point when the path size is 1.
|
// TODO(mgsergio): Draw the first point when the path size is 1.
|
||||||
void TrafficMode::HandlePoint(m2::PointD clickPoint, Qt::MouseButton const button)
|
void TrafficModel::HandlePoint(m2::PointD clickPoint, Qt::MouseButton const button)
|
||||||
{
|
{
|
||||||
if (!m_buildingPath)
|
if (!m_buildingPath)
|
||||||
return;
|
return;
|
||||||
@@ -555,12 +555,12 @@ void TrafficMode::HandlePoint(m2::PointD clickPoint, Qt::MouseButton const butto
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TrafficMode::StartBuildingPathChecks() const
|
bool TrafficModel::StartBuildingPathChecks() const
|
||||||
{
|
{
|
||||||
CHECK(m_currentSegment, ("A segment should be selected before path building is started."));
|
CHECK(m_currentSegment, ("A segment should be selected before path building is started."));
|
||||||
|
|
||||||
if (m_buildingPath)
|
if (m_buildingPath)
|
||||||
MYTHROW(TrafficModeError, ("Path building already in progress."));
|
MYTHROW(TrafficModelError, ("Path building already in progress."));
|
||||||
|
|
||||||
if (m_currentSegment->HasGoldenPath())
|
if (m_currentSegment->HasGoldenPath())
|
||||||
{
|
{
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
class QItemSelection;
|
class QItemSelection;
|
||||||
class Selection;
|
class Selection;
|
||||||
|
|
||||||
DECLARE_EXCEPTION(TrafficModeError, RootException);
|
DECLARE_EXCEPTION(TrafficModelError, RootException);
|
||||||
|
|
||||||
namespace traffxml
|
namespace traffxml
|
||||||
{
|
{
|
||||||
@@ -62,13 +62,13 @@ private:
|
|||||||
|
|
||||||
/// This class is used to map sample ids to real data
|
/// This class is used to map sample ids to real data
|
||||||
/// and change sample evaluations.
|
/// and change sample evaluations.
|
||||||
class TrafficMode : public QAbstractTableModel
|
class TrafficModel : public QAbstractTableModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// TODO(mgsergio): Check we are on the right mwm. I.e. right mwm version and everything.
|
// TODO(mgsergio): Check we are on the right mwm. I.e. right mwm version and everything.
|
||||||
TrafficMode(std::string const & dataFileName, DataSource const & dataSource,
|
TrafficModel(std::string const & dataFileName, DataSource const & dataSource,
|
||||||
std::unique_ptr<TrafficDrawerDelegateBase> drawerDelegate,
|
std::unique_ptr<TrafficDrawerDelegateBase> drawerDelegate,
|
||||||
std::unique_ptr<PointsControllerDelegateBase> pointsDelegate,
|
std::unique_ptr<PointsControllerDelegateBase> pointsDelegate,
|
||||||
QObject * parent = Q_NULLPTR);
|
QObject * parent = Q_NULLPTR);
|
||||||
Reference in New Issue
Block a user