GRE::LABELPLACEMENT Class Reference

#include <gre/labelplacement.h>

List of all members.

Classes

class  CONST_ITERATOR
class  ITERATOR

Public Member Functions

 LABELPLACEMENT (LAYER *layer, VIEW *view)
virtual ~LABELPLACEMENT ()
ERRVALUE Add (const LABELPLACE &place)
CONST_ITERATOR Begin () const
void Clear ()
void DeleteLabels (const RVC::ELEMENT &element)
CONST_ITERATOR End () const
INT32 Find (const REGION2D &region, MILIST< GRE::LABELPLACE * > &list) const
INT32 Find (const DRECT2D &rect, MILIST< GRE::LABELPLACE * > &list) const
INT32 Find (const DPOINT2D &pt, MILIST< GRE::LABELPLACE * > &list, int maxdist=0) const
INT32 Find (const DPOINT2D &pt, GRE::LABELPLACE &place, int maxdist=0) const
ERRVALUE GetCombinedRegion (REGION2D &region, bool bClear=true) const
bool GetLabelPlace (const RVC::ELEMENT &elem, GRE::LABELPLACE &place) const
bool GetLabelPlaces (const RVC::ELEMENT &elem, LABELPLACELIST &places) const
LAYERGetLayer () const
int GetNumItems () const
VIEWGetView () const

Static Public Member Functions

static ERRVALUE Deconflict (SIMPLE_ARRAY< LABELPLACEMENT * > &LabelSets)

Private Member Functions

virtual bool v_CompareLabels (const RVC::ELEMENT &elem1, const RVC::ELEMENT &elem2) const

Constructor & Destructor Documentation

GRE::LABELPLACEMENT::LABELPLACEMENT ( LAYER layer,
VIEW view 
)

Default constructor.

virtual GRE::LABELPLACEMENT::~LABELPLACEMENT (  )  [virtual]

Destructor.


Member Function Documentation

ERRVALUE GRE::LABELPLACEMENT::Add ( const LABELPLACE place  ) 

Add a place.

CONST_ITERATOR GRE::LABELPLACEMENT::Begin (  )  const [inline]

LABELPLACE Iterator constructor.

void GRE::LABELPLACEMENT::Clear (  ) 

Clear all places.

static ERRVALUE GRE::LABELPLACEMENT::Deconflict ( SIMPLE_ARRAY< LABELPLACEMENT * > &  LabelSets  )  [static]

Shuffle labels around so they don't overlap (note: not actually implemented yet).

void GRE::LABELPLACEMENT::DeleteLabels ( const RVC::ELEMENT element  ) 

Deletes placement information for all labels attached to a given element.

Note, if a label is associated with more than one element, only the leader line will be deleted.

CONST_ITERATOR GRE::LABELPLACEMENT::End (  )  const [inline]

LABELPLACE Iterator End condition.

INT32 GRE::LABELPLACEMENT::Find ( const REGION2D region,
MILIST< GRE::LABELPLACE * > &  list 
) const

Find all labels intersecting a rectangle in screen coordinates.

List will be sorted front to back. pt is in screen coordinates.

Returns:
Number of items found or error if < 0
INT32 GRE::LABELPLACEMENT::Find ( const DRECT2D rect,
MILIST< GRE::LABELPLACE * > &  list 
) const

Find all labels intersecting a rectangle in screen coordinates.

List will be sorted front to back. pt is in screen coordinates.

Returns:
Number of items found or error if < 0
INT32 GRE::LABELPLACEMENT::Find ( const DPOINT2D pt,
MILIST< GRE::LABELPLACE * > &  list,
int  maxdist = 0 
) const

Given a screen coordinate, find all labels at that location.

List will be sorted front to back. pt is in screen coordinates.

Returns:
Number of items found or error if < 0
INT32 GRE::LABELPLACEMENT::Find ( const DPOINT2D pt,
GRE::LABELPLACE place,
int  maxdist = 0 
) const

Given a screen coordinate, find the label (topmost in case of multiples) at that location.

pt is in screen coordinates. This version is for finding the label for data tips and things. The LABELPLACE returned is a copy, so changing it won't do anthing.

Returns:
Number of items found or error if < 0
ERRVALUE GRE::LABELPLACEMENT::GetCombinedRegion ( REGION2D region,
bool  bClear = true 
) const

Get the union of of all label place regions.

This may be used for clip-under support, but then again, maybe not. If the actual labels will be drawn with balloon tips, this won't know about it. By default, the region passed in will be cleared of any previous value. If you pass false for the bClear parameter, it will combine the label regions with the region passed in.

Parameters:
bClear Clear the region first
bool GRE::LABELPLACEMENT::GetLabelPlace ( const RVC::ELEMENT elem,
GRE::LABELPLACE place 
) const

Return the LABELPLACE for a given element.

Will return true if the label is found, false if not.

bool GRE::LABELPLACEMENT::GetLabelPlaces ( const RVC::ELEMENT elem,
LABELPLACELIST places 
) const

Return the LABELPLACEs for all labels for given element.

Will return true if the label is found, false if not.

LAYER* GRE::LABELPLACEMENT::GetLayer (  )  const
int GRE::LABELPLACEMENT::GetNumItems (  )  const
VIEW* GRE::LABELPLACEMENT::GetView (  )  const
virtual bool GRE::LABELPLACEMENT::v_CompareLabels ( const RVC::ELEMENT elem1,
const RVC::ELEMENT elem2 
) const [private, virtual]

Compare the labels for two elements.

Function should return true if the labels are the same, false if not. The optimizer may use this (based on an option flag) to determine if one label could be used for two elements. There is a default implementation which returns false, preventing lable combining.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:34:15 2012 for TNTsdk 2012 by  doxygen 1.6.1