osgSim::ShapeAttribute Class Reference

`#include <ShapeAttribute>`

## Public Types

enum | Type { UNKNOWN , INTEGER , DOUBLE , STRING }
| ShapeAttribute data type. More...

## Public Member Functions

| ShapeAttribute ()
| ShapeAttribute (const char *name)
| ShapeAttribute (const char *name, int value)
| ShapeAttribute (const char *name, double value)
| ShapeAttribute (const char *name, const char *value)
| ShapeAttribute (const ShapeAttribute &sa)
| ~ShapeAttribute ()
ShapeAttribute & | operator= (const ShapeAttribute &sa)
int | compare (const osgSim::ShapeAttribute &sa) const
bool | operator== (const osgSim::ShapeAttribute &sa) const
bool | operator!= (const osgSim::ShapeAttribute &sa) const
bool | operator< (const osgSim::ShapeAttribute &sa) const
const std::string & | getName () const
| Get the attribute name.
void | setName (const std::string &name)
| Set the attribute name.
Type | getType () const
| Get the attribute data type.
int | getInt () const
| Get the attribute data as an int.
double | getDouble () const
| Get the attribute data as a double.
const char * | getString () const
| Get the attribute data as a string.
void | setValue (int value)
| Set an integer attribute data.
void | setValue (double value)
| Set a double attribute data.
void | setValue (const char *value)
| Set a string attribute data.

## Member Enumeration Documentation

## Type

enum osgSim::ShapeAttribute::Type

ShapeAttribute data type.

Enumerator
UNKNOWN |
INTEGER |
DOUBLE |
STRING |

## Constructor & Destructor Documentation

## ShapeAttribute() [1/6]

osgSim::ShapeAttribute::ShapeAttribute | ( |  | ) |

Referenced by operator=(), setValue(), and ShapeAttribute().

## ShapeAttribute() [2/6]

osgSim::ShapeAttribute::ShapeAttribute | ( | const char * | name | ) |

## ShapeAttribute() [3/6]

osgSim::ShapeAttribute::ShapeAttribute | ( | const char * | name,
|  | int | value )

## ShapeAttribute() [4/6]

osgSim::ShapeAttribute::ShapeAttribute | ( | const char * | name,
|  | double | value )

## ShapeAttribute() [5/6]

osgSim::ShapeAttribute::ShapeAttribute | ( | const char * | name,
|  | const char * | value )

Note, ShapeAttribute takes a copy of both name and value, the calling code should manage its own clean up of the original strings.

## ShapeAttribute() [6/6]

osgSim::ShapeAttribute::ShapeAttribute | ( | const ShapeAttribute & | sa | ) |

References ShapeAttribute().

## ~ShapeAttribute()

osgSim::ShapeAttribute::~ShapeAttribute | ( |  | ) |

## Member Function Documentation

## compare()

int osgSim::ShapeAttribute::compare | ( | const osgSim::ShapeAttribute & | sa | ) | const

return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.

Referenced by operator!=(), operator<(), and operator==().

## getDouble()

double osgSim::ShapeAttribute::getDouble | ( |  | ) | const

inline

Get the attribute data as a double.

References _double.

## getInt()

int osgSim::ShapeAttribute::getInt | ( |  | ) | const

inline

Get the attribute data as an int.

References _integer.

## getName()

const std::string & osgSim::ShapeAttribute::getName | ( |  | ) | const

inline

Get the attribute name.

## getString()

const char * osgSim::ShapeAttribute::getString | ( |  | ) | const

inline

Get the attribute data as a string.

References _string.

## getType()

Type osgSim::ShapeAttribute::getType | ( |  | ) | const

inline

Get the attribute data type.

## operator!=()

bool osgSim::ShapeAttribute::operator!= | ( | const osgSim::ShapeAttribute & | sa | ) | const

inline

References compare().

## operator<()

bool osgSim::ShapeAttribute::operator< | ( | const osgSim::ShapeAttribute & | sa | ) | const

inline

References compare().

## operator=()

ShapeAttribute & osgSim::ShapeAttribute::operator= | ( | const ShapeAttribute & | sa | ) |

References ShapeAttribute().

## operator==()

bool osgSim::ShapeAttribute::operator== | ( | const osgSim::ShapeAttribute & | sa | ) | const

inline

References compare().

## setName()

void osgSim::ShapeAttribute::setName | ( | const std::string & | name | ) |

inline

Set the attribute name.

## setValue() [1/3]

void osgSim::ShapeAttribute::setValue | ( | const char * | value | ) |

Set a string attribute data.

References ShapeAttribute().

## setValue() [2/3]

void osgSim::ShapeAttribute::setValue | ( | double | value | ) |

inline

Set a double attribute data.

References _double, and DOUBLE.

## setValue() [3/3]

void osgSim::ShapeAttribute::setValue | ( | int | value | ) |

inline

Set an integer attribute data.

References _integer, and INTEGER.

## Member Data Documentation

## _double

double osgSim::ShapeAttribute::_double

Referenced by getDouble(), and setValue().

## _integer

int osgSim::ShapeAttribute::_integer

Referenced by getInt(), and setValue().

## _string

char* osgSim::ShapeAttribute::_string

Referenced by getString().

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

- ShapeAttribute