![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
The base class of the Geometry hierarchy
Each instance of the Geometry class represents a primitive, which may be displayed within the surface. Geometry will be displayed based on a Style, which is configured on the Surface3D.
Public Types | |
enum | GeometryType { GeometryTypePolyline , GeometryTypePolygon , GeometryTypeSymbol , GeometryTypeText , GeometryTypeSet } |
The type of a geometry instance. More... | |
enum | Interpolation { GreatCircle , RhumbLine } |
Public Member Functions | |
virtual | ~Geometry () |
Destructor. | |
virtual GeometryType | type () const =0 |
Query the type of the geometry instance. | |
virtual Geometry * | clone () const =0 |
const char * | styleName () const |
Query the style used when rendering the geometry. | |
void | styleName (const char *style) |
Interpolation | interpolation () const |
void | interpolation (Interpolation i) |
Set the type of interpolation applied to edges. | |
void | visibility (bool v) |
void | visibilityOnSurface (bool v, const Surface3D *surface) |
bool | visibilityOnSurface (const Surface3D *surface) const |
bool | setAttribute (const char *name, const char *value) |
const char * | getAttribute (const char *name) const |
bool | removeAttribute (const char *name) |
unsigned int | numAttributes () const |
const char * | attributeName (unsigned int index) const |
const char * | attributeValue (unsigned int index) const |
bool | removeAttribute (unsigned int index) |
GeodeticPoint | centroid () const |
Query the centroid of the geometry. | |
void | translate (const GeodeticPoint &t) |
void | scale (const GeodeticPoint &s) |
void | scale (const GeodeticPoint &s, const GeodeticPoint &origin) |
void | rotate (const GeodeticDirection &axis, double angle) |
Protected Member Functions | |
Geometry () | |
Geometry (const char *style) | |
Geometry (const Geometry &other) | |
Protected Attributes | |
void * | m_p |
|
virtual |
Destructor.
|
protected |
|
protected |
|
protected |
const char * envitia::maplink::earth::geometry::Geometry::attributeName | ( | unsigned int | index | ) | const |
Query the name of an attribute.
index | The index in the attribute array to query. |
const char * envitia::maplink::earth::geometry::Geometry::attributeValue | ( | unsigned int | index | ) | const |
Query the value of an attribute.
index | The index in the attribute array to query. |
GeodeticPoint envitia::maplink::earth::geometry::Geometry::centroid | ( | ) | const |
Query the centroid of the geometry.
|
pure virtual |
Create a clone of this geometry
If the geometry is a set this will perform a deep copy (All children of the set will be cloned).
Implemented in envitia::maplink::earth::geometry::GeometrySet, envitia::maplink::earth::geometry::Polygon, envitia::maplink::earth::geometry::Polyline, envitia::maplink::earth::geometry::Symbol, and envitia::maplink::earth::geometry::Text.
const char * envitia::maplink::earth::geometry::Geometry::getAttribute | ( | const char * | name | ) | const |
Get the value of an attribute.
name | The name of the attribute to query. |
Interpolation envitia::maplink::earth::geometry::Geometry::interpolation | ( | ) | const |
Query the type of interpolation applied to edges.
By default edges interpolation is set to GreatCircle
void envitia::maplink::earth::geometry::Geometry::interpolation | ( | Interpolation | i | ) |
Set the type of interpolation applied to edges.
unsigned int envitia::maplink::earth::geometry::Geometry::numAttributes | ( | ) | const |
Query the number of attributes.
In most cases applications should refer to attributes by name. The following methods are provided to allow applications to iterate through the attribute set:
bool envitia::maplink::earth::geometry::Geometry::removeAttribute | ( | const char * | name | ) |
Remove an attribute.
name | The name of the attribute to remove. |
bool envitia::maplink::earth::geometry::Geometry::removeAttribute | ( | unsigned int | index | ) |
Remove an attribute.
index | The index in the attribute array to remove. |
void envitia::maplink::earth::geometry::Geometry::rotate | ( | const GeodeticDirection & | axis, |
double | angle ) |
Rotate the geometry.
This method will rotate the coordinates of the geometry by the specified amount, around the specified axis.
The rotation will be applied relative to the centroid of the geometry.
As symbols and text are defined as a single point this method will have no apparent effect on them. The visualisation of these primitives may however be rotated on the display by calling Symbol::rotation or Text::rotation.
axis | The axis of rotation. |
angle | The angle to rotate by around the axis, in degrees, clockwise. |
void envitia::maplink::earth::geometry::Geometry::scale | ( | const GeodeticPoint & | s | ) |
Scale the geometry relative to its centroid.
This method will scale the coordinates of the Geometry by the specified amount.
s | The amount to scale the geometry by. |
void envitia::maplink::earth::geometry::Geometry::scale | ( | const GeodeticPoint & | s, |
const GeodeticPoint & | origin ) |
Scale the geometry.
This method will scale the coordinates of the Geometry by the specified amount.
s | The amount to scale the geometry by. |
origin | The origin for the scaling operation. |
bool envitia::maplink::earth::geometry::Geometry::setAttribute | ( | const char * | name, |
const char * | value ) |
Set the value of an attribute.
If the named attribute doesn't exist it will be added by calling this method.
name | The name of the attribute to set. |
value | The value to set. |
const char * envitia::maplink::earth::geometry::Geometry::styleName | ( | ) | const |
Query the style used when rendering the geometry.
void envitia::maplink::earth::geometry::Geometry::styleName | ( | const char * | style | ) |
Set the style to use when rendering the geometry.
When added to a surface a lookup will be performed against the Surface3D's style list using this name.
If no style has been configured with this name then a default style will be used (Style::Style()).
style | The name of the style to render this geometry as. |
void envitia::maplink::earth::geometry::Geometry::translate | ( | const GeodeticPoint & | t | ) |
|
pure virtual |
Query the type of the geometry instance.
Implemented in envitia::maplink::earth::geometry::GeometrySet, envitia::maplink::earth::geometry::Polygon, envitia::maplink::earth::geometry::Polyline, envitia::maplink::earth::geometry::Symbol, and envitia::maplink::earth::geometry::Text.
void envitia::maplink::earth::geometry::Geometry::visibility | ( | bool | v | ) |
Set the visibility of the geometry on all surfaces.
Calling this method will override any per-surface visibility settings.
v | The visibility of the geometry. |
void envitia::maplink::earth::geometry::Geometry::visibilityOnSurface | ( | bool | v, |
const Surface3D * | surface ) |
Set the visibility of the geometry on a specific surface.
Calling this method will set the visibility of the geometry on the specified surface. This method will not affect the geometry's visibility on other surfaces.
v | The visibility of the geometry. |
surface | The surface to set the visibility for. |
bool envitia::maplink::earth::geometry::Geometry::visibilityOnSurface | ( | const Surface3D * | surface | ) | const |
Query the visibility of the geometry.
surface | The surface to check the visibility for. |
|
protected |