#include <Polygon3D.hpp>
Public Types | |
typedef std::vector< Point3D > | base_class |
The base type. (Naming according to boost convention.) More... | |
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. More... | |
Polygon3D () | |
Constructor for an empty polygon. More... | |
Polygon3D (const Point3D &) | |
Convenience constructor for a polygon with one Point. More... | |
Polygon3D (const Point3D &, const Point3D &) | |
Convenience constructor for a polygon with two Points. More... | |
Polygon3D (const Point3D &, const Point3D &, const Point3D &) | |
Convenience constructor for a polygon with three Points. More... | |
Polygon3D (const base_class &) | |
Copy constructor from a std::vector. More... | |
void | sortForAngleXYPlane () |
Serialization | |
std::istream & | read (std::istream &is, UINT32 version) |
Reads this object from an input stream. More... | |
void | read (const BYTE *&buf, UINT32 version) |
Reads this object from a memory buffer. More... | |
std::ostream & | write (std::ostream &os, UINT32 version) const |
Writes this object to an output stream. More... | |
void | write (BYTE *&buf, UINT32 version) const |
Writes this object to a memory buffer and increments the buffer pointer. More... | |
std::streamsize | getSerializedSize (UINT32 version) const |
Returns the number of bytes this object needs in serialized form. More... | |
std::string | toString () const |
Text output for debugging; opposite of fromString(). More... | |
void | fromString (const std::string &polyString) |
Fill this Polygon3D by parsing the given string and extracting a list of points from the string. More... | |
Public Member Functions inherited from datatypes::BasicData | |
BasicData () | |
UINT16 | getDatatype () |
UINT16 | getSourceId () |
virtual void | setSourceId (UINT16 id) |
virtual | ~BasicData () |
Additional Inherited Members | |
Protected Attributes inherited from datatypes::BasicData | |
UINT16 | m_datatype |
UINT16 | m_sourceId |
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.
datatypes::Polygon3D::Polygon3D | ( | ) |
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.
Convenience constructor for a polygon with two Points.
Definition at line 28 of file Polygon3D.cpp.
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.
|
inlinevirtual |
Implements datatypes::BasicData.
Definition at line 50 of file Polygon3D.hpp.
|
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.
Reads this object from a memory buffer.
void datatypes::Polygon3D::sortForAngleXYPlane | ( | ) |
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.
Writes this object to a memory buffer and increments the buffer pointer.