Ejemplo n.º 1
0
        private void ReadVuMark(XmlTextReader configReader)
        {
            ConfigData.VuMarkData value = default(ConfigData.VuMarkData);
            string attribute            = configReader.GetAttribute("name");

            if (attribute == null)
            {
                Debug.LogWarning("Info parser: VuMark element without name is ignored.");
                return;
            }
            value.previewImage = configReader.GetAttribute("previewImage");
            XmlReader xmlReader = configReader.ReadSubtree();

            while (xmlReader.Read())
            {
                if (xmlReader.NodeType == XmlNodeType.Element)
                {
                    if (xmlReader.Name == "Code")
                    {
                        this.ReadVuMarkCode(xmlReader, ref value.idType, ref value.idLength);
                    }
                    else if (xmlReader.Name == "Shape")
                    {
                        this.ReadVuMarkShape(xmlReader, ref value.boundingBox2D, ref value.origin);
                    }
                }
            }
            this.mVuMarks.Add(attribute, value);
        }
Ejemplo n.º 2
0
        internal static void UpdateDataSetInfo(SerializedVuMark serializedObject, ConfigData.VuMarkData vuMarkInfo)
        {
            serializedObject.PreviewImage = "Assets/Editor/Vuforia/" + serializedObject.GetDataSetName() + "/" + vuMarkInfo.previewImage;
            serializedObject.IdType       = vuMarkInfo.idType;
            serializedObject.IdLength     = vuMarkInfo.idLength;
            Vector4 boundingBox2D = vuMarkInfo.boundingBox2D;

            serializedObject.BoundingBox = new Rect(boundingBox2D[0], boundingBox2D[1], boundingBox2D[2] - boundingBox2D[0], boundingBox2D[3] - boundingBox2D[1]);
            serializedObject.Origin      = new Vector2(vuMarkInfo.origin.x, boundingBox2D[3] - vuMarkInfo.origin.y);
        }
Ejemplo n.º 3
0
 public void GetVuMarkTarget(string name, out ConfigData.VuMarkData vm)
 {
     try
     {
         vm = this.vuMarkTargets[name];
     }
     catch
     {
         throw;
     }
 }
Ejemplo n.º 4
0
 private ConfigData.VuMarkData CreateDefaultVuMarkTarget()
 {
     ConfigData.VuMarkData result = default(ConfigData.VuMarkData);
     result.name          = "--- EMPTY ---";
     result.size.x        = 1f;
     result.size.y        = 1f;
     result.boundingBox2D = new Vector4(0f, 0f, 1f, 1f);
     result.origin        = new Vector2(0.5f, 0.5f);
     result.idType        = InstanceIdType.BYTES;
     result.idLength      = 0;
     return(result);
 }
Ejemplo n.º 5
0
 public void SetVuMarkTarget(ConfigData.VuMarkData item, string name)
 {
     this.vuMarkTargets[name] = item;
 }
Ejemplo n.º 6
0
 public bool TryGetInfo(string name, out ConfigData.VuMarkData info)
 {
     return(this.mVuMarks.TryGetValue(name, out info));
 }