Пример #1
0
    public void GetIdentifiersForArtefactsInCollectionWithIdentifier()
    {
        string[] collectionIdentifiers = CollectionReader.GetIdentifiersForCollections();
        string[] artefactIdentifiers   = CollectionReader.GetIdentifiersForArtefactsInCollectionWithIdentifier(collectionIdentifiers[0]);

        Assert.That(artefactIdentifiers[0] == "Evans Bay Wharf");
        Assert.That(artefactIdentifiers[1] == "Cog Wheel Evans Bay");
        Assert.That(artefactIdentifiers[2] == "Evans Boat House");
        Assert.That(artefactIdentifiers[3] == "Cricket Monument");
        Assert.That(artefactIdentifiers[4] == "Doll Head");
    }
Пример #2
0
    public void TestAddArtefactToCollection()
    {
        CreateTwoCollectionsWithTwoArtefacts();
        CollectionReader.LoadXmlFromFile(Paths.CollectionMetadata);
        string[] collectionIdentifiers_00 = CollectionReader.GetIdentifiersForArtefactsInCollectionWithIdentifier("TEST-COLLECTION-00");
        int      numArtefactsBeforeAdd    = collectionIdentifiers_00.Length;

        CollectionWriter.AddArtefactToCollectionWithIdentifier("TEST-COLLECTION-00", "NEW-ARTEFACT", new VerticeTransform(0f, 0f, 0f, 0f));

        CollectionReader.LoadXmlFromFile(Paths.CollectionMetadata);

        string[] updated_collectionIdentifiers_00 = CollectionReader.GetIdentifiersForArtefactsInCollectionWithIdentifier("TEST-COLLECTION-00");
        int      numArtefactsAfterAdd             = updated_collectionIdentifiers_00.Length;

        Assert.That(numArtefactsAfterAdd == (numArtefactsBeforeAdd + 1));
    }
Пример #3
0
    private void GetIdentifiers(string collectId)
    {
        collectionId = collectId;

        string[] collectionIdentifiers = CollectionReader.GetIdentifiersForArtefactsInCollectionWithIdentifier(collectId);
        importedObjects = new GameObject[collectionIdentifiers.Length];

        progressBar.SetActive(true);
        ProgressBarCont.SetMaxVal(collectionIdentifiers.Length * 2);

        for (int i = 0; i < collectionIdentifiers.Length; i++)
        {
            string meshLocation = Paths.PathToFile(DublinCoreReader.GetMeshLocationForArtefactWithIdentifier(collectionIdentifiers [i]));
            string texLocation  = Paths.PathToFile(DublinCoreReader.GetTextureLocationForArtefactWithIdentifier(collectionIdentifiers [i]));
            StartCoroutine(ImportModel(i, collectionIdentifiers[i], meshLocation, texLocation));
        }
    }
Пример #4
0
    public void TestInstantiateWithCollectionReaderDictionary()
    {
        // Get the list of collection identifiers, and subsequently the list of artefact identifiers for the first collection
        string[] collectionIdentifiers = CollectionReader.GetIdentifiersForCollections();
        string[] artefactIdentifiers   = CollectionReader.GetIdentifiersForArtefactsInCollectionWithIdentifier(collectionIdentifiers [0]);

        // Now get the transform data for the first artefact in the first collection, and attempt to construct a VerticeTransform with the data
        Dictionary <string, Dictionary <string, float> > transformData = CollectionReader.GetTransformForArtefactWithIdentifierInCollection(collectionIdentifiers [0], artefactIdentifiers [0]);
        VerticeTransform transform = new VerticeTransform(transformData);

        Assert.That(transform.position.x == 40.01599f);
        Assert.That(transform.position.y == -11.58916f);
        Assert.That(transform.position.z == 184.2516f);
        Assert.That(transform.rotation.x == 1.0f);
        Assert.That(transform.rotation.y == 1.0f);
        Assert.That(transform.rotation.z == 1.0f);
        Assert.That(transform.rotation.w == 1.0f);
        Assert.That(transform.scale.x == 1.0f);
        Assert.That(transform.scale.y == 1.0f);
        Assert.That(transform.scale.z == 1.0f);
    }
Пример #5
0
 public void GetIdentifiersForArtefactsInCollectionWithIdentifier_Invalid()
 {
     string[] artefactIdentifiers = CollectionReader.GetIdentifiersForArtefactsInCollectionWithIdentifier("THIS IS NOT A REAL COLLECTION ID");
 }