#include <Polygon3D.hpp>
Public Types | |
typedef std::vector< Point3D > | base_class |
The base type. (Naming according to boost convention.) | |
typedef Point3D::floatingpoint_type | floatingpoint_type |
Public Member Functions | |
Polygon3D | getMovedPath (double dist) const |
virtual const UINT32 | getUsedMemory () const |
bool | operator== (const Polygon3D &other) const |
Equality predicate. | |
Polygon3D () | |
Constructor for an empty polygon. | |
Polygon3D (const Point3D &) | |
Convenience constructor for a polygon with one Point. | |
Polygon3D (const Point3D &, const Point3D &) | |
Convenience constructor for a polygon with two Points. | |
Polygon3D (const Point3D &, const Point3D &, const Point3D &) | |
Convenience constructor for a polygon with three Points. | |
Polygon3D (const base_class &) | |
Copy constructor from a std::vector. | |
void | sortForAngleXYPlane () |
Serialization | |
std::istream & | read (std::istream &is, UINT32 version) |
Reads this object from an input stream. | |
void | read (const BYTE *&buf, UINT32 version) |
Reads this object from a memory buffer. | |
std::ostream & | write (std::ostream &os, UINT32 version) const |
Writes this object to an output stream. | |
void | write (BYTE *&buf, UINT32 version) const |
Writes this object to a memory buffer and increments the buffer pointer. | |
std::streamsize | getSerializedSize (UINT32 version) const |
Returns the number of bytes this object needs in serialized form. | |
std::string | toString () const |
Text output for debugging; opposite of fromString(). | |
void | fromString (const std::string &polyString) |
Fill this Polygon3D by parsing the given string and extracting a list of points from the string. |
Definition at line 23 of file Polygon3D.hpp.
typedef std::vector<Point3D> datatypes::Polygon3D::base_class |
The base type. (Naming according to boost convention.)
Definition at line 28 of file Polygon3D.hpp.
The type of the stored x, y coordinates of each of the points in this polygon.
Definition at line 32 of file Polygon3D.hpp.
Constructor for an empty polygon.
Definition at line 19 of file Polygon3D.cpp.
datatypes::Polygon3D::Polygon3D | ( | const Point3D & | p1 | ) |
Convenience constructor for a polygon with one Point.
Definition at line 23 of file Polygon3D.cpp.
datatypes::Polygon3D::Polygon3D | ( | const Point3D & | p1, |
const Point3D & | p2 | ||
) |
Convenience constructor for a polygon with two Points.
Definition at line 28 of file Polygon3D.cpp.
datatypes::Polygon3D::Polygon3D | ( | const Point3D & | p1, |
const Point3D & | p2, | ||
const Point3D & | p3 | ||
) |
Convenience constructor for a polygon with three Points.
Definition at line 33 of file Polygon3D.cpp.
datatypes::Polygon3D::Polygon3D | ( | const base_class & | other_vector | ) |
Copy constructor from a std::vector.
Definition at line 43 of file Polygon3D.cpp.
void datatypes::Polygon3D::fromString | ( | const std::string & | polyString | ) |
Fill this Polygon3D by parsing the given string and extracting a list of points from the string.
This is the opposite of toString().
Syntax example: (0.0 -2.0 0) (10 -1 0) (10 1 0) (0.0 2.0 0) (0.0 -2.0 0)
This results in a polygon with five points where the last is identical to the first so that the polygon is a closed polygon.
Internal syntax rules: The polygon is parsed from a list of floating point literals, separated by any of the following characters: " [ ( , ; ) ] as given by Polygon2D::getSeparatorCharacters(). If the number of floating point literals is not divisible by three, a std::runtime_error is thrown.
Polygon3D datatypes::Polygon3D::getMovedPath | ( | double | dist | ) | const |
DEPRECATED - the semantics of this function is very very unclear and it will be removed soon.
Get a polygon which has a constant distance to this polygon. This function is intended to create a path with a more or less constant width. The polygon should not have succeeding points with reversing direction (zick-zack). This function operates in the x-y-plane only.
Definition at line 115 of file Polygon3D.cpp.
std::streamsize datatypes::Polygon3D::getSerializedSize | ( | UINT32 | version | ) | const |
Returns the number of bytes this object needs in serialized form.
virtual const UINT32 datatypes::Polygon3D::getUsedMemory | ( | ) | const [inline, virtual] |
Implements datatypes::BasicData.
Definition at line 50 of file Polygon3D.hpp.
bool datatypes::Polygon3D::operator== | ( | const Polygon3D & | other | ) | const [inline] |
Equality predicate.
Definition at line 55 of file Polygon3D.hpp.
std::istream& datatypes::Polygon3D::read | ( | std::istream & | is, |
UINT32 | version | ||
) |
Reads this object from an input stream.
void datatypes::Polygon3D::read | ( | const BYTE *& | buf, |
UINT32 | version | ||
) |
Reads this object from a memory buffer.
Sort the points for incrementing angles of the projection to the X-Y plane Result is a list soted from left to right.
Definition at line 91 of file Polygon3D.cpp.
std::string datatypes::Polygon3D::toString | ( | ) | const |
Text output for debugging; opposite of fromString().
Conversion to string for debugging.
Definition at line 74 of file Polygon3D.cpp.
std::ostream& datatypes::Polygon3D::write | ( | std::ostream & | os, |
UINT32 | version | ||
) | const |
Writes this object to an output stream.
void datatypes::Polygon3D::write | ( | BYTE *& | buf, |
UINT32 | version | ||
) | const |
Writes this object to a memory buffer and increments the buffer pointer.