VRG3D Namespace Reference


class  ConfigMap
class  DisplayTile
class  Event
class  EventNetMsg
 A message that contains a single event. More...
class  EventBufferNetMsg
 A message that contains an array of Events. More...
class  ICubeXDevice
class  ISenseDirect
class  InputDevice
class  MidiInDevice
class  MidiOutDevice
class  MouseToTracker
class  ProjectionVRCamera
class  SpaceNavDevice
class  SynchedSystem
class  TrackDClient
class  VRApp
class  VRPNAnalogDevice
class  VRPNButtonDevice
class  VRPNTrackerDevice


ReferenceCountedPointer< class
ReferenceCountedPointer< class
ReferenceCountedPointer< class
ReferenceCountedPointer< class


EventRef createCopyOfEvent (EventRef e)
Array< std::string > splitStringIntoArray (const std::string &in)
std::string decygifyPath (const std::string &in)
std::string replaceEnvVars (const std::string &in)
void growAABox (AABox &box, const Vector3 &point)
void growAABox (AABox &box, const AABox &box2)
Color3 Color3FromUints (G3D::uint8 r, G3D::uint8 g, G3D::uint8 b)
unsigned int hashCode (const double d)
std::ostream & operator<< (std::ostream &os, const Vector2 &vec2)
std::istream & operator>> (std::istream &is, Vector2 &vec2)
std::istream & operator>> (std::istream &is, Vector3 &vec3)
std::ostream & operator<< (std::ostream &os, const Matrix3 &m)
std::istream & operator>> (std::istream &is, Matrix3 &m)
std::ostream & operator<< (std::ostream &os, const Matrix4 &m)
std::istream & operator>> (std::istream &is, Matrix4 &m)
std::istream & operator>> (std::istream &is, CoordinateFrame &m)
std::ostream & operator<< (std::ostream &os, const Color3 &c)
std::istream & operator>> (std::istream &is, Color3 &c)
std::ostream & operator<< (std::ostream &os, const Color4 &c)
std::istream & operator>> (std::istream &is, Color4 &c)
std::string matrix4ToString (Matrix4 m)
std::string coordinateFrameToString (CoordinateFrame cf)
std::string intToString (int i)
int stringToInt (const std::string &in)
std::string realToString (double r)
double stringToReal (const std::string &in)
void vrg3dSleepMsecs (double msecs)
 Sleeps for milliseconds.
void vrg3dSleepSecs (double secs)
 Sleeps for seconds.

Typedef Documentation

typedef ReferenceCountedPointer<class ConfigMap> VRG3D::ConfigMapRef

ConfigVal's and config files description:

ConfigVal's are an easy way to access program settings that can be stored in a configuration file. They are all key=value pairs where key and value are both originally std::strings. But, the value string can be easily reinterpreted by any class that overrides the stream >> and << operators. The ConfigVal() function figures out what type to try to convert to by the type of the second parameter to the function. This parameter also specifies the default value to return if the key is not found in the ConfigMap::_map Table.

To use a config file, call ConfigMap::readFile() with the filename of a text file to read. The format of each line of the file should be:

key value

where key has no spaces in it. value is everything after the space until the end of the line, so it can have spaces in it. Any line that *starts* with the character # is a comment and is ignored. A single \ character means cut the line here and continue on the next line. Everything after the \ is ignored and the text on the next line is appended to the text on the current line. You can escape the \ operator with a \ to get a single \ character.

Additionally, any value X appearing inside the special character sequence will be replaced by the value of the environment variable named X. If X is not defined, it will be replaced by a null string. If X takes the form of the path to a file and you're running in Windows under cygwin then X will be automatically converted from the form /cygdrive/c/blah/blah to the more Windows friendly form c:/blah/blah to stay compatible with the Visual C++ compiler.

Additionally, if you put a += after the key and the key has already been defined, then the value is appended to the key's current value. If you don't have the += and the same key is read in from a file, then the new value overwrites the old. For example:

mykey1 value1 mykey1 value2 mykey2 value3 mykey2+= value4

The value of mykey1 will be "value2". The value of mykey2 will be "value3 value4".

--- inside config-file.cfg ---

MyLength 0.4 MyVector (0.2, 0.4, 0.3)

--- end of file ---

Log *log = new Log("log.txt"); ConfigMapRef myMap = new ConfigMap("config-file.cfg", log); double l = myMap->get("MyLength", 0.0); Vector3 v = myMap->get("MyVector", Vector3::zero()); This class stores the data for the ConfigVal accessor functions Essentially, this is a big associative array std::string's map to std::strings. The ConfigVal function is used to access values and reinterpret them as different types. The key/value pairs can be read in from a file(s), or set manually with the set function.

typedef ReferenceCountedPointer<class Event> VRG3D::EventRef

typedef ReferenceCountedPointer<class MouseToTracker> VRG3D::MouseToTrackerRef

typedef ReferenceCountedPointer<class ProjectionVRCamera> VRG3D::ProjectionVRCameraRef

Function Documentation

Color3 VRG3D::Color3FromUints ( G3D::uint8  r,
G3D::uint8  g,
G3D::uint8  b 

std::string VRG3D::coordinateFrameToString ( CoordinateFrame  cf  ) 

EventRef VRG3D::createCopyOfEvent ( EventRef  e  ) 

Creates a copy of the Event pointed to by e and returns a ref counted pointer to the new copy.

std::string VRG3D::decygifyPath ( const std::string &  in  ) 

This function changes occurances of /cygdrive/c/folder1/folder2/etc.. to c:/folder1/folder2/etc.. when running in Windows. Paths coming from program arguments or environment variables will tend to take the /cygdrive/<drive-letter>/ form when running under cygwin, but file commands compiled with the MS Visual C++ compiler can't deal with paths of this form.

void VRG3D::growAABox ( AABox &  box,
const AABox &  box2 

void VRG3D::growAABox ( AABox &  box,
const Vector3 &  point 

unsigned int VRG3D::hashCode ( const double  d  ) 

std::string VRG3D::intToString ( int  i  ) 

std::string VRG3D::matrix4ToString ( Matrix4  m  ) 

std::ostream& VRG3D::operator<< ( std::ostream &  os,
const Color4 &  c 

std::ostream& VRG3D::operator<< ( std::ostream &  os,
const Color3 &  c 

std::ostream& VRG3D::operator<< ( std::ostream &  os,
const Matrix4 &  m 

std::ostream& VRG3D::operator<< ( std::ostream &  os,
const Matrix3 &  m 

std::ostream& VRG3D::operator<< ( std::ostream &  os,
const Vector2 &  vec2 

std::istream& VRG3D::operator>> ( std::istream &  is,
Color4 &  c 

std::istream& VRG3D::operator>> ( std::istream &  is,
Color3 &  c 

std::istream& VRG3D::operator>> ( std::istream &  is,
CoordinateFrame &  m 

std::istream& VRG3D::operator>> ( std::istream &  is,
Matrix4 &  m 

std::istream& VRG3D::operator>> ( std::istream &  is,
Matrix3 &  m 

std::istream& VRG3D::operator>> ( std::istream &  is,
Vector3 &  vec3 

std::istream& VRG3D::operator>> ( std::istream &  is,
Vector2 &  vec2 

std::string VRG3D::realToString ( double  r  ) 

std::string VRG3D::replaceEnvVars ( const std::string &  in  ) 

Given an input string, replaces all occurances of with the decygified (see above) value of the environment variable NAME. If NAME is not defined, then a blank string is returned.

Referenced by VRG3D::ConfigMap::get().

Array<std::string> VRG3D::splitStringIntoArray ( const std::string &  in  ) 

int VRG3D::stringToInt ( const std::string &  in  ) 

double VRG3D::stringToReal ( const std::string &  in  ) 

void VRG3D::vrg3dSleepMsecs ( double  msecs  ) 

Sleeps for milliseconds.

void VRG3D::vrg3dSleepSecs ( double  secs  ) 

Sleeps for seconds.

Generated on Wed Jan 26 06:35:59 2011 for VRG3D by  doxygen 1.5.6