Update svn properties, formatting cleanup.

This commit is contained in:
Jeff Ames
2008-09-09 01:26:48 +00:00
parent 3e1441afe1
commit fae34bb10c
41 changed files with 838 additions and 831 deletions

View File

@@ -104,13 +104,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
#region Private Methods
/// <summary>
/// Check if an entitybase list (like that returned by scene.GetEntities() ) contains a group with the rootpart uuid that matches the current uuid.
/// Check if an entitybase list (like that returned by scene.GetEntities()) contains a group with the rootpart uuid that matches the current uuid.
/// </summary>
private bool ContainsKey(List<EntityBase> list, UUID uuid)
{
foreach( EntityBase part in list)
if (part.UUID == uuid)
return true;
foreach (EntityBase part in list)
if (part.UUID == uuid)
return true;
return false;
}
@@ -118,9 +118,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{
foreach (EntityBase ent in list)
{
if (ent is SceneObjectGroup)
if (ent.UUID == uuid)
return (SceneObjectGroup)ent;
if (ent is SceneObjectGroup)
if (ent.UUID == uuid)
return (SceneObjectGroup)ent;
}
return null;
}
@@ -138,49 +138,49 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
System.Collections.Generic.List<EntityBase> sceneEntityList = m_Entity.Scene.GetEntities();
DiffersFromSceneGroup = false;
// if group is not contained in scene's list
if(!ContainsKey(sceneEntityList, m_UnchangedEntity.UUID))
if (!ContainsKey(sceneEntityList, m_UnchangedEntity.UUID))
{
foreach(SceneObjectPart part in m_UnchangedEntity.Children.Values)
{
// if scene list no longer contains this part, display translucent part and mark with red aura
if(! ContainsKey(sceneEntityList, part.UUID))
{
// if already displaying a red aura over part, make sure its red
if (m_AuraEntities.ContainsKey(part.UUID))
{
m_AuraEntities[part.UUID].SetAura(new Vector3(254,0,0), part.Scale);
}
else
{
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(),
part.GetWorldPosition(),
MetaEntity.TRANSLUCENT,
new Vector3(254,0,0),
part.Scale
);
m_AuraEntities.Add(part.UUID, auraGroup);
}
SceneObjectPart metaPart = m_Entity.GetLinkNumPart(part.LinkNum);
SetPartTransparency(metaPart, MetaEntity.TRANSLUCENT);
}
// otherwise, scene will not contain the part. note: a group can not remove a part without changing group id
}
// a deleted part has no where to point a beam particle system,
// if a metapart had a particle system (maybe it represented a moved part) remove it
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
{
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
}
DiffersFromSceneGroup = true;
foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values)
{
// if scene list no longer contains this part, display translucent part and mark with red aura
if (!ContainsKey(sceneEntityList, part.UUID))
{
// if already displaying a red aura over part, make sure its red
if (m_AuraEntities.ContainsKey(part.UUID))
{
m_AuraEntities[part.UUID].SetAura(new Vector3(254,0,0), part.Scale);
}
else
{
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(),
part.GetWorldPosition(),
MetaEntity.TRANSLUCENT,
new Vector3(254,0,0),
part.Scale
);
m_AuraEntities.Add(part.UUID, auraGroup);
}
SceneObjectPart metaPart = m_Entity.GetLinkNumPart(part.LinkNum);
SetPartTransparency(metaPart, MetaEntity.TRANSLUCENT);
}
// otherwise, scene will not contain the part. note: a group can not remove a part without changing group id
}
// a deleted part has no where to point a beam particle system,
// if a metapart had a particle system (maybe it represented a moved part) remove it
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
{
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
}
DiffersFromSceneGroup = true;
}
// if scene list does contain group, compare each part in group for differences and display beams and auras appropriately
else
else
{
MarkWithDifferences((SceneObjectGroup)GetGroupByUUID(sceneEntityList, m_UnchangedEntity.UUID));
MarkWithDifferences((SceneObjectGroup)GetGroupByUUID(sceneEntityList, m_UnchangedEntity.UUID));
}
}
@@ -190,7 +190,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public bool HasChildPrim(UUID uuid)
{
if (m_UnchangedEntity.Children.ContainsKey(uuid))
return true;
return true;
return false;
}
@@ -199,28 +199,28 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
/// </summary>
public bool HasChildPrim(uint localID)
{
foreach( SceneObjectPart part in m_UnchangedEntity.Children.Values)
if ( part.LocalId == localID )
return true;
foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values)
if (part.LocalId == localID)
return true;
return false;
}
public override void Hide(IClientAPI client)
{
base.Hide(client);
foreach(MetaEntity group in m_AuraEntities.Values)
group.Hide(client);
foreach(MetaEntity group in m_BeamEntities.Values)
group.Hide(client);
foreach (MetaEntity group in m_AuraEntities.Values)
group.Hide(client);
foreach (MetaEntity group in m_BeamEntities.Values)
group.Hide(client);
}
public override void HideFromAll()
{
base.HideFromAll();
foreach(MetaEntity group in m_AuraEntities.Values)
group.HideFromAll();
foreach(MetaEntity group in m_BeamEntities.Values)
group.HideFromAll();
foreach (MetaEntity group in m_AuraEntities.Values)
group.HideFromAll();
foreach (MetaEntity group in m_BeamEntities.Values)
group.HideFromAll();
}
/// <summary>
@@ -234,92 +234,92 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
Diff differences;
bool changed = false;
// Use "UnchangedEntity" to do comparisons because its text, transparency, and other attributes will be just as the user
// Use "UnchangedEntity" to do comparisons because its text, transparency, and other attributes will be just as the user
// had originally saved.
// m_Entity will NOT necessarily be the same entity as the user had saved.
foreach(SceneObjectPart UnchangedPart in m_UnchangedEntity.Children.Values)
foreach (SceneObjectPart UnchangedPart in m_UnchangedEntity.Children.Values)
{
//This is the part that we use to show changes.
metaEntityPart = m_Entity.GetLinkNumPart(UnchangedPart.LinkNum);
if (sceneEntityGroup.Children.ContainsKey(UnchangedPart.UUID))
{
sceneEntityPart = sceneEntityGroup.Children[UnchangedPart.UUID];
differences = Difference.FindDifferences(UnchangedPart, sceneEntityPart);
if (differences != Diff.NONE)
metaEntityPart.Text = "CHANGE: " + differences.ToString();
if (differences != 0)
{
// Root Part that has been modified
if ((differences&Diff.POSITION) > 0)
{
// If the position of any part has changed, make sure the RootPart of the
// meta entity is pointing with a beam particle system
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
{
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
}
BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(),
m_UnchangedEntity.RootPart.GetWorldPosition(),
MetaEntity.TRANSLUCENT,
sceneEntityPart,
new Vector3(0,0,254)
);
m_BeamEntities.Add(m_UnchangedEntity.RootPart.UUID, beamGroup);
}
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
{
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
m_AuraEntities.Remove(UnchangedPart.UUID);
}
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(),
UnchangedPart.GetWorldPosition(),
MetaEntity.TRANSLUCENT,
new Vector3(0,0,254),
UnchangedPart.Scale
);
m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
DiffersFromSceneGroup = true;
}
else // no differences between scene part and meta part
{
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
{
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
}
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
{
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
m_AuraEntities.Remove(UnchangedPart.UUID);
}
SetPartTransparency(metaEntityPart, MetaEntity.NONE);
}
}
else //The entity currently in the scene is missing parts from the metaentity saved, so mark parts red as deleted.
{
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
{
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
m_AuraEntities.Remove(UnchangedPart.UUID);
}
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(),
UnchangedPart.GetWorldPosition(),
MetaEntity.TRANSLUCENT,
new Vector3(254,0,0),
UnchangedPart.Scale
);
m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
DiffersFromSceneGroup = true;
}
//This is the part that we use to show changes.
metaEntityPart = m_Entity.GetLinkNumPart(UnchangedPart.LinkNum);
if (sceneEntityGroup.Children.ContainsKey(UnchangedPart.UUID))
{
sceneEntityPart = sceneEntityGroup.Children[UnchangedPart.UUID];
differences = Difference.FindDifferences(UnchangedPart, sceneEntityPart);
if (differences != Diff.NONE)
metaEntityPart.Text = "CHANGE: " + differences.ToString();
if (differences != 0)
{
// Root Part that has been modified
if ((differences&Diff.POSITION) > 0)
{
// If the position of any part has changed, make sure the RootPart of the
// meta entity is pointing with a beam particle system
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
{
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
}
BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(),
m_UnchangedEntity.RootPart.GetWorldPosition(),
MetaEntity.TRANSLUCENT,
sceneEntityPart,
new Vector3(0,0,254)
);
m_BeamEntities.Add(m_UnchangedEntity.RootPart.UUID, beamGroup);
}
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
{
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
m_AuraEntities.Remove(UnchangedPart.UUID);
}
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(),
UnchangedPart.GetWorldPosition(),
MetaEntity.TRANSLUCENT,
new Vector3(0,0,254),
UnchangedPart.Scale
);
m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
DiffersFromSceneGroup = true;
}
else // no differences between scene part and meta part
{
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
{
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
}
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
{
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
m_AuraEntities.Remove(UnchangedPart.UUID);
}
SetPartTransparency(metaEntityPart, MetaEntity.NONE);
}
}
else //The entity currently in the scene is missing parts from the metaentity saved, so mark parts red as deleted.
{
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
{
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
m_AuraEntities.Remove(UnchangedPart.UUID);
}
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(),
UnchangedPart.GetWorldPosition(),
MetaEntity.TRANSLUCENT,
new Vector3(254,0,0),
UnchangedPart.Scale
);
m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
DiffersFromSceneGroup = true;
}
}
return changed;
}
@@ -328,8 +328,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{
if (DiffersFromSceneGroup)
{
foreach(AuraMetaEntity group in m_AuraEntities.Values)
group.SendFullUpdate(client);
foreach (AuraMetaEntity group in m_AuraEntities.Values)
group.SendFullUpdate(client);
}
}
@@ -337,8 +337,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{
if (DiffersFromSceneGroup)
{
foreach(AuraMetaEntity group in m_AuraEntities.Values)
group.SendFullUpdateToAll();
foreach (AuraMetaEntity group in m_AuraEntities.Values)
group.SendFullUpdateToAll();
}
}
@@ -346,8 +346,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{
if (DiffersFromSceneGroup)
{
foreach(BeamMetaEntity group in m_BeamEntities.Values)
group.SendFullUpdate(client);
foreach (BeamMetaEntity group in m_BeamEntities.Values)
group.SendFullUpdate(client);
}
}
@@ -355,8 +355,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{
if (DiffersFromSceneGroup)
{
foreach(BeamMetaEntity group in m_BeamEntities.Values)
group.SendFullUpdateToAll();
foreach (BeamMetaEntity group in m_BeamEntities.Values)
group.SendFullUpdateToAll();
}
}
@@ -365,9 +365,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
FindDifferences();
if (DiffersFromSceneGroup)
{
SendFullUpdate(client);
SendFullAuraUpdate(client);
SendFullBeamUpdate(client);
SendFullUpdate(client);
SendFullAuraUpdate(client);
SendFullBeamUpdate(client);
}
}
@@ -376,9 +376,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
FindDifferences();
if (DiffersFromSceneGroup)
{
SendFullUpdateToAll();
SendFullAuraUpdateToAll();
SendFullBeamUpdateToAll();
SendFullUpdateToAll();
SendFullAuraUpdateToAll();
SendFullBeamUpdateToAll();
}
}