Ejemplo n.º 1
0
 private ConfigData.ObjectTargetData CreateDefaultObjectTarget()
 {
     ConfigData.ObjectTargetData result = default(ConfigData.ObjectTargetData);
     result.name    = "--- EMPTY ---";
     result.bboxMin = new Vector3(0f, 0f, 0f);
     result.bboxMax = new Vector3(140f, 90f, 90f);
     result.size.x  = 140f;
     result.size.y  = 90f;
     result.size.z  = 90f;
     return(result);
 }
Ejemplo n.º 2
0
 public void GetObjectTarget(string name, out ConfigData.ObjectTargetData ot)
 {
     try
     {
         ot = this.objectTargets[name];
     }
     catch
     {
         throw;
     }
 }
Ejemplo n.º 3
0
        private void ReadObjectTarget(XmlTextReader configReader)
        {
            ConfigData.ObjectTargetData value = default(ConfigData.ObjectTargetData);
            string attribute = configReader.GetAttribute("name");

            if (attribute == null)
            {
                Debug.LogWarning("Info parser: Object target element without name is ignored.");
                return;
            }
            value.previewImage = configReader.GetAttribute("previewImage");
            this.mObjectTargets.Add(attribute, value);
        }
Ejemplo n.º 4
0
        public static void Read(string editorConfigurationFile, ConfigData.ObjectTargetData[] objectTargetData)
        {
            CultureInfo arg_05_0 = CultureInfo.InvariantCulture;

            using (XmlTextReader xmlTextReader = new XmlTextReader(editorConfigurationFile))
            {
                Dictionary <string, int> dictionary = new Dictionary <string, int>();
                for (int i = 0; i < objectTargetData.Length; i++)
                {
                    dictionary[objectTargetData[i].name] = i;
                }
                while (xmlTextReader.Read())
                {
                    if (xmlTextReader.NodeType == XmlNodeType.Element)
                    {
                        string name = xmlTextReader.Name;
                        if (name == "ObjectTarget")
                        {
                            string attribute = xmlTextReader.GetAttribute("name");
                            if (attribute != null && dictionary.ContainsKey(attribute))
                            {
                                int num = dictionary[attribute];
                                ConfigData.ObjectTargetData objectTargetData2 = objectTargetData[num];
                                string   attribute2 = xmlTextReader.GetAttribute("targetId");
                                string[] array      = xmlTextReader.GetAttribute("bbox").Split(new char[]
                                {
                                    ' '
                                });
                                if (array != null && attribute2 != null)
                                {
                                    Vector3 bboxMin;
                                    Vector3 bboxMax;
                                    if (!VuforiaUtilities.BoundinBoxFromStringArray(out bboxMin, out bboxMax, array))
                                    {
                                        Debug.LogWarning("Found illegal bbox attribute for ObjectTarget " + array + " in editor configuration.xml. ObjectTarget will be ignored.");
                                    }
                                    else
                                    {
                                        objectTargetData2.targetID = attribute2;
                                        objectTargetData2.bboxMin  = bboxMin;
                                        objectTargetData2.bboxMax  = bboxMax;
                                        objectTargetData2.size     = objectTargetData2.bboxMax - objectTargetData2.bboxMin;
                                        objectTargetData[num]      = objectTargetData2;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 5
0
 public void SetObjectTarget(ConfigData.ObjectTargetData item, string name)
 {
     this.objectTargets[name] = item;
 }
Ejemplo n.º 6
0
 public bool TryGetInfo(string name, out ConfigData.ObjectTargetData info)
 {
     return(this.mObjectTargets.TryGetValue(name, out info));
 }