20#include <boost/scoped_ptr.hpp>
28#include "mongo/geo/point.h"
33template <
typename TCoordinates>
65 return GeoObjType_MultiPoint;
73 std::vector<Point<TCoordinates> >
getPoints()
const {
79 std::vector<Point<TCoordinates> > _points;
80 mutable boost::scoped_ptr<BoundingBox<TCoordinates> > _boundingBox;
91template <
typename TCoordinates>
93 : _bson(
GeoObj<TCoordinates>::validateType(bson, kMultiPointTypeStr)),
94 _points(
Geometry<TCoordinates>::parseAllPoints(bson)),
95 _boundingBox(
Geometry<TCoordinates>::parseBoundingBox(bson)) {}
97template <
typename TCoordinates>
100 _boundingBox.reset(computeBoundingBox());
101 return *_boundingBox.get();
104template <
typename TCoordinates>
C++ representation of a "BSON" object – that is, an extended JSON-style object in a binary representa...
Definition bsonobj.h:78
Represents a bounding box.
Definition boundingbox.h:67
static BoundingBox< TCoordinates > * computeBoundingBox(const std::vector< Point< TCoordinates > > &points)
Compute the bounding box around the given points.
Definition geometry.h:137
Definition multipoint.h:34
virtual BSONObj toBSON() const
Obtain a BSON representation of the MultiPoint.
Definition multipoint.h:48
virtual BoundingBox< TCoordinates > getBoundingBox() const
Obtain the bounding box surrounding this MultiPoint.
Definition multipoint.h:98
MultiPoint(const BSONObj &bson)
MultiPoint constructor.
Definition multipoint.h:92
virtual GeoObjType getType() const
Get the geometry type of this object.
Definition multipoint.h:64
std::vector< Point< TCoordinates > > getPoints() const
Obtain the points that make up this MultiPoint.
Definition multipoint.h:73
GeoObjType
An enum to represent the type of geometry of a Geo object.
Definition constants.h:45
Utility functions for parsing numbers from strings.
Definition compare_numbers.h:20