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);
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);
388 private:
void GetMeshInformation(
const Ogre::Mesh *_mesh,
389 size_t &_vertexCount,
390 Ogre::Vector3* &_vertices,
393 const Ogre::Vector3 &_position,
394 const Ogre::Quaternion &_orient,
395 const Ogre::Vector3 &_scale);
400 private:
void PrintSceneGraphHelper(
const std::string &_prefix,
406 private:
void OnScene(ConstScenePtr &_msg);
410 private:
void OnResponse(ConstResponsePtr &_msg);
414 private:
void OnRequest(ConstRequestPtr &_msg);
418 private:
void OnJointMsg(ConstJointPtr &_msg);
422 private:
bool ProcessSensorMsg(ConstSensorPtr &_msg);
426 private:
bool ProcessJointMsg(ConstJointPtr &_msg);
430 private:
bool ProcessLinkMsg(ConstLinkPtr &_msg);
434 private:
void ProcessSceneMsg(ConstScenePtr &_msg);
438 private:
bool ProcessModelMsg(
const msgs::Model &_msg);
442 private:
void OnSensorMsg(ConstSensorPtr &_msg);
446 private:
void OnVisualMsg(ConstVisualPtr &_msg);
450 private:
bool ProcessVisualMsg(ConstVisualPtr &_msg);
454 private:
void OnLightMsg(ConstLightPtr &_msg);
458 private:
void ProcessLightMsg(ConstLightPtr &_msg);
462 private:
void ProcessRequestMsg(ConstRequestPtr &_msg);
466 private:
void OnSelectionMsg(ConstSelectionPtr &_msg);
470 private:
void OnSkyMsg(ConstSkyPtr &_msg);
474 private:
void OnModelMsg(ConstModelPtr &_msg);
478 private:
void OnPoseMsg(ConstPosePtr &_msg);
482 private:
void OnSkeletonPoseMsg(ConstPoseAnimationPtr &_msg);
487 private:
void CreateCOMVisual(ConstLinkPtr &_msg,
VisualPtr _linkVisual);
496 private: std::string name;
502 private: std::vector<CameraPtr> cameras;
505 private: std::vector<UserCameraPtr> userCameras;
508 private: Ogre::SceneManager *manager;
511 private: Ogre::RaySceneQuery *raySceneQuery;
514 private: std::vector<Grid *> grids;
517 private:
static uint32_t idCounter;
520 private: uint32_t id;
523 private: std::string idString;
527 typedef std::list<boost::shared_ptr<msgs::Visual const> > VisualMsgs_L;
530 private: VisualMsgs_L visualMsgs;
534 typedef std::list<boost::shared_ptr<msgs::Light const> > LightMsgs_L;
537 private: LightMsgs_L lightMsgs;
541 typedef std::list<boost::shared_ptr<msgs::Pose const> > PoseMsgs_L;
544 private: PoseMsgs_L poseMsgs;
548 typedef std::list<boost::shared_ptr<msgs::Scene const> > SceneMsgs_L;
551 private: SceneMsgs_L sceneMsgs;
555 typedef std::list<boost::shared_ptr<msgs::Joint const> > JointMsgs_L;
558 private: JointMsgs_L jointMsgs;
562 typedef std::list<boost::shared_ptr<msgs::Link const> > LinkMsgs_L;
565 private: LinkMsgs_L linkMsgs;
569 typedef std::list<boost::shared_ptr<msgs::Model const> > ModelMsgs_L;
571 private: ModelMsgs_L modelMsgs;
575 typedef std::list<boost::shared_ptr<msgs::Sensor const> > SensorMsgs_L;
578 private: SensorMsgs_L sensorMsgs;
582 typedef std::list<boost::shared_ptr<msgs::Request const> > RequestMsgs_L;
584 private: RequestMsgs_L requestMsgs;
588 typedef std::map<std::string, VisualPtr> Visual_M;
591 private: Visual_M visuals;
595 typedef std::map<std::string, LightPtr> Light_M;
598 private: Light_M lights;
602 typedef std::list<boost::shared_ptr<msgs::PoseAnimation const> >
605 private: SkeletonPoseMsgs_L skeletonPoseMsgs;
608 private: boost::shared_ptr<msgs::Selection const> selectionMsg;
611 private: boost::mutex *receiveMutex;
662 private: std::vector<event::ConnectionPtr> connections;
675 private: std::string selectionMode;
678 private: msgs::Request *requestMsg;
681 private:
bool enableVisualizations;
687 private: std::map<std::string, Projector *> projectors;
693 private: SkyX::BasicController *skyxController;