Backproject
Public Member Functions | Static Public Member Functions | Friends | List of all members
Context Class Reference

A context; keeps track of overal program state in a way that is easily accessed by multiple functions. More...

#include <Context.h>

Public Member Functions

const std::vector< std::shared_ptr< ContextOperation > > & listOperations () const
 Lists the operations in the context. More...
 
const std::vector< std::shared_ptr< Image > > listImages () const
 Returns the images that are in the context. More...
 
const std::vector< std::vector< double > > listPoints () const
 Returns the points in the context. More...
 
void addImage (const std::shared_ptr< Image > image)
 Addsa new image to the context. More...
 
void addPoint (const std::vector< double > point)
 Adds a new point to the context. More...
 
void removeAllPoints ()
 Removes all of the points in the context.
 
void removeAllImages ()
 Removes all of the images in the context.
 
void Enter (std::ostream &os, std::istream &is)
 'Enter' the context and let the user interact with it More...
 

Static Public Member Functions

static void registerOperation (std::shared_ptr< ContextOperation > operation)
 Adds operations to all contexts. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const Context &context)
 Registration of the stream operator as a friend. More...
 

Detailed Description

A context; keeps track of overal program state in a way that is easily accessed by multiple functions.

Member Function Documentation

§ addImage()

void Context::addImage ( const std::shared_ptr< Image image)

Addsa new image to the context.

Parameters
imagethe image to add

§ addPoint()

void Context::addPoint ( const std::vector< double >  point)

Adds a new point to the context.

Parameters
pointthe point to add.

§ Enter()

void Context::Enter ( std::ostream &  os,
std::istream &  is 
)

'Enter' the context and let the user interact with it

Parameters
osOutput stream to use
isInput stream to use

§ listImages()

const std::vector< std::shared_ptr< Image > > Context::listImages ( ) const

Returns the images that are in the context.

Returns
A vector containing shared pointers which keep references to the Images.

§ listOperations()

const std::vector< std::shared_ptr< ContextOperation > > & Context::listOperations ( ) const

Lists the operations in the context.

Returns
a list of the operations inside the context.

§ listPoints()

const std::vector< std::vector< double > > Context::listPoints ( ) const

Returns the points in the context.

Returns
a vector containing all of the points (where a point is represented as a vector of doubles; x,y,z

§ registerOperation()

void Context::registerOperation ( std::shared_ptr< ContextOperation operation)
static

Adds operations to all contexts.

Note; user must prevent adding operations twice.

Parameters
operationoperation to add.

Friends And Related Function Documentation

§ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Context context 
)
friend

Registration of the stream operator as a friend.

Parameters
osthe stream instance to stream to
contextthe instance of the context being streamed
Returns
the stream, after it has been used to stream the context.

The documentation for this class was generated from the following files: