DbViewer: added checkbox to enable Add for nodes not linked to graph

This commit is contained in:
matlabbe
2020-10-09 12:15:33 -04:00
parent 6d552b7873
commit d5572d03ad
3 changed files with 19 additions and 7 deletions

View File

@@ -145,6 +145,7 @@ private Q_SLOTS:
void updateStereo(); void updateStereo();
void notifyParametersChanged(const QStringList &); void notifyParametersChanged(const QStringList &);
void setupMainLayout(bool vertical); void setupMainLayout(bool vertical);
void updateConstraintButtons();
private: private:
QString getIniFilePath() const; QString getIniFilePath() const;
@@ -176,7 +177,6 @@ private:
bool updateImageSliders = true, bool updateImageSliders = true,
const Signature & signatureFrom = Signature(0), const Signature & signatureFrom = Signature(0),
const Signature & signatureTo = Signature(0)); const Signature & signatureTo = Signature(0));
void updateConstraintButtons();
Link findActiveLink(int from, int to); Link findActiveLink(int from, int to);
bool containsLink( bool containsLink(
std::multimap<int, Link> & links, std::multimap<int, Link> & links,

View File

@@ -360,6 +360,7 @@ DatabaseViewer::DatabaseViewer(const QString & ini, QWidget * parent) :
connect(ui_->checkBox_odomFrame, SIGNAL(stateChanged(int)), this, SLOT(updateConstraintView())); connect(ui_->checkBox_odomFrame, SIGNAL(stateChanged(int)), this, SLOT(updateConstraintView()));
ui_->checkBox_showOptimized->setEnabled(false); ui_->checkBox_showOptimized->setEnabled(false);
connect(ui_->toolButton_constraint, SIGNAL(clicked(bool)), this, SLOT(editConstraint())); connect(ui_->toolButton_constraint, SIGNAL(clicked(bool)), this, SLOT(editConstraint()));
connect(ui_->checkBox_enableForAll, SIGNAL(stateChanged(int)), this, SLOT(updateConstraintButtons()));
ui_->horizontalSlider_iterations->setTracking(false); ui_->horizontalSlider_iterations->setTracking(false);
ui_->horizontalSlider_iterations->setEnabled(false); ui_->horizontalSlider_iterations->setEnabled(false);
@@ -5946,8 +5947,9 @@ void DatabaseViewer::updateConstraintButtons()
int from = ids_.at(ui_->horizontalSlider_A->value()); int from = ids_.at(ui_->horizontalSlider_A->value());
int to = ids_.at(ui_->horizontalSlider_B->value()); int to = ids_.at(ui_->horizontalSlider_B->value());
if(from!=to && from && to && if(from!=to && from && to &&
odomPoses_.find(from) != odomPoses_.end() && odomPoses_.find(from) != odomPoses_.end() &&
odomPoses_.find(to) != odomPoses_.end() && odomPoses_.find(to) != odomPoses_.end() &&
(ui_->checkBox_enableForAll->isChecked() ||
(weights_.find(from) != weights_.end() && weights_.at(from)>=0 && (weights_.find(from) != weights_.end() && weights_.at(from)>=0 &&
weights_.find(to) != weights_.end() && weights_.at(to)>=0))) weights_.find(to) != weights_.end() && weights_.at(to)>=0)))
{ {

View File

@@ -61,7 +61,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>296</width> <width>306</width>
<height>311</height> <height>311</height>
</rect> </rect>
</property> </property>
@@ -304,7 +304,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>296</width> <width>306</width>
<height>311</height> <height>311</height>
</rect> </rect>
</property> </property>
@@ -826,7 +826,7 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>0</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
@@ -1024,6 +1024,16 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="checkBox_enableForAll">
<property name="toolTip">
<string>Enable &quot;Add&quot; for all nodes (even not in graph)</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="pushButton_reject"> <widget class="QPushButton" name="pushButton_reject">
<property name="text"> <property name="text">
@@ -1038,7 +1048,7 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>0</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>