Simox  2.3.50
VirtualRobot::Scene Class Reference

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW Scene (const std::string &name)
 
virtual ~Scene ()
 
void registerRobot (RobotPtr robot)
 
void deRegisterRobot (RobotPtr robot)
 
void deRegisterRobot (const std::string &name)
 
bool hasRobot (RobotPtr robot) const
 
bool hasRobot (const std::string &name) const
 
RobotPtr getRobot (const std::string &name)
 
std::vector< RobotPtrgetRobots ()
 
void registerRobotConfig (RobotPtr robot, RobotConfigPtr config)
 
void registerRobotConfig (RobotPtr robot, std::vector< RobotConfigPtr > configs)
 
void deRegisterRobotConfig (RobotPtr robot, RobotConfigPtr config)
 
void deRegisterRobotConfig (RobotPtr robot, const std::string &name)
 
bool hasRobotConfig (RobotPtr robot, RobotConfigPtr config)
 
bool hasRobotConfig (RobotPtr robot, const std::string &name)
 
RobotConfigPtr getRobotConfig (const std::string &robotName, const std::string &name)
 
RobotConfigPtr getRobotConfig (RobotPtr robot, const std::string &name)
 
std::vector< RobotConfigPtrgetRobotConfigs (RobotPtr robot)
 
void registerManipulationObject (ManipulationObjectPtr obj)
 
void deRegisterManipulationObject (ManipulationObjectPtr obj)
 
void deRegisterManipulationObject (const std::string &name)
 
bool hasManipulationObject (ManipulationObjectPtr obstacle) const
 
bool hasManipulationObject (const std::string &name) const
 
ManipulationObjectPtr getManipulationObject (const std::string &name)
 
std::vector< ManipulationObjectPtrgetManipulationObjects ()
 
void registerObstacle (ObstaclePtr obstacle)
 
void deRegisterObstacle (ObstaclePtr obstacle)
 
void deRegisterObstacle (const std::string &name)
 
bool hasObstacle (ObstaclePtr obstacle) const
 
bool hasObstacle (const std::string &name) const
 
ObstaclePtr getObstacle (const std::string &name)
 
std::vector< ObstaclePtrgetObstacles ()
 
void registerTrajectory (TrajectoryPtr t)
 
void deRegisterTrajectory (TrajectoryPtr t)
 
void deRegisterTrajectory (const std::string &name)
 
bool hasTrajectory (TrajectoryPtr t) const
 
bool hasTrajectory (const std::string &name) const
 
TrajectoryPtr getTrajectory (const std::string &name)
 
std::vector< TrajectoryPtrgetTrajectories ()
 
std::vector< TrajectoryPtrgetTrajectories (const std::string &robotName)
 
void registerSceneObjectSet (SceneObjectSetPtr sos)
 
void deRegisterSceneObjectSet (SceneObjectSetPtr sos)
 
void deRegisterSceneObjectSet (const std::string &name)
 
bool hasSceneObjectSet (SceneObjectSetPtr sos) const
 
bool hasSceneObjectSet (const std::string &name) const
 
SceneObjectSetPtr getSceneObjectSet (const std::string &name)
 
std::vector< SceneObjectSetPtrgetSceneObjectSets ()
 
RobotNodeSetPtr getRobotNodeSet (const std::string &robot, const std::string rns)
 
std::string getName () const
 
template<typename T >
boost::shared_ptr< T > getVisualization (SceneObject::VisualizationType visuType=SceneObject::Full, bool addRobots=true, bool addObstacles=true, bool addManipulationObjects=true, bool addTrajectories=true, bool addSceneObjectSets=true)
 
std::string getXMLString (const std::string &basePath)
 

Protected Attributes

std::string name
 
std::vector< RobotPtrrobots
 
std::map< RobotPtr, std::vector< RobotConfigPtr > > robotConfigs
 
std::vector< ObstaclePtrobstacles
 
std::vector< ManipulationObjectPtrmanipulationObjects
 
std::vector< SceneObjectSetPtrsceneObjectSets
 
std::vector< TrajectoryPtrtrajectories
 

Constructor & Destructor Documentation

VirtualRobot::Scene::Scene ( const std::string &  name)
VirtualRobot::Scene::~Scene ( )
virtual

Member Function Documentation

void VirtualRobot::Scene::deRegisterManipulationObject ( ManipulationObjectPtr  obj)

Removes the ManipulationObject to from this scene. If the ManipulationObject is not registered nothing happens.

void VirtualRobot::Scene::deRegisterManipulationObject ( const std::string &  name)
void VirtualRobot::Scene::deRegisterObstacle ( ObstaclePtr  obstacle)

Removes the obstacle to from this scene. If the obstacle is not registered nothing happens.

void VirtualRobot::Scene::deRegisterObstacle ( const std::string &  name)
void VirtualRobot::Scene::deRegisterRobot ( RobotPtr  robot)

Removes the robot to from this scene. If the robot is not registered nothing happens.

void VirtualRobot::Scene::deRegisterRobot ( const std::string &  name)
void VirtualRobot::Scene::deRegisterRobotConfig ( RobotPtr  robot,
RobotConfigPtr  config 
)

Removes the RobotConfig to from this scene. If the RobotConfig is not registered nothing happens.

void VirtualRobot::Scene::deRegisterRobotConfig ( RobotPtr  robot,
const std::string &  name 
)
void VirtualRobot::Scene::deRegisterSceneObjectSet ( SceneObjectSetPtr  sos)

Removes the set to from this scene. If the set is not registered nothing happens.

void VirtualRobot::Scene::deRegisterSceneObjectSet ( const std::string &  name)
void VirtualRobot::Scene::deRegisterTrajectory ( TrajectoryPtr  t)

Removes the Trajectory to from this scene. If the Trajectory is not registered nothing happens.

void VirtualRobot::Scene::deRegisterTrajectory ( const std::string &  name)
VirtualRobot::ManipulationObjectPtr VirtualRobot::Scene::getManipulationObject ( const std::string &  name)
std::vector< ManipulationObjectPtr > VirtualRobot::Scene::getManipulationObjects ( )
std::string VirtualRobot::Scene::getName ( ) const
VirtualRobot::ObstaclePtr VirtualRobot::Scene::getObstacle ( const std::string &  name)
std::vector< ObstaclePtr > VirtualRobot::Scene::getObstacles ( )
VirtualRobot::RobotPtr VirtualRobot::Scene::getRobot ( const std::string &  name)
VirtualRobot::RobotConfigPtr VirtualRobot::Scene::getRobotConfig ( const std::string &  robotName,
const std::string &  name 
)
VirtualRobot::RobotConfigPtr VirtualRobot::Scene::getRobotConfig ( RobotPtr  robot,
const std::string &  name 
)
std::vector< RobotConfigPtr > VirtualRobot::Scene::getRobotConfigs ( RobotPtr  robot)
VirtualRobot::RobotNodeSetPtr VirtualRobot::Scene::getRobotNodeSet ( const std::string &  robot,
const std::string  rns 
)
std::vector< RobotPtr > VirtualRobot::Scene::getRobots ( )
VirtualRobot::SceneObjectSetPtr VirtualRobot::Scene::getSceneObjectSet ( const std::string &  name)
std::vector< SceneObjectSetPtr > VirtualRobot::Scene::getSceneObjectSets ( )
std::vector< TrajectoryPtr > VirtualRobot::Scene::getTrajectories ( )
std::vector< TrajectoryPtr > VirtualRobot::Scene::getTrajectories ( const std::string &  robotName)
VirtualRobot::TrajectoryPtr VirtualRobot::Scene::getTrajectory ( const std::string &  name)
template<typename T >
boost::shared_ptr< T > VirtualRobot::Scene::getVisualization ( SceneObject::VisualizationType  visuType = SceneObject::Full,
bool  addRobots = true,
bool  addObstacles = true,
bool  addManipulationObjects = true,
bool  addTrajectories = true,
bool  addSceneObjectSets = true 
)

Retrieve a visualization in the given format. Example usage: boost::shared_ptr<VirtualRobot::CoinVisualization> visualization = scene->getVisualization<CoinVisualization>(); SoNode* visualisationNode = NULL; if (visualization) visualisationNode = visualization->getCoinVisualization();

This method collects all visualization nodes and creates a new Visualization subclass which is given by the template parameter T. T must be a subclass of VirtualRobot::Visualization. A compile time error is thrown if a different class type is used as template argument.

std::string VirtualRobot::Scene::getXMLString ( const std::string &  basePath)

Creates an XML string that describes this scene.

Parameters
basePathAll paths to robots or objects are stored relative to this path.
Returns
The xml string.
bool VirtualRobot::Scene::hasManipulationObject ( ManipulationObjectPtr  obstacle) const
bool VirtualRobot::Scene::hasManipulationObject ( const std::string &  name) const
bool VirtualRobot::Scene::hasObstacle ( ObstaclePtr  obstacle) const
bool VirtualRobot::Scene::hasObstacle ( const std::string &  name) const
bool VirtualRobot::Scene::hasRobot ( RobotPtr  robot) const
bool VirtualRobot::Scene::hasRobot ( const std::string &  name) const
bool VirtualRobot::Scene::hasRobotConfig ( RobotPtr  robot,
RobotConfigPtr  config 
)
bool VirtualRobot::Scene::hasRobotConfig ( RobotPtr  robot,
const std::string &  name 
)
bool VirtualRobot::Scene::hasSceneObjectSet ( SceneObjectSetPtr  sos) const
bool VirtualRobot::Scene::hasSceneObjectSet ( const std::string &  name) const
bool VirtualRobot::Scene::hasTrajectory ( TrajectoryPtr  t) const
bool VirtualRobot::Scene::hasTrajectory ( const std::string &  name) const
void VirtualRobot::Scene::registerManipulationObject ( ManipulationObjectPtr  obj)

Registers the ManipulationObject to this scene. If an ManipulationObject with the same name is already registered nothing happens.

void VirtualRobot::Scene::registerObstacle ( ObstaclePtr  obstacle)

Registers the obstacle to this scene. If an obstacle with the same name is already registered nothing happens.

void VirtualRobot::Scene::registerRobot ( RobotPtr  robot)

Registers the robot to this scene. If a robot with the same name is already registered nothing happens.

void VirtualRobot::Scene::registerRobotConfig ( RobotPtr  robot,
RobotConfigPtr  config 
)

Registers the RobotConfig to this scene. If a config with the same name is already registered nothing happens.

void VirtualRobot::Scene::registerRobotConfig ( RobotPtr  robot,
std::vector< RobotConfigPtr configs 
)
void VirtualRobot::Scene::registerSceneObjectSet ( SceneObjectSetPtr  sos)

Registers the set to this scene. If a set with the same name is already registered nothing happens.

void VirtualRobot::Scene::registerTrajectory ( TrajectoryPtr  t)

Registers the Trajectory to this scene. If an Trajectory with the same name is already registered nothing happens.

Field Documentation

std::vector< ManipulationObjectPtr > VirtualRobot::Scene::manipulationObjects
protected
std::string VirtualRobot::Scene::name
protected
std::vector< ObstaclePtr > VirtualRobot::Scene::obstacles
protected
std::map< RobotPtr, std::vector< RobotConfigPtr > > VirtualRobot::Scene::robotConfigs
protected
std::vector< RobotPtr > VirtualRobot::Scene::robots
protected
std::vector< SceneObjectSetPtr > VirtualRobot::Scene::sceneObjectSets
protected
std::vector< TrajectoryPtr > VirtualRobot::Scene::trajectories
protected