MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
envitia::maplink::earth::geometry::Geometry Class Referenceabstract
Inheritance diagram for envitia::maplink::earth::geometry::Geometry:

Detailed Description

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 Geometryclone () 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
 

Member Enumeration Documentation

◆ GeometryType

The type of a geometry instance.

Enumerator
GeometryTypePolyline 
GeometryTypePolygon 
GeometryTypeSymbol 
GeometryTypeText 
GeometryTypeSet 

◆ Interpolation

The type of interpolation applied to edges. Primarily this applies to Polylines and Polygons which cover a large distance.

Enumerator
GreatCircle 

Lines will be interpolated following a great circle path.

RhumbLine 

Lines will be interpolated following a rhumb line path.

Constructor & Destructor Documentation

◆ ~Geometry()

virtual envitia::maplink::earth::geometry::Geometry::~Geometry ( )
virtual

Destructor.

◆ Geometry() [1/3]

envitia::maplink::earth::geometry::Geometry::Geometry ( )
protected

◆ Geometry() [2/3]

envitia::maplink::earth::geometry::Geometry::Geometry ( const char * style)
protected

◆ Geometry() [3/3]

envitia::maplink::earth::geometry::Geometry::Geometry ( const Geometry & other)
protected

Member Function Documentation

◆ attributeName()

const char * envitia::maplink::earth::geometry::Geometry::attributeName ( unsigned int index) const

Query the name of an attribute.

Parameters
indexThe index in the attribute array to query.
Returns
The name of the attribute, or null if index >= numAttributes().

◆ attributeValue()

const char * envitia::maplink::earth::geometry::Geometry::attributeValue ( unsigned int index) const

Query the value of an attribute.

Parameters
indexThe index in the attribute array to query.
Returns
The value of the attribute, or null if index >= numAttributes().

◆ centroid()

GeodeticPoint envitia::maplink::earth::geometry::Geometry::centroid ( ) const

Query the centroid of the geometry.

◆ clone()

virtual Geometry * envitia::maplink::earth::geometry::Geometry::clone ( ) const
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.

◆ getAttribute()

const char * envitia::maplink::earth::geometry::Geometry::getAttribute ( const char * name) const

Get the value of an attribute.

Parameters
nameThe name of the attribute to query.
Returns
The value of the attribute, or null if not set.

◆ interpolation() [1/2]

Interpolation envitia::maplink::earth::geometry::Geometry::interpolation ( ) const

Query the type of interpolation applied to edges.

By default edges interpolation is set to GreatCircle

◆ interpolation() [2/2]

void envitia::maplink::earth::geometry::Geometry::interpolation ( Interpolation i)

Set the type of interpolation applied to edges.

◆ numAttributes()

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:

Returns
The number of attributes configured on the Geometry instance.

◆ removeAttribute() [1/2]

bool envitia::maplink::earth::geometry::Geometry::removeAttribute ( const char * name)

Remove an attribute.

Parameters
nameThe name of the attribute to remove.
Returns
true if the attribute was removed, false otherwise.

◆ removeAttribute() [2/2]

bool envitia::maplink::earth::geometry::Geometry::removeAttribute ( unsigned int index)

Remove an attribute.

Parameters
indexThe index in the attribute array to remove.
Returns
true if the attribute was removed, false otherwise.

◆ rotate()

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.

Parameters
axisThe axis of rotation.
angleThe angle to rotate by around the axis, in degrees, clockwise.

◆ scale() [1/2]

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.

Parameters
sThe amount to scale the geometry by.

◆ scale() [2/2]

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.

Parameters
sThe amount to scale the geometry by.
originThe origin for the scaling operation.

◆ setAttribute()

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.

Parameters
nameThe name of the attribute to set.
valueThe value to set.
Returns
true if the attribute was set, false otherwise.

◆ styleName() [1/2]

const char * envitia::maplink::earth::geometry::Geometry::styleName ( ) const

Query the style used when rendering the geometry.

◆ styleName() [2/2]

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()).

See also
Surface3D::setStyle.
Parameters
styleThe name of the style to render this geometry as.

◆ translate()

void envitia::maplink::earth::geometry::Geometry::translate ( const GeodeticPoint & t)

Translate the geometry.

This method will translate the coordinates of the Geometry by the specified amount. If a translation is applied to a GeoemtrySet then all child Geometry within the set will be modified.

Parameters
tThe translation to apply.

◆ type()

virtual GeometryType envitia::maplink::earth::geometry::Geometry::type ( ) const
pure virtual

◆ visibility()

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.

Parameters
vThe visibility of the geometry.

◆ visibilityOnSurface() [1/2]

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.

Parameters
vThe visibility of the geometry.
surfaceThe surface to set the visibility for.

◆ visibilityOnSurface() [2/2]

bool envitia::maplink::earth::geometry::Geometry::visibilityOnSurface ( const Surface3D * surface) const

Query the visibility of the geometry.

Parameters
surfaceThe surface to check the visibility for.
Returns
The visibility of the geometry on all surfaces.

Member Data Documentation

◆ m_p

void* envitia::maplink::earth::geometry::Geometry::m_p
protected