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);
391 private:
void SetSky();
394 private:
void InitDeferredShading();
402 private: Ogre::Entity *GetOgreEntityAt(
CameraPtr _camera,
404 bool _ignorSelectionObj);
416 private:
void GetMeshInformation(
const Ogre::Mesh *_mesh,
417 size_t &_vertexCount,
418 Ogre::Vector3* &_vertices,
421 const Ogre::Vector3 &_position,
422 const Ogre::Quaternion &_orient,
423 const Ogre::Vector3 &_scale);
428 private:
void PrintSceneGraphHelper(
const std::string &_prefix,
434 private:
void OnScene(ConstScenePtr &_msg);
438 private:
void OnResponse(ConstResponsePtr &_msg);
442 private:
void OnRequest(ConstRequestPtr &_msg);
446 private:
void OnJointMsg(ConstJointPtr &_msg);
450 private:
bool ProcessSensorMsg(ConstSensorPtr &_msg);
454 private:
bool ProcessJointMsg(ConstJointPtr &_msg);
458 private:
bool ProcessLinkMsg(ConstLinkPtr &_msg);
462 private:
void ProcessSceneMsg(ConstScenePtr &_msg);
466 private:
bool ProcessModelMsg(
const msgs::Model &_msg);
470 private:
void OnSensorMsg(ConstSensorPtr &_msg);
474 private:
void OnVisualMsg(ConstVisualPtr &_msg);
478 private:
bool ProcessVisualMsg(ConstVisualPtr &_msg);
482 private:
void OnLightMsg(ConstLightPtr &_msg);
486 private:
void ProcessLightMsg(ConstLightPtr &_msg);
490 private:
void ProcessRequestMsg(ConstRequestPtr &_msg);
494 private:
void OnSelectionMsg(ConstSelectionPtr &_msg);
498 private:
void OnSkyMsg(ConstSkyPtr &_msg);
502 private:
void OnModelMsg(ConstModelPtr &_msg);
506 private:
void OnPoseMsg(ConstPose_VPtr &_msg);
510 private:
void OnSkeletonPoseMsg(ConstPoseAnimationPtr &_msg);
515 private:
void CreateCOMVisual(ConstLinkPtr &_msg,
VisualPtr _linkVisual);
524 private: std::string name;
530 private: std::vector<CameraPtr> cameras;
533 private: std::vector<UserCameraPtr> userCameras;
536 private: Ogre::SceneManager *manager;
539 private: Ogre::RaySceneQuery *raySceneQuery;
542 private: std::vector<Grid *> grids;
545 private:
static uint32_t idCounter;
548 private: uint32_t id;
551 private: std::string idString;
555 typedef std::list<boost::shared_ptr<msgs::Visual const> > VisualMsgs_L;
558 private: VisualMsgs_L visualMsgs;
562 typedef std::list<boost::shared_ptr<msgs::Light const> > LightMsgs_L;
565 private: LightMsgs_L lightMsgs;
569 typedef std::list<msgs::Pose> PoseMsgs_L;
572 private: PoseMsgs_L poseMsgs;
576 typedef std::list<boost::shared_ptr<msgs::Scene const> > SceneMsgs_L;
579 private: SceneMsgs_L sceneMsgs;
583 typedef std::list<boost::shared_ptr<msgs::Joint const> > JointMsgs_L;
586 private: JointMsgs_L jointMsgs;
590 typedef std::list<boost::shared_ptr<msgs::Link const> > LinkMsgs_L;
593 private: LinkMsgs_L linkMsgs;
597 typedef std::list<boost::shared_ptr<msgs::Model const> > ModelMsgs_L;
599 private: ModelMsgs_L modelMsgs;
603 typedef std::list<boost::shared_ptr<msgs::Sensor const> > SensorMsgs_L;
606 private: SensorMsgs_L sensorMsgs;
610 typedef std::list<boost::shared_ptr<msgs::Request const> > RequestMsgs_L;
612 private: RequestMsgs_L requestMsgs;
616 typedef std::map<std::string, VisualPtr> Visual_M;
619 private: Visual_M visuals;
623 typedef std::map<std::string, LightPtr> Light_M;
626 private: Light_M lights;
630 typedef std::list<boost::shared_ptr<msgs::PoseAnimation const> >
633 private: SkeletonPoseMsgs_L skeletonPoseMsgs;
636 private: boost::shared_ptr<msgs::Selection const> selectionMsg;
639 private: boost::mutex *receiveMutex;
690 private: std::vector<event::ConnectionPtr> connections;
703 private: std::string selectionMode;
706 private: msgs::Request *requestMsg;
709 private:
bool enableVisualizations;
715 private: std::map<std::string, Projector *> projectors;
721 private: SkyX::BasicController *skyxController;
724 private:
bool showCOMs;
727 private:
bool showCollisions;
730 private:
bool showJoints;
733 private:
bool transparent;