Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
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

ViewerConnectionviewer
 Socket and port info for communication with a sketch viewer GUI.
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 const id)
 Returns a pointer to the sketch with specified ID number; null if not found.

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
void resize (const size_t new_width, const size_t new_height)
 change the size of sketches in this sketch space (discards all existing sketches)
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< uint > & get_pool (const Sketch< uint > &)
 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< uint > * idx
Sketch< uint > * idxN
Sketch< uint > * idxS
Sketch< uint > * idxE
Sketch< uint > * idxW
Sketch< uint > * idxNE
Sketch< uint > * idxNW
Sketch< uint > * idxSE
Sketch< uint > * idxSW

Protected Member Functions

void setIdx (Sketch< uint > &indices, int const x, int const y, int const indexval)
 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< uintuintPool
 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 
)

Definition at line 15 of file SketchSpace.cc.

~SketchSpace (  ) 

Definition at line 102 of file SketchSpace.cc.

SketchSpace ( const SketchSpace  )  [protected]

never call this


Member Function Documentation

ShapeSpace& getDualSpace ( void   )  const [inline]

void dumpSpace (  )  const

dumps contents of sketch space

Definition at line 110 of file SketchSpace.cc.

void clear (  ) 

size_t getNumPixels (  )  const [inline]

returns the number of pixels of images in this space

Definition at line 86 of file SketchSpace.h.

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

int getRefreshCounter (  )  const [inline]

Definition at line 88 of file SketchSpace.h.

Referenced by SketchPoolRoot::getRefreshCounter().

void bumpRefreshCounter (  )  [inline]

Definition at line 89 of file SketchSpace.h.

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

void requireIdx (  ) 

creates idx if needed

Definition at line 29 of file SketchSpace.cc.

Referenced by VRmixin::VRmixin().

void requireIdx4way (  ) 

creates idxN, idxS, idxE, and idxW if needed

Definition at line 39 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 58 of file SketchSpace.cc.

Referenced by visops::neighborSum().

void freeIndexes (  ) 

frees the idx members

Definition at line 78 of file SketchSpace.cc.

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

void resize ( const size_t  new_width,
const size_t  new_height 
)

change the size of sketches in this sketch space (discards all existing sketches)

Definition at line 88 of file SketchSpace.cc.

NEWMAT::Matrix& getTmat (  )  [inline]

return the ShapeSpace-to-SketchSpace coordinate transformation matrix

Definition at line 107 of file SketchSpace.h.

Referenced by EllipseData::render().

NEWMAT::Matrix& getTmatinv (  )  [inline]

return the SketchSpace-to-ShapeSpace coordinate transformation matrix

Definition at line 110 of file SketchSpace.h.

void setTmat ( const NEWMAT::Matrix &  mat  ) 

set the ShapeSpace-to-SketchSpace coordinate transformation matrix

Definition at line 124 of file SketchSpace.cc.

Referenced by SketchSpace::setTmat().

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

Definition at line 129 of file SketchSpace.cc.

void setTmat ( const BoundingBox b  ) 

Definition at line 138 of file SketchSpace.cc.

void applyTmat ( NEWMAT::ColumnVector &  vec  ) 

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

Definition at line 145 of file SketchSpace.cc.

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

void applyTmatinv ( NEWMAT::ColumnVector &  vec  ) 

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

Definition at line 151 of file SketchSpace.cc.

Referenced by LineData::extractLine().

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().

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<uint>& get_pool ( const Sketch< uint > &   )  [inline]

Returns the SketchPool of appropriate type for the calling Sketch.

Definition at line 129 of file SketchSpace.h.

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.

std::string getTmatForGUI (  ) 

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

Definition at line 165 of file SketchSpace.cc.

Referenced by VRmixin::processSketchRequest().

std::string getSketchListForGUI (  ) 

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

Definition at line 175 of file SketchSpace.cc.

Referenced by VRmixin::processSketchRequest().

SketchDataRoot * retrieveSketch ( int const   id  ) 

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

Definition at line 185 of file SketchSpace.cc.

Referenced by VRmixin::processSketchRequest().

void setIdx ( Sketch< uint > &  indices,
int const   x,
int const   y,
int const   indexval 
) [protected]

helper function to ensure indices of idx Sketches are proper

Definition at line 157 of file SketchSpace.cc.

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

SketchSpace& operator= ( const SketchSpace  )  [protected]

never call this


Member Data Documentation

std::string name

name of this SketchSpace

Definition at line 29 of file SketchSpace.h.

Referenced by SketchPoolRoot::getSpaceName().

size_t numPixels [private]

total pixels = width * height

Definition at line 34 of file SketchSpace.h.

Referenced by SketchSpace::getNumPixels(), and SketchSpace::resize().

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().

int idCounter [private]

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

Definition at line 38 of file SketchSpace.h.

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().

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::resize(), SketchSpace::setIdx(), and Sketch::Sketch().

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 4.0
Generated Thu Nov 22 00:54:07 2007 by Doxygen 1.5.4