afl::SimpleBoundary_2 Class Reference

#include <simpleboundary_2.h>

Inheritance diagram for afl::SimpleBoundary_2:

afl::Boundary_2 List of all members.

Public Member Functions

 SimpleBoundary_2 (const Point &from, const Point &to, bool colour)
virtual ~SimpleBoundary_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 getStart () const
virtual Point getEnd () const
virtual void toXML (std::ostream &doc, const std::string &componentsDir, const std::string &baseURI) const
virtual Point getBoundingBoxMin () const
virtual Point getBoundingBoxMax () const
virtual Boundary_2clone ()
virtual Point findNearest (const Point &p) const
virtual Value getNormal (const Point &p) const

Protected Member Functions

virtual int whereIs (const Point &p) const
virtual bool intersectSegment (const Point &from, const Point &to) const

Detailed Description

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


Constructor & Destructor Documentation

afl::SimpleBoundary_2::SimpleBoundary_2 const Point from,
const Point to,
bool  colour
 

Creates a new boundary segment

Parameters:
from one corener of the boundary
to the other corner of the boundary
colour eithe red (meaning an island) or black (meaning a hole)
Exceptions:
ddf::GeometryException if to and from are the same.

virtual afl::SimpleBoundary_2::~SimpleBoundary_2  )  [virtual]
 

desructor is virtual


Member Function Documentation

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

adds a segment of the opposite colour.

Parameters:
field a field of the appropriate dimensions to define the new boundary section
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/value.

Reimplemented from afl::Boundary_2.

virtual void afl::SimpleBoundary_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::SimpleBoundary_2::clone  )  [virtual]
 

Returns:
a newly created and exact copy of the object

Reimplemented from afl::Boundary_2.

virtual Point afl::SimpleBoundary_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::SimpleBoundary_2::getBoundingBoxMax  )  const [virtual]
 

Returns:
the largest point in the segment. 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::SimpleBoundary_2::getBoundingBoxMin  )  const [virtual]
 

Returns:
the smallest point in the segment. 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 Point afl::SimpleBoundary_2::getEnd  )  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

virtual Value afl::SimpleBoundary_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 Point afl::SimpleBoundary_2::getStart  )  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

virtual data_t afl::SimpleBoundary_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 bool afl::SimpleBoundary_2::intersectSegment const Point from,
const Point to
const [protected, virtual]
 

Parameters:
from one corner of a segment to intesect with this one
to the other corner of a segment to intersect with this one
Returns:
true if the segment defines with from and to overlap this segment but is not entirely contained in this segmetn. I.e. either the boudary is crossed or the segment contains this segment.

Reimplemented from afl::Boundary_2.

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

Parameters:
p The point to locate
Returns:
`outside' if the point is outside the domain, `boundary' if

Reimplemented from afl::Boundary_2.

virtual void afl::SimpleBoundary_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::SimpleBoundary_2::whereIs const Point p  )  const [protected, virtual]
 

Parameters:
p The point to query
Returns:
-1 if the point is outside the domain, -2 if the point is inside a hole -3 if the point is before the segment, 0 if the point is on the boundary, or 1 if the point is inside the domain.

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