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);
293 public:
void SetVisible(
const std::string &_name,
bool _visible);
301 const std::string &_name);
310 public:
void SetFog(
const std::string &_type,
312 double _density,
double _start,
double _end);
316 public: uint32_t
GetId()
const;
340 public:
void SetGrid(
bool _enabled);
349 public: std::string
StripSceneName(
const std::string &_name)
const;
356 public:
void Clear();
363 const std::string &_newName);
398 private:
void SetSky();
401 private:
void InitDeferredShading();
409 private: Ogre::Entity *GetOgreEntityAt(
CameraPtr _camera,
411 bool _ignorSelectionObj);
423 private:
void GetMeshInformation(
const Ogre::Mesh *_mesh,
424 size_t &_vertexCount,
425 Ogre::Vector3* &_vertices,
428 const Ogre::Vector3 &_position,
429 const Ogre::Quaternion &_orient,
430 const Ogre::Vector3 &_scale);
435 private:
void PrintSceneGraphHelper(
const std::string &_prefix,
441 private:
void OnScene(ConstScenePtr &_msg);
445 private:
void OnResponse(ConstResponsePtr &_msg);
449 private:
void OnRequest(ConstRequestPtr &_msg);
453 private:
void OnJointMsg(ConstJointPtr &_msg);
457 private:
bool ProcessSensorMsg(ConstSensorPtr &_msg);
461 private:
bool ProcessJointMsg(ConstJointPtr &_msg);
465 private:
bool ProcessLinkMsg(ConstLinkPtr &_msg);
469 private:
void ProcessSceneMsg(ConstScenePtr &_msg);
473 private:
bool ProcessModelMsg(
const msgs::Model &_msg);
477 private:
void OnSensorMsg(ConstSensorPtr &_msg);
481 private:
void OnVisualMsg(ConstVisualPtr &_msg);
485 private:
bool ProcessVisualMsg(ConstVisualPtr &_msg);
489 private:
void OnLightMsg(ConstLightPtr &_msg);
493 private:
void ProcessLightMsg(ConstLightPtr &_msg);
497 private:
void ProcessRequestMsg(ConstRequestPtr &_msg);
501 private:
void OnSelectionMsg(ConstSelectionPtr &_msg);
505 private:
void OnSkyMsg(ConstSkyPtr &_msg);
509 private:
void OnModelMsg(ConstModelPtr &_msg);
513 private:
void OnPoseMsg(ConstPose_VPtr &_msg);
517 private:
void OnSkeletonPoseMsg(ConstPoseAnimationPtr &_msg);
522 private:
void CreateCOMVisual(ConstLinkPtr &_msg,
VisualPtr _linkVisual);
531 private: std::string name;
537 private: std::vector<CameraPtr> cameras;
540 private: std::vector<UserCameraPtr> userCameras;
543 private: Ogre::SceneManager *manager;
546 private: Ogre::RaySceneQuery *raySceneQuery;
549 private: std::vector<Grid *> grids;
552 private:
static uint32_t idCounter;
555 private: uint32_t id;
558 private: std::string idString;
562 typedef std::list<boost::shared_ptr<msgs::Visual const> > VisualMsgs_L;
565 private: VisualMsgs_L visualMsgs;
569 typedef std::list<boost::shared_ptr<msgs::Light const> > LightMsgs_L;
572 private: LightMsgs_L lightMsgs;
576 typedef std::list<msgs::Pose> PoseMsgs_L;
579 private: PoseMsgs_L poseMsgs;
583 typedef std::list<boost::shared_ptr<msgs::Scene const> > SceneMsgs_L;
586 private: SceneMsgs_L sceneMsgs;
590 typedef std::list<boost::shared_ptr<msgs::Joint const> > JointMsgs_L;
593 private: JointMsgs_L jointMsgs;
597 typedef std::list<boost::shared_ptr<msgs::Link const> > LinkMsgs_L;
600 private: LinkMsgs_L linkMsgs;
604 typedef std::list<boost::shared_ptr<msgs::Model const> > ModelMsgs_L;
606 private: ModelMsgs_L modelMsgs;
610 typedef std::list<boost::shared_ptr<msgs::Sensor const> > SensorMsgs_L;
613 private: SensorMsgs_L sensorMsgs;
617 typedef std::list<boost::shared_ptr<msgs::Request const> > RequestMsgs_L;
619 private: RequestMsgs_L requestMsgs;
623 typedef std::map<std::string, VisualPtr> Visual_M;
626 private: Visual_M visuals;
630 typedef std::map<std::string, LightPtr> Light_M;
633 private: Light_M lights;
637 typedef std::list<boost::shared_ptr<msgs::PoseAnimation const> >
640 private: SkeletonPoseMsgs_L skeletonPoseMsgs;
643 private: boost::shared_ptr<msgs::Selection const> selectionMsg;
646 private: boost::mutex *receiveMutex;
697 private: std::vector<event::ConnectionPtr> connections;
710 private: std::string selectionMode;
713 private: msgs::Request *requestMsg;
716 private:
bool enableVisualizations;
722 private: std::map<std::string, Projector *> projectors;
728 private: SkyX::BasicController *skyxController;
731 private:
bool showCOMs;
734 private:
bool showCollisions;
737 private:
bool showJoints;
740 private:
bool transparent;
743 private:
bool wireframe;
746 private:
bool initialized;