Coord3D

description...

public:


Description:

This is a base class for 3D drawing functions. This is a abstract class. The IsomCoord3D class implements the isometric 3D drawing functions.


Coord3D(Frame *_frm)
Creates a new Coord3D object.
_frmthe frame to which the coordinates are attached.

Frame *frame()
Returns the frame to which the object is attached.

Frame *setFrame(Frame *f)
Sets the frame of the object to _frm. If the frame was NULL, the center position is set to the center of the frame. The funcition returns the previous frame.

See also:
setCenter

void setCenter(int i, int j)
Sets the center (i.e. the position of the ogrin of the coordinate system) to (i, j) (in pixel coordinates)

double scale()
Returns the scale (the factor which is used when translating 3D coordinates to pixels)

double setScale(double s)
Sets the scale of the system to scale.

virtual void map(double x, double y, double z, int *i, int *j)
Maps the 3D coordinates of the point (x, y, z) to the frame pixel coordinates (this is a pure virtual function in Coord3D. Implemented in
IsomCoord3D)

void map(const Point3D &p, int *i, int *j)
Maps the 3D coordinates of the point p to the frame pixel coordinates (this is a pure virtual function in Coord3D. Implemented in
IsomCoord3D)

int fgColor()
Returns the foreground color of the attached frame. Put here for convenience.

int setFgColor(int fc)
Sets the foreground color of the attached frame to color. Put here for convenience.

int bgColor()
Returns the background color of the attached frame. Put here for convenience.

int setBgColor(int bc)
Sets the background color of the attached frame to color. Put here for convenience.

virtual void clear()
Clears the attached frame. Put here for convenience.

Point3D pos()
Returns the current position.

virtual void jump(const Point3D &pt)
Jumps to the point pt. Changes also the current position of the attached frame.

virtual void jump(double x, double y, double z)
Jumps to the point (_x, _y, _z. Changes also the current position of the attached frame.

virtual void dot(double x, double y, double z, int color)
Draws a dot at the position (x, y, z). The current position is unaffected.
colorThe color of the dot. If it is FRAME_FG then the current foreground color is used

void dot(const Point3D &p, int color)
Draws a dot at the position (p). The current position is unaffected.
colorThe color of the dot. If it is FRAME_FG then the current foreground color is used

virtual void lineTo(double x, double y, double z, int color)
Draws a line from the current position the position (x, y, z. The current position is moved the end of the line.
colorThe color of the line. If it is FRAME_FG then the current foreground color is used

void lineTo(const Point3D &p, int color)
Draws a line from the current position the position (p. The current position is moved the end of the line.
colorThe color of the line. If it is FRAME_FG then the current foreground color is used

virtual void line(double x1, double y1, double z1, double x2, double y2, double z2, int color)
Draws a line from the point (x1, y1, z1) to (x2, y2, z2). The current position is moved the end of the line.
colorThe color of the line. If it is FRAME_FG then the current foreground color is used

void line(const Point3D &p1, const Point3D &p2, int color)
Draws a line from the point p1 to p2. The current position is moved the end of the line.
colorThe color of the line. If it is FRAME_FG then the current foreground color is used

virtual void box(double x1, double y1, double z1, double x2, double y2, double z2, int color)
Draws a box with a corner in (x1, y1, z1) and and in (x2, y2, z2). The edges are parallel to the axis. The current position is moved to (x2, y2, z2).
colorThe color of the box. If it is FRAME_FG then the current foreground color is used

void box(const Point3D &p1, const Point3D &p2, int color)
Draws a box with a corner in p1 and and in p2. The edges are parallel to the axis. The current position is moved to p2.
colorThe color of the box. If it is FRAME_FG then the current foreground color is used

virtual void Xcrss(double x, double y, double z, int size, int color)
Draw a cross with in the point (x, y, z) and and in (x2, y2, z2. The edges are parallel to the axis. The current position is moved to (x2, y2, z2).
colorThe color of the cross. If it is FRAME_FG then the current foreground color is used

virtual void drawAxis()
Draws the axis of the system. (this is a pure virtual function in Coord3D. Implemented in IsomCoord3D)