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);
291 public:
void SetVisible(
const std::string &_name,
bool _visible);
299 const std::string &_name);
308 public:
void SetFog(
const std::string &_type,
310 double _density,
double _start,
double _end);
314 public: uint32_t
GetId()
const;
338 public:
void SetGrid(
bool _enabled);
347 public: std::string
StripSceneName(
const std::string &_name)
const;
354 public:
void Clear();
361 const std::string &_newName);
373 private:
void SetSky();
376 private:
void InitDeferredShading();
384 private: Ogre::Entity *GetOgreEntityAt(
CameraPtr _camera,
386 bool _ignorSelectionObj);
398 private:
void GetMeshInformation(
const Ogre::Mesh *_mesh,
399 size_t &_vertexCount,
400 Ogre::Vector3* &_vertices,
403 const Ogre::Vector3 &_position,
404 const Ogre::Quaternion &_orient,
405 const Ogre::Vector3 &_scale);
410 private:
void PrintSceneGraphHelper(
const std::string &_prefix,
416 private:
void OnScene(ConstScenePtr &_msg);
420 private:
void OnResponse(ConstResponsePtr &_msg);
424 private:
void OnRequest(ConstRequestPtr &_msg);
428 private:
void OnJointMsg(ConstJointPtr &_msg);
432 private:
bool ProcessSensorMsg(ConstSensorPtr &_msg);
436 private:
bool ProcessJointMsg(ConstJointPtr &_msg);
440 private:
bool ProcessLinkMsg(ConstLinkPtr &_msg);
444 private:
void ProcessSceneMsg(ConstScenePtr &_msg);
448 private:
bool ProcessModelMsg(
const msgs::Model &_msg);
452 private:
void OnSensorMsg(ConstSensorPtr &_msg);
456 private:
void OnVisualMsg(ConstVisualPtr &_msg);
460 private:
bool ProcessVisualMsg(ConstVisualPtr &_msg);
464 private:
void OnLightMsg(ConstLightPtr &_msg);
468 private:
void ProcessLightMsg(ConstLightPtr &_msg);
472 private:
void ProcessRequestMsg(ConstRequestPtr &_msg);
476 private:
void OnSelectionMsg(ConstSelectionPtr &_msg);
480 private:
void OnSkyMsg(ConstSkyPtr &_msg);
484 private:
void OnModelMsg(ConstModelPtr &_msg);
488 private:
void OnPoseMsg(ConstPosePtr &_msg);
492 private:
void OnSkeletonPoseMsg(ConstPoseAnimationPtr &_msg);
497 private:
void CreateCOMVisual(ConstLinkPtr &_msg,
VisualPtr _linkVisual);
506 private: std::string name;
512 private: std::vector<CameraPtr> cameras;
515 private: std::vector<UserCameraPtr> userCameras;
518 private: Ogre::SceneManager *manager;
521 private: Ogre::RaySceneQuery *raySceneQuery;
524 private: std::vector<Grid *> grids;
527 private:
static uint32_t idCounter;
530 private: uint32_t id;
533 private: std::string idString;
537 typedef std::list<boost::shared_ptr<msgs::Visual const> > VisualMsgs_L;
540 private: VisualMsgs_L visualMsgs;
544 typedef std::list<boost::shared_ptr<msgs::Light const> > LightMsgs_L;
547 private: LightMsgs_L lightMsgs;
551 typedef std::list<boost::shared_ptr<msgs::Pose const> > PoseMsgs_L;
554 private: PoseMsgs_L poseMsgs;
558 typedef std::list<boost::shared_ptr<msgs::Scene const> > SceneMsgs_L;
561 private: SceneMsgs_L sceneMsgs;
565 typedef std::list<boost::shared_ptr<msgs::Joint const> > JointMsgs_L;
568 private: JointMsgs_L jointMsgs;
572 typedef std::list<boost::shared_ptr<msgs::Link const> > LinkMsgs_L;
575 private: LinkMsgs_L linkMsgs;
579 typedef std::list<boost::shared_ptr<msgs::Model const> > ModelMsgs_L;
581 private: ModelMsgs_L modelMsgs;
585 typedef std::list<boost::shared_ptr<msgs::Sensor const> > SensorMsgs_L;
588 private: SensorMsgs_L sensorMsgs;
592 typedef std::list<boost::shared_ptr<msgs::Request const> > RequestMsgs_L;
594 private: RequestMsgs_L requestMsgs;
598 typedef std::map<std::string, VisualPtr> Visual_M;
601 private: Visual_M visuals;
605 typedef std::map<std::string, LightPtr> Light_M;
608 private: Light_M lights;
612 typedef std::list<boost::shared_ptr<msgs::PoseAnimation const> >
615 private: SkeletonPoseMsgs_L skeletonPoseMsgs;
618 private: boost::shared_ptr<msgs::Selection const> selectionMsg;
621 private: boost::mutex *receiveMutex;
672 private: std::vector<event::ConnectionPtr> connections;
685 private: std::string selectionMode;
688 private: msgs::Request *requestMsg;
691 private:
bool enableVisualizations;
697 private: std::map<std::string, Projector *> projectors;
703 private: SkyX::BasicController *skyxController;