24 #include <boost/enable_shared_from_this.hpp>
25 #include <boost/shared_ptr.hpp>
40 class BasicController;
76 class Scene :
public boost::enable_shared_from_this<Scene>
86 public:
Scene(
const std::string &_name,
87 bool _enableVisualizations =
false);
107 public: Ogre::SceneManager *
GetManager()
const;
111 public: std::string
GetName()
const;
134 public:
void CreateGrid(uint32_t _cellCount,
float _cellLength,
152 bool _autoRender =
true);
160 bool _autoRender =
true);
168 bool _autoRender =
true);
225 const std::string &_mode);
268 std::vector<VisualPtr> &_visuals);
285 public:
void SetVisible(
const std::string &_name,
bool _visible);
293 const std::string &_name);
302 public:
void SetFog(
const std::string &_type,
304 double _density,
double _start,
double _end);
308 public: uint32_t
GetId()
const;
332 public:
void SetGrid(
bool _enabled);
341 public: std::string
StripSceneName(
const std::string &_name)
const;
348 public:
void Clear();
355 const std::string &_newName);
363 private:
void SetSky();
366 private:
void InitDeferredShading();
374 private: Ogre::Entity *GetOgreEntityAt(
CameraPtr _camera,
376 bool _ignorSelectionObj);
380 private:
void GetMeshInformation(
const Ogre::Mesh *mesh,
381 size_t &vertex_count,
382 Ogre::Vector3* &vertices,
385 const Ogre::Vector3 &position,
386 const Ogre::Quaternion &orient,
387 const Ogre::Vector3 &scale);
392 private:
void PrintSceneGraphHelper(
const std::string &_prefix,
398 private:
void OnScene(ConstScenePtr &_msg);
402 private:
void OnResponse(ConstResponsePtr &_msg);
406 private:
void OnRequest(ConstRequestPtr &_msg);
410 private:
void OnJointMsg(ConstJointPtr &_msg);
414 private:
bool ProcessSensorMsg(ConstSensorPtr &_msg);
418 private:
bool ProcessJointMsg(ConstJointPtr &_msg);
422 private:
bool ProcessLinkMsg(ConstLinkPtr &_msg);
426 private:
void ProcessSceneMsg(ConstScenePtr &_msg);
430 private:
bool ProcessModelMsg(
const msgs::Model &_msg);
434 private:
void OnSensorMsg(ConstSensorPtr &_msg);
438 private:
void OnVisualMsg(ConstVisualPtr &_msg);
442 private:
bool ProcessVisualMsg(ConstVisualPtr &_msg);
446 private:
void OnLightMsg(ConstLightPtr &_msg);
450 private:
void ProcessLightMsg(ConstLightPtr &_msg);
454 private:
void ProcessRequestMsg(ConstRequestPtr &_msg);
458 private:
void OnSelectionMsg(ConstSelectionPtr &_msg);
462 private:
void OnSkyMsg(ConstSkyPtr &_msg);
466 private:
void OnModelMsg(ConstModelPtr &_msg);
470 private:
void OnPoseMsg(ConstPosePtr &_msg);
474 private:
void OnSkeletonPoseMsg(ConstPoseAnimationPtr &_msg);
479 private:
void CreateCOMVisual(ConstLinkPtr &_msg,
VisualPtr _linkVisual);
488 private: std::string name;
494 private: std::vector<CameraPtr> cameras;
497 private: std::vector<UserCameraPtr> userCameras;
500 private: Ogre::SceneManager *manager;
503 private: Ogre::RaySceneQuery *raySceneQuery;
506 private: std::vector<Grid *> grids;
509 private:
static uint32_t idCounter;
512 private: uint32_t id;
515 private: std::string idString;
519 typedef std::list<boost::shared_ptr<msgs::Visual const> > VisualMsgs_L;
522 private: VisualMsgs_L visualMsgs;
526 typedef std::list<boost::shared_ptr<msgs::Light const> > LightMsgs_L;
529 private: LightMsgs_L lightMsgs;
533 typedef std::list<boost::shared_ptr<msgs::Pose const> > PoseMsgs_L;
536 private: PoseMsgs_L poseMsgs;
540 typedef std::list<boost::shared_ptr<msgs::Scene const> > SceneMsgs_L;
543 private: SceneMsgs_L sceneMsgs;
547 typedef std::list<boost::shared_ptr<msgs::Joint const> > JointMsgs_L;
550 private: JointMsgs_L jointMsgs;
554 typedef std::list<boost::shared_ptr<msgs::Link const> > LinkMsgs_L;
557 private: LinkMsgs_L linkMsgs;
561 typedef std::list<boost::shared_ptr<msgs::Model const> > ModelMsgs_L;
563 private: ModelMsgs_L modelMsgs;
567 typedef std::list<boost::shared_ptr<msgs::Sensor const> > SensorMsgs_L;
570 private: SensorMsgs_L sensorMsgs;
574 typedef std::list<boost::shared_ptr<msgs::Request const> > RequestMsgs_L;
576 private: RequestMsgs_L requestMsgs;
580 typedef std::map<std::string, VisualPtr> Visual_M;
583 private: Visual_M visuals;
587 typedef std::map<std::string, LightPtr> Light_M;
590 private: Light_M lights;
594 typedef std::list<boost::shared_ptr<msgs::PoseAnimation const> >
597 private: SkeletonPoseMsgs_L skeletonPoseMsgs;
600 private: boost::shared_ptr<msgs::Selection const> selectionMsg;
603 private: boost::mutex *receiveMutex;
654 private: std::vector<event::ConnectionPtr> connections;
667 private: std::string selectionMode;
670 private: msgs::Request *requestMsg;
673 private:
bool enableVisualizations;
679 private: std::map<std::string, Projector *> projectors;
685 private: SkyX::BasicController *skyxController;