mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/graph][apps/sequence] In function store model, specify the
implementation of removeAll (always let an empty function in cartesian functions) Change-Id: I5e91a0ea427ba823eee4f86cdd8b7cd5426df2c6
This commit is contained in:
@@ -100,4 +100,12 @@ const KDColor CartesianFunctionStore::firstAvailableColor() {
|
||||
return k_defaultColors[0];
|
||||
}
|
||||
|
||||
void CartesianFunctionStore::removeAll() {
|
||||
for (int i = 0; i < m_numberOfFunctions; i++) {
|
||||
m_functions[i] = CartesianFunction("", KDColorBlack);
|
||||
}
|
||||
m_numberOfFunctions = 0;
|
||||
addEmptyFunction();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ public:
|
||||
void removeFunction(Shared::Function * f) override;
|
||||
int maxNumberOfFunctions() override;
|
||||
char symbol() const override;
|
||||
void removeAll() override;
|
||||
static constexpr int k_maxNumberOfFunctions = 8;
|
||||
private:
|
||||
const char * firstAvailableName() override;
|
||||
|
||||
@@ -93,4 +93,11 @@ const KDColor SequenceStore::firstAvailableColor() {
|
||||
return k_defaultColors[0];
|
||||
}
|
||||
|
||||
void SequenceStore::removeAll() {
|
||||
for (int i = 0; i < m_numberOfFunctions; i++) {
|
||||
m_sequences[i] = Sequence("", KDColorBlack);
|
||||
}
|
||||
m_numberOfFunctions = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
int maxNumberOfFunctions() override;
|
||||
const char * firstAvailableName() override;
|
||||
char symbol() const override;
|
||||
void removeAll() override;
|
||||
static constexpr int k_maxNumberOfSequences = 3;
|
||||
private:
|
||||
const KDColor firstAvailableColor() override;
|
||||
|
||||
@@ -62,10 +62,4 @@ int FunctionStore::numberOfDefinedFunctions() {
|
||||
return result;
|
||||
}
|
||||
|
||||
void FunctionStore::removeAll() {
|
||||
for (int i = 0; i < numberOfFunctions(); i++) {
|
||||
removeFunction(functionAtIndex(i));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
virtual Function * definedFunctionAtIndex(int i);
|
||||
virtual Function * addEmptyFunction() = 0;
|
||||
virtual void removeFunction(Function * f) = 0;
|
||||
void removeAll();
|
||||
virtual void removeAll() = 0;
|
||||
int numberOfFunctions();
|
||||
// Functions can be undefined when they have a color and a name but no content
|
||||
int numberOfDefinedFunctions();
|
||||
|
||||
Reference in New Issue
Block a user