MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLPrintItem Class Reference

Detailed Description

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 &centre, int scale)
 
bool extent (const TSLEnvelope &reqdExtent)
 
bool getBorder (TSLStyleID &colour, TSLStyleID &style, TSLDeviceUnits &thickness) const
 
bool getClearFlag () const
 
TSLPrintItemoperator= (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
 
TSLDrawingSurfacedrawingSurface () const
 

Constructor & Destructor Documentation

◆ TSLPrintItem() [1/3]

TSLPrintItem::TSLPrintItem ( )

Default constructor for TSLPrintItem.

◆ TSLPrintItem() [2/3]

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.

Parameters
surfaceDrawing Surface containing layers to print
tmcPerMetreNumber of TMC per metre. If 0, defaults to TMCperMU.
templateNameName of rectangle in template file to replace by this item.

◆ TSLPrintItem() [3/3]

TSLPrintItem::TSLPrintItem ( const TSLPrintItem & other)

Copy constructor for TSLPrintItem.

◆ ~TSLPrintItem()

TSLPrintItem::~TSLPrintItem ( )

Destructor for TSLPrintItem.

Member Function Documentation

◆ calcExtent()

bool TSLPrintItem::calcExtent ( TSLEnvelope & extent,
const TSLEnvelope & itemExtentInDU,
TSLTMC pageDUPerMetre ) const

◆ centreAndScale()

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.

Parameters
centreCentre point of item to display
scaleScale when printing item.
Returns
true on success, false otherwise.

◆ drawingSurface() [1/2]

TSLDrawingSurface * TSLPrintItem::drawingSurface ( ) const

◆ drawingSurface() [2/2]

void TSLPrintItem::drawingSurface ( TSLDrawingSurface * newSurface)
inline

Private, undocumented methods, for internal use by COM wrappers only

◆ extent()

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.

Parameters
reqdExtentExtent to ensure displayed.
Returns
true on success, false otherwise.

◆ getBorder()

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.

Parameters
colourStorage for colour for item border. Index into colors file specified in 'TSLDrawingSurface::setupColours'
styleStorage for style for item border. Index into line styles file specified in 'TSLDrawingSurface::setupLineStyles'
thicknessStorage for thickness for item border, in device units.
Returns
true on success, false otherwise.

◆ getClearFlag()

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.

◆ getTMCPerMetre()

TSLTMC TSLPrintItem::getTMCPerMetre ( )
inline

◆ operator=()

TSLPrintItem & TSLPrintItem::operator= ( const TSLPrintItem & other)

Assignment operator for this class.

◆ setBorder()

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.

Parameters
colourColour for item border. Index into colors file specified in 'TSLDrawingSurface::setupColours'
styleStyle for item border. Index into line styles file specified in 'TSLDrawingSurface::setupLineStyles'
thicknessThickness for item border, in device units.
Returns
true on success, false otherwise.

◆ setClearFlag()

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.

Parameters
cleartrue/false value to set.

◆ setTMCPerMetre()

void TSLPrintItem::setTMCPerMetre ( TSLTMC newVal)
inline

◆ templateName() [1/2]

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.

◆ templateName() [2/2]

bool TSLPrintItem::templateName ( const char * name)

Set the name of the template rectangle to use when defining the area to print the template.

Parameters
nameName of template rectangle to use
Returns
true on success, false otherwise.