2D object configuration. More...

#include <robj2dconfig.h>

Collaboration diagram for RObj2DConfig:
[legend]

Public Member Functions

 RObj2DConfig (RObj2D *obj, tOrientation ori)
 
int Compare (const RObj2DConfig &obj) const
 
int Compare (const tOrientation ori) const
 
void Set (const RPolygon &poly)
 
void Set (RContainer< RRect, false, false > &rects)
 
tCoord GetWidth (void) const
 
tCoord GetHeight (void) const
 
tCoord GetArea (void)
 
tOrientation GetOrientation (void) const
 
const RPolygonGetPolygon (void) const
 
RCursor< RObj2DConfigConnectorGetConnectors (void) const
 
RCursor< RRectGetRects (void) const
 
void Add (RObj2DConfigConnector *con)
 
RObj2DConfigConnectorGetConnector (RObj2DConnector *con) const
 
RObj2DConfigConnectorGetConnector (const RString &con) const
 

Private Attributes

RObj2DObj
 
RPolygon Polygon
 
RRects Rects
 
RRect Rect
 
tOrientation Orientation
 
RContainer
< RObj2DConfigConnector, true,
true > 
Connectors
 
tCoord Area
 

Detailed Description

2D object configuration.

The RObj2DConfig provides a representation for a particular configuration of an object.

Constructor & Destructor Documentation

RObj2DConfig ( RObj2D obj,
tOrientation  ori 
)

Constructor.

Parameters
objObject.
oriOrientation.

Member Function Documentation

int Compare ( const RObj2DConfig obj) const

Compare two configuration of object.

Parameters
objConfiguration to compare with.
Returns
a value used by RContainer.
int Compare ( const tOrientation  ori) const

Compare the current configuration with a possible orientation.

Parameters
oriOrientation
Returns
a value used by RContainer.
void Set ( const RPolygon poly)

Set the polygon. The area and the decomposition in rectangles are computed.

Parameters
polyPolygon.
void Set ( RContainer< RRect, false, false > &  rects)

Set the rectangles corresponding to the decomposition of the polygon. The area is computed.

Parameters
rectsRectangles. The container is emptied by this method.
tCoord GetWidth ( void  ) const

Return the Width of the object represented.

tCoord GetHeight ( void  ) const

Return the Height of the object represented.

tCoord GetArea ( void  )

Return the area of the object.

tOrientation GetOrientation ( void  ) const
Returns
the orientation of the configuration.
const RPolygon& GetPolygon ( void  ) const
Returns
the polygon.
RCursor<RObj2DConfigConnector> GetConnectors ( void  ) const
Returns
a cursor over the connectors.
RCursor<RRect> GetRects ( void  ) const
Returns
a cursor over the rectangles representing the decomposition of the polygon.
void Add ( RObj2DConfigConnector con)

Add a connector to the configuration.

Parameters
conConnector.
RObj2DConfigConnector* GetConnector ( RObj2DConnector con) const
Returns
the actual configuration of a given connector.
Parameters
conConnector.
RObj2DConfigConnector* GetConnector ( const RString con) const
Returns
the actual configuration of a given connector.
Parameters
conName of the connector.

Member Data Documentation

RObj2D* Obj
private

The object.

RPolygon Polygon
private

Polygon representing the object.

RRects Rects
private

Rectangular decompositions of the polygon.

RRect Rect
private

Rectangle holding the polygon.

tOrientation Orientation
private

Orientation.

RContainer<RObj2DConfigConnector,true,true> Connectors
private

The connectors of this object.

tCoord Area
private

Represent the area of the object.