View of /trunk/ModularRex/RexFramework/RexMaterialsDictionary.cs
Parent Directory
|
Revision Log
Revision 170 -
(download)
(annotate)
Tue May 26 13:46:19 2009 UTC (3 years, 11 months ago) by mikkopa
File size: 3737 byte(s)
Tue May 26 13:46:19 2009 UTC (3 years, 11 months ago) by mikkopa
File size: 3737 byte(s)
* Renamed RexClientView.cs to RexClientViewBase.cs like the class already is. * Added NG ClientView class, but that does not implement anything yet * Added some Asset URL to RexObjectProperties * Started modifying GetRexPrimDataToBytes so it can also send asset URLs to NG clients. This is work in progress and it doesn't affect to legacy clients.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
using log4net;
using OpenMetaverse;
namespace ModularRex.RexFramework
{
/// <summary>
/// Rex Material Dictionary
/// May get unfolded as a seperate class
/// </summary>
public class RexMaterialsDictionary : Dictionary<uint, UUID>, ICloneable, IXmlSerializable
{
private RexObjectProperties MyPart;
public void SetSceneObjectPart(RexObjectProperties vPart)
{
MyPart = vPart;
}
public void AddMaterial(uint vIndex, UUID vMaterialUUID)
{
lock (this)
{
this[vIndex] = vMaterialUUID;
}
if (MyPart != null)
MyPart.TriggerChangedRexObjectProperties();
}
public void DeleteMaterialByIndex(uint vIndex)
{
lock (this)
{
if (ContainsKey(vIndex))
{
Remove(vIndex);
if (MyPart != null)
MyPart.TriggerChangedRexObjectProperties();
}
}
}
public void ClearMaterials()
{
lock (this)
{
Clear();
}
if (MyPart != null)
MyPart.TriggerChangedRexObjectProperties();
}
public void ReadXml(XmlReader reader)
{
}
public void WriteXml(XmlWriter writer)
{
}
public XmlSchema GetSchema()
{
return null;
}
public Object Clone()
{
RexMaterialsDictionary clone = new RexMaterialsDictionary();
lock (this)
{
foreach (uint matindex in Keys)
clone.Add(matindex, this[matindex]);
}
return clone;
}
public override string ToString()
{
string s = String.Empty;
foreach (uint matindex in Keys)
s = s + "idx:" + matindex + ",value:" + this[matindex] + "\n";
return s;
}
}
public class RexMaterialsDictionaryItem
{
private int id = 0;
public int ID
{
get { return id; }
set { id = value; }
}
public RexMaterialsDictionaryItem() { }
public RexMaterialsDictionaryItem(KeyValuePair<uint, UUID> e)
{
num = e.Key;
assetId = e.Value;
}
private uint num = 0;
public uint Num
{
get { return num; }
set { num = value; }
}
private UUID assetId = UUID.Zero;
/// <summary>
/// The ID of the asset
/// </summary>
public UUID AssetID
{
get { return assetId; }
set { assetId = value; }
}
private string assetUrl = String.Empty;
/// <summary>
/// The url of the asset where it is located
/// </summary>
public string AssetURL
{
get { return assetUrl; }
set { assetUrl = value; }
}
private UUID rexObjectUUID;
/// <summary>
/// The UUID of the object to which this entry belongs to
/// </summary>
public UUID RexObjectUUID
{
get { return rexObjectUUID; }
set { rexObjectUUID = value; }
}
}
}
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

