예제 #1
0
        public ProbesDataSource(Guid guid, PointSet pointSet, Host host)
            : base(guid)
        {
            // set up the Ontology, a description of the kind of data we contain.
            // See DataSource sample for more details.
            OntologySpecification o = this.Ontology.Edit();

            o.PrimitiveTypes.Create("RasterPatch", "GeoEntity", typeof(RasterPatch2));
            this.UpdateOntology(o);

            EntitySpecification entitySpec = new EntitySpecification(this.Ontology.EntityTypes["GeoEntity"]); // the default entity type

            entity = this.EntityAuthorityReference.EntityAuthority.CreateEntity(true, entitySpec);

            this.pointSet = pointSet;

            if (pointSet.Metadata.ContainsKey("ProbePicture"))
            {
                probesHelper = new ProbesHelper(pointSet.Metadata["ProbePicture"], true);
            }
            else
            {
                probesHelper = new ProbesHelper("ProbeSample.png", false);
            }

            this.host = host;

            dataType = DSDataType.Table;
        }
        public TrajectoriesDataSource(Host host, PointSet data)
            : base(Guid.NewGuid())
        {
            this.pointSet = data;
            this.host     = host;

            if (pointSet.Metadata.ContainsKey("ProbePicture"))
            {
                probesHelper = new ProbesHelper(pointSet.Metadata["ProbePicture"], true);
            }
            else
            {
                probesHelper = new ProbesHelper("ProbeSample.png", false);
            }

            // set up the Ontology, a description of the kind of data we contain.
            // See DataSource sample for more details.
            OntologySpecification o = this.Ontology.Edit();

            o.PrimitiveTypes.Create("RasterPatch", "GeoEntity", typeof(RasterPatch2));

            this.UpdateOntology(o);

            EntitySpecification entitySpec = new EntitySpecification(this.Ontology.EntityTypes["GeoEntity"]);

            entity = this.EntityAuthorityReference.EntityAuthority.CreateEntity(true, entitySpec);
        }
예제 #3
0
        public ProbesDataSource(Guid guid, IDataSource2D <double> field, Host host)
            : base(guid)
        {
            // set up the Ontology, a description of the kind of data we contain.
            // See DataSource sample for more details.
            OntologySpecification o = this.Ontology.Edit();

            o.PrimitiveTypes.Create("RasterPatch", "GeoEntity", typeof(RasterPatch2));
            this.UpdateOntology(o);

            EntitySpecification entitySpec = new EntitySpecification(this.Ontology.EntityTypes["GeoEntity"]); // the default entity type

            entity = this.EntityAuthorityReference.EntityAuthority.CreateEntity(true, entitySpec);

            this.wfield = field;

            System.Windows.Point[,] grid = wfield.Grid;
            Coordinate2D minCoordinate = new Coordinate2D(grid[0, 0].X, grid[0, 0].Y);
            Coordinate2D maxCoordinate = new Coordinate2D(grid[field.Width - 1, field.Height - 1].X, grid[field.Width - 1, field.Height - 1].Y);


            for (int j = 0; j < field.Height; j++)
            {
                for (int i = 0; i < field.Width; i++)
                {
                    if (grid[i, j].X < minCoordinate.X)
                    {
                        minCoordinate.X = grid[i, j].X;
                    }

                    if (grid[i, j].X > maxCoordinate.X)
                    {
                        maxCoordinate.X = grid[i, j].X;
                    }

                    if (grid[i, j].Y < minCoordinate.Y)
                    {
                        minCoordinate.Y = grid[i, j].Y;
                    }

                    if (grid[i, j].Y > maxCoordinate.Y)
                    {
                        maxCoordinate.Y = grid[i, j].Y;
                    }
                }
            }

            gridBox = new GeoRect(
                minCoordinate.X,
                minCoordinate.Y,
                maxCoordinate.X - minCoordinate.X,
                maxCoordinate.Y - minCoordinate.Y);

            dataType  = DSDataType.TwoDim;
            this.host = host;

            probesHelper = new ProbesHelper("ProbeSample.png", false);
        }
예제 #4
0
        public ColorMapDataSource(WarpedDataSource2D <double> field, Host host, double minT, double maxT)
            : base(Guid.NewGuid())
        {
            OntologySpecification o = this.Ontology.Edit();

            o.PrimitiveTypes.Create("RasterPatch", "GeoEntity", typeof(RasterPatch2));
            this.UpdateOntology(o);

            EntitySpecification entitySpec = new EntitySpecification(this.Ontology.EntityTypes["GeoEntity"]); // the default entity type

            entity = this.EntityAuthorityReference.EntityAuthority.CreateEntity(true, entitySpec);

            this.host   = host;
            this.wfield = field;

            this.minT = minT;
            this.maxT = maxT;

            //colorMapHelper = new ColorMapHelper(field, null);
            isWarped = true;
        }