Homepage Demos Overview Downloads Tutorials Reference
Credits

SketchSpace Class Reference

#include <SketchSpace.h>

List of all members.


Detailed Description

Holds a collection of sketches of various types.

All the sketches in a SketchSpace have the same dimensions (width and height). They are organized into pools, managed by SketchPool<T> instances. Each SketchSpace has a dual, called a ShapeSpace. Several standard SketchSpace/ShapeSpace pairs are built in to VisualRoutinesBehavior. The most basic is camSkS, the camera sketch space.

Definition at line 27 of file SketchSpace.h.

SketchGUI interface

std::string getTmatForGUI ()
 Returns a string describing the shape-to-sketch transformation matrix.
std::string getSketchListForGUI ()
 Returns a string containing a list of all the sketches and their attributes.
SketchDataRootretrieveSketch (int id)
 Returns a pointer to the sketch with specified ID number; null if not found.
ViewerConnectionviewer
 Socket and port info for communication with a sketch viewer GUI.

Public Member Functions

 SketchSpace (std::string const _name, ReferenceFrameType_t _refFrameType, int const init_id, size_t const _width, size_t const _height)
 ~SketchSpace ()
ShapeSpacegetDualSpace () const
void dumpSpace () const
 dumps contents of sketch space
void clear ()
 Clears out viewable Sketches.
size_t getWidth () const
 returns the width of contained images, in pixels
size_t getHeight () const
 returns the height of contained images, in pixels
size_t getNumPixels () const
 returns the number of pixels of images in this space
int getRefreshCounter () const
void bumpRefreshCounter ()
void requireIdx ()
 creates idx if needed
void requireIdx4way ()
 creates idxN, idxS, idxE, and idxW if needed
void requireIdx8way ()
 creates idxNE, idxNW, idxSE, and idxSW, plus NSEW cases via requireIdx4way(), if needed
void freeIndexes ()
 frees the idx members
NEWMAT::Matrix & getTmat ()
 return the ShapeSpace-to-SketchSpace coordinate transformation matrix
NEWMAT::Matrix & getTmatinv ()
 return the SketchSpace-to-ShapeSpace coordinate transformation matrix
void setTmat (const NEWMAT::Matrix &mat)
 set the ShapeSpace-to-SketchSpace coordinate transformation matrix
void setTmat (float scale=1, float tx=0, float ty=0)
void setTmat (const BoundingBox &b)
void applyTmat (NEWMAT::ColumnVector &vec)
 apply the ShapeSpace-to-SketchSpace coordinate transformation to a vector
void applyTmatinv (NEWMAT::ColumnVector &vec)
 apply the SketchSpace-to-ShapeSpace coordinate transformation to a vector
SketchPool< bool > & get_pool (const Sketch< bool > &)
 Returns the SketchPool of appropriate type for the calling Sketch.
SketchPool< uchar > & get_pool (const Sketch< uchar > &)
 Returns the SketchPool of appropriate type for the calling Sketch.
SketchPool< usint > & get_pool (const Sketch< usint > &)
 Returns the SketchPool of appropriate type for the calling Sketch.
SketchPool< float > & get_pool (const Sketch< float > &)
 Returns the SketchPool of appropriate type for the calling Sketch.

Public Attributes

std::string name
 name of this SketchSpace
int dummy
 The value assigned to out-of-bounds indices: numPixels, i.e., one beyond the last image pixel.
Pre-generated indices for different directions
Sketch< usint > * idx
Sketch< usint > * idxN
Sketch< usint > * idxS
Sketch< usint > * idxE
Sketch< usint > * idxW
Sketch< usint > * idxNE
Sketch< usint > * idxNW
Sketch< usint > * idxSE
Sketch< usint > * idxSW

Protected Member Functions

void setIdx (Sketch< usint > &indices, int x, int y, int shift_i)
 helper function to ensure indices of idx Sketches are proper
 SketchSpace (const SketchSpace &)
 never call this
SketchSpaceoperator= (const SketchSpace &)
 never call this

Private Attributes

size_t width
 pixels along x axis
size_t height
 pixels along y axis
size_t numPixels
 total pixels = width * height
NEWMAT::Matrix Tmat
 transformation matrix for rendering shapes
NEWMAT::Matrix Tmatinv
 inverse transformation matrix for extracting shapes
int idCounter
 Incremented with each new Sketch, to guarantee a unique ID.
int refreshCounter
 Incremented each time SketchGUI refreshes the sketch/shape list.
ShapeSpacedualSpace
 Pointer to the ShapeSpace associated with this SketchSpace.
SketchPool< boolboolPool
 Pool for one of the SketchData<T> classes.
SketchPool< ucharucharPool
 Pool for one of the SketchData<T> classes.
SketchPool< usintusintPool
 Pool for one of the SketchData<T> classes.
SketchPool< float > floatPool
 Pool for one of the SketchData<T> classes.


Constructor & Destructor Documentation

SketchSpace ( std::string const   _name,
ReferenceFrameType_t  _refFrameType,
int const   init_id,
size_t const   _width,
size_t const   _height 
)

~SketchSpace (  ) 

Definition at line 90 of file SketchSpace.cc.

SketchSpace ( const SketchSpace  )  [protected]

never call this


Member Function Documentation

void applyTmat ( NEWMAT::ColumnVector &  vec  ) 

apply the ShapeSpace-to-SketchSpace coordinate transformation to a vector

Definition at line 133 of file SketchSpace.cc.

Referenced by PointData::extractPoints(), PointData::render(), EllipseData::render(), and LineData::setDrawCoords().

void applyTmatinv ( NEWMAT::ColumnVector &  vec  ) 

apply the SketchSpace-to-ShapeSpace coordinate transformation to a vector

Definition at line 139 of file SketchSpace.cc.

Referenced by LineData::extractLine().

void bumpRefreshCounter (  )  [inline]

Definition at line 92 of file SketchSpace.h.

Referenced by SketchSpace::getSketchListForGUI(), and VRmixin::~VRmixin().

void clear (  ) 

Clears out viewable Sketches.

Definition at line 105 of file SketchSpace.cc.

Referenced by MapBuilder::DoStop(), MapBuilder::executeRequest(), Lookout::processPointAt(), and VRmixin::~VRmixin().

void dumpSpace (  )  const

dumps contents of sketch space

Definition at line 98 of file SketchSpace.cc.

void freeIndexes (  ) 

frees the idx members

Definition at line 80 of file SketchSpace.cc.

Referenced by SketchSpace::~SketchSpace(), and VRmixin::~VRmixin().

SketchPool<float>& get_pool ( const Sketch< float > &   )  [inline]

Returns the SketchPool of appropriate type for the calling Sketch.

Definition at line 130 of file SketchSpace.h.

SketchPool<usint>& get_pool ( const Sketch< usint > &   )  [inline]

Returns the SketchPool of appropriate type for the calling Sketch.

Definition at line 129 of file SketchSpace.h.

SketchPool<uchar>& get_pool ( const Sketch< uchar > &   )  [inline]

Returns the SketchPool of appropriate type for the calling Sketch.

Definition at line 128 of file SketchSpace.h.

SketchPool<bool>& get_pool ( const Sketch< bool > &   )  [inline]

Returns the SketchPool of appropriate type for the calling Sketch.

Definition at line 127 of file SketchSpace.h.

Referenced by Sketch::Sketch().

ShapeSpace& getDualSpace ( void   )  const [inline]

size_t getNumPixels (  )  const [inline]

returns the number of pixels of images in this space

Definition at line 89 of file SketchSpace.h.

Referenced by SketchDataRoot::getNumPixels(), and SketchIndices::trimBounds().

int getRefreshCounter (  )  const [inline]

Definition at line 91 of file SketchSpace.h.

Referenced by SketchPoolRoot::getRefreshCounter().

std::string getSketchListForGUI (  ) 

Returns a string containing a list of all the sketches and their attributes.

Definition at line 164 of file SketchSpace.cc.

Referenced by VRmixin::processSketchRequest().

NEWMAT::Matrix& getTmat (  )  [inline]

return the ShapeSpace-to-SketchSpace coordinate transformation matrix

Definition at line 107 of file SketchSpace.h.

Referenced by EllipseData::render().

std::string getTmatForGUI (  ) 

Returns a string describing the shape-to-sketch transformation matrix.

Definition at line 154 of file SketchSpace.cc.

Referenced by VRmixin::processSketchRequest().

NEWMAT::Matrix& getTmatinv (  )  [inline]

return the SketchSpace-to-ShapeSpace coordinate transformation matrix

Definition at line 110 of file SketchSpace.h.

SketchSpace& operator= ( const SketchSpace  )  [protected]

never call this

void requireIdx (  ) 

creates idx if needed

Definition at line 27 of file SketchSpace.cc.

Referenced by VRmixin::VRmixin().

void requireIdx4way (  ) 

creates idxN, idxS, idxE, and idxW if needed

Definition at line 41 of file SketchSpace.cc.

Referenced by visops::bdist(), visops::neighborSum(), and SketchSpace::requireIdx8way().

void requireIdx8way (  ) 

creates idxNE, idxNW, idxSE, and idxSW, plus NSEW cases via requireIdx4way(), if needed

Definition at line 60 of file SketchSpace.cc.

Referenced by visops::neighborSum().

SketchDataRoot * retrieveSketch ( int  id  ) 

Returns a pointer to the sketch with specified ID number; null if not found.

Definition at line 174 of file SketchSpace.cc.

Referenced by VRmixin::processSketchRequest().

void setIdx ( Sketch< usint > &  indices,
int  x,
int  y,
int  shift_i 
) [protected]

helper function to ensure indices of idx Sketches are proper

Definition at line 145 of file SketchSpace.cc.

Referenced by SketchSpace::requireIdx(), SketchSpace::requireIdx4way(), and SketchSpace::requireIdx8way().

void setTmat ( const BoundingBox b  ) 

Definition at line 126 of file SketchSpace.cc.

void setTmat ( float  scale = 1,
float  tx = 0,
float  ty = 0 
)

Definition at line 117 of file SketchSpace.cc.

void setTmat ( const NEWMAT::Matrix &  mat  ) 

set the ShapeSpace-to-SketchSpace coordinate transformation matrix

Definition at line 112 of file SketchSpace.cc.

Referenced by SketchSpace::setTmat().


Member Data Documentation

SketchPool<bool> boolPool [private]

Pool for one of the SketchData<T> classes.

Definition at line 45 of file SketchSpace.h.

Referenced by SketchSpace::clear(), SketchSpace::dumpSpace(), SketchSpace::get_pool(), SketchSpace::getSketchListForGUI(), and SketchSpace::retrieveSketch().

ShapeSpace* dualSpace [private]

Pointer to the ShapeSpace associated with this SketchSpace.

Definition at line 41 of file SketchSpace.h.

Referenced by SketchSpace::getDualSpace(), and SketchSpace::~SketchSpace().

int dummy

The value assigned to out-of-bounds indices: numPixels, i.e., one beyond the last image pixel.

Definition at line 53 of file SketchSpace.h.

Referenced by SketchSpace::setIdx(), and Sketch::Sketch().

SketchPool<float> floatPool [private]

Pool for one of the SketchData<T> classes.

Definition at line 48 of file SketchSpace.h.

Referenced by SketchSpace::clear(), SketchSpace::dumpSpace(), SketchSpace::get_pool(), SketchSpace::getSketchListForGUI(), and SketchSpace::retrieveSketch().

int idCounter [private]

Incremented with each new Sketch, to guarantee a unique ID.

Definition at line 38 of file SketchSpace.h.

std::string name

name of this SketchSpace

Definition at line 29 of file SketchSpace.h.

size_t numPixels [private]

total pixels = width * height

Definition at line 34 of file SketchSpace.h.

Referenced by SketchSpace::getNumPixels().

int refreshCounter [private]

Incremented each time SketchGUI refreshes the sketch/shape list.

Definition at line 39 of file SketchSpace.h.

Referenced by SketchSpace::bumpRefreshCounter(), and SketchSpace::getRefreshCounter().

NEWMAT::Matrix Tmat [private]

transformation matrix for rendering shapes

Definition at line 35 of file SketchSpace.h.

Referenced by SketchSpace::applyTmat(), SketchSpace::getTmat(), SketchSpace::getTmatForGUI(), and SketchSpace::setTmat().

NEWMAT::Matrix Tmatinv [private]

inverse transformation matrix for extracting shapes

Definition at line 36 of file SketchSpace.h.

Referenced by SketchSpace::applyTmatinv(), SketchSpace::getTmatinv(), and SketchSpace::setTmat().

Pool for one of the SketchData<T> classes.

Definition at line 46 of file SketchSpace.h.

Referenced by SketchSpace::clear(), SketchSpace::dumpSpace(), SketchSpace::get_pool(), SketchSpace::getSketchListForGUI(), and SketchSpace::retrieveSketch().

Pool for one of the SketchData<T> classes.

Definition at line 47 of file SketchSpace.h.

Referenced by SketchSpace::clear(), SketchSpace::dumpSpace(), SketchSpace::get_pool(), SketchSpace::getSketchListForGUI(), and SketchSpace::retrieveSketch().

Socket and port info for communication with a sketch viewer GUI.

Definition at line 138 of file SketchSpace.h.

Referenced by VRmixin::processSketchRequest(), VRmixin::rleEncodeSketch(), VRmixin::VRmixin(), and SketchSpace::~SketchSpace().


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

DualCoding 3.0beta
Generated Wed Oct 4 00:02:31 2006 by Doxygen 1.4.7