29 using System.Collections.Generic;
30 using System.Reflection;
31 using System.Threading;
33 using NUnit.Framework;
35 using OpenSim.Framework;
36 using OpenSim.Region.Framework.Scenes;
37 using OpenSim.Services.Interfaces;
38 using OpenSim.Tests.Common;
40 namespace OpenSim.
Region.Framework.Scenes.Tests
90 TestHelpers.InMethod();
93 int partsToTestCount = 3;
96 = SceneHelpers.CreateSceneObject(partsToTestCount, TestHelpers.ParseTail(0x1),
"obj1", 0x10);
99 Assert.That(scene.AddNewSceneObject(so,
false), Is.True);
105 Assert.That(retrievedSo.PrimCount, Is.EqualTo(partsToTestCount));
107 for (
int i = 0; i < partsToTestCount; i++)
109 Assert.That(retrievedParts[i].Name, Is.EqualTo(parts[i].Name));
110 Assert.That(retrievedParts[i].UUID, Is.EqualTo(parts[i].UUID));
120 TestHelpers.InMethod();
124 string obj1Name =
"Alfred";
125 string obj2Name =
"Betty";
126 UUID objUuid =
new UUID(
"00000000-0000-0000-0000-000000000001");
130 { Name = obj1Name, UUID = objUuid };
132 Assert.That(scene.AddNewSceneObject(
new SceneObjectGroup(part1),
false), Is.True);
136 { Name = obj2Name, UUID = objUuid };
138 Assert.That(scene.AddNewSceneObject(
new SceneObjectGroup(part2),
false), Is.False);
144 Assert.That(retrievedPart.Name, Is.EqualTo(obj1Name));
145 Assert.That(retrievedPart.UUID, Is.EqualTo(objUuid));
154 TestHelpers.InMethod();
157 int partsToTestCount = 3;
160 = SceneHelpers.CreateSceneObject(partsToTestCount, TestHelpers.ParseTail(0x1),
"obj1", 0x10);
163 scene.AddNewSceneObject(so,
false);
166 Assert.That(scene.GetGroupByPrim(so.LocalId), Is.Not.Null);
169 Assert.That(scene.GetGroupByPrim(parts[partsToTestCount - 1].LocalId), Is.Not.Null);
172 Assert.That(scene.GetGroupByPrim(999), Is.Null);
174 uint soid = so.LocalId;
175 uint spid = parts[partsToTestCount - 1].LocalId;
178 scene.DeleteSceneObject(so,
false);
180 Assert.That(scene.GetGroupByPrim(soid), Is.Null);
181 Assert.That(scene.GetGroupByPrim(spid), Is.Null);
194 TestHelpers.InMethod();
199 Assert.That(so.IsDeleted, Is.False);
200 uint retrievedPartID = so.LocalId;
202 scene.DeleteSceneObject(so,
false);
204 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(retrievedPartID);
206 Assert.That(retrievedPart, Is.Null);
217 string rootPartName =
"rootpart";
218 UUID rootPartUuid =
new UUID(
"00000000-0000-0000-0000-000000000001");
219 string childPartName =
"childPart";
220 UUID childPartUuid =
new UUID(
"00000000-0000-0000-0001-000000000000");
224 { Name = rootPartName, UUID = rootPartUuid };
227 { Name = childPartName, UUID = childPartUuid };
230 sog.AddPart(linkPart);
232 Assert.That(sog.UUID, Is.EqualTo(rootPartUuid));
233 Assert.That(sog.RootPart.UUID, Is.EqualTo(rootPartUuid));
234 Assert.That(sog.Parts.Length, Is.EqualTo(2));
236 UUID newRootPartUuid =
new UUID(
"00000000-0000-0000-0000-000000000002");
237 sog.UUID = newRootPartUuid;
239 Assert.That(sog.UUID, Is.EqualTo(newRootPartUuid));
240 Assert.That(sog.RootPart.UUID, Is.EqualTo(newRootPartUuid));
241 Assert.That(sog.Parts.Length, Is.EqualTo(2));
void TestGetSceneObjectByPartLocalId()
Test retrieving a scene object via the local id of one of its parts.
void TestAddExistingSceneObjectUuid()
It shouldn't be possible to add a scene object if one with that uuid already exists in the scene...
static PrimitiveBaseShape Default
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
void TestAddSceneObject()
Test adding an object to a scene.
void TestChangeSceneObjectUuid()
Changing a scene object uuid changes the root part uuid. This is a valid operation if the object is n...
Helpers for setting up scenes.
Basic scene object tests (create, read and delete but not update).
void TestDeleteSceneObject()
Test deleting an object from a scene.