aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-03-31 01:52:06 +0100
committerJustin Clark-Casey (justincc)2012-03-31 01:52:06 +0100
commit32a953fed727fdadd65228b7c9282091da3521ac (patch)
tree014a128df31336fddcb9be1243f3f255f7d30b6f /OpenSim
parentRename SOG.HasChildPrim(uint) to SOG.ContainsPart(uint) to match existing Con... (diff)
downloadopensim-SC-32a953fed727fdadd65228b7c9282091da3521ac.zip
opensim-SC-32a953fed727fdadd65228b7c9282091da3521ac.tar.gz
opensim-SC-32a953fed727fdadd65228b7c9282091da3521ac.tar.bz2
opensim-SC-32a953fed727fdadd65228b7c9282091da3521ac.tar.xz
refactor: Rename SOG.GetChildPart() to GetPart() since it can also return the 'root' part.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs40
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs2
-rw-r--r--OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs2
7 files changed, 31 insertions, 31 deletions
diff --git a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
index ab8e1bf..f5f35bb 100644
--- a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
+++ b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Vegetation
79 } 79 }
80 80
81 SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); 81 SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
82 SceneObjectPart rootPart = sceneObject.GetChildPart(sceneObject.UUID); 82 SceneObjectPart rootPart = sceneObject.GetPart(sceneObject.UUID);
83 83
84 // if grass or tree, make phantom 84 // if grass or tree, make phantom
85 //rootPart.TrimPermissions(); 85 //rootPart.TrimPermissions();
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index fc61571..06f7c0f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1833,7 +1833,7 @@ namespace OpenSim.Region.Framework.Scenes
1833 { 1833 {
1834 AddRestoredSceneObject(group, true, true); 1834 AddRestoredSceneObject(group, true, true);
1835 EventManager.TriggerOnSceneObjectLoaded(group); 1835 EventManager.TriggerOnSceneObjectLoaded(group);
1836 SceneObjectPart rootPart = group.GetChildPart(group.UUID); 1836 SceneObjectPart rootPart = group.GetPart(group.UUID);
1837 rootPart.Flags &= ~PrimFlags.Scripted; 1837 rootPart.Flags &= ~PrimFlags.Scripted;
1838 rootPart.TrimPermissions(); 1838 rootPart.TrimPermissions();
1839 1839
@@ -4174,7 +4174,7 @@ namespace OpenSim.Region.Framework.Scenes
4174 { 4174 {
4175 if (ent is SceneObjectGroup) 4175 if (ent is SceneObjectGroup)
4176 { 4176 {
4177 SceneObjectPart part = ((SceneObjectGroup)ent).GetChildPart(((SceneObjectGroup)ent).UUID); 4177 SceneObjectPart part = ((SceneObjectGroup)ent).GetPart(((SceneObjectGroup)ent).UUID);
4178 if (part != null) 4178 if (part != null)
4179 { 4179 {
4180 if (part.Name == cmdparams[2]) 4180 if (part.Name == cmdparams[2])
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index cd1366c..8a05772 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1015,7 +1015,7 @@ namespace OpenSim.Region.Framework.Scenes
1015 SceneObjectGroup group = GetGroupByPrim(localID); 1015 SceneObjectGroup group = GetGroupByPrim(localID);
1016 if (group == null) 1016 if (group == null)
1017 return null; 1017 return null;
1018 return group.GetChildPart(localID); 1018 return group.GetPart(localID);
1019 } 1019 }
1020 1020
1021 /// <summary> 1021 /// <summary>
@@ -1062,7 +1062,7 @@ namespace OpenSim.Region.Framework.Scenes
1062 SceneObjectGroup group = GetGroupByPrim(fullID); 1062 SceneObjectGroup group = GetGroupByPrim(fullID);
1063 if (group == null) 1063 if (group == null)
1064 return null; 1064 return null;
1065 return group.GetChildPart(fullID); 1065 return group.GetPart(fullID);
1066 } 1066 }
1067 1067
1068 /// <summary> 1068 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index a73d9b6..10012d0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -96,7 +96,7 @@ namespace OpenSim.Region.Framework.Scenes
96 96
97 UUID newItemId = (copyItemID != UUID.Zero) ? copyItemID : item.ID; 97 UUID newItemId = (copyItemID != UUID.Zero) ? copyItemID : item.ID;
98 98
99 SceneObjectPart part = GetChildPart(localID); 99 SceneObjectPart part = GetPart(localID);
100 if (part != null) 100 if (part != null)
101 { 101 {
102 TaskInventoryItem taskItem = new TaskInventoryItem(); 102 TaskInventoryItem taskItem = new TaskInventoryItem();
@@ -170,7 +170,7 @@ namespace OpenSim.Region.Framework.Scenes
170 /// <returns>null if the item does not exist</returns> 170 /// <returns>null if the item does not exist</returns>
171 public TaskInventoryItem GetInventoryItem(uint primID, UUID itemID) 171 public TaskInventoryItem GetInventoryItem(uint primID, UUID itemID)
172 { 172 {
173 SceneObjectPart part = GetChildPart(primID); 173 SceneObjectPart part = GetPart(primID);
174 if (part != null) 174 if (part != null)
175 { 175 {
176 return part.Inventory.GetInventoryItem(itemID); 176 return part.Inventory.GetInventoryItem(itemID);
@@ -194,7 +194,7 @@ namespace OpenSim.Region.Framework.Scenes
194 /// <returns>false if the item did not exist, true if the update occurred succesfully</returns> 194 /// <returns>false if the item did not exist, true if the update occurred succesfully</returns>
195 public bool UpdateInventoryItem(TaskInventoryItem item) 195 public bool UpdateInventoryItem(TaskInventoryItem item)
196 { 196 {
197 SceneObjectPart part = GetChildPart(item.ParentPartID); 197 SceneObjectPart part = GetPart(item.ParentPartID);
198 if (part != null) 198 if (part != null)
199 { 199 {
200 part.Inventory.UpdateInventoryItem(item); 200 part.Inventory.UpdateInventoryItem(item);
@@ -214,7 +214,7 @@ namespace OpenSim.Region.Framework.Scenes
214 214
215 public int RemoveInventoryItem(uint localID, UUID itemID) 215 public int RemoveInventoryItem(uint localID, UUID itemID)
216 { 216 {
217 SceneObjectPart part = GetChildPart(localID); 217 SceneObjectPart part = GetPart(localID);
218 if (part != null) 218 if (part != null)
219 { 219 {
220 int type = part.Inventory.RemoveInventoryItem(itemID); 220 int type = part.Inventory.RemoveInventoryItem(itemID);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 9d16beb..04b3766 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1127,7 +1127,7 @@ namespace OpenSim.Region.Framework.Scenes
1127 1127
1128 public UUID GetPartsFullID(uint localID) 1128 public UUID GetPartsFullID(uint localID)
1129 { 1129 {
1130 SceneObjectPart part = GetChildPart(localID); 1130 SceneObjectPart part = GetPart(localID);
1131 if (part != null) 1131 if (part != null)
1132 { 1132 {
1133 return part.UUID; 1133 return part.UUID;
@@ -1143,7 +1143,7 @@ namespace OpenSim.Region.Framework.Scenes
1143 } 1143 }
1144 else 1144 else
1145 { 1145 {
1146 SceneObjectPart part = GetChildPart(localId); 1146 SceneObjectPart part = GetPart(localId);
1147 OnGrabPart(part, offsetPos, remoteClient); 1147 OnGrabPart(part, offsetPos, remoteClient);
1148 } 1148 }
1149 } 1149 }
@@ -1904,8 +1904,8 @@ namespace OpenSim.Region.Framework.Scenes
1904 /// Get a part with a given UUID 1904 /// Get a part with a given UUID
1905 /// </summary> 1905 /// </summary>
1906 /// <param name="primID"></param> 1906 /// <param name="primID"></param>
1907 /// <returns>null if a child part with the primID was not found</returns> 1907 /// <returns>null if a part with the primID was not found</returns>
1908 public SceneObjectPart GetChildPart(UUID primID) 1908 public SceneObjectPart GetPart(UUID primID)
1909 { 1909 {
1910 SceneObjectPart childPart; 1910 SceneObjectPart childPart;
1911 m_parts.TryGetValue(primID, out childPart); 1911 m_parts.TryGetValue(primID, out childPart);
@@ -1916,8 +1916,8 @@ namespace OpenSim.Region.Framework.Scenes
1916 /// Get a part with a given local ID 1916 /// Get a part with a given local ID
1917 /// </summary> 1917 /// </summary>
1918 /// <param name="localID"></param> 1918 /// <param name="localID"></param>
1919 /// <returns>null if a child part with the local ID was not found</returns> 1919 /// <returns>null if a part with the local ID was not found</returns>
1920 public SceneObjectPart GetChildPart(uint localID) 1920 public SceneObjectPart GetPart(uint localID)
1921 { 1921 {
1922 SceneObjectPart[] parts = m_parts.GetArray(); 1922 SceneObjectPart[] parts = m_parts.GetArray();
1923 for (int i = 0; i < parts.Length; i++) 1923 for (int i = 0; i < parts.Length; i++)
@@ -2035,7 +2035,7 @@ namespace OpenSim.Region.Framework.Scenes
2035 /// <returns>The object group of the newly delinked prim. Null if part could not be found</returns> 2035 /// <returns>The object group of the newly delinked prim. Null if part could not be found</returns>
2036 public SceneObjectGroup DelinkFromGroup(uint partID, bool sendEvents) 2036 public SceneObjectGroup DelinkFromGroup(uint partID, bool sendEvents)
2037 { 2037 {
2038 SceneObjectPart linkPart = GetChildPart(partID); 2038 SceneObjectPart linkPart = GetPart(partID);
2039 2039
2040 if (linkPart != null) 2040 if (linkPart != null)
2041 { 2041 {
@@ -2326,7 +2326,7 @@ namespace OpenSim.Region.Framework.Scenes
2326 /// <param name="localID"></param> 2326 /// <param name="localID"></param>
2327 public void SetPartName(string name, uint localID) 2327 public void SetPartName(string name, uint localID)
2328 { 2328 {
2329 SceneObjectPart part = GetChildPart(localID); 2329 SceneObjectPart part = GetPart(localID);
2330 if (part != null) 2330 if (part != null)
2331 { 2331 {
2332 part.Name = name; 2332 part.Name = name;
@@ -2335,7 +2335,7 @@ namespace OpenSim.Region.Framework.Scenes
2335 2335
2336 public void SetPartDescription(string des, uint localID) 2336 public void SetPartDescription(string des, uint localID)
2337 { 2337 {
2338 SceneObjectPart part = GetChildPart(localID); 2338 SceneObjectPart part = GetPart(localID);
2339 if (part != null) 2339 if (part != null)
2340 { 2340 {
2341 part.Description = des; 2341 part.Description = des;
@@ -2344,7 +2344,7 @@ namespace OpenSim.Region.Framework.Scenes
2344 2344
2345 public void SetPartText(string text, uint localID) 2345 public void SetPartText(string text, uint localID)
2346 { 2346 {
2347 SceneObjectPart part = GetChildPart(localID); 2347 SceneObjectPart part = GetPart(localID);
2348 if (part != null) 2348 if (part != null)
2349 { 2349 {
2350 part.SetText(text); 2350 part.SetText(text);
@@ -2353,7 +2353,7 @@ namespace OpenSim.Region.Framework.Scenes
2353 2353
2354 public void SetPartText(string text, UUID partID) 2354 public void SetPartText(string text, UUID partID)
2355 { 2355 {
2356 SceneObjectPart part = GetChildPart(partID); 2356 SceneObjectPart part = GetPart(partID);
2357 if (part != null) 2357 if (part != null)
2358 { 2358 {
2359 part.SetText(text); 2359 part.SetText(text);
@@ -2362,7 +2362,7 @@ namespace OpenSim.Region.Framework.Scenes
2362 2362
2363 public string GetPartName(uint localID) 2363 public string GetPartName(uint localID)
2364 { 2364 {
2365 SceneObjectPart part = GetChildPart(localID); 2365 SceneObjectPart part = GetPart(localID);
2366 if (part != null) 2366 if (part != null)
2367 { 2367 {
2368 return part.Name; 2368 return part.Name;
@@ -2372,7 +2372,7 @@ namespace OpenSim.Region.Framework.Scenes
2372 2372
2373 public string GetPartDescription(uint localID) 2373 public string GetPartDescription(uint localID)
2374 { 2374 {
2375 SceneObjectPart part = GetChildPart(localID); 2375 SceneObjectPart part = GetPart(localID);
2376 if (part != null) 2376 if (part != null)
2377 { 2377 {
2378 return part.Description; 2378 return part.Description;
@@ -2390,7 +2390,7 @@ namespace OpenSim.Region.Framework.Scenes
2390 /// <param name="SetVolumeDetect"></param> 2390 /// <param name="SetVolumeDetect"></param>
2391 public void UpdatePrimFlags(uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, bool SetVolumeDetect) 2391 public void UpdatePrimFlags(uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, bool SetVolumeDetect)
2392 { 2392 {
2393 SceneObjectPart selectionPart = GetChildPart(localID); 2393 SceneObjectPart selectionPart = GetPart(localID);
2394 2394
2395 if (SetTemporary && Scene != null) 2395 if (SetTemporary && Scene != null)
2396 { 2396 {
@@ -2427,7 +2427,7 @@ namespace OpenSim.Region.Framework.Scenes
2427 2427
2428 public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data) 2428 public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data)
2429 { 2429 {
2430 SceneObjectPart part = GetChildPart(localID); 2430 SceneObjectPart part = GetPart(localID);
2431 if (part != null) 2431 if (part != null)
2432 { 2432 {
2433 part.UpdateExtraParam(type, inUse, data); 2433 part.UpdateExtraParam(type, inUse, data);
@@ -2441,7 +2441,7 @@ namespace OpenSim.Region.Framework.Scenes
2441 /// <param name="textureEntry"></param> 2441 /// <param name="textureEntry"></param>
2442 public void UpdateTextureEntry(uint localID, byte[] textureEntry) 2442 public void UpdateTextureEntry(uint localID, byte[] textureEntry)
2443 { 2443 {
2444 SceneObjectPart part = GetChildPart(localID); 2444 SceneObjectPart part = GetPart(localID);
2445 if (part != null) 2445 if (part != null)
2446 { 2446 {
2447 part.UpdateTextureEntry(textureEntry); 2447 part.UpdateTextureEntry(textureEntry);
@@ -2473,7 +2473,7 @@ namespace OpenSim.Region.Framework.Scenes
2473 /// <param name="shapeBlock"></param> 2473 /// <param name="shapeBlock"></param>
2474 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID) 2474 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
2475 { 2475 {
2476 SceneObjectPart part = GetChildPart(localID); 2476 SceneObjectPart part = GetPart(localID);
2477 if (part != null) 2477 if (part != null)
2478 { 2478 {
2479 part.UpdateShape(shapeBlock); 2479 part.UpdateShape(shapeBlock);
@@ -2685,7 +2685,7 @@ namespace OpenSim.Region.Framework.Scenes
2685 /// <param name="localID"></param> 2685 /// <param name="localID"></param>
2686 public void UpdateSinglePosition(Vector3 pos, uint localID) 2686 public void UpdateSinglePosition(Vector3 pos, uint localID)
2687 { 2687 {
2688 SceneObjectPart part = GetChildPart(localID); 2688 SceneObjectPart part = GetPart(localID);
2689 2689
2690// SceneObjectPart[] parts = m_parts.GetArray(); 2690// SceneObjectPart[] parts = m_parts.GetArray();
2691// for (int i = 0; i < parts.Length; i++) 2691// for (int i = 0; i < parts.Length; i++)
@@ -2824,7 +2824,7 @@ namespace OpenSim.Region.Framework.Scenes
2824 /// <param name="localID"></param> 2824 /// <param name="localID"></param>
2825 public void UpdateSingleRotation(Quaternion rot, uint localID) 2825 public void UpdateSingleRotation(Quaternion rot, uint localID)
2826 { 2826 {
2827 SceneObjectPart part = GetChildPart(localID); 2827 SceneObjectPart part = GetPart(localID);
2828 2828
2829 SceneObjectPart[] parts = m_parts.GetArray(); 2829 SceneObjectPart[] parts = m_parts.GetArray();
2830 for (int i = 0; i < parts.Length; i++) 2830 for (int i = 0; i < parts.Length; i++)
@@ -2853,7 +2853,7 @@ namespace OpenSim.Region.Framework.Scenes
2853 /// <param name="localID"></param> 2853 /// <param name="localID"></param>
2854 public void UpdateSingleRotation(Quaternion rot, Vector3 pos, uint localID) 2854 public void UpdateSingleRotation(Quaternion rot, Vector3 pos, uint localID)
2855 { 2855 {
2856 SceneObjectPart part = GetChildPart(localID); 2856 SceneObjectPart part = GetPart(localID);
2857 if (part != null) 2857 if (part != null)
2858 { 2858 {
2859// m_log.DebugFormat( 2859// m_log.DebugFormat(
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 71a9084..f7e123b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -623,7 +623,7 @@ namespace OpenSim.Region.Framework.Scenes
623 623
624 group.ResetIDs(); 624 group.ResetIDs();
625 625
626 SceneObjectPart rootPart = group.GetChildPart(group.UUID); 626 SceneObjectPart rootPart = group.GetPart(group.UUID);
627 627
628 // Since renaming the item in the inventory does not affect the name stored 628 // Since renaming the item in the inventory does not affect the name stored
629 // in the serialization, transfer the correct name from the inventory to the 629 // in the serialization, transfer the correct name from the inventory to the
diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
index a17eb41..51b0592 100644
--- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
+++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
@@ -510,7 +510,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
510 } 510 }
511 511
512 SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); 512 SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
513 SceneObjectPart rootPart = sceneObject.GetChildPart(sceneObject.UUID); 513 SceneObjectPart rootPart = sceneObject.GetPart(sceneObject.UUID);
514 514
515 rootPart.AddFlag(PrimFlags.Phantom); 515 rootPart.AddFlag(PrimFlags.Phantom);
516 516