#include <OSDLPolygon.h>
All these vectors are to be defined in the Polygon's own 2D referential.
Definition at line 342 of file OSDLPolygon.h.
Public Member Functions | |
Polygon (listPoint2D &summits, bool listOwner=false) throw () | |
Creates a polygon from a suite of summit vertices. | |
virtual | ~Polygon () throw () |
Basic virtual destructor. | |
virtual bool | draw (Surface &targetSurface, Pixels::ColorDefinition colorDef=Pixels::White, bool filled=true) const throw () |
Draws the polygon on specified surface, with specified color. | |
virtual listPoint2D & | getPoints () const throw () |
Returns the points that this polygon gathered. | |
virtual void | setPoints (listPoint2D &newList) throw () |
Sets the vertex list for this polygon. | |
virtual bool | isListOwner () const throw () |
Tells whether the polygon owns its points. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const throw () |
Returns an user-friendly description of the state of this object. | |
Static Public Member Functions | |
static Polygon & | CreateFlakeBranch (Length length=200, Length thickness=20, Ceylan::Maths::AngleInDegrees childAngle=50, Ceylan::Maths::Ratio branchingHeightRatio=0.7, Ceylan::Maths::Ratio scale=0.3) throw () |
Creates a polygon whose shape is a snow flake, and which has no local referential registered. | |
static listPoint2D & | Duplicate (const listPoint2D &source) throw () |
Duplicates specified list of points : returns another list containing clones of each points in source. | |
static void | Delete (listPoint2D &listToBeDeleted) throw () |
Deletes specified list of points, including the points themselves. | |
static listPoint2D & | Append (listPoint2D &toBeAugmented, const listPoint2D &toAppend) throw () |
Appends a shallow (not deep) copy of the toAppend list to the toBeAugmented list. | |
static listPoint2D & | Apply (const Ceylan::Maths::Linear::HomogeneousMatrix3 &transformation, listPoint2D &sourceList) throw () |
Applies transformation, specified as a 3x3 homogeneous matrix, to each point of sourceList. | |
Private Member Functions | |
Polygon (const Polygon &source) throw () | |
Copy constructor made private to ensure that it will be never called. | |
Polygon & | operator= (const Polygon &source) throw () |
Assignment operator made private to ensure that it will be never called. | |
Private Attributes | |
listPoint2D * | _summits |
List of the summits of the polygon. | |
bool | _listOwner |
Tells whether the polygon owns the lists and the points that are stored in it. |
Polygon::Polygon | ( | listPoint2D & | summits, | |
bool | listOwner = false | |||
) | throw () [explicit] |
Creates a polygon from a suite of summit vertices.
summits | the input list of summits for this polygon. | |
listOwner | tells whether this polygon owns the specified point list and the points in it (and therefore will deallocate them) or not (in this case, neither the list object nor the points will be deallocated). |
Definition at line 390 of file OSDLPolygon.cc.
Polygon::~Polygon | ( | ) | throw () [virtual] |
Basic virtual destructor.
Definition at line 400 of file OSDLPolygon.cc.
References _listOwner, and _summits.
OSDL::Video::TwoDimensional::Polygon::Polygon | ( | const Polygon & | source | ) | throw () [explicit, private] |
Copy constructor made private to ensure that it will be never called.
The compiler should complain whenever this undefined constructor is called, implicitly or not.
bool Polygon::draw | ( | Surface & | targetSurface, | |
Pixels::ColorDefinition | colorDef = Pixels::White , |
|||
bool | filled = true | |||
) | const throw () [virtual] |
Draws the polygon on specified surface, with specified color.
The polygon can be rendered after transformation with the embedded matrix, the referential of this Locatable.
In all cases the place where to render the polygon on surface is determined by this inner matrix.
targetSurface | the surface to draw to. | |
colorDef | the polygon color. | |
filled | tells whether the polygon should be filled. |
Definition at line 432 of file OSDLPolygon.cc.
References OSDL::Video::TwoDimensional::drawPolygon().
listPoint2D & Polygon::getPoints | ( | ) | const throw () [virtual] |
Returns the points that this polygon gathered.
Definition at line 462 of file OSDLPolygon.cc.
References _summits.
void Polygon::setPoints | ( | listPoint2D & | newList | ) | throw () [virtual] |
Sets the vertex list for this polygon.
newList | the new list of vertices. |
Definition at line 471 of file OSDLPolygon.cc.
bool Polygon::isListOwner | ( | ) | const throw () [virtual] |
Tells whether the polygon owns its points.
Definition at line 488 of file OSDLPolygon.cc.
References _listOwner.
const string Polygon::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const throw () [virtual] |
Returns an user-friendly description of the state of this object.
level | the requested verbosity level. |
Definition at line 497 of file OSDLPolygon.cc.
References OSDL::Video::Pixels::toString().
static Polygon& OSDL::Video::TwoDimensional::Polygon::CreateFlakeBranch | ( | Length | length = 200 , |
|
Length | thickness = 20 , |
|||
Ceylan::Maths::AngleInDegrees | childAngle = 50 , |
|||
Ceylan::Maths::Ratio | branchingHeightRatio = 0.7 , |
|||
Ceylan::Maths::Ratio | scale = 0.3 | |||
) | throw () [static] |
Creates a polygon whose shape is a snow flake, and which has no local referential registered.
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. |
listPoint2D & Polygon::Duplicate | ( | const listPoint2D & | source | ) | throw () [static] |
Duplicates specified list of points : returns another list containing clones of each points in source.
Definition at line 658 of file OSDLPolygon.cc.
void Polygon::Delete | ( | listPoint2D & | listToBeDeleted | ) | throw () [static] |
Deletes specified list of points, including the points themselves.
Definition at line 677 of file OSDLPolygon.cc.
Referenced by OSDL::Video::TwoDimensional::PolygonSet::~PolygonSet().
listPoint2D & Polygon::Append | ( | listPoint2D & | toBeAugmented, | |
const listPoint2D & | toAppend | |||
) | throw () [static] |
Appends a shallow (not deep) copy of the toAppend list to the toBeAugmented list.
Definition at line 694 of file OSDLPolygon.cc.
static listPoint2D& OSDL::Video::TwoDimensional::Polygon::Apply | ( | const Ceylan::Maths::Linear::HomogeneousMatrix3 & | transformation, | |
listPoint2D & | sourceList | |||
) | throw () [static] |
Applies transformation, specified as a 3x3 homogeneous matrix, to each point of sourceList.
transformation | the 2D geometrical transformation, specified as a 3x3 homogeneous matrix. | |
sourceList | the list of points to transform. It will be updated thanks to the transformation. |
Polygon& OSDL::Video::TwoDimensional::Polygon::operator= | ( | const Polygon & | source | ) | throw () [private] |
Assignment operator made private to ensure that it will be never called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
List of the summits of the polygon.
Definition at line 573 of file OSDLPolygon.h.
Referenced by getPoints(), and ~Polygon().
bool OSDL::Video::TwoDimensional::Polygon::_listOwner [private] |
Tells whether the polygon owns the lists and the points that are stored in it.
Definition at line 583 of file OSDLPolygon.h.
Referenced by isListOwner(), and ~Polygon().