Multiplot  0.5.5
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
multiplot::Multiplot Class Reference

#include <multiplot.h>

Inheritance diagram for multiplot::Multiplot:
multiplot::Multiplot_base

Classes

class  Point2d
 
class  Trace
 

Public Member Functions

 Multiplot (const int x, const int y, const int w, const int h, const std::wstring &ttitle=L"Multiplot - updates on www.andre-krause.net", bool fullscreen=false)
 
Traceoperator[] (int _trace)
 
Traceoperator() (int _trace)
 
Tracetrace (int _trace)
 
void plot (const float x, const float y)
 
template<class T >
void plot (const std::vector< T > &v)
 
void color3f (float r, float g, float b)
 
void set_title (const std::wstring &title_)
 
void set_linewidth (float width)
 
void set_pointsize (float psize)
 
void set_scrolling (int max_points_to_plot)
 
void set_scaling (enum MP_SCALING sc, float x_min=-10, float x_max=10, float y_min=-10, float y_max=10)
 
void set_grid (enum MP_GRIDSTYLE ggridx=MP_LINEAR_GRID, enum MP_GRIDSTYLE ggridy=MP_LINEAR_GRID, float ggridx_step=-1.0, float ggridy_step=-1.0, float w=1.0)
 
void set_bg_color (float r, float g, float b)
 
void set_grid_color (float r, float g, float b)
 
void clear_all ()
 
void clear (int trace)
 
- Public Member Functions inherited from multiplot::Multiplot_base
 Multiplot_base (int x, int y, int w, int h, const std::wstring &ttitle, bool fullscreen)
 
void show ()
 
bool check ()
 
unsigned int w ()
 
unsigned int h ()
 
bool valid ()
 
void valid (bool v)
 
void set_caption (const std::wstring &t)
 
void redraw ()
 

Protected Member Functions

void initgl ()
 
Point2d draw_grid ()
 
virtual void draw ()
 
- Protected Member Functions inherited from multiplot::Multiplot_base
LRESULT WndProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
bool CreateGLWindow (int x, int y, int width, int height, const std::wstring &title, BYTE bits=0, bool fullscreenflag=false)
 
void DestroyGLWindow ()
 

Protected Attributes

float cur_point_size
 
unsigned int cur_trace
 
std::wstring title
 
Point2d bg_color
 
Point2d grid_color
 
int scaling_
 
Point2d range_min
 
Point2d range_max
 
Point2d minimum
 
Point2d maximum
 
Point2d scale
 
Point2d offset
 
std::vector< Tracetraces
 
int gridx
 
int gridy
 
float gridx_step
 
float gridy_step
 
float grid_linewidth
 
Point2d grid_spacing
 
- Protected Attributes inherited from multiplot::Multiplot_base
unsigned int width
 
unsigned int height
 
bool valid_
 
bool active
 
bool fullscreen
 
HDC hDC
 
HGLRC hRC
 
HWND hWnd
 
HINSTANCE hInstance
 

Additional Inherited Members

- Static Protected Member Functions inherited from multiplot::Multiplot_base
static LRESULT CALLBACK StaticWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK window_handler (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Detailed Description

this class creates a window to wich you can add an arbitrary number of autoscaling traces.

Member Function Documentation

◆ clear()

void multiplot::Multiplot::clear ( int  trace)
inline

this function call clears trace number t

◆ clear_all()

void multiplot::Multiplot::clear_all ( )
inline

this function call simply clears all traces

◆ color3f()

void multiplot::Multiplot::color3f ( float  r,
float  g,
float  b 
)
inline

change current drawing color for current trace.

◆ operator()()

Trace& multiplot::Multiplot::operator() ( int  _trace)
inline

Access function. allows direct access to a trace.

◆ operator[]()

Trace& multiplot::Multiplot::operator[] ( int  _trace)
inline

Access function. allows direct access to a trace.

◆ plot() [1/2]

void multiplot::Multiplot::plot ( const float  x,
const float  y 
)
inline

plots a point at x,y to the currently active trace. select a trace with a call to trace(int _tracenumber);

◆ plot() [2/2]

template<class T >
void multiplot::Multiplot::plot ( const std::vector< T > &  v)
inline

plots a vector of values to the currently active trace. the x value is running from 0 .. vector.size()-1 select a trace with a call to trace(int _tracenumber);

◆ set_bg_color()

void multiplot::Multiplot::set_bg_color ( float  r,
float  g,
float  b 
)
inline

sets the background color

◆ set_grid()

void multiplot::Multiplot::set_grid ( enum MP_GRIDSTYLE  ggridx = MP_LINEAR_GRID,
enum MP_GRIDSTYLE  ggridy = MP_LINEAR_GRID,
float  ggridx_step = -1.0,
float  ggridy_step = -1.0,
float  w = 1.0 
)
inline

call this function if you wish a grid to be plotted in your graph. by default, no grids are plotted. call this function with the first two arguments set to either MP_NO_GRID, MP_LINEAR_GRID or MP_LOG_GRID. the next two arguments gridx_step and gridy_step specify the grid spacing. Zero or a negative value like -1 enables auto - spacing. The last parameter w sets the grid-linewidth. the default is 1 pixel.

◆ set_grid_color()

void multiplot::Multiplot::set_grid_color ( float  r,
float  g,
float  b 
)
inline

sets the grid color

◆ set_linewidth()

void multiplot::Multiplot::set_linewidth ( float  width)
inline

changes current line width.

◆ set_pointsize()

void multiplot::Multiplot::set_pointsize ( float  psize)
inline

changes current point size.

◆ set_scaling()

void multiplot::Multiplot::set_scaling ( enum MP_SCALING  sc,
float  x_min = -10,
float  x_max = 10,
float  y_min = -10,
float  y_max = 10 
)
inline

changes the (auto-)scaling behaviour of the multiplot window. you can choose between MP_AUTO_SCALE MP_AUTO_SCALE_EQUAL MP_FIXED_SCALE

◆ set_scrolling()

void multiplot::Multiplot::set_scrolling ( int  max_points_to_plot)
inline

changes scrolling behaviour for current trace - see class Trace for details.

◆ set_title()

void multiplot::Multiplot::set_title ( const std::wstring &  title_)
inline

sets the window title.

◆ trace()

Trace& multiplot::Multiplot::trace ( int  _trace)
inline

sets the current trace. traces are numbered from zero to N. memory for the traces is automatically allocated.


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