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)
 Initializes a new polygon with its exterior ring. More...
 
 IlvMapPolygon (const IlvMapPolygon &source)
 Initializes a new polygon by copying an existing one. More...
 
void addInteriorRing (IlvMapRing *ring)
 Adds an interior ring to the polygon. More...
 
virtual IlBoolean contains (const IlvCoordinate &) const
 Returns IlTrue if some 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) 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. 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 ()
 Initializes a new empty IlvMapArea instance.
 
- Protected Member Functions inherited from IlvMapGeometry
 IlvMapGeometry ()
 Constructor. More...
 

Detailed Description

This class defines a Polygon.

Library: ilvmaps
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.

Constructor & Destructor Documentation

§ IlvMapPolygon() [1/2]

IlvMapPolygon::IlvMapPolygon ( IlvMapRing exteriorRing)

Initializes a new polygon with its exterior ring.

Parameters
exteriorRingThe exterior ring. This must not be 0. In this operation, the polygon becomes owner of the ring.

§ IlvMapPolygon() [2/2]

IlvMapPolygon::IlvMapPolygon ( const IlvMapPolygon source)

Initializes a new polygon by copying an existing one.

Parameters
sourceThe source polygon.

Member Function Documentation

§ addInteriorRing()

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.

§ contains()

virtual IlBoolean IlvMapPolygon::contains ( const IlvCoordinate coordinate) const
virtual

Returns IlTrue if some coordinate is contained in the object.

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

Implements IlvMapArea.

§ copy()

virtual IlvMapGeometry* IlvMapPolygon::copy ( ) const
virtual

Returns a copy of the object.

Returns
An IlvMapGeometry that must be deleted by the user.

Implements IlvMapArea.

§ getClassInfo()

virtual IlvClassInfo* IlvMapPolygon::getClassInfo ( ) const
virtual

Returns the IlvClassInfo of the instance.

Returns
An IlvClassInfo that should not be modified nor deleted.

Implements IlvMapArea.

§ getExteriorRing()

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.

§ getInteriorRing()

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.

§ getInteriorRingCount()

virtual IlUInt IlvMapPolygon::getInteriorRingCount ( ) const
virtual

Returns the count of interior rings.

Returns
The interior ring count.

§ getStroke()

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.

§ getSubElement()

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.

§ getSubElementCount()

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.

§ isCollection()

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.

§ removeInteriorRing()

IlvMapRing* IlvMapPolygon::removeInteriorRing ( const IlvMapRing ring)

Removes the specified interior ring from the list.

Parameters
ringThe ring to remove.
Returns
The removed interior ring or 0 if ring is not an interior ring of the polygon.

§ setExteriorRing()

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 0.
Returns
The previous exterior ring. The polygon is no more owned by the polygon and is to be deleted by the caller.

© Copyright 2018, 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.