From 0e180b0ad30d5f468be1c239865688449b8747cc Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Mon, 10 Nov 2008 20:04:55 +0000
Subject: * refactor: Expose SOG.SetRootPart for outsiders to use rather than
setting RootPart and adding the part separately * Make RootPart read only
---
.../Environment/Modules/ContentManagementSystem/MetaEntity.cs | 1 -
.../Modules/ContentManagementSystem/PointMetaEntity.cs | 6 +-----
OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 8 +++++---
OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs | 6 ++----
4 files changed, 8 insertions(+), 13 deletions(-)
(limited to 'OpenSim/Region/Environment')
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
public SceneObjectPart RootPart
{
get { return m_Entity.RootPart; }
- set { m_Entity.RootPart = value; }
}
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
//Initialize group and add part as root part
x.SetScene(scene);
- y.SetParent(x);
- y.ParentID = 0;
- y.LinkNum = 0;
- x.Children.Add(y.UUID, y);
- x.RootPart = y;
+ x.SetRootPart(y);
x.RegionHandle = scene.RegionInfo.RegionHandle;
x.SetScene(scene);
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
set { m_parts = value; }
}
+ ///
+ /// The root part of this scene object
+ ///
public SceneObjectPart RootPart
{
get { return m_rootPart; }
- set { m_rootPart = value; }
}
public ulong RegionHandle
@@ -877,7 +879,7 @@ namespace OpenSim.Region.Environment.Scenes
/// Set a part to act as the root part for this scene object
///
///
- private void SetRootPart(SceneObjectPart part)
+ public void SetRootPart(SceneObjectPart part)
{
part.SetParent(this);
part.ParentID = 0;
@@ -1886,7 +1888,7 @@ namespace OpenSim.Region.Environment.Scenes
m_scene.UnlinkSceneObject(objectGroup.UUID, true);
objectGroup.Children.Clear();
- objectGroup.RootPart = null;
+ objectGroup.m_rootPart = null;
// TODO Deleting the original group object may cause problems later on if they have already
// 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
SceneObjectPart part
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero);
//part.UpdatePrimFlags(false, false, true);
- part.ObjectFlags |= (uint)PrimFlags.Phantom;
-
- sceneObject.RootPart = part;
- sceneObject.AddPart(part);
+ part.ObjectFlags |= (uint)PrimFlags.Phantom;
+ sceneObject.SetRootPart(part);
scene.AddNewSceneObject(sceneObject, false);
--
cgit v1.1