Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

SketchDataRoot Class Reference

Parent class for SketchData<T> More...

#include <SketchDataRoot.h>

Inheritance diagram for SketchDataRoot:

Detailed Description

Parent class for SketchData<T>

Definition at line 21 of file SketchDataRoot.h.

List of all members.

Public Member Functions

 SketchDataRoot (SketchSpace *s)
virtual ~SketchDataRoot ()
SketchSpacegetSpace () const
 Returns the SketchSpace that owns the pool containing this SketchData object.
ShapeSpacegetDualSpace () const
 Returns the ShapeSpace associated with the SketchSpace for this Sketch.
int getId () const
 Return the id of this sketch.
int getParentId () const
 Return the id of this sketch's parent; value is zero for parentless sketches.
void setParentId (int const _id)
 Set the parent id of a sketch; normally used only inside visops functions.
int getViewableId () const
 Return the id of the closest viewable ancestor; will be the sketch's own id if it's viewable.
bool isViewable () const
 Returns true if the sketch is currently viewable by the SketchGUI.
void setViewable (bool const v=true)
 Sets whether the sketch is viewabile by the SketchGUI.
void retain (bool const r=true)
 Sets or clears the retain bit, which prevents a sketch from being reclaimed even if its reference count goes to zero; such a sketch may still be retrieved via GET_SKETCH.
bool isRetained () const
 Returns true if the sketch is currently retained.
int getRefcount () const
 Returns the reference count of the sketch; should always be positive in user code.
rgb getColor () const
 Returns the current color assigned to the sketch; only used for rendering Sketch<bool>
ColorMapType_t getColorMap () const
 Return the sketch's current colormap setting.
void setColorMap (const ColorMapType_t _map)
 Change the colormap of a sketch.
const std::string & getName () const
 Return the name of a sketch as a string.
void setName (const std::string &_name)
 Change the name of a sketch. Note that since the name is actually stored in the SketchData object, all Sketch objects pointing to this sketch will be affected.
virtual SketchType_t getType () const =0
 Return the type of data stored in this sketch. Virtual function overridden by each SketchData<T> class.
void V (std::string const &_name="")
 Make a sketch viewable and change its name; used by NEW_SKETCH macro.
void N (std::string const &_name="")
 Make a sketch non-viewable and change its name; used by NEW_SKETCH_N macro.
int indexX (int index)
 X coordinate encoded by sketch index.
int indexY (int index)
 Y coordinate encoded by sketch index.
Point indexPoint (const int index)
 Convert an index to a Point, using TmatInv.
int indexOf (int x, int y)
 Converts (x,y) into a sketch index.
virtual unsigned int saveBuffer (char buf[], unsigned int avail) const
 Save a sketch to a buffer; used in the SketchGUI interface.
virtual size_t savePixels (char buf[], size_t avail) const =0
 handle copying pixels to buffer

void setColor (const rgb &_color)
 Set the color of the sketch.
void setColor (const std::string &colorname)
 Set the color of the sketch.
void setColor (const color_index cindex)
 Set the color of the sketch.

void inheritFrom (const SketchDataRoot &parent)
 Set parentId and inherit color and colormap properties from a parent sketch.
void inheritFrom (const ShapeRoot &parent)
 Set parentId and inherit color and colormap properties from a parent sketch.
void inheritFrom (const BaseData &parent)
 Set parentId and inherit color and colormap properties from a parent sketch.

const unsigned int getWidth () const
 Width and height of sketches in this space.
const unsigned int getHeight () const
 Width and height of sketches in this space.
const unsigned int getNumPixels () const
 Width and height of sketches in this space.

Private Member Functions

 SketchDataRoot (const SketchDataRoot &)
 never call this
SketchDataRootoperator= (const SketchDataRoot &)
 never call this

Private Attributes

SketchSpacespace
 The SketchSpace that owns the pool containing this SketchData object.
std::string name
 Name of this sketch.
int id
 Sketch-specific integer ID, for unique identification.
int parentId
 Integer ID of the "parent" Sketch, 0 if no parent; used in GUI.
int refcount
 Reference count for the sketch. When SketchPool detects this as 0, it may reuse it.
bool retained
 If true, don't garbage collect this sketch when refcount is zero, so it can still be retrieved by GET_SKETCH.
bool viewable
 True if the Sketch is currently viewable via the SketchGUI.
int refreshTag
 Last time this sketch was included in a sketch list sent to the SketchGUI.
bool clearPending
 True if we've tried to clear this sketch but the SketchGUI was looking at it.
rgb color
ColorMapType_t colormap

Friends

class SketchPool
class Sketch
class SketchData
class SketchRoot

Constructor & Destructor Documentation

SketchDataRoot ( SketchSpace s  ) 

Definition at line 66 of file SketchDataRoot.h.

virtual ~SketchDataRoot (  )  [virtual]

Definition at line 72 of file SketchDataRoot.h.

SketchDataRoot ( const SketchDataRoot  )  [private]

never call this


Member Function Documentation

rgb getColor (  )  const

Returns the current color assigned to the sketch; only used for rendering Sketch<bool>

Definition at line 108 of file SketchDataRoot.h.

Referenced by SketchDataRoot::inheritFrom(), and BaseData::inheritFrom().

ColorMapType_t getColorMap (  )  const

Return the sketch's current colormap setting.

Definition at line 118 of file SketchDataRoot.h.

Referenced by SketchDataRoot::inheritFrom().

ShapeSpace & getDualSpace ( void   )  const

Returns the ShapeSpace associated with the SketchSpace for this Sketch.

Definition at line 18 of file SketchDataRoot.cc.

const unsigned int getHeight (  )  const

Width and height of sketches in this space.

Definition at line 21 of file SketchDataRoot.cc.

Referenced by SketchData< T >::at(), SketchDataRoot::saveBuffer(), and SketchData< T >::savePixels().

int getId (  )  const

Return the id of this sketch.

Definition at line 81 of file SketchDataRoot.h.

Referenced by SketchDataRoot::getViewableId().

const std::string& getName (  )  const

Return the name of a sketch as a string.

Definition at line 124 of file SketchDataRoot.h.

const unsigned int getNumPixels (  )  const

Width and height of sketches in this space.

Definition at line 22 of file SketchDataRoot.cc.

Referenced by SketchData< T >::savePixels().

int getParentId (  )  const

Return the id of this sketch's parent; value is zero for parentless sketches.

Definition at line 84 of file SketchDataRoot.h.

Referenced by SketchDataRoot::getViewableId().

int getRefcount (  )  const

Returns the reference count of the sketch; should always be positive in user code.

Definition at line 105 of file SketchDataRoot.h.

SketchSpace& getSpace (  )  const

Returns the SketchSpace that owns the pool containing this SketchData object.

Definition at line 75 of file SketchDataRoot.h.

Referenced by VRmixin::encodeSketch().

virtual SketchType_t getType (  )  const [pure virtual]

Return the type of data stored in this sketch. Virtual function overridden by each SketchData<T> class.

Implemented in SketchData< T >, SketchData< uchar >, SketchData< bool >, SketchData< DualCoding::uchar >, SketchData< skindex >, SketchData< T >, SketchData< T >, SketchData< T >, SketchData< T >, SketchData< T >, and SketchData< T >.

Referenced by SketchDataRoot::inheritFrom(), and SketchDataRoot::saveBuffer().

int getViewableId (  )  const

Return the id of the closest viewable ancestor; will be the sketch's own id if it's viewable.

Definition at line 90 of file SketchDataRoot.h.

Referenced by SketchDataRoot::inheritFrom(), and BaseData::inheritFrom().

const unsigned int getWidth (  )  const
int indexOf ( int  x,
int  y 
)

Converts (x,y) into a sketch index.

Definition at line 162 of file SketchDataRoot.h.

Point indexPoint ( const int  index  ) 

Convert an index to a Point, using TmatInv.

Definition at line 61 of file SketchDataRoot.cc.

int indexX ( int  index  ) 

X coordinate encoded by sketch index.

Definition at line 153 of file SketchDataRoot.h.

Referenced by SketchDataRoot::indexPoint().

int indexY ( int  index  ) 

Y coordinate encoded by sketch index.

Definition at line 156 of file SketchDataRoot.h.

Referenced by SketchDataRoot::indexPoint().

void inheritFrom ( const BaseData parent  ) 

Set parentId and inherit color and colormap properties from a parent sketch.

Definition at line 38 of file SketchDataRoot.cc.

void inheritFrom ( const ShapeRoot parent  ) 

Set parentId and inherit color and colormap properties from a parent sketch.

Definition at line 33 of file SketchDataRoot.cc.

void inheritFrom ( const SketchDataRoot parent  ) 

Set parentId and inherit color and colormap properties from a parent sketch.

Definition at line 24 of file SketchDataRoot.cc.

bool isRetained (  )  const

Returns true if the sketch is currently retained.

Definition at line 102 of file SketchDataRoot.h.

bool isViewable (  )  const

Returns true if the sketch is currently viewable by the SketchGUI.

Definition at line 93 of file SketchDataRoot.h.

Referenced by SketchDataRoot::getViewableId().

void N ( std::string const &  _name = ""  ) 

Make a sketch non-viewable and change its name; used by NEW_SKETCH_N macro.

Definition at line 48 of file SketchDataRoot.cc.

SketchDataRoot& operator= ( const SketchDataRoot  )  [private]

never call this

void retain ( bool const   r = true  ) 

Sets or clears the retain bit, which prevents a sketch from being reclaimed even if its reference count goes to zero; such a sketch may still be retrieved via GET_SKETCH.

Definition at line 99 of file SketchDataRoot.h.

unsigned int saveBuffer ( char  buf[],
unsigned int  avail 
) const [virtual]

Save a sketch to a buffer; used in the SketchGUI interface.

Definition at line 71 of file SketchDataRoot.cc.

Referenced by VRmixin::encodeSketch().

virtual size_t savePixels ( char  buf[],
size_t  avail 
) const [pure virtual]
void setColor ( const color_index  cindex  ) 

Set the color of the sketch.

Definition at line 57 of file SketchDataRoot.cc.

void setColor ( const std::string &  colorname  ) 

Set the color of the sketch.

Definition at line 53 of file SketchDataRoot.cc.

void setColor ( const rgb _color  ) 

Set the color of the sketch.

Definition at line 112 of file SketchDataRoot.h.

Referenced by SketchDataRoot::inheritFrom(), and SketchDataRoot::setColor().

void setColorMap ( const ColorMapType_t  _map  ) 

Change the colormap of a sketch.

Definition at line 121 of file SketchDataRoot.h.

Referenced by SketchDataRoot::inheritFrom().

void setName ( const std::string &  _name  ) 

Change the name of a sketch. Note that since the name is actually stored in the SketchData object, all Sketch objects pointing to this sketch will be affected.

Definition at line 127 of file SketchDataRoot.h.

Referenced by SketchDataRoot::N(), and SketchDataRoot::V().

void setParentId ( int const   _id  ) 

Set the parent id of a sketch; normally used only inside visops functions.

Definition at line 87 of file SketchDataRoot.h.

Referenced by SketchDataRoot::inheritFrom().

void setViewable ( bool const   v = true  ) 

Sets whether the sketch is viewabile by the SketchGUI.

Definition at line 96 of file SketchDataRoot.h.

Referenced by SketchDataRoot::N(), and SketchDataRoot::V().

void V ( std::string const &  _name = ""  ) 

Make a sketch viewable and change its name; used by NEW_SKETCH macro.

Definition at line 43 of file SketchDataRoot.cc.


Friends And Related Function Documentation

friend class Sketch [friend]

Definition at line 61 of file SketchDataRoot.h.

friend class SketchData [friend]

Definition at line 62 of file SketchDataRoot.h.

friend class SketchPool [friend]

Definition at line 60 of file SketchDataRoot.h.

friend class SketchRoot [friend]

Definition at line 63 of file SketchDataRoot.h.


Member Data Documentation

bool clearPending [private]

True if we've tried to clear this sketch but the SketchGUI was looking at it.

Definition at line 48 of file SketchDataRoot.h.

rgb color [private]

Color to use for displaying this sketch. Only meaningful for Sketch<bool> but info is preserved for inheritance by children or in case we coerce bool to int or float and then back to bool.

Definition at line 53 of file SketchDataRoot.h.

Referenced by SketchDataRoot::getColor(), and SketchDataRoot::setColor().

Which color map to use; default is to use the robot's own color table. Other tables are used for displaying grayscale images, or scaled quantities like distance or area using a continuous color scale from red to blue.

Definition at line 58 of file SketchDataRoot.h.

Referenced by SketchDataRoot::getColorMap(), SketchDataRoot::setColorMap(), and SketchData< T >::SketchData().

int id [private]

Sketch-specific integer ID, for unique identification.

Definition at line 30 of file SketchDataRoot.h.

Referenced by SketchDataRoot::getId().

std::string name [private]

Name of this sketch.

Definition at line 27 of file SketchDataRoot.h.

Referenced by SketchDataRoot::getName(), and SketchDataRoot::setName().

int parentId [private]

Integer ID of the "parent" Sketch, 0 if no parent; used in GUI.

Definition at line 33 of file SketchDataRoot.h.

Referenced by SketchDataRoot::getParentId(), and SketchDataRoot::setParentId().

int refcount [private]

Reference count for the sketch. When SketchPool detects this as 0, it may reuse it.

Definition at line 36 of file SketchDataRoot.h.

Referenced by SketchDataRoot::getRefcount().

int refreshTag [private]

Last time this sketch was included in a sketch list sent to the SketchGUI.

Definition at line 45 of file SketchDataRoot.h.

bool retained [private]

If true, don't garbage collect this sketch when refcount is zero, so it can still be retrieved by GET_SKETCH.

Definition at line 39 of file SketchDataRoot.h.

Referenced by SketchDataRoot::isRetained(), and SketchDataRoot::retain().

bool viewable [private]

True if the Sketch is currently viewable via the SketchGUI.

Definition at line 42 of file SketchDataRoot.h.

Referenced by SketchDataRoot::isViewable(), and SketchDataRoot::setViewable().


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

DualCoding 5.1CVS
Generated Mon May 9 04:56:31 2016 by Doxygen 1.6.3