Validate points.

--HG--
branch : develop
This commit is contained in:
dismine 2014-11-08 17:04:14 +02:00
parent 1499f98d71
commit d6a55c9a40
3 changed files with 37 additions and 3 deletions

View File

@ -66,6 +66,14 @@ DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const q
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogLineIntersectAxis::AngleTextChanged);
connect(ui->pushButtonGrowLengthAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::DeployAngleTextEdit);
connect(timerFormula, &QTimer::timeout, this, &DialogLineIntersectAxis::EvalAngle);
connect(ui->comboBoxFirstLinePoint,
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogLineIntersectAxis::PointNameChanged);
connect(ui->comboBoxSecondLinePoint,
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogLineIntersectAxis::PointNameChanged);
connect(ui->comboBoxAxisPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogLineIntersectAxis::PointNameChanged);
line = new VisToolLineIntersectAxis(data);
}
@ -257,6 +265,31 @@ void DialogLineIntersectAxis::DeployAngleTextEdit()
DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLengthAngle, formulaBaseHeightAngle);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLineIntersectAxis::PointNameChanged()
{
QSet<quint32> set;
set.insert(getCurrentObjectId(ui->comboBoxFirstLinePoint));
set.insert(getCurrentObjectId(ui->comboBoxSecondLinePoint));
set.insert(getCurrentObjectId(ui->comboBoxAxisPoint));
QColor color = okColor;
if (set.size() != 3)
{
flagError = false;
color = errorColor;
}
else
{
flagError = true;
color = okColor;
}
ChangeColor(ui->labelFirstLinePoint, color);
ChangeColor(ui->labelSecondLinePoint, color);
ChangeColor(ui->labelAxisPoint, color);
CheckState();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLineIntersectAxis::ShowVisualization()
{

View File

@ -70,6 +70,7 @@ public slots:
void EvalAngle();
void AngleTextChanged();
void DeployAngleTextEdit();
virtual void PointNameChanged();
protected:
virtual void ShowVisualization();
/**

View File

@ -211,7 +211,7 @@
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="labelAxisPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -231,7 +231,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="labelFirstLinePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -251,7 +251,7 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<widget class="QLabel" name="labelSecondLinePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>