preparing LandData seriali(s|z)ation into OAR [not yet functional]
parent
67f803c919
commit
f23f7b1fc4
|
@ -27,6 +27,9 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Xml;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
|
||||||
namespace OpenSim.Framework
|
namespace OpenSim.Framework
|
||||||
|
@ -36,6 +39,11 @@ namespace OpenSim.Framework
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LandData
|
public class LandData
|
||||||
{
|
{
|
||||||
|
// use only one serializer to give the runtime a chance to
|
||||||
|
// optimize it (it won't do that if you use a new instance
|
||||||
|
// every time)
|
||||||
|
private static XmlSerializer serializer = new XmlSerializer(typeof (LandData));
|
||||||
|
|
||||||
private Vector3 _AABBMax = new Vector3();
|
private Vector3 _AABBMax = new Vector3();
|
||||||
private Vector3 _AABBMin = new Vector3();
|
private Vector3 _AABBMin = new Vector3();
|
||||||
private int _area = 0;
|
private int _area = 0;
|
||||||
|
@ -86,6 +94,7 @@ namespace OpenSim.Framework
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Upper corner of the AABB for the parcel
|
/// Upper corner of the AABB for the parcel
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[XmlIgnore]
|
||||||
public Vector3 AABBMax {
|
public Vector3 AABBMax {
|
||||||
get {
|
get {
|
||||||
return _AABBMax;
|
return _AABBMax;
|
||||||
|
@ -97,6 +106,7 @@ namespace OpenSim.Framework
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Lower corner of the AABB for the parcel
|
/// Lower corner of the AABB for the parcel
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[XmlIgnore]
|
||||||
public Vector3 AABBMin {
|
public Vector3 AABBMin {
|
||||||
get {
|
get {
|
||||||
return _AABBMin;
|
return _AABBMin;
|
||||||
|
@ -205,6 +215,7 @@ namespace OpenSim.Framework
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of SceneObjectPart that are owned by a Group
|
/// Number of SceneObjectPart that are owned by a Group
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[XmlIgnore]
|
||||||
public int GroupPrims {
|
public int GroupPrims {
|
||||||
get {
|
get {
|
||||||
return _groupPrims;
|
return _groupPrims;
|
||||||
|
@ -363,6 +374,7 @@ namespace OpenSim.Framework
|
||||||
/// Number of SceneObjectPart that are owned by users who do not own the parcel
|
/// Number of SceneObjectPart that are owned by users who do not own the parcel
|
||||||
/// and don't have the 'group. These are elegable for AutoReturn collection
|
/// and don't have the 'group. These are elegable for AutoReturn collection
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[XmlIgnore]
|
||||||
public int OtherPrims {
|
public int OtherPrims {
|
||||||
get {
|
get {
|
||||||
return _otherPrims;
|
return _otherPrims;
|
||||||
|
@ -388,6 +400,7 @@ namespace OpenSim.Framework
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of SceneObjectPart that are owned by the owner of the parcel
|
/// Number of SceneObjectPart that are owned by the owner of the parcel
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[XmlIgnore]
|
||||||
public int OwnerPrims {
|
public int OwnerPrims {
|
||||||
get {
|
get {
|
||||||
return _ownerPrims;
|
return _ownerPrims;
|
||||||
|
@ -448,6 +461,7 @@ namespace OpenSim.Framework
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of SceneObjectPart that are currently selected by avatar
|
/// Number of SceneObjectPart that are currently selected by avatar
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[XmlIgnore]
|
||||||
public int SelectedPrims {
|
public int SelectedPrims {
|
||||||
get {
|
get {
|
||||||
return _selectedPrims;
|
return _selectedPrims;
|
||||||
|
@ -460,6 +474,7 @@ namespace OpenSim.Framework
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of meters^2 in the Simulator
|
/// Number of meters^2 in the Simulator
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[XmlIgnore]
|
||||||
public int SimwideArea {
|
public int SimwideArea {
|
||||||
get {
|
get {
|
||||||
return _simwideArea;
|
return _simwideArea;
|
||||||
|
@ -472,6 +487,7 @@ namespace OpenSim.Framework
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of SceneObjectPart in the Simulator
|
/// Number of SceneObjectPart in the Simulator
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[XmlIgnore]
|
||||||
public int SimwidePrims {
|
public int SimwidePrims {
|
||||||
get {
|
get {
|
||||||
return _simwidePrims;
|
return _simwidePrims;
|
||||||
|
@ -607,5 +623,22 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
return landData;
|
return landData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ToXml(XmlWriter xmlWriter)
|
||||||
|
{
|
||||||
|
serializer.Serialize(xmlWriter, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Restore a LandData object from the serialized xml representation.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="xmlReader"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static LandData FromXml(XmlReader xmlReader)
|
||||||
|
{
|
||||||
|
LandData land = (LandData)serializer.Deserialize(xmlReader);
|
||||||
|
|
||||||
|
return land;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue