Spherical.Shape.Parser Class Reference

With the rules of the Shape Grammar, turn the given specification into a Region object with its only public method. More...

List of all members.

Public Types

 Ok
 All is well, no error.
 errIllegalNumber
 The parsed token was not a number.
 errEol
 Premature end of line was reached.
 errNot2forRect
 There were other than 2 points specified for a RECT command.
 errNotenough4Poly
 There weren't at least 3 points for specifying a polygon or convex hull.
 errPolyBowtie
 The given polygon is either concave, or has self-intersecting edges.
 errPolyZeroLength
 The polygon specified contains edges of zero length (eg, from consecutive identical points).
 errChullTooBig
 The list of points for convex hull generation span a space larger than a hemisphere.
 errChullCoplanar
 The list of points for convex hull generation are all on the same great circle.
 errNullSpecification
 An empty string was given as a specification.
 errUnknown
 Some other error occured. Please call someone if this happens.
enum  Error {
  Ok, errIllegalNumber, errEol, errNot2forRect, errNotenough4Poly, errPolyBowtie, errPolyZeroLength, errChullTooBig,
  errChullCoplanar, errNullSpecification, errUnknown
}
 Descibes the Spherical Shape Parser error. More...

Public Member Functions

 Parser (string in_spec)
 Create an instance of a shape parser with a specification.

Static Public Member Functions

static string errmsg (Error errno)
 Turns a Parser.Error argument into a textual description.
static List< double > extract (String textSpec)
 Extracts all the points from a convex hull specification.
static Region compile (String textSpec)
 Compile a text description of a region into a new Region object.


Detailed Description

With the rules of the Shape Grammar, turn the given specification into a Region object with its only public method.


Member Enumeration Documentation

enum Spherical::Shape::Parser::Error

Descibes the Spherical Shape Parser error.

Enumerator:
Ok  All is well, no error.
errIllegalNumber  The parsed token was not a number.
errEol  Premature end of line was reached.
errNot2forRect  There were other than 2 points specified for a RECT command.
errNotenough4Poly  There weren't at least 3 points for specifying a polygon or convex hull.
errPolyBowtie  The given polygon is either concave, or has self-intersecting edges.
errPolyZeroLength  The polygon specified contains edges of zero length (eg, from consecutive identical points).
errChullTooBig  The list of points for convex hull generation span a space larger than a hemisphere.
errChullCoplanar  The list of points for convex hull generation are all on the same great circle.
errNullSpecification  An empty string was given as a specification.
errUnknown  Some other error occured. Please call someone if this happens.


Constructor & Destructor Documentation

Spherical.Shape.Parser.Parser ( string  in_spec  ) 

Create an instance of a shape parser with a specification.

Parsing occurs when parse() is invoked.

Parameters:
in_spec a valid shape specification


Member Function Documentation

static Region Spherical.Shape.Parser.compile ( String  textSpec  )  [static]

Compile a text description of a region into a new Region object.

The Shape Grammar is given in these specification. If there is an error in the specification, compile will throw a ParserException with an appropriate text message, and and internal Parser.Error variable.

Parameters:
textSpec 
Returns:

static string Spherical.Shape.Parser.errmsg ( Error  errno  )  [static]

Turns a Parser.Error argument into a textual description.

Parameters:
errno 
Returns:
string containing text of description

static List<double> Spherical.Shape.Parser.extract ( String  textSpec  )  [static]

Extracts all the points from a convex hull specification.

Parameters:
textSpec 
Returns:
a linear array of x, y, z values


The documentation for this class was generated from the following file:
February 7, 2007 György Fekete pre-release