Package com.ngt.jopenmetaverse.shared.structureddata

Examples of com.ngt.jopenmetaverse.shared.structureddata.OSDMap


    /// <param name="map">An <see cref="OSDMap"/> containing the data</param>
    public void Deserialize(OSDMap map)
    {
      OSDArray agentDataArray = (OSDArray)map.get("AgentData");

      OSDMap agentDataMap = (OSDMap)agentDataArray.get(0);
      AgentID = agentDataMap.get("AgentID").asUUID();
      QueryID = agentDataMap.get("QueryID").asUUID();


      OSDArray dataBlocksArray = (OSDArray)map.get("QueryData");
      QueryDataBlocks = new QueryData[dataBlocksArray.count()];
      for (int i = 0; i < dataBlocksArray.count(); i++)
      {
        OSDMap dataMap = (OSDMap)dataBlocksArray.get(i);
        QueryData data = new QueryData();
        data.ActualArea = dataMap.get("ActualArea").asInteger();
        data.BillableArea = dataMap.get("BillableArea").asInteger();
        data.Description = dataMap.get("Desc").asString();
        data.Dwell = (float)dataMap.get("Dwell").asReal();
        data.Flags = dataMap.get("Flags").asInteger();
        data.GlobalX = (float)dataMap.get("GlobalX").asReal();
        data.GlobalY = (float)dataMap.get("GlobalY").asReal();
        data.GlobalZ = (float)dataMap.get("GlobalZ").asReal();
        data.Name = dataMap.get("Name").asString();
        data.OwnerID = dataMap.get("OwnerID").asUUID();
        data.Price = dataMap.get("Price").asInteger();
        data.SimName = dataMap.get("SimName").asString();
        data.SnapShotID = dataMap.get("SnapshotID").asUUID();
        data.ProductSku = dataMap.get("ProductSKU").asString();
        QueryDataBlocks[i] = data;
      }

      OSDArray transactionArray = (OSDArray)map.get("TransactionData");
      OSDMap transactionDataMap = (OSDMap)transactionArray.get(0);
      TransactionID = transactionDataMap.get("TransactionID").asUUID();
    }
View Full Code Here


    /// Serialize the object
    /// </summary>
    /// <returns>An <see cref="OSDMap"/> containing the objects data</returns>
    public OSDMap Serialize()
    {
      OSDMap map = new OSDMap(1);
      OSDMap prefsMap = new OSDMap(1);
      prefsMap.put("max", OSD.FromString(MaxAccess));
      map.put("access_prefs", prefsMap);
      return map;
    }
View Full Code Here

    /// Deserialize the message
    /// </summary>
    /// <param name="map">An <see cref="OSDMap"/> containing the data</param>
    public void Deserialize(OSDMap map)
    {
      OSDMap prefsMap = (OSDMap)map.get("access_prefs");
      MaxAccess = prefsMap.get("max").asString();
    }
View Full Code Here

    /// Serialize the object
    /// </summary>
    /// <returns>An <see cref="OSDMap"/> containing the objects data</returns>
    public OSDMap Serialize()
    {
      OSDMap map = new OSDMap(3);

      OSDMap agentMap = new OSDMap(1);
      agentMap.put("AgentID", OSD.FromUUID(AgentID));
      OSDArray agentDataArray = new OSDArray(1);
      agentDataArray.add(agentMap);
      map.put("AgentData", agentDataArray);

      OSDMap queryMap = new OSDMap(1);
      queryMap.put("QueryID", OSD.FromUUID(QueryID));
      OSDArray queryDataArray = new OSDArray(1);
      queryDataArray.add(queryMap);
      map.put("QueryData", queryDataArray);

      OSDArray queryReplyArray = new OSDArray();
      for (int i = 0; i < QueryReplies.length; i++)
      {
        OSDMap queryReply = new OSDMap(100);
        queryReply.put("ActualArea", OSD.FromInteger(QueryReplies[i].ActualArea));
        queryReply.put("Auction", OSD.FromBoolean(QueryReplies[i].Auction));
        queryReply.put("ForSale", OSD.FromBoolean(QueryReplies[i].ForSale));
        queryReply.put("Name", OSD.FromString(QueryReplies[i].Name));
        queryReply.put("ParcelID", OSD.FromUUID(QueryReplies[i].ParcelID));
        queryReply.put("ProductSKU", OSD.FromString(QueryReplies[i].ProductSku));
        queryReply.put("SalePrice", OSD.FromInteger(QueryReplies[i].SalePrice));

        queryReplyArray.add(queryReply);
      }
      map.put("QueryReplies", queryReplyArray);
View Full Code Here

    /// </summary>
    /// <param name="map">An <see cref="OSDMap"/> containing the data</param>
    public void Deserialize(OSDMap map)
    {
      OSDArray agentDataArray = (OSDArray)map.get("AgentData");
      OSDMap agentDataMap = (OSDMap)agentDataArray.get(0);
      AgentID = agentDataMap.get("AgentID").asUUID();

      OSDArray queryDataArray = (OSDArray)map.get("QueryData");
      OSDMap queryDataMap = (OSDMap)queryDataArray.get(0);
      QueryID = queryDataMap.get("QueryID").asUUID();

      OSDArray queryRepliesArray = (OSDArray)map.get("QueryReplies");

      QueryReplies = new QueryReply[queryRepliesArray.count()];
      for (int i = 0; i < queryRepliesArray.count(); i++)
      {
        QueryReply reply = new QueryReply();
        OSDMap replyMap = (OSDMap)queryRepliesArray.get(i);
        reply.ActualArea = replyMap.get("ActualArea").asInteger();
        reply.Auction = replyMap.get("Auction").asBoolean();
        reply.ForSale = replyMap.get("ForSale").asBoolean();
        reply.Name = replyMap.get("Name").asString();
        reply.ParcelID = replyMap.get("ParcelID").asUUID();
        reply.ProductSku = replyMap.get("ProductSKU").asString();
        reply.SalePrice = replyMap.get("SalePrice").asInteger();

        QueryReplies[i] = reply;
      }
    }
View Full Code Here

    public Object[] Objects;

    public OSDMap Serialize()
    {
      OSDMap map = new OSDMap();
      OSDArray array = new OSDArray();

      if (Objects != null)
      {
        for (int i = 0; i < Objects.length; i++)
          array.add(Objects[i].Serialize());
      }

      map.put("objects", array);
      return map;
    }
View Full Code Here

        Objects = new Object[array.count()];

        for (int i = 0; i < array.count(); i++)
        {
          Object obj = new Object();
          OSDMap objMap = (OSDMap)array.get(i);

          if (objMap != null)
            obj.Deserialize(objMap);

          Objects[i] = obj;
View Full Code Here

      public UUID SculptID;
      public EnumsPrimitive.SculptType SculptType;

      public OSDMap Serialize()
      {
        OSDMap map = new OSDMap();

        map.put("group-id", OSD.FromUUID(GroupID));
        map.put("material", OSD.FromInteger((int)Material.getIndex()));
        map.put("name", OSD.FromString(Name));
        map.put("pos", OSD.FromVector3(Position));
        map.put("rotation", OSD.FromQuaternion(Rotation));
        map.put("scale", OSD.FromVector3(Scale));

        // Extra params
        OSDArray extraParams = new OSDArray();
        if (ExtraParams != null)
        {
          for (int i = 0; i < ExtraParams.length; i++)
            extraParams.add(ExtraParams[i].Serialize());
        }
        map.put("extra_parameters", extraParams);

        // Faces
        OSDArray faces = new OSDArray();
        if (Faces != null)
        {
          for (int i = 0; i < Faces.length; i++)
            faces.add(Faces[i].Serialize());
        }
        map.put("facelist", faces);

        // Shape
        OSDMap shape = new OSDMap();
        OSDMap path = new OSDMap();
        path.put("begin", OSD.FromReal(PathBegin));
        path.put("curve", OSD.FromInteger(PathCurve));
        path.put("end", OSD.FromReal(PathEnd));
        path.put("radius_offset", OSD.FromReal(RadiusOffset));
        path.put("revolutions", OSD.FromReal(Revolutions));
        path.put("scale_x", OSD.FromReal(ScaleX));
        path.put("scale_y", OSD.FromReal(ScaleY));
        path.put("shear_x", OSD.FromReal(ShearX));
        path.put("shear_y", OSD.FromReal(ShearY));
        path.put("skew", OSD.FromReal(Skew));
        path.put("taper_x", OSD.FromReal(TaperX));
        path.put("taper_y", OSD.FromReal(TaperY));
        path.put("twist", OSD.FromReal(Twist));
        path.put("twist_begin", OSD.FromReal(TwistBegin));
        shape.put("path", path);
        OSDMap profile = new OSDMap();
        profile.put("begin", OSD.FromReal(ProfileBegin));
        profile.put("curve", OSD.FromInteger(ProfileCurve));
        profile.put("end", OSD.FromReal(ProfileEnd));
        profile.put("hollow", OSD.FromReal(ProfileHollow));
        shape.put("profile", profile);
        OSDMap sculpt = new OSDMap();
        sculpt.put("id", OSD.FromUUID(SculptID));
        sculpt.put("type", OSD.FromInteger((int)SculptType.getIndex()));
        shape.put("sculpt", sculpt);
        map.put("shape", shape);

        return map;
      }
View Full Code Here

        {
          Faces = new Face[0];
        }

        // Shape
        OSDMap shape = (OSDMap)map.get("shape");
        OSDMap path = (OSDMap)shape.get("path");
        PathBegin = (float)path.get("begin").asReal();
        PathCurve = path.get("curve").asInteger();
        PathEnd = (float)path.get("end").asReal();
        RadiusOffset = (float)path.get("radius_offset").asReal();
        Revolutions = (float)path.get("revolutions").asReal();
        ScaleX = (float)path.get("scale_x").asReal();
        ScaleY = (float)path.get("scale_y").asReal();
        ShearX = (float)path.get("shear_x").asReal();
        ShearY = (float)path.get("shear_y").asReal();
        Skew = (float)path.get("skew").asReal();
        TaperX = (float)path.get("taper_x").asReal();
        TaperY = (float)path.get("taper_y").asReal();
        Twist = (float)path.get("twist").asReal();
        TwistBegin = (float)path.get("twist_begin").asReal();

        OSDMap profile = (OSDMap)shape.get("profile");
        ProfileBegin = (float)profile.get("begin").asReal();
        ProfileCurve = profile.get("curve").asInteger();
        ProfileEnd = (float)profile.get("end").asReal();
        ProfileHollow = (float)profile.get("hollow").asReal();

        OSDMap sculpt = (OSDMap)shape.get("sculpt");
        if (sculpt != null)
        {
          SculptID = sculpt.get("id").asUUID();
          SculptType = SculptType.get((byte)sculpt.get("type").asInteger());
        }
        else
        {
          SculptID = UUID.Zero;
          SculptType = SculptType.get((byte)0);
View Full Code Here

        public float ScaleS;
        public float ScaleT;

        public OSDMap Serialize()
        {
          OSDMap map = new OSDMap();
          map.put("bump", OSD.FromInteger((int)Bump.getIndex()));
          map.put("colors", OSD.FromColor4(Color));
          map.put("fullbright", OSD.FromBoolean(Fullbright));
          map.put("glow", OSD.FromReal(Glow));
          map.put("imageid", OSD.FromUUID(ImageID));
          map.put("imagerot", OSD.FromReal(ImageRot));
          map.put("media_flags", OSD.FromInteger(MediaFlags));
          map.put("offsets", OSD.FromReal(OffsetS));
          map.put("offsett", OSD.FromReal(OffsetT));
          map.put("scales", OSD.FromReal(ScaleS));
          map.put("scalet", OSD.FromReal(ScaleT));

          return map;
        }
View Full Code Here

TOP

Related Classes of com.ngt.jopenmetaverse.shared.structureddata.OSDMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.