Numworks Epsilon  1.4.1
Graphing Calculator Operating System
Shared::CurveView Class Referenceabstract

#include <curve_view.h>

Inheritance diagram for Shared::CurveView:
View Probability::LawCurveView Regression::GraphView Shared::FunctionGraphView Statistics::BoxView Statistics::HistogramView Graph::GraphView Sequence::GraphView

Public Types

enum  Axis { Axis::Horizontal = 0, Axis::Vertical = 1 }
 
typedef float(* EvaluateModelWithParameter) (float t, void *model, void *context)
 

Public Member Functions

 CurveView (CurveViewRange *curveViewRange=nullptr, CurveViewCursor *curveViewCursor=nullptr, BannerView *bannerView=nullptr, View *cursorView=nullptr, View *okView=nullptr)
 
virtual void reload ()
 
bool isMainViewSelected () const
 
void selectMainView (bool mainViewSelected)
 
void setCursorView (View *cursorView)
 
void setBannerView (View *bannerView)
 
void setOkView (View *okView)
 
float resolution () const
 
- Public Member Functions inherited from View
 View ()
 
virtual ~View ()
 
 View (const View &other)=delete
 
 View (View &&other)=delete
 
Viewoperator= (const View &other)=delete
 
Viewoperator= (View &&other)=delete
 
void resetSuperview ()
 
virtual void drawRect (KDContext *ctx, KDRect rect) const
 
void setSize (KDSize size)
 
void setFrame (KDRect frame)
 
KDPoint pointFromPointInView (View *view, KDPoint point)
 
KDRect bounds () const
 
Viewsubview (int index)
 
virtual KDSize minimalSizeForOptimalDisplay () const
 

Protected Member Functions

void setCurveViewRange (CurveViewRange *curveViewRange)
 
virtual float samplingRatio () const
 
float pixelToFloat (Axis axis, KDCoordinate p) const
 
float floatToPixel (Axis axis, float f) const
 
void drawLine (KDContext *ctx, KDRect rect, Axis axis, float coordinate, KDColor color, KDCoordinate thickness=1) const
 
void drawSegment (KDContext *ctx, KDRect rect, Axis axis, float coordinate, float lowerBound, float upperBound, KDColor color, KDCoordinate thickness=1) const
 
void drawDot (KDContext *ctx, KDRect rect, float x, float y, KDColor color, bool oversize=false) const
 
void drawGridLines (KDContext *ctx, KDRect rect, Axis axis, float step, KDColor color) const
 
void drawGrid (KDContext *ctx, KDRect rect) const
 
void drawAxes (KDContext *ctx, KDRect rect, Axis axis) const
 
void drawCurve (KDContext *ctx, KDRect rect, EvaluateModelWithParameter evaluation, void *model, void *context, KDColor color, bool colorUnderCurve=false, float colorLowerBound=0.0f, float colorUpperBound=0.0f, bool continuously=false) const
 
void drawHistogram (KDContext *ctx, KDRect rect, EvaluateModelWithParameter evaluation, void *model, void *context, float firstBarAbscissa, float barWidth, bool fillBar, KDColor defaultColor, KDColor highlightColor, float highlightLowerBound=INFINITY, float highlightUpperBound=-INFINITY) const
 
void computeLabels (Axis axis)
 
void drawLabels (KDContext *ctx, KDRect rect, Axis axis, bool shiftOrigin) const
 
- Protected Member Functions inherited from View
void markRectAsDirty (KDRect rect)
 

Protected Attributes

Viewm_bannerView
 
CurveViewCursorm_curveViewCursor
 
- Protected Attributes inherited from View
KDRect m_frame
 

Static Protected Attributes

static constexpr KDCoordinate k_labelMargin = 4
 
static constexpr KDCoordinate k_okMargin = 10
 
static constexpr KDCoordinate k_labelGraduationLength = 6
 
static constexpr int k_maxNumberOfXLabels = CurveViewRange::k_maxNumberOfXGridUnits
 
static constexpr int k_maxNumberOfYLabels = CurveViewRange::k_maxNumberOfYGridUnits
 
static constexpr int k_externRectMargin = 2
 

Detailed Description

Definition at line 13 of file curve_view.h.

Member Typedef Documentation

◆ EvaluateModelWithParameter

typedef float(* Shared::CurveView::EvaluateModelWithParameter) (float t, void *model, void *context)

Definition at line 15 of file curve_view.h.

Member Enumeration Documentation

◆ Axis

Enumerator
Horizontal 
Vertical 

Definition at line 16 of file curve_view.h.

Constructor & Destructor Documentation

◆ CurveView()

Shared::CurveView::CurveView ( CurveViewRange curveViewRange = nullptr,
CurveViewCursor curveViewCursor = nullptr,
BannerView bannerView = nullptr,
View cursorView = nullptr,
View okView = nullptr 
)

Definition at line 12 of file curve_view.cpp.

Member Function Documentation

◆ computeLabels()

void Shared::CurveView::computeLabels ( Axis  axis)
protected

Definition at line 130 of file curve_view.cpp.

◆ drawAxes()

void Shared::CurveView::drawAxes ( KDContext ctx,
KDRect  rect,
Axis  axis 
) const
protected

Definition at line 282 of file curve_view.cpp.

◆ drawCurve()

void Shared::CurveView::drawCurve ( KDContext ctx,
KDRect  rect,
EvaluateModelWithParameter  evaluation,
void *  model,
void *  context,
KDColor  color,
bool  colorUnderCurve = false,
float  colorLowerBound = 0.0f,
float  colorUpperBound = 0.0f,
bool  continuously = false 
) const
protected

Definition at line 339 of file curve_view.cpp.

◆ drawDot()

void Shared::CurveView::drawDot ( KDContext ctx,
KDRect  rect,
float  x,
float  y,
KDColor  color,
bool  oversize = false 
) const
protected

Definition at line 241 of file curve_view.cpp.

◆ drawGrid()

void Shared::CurveView::drawGrid ( KDContext ctx,
KDRect  rect 
) const
protected

Definition at line 277 of file curve_view.cpp.

◆ drawGridLines()

void Shared::CurveView::drawGridLines ( KDContext ctx,
KDRect  rect,
Axis  axis,
float  step,
KDColor  color 
) const
protected

Definition at line 256 of file curve_view.cpp.

◆ drawHistogram()

void Shared::CurveView::drawHistogram ( KDContext ctx,
KDRect  rect,
EvaluateModelWithParameter  evaluation,
void *  model,
void *  context,
float  firstBarAbscissa,
float  barWidth,
bool  fillBar,
KDColor  defaultColor,
KDColor  highlightColor,
float  highlightLowerBound = INFINITY,
float  highlightUpperBound = -INFINITY 
) const
protected

Definition at line 382 of file curve_view.cpp.

◆ drawLabels()

void Shared::CurveView::drawLabels ( KDContext ctx,
KDRect  rect,
Axis  axis,
bool  shiftOrigin 
) const
protected

Definition at line 146 of file curve_view.cpp.

◆ drawLine()

void Shared::CurveView::drawLine ( KDContext ctx,
KDRect  rect,
Axis  axis,
float  coordinate,
KDColor  color,
KDCoordinate  thickness = 1 
) const
protected

Definition at line 175 of file curve_view.cpp.

◆ drawSegment()

void Shared::CurveView::drawSegment ( KDContext ctx,
KDRect  rect,
Axis  axis,
float  coordinate,
float  lowerBound,
float  upperBound,
KDColor  color,
KDCoordinate  thickness = 1 
) const
protected

Definition at line 196 of file curve_view.cpp.

◆ floatToPixel()

float Shared::CurveView::floatToPixel ( Axis  axis,
float  f 
) const
protected

Definition at line 115 of file curve_view.cpp.

◆ isMainViewSelected()

bool Shared::CurveView::isMainViewSelected ( ) const

Definition at line 42 of file curve_view.cpp.

◆ pixelToFloat()

float Shared::CurveView::pixelToFloat ( Axis  axis,
KDCoordinate  p 
) const
protected

Definition at line 110 of file curve_view.cpp.

◆ reload()

void Shared::CurveView::reload ( )
virtual

◆ resolution()

float Shared::CurveView::resolution ( ) const

Definition at line 83 of file curve_view.cpp.

◆ samplingRatio()

float Shared::CurveView::samplingRatio ( ) const
protectedvirtual

Definition at line 87 of file curve_view.cpp.

◆ selectMainView()

void Shared::CurveView::selectMainView ( bool  mainViewSelected)

Definition at line 46 of file curve_view.cpp.

◆ setBannerView()

void Shared::CurveView::setBannerView ( View bannerView)

Definition at line 71 of file curve_view.cpp.

◆ setCursorView()

void Shared::CurveView::setCursorView ( View cursorView)

Definition at line 64 of file curve_view.cpp.

◆ setCurveViewRange()

void Shared::CurveView::setCurveViewRange ( CurveViewRange curveViewRange)
protected

Definition at line 53 of file curve_view.cpp.

◆ setOkView()

void Shared::CurveView::setOkView ( View okView)

Definition at line 77 of file curve_view.cpp.

Member Data Documentation

◆ k_externRectMargin

constexpr int Shared::CurveView::k_externRectMargin = 2
staticprotected

Definition at line 39 of file curve_view.h.

◆ k_labelGraduationLength

constexpr KDCoordinate Shared::CurveView::k_labelGraduationLength = 6
staticprotected

Definition at line 36 of file curve_view.h.

◆ k_labelMargin

constexpr KDCoordinate Shared::CurveView::k_labelMargin = 4
staticprotected

Definition at line 34 of file curve_view.h.

◆ k_maxNumberOfXLabels

constexpr int Shared::CurveView::k_maxNumberOfXLabels = CurveViewRange::k_maxNumberOfXGridUnits
staticprotected

Definition at line 37 of file curve_view.h.

◆ k_maxNumberOfYLabels

constexpr int Shared::CurveView::k_maxNumberOfYLabels = CurveViewRange::k_maxNumberOfYGridUnits
staticprotected

Definition at line 38 of file curve_view.h.

◆ k_okMargin

constexpr KDCoordinate Shared::CurveView::k_okMargin = 10
staticprotected

Definition at line 35 of file curve_view.h.

◆ m_bannerView

View* Shared::CurveView::m_bannerView
protected

Definition at line 56 of file curve_view.h.

◆ m_curveViewCursor

CurveViewCursor* Shared::CurveView::m_curveViewCursor
protected

Definition at line 57 of file curve_view.h.


The documentation for this class was generated from the following files: