My Project
 All Classes Files Functions Variables Enumerations Pages
Public Member Functions | List of all members
GeometrySpherical Class Reference

Concrete class providing a flat geometry (a sphere with nominal radius 1, equator in the XY-plane, Z axis through the poles). More...

#include <geometry.h>

Inheritance diagram for GeometrySpherical:
Geometry ScanConverter

Public Member Functions

 GeometrySpherical (uint seed)
 Constructor.
 
 ~GeometrySpherical ()
 Destructor.
 
float height (const XYZ &p) const
 Height is relative to the surface of the unit radius sphere.
 
void set_height (XYZ &p, float h) const
 The height set is relative to the surface of the unit radius sphere.
 
const XYZ midpoint (const XYZ &v0, const XYZ &v1) const
 Don't just take the mid-point of the straight-line path through the sphere's surface: must work relative to the sphere's surface.
 
float normalised_latitude (const XYZ &p) const
 Normalised latitude is 1.0 at the north pole, -1.0 at the south pole.
 
const XYZ up (const XYZ &p) const
 Up is normal to the sphere.
 
const XYZ north (const XYZ &p) const
 North is perpendicular to "up" and "east". More...
 
const XYZ east (const XYZ &p) const
 East is perpendicular to "up" and the polar vector. More...
 
const XYZ perturb (const XYZ &p, const XYZ &variation) const
 Add a random variation to a point. More...
 
float epsilon () const
 This needs to return something small for the lake flooding algorithm to work.
 
void scan_convert (const boost::array< XYZ, 3 > &v, const ScanConvertBackend &) const
 
uint scan_convert_image_aspect_ratio () const
 Return 2.0 for spheres because vertical range is +/- pi/2, horizontal is +/- pi.
 
- Public Member Functions inherited from Geometry
 Geometry (uint seed)
 Constructor.
 
virtual ~Geometry ()
 Destructor.
 

Additional Inherited Members

- Static Protected Member Functions inherited from Geometry
static void scan_convert_common (const boost::array< XYZ, 3 > &v, const ScanConvertBackend &backend)
 Common scan-converter code. More...
 
- Protected Attributes inherited from Geometry
Random01 _r01
 Random number generator used for perturbations and the like. More...
 

Detailed Description

Concrete class providing a flat geometry (a sphere with nominal radius 1, equator in the XY-plane, Z axis through the poles).

Member Function Documentation

const XYZ GeometrySpherical::east ( const XYZ p) const
inlinevirtual

East is perpendicular to "up" and the polar vector.

Warning
Returns zero vector at the poles

Implements Geometry.

const XYZ GeometrySpherical::north ( const XYZ p) const
inlinevirtual

North is perpendicular to "up" and "east".

Warning
Returns zero vector at the poles

Implements Geometry.

const XYZ GeometrySpherical::perturb ( const XYZ p,
const XYZ variation 
) const
inlinevirtual

Add a random variation to a point.

In spherical geometry, the variation ellipsoid tracks the surface (ie z corresponds to up, north to y)

Implements Geometry.

void GeometrySpherical::scan_convert ( const boost::array< XYZ, 3 > &  v,
const ScanConvertBackend backend 
) const
virtual

The problem with spherical geometry is that spans can go off one side of the map and come back on the other.

Todo:
Might be better if span replication was done in backed rather than duplicating all the y-compute.

Implements ScanConverter.


The documentation for this class was generated from the following files: