// /** * @file llimportobject.h */ #ifndef LL_LLIMPORTOBJECT_H #define LL_LLIMPORTOBJECT_H #include "llviewerobject.h" #include "llfloater.h" #include "llvoavatardefines.h" class LLImportAssetData { public: LLImportAssetData(std::string infilename,LLUUID inassetid,LLAssetType::EType intype); U32 localid; LLAssetType::EType type; LLInventoryType::EType inv_type; EWearableType wear_type; LLTransactionID tid; LLUUID assetid; LLUUID folderid; LLUUID oldassetid; std::string name; std::string description; std::string filename; }; class LLImportWearable { public: std::string mName; int mType; std::string mData; LLSD mOrginalLLSD; LLImportWearable(LLSD sd); std::list mTextures; void replaceTextures(std::map textures_replace); }; class LLImportObject : public LLViewerObject { public: //LLImportObject(std::string id, std::string parentId); LLImportObject(std::string id, LLSD prim); std::string mId; std::string mParentId; std::string mPrimName; bool importIsAttachment; U32 importAttachPoint; LLVector3 importAttachPos; LLQuaternion importAttachRot; std::list mTextures; }; class LLXmlImportOptions { friend bool operator==(const LLXmlImportOptions &a, const LLXmlImportOptions &b); friend bool operator!=(const LLXmlImportOptions &a, const LLXmlImportOptions &b); public: LLXmlImportOptions(LLXmlImportOptions* options); LLXmlImportOptions(std::string filename); LLXmlImportOptions(LLSD llsd); virtual ~LLXmlImportOptions(); void clear(); void init(LLSD llsd); std::string mName; //LLSD mLLSD; std::string mAssetDir; std::vector mAssets; std::vector mRootObjects; std::vector mChildObjects; std::vector mWearables; BOOL mKeepPosition; LLViewerObject* mSupplier; BOOL mReplaceTexture; protected: LLUUID mID; }; class LLXmlImport { public: static void import(LLXmlImportOptions* import_options); static void onNewPrim(LLViewerObject* object); static void onNewItem(LLViewerInventoryItem* item); static void onNewAttachment(LLViewerObject* object); static void Cancel(void* user_data); static void rez_supply(); static void finish_init(); static void finish_link(); static bool sImportInProgress; static bool sImportHasAttachments; static LLUUID sFolderID; static LLViewerObject* sSupplyParams; static int sPrimsNeeded; static std::vector sPrims; // all prims being imported static std::map sPt2watch; // attach points that need watching static std::map sId2attachpt; // attach points of all attachables static std::map sPt2attachpos; // positions of all attachables static std::map sPt2attachrot; // rotations of all attachables static std::map > sLinkSets;//Linksets to link. static int sPrimIndex; static int sAttachmentsDone; static std::map sId2localid; static std::map sRootpositions; static std::map sRootrotations; static LLXmlImportOptions* sXmlImportOptions; static int sTotalAssets; static int sUploadedAssets; static std::map sTextureReplace; }; #endif //