Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

TraplasObject Class Reference

Superclass for types of objects that are part of the simulated transport network. More...

#include <TraplasObject.h>

Inheritance diagram for TraplasObject:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 TraplasObject ()
virtual int getId ()
virtual int getType ()
virtual void setDescription (string descript)
virtual bool select ()
virtual bool isSelected ()
virtual osg::Node * getModel ()
virtual osg::Vec3d getPosition ()
virtual string toString ()
bool setLabel (shared_ptr< string > desc)
void initLabel ()

Protected Member Functions

virtual ~TraplasObject ()

Protected Attributes

int id
int type
bool selected
string description
osg::Node * model
osg::Geode * label

Detailed Description

Superclass for types of objects that are part of the simulated transport network.

This class contains the basic functionality shared by Cargo, Infrastructure and Transport resources.

Definition at line 79 of file TraplasObject.h.


Constructor & Destructor Documentation

TraplasObject::TraplasObject  ) 
 

Definition at line 86 of file TraplasObject.cpp.

TraplasObject::~TraplasObject  )  [protected, virtual]
 

Definition at line 88 of file TraplasObject.cpp.


Member Function Documentation

virtual int TraplasObject::getId  )  [inline, virtual]
 

Function to get the ID of a TraplasObject.

Returns:
The identifier of the object.

Definition at line 86 of file TraplasObject.h.

References id.

virtual osg::Node* TraplasObject::getModel  )  [inline, virtual]
 

Function to get the OSG-model for this object.

Returns:
An osg node of type Geode containing the osg-model for this object.

Definition at line 111 of file TraplasObject.h.

References model.

Referenced by StateControl::arc(), StateControl::drv(), StateControl::load(), StateControl::newcarg(), StateControl::rmcarg(), select(), StateControl::trdel(), and StateControl::unload().

osg::Vec3d TraplasObject::getPosition  )  [virtual]
 

Virtual function to get the (relative) position of a TraplasObject.

Returns:
The position of the object, relative to its parent.

Definition at line 115 of file TraplasObject.cpp.

References model.

Referenced by StateControl::drv(), and StateControl::trnew().

virtual int TraplasObject::getType  )  [inline, virtual]
 

Function to get the type of the object.

Returns:
Which type of TraplasObject this is.

Definition at line 91 of file TraplasObject.h.

References type.

void TraplasObject::initLabel  ) 
 

Initialises the label and places it under the AutoTransform of the resource.

Returns:
true if succesfull, false if there has been an error.

Definition at line 90 of file TraplasObject.cpp.

References FONTSIZE_LABELS, label, and model.

Referenced by StateControl::location(), StateControl::newcarg(), and StateControl::trnew().

virtual bool TraplasObject::isSelected  )  [inline, virtual]
 

Virtual function to see if this object has been selected.

Returns:
True if this object is selected, false otherwise.

Definition at line 106 of file TraplasObject.h.

References selected.

Referenced by StateControl::load(), StateControl::rmcarg(), UserInterface::selectionAction(), StateControl::setspdinviz(), StateControl::trdel(), and StateControl::unload().

bool TraplasObject::select  )  [virtual]
 

Function to (de)select this object.

Returns:
true if this object is now selected, false if it has been deselected.

Definition at line 129 of file TraplasObject.cpp.

References getModel(), and selected.

Referenced by StateControl::selectObject().

Here is the call graph for this function:

void TraplasObject::setDescription string  descript  )  [virtual]
 

Function to set the description of this object.

Parameters:
descript The string describing the object.

Definition at line 124 of file TraplasObject.cpp.

References description, and model.

Referenced by Cargo::Cargo(), Infrastructure::Infrastructure(), StateControl::location(), StateControl::newcarg(), Transport::Transport(), and StateControl::trnew().

bool TraplasObject::setLabel shared_ptr< string >  desc  ) 
 

Sets the label for this model.

Parameters:
desc The label geode used for showing relevant information about this object.
Returns:
true if succesfull, false if there has been an error.

Definition at line 146 of file TraplasObject.cpp.

References label.

Referenced by StateControl::location(), StateControl::newcarg(), and StateControl::trnew().

string TraplasObject::toString  )  [virtual]
 

Returns:
A string with information about this TraplasObject.

Reimplemented in Cargo, Transport, and Infrastructure.

Definition at line 153 of file TraplasObject.cpp.

Referenced by StateControl::deselectObject(), StateControl::selectObject(), and StateControl::updateHudText().


Member Data Documentation

string TraplasObject::description [protected]
 

Definition at line 140 of file TraplasObject.h.

Referenced by setDescription(), Infrastructure::toString(), Transport::toString(), and Cargo::toString().

int TraplasObject::id [protected]
 

Definition at line 137 of file TraplasObject.h.

Referenced by Cargo::Cargo(), getId(), Infrastructure::Infrastructure(), and Transport::Transport().

osg::Geode* TraplasObject::label [protected]
 

Definition at line 142 of file TraplasObject.h.

Referenced by initLabel(), and setLabel().

osg::Node* TraplasObject::model [protected]
 

Definition at line 141 of file TraplasObject.h.

Referenced by Cargo::Cargo(), getModel(), getPosition(), Infrastructure::Infrastructure(), initLabel(), setDescription(), and Transport::Transport().

bool TraplasObject::selected [protected]
 

Definition at line 139 of file TraplasObject.h.

Referenced by Cargo::Cargo(), Infrastructure::Infrastructure(), isSelected(), select(), and Transport::Transport().

int TraplasObject::type [protected]
 

Definition at line 138 of file TraplasObject.h.

Referenced by Cargo::Cargo(), getType(), Infrastructure::Infrastructure(), and Transport::Transport().


The documentation for this class was generated from the following files:
Generated on Mon Jun 19 10:22:23 2006 for TraplasVisualisation by  doxygen 1.4.4