MatOCAD Logo

Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

PnlGraph Class Reference

Bidimensional graph visualization. More...

#include <PnlGraph.h>

Collaboration diagram for PnlGraph:

Collaboration graph
[legend]
List of all members.

Public Member Functions

double calculate_ordinata (double y)
 Converts the given y absolute position to the respective ordinata.
double calculate_ascissa (double x)
 Converts the given x absolute position to the respective ascissa.
wxMenu * GetPopUp ()
 Return the pop-up menu of the object.
 PnlGraph (wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxSIMPLE_BORDER, const wxString &name=_T("panel"))
 Constructor.
void SettingsClick (wxCommandEvent &event)
 Open the settings window DlgOpzioni.

Public Attributes

OpzGrafico options
 Structure OpzGrafico that contains general options.

Private Member Functions

int calculate_y (double ordinata)
 Converts the given ordinata to an y absolute position.
int calculate_x (double ascissa)
 Converts the given ascissa to an x absolute position.
void draw_function (rif *pointstructure, color colore, int width)
 Function that draws the entire scene.
void draw_axis (void)
 Function that cartesian axis.
void draw_grid (void)
 Function that draw the grid if enabled.
void draw_steps (void)
 Function that draw the steps on the axis if enabled.
void OnLeftUp (wxMouseEvent &event)
 Process the left up mouse event.
void OnRightDown (wxMouseEvent &event)
 Process the right down mouse event.
void OnMotion (wxMouseEvent &event)
 Process the on motion mouse event.
void OnLeftDown (wxMouseEvent &event)
 Process the left down mouse event.
void OnPaint (wxPaintEvent &event)
 Process the paint event to redraw the graph.

Private Attributes

wxPaintDC * sheet
 Buffer for drawing functions.
wxMenu * PopLista
 right-click popup menu

Detailed Description

Bidimensional graph visualization.

PnlGraph class shows bidimensional graphs of inserted function it's derived from wxPanel

Definition at line 22 of file PnlGraph.h.


Constructor & Destructor Documentation

PnlGraph::PnlGraph wxWindow *  parent,
wxWindowID  id = -1,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxSIMPLE_BORDER,
const wxString &  name = _T("panel")
 

Constructor.

Definition at line 67 of file PnlGraph.cpp.

References PopLista.


Member Function Documentation

double PnlGraph::calculate_ascissa double  x  ) 
 

Converts the given x absolute position to the respective ascissa.

Parameters:
x the x position to convert.
Returns:
the absolute ascissa of the given x position.
See also:
calculate_ordinata(), calculate_y() and calculate_x()

Definition at line 51 of file PnlGraph.cpp.

References options, OpzGrafico::xmax, and OpzGrafico::xmin.

Referenced by PnlGraphFrame::PointerMoved().

double PnlGraph::calculate_ordinata double  y  ) 
 

Converts the given y absolute position to the respective ordinata.

Parameters:
y the y position to convert.
Returns:
the absolute ordinata of the given y position.
See also:
calculate_ascissa(), calculate_y() and calculate_x()

Definition at line 59 of file PnlGraph.cpp.

References options, OpzGrafico::ymax, and OpzGrafico::ymin.

Referenced by PnlGraphFrame::PointerMoved().

int PnlGraph::calculate_x double  ascissa  )  [private]
 

Converts the given ascissa to an x absolute position.

Parameters:
ascissa the ascissa to convert.
Returns:
the absolute x position of the given ascissa.
See also:
calculate_ordinata(), calculate_ascissa() and calculate_y()

Definition at line 42 of file PnlGraph.cpp.

References options, OpzGrafico::xmax, and OpzGrafico::xmin.

Referenced by draw_axis(), draw_function(), draw_grid(), and draw_steps().

int PnlGraph::calculate_y double  ordinata  )  [private]
 

Converts the given ordinata to an y absolute position.

Parameters:
ordinata the ordinata to convert.
Returns:
the absolute y position of the given ordinata.
See also:
calculate_ordinata(), calculate_ascissa() and calculate_x()

Referenced by draw_axis(), draw_function(), draw_grid(), and draw_steps().

void PnlGraph::draw_axis void   )  [private]
 

Function that cartesian axis.

Definition at line 112 of file PnlGraph.cpp.

References calculate_x(), calculate_y(), options, sheet, OpzGrafico::xaxis, OpzGrafico::xmax, OpzGrafico::xmin, OpzGrafico::yaxis, OpzGrafico::ymax, and OpzGrafico::ymin.

Referenced by OnPaint().

void PnlGraph::draw_function rif pointstructure,
color  colore,
int  width
[private]
 

Function that draws the entire scene.

The values to show are calculated by TParserValore

Parameters:
pointstructure the stucture containing the function scomposed by TParserScomponi.
color the color of function.
width the drawing width of the function.
See also:
draw_axis(), draw_steps() and draw_grid()

Definition at line 140 of file PnlGraph.cpp.

References col::blue, TParserValore::CalcolaValore(), calculate_x(), calculate_y(), col::green, options, col::red, sheet, OpzGrafico::xmax, OpzGrafico::xmin, OpzGrafico::ymax, and OpzGrafico::ymin.

Referenced by OnPaint().

void PnlGraph::draw_grid void   )  [private]
 

Function that draw the grid if enabled.

Definition at line 175 of file PnlGraph.cpp.

References calculate_x(), calculate_y(), OpzGrafico::nstepsx, OpzGrafico::nstepsy, options, sheet, OpzGrafico::xgrid, OpzGrafico::xmax, OpzGrafico::xmin, OpzGrafico::ygrid, OpzGrafico::ymax, and OpzGrafico::ymin.

Referenced by OnPaint().

void PnlGraph::draw_steps void   )  [private]
 

Function that draw the steps on the axis if enabled.

Definition at line 273 of file PnlGraph.cpp.

References calculate_x(), calculate_y(), OpzGrafico::nstepsx, OpzGrafico::nstepsy, options, sheet, OpzGrafico::showstepsx, OpzGrafico::showstepsy, OpzGrafico::xmax, OpzGrafico::xmin, OpzGrafico::ymax, and OpzGrafico::ymin.

Referenced by OnPaint().

wxMenu * PnlGraph::GetPopUp  ) 
 

Return the pop-up menu of the object.

Returns:
the popoup menu

Definition at line 346 of file PnlGraph.cpp.

References PopLista.

void PnlGraph::OnLeftDown wxMouseEvent &  event  )  [private]
 

Process the left down mouse event.

Definition at line 213 of file PnlGraph.cpp.

void PnlGraph::OnLeftUp wxMouseEvent &  event  )  [private]
 

Process the left up mouse event.

Definition at line 240 of file PnlGraph.cpp.

void PnlGraph::OnMotion wxMouseEvent &  event  )  [private]
 

Process the on motion mouse event.

Definition at line 252 of file PnlGraph.cpp.

void PnlGraph::OnPaint wxPaintEvent &  event  )  [private]
 

Process the paint event to redraw the graph.

Definition at line 75 of file PnlGraph.cpp.

References OpzGrafico::bgcolor, draw_axis(), draw_function(), draw_grid(), draw_steps(), TLista::ExtractColor(), TLista::ExtractDrawFlag(), TLista::ExtractStructure(), TLista::ExtractWidth(), OpzGrafico::functions, TLista::nelements, options, and sheet.

void PnlGraph::OnRightDown wxMouseEvent &  event  )  [private]
 

Process the right down mouse event.

Definition at line 226 of file PnlGraph.cpp.

References PopLista.

void PnlGraph::SettingsClick wxCommandEvent &  event  ) 
 

Open the settings window DlgOpzioni.

Definition at line 337 of file PnlGraph.cpp.

Referenced by MainFrm::BtnModificaClick().


Member Data Documentation

OpzGrafico PnlGraph::options
 

Structure OpzGrafico that contains general options.

Definition at line 136 of file PnlGraph.h.

Referenced by calculate_ascissa(), calculate_ordinata(), calculate_x(), PnlGraphFrame::CheckOptions(), draw_axis(), draw_function(), draw_grid(), draw_steps(), PnlObjTree::FillFunction(), OnPaint(), and PnlGraphFrame::TxtValueChanged().

wxMenu* PnlGraph::PopLista [private]
 

right-click popup menu

Definition at line 35 of file PnlGraph.h.

Referenced by GetPopUp(), OnRightDown(), and PnlGraph().

wxPaintDC* PnlGraph::sheet [private]
 

Buffer for drawing functions.

Definition at line 32 of file PnlGraph.h.

Referenced by draw_axis(), draw_function(), draw_grid(), draw_steps(), and OnPaint().


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

 

SourceForge Logo