Bentley-Otmann Algorithm 2.0
An implementation of Bentley-Ottmann algorithm in order to count the m,n-cubes
Classes | Typedefs | Enumerations | Functions
geometry.hpp File Reference

Definition of geometric objects. More...

#include <vector>
#include <iostream>
#include <gmpxx.h>
#include <boost/rational.hpp>
#include "integer_type.hpp"
Include dependency graph for geometry.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Point
 2D points with rational coordinates More...
struct  Slope
 Slope of a segment line. More...
class  Segment
 2D segment lines More...
class  Event
 Event for Bentley-Ottmann's algorithm. More...

Typedefs

typedef int I
 Rational type.
typedef boost::rational< int > rat

Enumerations

enum  slope_t { undef, rational, infty }
 Kind of slope. More...

Functions

std::ostream & operator<< (std::ostream &, const Segment &)
 Pretty-printing for Segment.
std::ostream & operator<< (std::ostream &, const Segment *&)
 Pretty-printing for mpz_class.
std::ostream & operator<< (std::ostream &, const Point &)
 Pretty-printing for Point.

Detailed Description

Definition of geometric objects.

Author:
Pierre Cagne
Date:
07/11/2011

Here are implemented classes for geometric objects. First, a simple class for 2D points. Next, a class for 2D segments with possibility of ordering. Last, a class for 'events', an ameloriated type of point used in Bentley-Ottmann algorithm.

See also:
geometry.cpp

Definition in file geometry.hpp.


Typedef Documentation

typedef int I

Rational type.

This type can be a rational type with arbitrary precision (if USE_BIGINT is true) using the GMP library. Otherwise, it just is a rational type with numerator and denominator of type int.

Another library can be use instead of GMP by changing only this two typedef (and of course the included header(s) of the library). The only requirement for a good behaviour are : I should have a constructor from the paramater type int.

Definition at line 44 of file geometry.hpp.


Enumeration Type Documentation

enum slope_t

Kind of slope.

Defines a kind of slope for the slope structure. undef is only used in default construction.

Definition at line 88 of file geometry.hpp.


Function Documentation

std::ostream& operator<< ( std::ostream &  begin,
const Segment s 
)

Pretty-printing for Segment.

Parameters:
beginOstream
sSegment to print
Returns:
Ostream begin concatenated with the pretty-printing of s

Definition at line 272 of file geometry.cpp.

std::ostream& operator<< ( std::ostream &  begin,
const Point p 
)

Pretty-printing for Point.

Parameters:
beginOstream
pPoint to print
Returns:
Ostream begin concatenated with the pretty-printing of p

Definition at line 248 of file geometry.cpp.

std::ostream& operator<< ( std::ostream &  begin,
const Segment *&  s 
)

Pretty-printing for mpz_class.

Parameters:
beginOstream
zInteger to print
Returns:
Ostream begin concatenated with the printing of z Pretty-printing for mpq_class
Parameters:
beginOstream
fRational to print
Returns:
Ostream begin concatenated with the printing of f Pointer version of the segment's pretty-printing

Definition at line 237 of file geometry.cpp.

 All Classes Files Functions Variables Typedefs Enumerations