Polygon sets are collections of polygons defined in the same referential. More...
#include <OSDLPolygon.h>
Public Member Functions | |
PolygonSet (bool listOwner=false) | |
Creates an empty set of polygons. | |
PolygonSet (std::list< listPoint2D * > &polygonList, bool listOwner=false) | |
Creates an encapsulated set of polygons from a list of suites of summit vertices. | |
virtual | ~PolygonSet () throw () |
Basic virtual destructor. | |
virtual void | addPointsOf (Polygon &newPolygon) |
Adds a new polygon to the polygon set, thanks to the points of the specified polygon. | |
virtual void | addPointList (listPoint2D &listToAdd) |
Adds a new list of points to the polygon set. | |
virtual bool | draw (Surface &targetSurface, Coordinate x, Coordinate y, Pixels::ColorDefinition colorDef=Pixels::White, bool filled=true) const |
Draws the polygon set on specified surface, with specified color, at specified place. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const |
Returns an user-friendly description of the state of this object. | |
Static Public Member Functions | |
static PolygonSet & | CreateFlake (Ceylan::Uint8 branchCount=5, Length length=200, Length thickness=20, Ceylan::Maths::AngleInDegrees childAngle=50, Ceylan::Maths::Ratio branchingHeightRatio=0.7, Ceylan::Maths::Ratio scale=0.3) |
Creates a polygon whose shape is a snow flake. | |
Protected Attributes | |
std::list< listPoint2D * > * | _polygonList |
List of the summits of the polygon. | |
bool | _listOwner |
Tells whether the polygon owns the embedded list, including its whole content. | |
Private Member Functions | |
PolygonSet (const PolygonSet &source) | |
Copy constructor made private to ensure that it will never be called. | |
PolygonSet & | operator= (const PolygonSet &source) |
Assignment operator made private to ensure that it will never be called. |
Polygon sets are collections of polygons defined in the same referential.
Polygon sets are especially useful to model shapes that are complex or split in multiple non-overlapping parts, not connex.
Definition at line 680 of file OSDLPolygon.h.
PolygonSet::PolygonSet | ( | bool | listOwner = false |
) | [explicit] |
Creates an empty set of polygons.
listOwner | tells whether this polygon owns the lists and the points in its polygon list (and therefore will deallocate them) or not (in this case, neither the list nor the points will be deallocated). |
Definition at line 864 of file OSDLPolygon.cc.
PolygonSet::PolygonSet | ( | std::list< listPoint2D * > & | polygonList, | |
bool | listOwner = false | |||
) | [explicit] |
Creates an encapsulated set of polygons from a list of suites of summit vertices.
polygonList | a list of list of points as inputs. | |
listOwner | tells whether this polygon owns the lists and the points in its polygon list (and therefore will deallocate them) or not (in this case, neither the list nor the points will be deallocated). |
Definition at line 874 of file OSDLPolygon.cc.
PolygonSet::~PolygonSet | ( | ) | throw () [virtual] |
Basic virtual destructor.
Definition at line 885 of file OSDLPolygon.cc.
References _listOwner, _polygonList, and OSDL::Video::TwoDimensional::Polygon::Delete().
OSDL::Video::TwoDimensional::PolygonSet::PolygonSet | ( | const PolygonSet & | source | ) | [explicit, private] |
Copy constructor made private to ensure that it will never be called.
The compiler should complain whenever this undefined constructor is called, implicitly or not.
void PolygonSet::addPointList | ( | listPoint2D & | listToAdd | ) | [virtual] |
Adds a new list of points to the polygon set.
listToAdd | the list of points to be added. |
Definition at line 926 of file OSDLPolygon.cc.
References _polygonList.
Referenced by addPointsOf().
void PolygonSet::addPointsOf | ( | TwoDimensional::Polygon & | newPolygon | ) | [virtual] |
Adds a new polygon to the polygon set, thanks to the points of the specified polygon.
The polygon set takes ownership of the list and the points in it.
newPolygon | the point-providing polygon. |
Definition at line 913 of file OSDLPolygon.cc.
References addPointList(), OSDL::Video::TwoDimensional::Polygon::getPoints(), and OSDL::Video::TwoDimensional::Polygon::isListOwner().
static PolygonSet& OSDL::Video::TwoDimensional::PolygonSet::CreateFlake | ( | Ceylan::Uint8 | branchCount = 5 , |
|
Length | length = 200 , |
|||
Length | thickness = 20 , |
|||
Ceylan::Maths::AngleInDegrees | childAngle = 50 , |
|||
Ceylan::Maths::Ratio | branchingHeightRatio = 0.7 , |
|||
Ceylan::Maths::Ratio | scale = 0.3 | |||
) | [static] |
Creates a polygon whose shape is a snow flake.
branchCount | tells how many branches the flake should have (must not be null). | |
length | defines the height of the main branch of this flake. | |
thickness | defines the width of the main branch of this flake. | |
childAngle | defines the angle, in degrees, between the main branch and the second branch. | |
branchingHeightRatio | tells at which height of the main branch the second shall begin. | |
scale | defines the ratio of the second branch relatively to the main one. |
bool PolygonSet::draw | ( | Surface & | targetSurface, | |
Coordinate | x, | |||
Coordinate | y, | |||
Pixels::ColorDefinition | colorDef = Pixels::White , |
|||
bool | filled = true | |||
) | const [virtual] |
Draws the polygon set on specified surface, with specified color, at specified place.
Definition at line 938 of file OSDLPolygon.cc.
References _polygonList, and OSDL::Video::TwoDimensional::drawPolygon().
PolygonSet& OSDL::Video::TwoDimensional::PolygonSet::operator= | ( | const PolygonSet & | source | ) | [private] |
Assignment operator made private to ensure that it will never be called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
const string PolygonSet::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [virtual] |
Returns an user-friendly description of the state of this object.
level | the requested verbosity level. |
Definition at line 968 of file OSDLPolygon.cc.
References _polygonList, and OSDL::Video::Pixels::toString().
bool OSDL::Video::TwoDimensional::PolygonSet::_listOwner [protected] |
Tells whether the polygon owns the embedded list, including its whole content.
Definition at line 865 of file OSDLPolygon.h.
Referenced by ~PolygonSet().
std::list<listPoint2D *>* OSDL::Video::TwoDimensional::PolygonSet::_polygonList [protected] |
List of the summits of the polygon.
Definition at line 854 of file OSDLPolygon.h.
Referenced by addPointList(), draw(), toString(), and ~PolygonSet().