Screen Class Reference

Screen is a camera. More...

#include <screen.hpp>

Collaboration diagram for Screen:

Collaboration graph
[legend]
List of all members.

Public Types

enum  eplane { UNDEFINED = 0, PLANE_XY = 1, PLANE_YZ, PLANE_ZX }
typedef color3 color

Public Member Functions

 Screen (size_t w, size_t h, prec_t sw, prec_t sh, const color &bg=WHITE)
 Create screen.
 Screen (const Screen &copy)
 ~Screen ()
Screenoperator= (const Screen &copy)
void clear (const color &c=WHITE)
void draw_axes (prec_t interval=0.0, const color &c=BLUE)
 Draw axes onto screen based on the scales.
void set_pixel (size_t x, size_t y, const color &c)
 Set pixel at raster position (x, y) on screen.
void set_pixel (const vect3d &p, const color &c)
 Set pixel on screen at given position p.
void set_pixel_merge (size_t x, size_t y, prec_t factor, const color &c)
void translate (const vect3d &p, size_t &out_x, size_t &out_y)
 Translate given position p into raster coordinate (out_x, out_y).
void translate (const vect3d &p, prec_t &out_x, prec_t &out_y, prec_t &out_z)
 Translate given position p into scaled coordinate (x, y) and distance from screen out_z.
void reverse (size_t x, size_t y, vect3d &out_p)
 Translate raster coordinate (x, y) into space coordinate out_p.
prec_t get_dx ()
prec_t get_dy ()
prec_t get_dw ()
prec_t get_dh ()
void write (const char *path)
 Write screen as window bitmap into given path.
void write (const std::string &path)
 Write screen as window bitmap into given path.
prec_t get_space_width ()
size_t get_width () const
size_t get_height () const
void set_axis (eplane plane, prec_t distance=0.0)
 Set axes of the camera to match the given plane.
void set_axis (const vect3d &pos0, const vect3d &xaxix, const vect3d &yaxis)
 Set axes of the camera.
void set_perspective (bool p)
 Set screen into perspective mode.
void set_zbuffer (bool enable)
 Enable zbuffer.
void draw_line (const vect3d &p0, const vect3d &p1, const color &c)
 Draw a generic aliased line.
void draw_cross (const vect3d &p0, const color &c, prec_t len=0.05)
 Draw a cross across all axes.
const vect3dget_center () const

Static Public Attributes

static const color WHITE
static const color RED
static const color GREEN
static const color BLUE
static const color BLACK

Detailed Description

Screen is a camera.

Definition at line 45 of file screen.hpp.


Member Typedef Documentation

typedef color3 Screen::color

Definition at line 48 of file screen.hpp.


Member Enumeration Documentation

enum Screen::eplane

Enumerator:
UNDEFINED 
PLANE_XY 
PLANE_YZ 
PLANE_ZX 

Definition at line 103 of file screen.hpp.


Constructor & Destructor Documentation

Screen::Screen ( size_t  w,
size_t  h,
prec_t  sw,
prec_t  sh,
const color bg = WHITE 
)

Create screen.

Parameters:
w Width of screen in pixels
h Height of screen in pixels
sw Horizontal scale of screen (meters)
sh Vertical scale of screen (meters)

Screen::Screen ( const Screen copy  ) 

Screen::~Screen (  ) 


Member Function Documentation

Screen& Screen::operator= ( const Screen copy  ) 

void Screen::clear ( const color c = WHITE  ) 

void Screen::draw_axes ( prec_t  interval = 0.0,
const color c = BLUE 
)

Draw axes onto screen based on the scales.

void Screen::set_pixel ( size_t  x,
size_t  y,
const color c 
)

Set pixel at raster position (x, y) on screen.

void Screen::set_pixel ( const vect3d p,
const color c 
)

Set pixel on screen at given position p.

The position is translated into raster coordinates.

void Screen::set_pixel_merge ( size_t  x,
size_t  y,
prec_t  factor,
const color c 
)

Deprecated:

void Screen::translate ( const vect3d p,
size_t &  out_x,
size_t &  out_y 
)

Translate given position p into raster coordinate (out_x, out_y).

void Screen::translate ( const vect3d p,
prec_t out_x,
prec_t out_y,
prec_t out_z 
)

Translate given position p into scaled coordinate (x, y) and distance from screen out_z.

void Screen::reverse ( size_t  x,
size_t  y,
vect3d out_p 
)

Translate raster coordinate (x, y) into space coordinate out_p.

prec_t Screen::get_dx (  )  [inline]

Definition at line 87 of file screen.hpp.

prec_t Screen::get_dy (  )  [inline]

Definition at line 88 of file screen.hpp.

prec_t Screen::get_dw (  )  [inline]

Definition at line 89 of file screen.hpp.

prec_t Screen::get_dh (  )  [inline]

Definition at line 90 of file screen.hpp.

void Screen::write ( const char *  path  ) 

Write screen as window bitmap into given path.

Referenced by write().

void Screen::write ( const std::string &  path  )  [inline]

Write screen as window bitmap into given path.

Definition at line 96 of file screen.hpp.

References write().

prec_t Screen::get_space_width (  )  [inline]

Definition at line 98 of file screen.hpp.

size_t Screen::get_width (  )  const [inline]

Definition at line 100 of file screen.hpp.

size_t Screen::get_height (  )  const [inline]

Definition at line 101 of file screen.hpp.

void Screen::set_axis ( eplane  plane,
prec_t  distance = 0.0 
)

Set axes of the camera to match the given plane.

void Screen::set_axis ( const vect3d pos0,
const vect3d xaxix,
const vect3d yaxis 
)

Set axes of the camera.

void Screen::set_perspective ( bool  p  )  [inline]

Set screen into perspective mode.

Definition at line 109 of file screen.hpp.

void Screen::set_zbuffer ( bool  enable  ) 

Enable zbuffer.

void Screen::draw_line ( const vect3d p0,
const vect3d p1,
const color c 
)

Draw a generic aliased line.

void Screen::draw_cross ( const vect3d p0,
const color c,
prec_t  len = 0.05 
)

Draw a cross across all axes.

const vect3d& Screen::get_center (  )  const [inline]

Definition at line 119 of file screen.hpp.


Member Data Documentation

const color Screen::WHITE [static]

Definition at line 50 of file screen.hpp.

const color Screen::RED [static]

Definition at line 51 of file screen.hpp.

const color Screen::GREEN [static]

Definition at line 52 of file screen.hpp.

const color Screen::BLUE [static]

Definition at line 53 of file screen.hpp.

const color Screen::BLACK [static]

Definition at line 54 of file screen.hpp.


The documentation for this class was generated from the following file:
Generated on Thu Dec 6 20:31:16 2007 for Ephi by  doxygen 1.5.0