rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Maps Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvMapPolygon Class Reference

This class defines a Polygon. More...

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

Inheritance diagram for IlvMapPolygon:
IlvMapArea IlvMapGeometry

List of all members.

Public Member Functions

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

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:
exteriorRing The 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:
source The 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:
ring The interior ring to be added.
virtual IlBoolean IlvMapPolygon::contains ( const IlvCoordinate coordinate  )  const [virtual]

Returns IlTrue if coordinate is contained in the object.

Parameters:
coordinate The 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:
index The 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 the sub element of index index if the geometry is a collection.

Otherwise, it returns a null pointer.

Returns:
The sub element of index index if the geometry is a collection.

Implements IlvMapGeometry.

virtual IlUInt IlvMapPolygon::getSubElementCount (  )  const [virtual]

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

Otherwise, it returns 0.

Returns:
The number of elements contained in the geometry if the geometry is a collection. Otherwise, it returns 0.

Implements IlvMapGeometry.

virtual IlBoolean IlvMapPolygon::isCollection (  )  const [virtual]

Returns IlTrue if the 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:
ring The 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:
exteriorRing The 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.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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