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

This is a class for isomteric 3D drawing. More...

#include <capd/krak/coord3d.h>

Public Member Functions

 IsomCoord3D (capd::krak::Frame *frm=NULL, int orient=0)
 Creates a IsomCoord3D object. More...
 
virtual ~IsomCoord3D ()
 
virtual int orientation ()
 Returns the orientation of the system. More...
 
virtual int setOrientation (int i)
 Sets the orientation of the system. More...
 
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. More...
 
virtual void drawAxis ()
 Draws the axis of the system. More...
 
capd::krak::Frameframe ()
 Returns the frame to which the object is attached. More...
 
capd::krak::FramesetFrame (capd::krak::Frame *f)
 Sets the frame of the object to _frm . More...
 
void setCenter (int i, int j)
 Sets the center (i.e. More...
 
double scale ()
 Returns the scale (the factor which is used when translating 3D coordinates to pixels) More...
 
double setScale (double s)
 Sets the scale of the system to scale . More...
 
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. More...
 
int fgColor ()
 Returns the foreground color of the attached frame. More...
 
int setFgColor (int fc)
 Sets the foreground color of the attached frame to color . More...
 
int bgColor ()
 Returns the background color of the attached frame. More...
 
int setBgColor (int bc)
 Sets the background color of the attached frame to color . More...
 
virtual void clear ()
 Clears the attached frame. More...
 
Point3D pos ()
 Returns the current position. More...
 
virtual void jump (const Point3D &pt)
 Jumps to the point pt . More...
 
virtual void jump (double x, double y, double z)
 Jumps to the point (_x, _y , _z ) . More...
 
virtual void dot (double x, double y, double z, int color=FRAME_FG)
 Draws a dot at the position (x, y , z) . More...
 
void dot (const Point3D &p, int color=FRAME_FG)
 Draws a dot at the position (p). More...
 
virtual void lineTo (double x, double y, double z, int color=FRAME_FG)
 Draws a line from the current position the position (x), y , z . More...
 
void lineTo (const Point3D &p, int color=FRAME_FG)
 Draws a line from the current position the position (p). More...
 
virtual void line (double x1, double y1, double z1, double x2, double y2, double z2, int color=FRAME_FG)
 Draws a line from the point (x1, y1 , z1 ) to (x2 , y2 , z2 ) . More...
 
void line (const Point3D &p1, const Point3D &p2, int color=FRAME_FG)
 Draws a line from the point p1 to p2. More...
 
virtual void box (double x1, double y1, double z1, double x2, double y2, double z2, int color=FRAME_FG)
 Draws a box with a corner in (x1, y1 , z1 ) and and in (x2, y2 , z2). More...
 
void box (const Point3D &p1, const Point3D &p2, int color=FRAME_FG)
 Draws a box with a corner in p1 and and in p2. More...
 
virtual void Xcrss (double x, double y, double z, int size=1, int color=FRAME_FG)
 Draw a cross with in the point (x), y , z and and in (x2), y2 , z2 . More...
 
void Xcrss (const Point3D &p, int size=1, int color=FRAME_FG)
 

Protected Attributes

int orient
 
capd::krak::Framefrm
 
int cx
 
int cy
 
Point3D cpos
 
double sc
 

Detailed Description

This is a class for isomteric 3D drawing.

Most function are inherited from Coord3D::top(Coord3D).

Example use:

  IsomCoord3D c(frm);      // c will draw on the frame frm
  c.setFgColor(BLACK);     // this function sets the color of
                           // the attached frame
  c.setScale(0.1);         // this sets the size of a logical unit
  c.jump(15.2, 17, 44);
  c.lineTo(33.2, 32, 45);
  c.box(45, 56, 67,
        -123, -23, -56, RED);
  //etc...

Constructor & Destructor Documentation

◆ ~IsomCoord3D()

virtual capd::krak::IsomCoord3D::~IsomCoord3D ( )
inlinevirtual

Member Function Documentation

◆ box()

void capd::krak::Coord3D::box ( const Point3D p1,
const Point3D p2,
int  color = FRAME_FG 
)
inlineinherited

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.

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

◆ dot()

void capd::krak::Coord3D::dot ( const Point3D p,
int  color = FRAME_FG 
)
inlineinherited

Draws a dot at the position (p).

The current position is unaffected.

Parameters
colorThe color of the dot. If it is FRAME_FG then the current foreground color is used

◆ frame()

capd::krak::Frame* capd::krak::Coord3D::frame ( )
inlineinherited

Returns the frame to which the object is attached.

◆ line()

void capd::krak::Coord3D::line ( const Point3D p1,
const Point3D p2,
int  color = FRAME_FG 
)
inlineinherited

Draws a line from the point p1 to p2.

The current position is moved the end of the line.

Parameters
colorThe color of the line. If it is FRAME_FG then the current foreground color is used

◆ lineTo()

void capd::krak::Coord3D::lineTo ( const Point3D p,
int  color = FRAME_FG 
)
inlineinherited

Draws a line from the current position the position (p).

The current position is moved the end of the line.

Parameters
colorThe color of the line. If it is FRAME_FG then the current foreground color is used

◆ map()

void capd::krak::Coord3D::map ( const Point3D p,
int i,
int j 
)
inlineinherited

Maps the 3D coordinates of the point p to the frame pixel coordinates (this is a pure virtual function in Coord3D.

Implemented in IsomCoord3D::top(IsomCoord3D))

◆ pos()

Point3D capd::krak::Coord3D::pos ( )
inlineinherited

Returns the current position.

◆ scale()

double capd::krak::Coord3D::scale ( )
inlineinherited

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

◆ Xcrss()

void capd::krak::Coord3D::Xcrss ( const Point3D p,
int  size = 1,
int  color = FRAME_FG 
)
inlineinherited

Member Data Documentation

◆ cpos

Point3D capd::krak::Coord3D::cpos
protectedinherited

◆ cx

int capd::krak::Coord3D::cx
protectedinherited

◆ cy

int capd::krak::Coord3D::cy
protectedinherited

◆ frm

capd::krak::Frame* capd::krak::Coord3D::frm
protectedinherited

◆ orient

int capd::krak::IsomCoord3D::orient
protected

◆ sc

double capd::krak::Coord3D::sc
protectedinherited