mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
#ifndef PROBABILITY_DISTRIBUTION_CURVE_VIEW_H
|
|
#define PROBABILITY_DISTRIBUTION_CURVE_VIEW_H
|
|
|
|
#include "../shared/curve_view.h"
|
|
#include "../constant.h"
|
|
#include "distribution/distribution.h"
|
|
#include "calculation/calculation.h"
|
|
#include <escher.h>
|
|
#include <poincare/print_float.h>
|
|
#include <poincare/coordinate_2D.h>
|
|
|
|
namespace Probability {
|
|
|
|
class DistributionCurveView : public Shared::CurveView {
|
|
public:
|
|
DistributionCurveView(Distribution * distribution, Calculation * calculation) :
|
|
CurveView(distribution, nullptr, nullptr, nullptr),
|
|
m_labels{},
|
|
m_distribution(distribution),
|
|
m_calculation(calculation)
|
|
{
|
|
assert(distribution != nullptr);
|
|
assert(calculation != nullptr);
|
|
}
|
|
|
|
void reload() override;
|
|
void drawRect(KDContext * ctx, KDRect rect) const override;
|
|
protected:
|
|
char * label(Axis axis, int index) const override;
|
|
private:
|
|
static float EvaluateAtAbscissa(float abscissa, void * model, void * context);
|
|
static Poincare::Coordinate2D<float> EvaluateXYAtAbscissa(float abscissa, void * model, void * context);
|
|
static KDColor const * k_backgroundColor;
|
|
void drawStandardNormal(KDContext * ctx, KDRect rect, float colorLowerBound, float colorUpperBound) const;
|
|
char m_labels[k_maxNumberOfXLabels][k_labelBufferMaxSize];
|
|
Distribution * m_distribution;
|
|
Calculation * m_calculation;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|