![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
This class holds all information about an item to be printed.
All layers attached to the specified drawingSurface will be printed. The area of the drawingSurface to print may be specified by TMC extent, or by specifying a scale and centre. If an extent is specified, then the drawingSurface will attempt to display the whole of the specified extent, keeping the aspect ratio. This is in line with the use of the 'resize' method on the drawingSurface.
The position of the item in the template is managed by specifying a named rectangle that is embedded within the template entity set. The item will be drawn in place of the name rectangle.
Public Member Functions | |
TSLPrintItem () | |
TSLPrintItem (TSLDrawingSurface *surface, TSLTMC tmcPerMetre=0, const char *templateName="map") | |
TSLPrintItem (const TSLPrintItem &other) | |
~TSLPrintItem () | |
bool | centreAndScale (const TSLCoord ¢re, int scale) |
bool | extent (const TSLEnvelope &reqdExtent) |
bool | getBorder (TSLStyleID &colour, TSLStyleID &style, TSLDeviceUnits &thickness) const |
bool | getClearFlag () const |
TSLPrintItem & | operator= (const TSLPrintItem &other) |
bool | setBorder (TSLStyleID colour, TSLStyleID style, TSLDeviceUnits thickness) |
void | setClearFlag (bool clear) |
bool | templateName (const char *name) |
const char * | templateName () const |
void | drawingSurface (TSLDrawingSurface *newSurface) |
void | setTMCPerMetre (TSLTMC newVal) |
TSLTMC | getTMCPerMetre () |
bool | calcExtent (TSLEnvelope &extent, const TSLEnvelope &itemExtentInDU, TSLTMC pageDUPerMetre) const |
TSLDrawingSurface * | drawingSurface () const |
TSLPrintItem::TSLPrintItem | ( | ) |
Default constructor for TSLPrintItem.
TSLPrintItem::TSLPrintItem | ( | TSLDrawingSurface * | surface, |
TSLTMC | tmcPerMetre = 0, | ||
const char * | templateName = "map" ) |
Constructor for Print Item.
Note that the layers are copied from the specified Drawing Surface to an internal one held within the Print Helper class. This means that any 'id' on the specified Drawing Surface will not be available during the print.
surface | Drawing Surface containing layers to print |
tmcPerMetre | Number of TMC per metre. If 0, defaults to TMCperMU. |
templateName | Name of rectangle in template file to replace by this item. |
TSLPrintItem::TSLPrintItem | ( | const TSLPrintItem & | other | ) |
Copy constructor for TSLPrintItem.
TSLPrintItem::~TSLPrintItem | ( | ) |
Destructor for TSLPrintItem.
bool TSLPrintItem::calcExtent | ( | TSLEnvelope & | extent, |
const TSLEnvelope & | itemExtentInDU, | ||
TSLTMC | pageDUPerMetre ) const |
bool TSLPrintItem::centreAndScale | ( | const TSLCoord & | centre, |
int | scale ) |
Sets centre point and scale to use when displaying this print item.
The scale units will be used in the calcExtent method.
centre | Centre point of item to display |
scale | Scale when printing item. |
TSLDrawingSurface * TSLPrintItem::drawingSurface | ( | ) | const |
|
inline |
Private, undocumented methods, for internal use by COM wrappers only
bool TSLPrintItem::extent | ( | const TSLEnvelope & | reqdExtent | ) |
Set extent of drawing surface to display.
The TSLDrawingSurface will attempt to display the whole of the specified extent, keeping the aspect ratio. This is in line with the use of the 'TSLDrawingSurface::resize' method.
reqdExtent | Extent to ensure displayed. |
bool TSLPrintItem::getBorder | ( | TSLStyleID & | colour, |
TSLStyleID & | style, | ||
TSLDeviceUnits & | thickness ) const |
Query method the border rendering attributes.
After an item has been printed, a border may be drawn around the rectangle. This method allows the rendering attributes of the border to be queried. If any of the attributes are zero, then the border will not be drawn.
colour | Storage for colour for item border. Index into colors file specified in 'TSLDrawingSurface::setupColours' |
style | Storage for style for item border. Index into line styles file specified in 'TSLDrawingSurface::setupLineStyles' |
thickness | Storage for thickness for item border, in device units. |
bool TSLPrintItem::getClearFlag | ( | ) | const |
Query method returning the value of the clear flag, which determines whether the background is cleared before drawing this item.. Default is true.
Returns the value of the flag.
|
inline |
TSLPrintItem & TSLPrintItem::operator= | ( | const TSLPrintItem & | other | ) |
Assignment operator for this class.
bool TSLPrintItem::setBorder | ( | TSLStyleID | colour, |
TSLStyleID | style, | ||
TSLDeviceUnits | thickness ) |
Sets the border rendering attributes.
After an item has been printed, a border may be drawn around the rectangle. This method allows the rendering attributes of the border to be defined. If any of the attributes are zero, then the border will not be drawn.
colour | Colour for item border. Index into colors file specified in 'TSLDrawingSurface::setupColours' |
style | Style for item border. Index into line styles file specified in 'TSLDrawingSurface::setupLineStyles' |
thickness | Thickness for item border, in device units. |
void TSLPrintItem::setClearFlag | ( | bool | clear | ) |
Query method returning the value of the clear flag, which determines whether the background is cleared before drawing this item.. Default is true.
clear | true/false value to set. |
|
inline |
const char * TSLPrintItem::templateName | ( | ) | const |
Query for the name of the template rectangle to use when defining the area to print the template.
Returns name of the template rectangle.
bool TSLPrintItem::templateName | ( | const char * | name | ) |
Set the name of the template rectangle to use when defining the area to print the template.
name | Name of template rectangle to use |