MongoDB C++ Driver  legacy-1.1.2
Public Member Functions | List of all members
mongo::geo::Polygon< TCoordinates > Class Template Reference
+ Inheritance diagram for mongo::geo::Polygon< TCoordinates >:

Public Member Functions

 Polygon (const BSONObj &bson)
 Polygon constructor. More...
 
 Polygon (const std::vector< LineString< TCoordinates > > &linearRings)
 Polygon constructor. More...
 
virtual BSONObj toBSON () const
 Obtain a BSON representation of the polygon. More...
 
virtual BoundingBox< TCoordinates > getBoundingBox () const
 Obtain the bounding box surrounding this Polygon. More...
 
virtual GeoObjType getType () const
 Get the geometry type of this object. More...
 
std::vector< Point< TCoordinates > > getPoints () const
 Obtain the points that make up this Polygon. More...
 
std::vector< LineString< TCoordinates > > getLinearRings () const
 Obtain the linear rings that make up this Polygon. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from mongo::geo::Geometry< TCoordinates >
static BoundingBox< TCoordinates > * computeBoundingBox (const std::vector< Point< TCoordinates > > &points)
 Compute the bounding box around the given points. More...
 
static BoundingBox< TCoordinates > * computeBoundingBox (const std::vector< BoundingBox< TCoordinates > > &bboxes)
 Compute the smallest bounding box that contains the given bounding boxes. More...
 
static BoundingBox< TCoordinates > * parseBoundingBox (const BSONObj &bson)
 Parses the bounding box defined by the given geometry shape, represented in BSON. More...
 

Constructor & Destructor Documentation

template<typename TCoordinates >
mongo::geo::Polygon< TCoordinates >::Polygon ( const BSONObj bson)
explicit

Polygon constructor.

Parameters
bsonA BSON representation of the polygon.
template<typename TCoordinates >
mongo::geo::Polygon< TCoordinates >::Polygon ( const std::vector< LineString< TCoordinates > > &  linearRings)
explicit

Polygon constructor.

Parameters
linearRingsThe linear rings that define this polygon. The first element represents the exterior linear ring. Any subsequent elements represent interior rings (or holes).

Member Function Documentation

template<typename TCoordinates >
BoundingBox< TCoordinates > mongo::geo::Polygon< TCoordinates >::getBoundingBox ( ) const
virtual

Obtain the bounding box surrounding this Polygon.

Returns
A bounding box surrounding this Polygon.

Implements mongo::geo::GeoObj< TCoordinates >.

template<typename TCoordinates >
std::vector< LineString< TCoordinates > > mongo::geo::Polygon< TCoordinates >::getLinearRings ( ) const

Obtain the linear rings that make up this Polygon.

Returns
a vector of LineStrings that define the linear rings making up this Polygon.
template<typename TCoordinates >
std::vector< Point< TCoordinates > > mongo::geo::Polygon< TCoordinates >::getPoints ( ) const

Obtain the points that make up this Polygon.

Returns
a vector of points making up this Polygon.
template<typename TCoordinates>
virtual GeoObjType mongo::geo::Polygon< TCoordinates >::getType ( ) const
inlinevirtual

Get the geometry type of this object.

Returns
GeoObjType_Polygon

Implements mongo::geo::GeoObj< TCoordinates >.

template<typename TCoordinates>
virtual BSONObj mongo::geo::Polygon< TCoordinates >::toBSON ( ) const
inlinevirtual

Obtain a BSON representation of the polygon.

Returns
a BSON representation of the polygon.

Implements mongo::geo::GeoObj< TCoordinates >.


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