aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/primbackup.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/primbackup.h134
1 files changed, 134 insertions, 0 deletions
diff --git a/linden/indra/newview/primbackup.h b/linden/indra/newview/primbackup.h
new file mode 100644
index 0000000..cbd757a
--- /dev/null
+++ b/linden/indra/newview/primbackup.h
@@ -0,0 +1,134 @@
1
2#include "llviewerinventory.h"
3
4#define LL_GRID_PERMISSIONS 1
5
6enum export_states {EXPORT_INIT,EXPORT_STRUCTURE,EXPORT_TEXTURES,EXPORT_LLSD,EXPORT_DONE};
7
8class primbackup : public LLFloater
9
10{
11 public:
12 //Export state machine
13 enum export_states export_state;
14
15 //Export idle callback
16 static void exportworker(void *userdata);
17
18 //Static accessor
19 static primbackup* getInstance();
20
21 static bool check_perms( LLSelectNode* node );
22
23 virtual ~primbackup();
24
25 //Floater stuff
26 virtual void show();
27 virtual void draw();
28 virtual void onClose( bool app_quitting );
29
30 //Import entry point
31 void import_object(bool upload=FALSE);
32
33 //Export entry point
34 void pre_export_object();
35
36 //Update map from texture worker
37 void update_map(LLUUID uploaded_asset);
38
39 //Move to next texture upload
40 void upload_next_asset();
41
42 // is ready for next texture?
43 bool m_nexttextureready;
44
45 //Folder public geter
46 std::string getfolder() {return folder;};
47
48 //Prim updated callback
49 void prim_update(LLViewerObject* object);
50
51 //New prim call back
52 bool newprim(LLViewerObject * pobject);
53
54private:
55
56 //Static singleton stuff
57 primbackup();
58 static primbackup* sInstance;
59
60 // are we active flag
61 bool running;
62
63 //file and folder name control
64 std::string file_name;
65 std::string folder;
66
67 // True if we need to rebase the assets
68 bool m_retexture;
69
70 //Counts of import and export objects and textures and prims
71 int m_objects,m_curobject;
72 int m_prims,m_curprim;
73 int m_textures,m_curtexture;
74
75 // No prims rezed
76 int rezcount;
77
78 // Update the floater with status numbers
79 void updateimportnumbers();
80 void updateexportnumbers();
81
82 //Convert a selection list of objects to LLSD
83 LLSD prims_to_llsd(LLViewerObject::child_list_t child_list);
84
85 // Start the import process
86 void import_object1a();
87
88 //Export the next texture in list
89 void export_next_texture();
90
91 //apply LLSD to object
92 void xmltoprim(LLSD prim_llsd,LLViewerObject * pobject);
93
94
95 //rez a prim at a given position (note not agent offset X/Y screen for raycast)
96 void rez_agent_offset(LLVector3 offset);
97
98 //Move to the next import group
99 void import_next_object();
100
101 //Get an offset from the agent based on rotation and current pos
102 LLVector3 offset_agent(LLVector3 offset);
103
104 // Rebase map
105 std::map<LLUUID,LLUUID> assetmap;
106
107 //Export texture list
108 std::list<LLUUID> textures;
109
110 //Import object tracking
111 std::vector<LLViewerObject *> toselect;
112 std::vector<LLViewerObject *>::iterator process_iter;
113
114 //Working LLSD holders
115 LLUUID current_asset;
116 LLSD llsd;
117 LLSD this_group;
118 LLUUID expecting_update;
119
120 //working llsd itterators for objects and linksets
121 LLSD::map_const_iterator prim_import_iter;
122 LLSD::array_const_iterator group_prim_import_iter;
123
124 // Root pos and central root pos for link set
125 LLVector3 root_pos;
126 LLVector3 root_root_pos;
127 LLVector3 group_offset;
128
129 //Agent inital pos and rot when starting import
130 LLQuaternion root_rot;
131 LLQuaternion agent_rot;
132
133};
134