Maria GDK 5.0.0.738
Documentation of native code in develop branch
Loading...
Searching...
No Matches
Maria::Polygon Class Referencefinal

#include <MPolygon.h>

Inheritance diagram for Maria::Polygon:
Maria::DrawObject

Public Member Functions

virtual void setPosition (const BasicGeoTypes::GeoPos &pos) override
 Set origin of the draw object at the given position.
 
virtual BasicGeoTypes::GeoPos getPosition () const override
 Get the origin of the draw object in geographical coordinates.
 
BasicGeoTypes::GeoPos getPoint (int i, int ring=0) const
 Get a point from a given polygon ring.
 
void setPoint (int i, const BasicGeoTypes::GeoPos &p, int ring=0)
 Set a point in the given polygon ring.
 
void addPoint (const BasicGeoTypes::GeoPos &p, int ring=0)
 Append a new point to the given polygon ring.
 
int getNumPoints (int ring=0) const
 Get number of points in the given polygon ring.
 
bool isEmpty () const
 Check if the polygon contains any data.
 
int getNumRings () const
 Get number of polygon rings.
 
- Public Member Functions inherited from Maria::DrawObject
 DrawObject (const std::shared_ptr< Maria::DrawObjectData > &data)
 
Maria::ItemId getId () const
 
const std::string getDataTypeId () const
 
const std::shared_ptr< Maria::DrawObjectDatagetData () const
 
virtual void setPosition (const BasicGeoTypes::GeoPos &pos)=0
 Set origin of the draw object at the given position.
 
virtual BasicGeoTypes::GeoPos getPosition () const =0
 Get the origin of the draw object in geographical coordinates.
 
void setLineColor (const STK::Color4i color)
 
const STK::Color4i getLineColor () const
 
void setLineDashStyle (Maria::DashStyle dashStyle)
 
Maria::DashStyle getLineDashStyle () const
 
void setLineWidth (int w)
 
int getLineWidth () const
 
void setFillColor (const STK::Color4i color)
 
const STK::Color4i getFillColor () const
 
void setFill (bool fill)
 
bool getFill () const
 
void setFillStyle (Maria::FillStyle fillStyle)
 
Maria::FillStyle getFillStyle () const
 
void setText (const std::string &text)
 Set text for draw object.
 
std::string getText () const
 Get text for draw object.
 
void setFieldValue (const std::string &key, const std::string &value)
 
std::string getFieldValue (const std::string &key) const
 

Protected Member Functions

std::shared_ptr< PolygonGeometrygeometry () const
 

Friends

class DrawObjectFactory
 

Additional Inherited Members

- Protected Attributes inherited from Maria::DrawObject
std::shared_ptr< DrawObjectData_data
 
int32_t _index = -1
 

Detailed Description

Polygon - Geographical polygon object. This class represents a draw object with polygon geometry, defined in geographical lat/lon coordinates. The polygon may consist of several "rings" where each ring is a closed polyone. The outer ring is the perimeter of the polygon and any inner rings will be holes.

The outer ring is taken to be ring #0 by convention, and if no ring is specified in the api methods, the outer ring is assumed.

Member Function Documentation

◆ addPoint()

void Maria::Polygon::addPoint ( const BasicGeoTypes::GeoPos p,
int  ring = 0 
)

Append a new point to the given polygon ring.

Parameters
pNew point data.
ringRing index. If not specified, ring 0 (the outer perimeter) is assumed.

◆ getNumPoints()

int Maria::Polygon::getNumPoints ( int  ring = 0) const
inline

Get number of points in the given polygon ring.

Parameters
ringRing index. If not specified, ring 0 (the outer perimeter) is assumed.
Returns
Number of points in the ring.

◆ getNumRings()

int Maria::Polygon::getNumRings ( ) const
inline

Get number of polygon rings.

Returns
Number of rings in the polygon

◆ getPoint()

BasicGeoTypes::GeoPos Maria::Polygon::getPoint ( int  i,
int  ring = 0 
) const

Get a point from a given polygon ring.

Parameters
iPoint index the the polygon ring.
ringRing index. If not specified, ring 0 (the outer perimeter) is assumed.
Returns
A geo point for the given index.

◆ getPosition()

BasicGeoTypes::GeoPos Maria::Polygon::getPosition ( ) const
overridevirtual

Get the origin of the draw object in geographical coordinates.

Implements Maria::DrawObject.

◆ setPoint()

void Maria::Polygon::setPoint ( int  i,
const BasicGeoTypes::GeoPos p,
int  ring = 0 
)

Set a point in the given polygon ring.

Parameters
iPoint index the the polygon ring.
pNew point data.
ringRing index. If not specified, ring 0 (the outer perimeter) is assumed.

◆ setPosition()

void Maria::Polygon::setPosition ( const BasicGeoTypes::GeoPos pos)
overridevirtual

Set origin of the draw object at the given position.

Parameters
posGeographical position of the draw object.

Implements Maria::DrawObject.


The documentation for this class was generated from the following files: