aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs
diff options
context:
space:
mode:
authorJeff Ames2008-09-09 01:26:48 +0000
committerJeff Ames2008-09-09 01:26:48 +0000
commitfae34bb10cfa10702faf5c19d8c8517faa018cb5 (patch)
tree2001f24703b010957254dbb49ef5e222ff30b84d /OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs
parentFix state xxx within state xxx itself triggering a state "change" to (diff)
downloadopensim-SC-fae34bb10cfa10702faf5c19d8c8517faa018cb5.zip
opensim-SC-fae34bb10cfa10702faf5c19d8c8517faa018cb5.tar.gz
opensim-SC-fae34bb10cfa10702faf5c19d8c8517faa018cb5.tar.bz2
opensim-SC-fae34bb10cfa10702faf5c19d8c8517faa018cb5.tar.xz
Update svn properties, formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs310
1 files changed, 155 insertions, 155 deletions
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs
index 819ff87..13f5cc0 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs
@@ -104,13 +104,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
104 #region Private Methods 104 #region Private Methods
105 105
106 /// <summary> 106 /// <summary>
107 /// Check if an entitybase list (like that returned by scene.GetEntities() ) contains a group with the rootpart uuid that matches the current uuid. 107 /// Check if an entitybase list (like that returned by scene.GetEntities()) contains a group with the rootpart uuid that matches the current uuid.
108 /// </summary> 108 /// </summary>
109 private bool ContainsKey(List<EntityBase> list, UUID uuid) 109 private bool ContainsKey(List<EntityBase> list, UUID uuid)
110 { 110 {
111 foreach( EntityBase part in list) 111 foreach (EntityBase part in list)
112 if (part.UUID == uuid) 112 if (part.UUID == uuid)
113 return true; 113 return true;
114 return false; 114 return false;
115 } 115 }
116 116
@@ -118,9 +118,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
118 { 118 {
119 foreach (EntityBase ent in list) 119 foreach (EntityBase ent in list)
120 { 120 {
121 if (ent is SceneObjectGroup) 121 if (ent is SceneObjectGroup)
122 if (ent.UUID == uuid) 122 if (ent.UUID == uuid)
123 return (SceneObjectGroup)ent; 123 return (SceneObjectGroup)ent;
124 } 124 }
125 return null; 125 return null;
126 } 126 }
@@ -138,49 +138,49 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
138 System.Collections.Generic.List<EntityBase> sceneEntityList = m_Entity.Scene.GetEntities(); 138 System.Collections.Generic.List<EntityBase> sceneEntityList = m_Entity.Scene.GetEntities();
139 DiffersFromSceneGroup = false; 139 DiffersFromSceneGroup = false;
140 // if group is not contained in scene's list 140 // if group is not contained in scene's list
141 if(!ContainsKey(sceneEntityList, m_UnchangedEntity.UUID)) 141 if (!ContainsKey(sceneEntityList, m_UnchangedEntity.UUID))
142 { 142 {
143 foreach(SceneObjectPart part in m_UnchangedEntity.Children.Values) 143 foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values)
144 { 144 {
145 // if scene list no longer contains this part, display translucent part and mark with red aura 145 // if scene list no longer contains this part, display translucent part and mark with red aura
146 if(! ContainsKey(sceneEntityList, part.UUID)) 146 if (!ContainsKey(sceneEntityList, part.UUID))
147 { 147 {
148 // if already displaying a red aura over part, make sure its red 148 // if already displaying a red aura over part, make sure its red
149 if (m_AuraEntities.ContainsKey(part.UUID)) 149 if (m_AuraEntities.ContainsKey(part.UUID))
150 { 150 {
151 m_AuraEntities[part.UUID].SetAura(new Vector3(254,0,0), part.Scale); 151 m_AuraEntities[part.UUID].SetAura(new Vector3(254,0,0), part.Scale);
152 } 152 }
153 else 153 else
154 { 154 {
155 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, 155 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
156 m_Entity.Scene.PrimIDAllocate(), 156 m_Entity.Scene.PrimIDAllocate(),
157 part.GetWorldPosition(), 157 part.GetWorldPosition(),
158 MetaEntity.TRANSLUCENT, 158 MetaEntity.TRANSLUCENT,
159 new Vector3(254,0,0), 159 new Vector3(254,0,0),
160 part.Scale 160 part.Scale
161 ); 161 );
162 m_AuraEntities.Add(part.UUID, auraGroup); 162 m_AuraEntities.Add(part.UUID, auraGroup);
163 } 163 }
164 SceneObjectPart metaPart = m_Entity.GetLinkNumPart(part.LinkNum); 164 SceneObjectPart metaPart = m_Entity.GetLinkNumPart(part.LinkNum);
165 SetPartTransparency(metaPart, MetaEntity.TRANSLUCENT); 165 SetPartTransparency(metaPart, MetaEntity.TRANSLUCENT);
166 } 166 }
167 // otherwise, scene will not contain the part. note: a group can not remove a part without changing group id 167 // otherwise, scene will not contain the part. note: a group can not remove a part without changing group id
168 } 168 }
169 169
170 // a deleted part has no where to point a beam particle system, 170 // a deleted part has no where to point a beam particle system,
171 // if a metapart had a particle system (maybe it represented a moved part) remove it 171 // if a metapart had a particle system (maybe it represented a moved part) remove it
172 if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID)) 172 if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
173 { 173 {
174 m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll(); 174 m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
175 m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID); 175 m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
176 } 176 }
177 177
178 DiffersFromSceneGroup = true; 178 DiffersFromSceneGroup = true;
179 } 179 }
180 // if scene list does contain group, compare each part in group for differences and display beams and auras appropriately 180 // if scene list does contain group, compare each part in group for differences and display beams and auras appropriately
181 else 181 else
182 { 182 {
183 MarkWithDifferences((SceneObjectGroup)GetGroupByUUID(sceneEntityList, m_UnchangedEntity.UUID)); 183 MarkWithDifferences((SceneObjectGroup)GetGroupByUUID(sceneEntityList, m_UnchangedEntity.UUID));
184 } 184 }
185 } 185 }
186 186
@@ -190,7 +190,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
190 public bool HasChildPrim(UUID uuid) 190 public bool HasChildPrim(UUID uuid)
191 { 191 {
192 if (m_UnchangedEntity.Children.ContainsKey(uuid)) 192 if (m_UnchangedEntity.Children.ContainsKey(uuid))
193 return true; 193 return true;
194 return false; 194 return false;
195 } 195 }
196 196
@@ -199,28 +199,28 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
199 /// </summary> 199 /// </summary>
200 public bool HasChildPrim(uint localID) 200 public bool HasChildPrim(uint localID)
201 { 201 {
202 foreach( SceneObjectPart part in m_UnchangedEntity.Children.Values) 202 foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values)
203 if ( part.LocalId == localID ) 203 if (part.LocalId == localID)
204 return true; 204 return true;
205 return false; 205 return false;
206 } 206 }
207 207
208 public override void Hide(IClientAPI client) 208 public override void Hide(IClientAPI client)
209 { 209 {
210 base.Hide(client); 210 base.Hide(client);
211 foreach(MetaEntity group in m_AuraEntities.Values) 211 foreach (MetaEntity group in m_AuraEntities.Values)
212 group.Hide(client); 212 group.Hide(client);
213 foreach(MetaEntity group in m_BeamEntities.Values) 213 foreach (MetaEntity group in m_BeamEntities.Values)
214 group.Hide(client); 214 group.Hide(client);
215 } 215 }
216 216
217 public override void HideFromAll() 217 public override void HideFromAll()
218 { 218 {
219 base.HideFromAll(); 219 base.HideFromAll();
220 foreach(MetaEntity group in m_AuraEntities.Values) 220 foreach (MetaEntity group in m_AuraEntities.Values)
221 group.HideFromAll(); 221 group.HideFromAll();
222 foreach(MetaEntity group in m_BeamEntities.Values) 222 foreach (MetaEntity group in m_BeamEntities.Values)
223 group.HideFromAll(); 223 group.HideFromAll();
224 } 224 }
225 225
226 /// <summary> 226 /// <summary>
@@ -234,92 +234,92 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
234 Diff differences; 234 Diff differences;
235 bool changed = false; 235 bool changed = false;
236 236
237 // Use "UnchangedEntity" to do comparisons because its text, transparency, and other attributes will be just as the user 237 // Use "UnchangedEntity" to do comparisons because its text, transparency, and other attributes will be just as the user
238 // had originally saved. 238 // had originally saved.
239 // m_Entity will NOT necessarily be the same entity as the user had saved. 239 // m_Entity will NOT necessarily be the same entity as the user had saved.
240 foreach(SceneObjectPart UnchangedPart in m_UnchangedEntity.Children.Values) 240 foreach (SceneObjectPart UnchangedPart in m_UnchangedEntity.Children.Values)
241 { 241 {
242 //This is the part that we use to show changes. 242 //This is the part that we use to show changes.
243 metaEntityPart = m_Entity.GetLinkNumPart(UnchangedPart.LinkNum); 243 metaEntityPart = m_Entity.GetLinkNumPart(UnchangedPart.LinkNum);
244 if (sceneEntityGroup.Children.ContainsKey(UnchangedPart.UUID)) 244 if (sceneEntityGroup.Children.ContainsKey(UnchangedPart.UUID))
245 { 245 {
246 sceneEntityPart = sceneEntityGroup.Children[UnchangedPart.UUID]; 246 sceneEntityPart = sceneEntityGroup.Children[UnchangedPart.UUID];
247 differences = Difference.FindDifferences(UnchangedPart, sceneEntityPart); 247 differences = Difference.FindDifferences(UnchangedPart, sceneEntityPart);
248 if (differences != Diff.NONE) 248 if (differences != Diff.NONE)
249 metaEntityPart.Text = "CHANGE: " + differences.ToString(); 249 metaEntityPart.Text = "CHANGE: " + differences.ToString();
250 if (differences != 0) 250 if (differences != 0)
251 { 251 {
252 // Root Part that has been modified 252 // Root Part that has been modified
253 if ((differences&Diff.POSITION) > 0) 253 if ((differences&Diff.POSITION) > 0)
254 { 254 {
255 // If the position of any part has changed, make sure the RootPart of the 255 // If the position of any part has changed, make sure the RootPart of the
256 // meta entity is pointing with a beam particle system 256 // meta entity is pointing with a beam particle system
257 if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID)) 257 if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
258 { 258 {
259 m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll(); 259 m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
260 m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID); 260 m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
261 } 261 }
262 BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene, 262 BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene,
263 m_Entity.Scene.PrimIDAllocate(), 263 m_Entity.Scene.PrimIDAllocate(),
264 m_UnchangedEntity.RootPart.GetWorldPosition(), 264 m_UnchangedEntity.RootPart.GetWorldPosition(),
265 MetaEntity.TRANSLUCENT, 265 MetaEntity.TRANSLUCENT,
266 sceneEntityPart, 266 sceneEntityPart,
267 new Vector3(0,0,254) 267 new Vector3(0,0,254)
268 ); 268 );
269 m_BeamEntities.Add(m_UnchangedEntity.RootPart.UUID, beamGroup); 269 m_BeamEntities.Add(m_UnchangedEntity.RootPart.UUID, beamGroup);
270 } 270 }
271 271
272 if (m_AuraEntities.ContainsKey(UnchangedPart.UUID)) 272 if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
273 { 273 {
274 m_AuraEntities[UnchangedPart.UUID].HideFromAll(); 274 m_AuraEntities[UnchangedPart.UUID].HideFromAll();
275 m_AuraEntities.Remove(UnchangedPart.UUID); 275 m_AuraEntities.Remove(UnchangedPart.UUID);
276 } 276 }
277 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, 277 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
278 m_Entity.Scene.PrimIDAllocate(), 278 m_Entity.Scene.PrimIDAllocate(),
279 UnchangedPart.GetWorldPosition(), 279 UnchangedPart.GetWorldPosition(),
280 MetaEntity.TRANSLUCENT, 280 MetaEntity.TRANSLUCENT,
281 new Vector3(0,0,254), 281 new Vector3(0,0,254),
282 UnchangedPart.Scale 282 UnchangedPart.Scale
283 ); 283 );
284 m_AuraEntities.Add(UnchangedPart.UUID, auraGroup); 284 m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
285 SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT); 285 SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
286 286
287 DiffersFromSceneGroup = true; 287 DiffersFromSceneGroup = true;
288 } 288 }
289 else // no differences between scene part and meta part 289 else // no differences between scene part and meta part
290 { 290 {
291 if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID)) 291 if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
292 { 292 {
293 m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll(); 293 m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
294 m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID); 294 m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
295 } 295 }
296 if (m_AuraEntities.ContainsKey(UnchangedPart.UUID)) 296 if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
297 { 297 {
298 m_AuraEntities[UnchangedPart.UUID].HideFromAll(); 298 m_AuraEntities[UnchangedPart.UUID].HideFromAll();
299 m_AuraEntities.Remove(UnchangedPart.UUID); 299 m_AuraEntities.Remove(UnchangedPart.UUID);
300 } 300 }
301 SetPartTransparency(metaEntityPart, MetaEntity.NONE); 301 SetPartTransparency(metaEntityPart, MetaEntity.NONE);
302 } 302 }
303 } 303 }
304 else //The entity currently in the scene is missing parts from the metaentity saved, so mark parts red as deleted. 304 else //The entity currently in the scene is missing parts from the metaentity saved, so mark parts red as deleted.
305 { 305 {
306 if (m_AuraEntities.ContainsKey(UnchangedPart.UUID)) 306 if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
307 { 307 {
308 m_AuraEntities[UnchangedPart.UUID].HideFromAll(); 308 m_AuraEntities[UnchangedPart.UUID].HideFromAll();
309 m_AuraEntities.Remove(UnchangedPart.UUID); 309 m_AuraEntities.Remove(UnchangedPart.UUID);
310 } 310 }
311 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, 311 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
312 m_Entity.Scene.PrimIDAllocate(), 312 m_Entity.Scene.PrimIDAllocate(),
313 UnchangedPart.GetWorldPosition(), 313 UnchangedPart.GetWorldPosition(),
314 MetaEntity.TRANSLUCENT, 314 MetaEntity.TRANSLUCENT,
315 new Vector3(254,0,0), 315 new Vector3(254,0,0),
316 UnchangedPart.Scale 316 UnchangedPart.Scale
317 ); 317 );
318 m_AuraEntities.Add(UnchangedPart.UUID, auraGroup); 318 m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
319 SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT); 319 SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
320 320
321 DiffersFromSceneGroup = true; 321 DiffersFromSceneGroup = true;
322 } 322 }
323 } 323 }
324 return changed; 324 return changed;
325 } 325 }
@@ -328,8 +328,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
328 { 328 {
329 if (DiffersFromSceneGroup) 329 if (DiffersFromSceneGroup)
330 { 330 {
331 foreach(AuraMetaEntity group in m_AuraEntities.Values) 331 foreach (AuraMetaEntity group in m_AuraEntities.Values)
332 group.SendFullUpdate(client); 332 group.SendFullUpdate(client);
333 } 333 }
334 } 334 }
335 335
@@ -337,8 +337,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
337 { 337 {
338 if (DiffersFromSceneGroup) 338 if (DiffersFromSceneGroup)
339 { 339 {
340 foreach(AuraMetaEntity group in m_AuraEntities.Values) 340 foreach (AuraMetaEntity group in m_AuraEntities.Values)
341 group.SendFullUpdateToAll(); 341 group.SendFullUpdateToAll();
342 } 342 }
343 } 343 }
344 344
@@ -346,8 +346,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
346 { 346 {
347 if (DiffersFromSceneGroup) 347 if (DiffersFromSceneGroup)
348 { 348 {
349 foreach(BeamMetaEntity group in m_BeamEntities.Values) 349 foreach (BeamMetaEntity group in m_BeamEntities.Values)
350 group.SendFullUpdate(client); 350 group.SendFullUpdate(client);
351 } 351 }
352 } 352 }
353 353
@@ -355,8 +355,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
355 { 355 {
356 if (DiffersFromSceneGroup) 356 if (DiffersFromSceneGroup)
357 { 357 {
358 foreach(BeamMetaEntity group in m_BeamEntities.Values) 358 foreach (BeamMetaEntity group in m_BeamEntities.Values)
359 group.SendFullUpdateToAll(); 359 group.SendFullUpdateToAll();
360 } 360 }
361 } 361 }
362 362
@@ -365,9 +365,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
365 FindDifferences(); 365 FindDifferences();
366 if (DiffersFromSceneGroup) 366 if (DiffersFromSceneGroup)
367 { 367 {
368 SendFullUpdate(client); 368 SendFullUpdate(client);
369 SendFullAuraUpdate(client); 369 SendFullAuraUpdate(client);
370 SendFullBeamUpdate(client); 370 SendFullBeamUpdate(client);
371 } 371 }
372 } 372 }
373 373
@@ -376,9 +376,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
376 FindDifferences(); 376 FindDifferences();
377 if (DiffersFromSceneGroup) 377 if (DiffersFromSceneGroup)
378 { 378 {
379 SendFullUpdateToAll(); 379 SendFullUpdateToAll();
380 SendFullAuraUpdateToAll(); 380 SendFullAuraUpdateToAll();
381 SendFullBeamUpdateToAll(); 381 SendFullBeamUpdateToAll();
382 } 382 }
383 } 383 }
384 384