本文整理汇总了C#中OpenSim.Tests.Common.SceneHelpers.DeleteSceneObject方法的典型用法代码示例。如果您正苦于以下问题:C# SceneHelpers.DeleteSceneObject方法的具体用法?C# SceneHelpers.DeleteSceneObject怎么用?C# SceneHelpers.DeleteSceneObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Tests.Common.SceneHelpers
的用法示例。
在下文中一共展示了SceneHelpers.DeleteSceneObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestDeleteSceneObject
public void TestDeleteSceneObject()
{
TestHelpers.InMethod();
TestScene scene = new SceneHelpers().SetupScene();
SceneObjectGroup so = SceneHelpers.AddSceneObject(scene);
Assert.That(so.IsDeleted, Is.False);
scene.DeleteSceneObject(so, false);
Assert.That(so.IsDeleted, Is.True);
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId);
Assert.That(retrievedPart, Is.Null);
}
示例2: TestDelinkPersistence
public void TestDelinkPersistence()
{
TestHelpers.InMethod();
//log4net.Config.XmlConfigurator.Configure();
TestScene scene = new SceneHelpers().SetupScene();
string rootPartName = "rootpart";
UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
string linkPartName = "linkpart";
UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000");
SceneObjectPart rootPart
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = rootPartName, UUID = rootPartUuid };
SceneObjectPart linkPart
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = linkPartName, UUID = linkPartUuid };
SceneObjectGroup sog = new SceneObjectGroup(rootPart);
sog.AddPart(linkPart);
scene.AddNewSceneObject(sog, true);
// In a test, we have to crank the backup handle manually. Normally this would be done by the timer invoked
// scene backup thread.
scene.Backup(true);
// These changes should occur immediately without waiting for a backup pass
SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false);
Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.True);
scene.DeleteSceneObject(groupToDelete, false);
Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.False);
List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID);
Assert.That(storedObjects.Count, Is.EqualTo(1));
Assert.That(storedObjects[0].Parts.Length, Is.EqualTo(1));
Assert.That(storedObjects[0].ContainsPart(rootPartUuid));
}
示例3: TestGetSceneObjectByPartLocalId
public void TestGetSceneObjectByPartLocalId()
{
TestHelpers.InMethod();
Scene scene = new SceneHelpers().SetupScene();
int partsToTestCount = 3;
SceneObjectGroup so
= SceneHelpers.CreateSceneObject(partsToTestCount, TestHelpers.ParseTail(0x1), "obj1", 0x10);
SceneObjectPart[] parts = so.Parts;
scene.AddNewSceneObject(so, false);
// Test getting via the root part's local id
Assert.That(scene.GetGroupByPrim(so.LocalId), Is.Not.Null);
// Test getting via a non root part's local id
Assert.That(scene.GetGroupByPrim(parts[partsToTestCount - 1].LocalId), Is.Not.Null);
// Test that we don't get back an object for a local id that doesn't exist
Assert.That(scene.GetGroupByPrim(999), Is.Null);
// Now delete the scene object and check again
scene.DeleteSceneObject(so, false);
Assert.That(scene.GetGroupByPrim(so.LocalId), Is.Null);
Assert.That(scene.GetGroupByPrim(parts[partsToTestCount - 1].LocalId), Is.Null);
}
示例4: TestDelinkPersistence
public void TestDelinkPersistence()
{
TestHelpers.InMethod();
//log4net.Config.XmlConfigurator.Configure();
TestScene scene = new SceneHelpers().SetupScene();
string rootPartName = "rootpart";
UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
string linkPartName = "linkpart";
UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000");
SceneObjectPart rootPart
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = rootPartName, UUID = rootPartUuid };
SceneObjectPart linkPart
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = linkPartName, UUID = linkPartUuid };
SceneObjectGroup linkGroup = new SceneObjectGroup(linkPart);
scene.AddNewSceneObject(linkGroup, true);
SceneObjectGroup sog = new SceneObjectGroup(rootPart);
scene.AddNewSceneObject(sog, true);
Assert.IsFalse(sog.GroupContainsForeignPrims);
sog.LinkToGroup(linkGroup);
Assert.IsTrue(sog.GroupContainsForeignPrims);
scene.Backup(true);
Assert.AreEqual(1, scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID).Count);
// These changes should occur immediately without waiting for a backup pass
SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false);
Assert.IsFalse(groupToDelete.GroupContainsForeignPrims);
scene.DeleteSceneObject(groupToDelete, false);
List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID);
Assert.AreEqual(1, storedObjects.Count);
Assert.AreEqual(1, storedObjects[0].Parts.Length);
Assert.IsTrue(storedObjects[0].ContainsPart(rootPartUuid));
}