Milo  0.1
Milo:EquationManipulationProgram
Private Member Functions | Private Attributes | List of all members
AsciiGraphics Class Reference
Inheritance diagram for AsciiGraphics:
Inheritance graph
[legend]
Collaboration diagram for AsciiGraphics:
Collaboration graph
[legend]

Public Member Functions

Constructor and Virtual Destructor
 AsciiGraphics (ostream &os)
 
 ~AsciiGraphics ()
 
Virtual Public Member Functions
int getTextHeight ()
 
int getTextLength (const std::string &s)
 
int getCharLength (char)
 
int getParenthesisWidth (int)
 
int getDivideLineHeight ()
 
int getDifferentialHeight (char)
 
int getDifferentialWidth (char)
 
int getDifferentialBase (char)
 
void differential (int x0, int y0, char variable)
 
void parenthesis (int x_size, int y_size, int x0, int y0)
 
void horiz_line (int x_size, int x0, int y0)
 
void at (int x, int y, int c, Attributes, Color color=BLACK)
 
void at (int x, int y, const string &s, Attributes, Color color=BLACK)
 
void out ()
 
void clear_screen ()
 
virtual void set (int x, int y, int, int)
 
- Public Member Functions inherited from UI::Graphics
 Graphics ()
 
virtual ~Graphics ()
 
virtual void at (int x0, int y0, const std::string &s, Attributes chrAttr, Color color=BLACK)=0
 
virtual void setSelect (int x, int y, int x0, int y0)
 
void set (const Box &box)
 
void setSelect (const Box &box)
 
void parenthesis (const Box &box)
 
void relativeOrig (int &x, int &y)
 

Private Member Functions

void at (int x, int y, int c)
 

Private Attributes

vector< string > m_field
 2D text array.
 
vector< vector< Color > > m_colors
 2D color array.
 
ostream & m_os
 Stream to ouput text array.
 
KeyEvent m_keyEvent = 0
 dummy storage
 

Additional Inherited Members

- Public Types inherited from UI::Graphics
enum  Color {
  BLACK, RED, GREEN, YELLOW,
  BLUE, MAGENTA, CYAN, WHITE
}
 
enum  Attributes { NONE =0, BOLD =1, ITALIC =2, BOLD_ITALIC =3 }
 
- Protected Attributes inherited from UI::Graphics
int m_xSize
 Horizontal size of graphic window.
 
int m_ySize
 Vertical size of graphic window.
 
int m_xOrig
 Horizontal origin of graphic window.
 
int m_yOrig
 Vertical origin of graphic window.
 
Box m_select
 Currently selected area.
 

Detailed Description

Class derived from ABC graphics so Equation can draw to a 2D character array.

Member Function Documentation

void AsciiGraphics::at ( int  x,
int  y,
int  c,
Attributes  ,
Color  color = BLACK 
)
inlinevirtual

Draw a string at x,y with a color.

Parameters
xHorizontal origin of line.
yVertical origin of line.
cCharacter to be drawn at x0,y0.
colorColor of line.

Implements UI::Graphics.

void AsciiGraphics::at ( int  x,
int  y,
const string &  s,
Attributes  ,
Color  color = BLACK 
)

Draw a string at x,y with a color.

Parameters
xHorizontal origin of line.
yVertical origin of line.
sString to be drawn at x0,y0.
colorColor of line.
void AsciiGraphics::at ( int  x,
int  y,
int  c 
)
inlineprivate

Draw a string at x,y with a color.

Parameters
xHorizontal origin of line.
yVertical origin of line.
cCharacter to be drawn at x0,y0.
void AsciiGraphics::clear_screen ( )
virtual

Clear characters in text array.

Implements UI::Graphics.

void AsciiGraphics::differential ( int  x0,
int  y0,
char  variable 
)
virtual

Draw differential of width x0 and height y0 with char variable name.

Parameters
x0Horizontal origin of differential.
y0Vertical origin of differential.
variableName of variable of differential.

Implements UI::Graphics.

int AsciiGraphics::getCharLength ( char  )
inlinevirtual

Length of character in ASCII is 1.

Returns
Return one.

Implements UI::Graphics.

int AsciiGraphics::getDifferentialBase ( char  )
inlinevirtual

Get vertical offset of differential.

Returns
Vertical offset of differential in lines of text.

Implements UI::Graphics.

int AsciiGraphics::getDifferentialHeight ( char  )
inlinevirtual

Get height of differential in lines of text.

Returns
Height of differential in lines of text.

Implements UI::Graphics.

int AsciiGraphics::getDifferentialWidth ( char  )
inlinevirtual

Get width of differential in lines of text.

Returns
Width of differential in lines of text.

Implements UI::Graphics.

int AsciiGraphics::getDivideLineHeight ( )
inlinevirtual

Get height of line in a division node which is always 1.

Returns
Return one.

Implements UI::Graphics.

int AsciiGraphics::getParenthesisWidth ( int  )
inlinevirtual

Get width of a parenthesis in characters which is always 1.

Returns
Return one.

Implements UI::Graphics.

int AsciiGraphics::getTextHeight ( )
inlinevirtual

Get height of text in lines.

Returns
All ASCII characters are one line in height.

Implements UI::Graphics.

int AsciiGraphics::getTextLength ( const std::string &  s)
inlinevirtual

Get length of string in characters.

Returns
Length of string in characters.

Implements UI::Graphics.

void AsciiGraphics::horiz_line ( int  x_size,
int  x0,
int  y0 
)
inlinevirtual

Draw a horizontal line starting at x0,y0 length x_size.

Parameters
x_sizeHorizontal size of both line.
x0Horizontal origin of line.
y0Vertical origin of line.

Implements UI::Graphics.

void AsciiGraphics::out ( )
virtual

Flush all characters to the text array.

Implements UI::Graphics.

void AsciiGraphics::parenthesis ( int  x_size,
int  y_size,
int  x0,
int  y0 
)
virtual

Draw pair of parenthesis around a node of size x_size, y_size and origin x0,y0.

Parameters
x_sizeHorizontal size of both parenthesis.
y_sizeVertical size of parenthesis.
x0Horizontal origin of parenthesis.
y0Vertical origin of parenthesis.

Implements UI::Graphics.

virtual void AsciiGraphics::set ( int  x,
int  y,
int  ,
int   
)
inlinevirtual

Set size of the text array (origin is always 0,0).

Parameters
xHorizontal size of text array.
yVertical size of text array.

Reimplemented from UI::Graphics.


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