PointSetList Class Reference

#include <point-set-list.h>

Inheritance diagram for PointSetList:

MutablePointSetList OnDiskPointSetList List of all members.

Detailed Description

Abstract interface for a list of PointSet.

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:

See also:
PointSet


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 PointSetoperator[] (int index)
 Returns a const ref to the <index>th PointSet.
virtual const PointSetpoint_set (int index) const=0
 Returns a const ref to the <index>th PointSet.
const Pointpoint (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.


Constructor & Destructor Documentation

virtual ~PointSetList (  )  [inline, virtual]


Member Function Documentation

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.

const PointSet& operator[] ( int  index  )  [inline]

Returns a const ref to the <index>th PointSet.

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

Locate a Point in a PointSet.

Given an index specifying which point we are referring to, report which PointSet it belongs to, as well as the index into that PointSet that the PointSet belongs to.

Returns true if <index> is a valid Point and the data was successfully loaded, false otherwise.

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.

See also:
PointRef

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.


The documentation for this class was generated from the following files:
Generated on Fri Sep 21 11:39:05 2007 for libpmk2 by  doxygen 1.5.1