123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #ifndef REDREAM_H
- #define REDREAM_H
- #include <QString>
- #include <boost/any.hpp>
- #include <map>
- #include <QList>
- typedef std::map<std::string, boost::any> PlistDict;
- typedef std::vector<boost::any> PlistArray;
- class Redream
- {
- public:
- static Redream* getInstance();
- /**
- * @brief 创建房间时创建一个red模版
- * @return
- */
- bool createRedream(QString filePath);
- /**
- * @brief 创建物件时导入red文件
- * @return
- */
- void addObjectToRedream(std::string filePath, std::vector<std::string> object);
- /**
- * @brief 从red文件中删除一个物件
- * @return
- */
- void deleteObjectFromRedream(std::string filePath, std::vector<std::string> object);
-
- /**
- * @brief 从red文件中获取时间线信息
- * @return
- */
- QList<QString> getTimelineFromRedream(std::string filePath);
- /**
- * @brief 创建家具时导入red文件
- * @return
- */
- void addFurnitureToRedream(std::string filePath, std::string furnitureId);
- /**
- * @brief 从red文件中删除一个家具
- * @return
- */
- void deleteFurnitureFromRedream(std::string filePath, std::string furnitureId);
- /**
- * @brief 查询家具的位置信息
- * @return
- */
- std::array<qreal, 2> getFurniturePos(std::string filePath, std::string furnitureId);
- /**
- * @brief 误操作可能会导致家具节点丢失, 检查家具是否丢失,如果已丢失,则在特定地方重新创建一下
- * @return
- */
- void checkFurnitureIsLost(std::string filePath, std::string furnitureId);
- //redream节点丢失问题
- void syncAllFurnitureRedreamNodes(QString roomId);
- int getFurnitureLocalZOrder(std::string filePath, std::string furnitureId);
- private:
- PlistDict _addChildren(std::string furnitureId);
- PlistArray _addProperties(std::string furnitureId);
- };
- #endif // REDREAM_H
|