MutablePointSetList Class Reference

#include <mutable-point-set-list.h>

Inheritance diagram for MutablePointSetList:

PointSetList List of all members.

Detailed Description

A mutable, in-memory PointSetList.

This class adds AddPointSet to the interface, allowing one to (as the name suggests) add new PointSets. You may also modify PointSets or the Features they contain, and can replace PointSets in the list with other PointSets.


Public Member Functions

virtual ~MutablePointSetList ()
void ReadFromStream (istream &input_stream)
 Reads an entire data set from a stream.
void ReadFromFile (const char *filename)
 Reads an entire data set from a file.
void ReadSelectionFromStream (istream &input_stream, int start, int selection_size)
 Reads a segment of the data from a stream.
virtual int GetNumPointSets () const
 Get the total number of PointSets in this PointSetList.
virtual int GetNumPoints () const
 Get the total number of Features in this PointSetList.
virtual int GetFeatureDim () const
 Get the dim of every Feature in this PointSetList.
virtual vector< int > GetSetCardinalities () const
 Get the number of Features in each PointSet.
PointSetoperator[] (int index)
 Returns a ref to the <index>th PointSet.
virtual const PointSetoperator[] (int index) const
 Returns a const ref to the <index>th PointSet.
void AddPointSet (const PointSet &point_set)
 Adds a copy of <point_set> to the end of the list.
const FeatureGetFeature (int index) const
 Returns the <index>th Feature in the PointSetList.
pair< int, int > GetFeatureIndices (int index) const
 Locate a Feature in a PointSet.
void GetPointRefs (vector< PointRef > *out_refs) const
 Get PointRefs to every Feature 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

~MutablePointSetList (  )  [virtual]


Member Function Documentation

void ReadFromStream ( istream &  input_stream  ) 

Reads an entire data set from a stream.

Aborts if the input_stream cannot be read.

void ReadFromFile ( const char *  filename  ) 

Reads an entire data set from a file.

Aborts if the file cannot be read.

void ReadSelectionFromStream ( istream &  input_stream,
int  start,
int  selection_size 
)

Reads a segment of the data from a stream.

<start> specifies the index of the first PointSet to read in the stream of data. If <selection_size> is large enough so that this would want to read past the end of the file, ReadSelectionFromStream will just stop reading. Observe that you will need to adjust indices (i.e., if you choose to read Y PointSets starting from index X, then this[0] will be the 6th PointSet, as opposed to this[5]).

Aborts if the input_stream cannot be read.

int GetNumPointSets (  )  const [virtual]

Get the total number of PointSets in this PointSetList.

Implements PointSetList.

int GetNumPoints (  )  const [virtual]

Get the total number of Features in this PointSetList.

This is the sum of GetNumFeatures() over all PointSets in in this PointSetList.

Implements PointSetList.

int GetFeatureDim (  )  const [virtual]

Get the dim of every Feature in this PointSetList.

Implements PointSetList.

vector< int > GetSetCardinalities (  )  const [virtual]

Get the number of Features in each PointSet.

Returns a vector of size this.GetNumPointSets(), where the nth element is the number of Features in the nth PointSet in this PointSetList.

Implements PointSetList.

PointSet & operator[] ( int  index  ) 

Returns a ref to the <index>th PointSet.

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

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

Implements PointSetList.

void AddPointSet ( const PointSet point_set  ) 

Adds a copy of <point_set> to the end of the list.

const Feature & GetFeature ( int  index  )  const [inherited]

Returns the <index>th Feature in the PointSetList.

We can also think of a PointSetList as a long vector of Features if we ignore the PointSet boundaries, so you can reference individual features of a PointSetList through this.

pair< int, int > GetFeatureIndices ( int  index  )  const [inherited]

Locate a Feature in a PointSet.

Given an index specifying which feature we are referring to, return which PointSet it belongs to, as well as the index into that PointSet that the Feature belongs to.

void GetPointRefs ( vector< PointRef > *  out_refs  )  const [inherited]

Get PointRefs to every Feature in this PointSetList.

Requires out_refs != NULL. Makes out_refs a vector of size GetNumPoints(), where the nth element is a PointRef pointing to the nth Feature (i.e., points to GetFeature(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 [inherited]

Writes the entire PointSetList to a stream.

See the detailed description of PointSetList for the format.

void WriteHeaderToStream ( ostream &  output_stream  )  const [inherited]

Writes just the serialized header to a stream.

void WritePointSetsToStream ( ostream &  output_stream  )  const [inherited]

Writes the point sets (without a header) sequentially to a stream.

void WriteToFile ( const char *  output_file  )  const [inherited]

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 Wed May 2 11:17:13 2007 for libpmk by  doxygen 1.5.1