Skip to content

Commit

Permalink
[apps/shared] Move properties logic to ContinuousFunctionProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
PiaNumworks authored and GabrielNumworks committed Apr 17, 2024
1 parent 77e48f3 commit edd5ea8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
12 changes: 4 additions & 8 deletions apps/shared/continuous_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,11 @@ class ContinuousFunction : public Function {

// Wether or not we can display the derivative
bool canDisplayDerivative() const {
return properties().canBeActiveInTable() && !properties().isInversePolar();
return properties().canDisplayDerivative();
}
bool canComputeArea() const {
return canDisplayDerivative() && properties().isCartesian();
}
bool canPlotDerivatives() const {
return canDisplayDerivative() && properties().isCartesian();
}
bool canComputeTangent() const { return canDisplayDerivative(); }
bool canComputeArea() const { return properties().canComputeArea(); }
bool canPlotDerivatives() const { return properties().canPlotDerivatives(); }
bool canComputeTangent() const { return properties().canDisplayDerivative(); }
// If the ContinuousFunction should be considered active in table
bool isActiveInTable() const {
return properties().canBeActiveInTable() && isActive();
Expand Down
10 changes: 10 additions & 0 deletions apps/shared/continuous_function_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ class ContinuousFunctionProperties {
bool canHaveCustomDomain() const {
return !isAlongY() && isEquality() && !isScatterPlot();
}
bool canDisplayDerivative() const {
return canBeActiveInTable() && !isInversePolar();
}
bool canComputeArea() const {
return canDisplayDerivative() && isCartesian();
}
bool canPlotDerivatives() const {
return canDisplayDerivative() && isCartesian();
}
bool canComputeTangent() const { return canDisplayDerivative(); }

bool isLine() const {
return getCurveParameterType() == CurveParameterType::VerticalLine ||
Expand Down

0 comments on commit edd5ea8

Please sign in to comment.