diff options
author | Justin Clarke Casey | 2008-11-10 20:04:55 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-10 20:04:55 +0000 |
commit | 0e180b0ad30d5f468be1c239865688449b8747cc (patch) | |
tree | 4d442315d268836641cb2b10e6937a0d308bdc18 | |
parent | Removed some debug output I forgot to remove... (diff) | |
download | opensim-SC-0e180b0ad30d5f468be1c239865688449b8747cc.zip opensim-SC-0e180b0ad30d5f468be1c239865688449b8747cc.tar.gz opensim-SC-0e180b0ad30d5f468be1c239865688449b8747cc.tar.bz2 opensim-SC-0e180b0ad30d5f468be1c239865688449b8747cc.tar.xz |
* refactor: Expose SOG.SetRootPart for outsiders to use rather than setting RootPart and adding the part separately
* Make RootPart read only
9 files changed, 19 insertions, 29 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index 6f4edd1..3669bdc 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs | |||
@@ -210,8 +210,8 @@ namespace OpenSim.Data.MSSQL | |||
210 | "No shape found for prim in storage, so setting default box shape"); | 210 | "No shape found for prim in storage, so setting default box shape"); |
211 | prim.Shape = PrimitiveBaseShape.Default; | 211 | prim.Shape = PrimitiveBaseShape.Default; |
212 | } | 212 | } |
213 | group.AddPart(prim); | 213 | |
214 | group.RootPart = prim; | 214 | group.SetRootPart(prim); |
215 | 215 | ||
216 | createdObjects.Add(group.UUID, group); | 216 | createdObjects.Add(group.UUID, group); |
217 | retvals.Add(group); | 217 | retvals.Add(group); |
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index 27bfec8..70940db 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs | |||
@@ -421,8 +421,8 @@ namespace OpenSim.Data.MySQL | |||
421 | "No shape found for prim in storage, so setting default box shape"); | 421 | "No shape found for prim in storage, so setting default box shape"); |
422 | prim.Shape = PrimitiveBaseShape.Default; | 422 | prim.Shape = PrimitiveBaseShape.Default; |
423 | } | 423 | } |
424 | group.AddPart(prim); | 424 | |
425 | group.RootPart = prim; | 425 | group.SetRootPart(prim); |
426 | createdObjects.Add(group.UUID, group); | 426 | createdObjects.Add(group.UUID, group); |
427 | retvals.Add(group); | 427 | retvals.Add(group); |
428 | LoadItems(prim); | 428 | LoadItems(prim); |
diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs index ecb29fe..833f1b7 100644 --- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs +++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs | |||
@@ -195,8 +195,7 @@ namespace OpenSim.Data.NHibernate | |||
195 | // root part | 195 | // root part |
196 | if (p.UUID == uuid) | 196 | if (p.UUID == uuid) |
197 | { | 197 | { |
198 | group.AddPart(p); | 198 | group.SetRootPart(p); |
199 | group.RootPart = p; | ||
200 | } | 199 | } |
201 | else | 200 | else |
202 | { | 201 | { |
@@ -244,8 +243,7 @@ namespace OpenSim.Data.NHibernate | |||
244 | if (p.UUID == p.ParentUUID) | 243 | if (p.UUID == p.ParentUUID) |
245 | { | 244 | { |
246 | SceneObjectGroup group = new SceneObjectGroup(); | 245 | SceneObjectGroup group = new SceneObjectGroup(); |
247 | group.AddPart(p); | 246 | group.SetRootPart(p); |
248 | group.RootPart = p; | ||
249 | SOG.Add(p.ParentUUID, group); | 247 | SOG.Add(p.ParentUUID, group); |
250 | } | 248 | } |
251 | else | 249 | else |
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index 93d9406..cc3ad06 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs | |||
@@ -436,8 +436,8 @@ namespace OpenSim.Data.SQLite | |||
436 | "[REGION DB]: No shape found for prim in storage, so setting default box shape"); | 436 | "[REGION DB]: No shape found for prim in storage, so setting default box shape"); |
437 | prim.Shape = PrimitiveBaseShape.Default; | 437 | prim.Shape = PrimitiveBaseShape.Default; |
438 | } | 438 | } |
439 | group.AddPart(prim); | 439 | |
440 | group.RootPart = prim; | 440 | group.SetRootPart(prim); |
441 | createdObjects.Add(group.UUID, group); | 441 | createdObjects.Add(group.UUID, group); |
442 | retvals.Add(group); | 442 | retvals.Add(group); |
443 | LoadItems(prim); | 443 | LoadItems(prim); |
@@ -1102,8 +1102,7 @@ namespace OpenSim.Data.SQLite | |||
1102 | // sop.TouchName = ""; | 1102 | // sop.TouchName = ""; |
1103 | // sop.UUID = UUID.Random(); | 1103 | // sop.UUID = UUID.Random(); |
1104 | // sop.Shape = PrimitiveBaseShape.Default; | 1104 | // sop.Shape = PrimitiveBaseShape.Default; |
1105 | // sog.AddPart(sop); | 1105 | // sog.SetRootPart(sop); |
1106 | // sog.RootPart = sop; | ||
1107 | // Add breakpoint in above line. Check sop fields. | 1106 | // Add breakpoint in above line. Check sop fields. |
1108 | 1107 | ||
1109 | // TODO: this doesn't work yet because something more | 1108 | // TODO: this doesn't work yet because something more |
diff --git a/OpenSim/Data/Tests/BasicRegionTest.cs b/OpenSim/Data/Tests/BasicRegionTest.cs index 12435c9..ab46ed4 100644 --- a/OpenSim/Data/Tests/BasicRegionTest.cs +++ b/OpenSim/Data/Tests/BasicRegionTest.cs | |||
@@ -315,8 +315,7 @@ namespace OpenSim.Data.Tests | |||
315 | sop.ObjectFlags = 0; | 315 | sop.ObjectFlags = 0; |
316 | 316 | ||
317 | SceneObjectGroup sog = new SceneObjectGroup(); | 317 | SceneObjectGroup sog = new SceneObjectGroup(); |
318 | sog.AddPart(sop); | 318 | sog.SetRootPart(sop); |
319 | sog.RootPart = sop; | ||
320 | 319 | ||
321 | // Inserts group in DB | 320 | // Inserts group in DB |
322 | db.StoreObject(sog,region3); | 321 | db.StoreObject(sog,region3); |
@@ -795,8 +794,7 @@ namespace OpenSim.Data.Tests | |||
795 | sop.Shape = PrimitiveBaseShape.Default; | 794 | sop.Shape = PrimitiveBaseShape.Default; |
796 | 795 | ||
797 | SceneObjectGroup sog = new SceneObjectGroup(); | 796 | SceneObjectGroup sog = new SceneObjectGroup(); |
798 | sog.AddPart(sop); | 797 | sog.SetRootPart(sop); |
799 | sog.RootPart = sop; | ||
800 | return sog; | 798 | return sog; |
801 | } | 799 | } |
802 | 800 | ||
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs index 801f8ff..d654a1a 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs | |||
@@ -132,7 +132,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement | |||
132 | public SceneObjectPart RootPart | 132 | public SceneObjectPart RootPart |
133 | { | 133 | { |
134 | get { return m_Entity.RootPart; } | 134 | get { return m_Entity.RootPart; } |
135 | set { m_Entity.RootPart = value; } | ||
136 | } | 135 | } |
137 | 136 | ||
138 | public Scene Scene | 137 | public Scene Scene |
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs index bf7d944..5db9545 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs | |||
@@ -104,11 +104,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement | |||
104 | 104 | ||
105 | //Initialize group and add part as root part | 105 | //Initialize group and add part as root part |
106 | x.SetScene(scene); | 106 | x.SetScene(scene); |
107 | y.SetParent(x); | 107 | x.SetRootPart(y); |
108 | y.ParentID = 0; | ||
109 | y.LinkNum = 0; | ||
110 | x.Children.Add(y.UUID, y); | ||
111 | x.RootPart = y; | ||
112 | x.RegionHandle = scene.RegionInfo.RegionHandle; | 108 | x.RegionHandle = scene.RegionInfo.RegionHandle; |
113 | x.SetScene(scene); | 109 | x.SetScene(scene); |
114 | 110 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 8f88d8e..d2bd698 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -184,10 +184,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
184 | set { m_parts = value; } | 184 | set { m_parts = value; } |
185 | } | 185 | } |
186 | 186 | ||
187 | /// <value> | ||
188 | /// The root part of this scene object | ||
189 | /// </value> | ||
187 | public SceneObjectPart RootPart | 190 | public SceneObjectPart RootPart |
188 | { | 191 | { |
189 | get { return m_rootPart; } | 192 | get { return m_rootPart; } |
190 | set { m_rootPart = value; } | ||
191 | } | 193 | } |
192 | 194 | ||
193 | public ulong RegionHandle | 195 | public ulong RegionHandle |
@@ -877,7 +879,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
877 | /// Set a part to act as the root part for this scene object | 879 | /// Set a part to act as the root part for this scene object |
878 | /// </summary> | 880 | /// </summary> |
879 | /// <param name="part"></param> | 881 | /// <param name="part"></param> |
880 | private void SetRootPart(SceneObjectPart part) | 882 | public void SetRootPart(SceneObjectPart part) |
881 | { | 883 | { |
882 | part.SetParent(this); | 884 | part.SetParent(this); |
883 | part.ParentID = 0; | 885 | part.ParentID = 0; |
@@ -1886,7 +1888,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1886 | 1888 | ||
1887 | m_scene.UnlinkSceneObject(objectGroup.UUID, true); | 1889 | m_scene.UnlinkSceneObject(objectGroup.UUID, true); |
1888 | objectGroup.Children.Clear(); | 1890 | objectGroup.Children.Clear(); |
1889 | objectGroup.RootPart = null; | 1891 | objectGroup.m_rootPart = null; |
1890 | 1892 | ||
1891 | // TODO Deleting the original group object may cause problems later on if they have already | 1893 | // TODO Deleting the original group object may cause problems later on if they have already |
1892 | // made it into the update queue. However, sending out updates for those parts is now | 1894 | // made it into the update queue. However, sending out updates for those parts is now |
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs index 4a038e2..de37eb4 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs | |||
@@ -78,10 +78,8 @@ namespace OpenSim.Region.Environment.Scenes.Tests | |||
78 | SceneObjectPart part | 78 | SceneObjectPart part |
79 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); | 79 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); |
80 | //part.UpdatePrimFlags(false, false, true); | 80 | //part.UpdatePrimFlags(false, false, true); |
81 | part.ObjectFlags |= (uint)PrimFlags.Phantom; | 81 | part.ObjectFlags |= (uint)PrimFlags.Phantom; |
82 | 82 | sceneObject.SetRootPart(part); | |
83 | sceneObject.RootPart = part; | ||
84 | sceneObject.AddPart(part); | ||
85 | 83 | ||
86 | scene.AddNewSceneObject(sceneObject, false); | 84 | scene.AddNewSceneObject(sceneObject, false); |
87 | 85 | ||