#include <point-set-list.h>
Inheritance diagram for PointSetList:
All Points contained in any PointSetList must have the same dimension. When serialized, a PointSetList takes on the following format:
Equivalently, at a higher level:
Public Member Functions | |
virtual | ~PointSetList () |
virtual int | point_set_size () const=0 |
Get the total number of PointSets in this PointSetList. | |
virtual int | point_size () const=0 |
Get the total number of Points in this PointSetList. | |
virtual int | point_dim () const=0 |
Get the dim of every Point in this PointSetList. | |
virtual bool | GetSetCardinalities (vector< int > *destination) const |
Get the number of Points in each PointSet. | |
const PointSet & | operator[] (int index) |
Returns a const ref to the <index>th PointSet. | |
virtual const PointSet & | point_set (int index) const=0 |
Returns a const ref to the <index>th PointSet. | |
const Point & | point (int index) const |
Returns the <index>th Point in the PointSetList. | |
bool | GetPointIndices (int index, int *which_point_set, int *which_point) const |
Locate a Point in a PointSet. | |
void | GetPointRefs (vector< PointRef > *out_refs) const |
Get PointRefs to every Point in this PointSetList. | |
void | WriteToStream (ostream &output_stream) const |
Writes the entire PointSetList to a stream. | |
void | WriteHeaderToStream (ostream &output_stream) const |
Writes just the serialized header to a stream. | |
void | WritePointSetsToStream (ostream &output_stream) const |
Writes the point sets (without a header) sequentially to a stream. | |
void | WriteToFile (const char *output_file) const |
Writes the entire PointSetList to a file. |
virtual ~PointSetList | ( | ) | [inline, virtual] |
virtual int point_set_size | ( | ) | const [pure virtual] |
Get the total number of PointSets in this PointSetList.
Implemented in MutablePointSetList, and OnDiskPointSetList.
virtual int point_size | ( | ) | const [pure virtual] |
Get the total number of Points in this PointSetList.
This is the sum of PointSet::size() over all PointSets in in this PointSetList.
Implemented in MutablePointSetList, and OnDiskPointSetList.
virtual int point_dim | ( | ) | const [pure virtual] |
Get the dim of every Point in this PointSetList.
Defined to be 0 if the PointSetList is empty.
Implemented in MutablePointSetList, and OnDiskPointSetList.
bool GetSetCardinalities | ( | vector< int > * | destination | ) | const [virtual] |
Get the number of Points in each PointSet.
Fills <destination> with a vector of size this.point_set_size(), where the nth element is the number of Points in the nth PointSet in this PointSetList. It is cleared first, and must not be NULL.
Returns true on success and false otherwise, although currently there is no reason that this method will fail.
Reimplemented in OnDiskPointSetList.
virtual const PointSet& point_set | ( | int | index | ) | const [pure virtual] |
Returns a const ref to the <index>th PointSet.
Implemented in MutablePointSetList, and OnDiskPointSetList.
const Point & point | ( | int | index | ) | const |
Returns the <index>th Point in the PointSetList.
We can also think of a PointSetList as a long vector of Points if we ignore the PointSet boundaries, so you can reference individual points of a PointSetList through this.
bool GetPointIndices | ( | int | index, | |
int * | which_point_set, | |||
int * | which_point | |||
) | const |
void GetPointRefs | ( | vector< PointRef > * | out_refs | ) | const |
Get PointRefs to every Point in this PointSetList.
Requires out_refs != NULL. Makes out_refs a vector of size this->point_size(), where the nth element is a PointRef pointing to the nth Point (i.e., points to this->point(n)). If out_refs has something in it beforehand, it will be cleared prior to filling it.
void WriteToStream | ( | ostream & | output_stream | ) | const |
Writes the entire PointSetList to a stream.
See the detailed description of PointSetList for the format.
void WriteHeaderToStream | ( | ostream & | output_stream | ) | const |
Writes just the serialized header to a stream.
void WritePointSetsToStream | ( | ostream & | output_stream | ) | const |
Writes the point sets (without a header) sequentially to a stream.
void WriteToFile | ( | const char * | output_file | ) | const |
Writes the entire PointSetList to a file.
See detailed description of PointSetList for the format.