コード例 #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;
        }
コード例 #2
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);
        }
コード例 #3
0
        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);

        }
コード例 #4
0
 public void SetPicture(string fileName)
 {
     probesHelper = new ProbesHelper(fileName, true);
     this.OnDataChanged(null);
 }
コード例 #5
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);
        }
コード例 #6
0
 public void SetPicture(string fileName)
 {
     probesHelper = new ProbesHelper(fileName, true);
     this.OnDataChanged(null);
 }