mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/graph/graph] Define PreimageGraphController class
This commit is contained in:
committed by
Émilie Feral
parent
ab108bbd2c
commit
e0774cba4b
@@ -12,6 +12,7 @@ app_src += $(addprefix apps/graph/,\
|
||||
graph/graph_controller.cpp \
|
||||
graph/graph_controller_helper.cpp \
|
||||
graph/graph_view.cpp \
|
||||
graph/preimage_graph_controller.cpp\
|
||||
graph/integral_graph_controller.cpp \
|
||||
graph/intersection_graph_controller.cpp \
|
||||
graph/root_graph_controller.cpp \
|
||||
|
||||
29
apps/graph/graph/preimage_graph_controller.cpp
Normal file
29
apps/graph/graph/preimage_graph_controller.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "preimage_graph_controller.h"
|
||||
|
||||
namespace Graph {
|
||||
|
||||
PreimageGraphController::PreimageGraphController(
|
||||
Responder * parentResponder,
|
||||
GraphView * graphView,
|
||||
BannerView * bannerView,
|
||||
Shared::InteractiveCurveViewRange * curveViewRange,
|
||||
Shared::CurveViewCursor * cursor
|
||||
) :
|
||||
CalculationGraphController(
|
||||
parentResponder,
|
||||
graphView,
|
||||
bannerView,
|
||||
curveViewRange,
|
||||
cursor,
|
||||
I18n::Message::NoPreimageFound
|
||||
),
|
||||
m_image(NAN)
|
||||
{
|
||||
}
|
||||
|
||||
Poincare::Expression::Coordinate2D PreimageGraphController::computeNewPointOfInterest(double start, double step, double max, Poincare::Context * context) {
|
||||
Poincare::Expression expression = Poincare::Float<double>::Builder(m_image);
|
||||
return functionStore()->modelForRecord(m_record)->nextIntersectionFrom(start, step, max, context, expression);
|
||||
}
|
||||
|
||||
}
|
||||
22
apps/graph/graph/preimage_graph_controller.h
Normal file
22
apps/graph/graph/preimage_graph_controller.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "calculation_graph_controller.h"
|
||||
|
||||
namespace Graph {
|
||||
|
||||
class PreimageGraphController : public CalculationGraphController {
|
||||
public:
|
||||
PreimageGraphController(
|
||||
Responder * parentResponder,
|
||||
GraphView * graphView,
|
||||
BannerView * bannerView,
|
||||
Shared::InteractiveCurveViewRange * curveViewRange,
|
||||
Shared::CurveViewCursor * cursor
|
||||
);
|
||||
const char * title() override { return I18n::translate(I18n::Message::Preimage); }
|
||||
double image() { return m_image; }
|
||||
void setImage(double value) { m_image = value; }
|
||||
private:
|
||||
Poincare::Expression::Coordinate2D computeNewPointOfInterest(double start, double step, double max, Poincare::Context * context) override;
|
||||
double m_image;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user