![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
Helper class to manage and maintain object extents.
Also allows minor geometric manipulation.
An Envelope is axis aligned.
Public Member Functions | |
TSLEnvelope () | |
TSLEnvelope (const TSLEnvelope &right) | |
TSLEnvelope (const TSLCoord &bottomLeft, const TSLCoord &topRight) | |
TSLEnvelope (TSLTMC x1, TSLTMC y1, TSLTMC x2, TSLTMC y2) | |
~TSLEnvelope () | |
bool | operator== (const TSLEnvelope &rhs) const |
bool | operator!= (const TSLEnvelope &rhs) const |
TSLEnvelope & | operator= (const TSLEnvelope &anotherEnvelope) |
TSLEnvelope & | operator+= (const TSLCoord &c) |
TSLEnvelope & | operator+= (const TSLEnvelope &e) |
const TSLCoord & | bottomLeft () const |
TSLCoord | centre () const |
bool | contains (const TSLEnvelope &e) const |
bool | containsWithTolerance (const TSLEnvelope &e, TSLTMC tolerance) const |
bool | contains (const TSLCoord &coord) const |
void | corners (const TSLCoord &bottomLeft, const TSLCoord &topRight) |
void | corners (TSLTMC x1, TSLTMC y1, TSLTMC x2, TSLTMC y2) |
double | distance (const TSLEnvelope &envelope) const |
bool | expand (TSLTMC inc) |
bool | expand (TSLTMC xInc, TSLTMC yInc) |
TSLULong | height () const |
bool | inside (const TSLEnvelope &e) const |
bool | intersect (const TSLEnvelope &e) const |
TSLEnvelope | intersection (const TSLEnvelope &other) const |
bool | overlaps (const TSLEnvelope &e) const |
void | reset (const TSLCoord &coord) |
bool | rotate (double angle, TSLTMC cx, TSLTMC cy) |
bool | scale (double scaleOnX, double scaleOnY, const TSLCoord *origin=NULL) |
bool | scale (double scaleParam, const TSLCoord *origin=NULL) |
double | squareDistance (const TSLEnvelope &envelope) const |
const TSLCoord & | topRight () const |
bool | translate (TSLTMC dx, TSLTMC dy) |
void | move (TSLTMC x, TSLTMC y) |
TSLULong | width () const |
bool | within (const TSLEnvelope &e) const |
bool | withinWithTolerance (const TSLEnvelope &e, TSLTMC tolerance) const |
TSLTMC | xMax () const |
TSLTMC | xMin () const |
TSLTMC | yMax () const |
TSLTMC | yMin () const |
Public Attributes | |
TSLCoord | m_bottomLeft |
TSLCoord | m_topRight |
|
inline |
Class TSLEnvelope
|
inline |
Constructor of an Envelope object with specified bounds.
Although the arguments are typically bottom left and top right corners, the x and y values are sorted into the appropriate corner.
|
inline |
Constructor of an Envelope object with specified bounds.
Although the arguments are typically bottom left and top right corners, the x and y values are sorted into the appropriate corner.
(x1,y1) | Corner of the extent. |
(x2,y2) | Opposite corner of the extent |
|
inline |
Destructor.
|
inline |
Query the bottom left corner of the extent.
|
inline |
Returns the centre of the envelope.
|
inline |
Query if this envelope contains the specified coordinate.
For the purposes of this method, a coordinate is considered contained if it touches the boundary.
coord | Coordinate to check. |
|
inline |
Query if this envelope contains the specified envelope.
For the purposes of this method, an envelope is considered contained if it touches the boundary.
e | Envelope to check. |
|
inline |
Query if this envelope contains the specified envelope.
For the purposes of this method, an envelope is considered contained if it touches the boundary. The tolerance is used to reduce the size of this envelope (only for the purpose of this check) at both max and min corners.
e | Envelope to check. |
tolerance | A TMC value that this envelope is reduced by. |
Sets both corners of the envelope.
Although the arguments are typically bottom left and top right corners, the x and y values are sorted into the appropriate corner.
|
inline |
Sets both corners of the envelope.
Although the arguments are typically bottom left and top right corners, the x and y values are sorted into the appropriate corner.
(x1,y1) | Corner of the extent. |
(x2,y2) | Opposite corner of the extent. |
|
inline |
The method returns the Euclidean distance between this envelope and another TSLEnvelope.
If the envelopes intersect (overlap) then the distance is 0.
envelope | the envelope to find the distance too. |
|
inline |
Expand envelope in all directions.
Makes the envelope bigger in all directions, by the specified amount. Thus the specific increment will be added to the top right corner values and subtracted from the bottom left corner values.
inc | Increment, in internal TMC units. |
|
inline |
Expand envelope in all directions, with different factors in X and Y axis.
Makes the envelope bigger in all directions, by the specified amounts. Thus the specific increments will be added to the top right corner values and subtracted from the bottom left corner values.
xInc | Increment applied to X axis, in internal TMC units. |
yInc | Increment applied to Y axis, in internal TMC units |
|
inline |
Query the height of envelope.
This method should be used rather than just taking the difference of yMax and yMin directly since numeric overflow may occur if the values are not converted correctly.
Returns the height of the envelope.
|
inline |
Query if the specified envelope lies inside this envelope.
For the purposes of this method, an envelope is considered inside if it touches the boundary.
Note: This is a synonym for the 'contains' method.
e | Envelope to check. |
|
inline |
Query if envelopes intersect.
For the purposes of this method, an envelope is considered intersecting if it touches the boundary.
Note: This is a synonym for the 'overlaps' method.
e | Envelope to check. |
|
inline |
If this envelope intersects the given envelope, then the intersection of the two (as a TSLEnvelope) is returned. Otherwise an empty envelope is returned.
|
inline |
Move the envelope to the specified location. The envelope will be clipped to the maximum TMC extent if necessary.
x | x-position in TMCs |
y | x-position in TMCs |
|
inline |
Compares two envelopes.
rhs | Source for comparison. |
|
inline |
Merge with specified coordinate.
Expands this envelope to include the specified coordinate.
c | Coordinate to include. |
|
inline |
Merge with specified envelope.
Expands this envelope to include the specified envelope.
e | Envelope to include. |
|
inline |
Assignment operator.
Sets the envelope to be equal to that specified.
anotherEnvelope | Source for new corners. |
|
inline |
Compares two envelopes.
rhs | Source for comparison. |
|
inline |
Query if envelopes overlap.
For the purposes of this method, an envelope is considered overlapping if it touches the boundary.
Note: This is a synonym for the 'intersect' method.
e | Envelope to check. |
|
inline |
Resets the envelope to the specified coordinate.
Resets the envelope so that both corners are at the specified point.
coord | Point to reset to. |
|
inline |
Rotate the envelope.
Updates an envelope with the extent of its rotated rectangle. The angle specified is in radians, +ve anti-clockwise from the x-axis. Rotates about specified centre.
angle | the angle for rotation |
cx | the centre x coordinate |
cy | the centre y coordinate |
|
inline |
Scales an envelope allowing different scale parameters in x and y.
If origin = NULL, the origin of the scale is the centre of the Envelope.
A scale parameter of 0 is not valid.
scaleOnX | Scale factor for X axis |
scaleOnY | Scale factor for Y axis. |
origin | Position to scale around, NULL scales around centre. |
|
inline |
Scales an envelope equally.
If origin = NULL, the origin of the scale is the centre of the Envelope.
A scale parameter of 0 is not valid.
scaleParam | Scale factor. |
origin | Position to scale around, NULL scales around centre. |
|
inline |
The method returns the Euclidean square distance between this envelope and another TSLEnvelope.
If the envelopes intersect (overlap) then the distance is 0.
envelope | the envelope to find the distance too. |
|
inline |
Query the top right corner of the extent.
|
inline |
Translates the envelope by a delta.
Translates the corners of the envelope by the specified delta values.
dx | X delta value. |
dy | Y delta value. |
|
inline |
Query the width of the envelope.
This method should be used rather than just taking the difference of xMax and xMin directly since numeric overflow may occur if the values are not converted correctly.
|
inline |
For the purposes of this method, an envelope is considered within, if it touches the boundary.
e | Envelope to check against. |
|
inline |
For the purposes of this method, an envelope is considered within, if it touches the boundary. The passed envelope is reduced by the size of the tolerance at both max and min corners.
e | Envelope to check against. |
tolerance | A TMC value that the passed envelope is reduced by. |
|
inline |
Query the maximum X value of the envelope.
|
inline |
Query the minimum X value of the envelope.
|
inline |
Query the maximum Y value of the envelope.
|
inline |
Query the minimum Y value of the envelope.
TSLCoord TSLEnvelope::m_bottomLeft |
Data Members for Associations
TSLCoord TSLEnvelope::m_topRight |