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