Geometric Information. More...
#include <rgeoinfo.h>
Public Member Functions | |
RGeoInfo (RObj2D *obj) | |
RGeoInfo (const RGeoInfo &info) | |
int | Compare (const RGeoInfo &info) const |
int | Compare (const size_t id) const |
virtual void | ClearInfo (void) |
tCoord | GetArea (void) const |
void | Boundary (RRect &rect) |
RObj2DContainer * | GetContainer (void) const |
void | SetContainer (RObj2DContainer *container) |
bool | IsValid (void) const |
RObj2D * | GetObj (void) const |
void | SetConfig (tOrientation ori) |
RObj2DConfig * | GetConfig (void) const |
virtual void | Assign (const RPoint &pos, RGrid *grid, size_t order) |
bool | IsValid (const RPoint &pos, const RSize &limits) const |
bool | IsMovingAway (const RPoint &pos, const RPoint &ref, bool left, bool bottom) const |
bool | Test (RPoint &pos, RGrid *grid) |
void | PushBottomLeft (RPoint &pos, const RSize &limits, RGrid *grid) |
void | PushCenter (RPoint &pos, const RSize &limits, RGrid *grid) |
bool | Overlap (RGeoInfo *info) const |
size_t | GetNbPoints (void) const |
RPoint | GetPos (void) const |
RGeoInfo & | operator+= (const RPoint &pt) |
RGeoInfo & | operator-= (const RPoint &pt) |
RGeoInfo & | operator= (const RGeoInfo &info) |
bool | IsIn (RPoint pos) const |
void | Add (RPolygons &polys) |
RPolygon | GetPlacedPolygon (void) const |
size_t | GetOrder (void) const |
virtual | ~RGeoInfo (void) |
Protected Member Functions | |
RGeoInfo (void) | |
Protected Attributes | |
RObj2D * | Obj |
RObj2DConfig * | Config |
RPoint | Pos |
RObj2DContainer * | Container |
size_t | Order |
Detailed Description
Geometric Information.
The RGeoInfo class provides a geometric information concerning the placement of an object.
Constructor & Destructor Documentation
|
protected |
Construct a geometric information.
|
virtual |
Destruct the geometric information.
Member Function Documentation
int Compare | ( | const RGeoInfo & | info | ) | const |
Compare function use for the RContainer class. Compare only the addresses of the pointers.
- Parameters
-
info Pointer used for the comparison.
int Compare | ( | const size_t | id | ) | const |
Compare function use for the RContainer class. Compare the identifier with the one of the corresponding object.
- Parameters
-
id Identifier used for the comparison.
|
virtual |
Clears the geometric information.
Reimplemented in RObj2DContainer.
tCoord GetArea | ( | void | ) | const |
Area used by the polygon.
void Boundary | ( | RRect & | rect | ) |
Calculate the boundary rectangle of the polygon according to the position.
- Parameters
-
rect Rectangle that will hold the result.
RObj2DContainer* GetContainer | ( | void | ) | const |
- Returns
- a pointer to the container or null if the object is not aggregated.
void SetContainer | ( | RObj2DContainer * | container | ) |
Set the container that hold the object.
- Parameters
-
container Container.
bool IsValid | ( | void | ) | const |
Return true if the geometric information is a valid one.
RObj2D* GetObj | ( | void | ) | const |
Return the object.
void SetConfig | ( | tOrientation | ori | ) |
Set the configuration used.
- Parameters
-
ori Orientation.
RObj2DConfig* GetConfig | ( | void | ) | const |
Return the configuration used.
Assign the geometric information to the position and update the grids with the identifier of the object.
- Parameters
-
pos Position to place. grid Grid. order Order of the corresponding geometric information.
Reimplemented in RObj2DContainer.
Return true if the geometric information is a valid one in given limits.
- Parameters
-
pos Position to verify. limits Limits.
Verify that a given position is not moving away from a reference one.
- Parameters
-
pos Position to verify. ref Reference position. left Is the position moving to the left (true) or to the right (false)? bottom Is the position moving to the bottom (true) or to the up (false)?
- Returns
- true if the position moves away.
Test if the shape of the object can be placed at a specific position based on a given grid.
- Parameters
-
pos Position to test. grid Grid.
Calculate the position where the object represented can be placed, if it is pushed to the bottom and to the left.
- Parameters
-
pos Initial position, and then the final one. limits Limits for the placement. grid Grid.
Calculate the position where the object represented can be placed, if it is pushed in direction of the center.
- Parameters
-
pos Initial position, and then the final one. limits Limits for the placement. grid Grid.
bool Overlap | ( | RGeoInfo * | info | ) | const |
This function returns true if the two objects represented by this geometric information overlap (Rects have to be calculated.
size_t GetNbPoints | ( | void | ) | const |
Return the number of points contained in the polygon.
RPoint GetPos | ( | void | ) | const |
- Returns
- the position of the geometric information.
Make a translation of the point.
- Parameters
-
pt Point representing the vector used.
Make a translation of the point.
- Parameters
-
pt The point representing the vector used.
bool IsIn | ( | RPoint | pos | ) | const |
Return true if a point is in the polygon.
void Add | ( | RPolygons & | polys | ) |
Add the polygon representing the object in the container of polygons.
RPolygon GetPlacedPolygon | ( | void | ) | const |
Return the polygon representing the object placed.
size_t GetOrder | ( | void | ) | const |
Get the order.
Member Data Documentation
|
protected |
Pointer to the the object.
|
protected |
The particular configuration of the object used.
|
protected |
Position of the object.
|
protected |
Indicate the container of the object (if any). This is used to aggregate a set of objects.
|
protected |
Order of the geometric information.