CAPD DynSys Library  5.2.0
capd::krak::Frame Class Reference

#include <capd/krak/krak-library.h>

Public Member Functions

void initFrm (int arglti, int argltj, int argrbi, int argrbj, int bgc=WHITE, int fgc=BLACK, int im=fontHght/2, int jm=fontWdth/2)
 
 Frame (void)
 Generates a new frame as a subframe of rootFrm with left top corner at the top left corner of rootFrm, right bottom corner at the botton right bottom cornet of rootFrm, and black and white colors. More...
 
 Frame (int lti, int ltj, int rbi, int rbj, int bgc=WHITE, int fgc=BLACK, int im=fontWdth/2, int jm=fontHght/2)
 It generates a new frame as a subframe of rootFrame with left top corner (lti,ltj), right bottom corner at (rbi,rbj). More...
 
 Frame (const Frame &prntFrm, const capd::krak::At &lt, const capd::krak::At &rb, int bgc=WHITE, int fgc=BLACK, int im=fontWdth/2, int jm=fontHght/2)
 Generates a new frame as a subframe of prntFrm with left top corner lt, right bottom corner at rb, where the coordinates are given in columns and rows of the parent frame. More...
 
 Frame (Frame &prntFrm, int lti, int ltj, int rbi, int rbj, int bgc=WHITE, int fgc=BLACK, int im=fontHght/2, int jm=fontWdth/2)
 Generates a new frame as a subframe of prntFrm with left top corner (lti,ltj),right bottom corner at (rbi,rbj), where the coordinates are given in percentage of the horizontal and vertical size of the parent frame. More...
 
 Frame (Frame &prntFrm, int lti, int ltj, int rbi, int rbj, double swx, double swy, double nex, double ney, int bgc=WHITE, int fgc=BLACK, int im=fontHght/2, int jm=fontWdth/2)
 Generates a new frame as a subframe of prntFrm and sets the world coordinates and colors. More...
 
void Locate (Frame &prntFrm, capd::krak::At &lt, capd::krak::At &rb)
 Moves the left top corner to lt and the left botton corner to rb where the coordinates are given in text cells. More...
 
void Locate (Frame &prntFrm, int lti, int ltj, int rbi, int rbj)
 Moves the left top corner to (arglti, argltj) and the left botton corner to (argrbi, argrbj) where the coordinates are given in percentage. More...
 
void setWorldCoord (double swx, double swy, double nex, double ney)
 Sets to world coordinates. More...
 
void adjust (void)
 
int NoCol (void)
 Return the number of columns in the frame. More...
 
int NoRow (void)
 Return the number of rows in the frame. More...
 
void Clear (void)
 Clears the frame with the background color and moves the current position to (0,0) More...
 
void Clear (int color)
 Clears the frame with the color color and moves the current position to (0,0) More...
 
void Bound (int color=BLACK)
 Draw a boundary around the frame in color color. More...
 
void SetBgColor (int c)
 Sets the background color to c. More...
 
void SetFgColor (int c)
 Sets the foreground color to c. More...
 
int getRow (capd::krak::Pxl &pxl)
 returns the character row that correspond to the pixel pxl More...
 
int getCol (capd::krak::Pxl &pxl)
 returns the character column that correspond to the pixel pxl More...
 
int x2i (double x)
 Translates world coordinate x to a device coordinate. More...
 
int y2j (double y)
 Translates world coordinate y to a device coordinate. More...
 
double x2p (double x)
 Same as x2i() but returns a double. More...
 
double y2q (double y)
 Same as y2j() but returns a double. More...
 
double i2x (int i)
 Translates device coordinate i to a world coordinate. More...
 
double j2y (int j)
 Translates device coordinate j to a world coordinate. More...
 
void jump (int i, int j)
 Moves the current position to (i, j), in device coordinates. More...
 
void draw (int i, int j, int color=FRAME_FG)
 draws a line from the current position to (i, j) using the color color. More...
 
void drawText (const char *c, int i, int j, int color=FRAME_FG)
 draws the text given by t from the current position using the color color. More...
 
void dot (int i, int j, int color=FRAME_FG)
 Draw a dot at position (i, j) (in pixel coordinates) and color color. More...
 
void circle (int i, int j, int r, int color=FRAME_FG)
 Draw a circle at position (i, j) of radius r (in pixel coordinates) and color color. More...
 
void line (int i1, int j1, int i2, int j2, int color=FRAME_FG)
 Draws a line from the point (x1, y1) to (x2, y2) (in pixel coordinates)in the color color. More...
 
void box (int lti, int ltj, int rbi, int rbj, int color=FRAME_FG)
 draws a box (an empty rectangle) with the left top corner in (lti, ltj) and the right botton corner in (rbi, rbj), in device coordinates. More...
 
void boxFill (int lti, int ltj, int rbi, int rbj, int col, int pattern=SOLID_P)
 Draws a filled box with the botton left corner at (swx, swy) and the right top corner at (nex, ney). More...
 
void jump (double x, double y)
 Moves the current position to (x, y), in world coordinates. More...
 
void draw (double x, double y, int color=FRAME_FG)
 Draws a line from the current position to (x, y) (in world coordinates) using the color color. More...
 
void drawText (const char *c, double x, double y, int color=FRAME_FG)
 Draws a text from the position (x, y) (in world coordinates) using the color color. More...
 
void dot (double x, double y, int color=FRAME_FG)
 Draw a dot at position (x, y) (in world coordinates) and color color. More...
 
void circle (double x, double y, int r, int color=FRAME_FG)
 Draw a circle at position (x, y) (in world coordinates) of radius r (in pixel coordinates) and color color. More...
 
void line (double x1, double y1, double x2, double y2, int color=FRAME_FG)
 Draws a line from the point (x1, y1) to (x2, y2) (in world coordinates)in the color color. More...
 
void box (double swx, double swy, double nex, double ney, int color=FRAME_FG)
 draws a box (an empty rectangle) with the left botton corner in (swx, swy) and the right top corner in (nex, ney), in world coordinates. More...
 
void boxFill (double swx, double swy, double nex, double ney, int col, int pattern=SOLID_P)
 Draws a filled box with the botton left corner at (swx, swy) and the right top corner at (nex, ney). More...
 
void Xcrss (double x, double y, int size=1, int color=FRAME_FG)
 Draw a cross at position (x, y) (in world coordinates), color color and size size. More...
 
int precision (int p)
 
Frameoperator<< (char c)
 Prints the character c at the current position. More...
 
Frameoperator<< (int n)
 Prints the number n at the current position. More...
 
Frameoperator<< (long n)
 Prints the number n at the current position. More...
 
Frameoperator<< (double r)
 Outputs the double r, eg. More...
 
Frameoperator<< (const capd::krak::frstring &a_string)
 Outputs the string a_string on the frame. More...
 
Frameoperator<< (const char *text)
 Outputs the string text on the frame. More...
 
Frameoperator<< (const capd::krak::colstring &a_colstring)
 Print a color text on the frame. More...
 
Frameoperator<< (const capd::krak::FgColor &c)
 Changes the foreground color of the frame, like: More...
 
Frameoperator<< (const capd::krak::BgColor &c)
 Changes the background color of the frame, like: More...
 
Frameoperator<< (capd::krak::Tab tab)
 Moves the current position to the column refered by tab. More...
 
Frameoperator>> (const capd::krak::At &at)
 The same as operator<< - changes the current position to at. More...
 
Frameoperator>> (const capd::krak::FgColor &c)
 The same as operator<< - changes the foreground color to c. More...
 
Frameoperator>> (const capd::krak::BgColor &c)
 The same as operator<< - changes the background color to c. More...
 
int isInside (capd::krak::Pxl &p)
 Checks if the pixel pxl (in device coordinates) is inside the frame. More...
 
Frameoperator>> (capd::krak::frstring &a_string)
 Reads a string from the keyboard. More...
 
Frameoperator>> (int &n)
 Reads a number from the keyboard using getText(). More...
 
Frameoperator>> (long &n)
 Reads a number from the keyboard using getText(). More...
 
Frameoperator>> (double &r)
 Reads a double from the keyboard using getText(). More...
 
int Edit (At at, int no_col, capd::krak::frstring &s)
 A more sophisticated version of getText. More...
 
 Frame (void)
 
 Frame (int lti, int ltj, int rbi, int rbj, int bgc=WHITE, int fgc=BLACK, int im=fontWdth/2, int jm=fontHght/2)
 
void setWorldCoord (double swx, double swy, double nex, double ney)
 
void Clear (void)
 
void Clear (int color)
 
void Bound (int color=BLACK)
 
void SetBgColor (int c)
 
void SetFgColor (int c)
 
void jump (int i, int j)
 
void draw (int i, int j, int color=FRAME_FG)
 
void drawText (const char *c, int i, int j, int color=FRAME_FG)
 
void dot (int i, int j, int color=FRAME_FG)
 
void circle (int i, int j, int r, int color=FRAME_FG)
 
void line (int i1, int j1, int i2, int j2, int color=FRAME_FG)
 
void box (int lti, int ltj, int rbi, int rbj, int color=FRAME_FG)
 
void boxFill (int lti, int ltj, int rbi, int rbj, int col, int pattern=SOLID_P)
 
void jump (double x, double y)
 
void draw (double x, double y, int color=FRAME_FG)
 
void drawText (const char *c, double x, double y, int color=FRAME_FG)
 
void dot (double x, double y, int color=FRAME_FG)
 
void circle (double x, double y, int r, int color=FRAME_FG)
 
void line (double x1, double y1, double x2, double y2, int color=FRAME_FG)
 
void box (double swx, double swy, double nex, double ney, int color=FRAME_FG)
 
void boxFill (double swx, double swy, double nex, double ney, int col, int pattern=SOLID_P)
 
void Xcrss (double x, double y, int size=1, int color=FRAME_FG)
 
int precision (int p)
 
Frameoperator<< (char c)
 
Frameoperator<< (int n)
 
Frameoperator<< (long n)
 
Frameoperator<< (double r)
 
Frameoperator<< (const char *text)
 
Frameoperator<< (const capd::krak::FgColor &c)
 
Frameoperator<< (const capd::krak::BgColor &c)
 
Frameoperator<< (capd::krak::Tab tab)
 
Frameoperator>> (const capd::krak::At &at)
 
Frameoperator>> (const capd::krak::FgColor &c)
 
Frameoperator>> (const capd::krak::BgColor &c)
 
Frameoperator>> (int &n)
 
Frameoperator>> (long &n)
 
Frameoperator>> (double &r)
 
void initFrm (int arglti, int argltj, int argrbi, int argrbj, int bgc=WHITE, int fgc=BLACK, int im=fontHght/2, int jm=fontWdth/2)
 
 Frame (void)
 
 Frame (int lti, int ltj, int rbi, int rbj, int bgc=WHITE, int fgc=BLACK, int im=fontWdth/2, int jm=fontHght/2)
 
 Frame (const Frame &prntFrm, const At &lt, const At &rb, int bgc=WHITE, int fgc=BLACK, int im=fontWdth/2, int jm=fontHght/2)
 
 Frame (Frame &prntFrm, int lti, int ltj, int rbi, int rbj, int bgc=WHITE, int fgc=BLACK, int im=fontHght/2, int jm=fontWdth/2)
 
 Frame (Frame &prntFrm, int lti, int ltj, int rbi, int rbj, double swx, double swy, double nex, double ney, int bgc=WHITE, int fgc=BLACK, int im=fontHght/2, int jm=fontWdth/2)
 
void Locate (Frame &prntFrm, At &lt, At &rb)
 
void Locate (Frame &prntFrm, int lti, int ltj, int rbi, int rbj)
 
void setWorldCoord (double swx, double swy, double nex, double ney)
 
void adjust (void)
 
int NoCol (void)
 
int NoRow (void)
 
void Clear (void)
 
void Clear (int color)
 
void Bound (int color=BLACK)
 
void SetBgColor (int c)
 
void SetFgColor (int c)
 
int getRow (PXL &pxl)
 
int getCol (PXL &pxl)
 
int x2i (double x)
 
int y2j (double y)
 
double x2p (double x)
 
double y2q (double y)
 
double i2x (int i)
 
double j2y (int j)
 
void jump (int i, int j)
 
void draw (int i, int j, int color=FRAME_FG)
 
void drawText (const char *c, int i, int j, int color=FRAME_FG)
 
void dot (int i, int j, int color=FRAME_FG)
 
void circle (int i, int j, int r, int color=FRAME_FG)
 
void line (int i1, int j1, int i2, int j2, int color=FRAME_FG)
 
void box (int lti, int ltj, int rbi, int rbj, int color=FRAME_FG)
 
void boxFill (int lti, int ltj, int rbi, int rbj, int col, int pattern=SOLID_P)
 
void polygon (int coords[], int nPoints, int color=FRAME_FG)
 
void polygonFill (int coords[], int nPoints, int col, int pattern=SOLID_P)
 
void arc (int lti, int ltj, int rbi, int rbj, int bi, int bj, int ei, int ej, int color=FRAME_FG)
 
void arcFill (int lti, int ltj, int rbi, int rbj, int bi, int bj, int ei, int ej, int col, int pattern=SOLID_P)
 
void ellipse (int lti, int ltj, int rbi, int rbj, int color=FRAME_FG)
 Draws an ellipse bound by the rectangle of world coordinates coordinates (lti,ltj) and (rbi,rbj). More...
 
void ellipseFill (int lti, int ltj, int rbi, int rbj, int col, int pattern=SOLID_P)
 Draws an ellipse bound by the rectangle of world coordinates coordinates (lti,ltj) and (rbi,rbj). More...
 
void jump (double x, double y)
 
void draw (double x, double y, int color=FRAME_FG)
 
void dot (double x, double y, int color=FRAME_FG)
 
void circle (double x, double y, int r, int color=FRAME_FG)
 
void line (double x1, double y1, double x2, double y2, int color=FRAME_FG)
 
void box (double swx, double swy, double nex, double ney, int color=FRAME_FG)
 
void boxFill (double swx, double swy, double nex, double ney, int col, int pattern=SOLID_P)
 
void polygon (double coords[], int nPoints, int color=FRAME_FG)
 
void polygonFill (double coords[], int nPoints, int col, int pattern=SOLID_P)
 
void arc (double swx, double swy, double nex, double ney, double bx, double by, double ex, double ey, int color=FRAME_FG)
 Draws an arc of an ellipse bound by the rectangle of world coordinates coordinates (swx,swy) and (nex,ney). More...
 
void arcFill (double swx, double swy, double nex, double ney, double bx, double by, double ex, double ey, int col, int pattern=SOLID_P)
 Fills and area between an arc and its chord. More...
 
void ellipse (double swx, double swy, double nex, double ney, int color=FRAME_FG)
 Draws an ellipse bound by the rectangle of world coordinates coordinates (swx,swy) and (nex,ney). More...
 
void ellipseFill (double swx, double swy, double nex, double ney, int col, int pattern=SOLID_P)
 Draws an ellipse bound by the rectangle of world coordinates coordinates (swx,swy) and (nex,ney). More...
 
void Xcrss (double x, double y, int size=1, int color=FRAME_FG)
 
int precision (int p)
 
Frameoperator<< (char c)
 
Frameoperator<< (int n)
 
Frameoperator<< (long n)
 
Frameoperator<< (double r)
 
Frameoperator<< (const frstring &a_string)
 
Frameoperator<< (const char *text)
 
Frameoperator<< (colstring &a_colstring)
 
Frameoperator<< (const FgColor &c)
 
Frameoperator<< (const BgColor &c)
 
Frameoperator<< (Tab tab)
 
Frameoperator>> (const At &at)
 
Frameoperator>> (const FgColor &c)
 
Frameoperator>> (const BgColor &c)
 
int isInside (PXL &p)
 
Frameoperator>> (frstring &a_string)
 
Frameoperator>> (int &n)
 
Frameoperator>> (long &n)
 
Frameoperator>> (double &r)
 
int Edit (At at, int no_col, frstring &s)
 

Public Attributes

int ltj
 
int lti
 
int rbj
 
int rbi
 
int cj
 
int ci
 
int imarg
 
int jmarg
 
double swx
 
double swy
 
double nex
 
double ney
 
int cRow
 
int cCol
 
int lRow
 
int lCol
 
int bgColor
 
int fgColor
 
int prec
 

Friends

Frameoperator<< (Frame &f, const capd::krak::At &at)
 Moves the current position to the cell refered by at, like: More...
 
Frameoperator<< (Frame &f, const capd::krak::At &at)
 Moves the current position to the cell refered by at, like: More...
 
Frameoperator<< (Frame &f, const At &at)
 Moves the current position to the cell refered by at, like: More...
 

Constructor & Destructor Documentation

◆ Frame() [1/7]

capd::krak::Frame::Frame ( void  )

Generates a new frame as a subframe of rootFrm with left top corner at the top left corner of rootFrm, right bottom corner at the botton right bottom cornet of rootFrm, and black and white colors.

◆ Frame() [2/7]

capd::krak::Frame::Frame ( int  arglti,
int  argltj,
int  argrbi,
int  argrbj,
int  bgc = WHITE,
int  fgc = BLACK,
int  im = fontWdth/2,
int  jm = fontHght/2 
)

It generates a new frame as a subframe of rootFrame with left top corner (lti,ltj), right bottom corner at (rbi,rbj).

bgc and fgc are the background and foreground color, im and jm are the margins.

◆ Frame() [3/7]

capd::krak::Frame::Frame ( void  )

◆ Frame() [4/7]

capd::krak::Frame::Frame ( int  lti,
int  ltj,
int  rbi,
int  rbj,
int  bgc = WHITE,
int  fgc = BLACK,
int  im = fontWdth/2,
int  jm = fontHght/2 
)

◆ Frame() [5/7]

capd::krak::Frame::Frame ( const Frame prntFrm,
const At lt,
const At rb,
int  bgc = WHITE,
int  fgc = BLACK,
int  im = fontWdth/2,
int  jm = fontHght/2 
)

◆ Frame() [6/7]

capd::krak::Frame::Frame ( Frame prntFrm,
int  lti,
int  ltj,
int  rbi,
int  rbj,
int  bgc = WHITE,
int  fgc = BLACK,
int  im = fontHght/2,
int  jm = fontWdth/2 
)

◆ Frame() [7/7]

capd::krak::Frame::Frame ( Frame prntFrm,
int  lti,
int  ltj,
int  rbi,
int  rbj,
double  swx,
double  swy,
double  nex,
double  ney,
int  bgc = WHITE,
int  fgc = BLACK,
int  im = fontHght/2,
int  jm = fontWdth/2 
)

Member Function Documentation

◆ adjust() [1/2]

void capd::krak::Frame::adjust ( void  )
inline

◆ adjust() [2/2]

void capd::krak::Frame::adjust ( void  )

◆ arc() [1/2]

void capd::krak::Frame::arc ( double  swx,
double  swy,
double  nex,
double  ney,
double  bx,
double  by,
double  ex,
double  ey,
int  color = FRAME_FG 
)
inline

Draws an arc of an ellipse bound by the rectangle of world coordinates coordinates (swx,swy) and (nex,ney).

The arc is indicated by the points (bx,by) and (ex,ey). The arc is drawn in the color i@(color)

◆ arc() [2/2]

void capd::krak::Frame::arc ( int  lti,
int  ltj,
int  rbi,
int  rbj,
int  bi,
int  bj,
int  ei,
int  ej,
int  color = FRAME_FG 
)

◆ arcFill() [1/2]

void capd::krak::Frame::arcFill ( double  swx,
double  swy,
double  nex,
double  ney,
double  bx,
double  by,
double  ex,
double  ey,
int  color,
int  pattern = SOLID_P 
)
inline

Fills and area between an arc and its chord.

The arch is an arc of an ellipse bound by the rectangle of world coordinates coordinates (swx,swy) and (nex,ney). The arc is indicated by the points (bx,by) and (ex,ey). The arc is drawn in the color i@(color)

◆ arcFill() [2/2]

void capd::krak::Frame::arcFill ( int  lti,
int  ltj,
int  rbi,
int  rbj,
int  bi,
int  bj,
int  ei,
int  ej,
int  col,
int  pattern = SOLID_P 
)

◆ Bound() [1/2]

void capd::krak::Frame::Bound ( int  color = BLACK)
inline

Draw a boundary around the frame in color color.

◆ Bound() [2/2]

void capd::krak::Frame::Bound ( int  color = BLACK)

◆ box() [1/4]

void capd::krak::Frame::box ( double  swx,
double  swy,
double  nex,
double  ney,
int  color = FRAME_FG 
)
inlinevirtual

draws a box (an empty rectangle) with the left botton corner in (swx, swy) and the right top corner in (nex, ney), in world coordinates.

Parameters
colorThe color of the box. If it is FRAME_FG then the frame foreground color is used

Implements capd::krak::IFrame.

◆ box() [2/4]

void capd::krak::Frame::box ( double  swx,
double  swy,
double  nex,
double  ney,
int  color = FRAME_FG 
)
virtual

Implements capd::krak::IFrame.

◆ box() [3/4]

void capd::krak::Frame::box ( int  lti,
int  ltj,
int  rbi,
int  rbj,
int  color = FRAME_FG 
)
inlinevirtual

draws a box (an empty rectangle) with the left top corner in (lti, ltj) and the right botton corner in (rbi, rbj), in device coordinates.

Parameters
colorThe color of the box. If it is FRAME_FG then the frame foreground color is used

Implements capd::krak::IFrame.

◆ box() [4/4]

void capd::krak::Frame::box ( int  lti,
int  ltj,
int  rbi,
int  rbj,
int  color = FRAME_FG 
)
virtual

Implements capd::krak::IFrame.

◆ boxFill() [1/4]

void capd::krak::Frame::boxFill ( double  swx,
double  swy,
double  nex,
double  ney,
int  col,
int  pattern = SOLID_P 
)
inlinevirtual

Draws a filled box with the botton left corner at (swx, swy) and the right top corner at (nex, ney).

The box is filled with color color

Implements capd::krak::IFrame.

◆ boxFill() [2/4]

void capd::krak::Frame::boxFill ( double  swx,
double  swy,
double  nex,
double  ney,
int  col,
int  pattern = SOLID_P 
)
virtual

Implements capd::krak::IFrame.

◆ boxFill() [3/4]

void capd::krak::Frame::boxFill ( int  lti,
int  ltj,
int  rbi,
int  rbj,
int  col,
int  pattern = SOLID_P 
)
inlinevirtual

Draws a filled box with the botton left corner at (swx, swy) and the right top corner at (nex, ney).

The box is filled with color color

Implements capd::krak::IFrame.

◆ boxFill() [4/4]

void capd::krak::Frame::boxFill ( int  lti,
int  ltj,
int  rbi,
int  rbj,
int  col,
int  pattern = SOLID_P 
)
virtual

Implements capd::krak::IFrame.

◆ circle() [1/4]

void capd::krak::Frame::circle ( double  x,
double  y,
int  r,
int  color = FRAME_FG 
)
virtual

Draw a circle at position (x, y) (in world coordinates) of radius r (in pixel coordinates) and color color.

Implements capd::krak::IFrame.

◆ circle() [2/4]

void capd::krak::Frame::circle ( double  x,
double  y,
int  r,
int  color = FRAME_FG 
)
virtual

Implements capd::krak::IFrame.

◆ circle() [3/4]

void capd::krak::Frame::circle ( int  i,
int  j,
int  r,
int  color = FRAME_FG 
)

Draw a circle at position (i, j) of radius r (in pixel coordinates) and color color.

◆ circle() [4/4]

void capd::krak::Frame::circle ( int  i,
int  j,
int  r,
int  color = FRAME_FG 
)

◆ Clear() [1/4]

void capd::krak::Frame::Clear ( int  color)
inline

Clears the frame with the color color and moves the current position to (0,0)

◆ Clear() [2/4]

void capd::krak::Frame::Clear ( int  color)

◆ Clear() [3/4]

void capd::krak::Frame::Clear ( void  )
inline

Clears the frame with the background color and moves the current position to (0,0)

◆ Clear() [4/4]

void capd::krak::Frame::Clear ( void  )

◆ dot() [1/4]

void capd::krak::Frame::dot ( double  x,
double  y,
int  color = FRAME_FG 
)
virtual

Draw a dot at position (x, y) (in world coordinates) and color color.

Implements capd::krak::IFrame.

◆ dot() [2/4]

void capd::krak::Frame::dot ( double  x,
double  y,
int  color = FRAME_FG 
)
virtual

Implements capd::krak::IFrame.

◆ dot() [3/4]

void capd::krak::Frame::dot ( int  i,
int  j,
int  color = FRAME_FG 
)

Draw a dot at position (i, j) (in pixel coordinates) and color color.

◆ dot() [4/4]

void capd::krak::Frame::dot ( int  i,
int  j,
int  color = FRAME_FG 
)

◆ draw() [1/4]

void capd::krak::Frame::draw ( double  x,
double  y,
int  color = FRAME_FG 
)
inlinevirtual

Draws a line from the current position to (x, y) (in world coordinates) using the color color.

Draws a line from from the current position to (x, y) (in world coordinates) using the color color.

Implements capd::krak::IFrame.

◆ draw() [2/4]

void capd::krak::Frame::draw ( double  x,
double  y,
int  color = FRAME_FG 
)
virtual

Implements capd::krak::IFrame.

◆ draw() [3/4]

void capd::krak::Frame::draw ( int  i,
int  j,
int  color = FRAME_FG 
)
virtual

draws a line from the current position to (i, j) using the color color.

If color is FRAME_FG then the frame foreground color is used.

Implements capd::krak::IFrame.

◆ draw() [4/4]

void capd::krak::Frame::draw ( int  i,
int  j,
int  color = FRAME_FG 
)
virtual

Implements capd::krak::IFrame.

◆ drawText() [1/3]

void capd::krak::Frame::drawText ( const char *  c,
double  x,
double  y,
int  color = FRAME_FG 
)
inlinevirtual

Draws a text from the position (x, y) (in world coordinates) using the color color.

Implements capd::krak::IFrame.

◆ drawText() [2/3]

void capd::krak::Frame::drawText ( const char *  t,
int  i,
int  j,
int  color = FRAME_FG 
)

draws the text given by t from the current position using the color color.

If color is FRAME_FG then the frame foreground color is used.

◆ drawText() [3/3]

void capd::krak::Frame::drawText ( const char *  c,
int  i,
int  j,
int  color = FRAME_FG 
)

◆ Edit()

int capd::krak::Frame::Edit ( At  at,
int  no_col,
frstring s 
)

◆ ellipse() [1/2]

void capd::krak::Frame::ellipse ( double  swx,
double  swy,
double  nex,
double  ney,
int  color = FRAME_FG 
)
inline

Draws an ellipse bound by the rectangle of world coordinates coordinates (swx,swy) and (nex,ney).

The ellipse is drawn in the color i@(color)

◆ ellipse() [2/2]

void capd::krak::Frame::ellipse ( int  lti,
int  ltj,
int  rbi,
int  rbj,
int  color = FRAME_FG 
)
inline

Draws an ellipse bound by the rectangle of world coordinates coordinates (lti,ltj) and (rbi,rbj).

The ellipse is drawn in the color i@(color)

◆ ellipseFill() [1/2]

void capd::krak::Frame::ellipseFill ( double  swx,
double  swy,
double  nex,
double  ney,
int  color,
int  pattern = SOLID_P 
)
inline

Draws an ellipse bound by the rectangle of world coordinates coordinates (swx,swy) and (nex,ney).

The ellipse is drawn in the color i@(color) pattern i@(pattern) in the color i@(color)

◆ ellipseFill() [2/2]

void capd::krak::Frame::ellipseFill ( int  lti,
int  ltj,
int  rbi,
int  rbj,
int  color,
int  pattern = SOLID_P 
)
inline

Draws an ellipse bound by the rectangle of world coordinates coordinates (lti,ltj) and (rbi,rbj).

The ellipse is filled with the pattern i@(pattern) in the color i@(color)

◆ getCol() [1/2]

int capd::krak::Frame::getCol ( capd::krak::Pxl pxl)
inline

returns the character column that correspond to the pixel pxl

◆ getCol() [2/2]

int capd::krak::Frame::getCol ( PXL pxl)

◆ getRow() [1/2]

int capd::krak::Frame::getRow ( capd::krak::Pxl pxl)
inline

returns the character row that correspond to the pixel pxl

◆ getRow() [2/2]

int capd::krak::Frame::getRow ( PXL pxl)

◆ i2x() [1/2]

double capd::krak::Frame::i2x ( int  i)
inline

Translates device coordinate i to a world coordinate.

◆ i2x() [2/2]

double capd::krak::Frame::i2x ( int  i)

◆ initFrm()

void capd::krak::Frame::initFrm ( int  arglti,
int  argltj,
int  argrbi,
int  argrbj,
int  bgc = WHITE,
int  fgc = BLACK,
int  im = fontHght/2,
int  jm = fontWdth/2 
)

◆ isInside() [1/2]

int capd::krak::Frame::isInside ( capd::krak::Pxl p)
inline

Checks if the pixel pxl (in device coordinates) is inside the frame.

◆ isInside() [2/2]

int capd::krak::Frame::isInside ( PXL p)

◆ j2y() [1/2]

double capd::krak::Frame::j2y ( int  j)
inline

Translates device coordinate j to a world coordinate.

◆ j2y() [2/2]

double capd::krak::Frame::j2y ( int  j)

◆ jump() [1/4]

void capd::krak::Frame::jump ( double  x,
double  y 
)
inlinevirtual

Moves the current position to (x, y), in world coordinates.

Implements capd::krak::IFrame.

◆ jump() [2/4]

void capd::krak::Frame::jump ( double  x,
double  y 
)
virtual

Implements capd::krak::IFrame.

◆ jump() [3/4]

void capd::krak::Frame::jump ( int  i,
int  j 
)
inlinevirtual

Moves the current position to (i, j), in device coordinates.

Implements capd::krak::IFrame.

◆ jump() [4/4]

void capd::krak::Frame::jump ( int  i,
int  j 
)
virtual

Implements capd::krak::IFrame.

◆ line() [1/4]

void capd::krak::Frame::line ( double  x1,
double  y1,
double  x2,
double  y2,
int  color = FRAME_FG 
)
virtual

Draws a line from the point (x1, y1) to (x2, y2) (in world coordinates)in the color color.

The current position is moved to the end of the line

Implements capd::krak::IFrame.

◆ line() [2/4]

void capd::krak::Frame::line ( double  x1,
double  y1,
double  x2,
double  y2,
int  color = FRAME_FG 
)
virtual

Implements capd::krak::IFrame.

◆ line() [3/4]

void capd::krak::Frame::line ( int  x1,
int  y1,
int  x2,
int  y2,
int  color = FRAME_FG 
)
virtual

Draws a line from the point (x1, y1) to (x2, y2) (in pixel coordinates)in the color color.

The current position is moved to the end of the line

Implements capd::krak::IFrame.

◆ line() [4/4]

void capd::krak::Frame::line ( int  i1,
int  j1,
int  i2,
int  j2,
int  color = FRAME_FG 
)
virtual

Implements capd::krak::IFrame.

◆ Locate() [1/2]

void capd::krak::Frame::Locate ( Frame prntFrm,
At lt,
At rb 
)

◆ Locate() [2/2]

void capd::krak::Frame::Locate ( Frame prntFrm,
int  lti,
int  ltj,
int  rbi,
int  rbj 
)

◆ NoCol() [1/2]

int capd::krak::Frame::NoCol ( void  )
inline

Return the number of columns in the frame.

◆ NoCol() [2/2]

int capd::krak::Frame::NoCol ( void  )

◆ NoRow() [1/2]

int capd::krak::Frame::NoRow ( void  )
inline

Return the number of rows in the frame.

◆ NoRow() [2/2]

int capd::krak::Frame::NoRow ( void  )

◆ operator<<() [1/18]

Frame & capd::krak::Frame::operator<< ( capd::krak::Tab  tab)
inline

Moves the current position to the column refered by tab.

Moves the current position to the column refered by tab.

◆ operator<<() [2/18]

capd::krak::Frame & capd::krak::Frame::operator<< ( char  c)

Prints the character c at the current position.

◆ operator<<() [3/18]

Frame& capd::krak::Frame::operator<< ( char  c)

◆ operator<<() [4/18]

Frame& capd::krak::Frame::operator<< ( colstring a_colstring)

◆ operator<<() [5/18]

Frame& capd::krak::Frame::operator<< ( const BgColor c)

◆ operator<<() [6/18]

Frame & capd::krak::Frame::operator<< ( const capd::krak::BgColor c)
inline

Changes the background color of the frame, like:

frm<< BgColor(YELLOW)<<"yellow"<< BgColor(GREEN)<<"green"

◆ operator<<() [7/18]

Frame & capd::krak::Frame::operator<< ( const capd::krak::FgColor c)
inline

Changes the foreground color of the frame, like:

frm<< FgColor(RED)<<"red "<< FgColor(BLUE)<<"blue"

◆ operator<<() [8/18]

capd::krak::Frame & capd::krak::Frame::operator<< ( const char *  text)

Outputs the string text on the frame.

◆ operator<<() [9/18]

Frame& capd::krak::Frame::operator<< ( const char *  text)

◆ operator<<() [10/18]

Frame& capd::krak::Frame::operator<< ( const FgColor c)

◆ operator<<() [11/18]

Frame& capd::krak::Frame::operator<< ( const frstring a_string)

◆ operator<<() [12/18]

capd::krak::Frame & capd::krak::Frame::operator<< ( double  r)

Outputs the double r, eg.

:

frm<<3.14159;

◆ operator<<() [13/18]

Frame& capd::krak::Frame::operator<< ( double  r)

◆ operator<<() [14/18]

capd::krak::Frame & capd::krak::Frame::operator<< ( int  n)

Prints the number n at the current position.

◆ operator<<() [15/18]

Frame& capd::krak::Frame::operator<< ( int  n)

◆ operator<<() [16/18]

capd::krak::Frame & capd::krak::Frame::operator<< ( long  n)

Prints the number n at the current position.

◆ operator<<() [17/18]

Frame& capd::krak::Frame::operator<< ( long  n)

◆ operator<<() [18/18]

Frame& capd::krak::Frame::operator<< ( Tab  tab)

◆ operator>>() [1/13]

Frame& capd::krak::Frame::operator>> ( const At at)

◆ operator>>() [2/13]

Frame& capd::krak::Frame::operator>> ( const BgColor c)

◆ operator>>() [3/13]

Frame & capd::krak::Frame::operator>> ( const capd::krak::At at)
inline

The same as operator<< - changes the current position to at.

◆ operator>>() [4/13]

Frame & capd::krak::Frame::operator>> ( const capd::krak::BgColor c)
inline

The same as operator<< - changes the background color to c.

◆ operator>>() [5/13]

Frame & capd::krak::Frame::operator>> ( const capd::krak::FgColor c)
inline

The same as operator<< - changes the foreground color to c.

◆ operator>>() [6/13]

Frame& capd::krak::Frame::operator>> ( const FgColor c)

◆ operator>>() [7/13]

capd::krak::Frame & capd::krak::Frame::operator>> ( double r)

Reads a double from the keyboard using getText().

◆ operator>>() [8/13]

Frame& capd::krak::Frame::operator>> ( double r)

◆ operator>>() [9/13]

Frame& capd::krak::Frame::operator>> ( frstring a_string)

◆ operator>>() [10/13]

capd::krak::Frame & capd::krak::Frame::operator>> ( int n)

Reads a number from the keyboard using getText().

◆ operator>>() [11/13]

Frame& capd::krak::Frame::operator>> ( int n)

◆ operator>>() [12/13]

capd::krak::Frame & capd::krak::Frame::operator>> ( long &  n)

Reads a number from the keyboard using getText().

◆ operator>>() [13/13]

Frame& capd::krak::Frame::operator>> ( long &  n)

◆ polygon() [1/2]

void capd::krak::Frame::polygon ( double  coords[],
int  nPoints,
int  color = FRAME_FG 
)

◆ polygon() [2/2]

void capd::krak::Frame::polygon ( int  coords[],
int  nPoints,
int  color = FRAME_FG 
)

◆ polygonFill() [1/2]

void capd::krak::Frame::polygonFill ( double  coords[],
int  nPoints,
int  col,
int  pattern = SOLID_P 
)

◆ polygonFill() [2/2]

void capd::krak::Frame::polygonFill ( int  coords[],
int  nPoints,
int  col,
int  pattern = SOLID_P 
)

◆ precision() [1/2]

int capd::krak::Frame::precision ( int  p)
inline

◆ precision() [2/2]

int capd::krak::Frame::precision ( int  p)
inline

◆ SetBgColor() [1/2]

void capd::krak::Frame::SetBgColor ( int  c)
inline

Sets the background color to c.

Sets the background color to c .

◆ SetBgColor() [2/2]

void capd::krak::Frame::SetBgColor ( int  c)

◆ SetFgColor() [1/2]

void capd::krak::Frame::SetFgColor ( int  c)
inline

Sets the foreground color to c.

Sets the foreground color to c .

◆ SetFgColor() [2/2]

void capd::krak::Frame::SetFgColor ( int  c)

◆ setWorldCoord() [1/2]

void capd::krak::Frame::setWorldCoord ( double  the_swx,
double  the_swy,
double  the_nex,
double  the_ney 
)
inlinevirtual

Sets to world coordinates.

Parameters
swx,swythe coordinates of the bottom-left (southwest) corner
nex,neythe coordinates of the upper-right (northeast) corner

Implements capd::krak::IFrame.

◆ setWorldCoord() [2/2]

void capd::krak::Frame::setWorldCoord ( double  swx,
double  swy,
double  nex,
double  ney 
)
virtual

Implements capd::krak::IFrame.

◆ x2i() [1/2]

int capd::krak::Frame::x2i ( double  x)
inline

Translates world coordinate x to a device coordinate.

◆ x2i() [2/2]

int capd::krak::Frame::x2i ( double  x)

◆ x2p() [1/2]

double capd::krak::Frame::x2p ( double  x)
inline

Same as x2i() but returns a double.

Same as x2i()> but returns a double.

◆ x2p() [2/2]

double capd::krak::Frame::x2p ( double  x)

◆ Xcrss() [1/2]

void capd::krak::Frame::Xcrss ( double  x,
double  y,
int  size = 1,
int  color = FRAME_FG 
)
virtual

Draw a cross at position (x, y) (in world coordinates), color color and size size.

Implements capd::krak::IFrame.

◆ Xcrss() [2/2]

void capd::krak::Frame::Xcrss ( double  x,
double  y,
int  size = 1,
int  color = FRAME_FG 
)
virtual

Implements capd::krak::IFrame.

◆ y2j() [1/2]

int capd::krak::Frame::y2j ( double  y)
inline

Translates world coordinate y to a device coordinate.

◆ y2j() [2/2]

int capd::krak::Frame::y2j ( double  y)

◆ y2q() [1/2]

double capd::krak::Frame::y2q ( double  y)
inline

Same as y2j() but returns a double.

Same as y2j()> but returns a double.

◆ y2q() [2/2]

double capd::krak::Frame::y2q ( double  y)

Friends And Related Function Documentation

◆ operator<< [1/2]

Frame& operator<< ( Frame f,
const At at 
)
friend

Moves the current position to the cell refered by at, like:

Moves the current position to the cell refered by at , like:

frm<<At(30,30)<<"AAAAA";

◆ operator<< [2/2]

Frame& operator<< ( Frame f,
const capd::krak::At at 
)
friend

Moves the current position to the cell refered by at, like:

Moves the current position to the cell refered by at , like:

frm<<At(30,30)<<"AAAAA";