24 #include <boost/enable_shared_from_this.hpp>
25 #include <boost/shared_ptr.hpp>
26 #include <boost/unordered/unordered_map.hpp>
42 class BasicController;
78 class Scene :
public boost::enable_shared_from_this<Scene>
95 public: Scene(
const std::string &_name,
96 bool _enableVisualizations =
false);
116 public: Ogre::SceneManager *
GetManager()
const;
120 public: std::string
GetName()
const;
143 public:
void CreateGrid(uint32_t _cellCount,
float _cellLength,
149 public: Grid *
GetGrid(uint32_t _index)
const;
161 bool _autoRender =
true);
169 bool _autoRender =
true);
177 bool _autoRender =
true);
238 const std::string &_mode);
281 std::vector<VisualPtr> &_visuals);
306 public:
void SetVisible(
const std::string &_name,
bool _visible);
314 const std::string &_name);
323 public:
void SetFog(
const std::string &_type,
325 double _density,
double _start,
double _end);
329 public: uint32_t
GetId()
const;
353 public:
void SetGrid(
bool _enabled);
362 public: std::string
StripSceneName(
const std::string &_name)
const;
369 public:
void Clear();
376 const std::string &_newName);
433 private:
void SetSky();
436 private:
void InitDeferredShading();
444 private: Ogre::Entity *GetOgreEntityAt(
CameraPtr _camera,
446 bool _ignorSelectionObj);
458 private:
void GetMeshInformation(
const Ogre::Mesh *_mesh,
459 size_t &_vertexCount,
460 Ogre::Vector3* &_vertices,
463 const Ogre::Vector3 &_position,
464 const Ogre::Quaternion &_orient,
465 const Ogre::Vector3 &_scale);
470 private:
void PrintSceneGraphHelper(
const std::string &_prefix,
476 private:
void OnScene(ConstScenePtr &_msg);
480 private:
void OnResponse(ConstResponsePtr &_msg);
484 private:
void OnRequest(ConstRequestPtr &_msg);
488 private:
void OnJointMsg(ConstJointPtr &_msg);
492 private:
bool ProcessSensorMsg(ConstSensorPtr &_msg);
496 private:
bool ProcessJointMsg(ConstJointPtr &_msg);
500 private:
bool ProcessLinkMsg(ConstLinkPtr &_msg);
504 private:
bool ProcessSceneMsg(ConstScenePtr &_msg);
508 private:
bool ProcessModelMsg(
const msgs::Model &_msg);
512 private:
void OnSensorMsg(ConstSensorPtr &_msg);
516 private:
void OnVisualMsg(ConstVisualPtr &_msg);
520 private:
bool ProcessVisualMsg(ConstVisualPtr &_msg);
524 private:
void OnLightMsg(ConstLightPtr &_msg);
528 private:
bool ProcessLightMsg(ConstLightPtr &_msg);
532 private:
void ProcessRequestMsg(ConstRequestPtr &_msg);
536 private:
void OnSelectionMsg(ConstSelectionPtr &_msg);
540 private:
void OnSkyMsg(ConstSkyPtr &_msg);
544 private:
void OnModelMsg(ConstModelPtr &_msg);
548 private:
void OnPoseMsg(ConstPosesStampedPtr &_msg);
552 private:
void OnSkeletonPoseMsg(ConstPoseAnimationPtr &_msg);
557 private:
void CreateCOMVisual(ConstLinkPtr &_msg,
VisualPtr _linkVisual);
566 private: std::string name;
572 private: std::vector<CameraPtr> cameras;
575 private: std::vector<UserCameraPtr> userCameras;
578 private: Ogre::SceneManager *manager;
581 private: Ogre::RaySceneQuery *raySceneQuery;
584 private: std::vector<Grid *> grids;
587 private:
static uint32_t idCounter;
590 private: uint32_t id;
593 private: std::string idString;
597 typedef std::list<boost::shared_ptr<msgs::Visual const> > VisualMsgs_L;
600 private: VisualMsgs_L visualMsgs;
604 typedef std::list<boost::shared_ptr<msgs::Light const> > LightMsgs_L;
607 private: LightMsgs_L lightMsgs;
611 typedef std::list<msgs::Pose> PoseMsgs_L;
614 private: PoseMsgs_L poseMsgs;
618 typedef std::list<boost::shared_ptr<msgs::Scene const> > SceneMsgs_L;
621 private: SceneMsgs_L sceneMsgs;
625 typedef std::list<boost::shared_ptr<msgs::Joint const> > JointMsgs_L;
628 private: JointMsgs_L jointMsgs;
632 typedef std::list<boost::shared_ptr<msgs::Link const> > LinkMsgs_L;
635 private: LinkMsgs_L linkMsgs;
639 typedef std::list<boost::shared_ptr<msgs::Model const> > ModelMsgs_L;
641 private: ModelMsgs_L modelMsgs;
645 typedef std::list<boost::shared_ptr<msgs::Sensor const> > SensorMsgs_L;
648 private: SensorMsgs_L sensorMsgs;
652 typedef std::list<boost::shared_ptr<msgs::Request const> > RequestMsgs_L;
654 private: RequestMsgs_L requestMsgs;
658 typedef std::map<std::string, VisualPtr> Visual_M;
661 private: Visual_M visuals;
665 typedef std::map<std::string, LightPtr> Light_M;
668 private: Light_M lights;
672 typedef std::list<boost::shared_ptr<msgs::PoseAnimation const> >
675 private: SkeletonPoseMsgs_L skeletonPoseMsgs;
678 private: boost::shared_ptr<msgs::Selection const> selectionMsg;
681 private: boost::mutex *receiveMutex;
732 private: std::vector<event::ConnectionPtr> connections;
745 private: std::string selectionMode;
748 private: msgs::Request *requestMsg;
751 private:
bool enableVisualizations;
754 private: Heightmap *terrain;
757 private: std::map<std::string, Projector *> projectors;
763 private: SkyX::BasicController *skyxController;
766 private:
bool showCOMs;
769 private:
bool showCollisions;
772 private:
bool showJoints;
775 private:
bool transparent;
778 private:
bool wireframe;
781 private:
bool initialized;
793 typedef boost::unordered_map<std::string,
794 boost::shared_ptr<msgs::Joint const> > JointMsgs_M;
797 private: JointMsgs_M joints;