afl::FieldBoundary_2 Class Reference

#include <fieldboundary_2.h>

Inheritance diagram for afl::FieldBoundary_2:

afl::Boundary_2 List of all members.

Public Member Functions

 FieldBoundary_2 (const Field *field, bool colour)
virtual ~FieldBoundary_2 ()
virtual troolean locate (const Point &p) const
virtual data_t intersect (const Point &p, const Point &v) const
virtual void addSegment (const Point &from, const Point &to)
virtual void addSegment (const Field *field)
virtual Point getBoundingBoxMin () const
virtual Point getBoundingBoxMax () const
virtual void toXML (std::ostream &doc, const std::string &componentsDir, const std::string &baseURI) const
virtual Boundary_2clone ()
virtual Point findNearest (const Point &p) const
virtual Value getNormal (const Point &p) const

Protected Member Functions

virtual troolean inLocal (const Point &p) const
virtual int whereIs (const Point &p) const
void computeBoundingBox (size_t stops=boundaryParts) const

Detailed Description

Class FieldBoundary_2 a rectangular area that is defined using 2 points of opposite corners


Constructor & Destructor Documentation

afl::FieldBoundary_2::FieldBoundary_2 const Field field,
bool  colour
 

Creates a new boundary segment

Parameters:
field a one dimensional 2D vector field
colour eithe red (meaning an island) or black (meaning a hole)
Exceptions:
ddf::GeometryException if the field is not the right dimension and type.

virtual afl::FieldBoundary_2::~FieldBoundary_2  )  [virtual]
 

desructor is virtual


Member Function Documentation

virtual void afl::FieldBoundary_2::addSegment const Field field  )  [virtual]
 

adds a segment of the opposite colour.

Parameters:
field a field that defines the new segment to add
Exceptions:
ddf::GeometryException is thrown if the new segment has no hyper-volume
ddf::InvalidArgumentException is thrown if the new segment overlaps an existing segment or if the new segment is not of the right dimension.

Reimplemented from afl::Boundary_2.

virtual void afl::FieldBoundary_2::addSegment const Point from,
const Point to
[virtual]
 

adds a segment of the opposite colour.

Parameters:
from one hyper corner of the new rectangular segment
to the opposite hyper-corner of the new rectangular segment
Exceptions:
ddf::GeometryException is thrown if the new segment has no hyper-volume
ddf::InvalidArgumentException is thrown if the new segment overlaps an existing segment or if the new segment is not of the right dimension.

Reimplemented from afl::Boundary_2.

virtual Boundary_2* afl::FieldBoundary_2::clone  )  [virtual]
 

Returns:
a newly created and exact copy of the object

Reimplemented from afl::Boundary_2.

void afl::FieldBoundary_2::computeBoundingBox size_t  stops = boundaryParts  )  const [protected]
 

computes the bounding box of the field

Parameters:
stops the number of points to check the boundary at

virtual Point afl::FieldBoundary_2::findNearest const Point p  )  const [virtual]
 

finds the nearest point on the boundary to a point.

Parameters:
p the point to find the nearest point of
Returns:
the nearest point to p that is on the boundary. If p is on the boundary, then p itself is returned.

Reimplemented from afl::Boundary_2.

virtual Point afl::FieldBoundary_2::getBoundingBoxMax  )  const [virtual]
 

Returns:
the largest point in the boundary. In a simple boundary, this is a point with the largest value of X, Y, Z and T. In a field boundary this is the point that corresponds to field's boundary's largest point

Reimplemented from afl::Boundary_2.

virtual Point afl::FieldBoundary_2::getBoundingBoxMin  )  const [virtual]
 

Returns:
the smallest point in the boundary. In a simple boundary, this is a point with the smallest value of X, Y, Z and T. In a field boundary this is the point that corresponds to field's boundary's smallest point

Reimplemented from afl::Boundary_2.

virtual Value afl::FieldBoundary_2::getNormal const Point p  )  const [virtual]
 

finds the vector normal to the boundary at a point p on the boundary

Parameters:
p the point on the boundary to find the normal to.
Returns:
a vector (i.e. 1 column value) that returns the normal to the boundary at p
Exceptions:
ddf::InvalidArgumentException if p is not on the boundary

Reimplemented from afl::Boundary_2.

virtual troolean afl::FieldBoundary_2::inLocal const Point p  )  const [protected, virtual]
 

this method checks a point against this domain only, not against the segments

Parameters:
p The point to locate
Returns:
`outside' if the point is outside the domain, `boundary' if it is on the boundary, or inside if the point is in the domain. Note that the colour of the segment doesn't matter.

virtual data_t afl::FieldBoundary_2::intersect const Point p,
const Point v
const [virtual]
 

Finds the distance from a point to the boundary in the direction of a vector.

Parameters:
p The point that is being queried.
v the vector to find an intersection in the direction of
Returns:
the distance from the point along the vector that the boundary intersects (or the shortest distance if there are multiple intersections) of the length of the vector if there is no intersection. If p is on the boundary then the return value is 0. if p is outside the domain the distance is still positive.

Reimplemented from afl::Boundary_2.

virtual troolean afl::FieldBoundary_2::locate const Point p  )  const [virtual]
 

Parameters:
p The point to locate
Returns:
`outside' if the point is outside the domain, `boundary' if it is on the boundary, or inside if the point is in the domain

Reimplemented from afl::Boundary_2.

virtual void afl::FieldBoundary_2::toXML std::ostream &  doc,
const std::string &  componentsDir,
const std::string &  baseURI
const [virtual]
 

represents the segment as an XML string that will be put onto doc

Parameters:
doc the stream to put the XML string on
componentsDir the path of a directory to store component files in
baseURI a URI that refers to the directory in componentsDir

Reimplemented from afl::Boundary_2.

virtual int afl::FieldBoundary_2::whereIs const Point p  )  const [protected, virtual]
 

recursively checks whether a point p is in this domain

Parameters:
p the point to test
Returns:
1 if the point is inside an island, 0 if p is on a boundary -1 if the point is outside this domain or -2 if the point is in a hole

Reimplemented from afl::Boundary_2.


The documentation for this class was generated from the following file:
Generated on Fri Dec 22 07:17:51 2006 for afl by  doxygen 1.4.6