![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
Class managing a set of internal TMC coordinates.
Used to construct geometric objects such as polylines and polygons.
NOTE: Instances of TSLCoordSet must be allocated on the heap since the allocation is redirected to MapLink. To prevent users creating these objects statically, automatically or embedded, the destructor is private. To destroy a TSLCoordSet, call the public destroy method, rather than the delete operator.
Public Member Functions | |
TSLCoordSet () | |
TSLCoordSet (const TSLCoordSet &other) | |
TSLCoordSet & | operator= (const TSLCoordSet &right) |
TSLCoord & | operator[] (int index) |
const TSLCoord & | operator[] (int index) const |
bool | add (TSLTMC x, TSLTMC y, int index=-1) |
bool | add (const TSLCoord &coord, int index=-1) |
bool | addCoords (const TSLCoord *coords, int num) |
bool | addCoords (const TSLTMC *xy, int num) |
TSLCoord & | back () |
const TSLCoord & | back () const |
unsigned int | capacity () |
bool | clear () |
bool | concatenate (const TSLCoordSet &rhs) |
TSLAreaRelations | coordInArea (const TSLCoord &coord) const |
bool | destroy () |
TSLCoord & | elementAt (int index) |
const TSLCoord & | elementAt (int index) const |
TSLEnvelope | envelope () const |
void | extendHint (TSLCoordSetExtendHint hint, int extendBlockSize) |
TSLCoord & | front () |
const TSLCoord & | front () const |
double | length () const |
bool | move (const TSLCoord &location, const TSLCoord &reference) |
bool | nearest (const TSLCoord &coord, TSLCoord &nearestCoord, int &nearestIndex) const |
bool | remove (int index) |
void | reserve (int size) |
void | resize (int newSize) |
bool | reverse () |
bool | rotate (double angle, const TSLCoord *origin=0) |
bool | scale (double scaleParam, const TSLCoord *origin=0) |
int | size () const |
void | swap (TSLCoordSet &rhs) |
bool | translate (TSLTMC dx, TSLTMC dy) |
void * | operator new (size_t size) TSL_NO_THROW |
void * | operator new (size_t size, char *filename, int line) |
TSLCoordSet::TSLCoordSet | ( | ) |
Default constructor.
Creates an empty coordinate set.
Use the destroy method to destroy an instance of this class, rather than the delete operator.
TSLCoordSet::TSLCoordSet | ( | const TSLCoordSet & | other | ) |
Copy constructor.
Creates a coordinate set that is a copy of that specified.
Use the destroy method to destroy an instance of this class, rather than the delete operator.
bool TSLCoordSet::add | ( | const TSLCoord & | coord, |
int | index = -1 ) |
Add a new coordinate to the set.
coord | New coordinate to append |
index | Position for new point. If value is out of range, then new coordinate is appended. |
bool TSLCoordSet::add | ( | TSLTMC | x, |
TSLTMC | y, | ||
int | index = -1 ) |
Add a new coordinate to the set.
x | X coordinate for new point. |
y | Y coordinate for new point. |
index | Position for new point. If value is out of range, then new coordinate is appended. |
bool TSLCoordSet::addCoords | ( | const TSLCoord * | coords, |
int | num ) |
Add a number of new coordinates to the set.
coords | Pointer to new coordinates to append. |
num | Number of coordinates to add |
bool TSLCoordSet::addCoords | ( | const TSLTMC * | xy, |
int | num ) |
Add a number of new coordinates to the set.
xy | Pointer to new xy pairs to append. |
num | Number of xy pairs to add |
TSLCoord & TSLCoordSet::back | ( | ) |
Access the last coordinate.
Returns a reference to the last coordinate.
const TSLCoord & TSLCoordSet::back | ( | ) | const |
Access the last coordinate.
Returns a reference to the last coordinate
unsigned int TSLCoordSet::capacity | ( | ) |
Returns the capacity of the coordinate set, ie the number of coordinates that can be held in the allocated memory.
bool TSLCoordSet::clear | ( | ) |
Clears the coordinate set.
bool TSLCoordSet::concatenate | ( | const TSLCoordSet & | rhs | ) |
Concatenates anotherCoordSet to the supplier.
rhs | CoordSet to concatenate |
TSLAreaRelations TSLCoordSet::coordInArea | ( | const TSLCoord & | coord | ) | const |
Query whether the specified coordinate is inside the area formed by the coordinate set. This assumes that the coordinate set is closed.
The coordinates in this TSLCoordSet must be valid for creating a TSLPolygon i.e. edges must not cross, although they may touch and the coordinates must be specified in an anti-clockwise direction.
coord | Coordinate to test |
bool TSLCoordSet::destroy | ( | ) |
Destroy a TSLCoordSet.
NOTE : Instances of TSLCoordSet must be allocated on the heap since the allocation is redirected to MapLink. To prevent users creating these objects statically, automatically or embedded, we make the destructor private. To destroy a TSLCoordSet, call the public destroy method, rather than the delete operator.
TSLCoord & TSLCoordSet::elementAt | ( | int | index | ) |
Access the coordinate at the specified index.
index | Index into coordinate set |
const TSLCoord & TSLCoordSet::elementAt | ( | int | index | ) | const |
Access the read-only coordinate at the specified index.
index | Index into coordinate set |
TSLEnvelope TSLCoordSet::envelope | ( | ) | const |
Return the minimum bounding box of the coordinate set.
void TSLCoordSet::extendHint | ( | TSLCoordSetExtendHint | hint, |
int | extendBlockSize ) |
The extend hint determines the way in which the coordinate set reallocates its memory when the capacity of the coordinate set has been exceeded.
hint | The new hint for this coordinate set. |
extendBlockSize | Number of coordinates in the block. If you specify TSLCoordSetExtendByBlockSize, then this parameter defines the block size used. This is ignored for all other capacity hints. |
See documentation in TSLCoordSetExtendHint for further information.
TSLCoord & TSLCoordSet::front | ( | ) |
Access the first coordinate.
Returns a reference to the first coordinate.
const TSLCoord & TSLCoordSet::front | ( | ) | const |
Access the first coordinate.
Returns a reference to the first coordinate
double TSLCoordSet::length | ( | ) | const |
Returns the length of the polyline described by this set of coordinates in TMC units.
Moves the coordSet, matching the "reference" point of the coordSet (this can be a point which does not belong to the Entity) with the point defined by "location".
location | Point to move to. |
reference | Reference point to move from. |
bool TSLCoordSet::nearest | ( | const TSLCoord & | coord, |
TSLCoord & | nearestCoord, | ||
int & | nearestIndex ) const |
Queries for the index and value of the nearest coordinate in the coordset, to the specified point.
coord | Coord to find nearest to |
nearestCoord | Storage for nearest coordinate |
nearestIndex | Storage for index of nearest Coordinate |
void * TSLCoordSet::operator new | ( | size_t | size | ) |
These are here to avoid being documented Allocation redirection for API.
void * TSLCoordSet::operator new | ( | size_t | size, |
char * | filename, | ||
int | line ) |
When included in an MFC application in debug mode, the debug new expects this to be here. Override it and return the same as the normal one. The library must include it when compiled in release mode, since the user's application may be in debug mode.
TSLCoordSet & TSLCoordSet::operator= | ( | const TSLCoordSet & | right | ) |
Assignment operator.
Assigns the argument coordinate set to this.
right | Source for new value. |
TSLCoord & TSLCoordSet::operator[] | ( | int | index | ) |
Access the coordinate at the specified index.
index | Index into coordinate set |
const TSLCoord & TSLCoordSet::operator[] | ( | int | index | ) | const |
Access the read-only coordinate at the specified index.
index | Index into coordinate set |
bool TSLCoordSet::remove | ( | int | index | ) |
Remove the coordinate at the specified index.
index | Position for the point to remove. |
void TSLCoordSet::reserve | ( | int | size | ) |
Pre-allocate storage space for a specified number of coordinates.
size | The number of coordinates to reserve storage space for. |
void TSLCoordSet::resize | ( | int | newSize | ) |
Resizes the coordinate set so it contains newSize coordinates.
If the new size is smaller than the current size, the extra coordinates will be removed from the end, leaving the first newSize coordinates unchanged.
If the new size is larger than the current size, the new coordinates will be added to the end, and all will be set to (0,0).
newSize | The new size. |
bool TSLCoordSet::reverse | ( | ) |
Reverses the order of the coordinate sequence in the set of coordinates.
Returns true on success, false otherwise.
bool TSLCoordSet::rotate | ( | double | angle, |
const TSLCoord * | origin = 0 ) |
Rotates the coordSet clockwise by angle, using origin as the reference of the rotation or its envelope centre if origin = NULL.
The angle is given in radians.
angle | Angle to rotate by - radians, +ve anti-clockwise from +ve X axis |
origin | Position to rotate about |
bool TSLCoordSet::scale | ( | double | scaleParam, |
const TSLCoord * | origin = 0 ) |
Scales a coordSet. The origin of the scale is the envelope centre of the coordSet if origin = NULL.. A scale factor of 0 is not valid.
scaleParam | Scale factor |
origin | Location to scale about. |
int TSLCoordSet::size | ( | ) | const |
Query the number of coordinates in the coordinate set.
void TSLCoordSet::swap | ( | TSLCoordSet & | rhs | ) |
Efficiently swaps the contents of this TSLCoordSet with the one given.
rhs | TSLCoordSet to swap the contents with. |
bool TSLCoordSet::translate | ( | TSLTMC | dx, |
TSLTMC | dy ) |
Moves the coordSet by the specified x and y amounts.
dx | Delta to translate horizontally |
dy | Delta to translate vertically |