A fuzzy logic C++ library
Public Member Functions | Protected Member Functions | Protected Attributes
slifis_plot::PLOT_RB Class Reference

this is a pure virtual root class for the 2 type of plots for a rule base : PLOT_RB_2D and PLOT_RB_TEXT It holds common attributes (GRID) More...

#include <plot_rb.hpp>

+ Inheritance diagram for slifis_plot::PLOT_RB:
+ Collaboration diagram for slifis_plot::PLOT_RB:

List of all members.

Public Member Functions

 PLOT_RB (const slifis::RULE_BASE &rule_base, int w=400, int h=300)
virtual ~PLOT_RB ()
virtual bool Draw ()=0
 Returns a bool, because in some situations, we will not be able to draw the plot (returns false).
virtual std::string GetPlotName () const =0
bool GetIndexCoordinates (int x, int y, size_t &idx_col, size_t &idx_row) const
 Transform Screen coordinates (x,y) into index coordinates.

Protected Member Functions

void Resize (int w, int h)
 Changes size of plot.

Protected Attributes

const slifis::RULE_BASErb
 Pointer on original rule base, given through constructor.
GRID _grid
 the grid...

Detailed Description

this is a pure virtual root class for the 2 type of plots for a rule base : PLOT_RB_2D and PLOT_RB_TEXT It holds common attributes (GRID)


Constructor & Destructor Documentation

slifis_plot::PLOT_RB::PLOT_RB ( const slifis::RULE_BASE rule_base,
int  w = 400,
int  h = 300 
)

References __IN__, and __OUT__.


Member Function Documentation

virtual bool slifis_plot::PLOT_RB::Draw ( ) [pure virtual]

Returns a bool, because in some situations, we will not be able to draw the plot (returns false).

Implements slifis_plot::PLOT.

Implemented in slifis_plot::PLOT_RB_TEXT, and slifis_plot::PLOT_RB_2D.

virtual std::string slifis_plot::PLOT_RB::GetPlotName ( ) const [pure virtual]
bool slifis_plot::PLOT_RB::GetIndexCoordinates ( int  x,
int  y,
size_t &  idx_col,
size_t &  idx_row 
) const

Transform Screen coordinates (x,y) into index coordinates.

  • Returns true if screen coordinates points to a cell, false if not. In this latter case, index values are left unchanged
  • Please note that the returned indexes are "grid" indexes. If object is of type PLOT_RB_2D, then you may need to add +1 to both axis to get the correct indexes

References __IN__, __OUT__, _grid, slifis_plot::PLOT::_margins, slifis_plot::GRID::GetCell(), slifis_plot::GRID_CELL::GetH(), slifis_plot::PLOT::GetH(), slifis_plot::GRID::GetNbCols(), slifis_plot::GRID::GetNbRows(), slifis_plot::GRID_CELL::GetW(), slifis_plot::PLOT::GetW(), slifis_plot::GRID_CELL::GetX(), slifis_plot::GRID_CELL::GetY(), slifis_plot::PLOT_MARGINS::m_hl, slifis_plot::PLOT_MARGINS::m_hr, slifis_plot::PLOT_MARGINS::m_vb, and slifis_plot::PLOT_MARGINS::m_vt.

Referenced by slifis_plot::PLOT_RB_TEXT::GetPositionInfo(), and Mouse_CB_rb_2D().

void slifis_plot::PLOT_RB::Resize ( int  w,
int  h 
) [protected]

Member Data Documentation