public SparqlQueryProcessingModel(string storeName, IBrightstarService service, SparqlRequestObject sparqlRequest)
 {
     _storeName     = storeName;
     _service       = service;
     _sparqlRequest = sparqlRequest;
     ResultModel    = sparqlRequest.Query == null ? SerializableModel.None : SparqlQueryHelper.GetResultModel(sparqlRequest.Query);
 }
 public SparqlQueryProcessingModel(string storeName, IBrightstarService service, SparqlRequestObject sparqlRequest)
 {
     _storeName = storeName;
     _service = service;
     _sparqlRequest = sparqlRequest;
     ResultModel = sparqlRequest.Query == null ? SerializableModel.None : SparqlQueryHelper.GetResultModel(sparqlRequest.Query);
 }
Example #3
0
 private static void SetMeshList(AnimationModelContent model, SerializableModel modelContent)
 {
     foreach (SerializableMesh meshContent in modelContent.meshList)
     {
         AnimationMesh mesh = CreateMesh(meshContent);
         model.AddMesh(mesh);
     }
 }
Example #4
0
 private static void SetAnimationList(AnimationModelContent model, SerializableModel modelContent)
 {
     foreach (SerializableAnimation animationContent in modelContent.animationList)
     {
         Animation animation = CreateAnimation(animationContent);
         model.AddAnimation(animation);
     }
 }
Example #5
0
 private RdfFormat(string defaultExtension, Type formatterType, SerializableModel models, params string[] mediaTypes)
 {
     DefaultExtension    = defaultExtension;
     TripleFormatterType = formatterType;
     Encoding            = Encoding.UTF8;
     MediaTypes          = new List <string>(mediaTypes);
     SerializedModel     = models;
 }
Example #6
0
 private RdfFormat(string defaultExtension, Type formatterType, SerializableModel models, params string[] mediaTypes)
 {
     DefaultExtension = defaultExtension;
     TripleFormatterType = formatterType;
     Encoding = Encoding.UTF8;
     MediaTypes = new List<string>(mediaTypes);
     SerializedModel = models;
 }
Example #7
0
        public AnimationModelContent Load(string assetName)
        {
            SerializableModel     modelContent = content.Load <SerializableModel>(assetName);
            AnimationModelContent model        = new AnimationModelContent(modelContent.name);

            SetSkeleton(model, modelContent);
            SetMeshList(model, modelContent);
            SetAnimationList(model, modelContent);

            string textureDirectory = assetName.Replace(modelContent.name, "");

            SetTextures(model, content, textureDirectory);

            return(model);
        }
Example #8
0
    protected override SiteElement AddElementComponent(GameObject elementObject, SerializableSiteElement element)
    {
        SerializableModel modelData = element as SerializableModel;

        if (modelData.custom.modelType == "ply" || modelData.custom.modelType == "las" || modelData.custom.modelType == "xyz")
        {
            Debug.Log("Creating new PointsOOC");
            PointsOOC newElement = elementObject.AddComponent <PointsOOC>();
            return(newElement);
        }
        else
        {
            Debug.Log("Creating new Model");
            Model newElement = elementObject.AddComponent <Model>();
            return(newElement);
        }
    }
Example #9
0
    protected override IEnumerator LoadCoroutine()
    {
        SerializableModel pointsData = siteData as SerializableModel;

        // CustomData custom = JsonUtility.FromJson<CustomData>(pointsData.customData);


        //Choose UI type
        elementUI = new PointOOCElementUI();


        string cacheDirectory = GetCacheDirectory(pointsData.file);

        if (!Directory.Exists(cacheDirectory))
        {
            yield return(StartCoroutine(ProcessPLY(GetAbsolutePath(pointsData.file), cacheDirectory)));
        }
        loaded = true;
        yield return(null);
    }
Example #10
0
        private static void SetSkeleton(AnimationModelContent model, SerializableModel modelContent)
        {
            AnimationSkeleton skeleton = CreateSkeleton(modelContent.skeleton);

            model.SetSkeleton(skeleton);
        }
 public ActionResult Baz(SerializableModel model)
 {
     return View();
 }
Example #12
0
    protected override IEnumerator ActivateCoroutine()
    {
        //Change the max tilt angle of the camera
        GameObject playerObj = GameObject.FindGameObjectWithTag("Player");
        Player     player    = playerObj.GetComponent <Player>();

        player.ChangeTiltAngle(85.0f);

        Debug.Log("Activating points");
        //create/activate pointcloudsetrealtimecontroller
        SerializableModel pointsData = siteData as SerializableModel;

        Debug.Log("Loading points " + pointsData.name);

        Debug.Log("Initializing mesh");

        mesh                   = this.gameObject.AddComponent <GeoTriMeshConfiguration>();
        mesh.pointRadius       = 5;
        mesh.renderCircles     = true;
        mesh.screenSize        = true;
        mesh.interpolation     = InterpolationMode.OFF;
        mesh.reloadingPossible = true;


        Debug.Log("Initializing set");

        set = this.gameObject.AddComponent <PointCloudSetRealTimeController>();
        set.moveCenterToTransformPosition = true;
        set.pointBudget         = 4294967295;
        set.minNodeSize         = 10;
        set.nodesLoadedPerFrame = 15;
        set.nodesGOsPerFrame    = 30;
        set.meshConfiguration   = mesh;
        set.cacheSizeInPoints   = 3000000;
        set.userCamera          = CAVECameraRig.frustumCamera;

        Debug.Log("Initializing controller");

        //create dynamicloadercontroller
        controller               = this.gameObject.AddComponent <DynamicLoaderController>();
        controller.cloudPath     = GetCacheDirectory(pointsData.file);
        controller.setController = set;
        set.userCamera           = CAVECameraRig.frustumCamera;

        yield return(null);

        if (this.spoi != null)
        {
            try {
                string cloudPath = GetCacheDirectory(pointsData.file);
                if (!cloudPath.EndsWith("\\"))
                {
                    cloudPath = cloudPath + "\\";
                }

                PointCloudMetaData md = CloudLoader.LoadMetaData(cloudPath, false);
                this.spoi.Delete();
                this.spoi = new ShapefilePOI(this.siteData.custom.shapefilePath, -md.boundingBox.Center().ToFloatVector());
            } catch (Exception ex) {
                Debug.LogError(ex);
            }
        }
    }
Example #13
0
    protected override IEnumerator LoadCoroutine()
    {
        SerializableModel modelData = siteData as SerializableModel;

        GameObject pivot = new GameObject("Position Pivot");

        pivot.transform.parent = this.transform;

        Debug.Log("Loading Model");
        yield return(null);

        string path = modelData.file;

        if (!File.Exists(path))
        {
            Debug.LogError("Failed to find file: " + path);
            failed = true;
            yield break;
        }

        string fileExtension = Path.GetExtension(path);


        if (fileExtension == ".dae")
        {
            string colladaString = File.ReadAllText(path);
            model = ColladaImporter.Import(colladaString);
            LoadTextures(model, colladaString);

            if (model == null)
            {
                Debug.LogError("Failed to load model from " + path);
            }

            yield return(null);
        }
        else if (fileExtension == ".obj" || fileExtension == ".txt")
        {
            Debug.LogWarning("LOADING OBJ");
            yield return(null);


            Debug.LogWarning("Preprocessing Model");
            yield return(StartCoroutine(PreprocessObjFile(path)));

            Debug.LogWarning("DONE");


            Debug.LogWarning("Loading Model...");
            yield return(null);


            List <GameObject> loadedObjects = new List <GameObject>();
            yield return(StartCoroutine(LoadObjModel(path, loadedObjects)));


            Debug.LogWarning("DONE");

            model = new GameObject(modelData.name);
            model.transform.parent = this.transform;


            pivot.transform.parent        = model.transform;
            pivot.transform.localPosition = Vector3.zero;
            pivot.transform.localRotation = Quaternion.identity;

            foreach (GameObject obj in loadedObjects)
            {
                obj.transform.parent = pivot.transform;
            }

            CenterModel(pivot);
            ScaleModelToFit();
        }
        else
        {
            Debug.LogError("Failed to load model, unsupported file extension: " + path);
            yield break;
        }

        if (model == null)
        {
            yield break;
        }

        model.SetActive(false);
    }