geom::Grid Struct Reference

A structure representing a grid as a matrix of points. More...

#include <geom.hh>

List of all members.

Public Member Functions

 Grid (int width, int height)
 Create a grid of certain size.
 Grid (const std::vector< Line > &lines1, const std::vector< Line > &lines2)
 Create a grid of the intersections between two series of lines.
Pointoperator() (int x, int y)
 Access a point.
Pointoperator[] (int index)
 Access the point buffer directly.

Public Attributes

int width
 The width of the grid.
int height
 The height of the grid.
std::vector< Pointpoints
 The points in the grid: 1st row, 2nd row, and so on.


Detailed Description

A structure representing a grid as a matrix of points.


Constructor & Destructor Documentation

geom::Grid::Grid int  width,
int  height
[inline]
 

Create a grid of certain size.

Parameters:
width = the width of the grid
height = the height of the grid

geom::Grid::Grid const std::vector< Line > &  lines1,
const std::vector< Line > &  lines2
[inline]
 

Create a grid of the intersections between two series of lines.

This constructor takes two sets of lines, and for each line in the first set, it computes the intersections with each line from the second set. The intersections are stored so that n'th row contains the intersections of the n'th line of the first set.

Parameters:
lines1 = the first set of lines
lines2 = the second set of lines


Member Function Documentation

Point& geom::Grid::operator() int  x,
int  y
[inline]
 

Access a point.

Note:
The function checks the bounds.
Parameters:
x = the column of the grid
y = the row of the grid

Point& geom::Grid::operator[] int  index  )  [inline]
 

Access the point buffer directly.

Note:
The function checks the bounds.
Parameters:
index = the index of the point in the buffer


The documentation for this struct was generated from the following file:
Generated on Tue Apr 8 09:58:19 2008 for GoCam by  doxygen 1.4.6