Files
Upsilon/apps/graph/app.h
Émilie Feral e702c1f61b [apps/graph][apps/regression][app/sequence] Move model and range
versions to the snapshot

Change-Id: I6ec56ab59d734c0c43a5df32462173c611cc68b3
2017-05-18 14:16:41 +02:00

63 lines
2.0 KiB
C++

#ifndef GRAPH_APP_H
#define GRAPH_APP_H
#include <escher.h>
#include <poincare.h>
#include "cartesian_function_store.h"
#include "graph/graph_controller.h"
#include "list/list_controller.h"
#include "values/values_controller.h"
#include "../shared/function_app.h"
namespace Graph {
class App : public Shared::FunctionApp {
public:
class Descriptor : public ::App::Descriptor {
public:
I18n::Message name() override;
I18n::Message upperName() override;
const Image * icon() override;
};
class Snapshot : public Shared::FunctionApp::Snapshot {
public:
Snapshot();
App * unpack(Container * container) override;
void reset() override;
Descriptor * descriptor() override;
CartesianFunctionStore * functionStore();
Shared::InteractiveCurveViewRange * graphRange();
private:
void tidy() override;
CartesianFunctionStore m_functionStore;
Shared::InteractiveCurveViewRange m_graphRange;
};
InputViewController * inputViewController() override;
/* This local context can parse x. However, it always stores NAN
* as x value. When we need to evaluate expression with a specific x value, we
* use a temporary local context (on the stack). That way, we avoid keeping
* weird x values after drawing curves or displaying the value table. */
Poincare::Context * localContext() override;
private:
App(Container * container, Snapshot * snapshot);
Poincare::VariableContext m_xContext;
ListController m_listController;
ButtonRowController m_listFooter;
ButtonRowController m_listHeader;
StackViewController m_listStackViewController;
GraphController m_graphController;
AlternateEmptyViewController m_graphAlternateEmptyViewController;
ButtonRowController m_graphHeader;
StackViewController m_graphStackViewController;
ValuesController m_valuesController;
AlternateEmptyViewController m_valuesAlternateEmptyViewController;
ButtonRowController m_valuesHeader;
StackViewController m_valuesStackViewController;
TabViewController m_tabViewController;
InputViewController m_inputViewController;
};
}
#endif