PD: Add offset / overall length modes for LinearPattern

This commit adds support for two separate modes of defining distance
between elements in PD's Linear Pattern.

1. Overall Length - which works exactly like it works before,
2. Spacing - which allows user to explicitly define distance (offset) between
   features.
This commit is contained in:
al
2022-05-12 00:52:05 +12:00
committed by Kacper Donat
parent d623e37e5e
commit 2b1108439f
5 changed files with 221 additions and 22 deletions

View File

@@ -59,7 +59,9 @@ private Q_SLOTS:
void onUpdateViewTimer();
void onDirectionChanged(int num);
void onCheckReverse(const bool on);
void onModeChanged(const int mode);
void onLength(const double l);
void onOffset(const double o);
void onOccurrences(const uint n);
void onUpdateView(bool) override;
void onFeatureDeleted() override;
@@ -72,13 +74,16 @@ protected:
void clearButtons() override;
void getDirection(App::DocumentObject*& obj, std::vector<std::string>& sub) const;
bool getReverse() const;
int getMode() const;
double getLength() const;
double getOffset() const;
unsigned getOccurrences() const;
private:
void connectSignals();
void setupUI();
void updateUI();
void adaptVisibilityToMode();
void kickUpdateViewTimer() const;
private: