0001110: Decimal point entry in LinearPattern length field
This commit is contained in:
parent
28db176474
commit
de9ad5ddfb
|
@ -25,6 +25,7 @@
|
|||
|
||||
#ifndef _PreComp_
|
||||
# include <QMessageBox>
|
||||
# include <QTimer>
|
||||
#endif
|
||||
|
||||
#include "ui_TaskLinearPatternParameters.h"
|
||||
|
@ -93,6 +94,12 @@ TaskLinearPatternParameters::TaskLinearPatternParameters(TaskMultiTransformParam
|
|||
|
||||
void TaskLinearPatternParameters::setupUI()
|
||||
{
|
||||
updateViewTimer = new QTimer(this);
|
||||
updateViewTimer->setSingleShot(true);
|
||||
updateViewTimer->setInterval(getUpdateViewTimeout());
|
||||
|
||||
connect(updateViewTimer, SIGNAL(timeout()),
|
||||
this, SLOT(onUpdateViewTimer()));
|
||||
connect(ui->comboDirection, SIGNAL(activated(int)),
|
||||
this, SLOT(onDirectionChanged(int)));
|
||||
connect(ui->checkReverse, SIGNAL(toggled(bool)),
|
||||
|
@ -188,6 +195,16 @@ void TaskLinearPatternParameters::updateUI()
|
|||
blockUpdate = false;
|
||||
}
|
||||
|
||||
void TaskLinearPatternParameters::onUpdateViewTimer()
|
||||
{
|
||||
recomputeFeature();
|
||||
}
|
||||
|
||||
void TaskLinearPatternParameters::kickUpdateViewTimer() const
|
||||
{
|
||||
updateViewTimer->start();
|
||||
}
|
||||
|
||||
void TaskLinearPatternParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
{
|
||||
if (msg.Type == Gui::SelectionChanges::AddSelection) {
|
||||
|
@ -237,7 +254,7 @@ void TaskLinearPatternParameters::onCheckReverse(const bool on) {
|
|||
pcLinearPattern->Reversed.setValue(on);
|
||||
|
||||
exitSelectionMode();
|
||||
recomputeFeature();
|
||||
kickUpdateViewTimer();
|
||||
}
|
||||
|
||||
void TaskLinearPatternParameters::onLength(const double l) {
|
||||
|
@ -247,7 +264,7 @@ void TaskLinearPatternParameters::onLength(const double l) {
|
|||
pcLinearPattern->Length.setValue(l);
|
||||
|
||||
exitSelectionMode();
|
||||
recomputeFeature();
|
||||
kickUpdateViewTimer();
|
||||
}
|
||||
|
||||
void TaskLinearPatternParameters::onOccurrences(const int n) {
|
||||
|
@ -257,7 +274,7 @@ void TaskLinearPatternParameters::onOccurrences(const int n) {
|
|||
pcLinearPattern->Occurrences.setValue(n);
|
||||
|
||||
exitSelectionMode();
|
||||
recomputeFeature();
|
||||
kickUpdateViewTimer();
|
||||
}
|
||||
|
||||
void TaskLinearPatternParameters::onDirectionChanged(int num) {
|
||||
|
@ -294,7 +311,7 @@ void TaskLinearPatternParameters::onDirectionChanged(int num) {
|
|||
else if (num == maxcount)
|
||||
exitSelectionMode();
|
||||
|
||||
recomputeFeature();
|
||||
kickUpdateViewTimer();
|
||||
}
|
||||
|
||||
void TaskLinearPatternParameters::onUpdateView(bool on)
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "TaskTransformedParameters.h"
|
||||
#include "ViewProviderLinearPattern.h"
|
||||
|
||||
class QTimer;
|
||||
class Ui_TaskLinearPatternParameters;
|
||||
|
||||
namespace App {
|
||||
|
@ -62,6 +63,7 @@ public:
|
|||
const unsigned getOccurrences(void) const;
|
||||
|
||||
private Q_SLOTS:
|
||||
void onUpdateViewTimer();
|
||||
void onDirectionChanged(int num);
|
||||
void onCheckReverse(const bool on);
|
||||
void onLength(const double l);
|
||||
|
@ -75,9 +77,11 @@ protected:
|
|||
private:
|
||||
void setupUI();
|
||||
void updateUI();
|
||||
void kickUpdateViewTimer() const;
|
||||
|
||||
private:
|
||||
Ui_TaskLinearPatternParameters* ui;
|
||||
QTimer* updateViewTimer;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#ifndef _PreComp_
|
||||
# include <QMessageBox>
|
||||
# include <QTimer>
|
||||
#endif
|
||||
|
||||
#include "ui_TaskPolarPatternParameters.h"
|
||||
|
@ -93,6 +94,12 @@ TaskPolarPatternParameters::TaskPolarPatternParameters(TaskMultiTransformParamet
|
|||
|
||||
void TaskPolarPatternParameters::setupUI()
|
||||
{
|
||||
updateViewTimer = new QTimer(this);
|
||||
updateViewTimer->setSingleShot(true);
|
||||
updateViewTimer->setInterval(getUpdateViewTimeout());
|
||||
|
||||
connect(updateViewTimer, SIGNAL(timeout()),
|
||||
this, SLOT(onUpdateViewTimer()));
|
||||
connect(ui->comboAxis, SIGNAL(activated(int)),
|
||||
this, SLOT(onAxisChanged(int)));
|
||||
connect(ui->checkReverse, SIGNAL(toggled(bool)),
|
||||
|
@ -169,6 +176,16 @@ void TaskPolarPatternParameters::updateUI()
|
|||
blockUpdate = false;
|
||||
}
|
||||
|
||||
void TaskPolarPatternParameters::onUpdateViewTimer()
|
||||
{
|
||||
recomputeFeature();
|
||||
}
|
||||
|
||||
void TaskPolarPatternParameters::kickUpdateViewTimer() const
|
||||
{
|
||||
updateViewTimer->start();
|
||||
}
|
||||
|
||||
void TaskPolarPatternParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
{
|
||||
if (msg.Type == Gui::SelectionChanges::AddSelection) {
|
||||
|
@ -213,7 +230,7 @@ void TaskPolarPatternParameters::onCheckReverse(const bool on) {
|
|||
pcPolarPattern->Reversed.setValue(on);
|
||||
|
||||
exitSelectionMode();
|
||||
recomputeFeature();
|
||||
kickUpdateViewTimer();
|
||||
}
|
||||
|
||||
void TaskPolarPatternParameters::onAngle(const double a) {
|
||||
|
@ -223,7 +240,7 @@ void TaskPolarPatternParameters::onAngle(const double a) {
|
|||
pcPolarPattern->Angle.setValue(a);
|
||||
|
||||
exitSelectionMode();
|
||||
recomputeFeature();
|
||||
kickUpdateViewTimer();
|
||||
}
|
||||
|
||||
void TaskPolarPatternParameters::onOccurrences(const int n) {
|
||||
|
@ -233,7 +250,7 @@ void TaskPolarPatternParameters::onOccurrences(const int n) {
|
|||
pcPolarPattern->Occurrences.setValue(n);
|
||||
|
||||
exitSelectionMode();
|
||||
recomputeFeature();
|
||||
kickUpdateViewTimer();
|
||||
}
|
||||
|
||||
void TaskPolarPatternParameters::onAxisChanged(int num) {
|
||||
|
@ -256,7 +273,7 @@ void TaskPolarPatternParameters::onAxisChanged(int num) {
|
|||
else if (num == 1)
|
||||
exitSelectionMode();
|
||||
|
||||
recomputeFeature();
|
||||
kickUpdateViewTimer();
|
||||
}
|
||||
|
||||
void TaskPolarPatternParameters::onUpdateView(bool on)
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "TaskTransformedParameters.h"
|
||||
#include "ViewProviderPolarPattern.h"
|
||||
|
||||
class QTimer;
|
||||
class Ui_TaskPolarPatternParameters;
|
||||
|
||||
namespace App {
|
||||
|
@ -63,6 +64,7 @@ public:
|
|||
const unsigned getOccurrences(void) const;
|
||||
|
||||
private Q_SLOTS:
|
||||
void onUpdateViewTimer();
|
||||
void onAxisChanged(int num);
|
||||
void onCheckReverse(const bool on);
|
||||
void onAngle(const double a);
|
||||
|
@ -76,9 +78,11 @@ protected:
|
|||
private:
|
||||
void setupUI();
|
||||
void updateUI();
|
||||
void kickUpdateViewTimer() const;
|
||||
|
||||
private:
|
||||
Ui_TaskPolarPatternParameters* ui;
|
||||
QTimer* updateViewTimer;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -82,6 +82,16 @@ TaskTransformedParameters::~TaskTransformedParameters()
|
|||
Gui::Selection().rmvSelectionGate();
|
||||
}
|
||||
|
||||
bool TaskTransformedParameters::isViewUpdated() const
|
||||
{
|
||||
return (blockUpdate == false);
|
||||
}
|
||||
|
||||
int TaskTransformedParameters::getUpdateViewTimeout() const
|
||||
{
|
||||
return 500;
|
||||
}
|
||||
|
||||
const bool TaskTransformedParameters::originalSelected(const Gui::SelectionChanges& msg)
|
||||
{
|
||||
if (msg.Type == Gui::SelectionChanges::AddSelection && originalSelectionMode) {
|
||||
|
|
|
@ -85,6 +85,9 @@ protected:
|
|||
void showOriginals();
|
||||
|
||||
void addReferenceSelectionGate(bool edge, bool face);
|
||||
bool isViewUpdated() const;
|
||||
int getUpdateViewTimeout() const;
|
||||
|
||||
protected:
|
||||
virtual void changeEvent(QEvent *e) = 0;
|
||||
virtual void onSelectionChanged(const Gui::SelectionChanges& msg) = 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user