Rogue Wave Views
Maps Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions
IlvMapPolygon Class Reference

This class defines a Polygon. More...

#include <ilviews/maps/geometry/geopolygon.h>

Inheritance diagram for IlvMapPolygon:
IlvMapArea IlvMapGeometry

Public Member Functions

 IlvMapPolygon (IlvMapRing *exteriorRing)
 Constructs a polygon with its exterior ring. More...
 
 IlvMapPolygon (const IlvMapPolygon &source)
 Creates a polygon by copying an existing one. More...
 
void addInteriorRing (IlvMapRing *ring)
 Adds an interior ring to the polygon. More...
 
virtual IlBoolean contains (const IlvCoordinate &coordinate) const
 Returns IlTrue if coordinate is contained in the object. More...
 
virtual IlvMapGeometrycopy () const
 Returns a copy of the object. More...
 
virtual IlvClassInfogetClassInfo () const
 Returns the IlvClassInfo of the instance. More...
 
IlvMapRinggetExteriorRing () const
 Returns the exterior ring of the polygon. More...
 
const IlvMapRinggetInteriorRing (IlUInt index) const
 Returns the specified interior ring. More...
 
virtual IlUInt getInteriorRingCount () const
 Returns the count of interior rings. More...
 
virtual const IlvMapCurvegetStroke () const
 Returns the stroke of the area. More...
 
virtual const IlvMapGeometrygetSubElement (IlUInt index) const
 Returns a sub element of a collection geometry. More...
 
virtual IlUInt getSubElementCount () const
 Returns the number of elements contained in the geometry if the geometry is a collection. More...
 
virtual IlBoolean isCollection () const
 Checks if this geometry is a collection of other geometries. More...
 
IlvMapRingremoveInteriorRing (const IlvMapRing *ring)
 Removes the specified interior ring from the list and returns it. More...
 
void removeInteriorRings ()
 Removes and deletes all the interior rings of the polygon.
 
IlvMapRingsetExteriorRing (IlvMapRing *exteriorRing)
 Sets the exterior ring of the polygon. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from IlvMapGeometry
static IlvClassInfoClassInfo ()
 Returns the class info. More...
 
- Protected Member Functions inherited from IlvMapArea
 IlvMapArea ()
 Constructor. More...
 
- Protected Member Functions inherited from IlvMapGeometry
 IlvMapGeometry ()
 Constructor. More...
 

Detailed Description

This class defines a Polygon.

A polygon is a an area that can contain holes. It is defined by an exterior ring and by interior rings that describe the internal holes of the polygon. The interior rings should not intersect. However, this class does not perform automatic consistency checking.

The instances of this class can be rendered by an IlvDefaultFeatureRenderer or by an IlvDefaultAreaRenderer. Library: ilvmaps

Constructor & Destructor Documentation

IlvMapPolygon::IlvMapPolygon ( IlvMapRing exteriorRing)

Constructs a polygon with its exterior ring.

Parameters
exteriorRingThe exterior ring. exteriorRing should not be null. In this operation, the polygon becomes owner of the ring.
IlvMapPolygon::IlvMapPolygon ( const IlvMapPolygon source)

Creates a polygon by copying an existing one.

Parameters
sourceThe source polygon.

Member Function Documentation

void IlvMapPolygon::addInteriorRing ( IlvMapRing ring)

Adds an interior ring to the polygon.

In this operation, the polygon becomes owner of the ring.

Parameters
ringThe interior ring to be added.
virtual IlBoolean IlvMapPolygon::contains ( const IlvCoordinate coordinate) const
virtual

Returns IlTrue if coordinate is contained in the object.

Parameters
coordinateThe point to be checked.
Returns
IlTrue if coordinate is contained in the object.

Implements IlvMapArea.

virtual IlvMapGeometry* IlvMapPolygon::copy ( ) const
virtual

Returns a copy of the object.

Returns
An IlvMapGeometry that must be deleted by the user.

Implements IlvMapArea.

virtual IlvClassInfo* IlvMapPolygon::getClassInfo ( ) const
virtual

Returns the IlvClassInfo of the instance.

Returns
An IlvClassInfo that should not be modified nor deleted.

Implements IlvMapArea.

IlvMapRing* IlvMapPolygon::getExteriorRing ( ) const

Returns the exterior ring of the polygon.

Returns
The IlvMapRing object that can be modified, but that should not be deleted.
const IlvMapRing* IlvMapPolygon::getInteriorRing ( IlUInt  index) const

Returns the specified interior ring.

Parameters
indexThe index of the ring. index should be between 0 and getInteriorRingCount() - 1.
Returns
The IlvMapRing object that can be modified, but that should not be deleted.
virtual IlUInt IlvMapPolygon::getInteriorRingCount ( ) const
virtual

Returns the count of interior rings.

Returns
The interior ring count.
virtual const IlvMapCurve* IlvMapPolygon::getStroke ( ) const
virtual

Returns the stroke of the area.

Returns
An IlvCurve object that should not be deleted nor modified.

Implements IlvMapArea.

virtual const IlvMapGeometry* IlvMapPolygon::getSubElement ( IlUInt  index) const
virtual

Returns a sub element of a collection geometry.

Parameters
indexThe index of the sub-geometry to be retrieved.
Returns
The sub element of index index if the geometry is a collection or 0 if it is not.

Implements IlvMapGeometry.

virtual IlUInt IlvMapPolygon::getSubElementCount ( ) const
virtual

Returns the number of elements contained in the geometry if the geometry is a collection.

Returns
The number of elements contained in the geometry if the geometry is a collection. If it is not, this method returns 0.

Implements IlvMapGeometry.

virtual IlBoolean IlvMapPolygon::isCollection ( ) const
virtual

Checks if this geometry is a collection of other geometries.

The composite geometries predefined in Rogue Wave Views Maps are: IlvMapGeometryCollection, IlvMapMultiPoint, IlvMapSegmentString and its subclasses, IlvMapMultiCurve and IlvMapMultiArea.

Returns
IlTrue if the geometry is a collection of other geometries.

Implements IlvMapGeometry.

IlvMapRing* IlvMapPolygon::removeInteriorRing ( const IlvMapRing ring)

Removes the specified interior ring from the list and returns it.

If the ring is not an interior ring of the polygon, the function returns a null pointer.

Parameters
ringThe ring to remove.
Returns
The removed interior ring or 0 if ring is not an interior ring of the polygon.
IlvMapRing* IlvMapPolygon::setExteriorRing ( IlvMapRing exteriorRing)

Sets the exterior ring of the polygon.

The previous exterior ring is returned by the function and is no longer owned by the polygon.

Parameters
exteriorRingThe exterior ring. In this operation, the polygon becomes owner of the ring. The value should not be null.
Returns
The previous exterior ring. The polygon is no more owned by the polygon and is to be deleted by the caller.

© Copyright 2016, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.