Class Graph

Inheritance Relationships

Base Type

Class Documentation

class Graph : public nanogui::Widget

Simple graph widget for showing a function plot.

Public Functions

Graph(Widget *parent, const std::string &caption = "Untitled")
const std::string &caption() const
void setCaption(const std::string &caption)
const std::string &header() const
void setHeader(const std::string &header)
const std::string &footer() const
void setFooter(const std::string &footer)
const Color &backgroundColor() const
void setBackgroundColor(const Color &backgroundColor)
const Color &foregroundColor() const
void setForegroundColor(const Color &foregroundColor)
const Color &textColor() const
void setTextColor(const Color &textColor)
const VectorXf &values() const
VectorXf &values()
void setValues(const VectorXf &values)
virtual Vector2i preferredSize(NVGcontext *ctx) const

Compute the preferred size of the widget.

virtual void draw(NVGcontext *ctx)

Draw the widget (and all child widgets)

virtual void save(Serializer &s) const

Save the state of the widget into the given Serializer instance.

virtual bool load(Serializer &s)

Restore the state of the widget from the given Serializer instance.

Protected Attributes

std::string mCaption
std::string mHeader
std::string mFooter
Color mBackgroundColor
Color mForegroundColor
Color mTextColor
VectorXf mValues