HOG2
Public Member Functions | Private Attributes | List of all members
Plotting::Line Class Reference

#include <Plot2D.h>

Public Member Functions

 Line (const char *label, tPlotType=kLinePlot)
 
void AddPoint (double x, double y)
 
void AddPoint (double x)
 
void Clear ()
 
const char * GetLabel ()
 
void ClearColor ()
 
void SetColor (double, double, double)
 
void SetColor (const rgbColor &c)
 
void SetWidth (float w)
 
void OpenGLDraw () const
 
void Draw (Graphics::Display &display, double xOff, double yOff, double xScale, double yScale) const
 
void SetHidden (bool val)
 
bool IsHidden ()
 
void Smooth (unsigned int windowSize)
 
bool GetChanged ()
 
void SetChange (bool val)
 
double GetMaxX ()
 
double GetMaxY ()
 
double GetMinX ()
 
double GetMinY ()
 
double DistanceToLine (double xp, double yp)
 
double VerticalDistanceToLine (double xp, double yp)
 

Private Attributes

bool changedLine
 
tPlotType plotType
 
double xMin
 
double xMax
 
double yMin
 
double yMax
 
double r
 
double g
 
double b
 
std::vector< double > x
 
std::vector< double > y
 
bool hidden
 
char name [1024]
 
float width
 

Detailed Description

Definition at line 25 of file Plot2D.h.

Constructor & Destructor Documentation

◆ Line()

Plotting::Line::Line ( const char *  label,
tPlotType  ptype = kLinePlot 
)

Definition at line 18 of file Plot2D.cpp.

References changedLine, ClearColor(), hidden, name, width, xMax, xMin, yMax, and yMin.

Member Function Documentation

◆ AddPoint() [1/2]

void Plotting::Line::AddPoint ( double  x)

Definition at line 42 of file Plot2D.cpp.

References AddPoint(), changedLine, and x.

◆ AddPoint() [2/2]

void Plotting::Line::AddPoint ( double  x,
double  y 
)

Definition at line 51 of file Plot2D.cpp.

References changedLine, x, xMax, xMin, y, yMax, and yMin.

Referenced by AddPoint().

◆ Clear()

void Plotting::Line::Clear ( )

Definition at line 32 of file Plot2D.cpp.

References x, xMax, xMin, y, yMax, and yMin.

◆ ClearColor()

void Plotting::Line::ClearColor ( )

Definition at line 121 of file Plot2D.cpp.

References r.

Referenced by Line().

◆ DistanceToLine()

double Plotting::Line::DistanceToLine ( double  xp,
double  yp 
)

Definition at line 69 of file Plot2D.cpp.

References fless(), x, and y.

◆ Draw()

void Plotting::Line::Draw ( Graphics::Display display,
double  xOff,
double  yOff,
double  xScale,
double  yScale 
) const

Definition at line 174 of file Plot2D.cpp.

References b, Graphics::Display::DrawLineSegments(), g, hidden, r, width, x, and y.

◆ GetChanged()

bool Plotting::Line::GetChanged ( )
inline

Definition at line 43 of file Plot2D.h.

References changedLine.

◆ GetLabel()

const char* Plotting::Line::GetLabel ( )
inline

Definition at line 31 of file Plot2D.h.

References name.

◆ GetMaxX()

double Plotting::Line::GetMaxX ( )
inline

Definition at line 45 of file Plot2D.h.

References xMax.

Referenced by Plotting::Plot2D::AddLine(), and Plotting::Plot2D::ResetAxis().

◆ GetMaxY()

double Plotting::Line::GetMaxY ( )
inline

Definition at line 46 of file Plot2D.h.

References yMax.

Referenced by Plotting::Plot2D::AddLine(), and Plotting::Plot2D::ResetAxis().

◆ GetMinX()

double Plotting::Line::GetMinX ( )
inline

Definition at line 47 of file Plot2D.h.

References xMin.

Referenced by Plotting::Plot2D::AddLine(), and Plotting::Plot2D::ResetAxis().

◆ GetMinY()

double Plotting::Line::GetMinY ( )
inline

Definition at line 48 of file Plot2D.h.

References yMin.

Referenced by Plotting::Plot2D::AddLine(), and Plotting::Plot2D::ResetAxis().

◆ IsHidden()

bool Plotting::Line::IsHidden ( )
inline

Definition at line 40 of file Plot2D.h.

References hidden.

◆ OpenGLDraw()

void Plotting::Line::OpenGLDraw ( ) const

Definition at line 138 of file Plot2D.cpp.

References b, g, hidden, Plotting::kImpulsePlot, Plotting::kLinePlot, plotType, r, x, and y.

◆ SetChange()

void Plotting::Line::SetChange ( bool  val)
inline

Definition at line 44 of file Plot2D.h.

References changedLine.

◆ SetColor() [1/2]

void Plotting::Line::SetColor ( const rgbColor c)

Definition at line 126 of file Plot2D.cpp.

References b, rgbColor::b, g, rgbColor::g, r, and rgbColor::r.

◆ SetColor() [2/2]

void Plotting::Line::SetColor ( double  _r,
double  _g,
double  _b 
)

Definition at line 133 of file Plot2D.cpp.

References b, g, and r.

◆ SetHidden()

void Plotting::Line::SetHidden ( bool  val)
inline

Definition at line 39 of file Plot2D.h.

References hidden.

◆ SetWidth()

void Plotting::Line::SetWidth ( float  w)
inline

Definition at line 36 of file Plot2D.h.

References width.

◆ Smooth()

void Plotting::Line::Smooth ( unsigned int  windowSize)
inline

Definition at line 99 of file Plot2D.cpp.

References x, and y.

◆ VerticalDistanceToLine()

double Plotting::Line::VerticalDistanceToLine ( double  xp,
double  yp 
)

Definition at line 83 of file Plot2D.cpp.

References x, and y.

Member Data Documentation

◆ b

double Plotting::Line::b
private

Definition at line 56 of file Plot2D.h.

Referenced by Draw(), OpenGLDraw(), and SetColor().

◆ changedLine

bool Plotting::Line::changedLine
private

Definition at line 53 of file Plot2D.h.

Referenced by AddPoint(), GetChanged(), Line(), and SetChange().

◆ g

double Plotting::Line::g
private

Definition at line 56 of file Plot2D.h.

Referenced by Draw(), OpenGLDraw(), and SetColor().

◆ hidden

bool Plotting::Line::hidden
private

Definition at line 59 of file Plot2D.h.

Referenced by Draw(), IsHidden(), Line(), OpenGLDraw(), and SetHidden().

◆ name

char Plotting::Line::name[1024]
private

Definition at line 60 of file Plot2D.h.

Referenced by GetLabel(), and Line().

◆ plotType

tPlotType Plotting::Line::plotType
private

Definition at line 54 of file Plot2D.h.

Referenced by OpenGLDraw().

◆ r

double Plotting::Line::r
private

Definition at line 56 of file Plot2D.h.

Referenced by ClearColor(), Draw(), OpenGLDraw(), and SetColor().

◆ width

float Plotting::Line::width
private

Definition at line 61 of file Plot2D.h.

Referenced by Draw(), Line(), and SetWidth().

◆ x

std::vector<double> Plotting::Line::x
private

Definition at line 57 of file Plot2D.h.

Referenced by AddPoint(), Clear(), DistanceToLine(), Draw(), OpenGLDraw(), Smooth(), and VerticalDistanceToLine().

◆ xMax

double Plotting::Line::xMax
private

Definition at line 55 of file Plot2D.h.

Referenced by AddPoint(), Clear(), GetMaxX(), and Line().

◆ xMin

double Plotting::Line::xMin
private

Definition at line 55 of file Plot2D.h.

Referenced by AddPoint(), Clear(), GetMinX(), and Line().

◆ y

std::vector<double> Plotting::Line::y
private

Definition at line 58 of file Plot2D.h.

Referenced by AddPoint(), Clear(), DistanceToLine(), Draw(), OpenGLDraw(), Smooth(), and VerticalDistanceToLine().

◆ yMax

double Plotting::Line::yMax
private

Definition at line 55 of file Plot2D.h.

Referenced by AddPoint(), Clear(), GetMaxY(), and Line().

◆ yMin

double Plotting::Line::yMin
private

Definition at line 55 of file Plot2D.h.

Referenced by AddPoint(), Clear(), GetMinY(), and Line().


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