Пример #1
1
        public static void DrawPoint(System.Drawing.Graphics g, PointType type, Color c, float w, float x, float y)
        {
            w = w/2;

            switch (type)
            {
                case PointType.TriangleUp:
                    var triangleUp = new[]
                            {
                                new PointF(x - w, y + w),
                                new PointF(x + w, y + w),
                                new PointF(x, y - w)
                            };
                    g.FillPolygon(new SolidBrush(c), triangleUp);
                    g.DrawPolygon(new Pen(Color.Black, 1), triangleUp);
                    break;

                case PointType.TriangleDown:
                    var triangleDown = new[]
                            {
                                new PointF(x - w, y - w),
                                new PointF(x + w, y - w),
                                new PointF(x, y + w)
                            };
                    g.FillPolygon(new SolidBrush(c), triangleDown);
                    g.DrawPolygon(new Pen(Color.Black, 1), triangleDown);
                    break;

                case PointType.Circle:
                    g.FillEllipse(new SolidBrush(c), x - w, y - w, 2 * w, 2 * w);
                    g.DrawEllipse(new Pen(Color.Black, 1), x - w, y - w, 2 * w, 2 * w);
                    break;
                case PointType.Square:
                    g.FillRectangle(new SolidBrush(c), x - w, y - w, 2 * w, 2 * w);
                    g.DrawRectangle(new Pen(Color.Black, 1), x - w, y - w, 2 * w, 2 * w);
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }
Пример #2
0
 private static void DrawPoints(PointType type, PointDrawer[] points, Graphics g)
 {
     for (int i = 0; i < points.GetLength(0); i++)
     {
         DrawPoint(type, points[i], g);
     }
 }
Пример #3
0
 public Linepoint(double ra, double dec, PointType type, string name)
 {
     RA = ra;
     Dec = dec;
     PointType = type;
     Name = name;
 }
Пример #4
0
		public CGRect RemovePointsWithType (PointType type)
		{
			var updateRect = CGRect.Empty;
			LinePoint priorPoint = null;
			var keepPoints = new List<LinePoint> ();

			foreach (var point in points) {
				var keepPoint = !point.Properties.Contains (type);

				if (!keepPoint) {
					var rect = UpdateRectForLinePoint (point);

					if (priorPoint != null)
						rect.UnionWith (UpdateRectForLinePoint (priorPoint));

					updateRect.UnionWith (rect);
				}

				priorPoint = point;

				if (keepPoint)
					keepPoints.Add (point);
			}

			points = keepPoints;
			return updateRect;
		}
Пример #5
0
 private static void DrawText(PointType type, TextDrawer p , Graphics g)
 {
     Font myFont = null;
     SolidBrush blackBrush = null;
     switch(type)
     {
         case PointType.CENTER:
             myFont = new Font("Verdana", 14);
             blackBrush = new SolidBrush(Color.Red);
             g.DrawString(p.text, myFont, blackBrush, p.x, p.y);
             break;
         case PointType.EDAGE:
             myFont = new Font("Verdana", 12);
             blackBrush = new SolidBrush(Color.Red);
             g.DrawString(p.text, myFont, blackBrush, p.x, p.y);
             break;
         case PointType.NORMAL:
             myFont = new Font("Courier New", 8);
             blackBrush = new SolidBrush(Color.Green);
             g.DrawString(p.text, myFont, blackBrush, p.x, p.y);
             break;
         case PointType.GROUP:
             myFont = new Font("Verdana", 12);
             blackBrush = new SolidBrush(Color.RoyalBlue);
             g.DrawString(p.text, myFont, blackBrush, p.x, p.y);
             break;
     }
 }
Пример #6
0
 public TimeseriesPoint(DateTime date, long questionId, List<string> tags, PointType type)
 {
     m_Date = date;
     m_QuestionId = questionId;
     m_Type = type;
     m_Tags = tags;
 }
Пример #7
0
 public SimPoint(float x, float y, PointType type, float strength, float twist)
 {
     this.x = x;
     this.y = y;
     this.type = type;
     this.strength = strength;
     this.twist = twist;
 }
Пример #8
0
    //Initialize the values for this spawn point
    public void Initialize(PointType _type,Box _boxRef)
    {
        m_Type=_type;
        m_BoxRef=_boxRef;
        if(_type==PointType.Box)
            m_BoxRef.SetUp((SpawnPoint)this,(Box.BoxType)Random.Range(0,(int)Box.BoxType.MAX));
        else
            m_BoxRef.m_Goal=(SpawnPoint)this;

        SpriteRegen (false);
    }
Пример #9
0
 internal Res11Point(Res11 dfs, IDfsDynamicItemInfo I, int ElementNumber, double chainage, string BranchName, string TopoId, double X, double Y, PointType pt)
 {
   Chainage = chainage;
   this.dfs = dfs;
   this.I = I;
   this.ElementNumber = ElementNumber;
   this.BranchName = BranchName;
   this.TopoID = TopoId;
   this.X = X;
   this.Y = Y;
   this.pointType = pt;
 }
Пример #10
0
        public CGRect AddPointOfType(PointType pointType, UITouch touch)
        {
            var previousPoint = Points.LastOrDefault ();
            var previousSequenceNumber = previousPoint != null ? previousPoint.SequenceNumber : -1;
            var point = new LinePoint (touch, previousSequenceNumber + 1, pointType);

            if (point.EstimationUpdateIndex != null && point.EstimatedPropertiesExpectingUpdates != 0)
                pointsWaitingForUpdatesByEstimationIndex [point.EstimationUpdateIndex] = point;

            Points.Add (point);
            return UpdateRectForLinePoint (point, previousPoint);
        }
Пример #11
0
 private void ShowShadow(Point point, PointType pointType)
 {
     if (pointType == PointType.Precision) //精确坐标点
     {
         Canvas.SetLeft(Shadow, point.X);
         Canvas.SetTop(Shadow, point.Y);
     }
     else  //偏移坐标点
     {
         Canvas.SetLeft(Shadow, point.X - this.x + this._ShadowX);
         Canvas.SetTop(Shadow, point.Y - this.y + this._ShadowX);
     }
 }
Пример #12
0
		public static string GetPointTypeString(PointType pt) {
			switch (pt) {
				case PointType.tractor:
					return "Extra";
				case PointType.junkCollision:
					return "Extra";
				case PointType.issHealth:
					return "Objectives";
				case PointType.issHit:
					return "Penalties";
				default:
					return "Extra";
			}
		}
Пример #13
0
		public CGRect AddPointAtLocation (CGPoint location, CGPoint preciseLocation, nfloat force, double timestamp, PointType type)
		{
			var point = new LinePoint (timestamp, force, location, preciseLocation, type);
			var updateRect = UpdateRectForLinePoint (point);

			var last = points.LastOrDefault ();
			if (last != null) {
				var lastRect = UpdateRectForLinePoint (last);
				updateRect.UnionWith (lastRect);
			}

			points.Add (point);
			return updateRect;
		}
Пример #14
0
        protected override PointType LocalNormalAt(PointType point, Intersection hit = null)
        {
            var dist = point.X * point.X + point.Z * point.Z;

            if (dist < 1 && point.Y >= Maximum - EPSILON)
            {
                return(PointType.Vector(0, 1, 0));
            }

            if (dist < 1 && point.Y <= Minimum + EPSILON)
            {
                return(PointType.Vector(0, -1, 0));
            }

            return(PointType.Vector(point.X, 0, point.Z));
        }
Пример #15
0
        private void CalculatePath()
        {
            DrawCanvas.Children.Clear();

            var proj = new obj.Projectile(
                PointType.Point(0, 1, 0),
                PointType.Vector(1, 1, 0).Normalize() * inc);
            var env = new obj.Environment(
                PointType.Vector(0, -0.1, 0),
                PointType.Vector(-0.01, 0, 0));

            foreach (var coord in obj.Projectile.GetTick(env, proj))
            {
                DrawCircle(coord.X, coord.Y);
            }
        }
Пример #16
0
        public BasePointItem(IConfigItem c, IProcessingManager processingManager, IStateUpdater stateUpdater, IConfiguration configuration, int i)
        {
            this.configItem        = c;
            this.processingManager = processingManager;
            this.stateUpdater      = stateUpdater;
            this.configuration     = configuration;
            this.alarm             = AlarmType.NO_ALARM;
            this.type     = c.RegistryType;
            this.address  = (ushort)(c.StartAddress + i);
            this.name     = $"{configItem.Description} [{i}]";
            this.rawValue = configItem.DefaultValue;
            this.pointId  = PointIdentifierHelper.GetNewPointId(new PointIdentifier(this.type, this.address));

            WriteCommand = new RelayCommand(WriteCommand_Execute, WriteCommand_CanExecute);
            ReadCommand  = new RelayCommand(ReadCommand_Execute);
        }
Пример #17
0
        public BasePointItem(IConfigItem c, IFunctionExecutor commandExecutor, IStateUpdater stateUpdater, IConfiguration configuration, int i)
        {
            this.configItem      = c;
            this.commandExecutor = commandExecutor;
            this.stateUpdater    = stateUpdater;
            this.configuration   = configuration;

            this.type     = c.RegistryType;
            this.address  = (ushort)(c.StartAddress + i);
            this.gid      = configItem.Gid;
            this.name     = $"{configItem.Description}";
            this.rawValue = (ushort)configItem.DefaultValue;
            commandExecutor.UpdatePointEvent += CommandExecutor_UpdatePointEvent;
            WriteCommand = new RelayCommand(WriteCommand_Execute, WriteCommand_CanExecute);
            ReadCommand  = new RelayCommand(ReadCommand_Execute);
        }
Пример #18
0
        internal string Format(PointType formatType)
        {
            string functionName = FUNCID.GetFunctionName(this.component, this.function);

            if (formatType == PointType.NameOnly)
            {
                return(functionName);
            }
            StringWriter writer = new StringWriter();

            switch (formatType)
            {
            case PointType.Entry:
                if (this.parms == null)
                {
                    writer.Write("{{  {0}", functionName);
                }
                else
                {
                    writer.Write("{{  {0} inputs {1}", functionName, this.parms);
                }
                break;

            case PointType.Exit:
                if (this.result == null)
                {
                    if (this.retCode == 0)
                    {
                        writer.Write("}}  {0} rc=OK", functionName);
                    }
                    else
                    {
                        writer.Write("}}! {0} rc=(Unknown({1}))", functionName, this.retCode);
                    }
                }
                else
                {
                    writer.Write("}}  {0} rc=OK returns [{1}]", functionName, this.result);
                }
                break;

            default:
                writer.Write("    {0} data={1}", functionName, this.retCode);
                break;
            }
            return(writer.ToString());
        }
Пример #19
0
        /// <summary>
        /// Calcula o histograma de uma das bandas da imagem.
        /// </summary>
        /// <param name="bmpData">Dados da imagem.</param>
        /// <param name="type">Banda a ser escolhida (Red, Green ou Blue).</param>
        /// <param name="imageHistogram">O histograma da imagem.</param>
        public static void ImageHistogram(ref byte[, ,] bmpData, PointType type, out int[] imageHistogram)
        {
            // tamanho do bitmap
            int width  = bmpData.GetUpperBound(0) + 1;
            int height = bmpData.GetUpperBound(1) + 1;

            // tamanho do histograma
            imageHistogram = new int[bmpData.GetLength(0)];

            // inicializa histograma
            for (int i = 0; i < imageHistogram.Length; ++i)
            {
                imageHistogram[i] = 0;
            }

            // calcula histograma
            if (type == PointType.Red)
            {
                for (int i = 0; i < width; ++i)
                {
                    for (int j = 0; j < height; ++j)
                    {
                        imageHistogram[bmpData[i, j, 0]]++;
                    }
                }
            }
            else if (type == PointType.Green)
            {
                for (int i = 0; i < width; ++i)
                {
                    for (int j = 0; j < height; ++j)
                    {
                        imageHistogram[bmpData[i, j, 1]]++;
                    }
                }
            }
            else
            {
                for (int i = 0; i < width; ++i)
                {
                    for (int j = 0; j < height; ++j)
                    {
                        imageHistogram[bmpData[i, j, 2]]++;
                    }
                }
            }
        }
        public static Point ToGeometry(this PointType point)
        {
            if (point.Item is DirectPositionType)
            {
                return(new Point(((DirectPositionType)point.Item).ToGeometry()));
            }
            if (point.Item is CoordinatesType)
            {
                return(new Point(((CoordinatesType)point.Item).ToGeometry().First()));
            }
            if (point.Item is CoordType)
            {
                return(new Point(((CoordType)point.Item).ToGeometry()));
            }

            throw new InvalidFormatException("invalid GML representation: gml:point is empty");
        }
Пример #21
0
        public string ToTypeStr(PointType type)
        {
            switch (type)
            {
            case PointType.Ushort:
                return("短整型");

            case PointType.Real:
                return("浮点型");

            case PointType.Bool:
                return("开关型");

            default:
                return("未知的数据类型");
            }
        }
Пример #22
0
        private ModbusFunctionCode?GetReadFunctionCode(PointType registryType)
        {
            switch (registryType)
            {
            case PointType.DIGITAL_OUTPUT: return(ModbusFunctionCode.READ_COILS);

            case PointType.DIGITAL_INPUT: return(ModbusFunctionCode.READ_DISCRETE_INPUTS);

            case PointType.ANALOG_INPUT: return(ModbusFunctionCode.READ_INPUT_REGISTERS);

            case PointType.ANALOG_OUTPUT: return(ModbusFunctionCode.READ_HOLDING_REGISTERS);

            case PointType.HR_LONG: return(ModbusFunctionCode.READ_HOLDING_REGISTERS);

            default: return(null);
            }
        }
Пример #23
0
    public void NewIsLand(IsLandShapeType islandType, PointType pointType, int numPoints, uint seed, uint variant)
    {
        switch (islandType)
        {
        case IsLandShapeType.Perlin:
            IslandShapeGen = IsLandShape.MakePerlin(seed);
            break;

        case IsLandShapeType.Radial:
            IslandShapeGen = IsLandShape.MakeRadial(seed);
            break;

        case IsLandShapeType.Square:
            IslandShapeGen = IsLandShape.MakeSquare(seed);
            break;

        default:
            break;
        }

        switch (pointType)
        {
        case PointType.Random:
            PointSelectorGen = PointSelector.generateRandom(MapSize, seed);
            break;

        case PointType.Relaxed:
            PointSelectorGen = PointSelector.generateRelaxed(MapSize, seed);
            break;

        case PointType.Square:
            PointSelectorGen = PointSelector.generateSquare(MapSize, seed);
            break;

        case PointType.Hexagon:
            PointSelectorGen = PointSelector.generateHexagon(MapSize, seed);
            break;

        default:
            break;
        }

        NeedsMoreRandomness = PointSelector.needsMoreRandomness(pointType);
        NumPoints           = numPoints;
        ParkMillerRng.Seed  = variant;
    }
Пример #24
0
    //获取摄像头位置
    public Transform GetCameraPoint(int id, PointType pointType)
    {
        if (pointType == PointType.start)
        {
            return(gameData.cameraPoint[id - 1].GetComponent <Transform>());
        }

        else if (pointType == PointType.camp)
        {
            return(gameData.cameraPoint2[id - 1].GetComponent <Transform>());
        }

        else
        {
            return(null);
        }
    }
Пример #25
0
        //=========================================================================================
        /// <summary>
        /// ポイントタイプ追加
        /// </summary>
        /// <param name="label"></param>
        /// <param name="col"></param>
        /// <param name="value"></param>
        public void AddPointType(string label, Color col, int value)
        {
            if (value2typeDict.ContainsKey(value))
            {
                return;
            }

            PointType pt = new PointType();

            pt.label = label;
            pt.col   = col;
            pt.value = value;
            pointTypeList.Add(pt);

            // 逆引き辞書登録
            value2typeDict[value] = pt;
        }
Пример #26
0
        public void ReleaseValue(PointType pointType, int index)
        {
            lock (Database.lockObject)
            {
                FixedValue fixedValue = null;
                if (Database.FixedValues.TryGetValue(new Tuple <int, PointType>(index, pointType), out fixedValue))
                {
                    Database.FixedValues.Remove(new Tuple <int, PointType>(index, pointType));

                    AnalogInputPoint analogInputPoint = null;
                    if (Database.AnalogInputPoints.TryGetValue(index, out analogInputPoint))
                    {
                        analogInputPoint.IsFixed = false;
                    }
                }
            }
        }
Пример #27
0
        public IActionResult AddPointType(EditPointTypeModel model)
        {
            PointType pointType = PointType.New();

            pointType.Description  = model.Description;
            pointType.DisplayOrder = model.DisplayOrder;
            pointType.QuotaDay     = model.QuotaDay;
            pointType.Typename     = model.Typename;
            pointType.Typekey      = Guid.NewGuid().ToString();
            bool result = pointTypeService.AddPointType(pointType);

            if (result)
            {
                return(Json(new StatusMessageData(StatusMessageType.Success, "添加成功!")));
            }
            return(Json(new StatusMessageData(StatusMessageType.Error, "添加失败!")));
        }
Пример #28
0
        public IActionResult _EditPointType(string Typekey)
        {
            if (string.IsNullOrWhiteSpace(Typekey))
            {
                return(Json(new StatusMessageData(StatusMessageType.Error, "找不到该积分类型!")));
            }
            PointType          pointType = pointTypeService.GetFullPointType(Typekey);
            EditPointTypeModel model     = new EditPointTypeModel()
            {
                DisplayOrder = pointType.DisplayOrder,
                QuotaDay     = pointType.QuotaDay,
                Typename     = pointType.Typename,
                Description  = pointType.Description
            };

            return(View(model));
        }
Пример #29
0
        private static void ShowPointTypeMode(Path2D aPathRaw, int aIndex, Selection aSelection, Matrix4x4 aTransform, Matrix4x4 aInvTransform, SerializedProperty aPath, Path2D.Plane aPlane, PathEditorVisuals aVisuals)
        {
            Handles.color = aVisuals.colorHandle * _activeHandleTint;
            Handles.CapFunction cap = aVisuals.capVertex;
            if (aVisuals.capVertexTypes != null)
            {
                cap = aVisuals.capVertexTypes[(int)aPathRaw.GetControls(aIndex).type];
            }
            Vector3 v = aTransform.MultiplyPoint3x4(Plane(aPathRaw[aIndex], aPlane));

            EditorGUIUtility.AddCursorRect(new Rect(0, 0, Screen.width, Screen.height), MouseCursor.RotateArrow);
            if (Handles.Button(v,
                               SceneView.lastActiveSceneView.camera.transform.rotation,
                               HandleUtility.GetHandleSize(v) * aVisuals.sizeVertexMode,
                               HandleUtility.GetHandleSize(v) * aVisuals.sizeVertexMode,
                               cap))
            {
                PointType t = aPathRaw.GetControls(aIndex).type;
                if (t == PointType.Auto)
                {
                    t = PointType.Locked;
                }
                else if (t == PointType.Free)
                {
                    t = PointType.Locked;
                }
                else if (t == PointType.Locked)
                {
                    t = PointType.CircleCorner;
                }
                else if (t == PointType.CircleCorner)
                {
                    t = PointType.Sharp;
                }
                else if (t == PointType.Sharp)
                {
                    t = PointType.Auto;
                }

                SerializedProperty pointControls = aPath.FindPropertyRelative("_pointControls");
                aSelection.Each(aIndex, i => pointControls.GetArrayElementAtIndex(i).FindPropertyRelative("type").enumValueIndex = (int)t);

                _recentInteract = aIndex;
                GUI.changed     = true;
            }
        }
Пример #30
0
        public Point(int id, PointColor c, PointType t, int maxM, List <int> lineList)
        {
            locate   = id;
            color    = c;
            type     = t;
            MaxMagic = maxM;
            magic    = maxM;
            line     = lineList;

            isUnpassable = false;
            isBroken     = false;
            isActivity   = false;
            isDefence    = false;
            isProtected  = false;

            buff = new List <BuffBasic>();
        }
Пример #31
0
    private IPoint FindPoint(PointType type)
    {
        if (points == null)
        {
            FillPoints();
        }
        int index = 0;

        for (int i = 0; i < points.Length; i++)
        {
            if (points[i].GetPointType() == type)
            {
                index = i;
            }
        }

        return(points[index]);
    }
Пример #32
0
    public void Choose(int x, int y)
    {
        if (points[x, y].PointType != PointType.Empty)
        {
            return;
        }

        points[x, y].PointType = State;
        Comfirm(x, y, State);
        if (State == PointType.White)
        {
            State = PointType.Black;
        }
        else
        {
            State = PointType.White;
        }
    }
Пример #33
0
        /// <summary>
        /// xml로 저장시 값을 저장해줌
        /// </summary>
        /// <returns></returns>
        public override Telerik.Windows.Diagrams.Core.SerializationInfo Serialize()
        {
            var result = base.Serialize();

            result["Index"]     = Index.ToString();
            result["PointType"] = PointType.ToString();

            result["NaviPointX"] = NaviPointX.ToString();
            result["NaviPointY"] = NaviPointY.ToString();

            //result["Description1"] = Description1 == null ? "" : Description1;
            //result["Description2"] = Description2 == null ? "" : Description2;
            //result["Description3"] = Description3 == null ? "" : Description3;
            //result["Description4"] = Description4 == null ? "" : Description4;
            //result["Description5"] = Description5 == null ? "" : Description5;

            return(result);
        }
Пример #34
0
        public void DrawPoint(Point point, int diameter, Color color, PointType pointType)
        {
            ValidateDiameter(diameter);

            var radius    = diameter / 2;
            var location  = new Point(point.X - radius, point.Y - radius);
            var size      = new Size(diameter, diameter);
            var pen       = new Pen(color);
            var rectangle = new Rectangle(location, size);

            _graphics.DrawEllipse(pen, rectangle);

            if (pointType == PointType.Filled)
            {
                var brush = new SolidBrush(color);
                _graphics.FillEllipse(brush, rectangle);
            }
        }
Пример #35
0
        public PointType AddPointType(string name)
        {
            var pointType = DataContext.PointTypes
                            .FirstOrDefault(
                x => x.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase));

            if (pointType != null)
            {
                return(null);                   //Тип {name} уже существует!
            }
            pointType = new PointType
            {
                Name = name
            };
            DataContext.PointTypes.Add(pointType);
            DataContext.SaveChanges();
            return(pointType);
        }
Пример #36
0
 public void UpdatePoints(PointType pointType, int points, int levelGoal)
 {
     if (levelPoints.ContainsKey(pointType))
     {
         levelPoints[pointType] += points;
     }
     else
     {
         levelPoints.Add(pointType, points);
     }
     if (pointType == PointType.Blue)
     {
         if (levelPoints[pointType] >= levelGoal)
         {
             uiPoints[0].text = "Done";
         }
         else
         {
             uiPoints[0].text = levelPoints[pointType].ToString() + "/" + levelGoal.ToString();
         }
     }
     if (pointType == PointType.Red)
     {
         if (levelPoints[pointType] >= levelGoal)
         {
             uiPoints[1].text = "Done";
         }
         else
         {
             uiPoints[1].text = levelPoints[pointType].ToString() + "/" + levelGoal.ToString();
         }
     }
     if (pointType == PointType.Yellow)
     {
         if (levelPoints[pointType] >= levelGoal)
         {
             uiPoints[2].text = "Done";
         }
         else
         {
             uiPoints[2].text = levelPoints[pointType].ToString() + "/" + levelGoal.ToString();
         }
     }
 }
Пример #37
0
        private void openButDropList_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd1 = new OpenFileDialog();

            ofd1.Filter = "Data files|*.dat|Saved data|*.csv";
            ofd1.Title  = "Select a data file";
            if (ofd1.ShowDialog() == DialogResult.OK)
            {
                currOpenedFile.LoadData(ofd1.FileName, ofd1.FilterIndex);
                consoleOut.Text      = "Success reading file";
                findPointBut.Enabled = true;
                dataView.Enabled     = true;
                this.Text            = defName + " [" + ofd1.FileName + "]";
            }
            plotType = PointType.Source;
            Drawing(true);
            tableType = PointType.Source;
            DisplayResults();
        }
Пример #38
0
        private async Task <bool> insertPointsDataset(PointsDataSet pointsDataset)
        {
            IEnumerable <PointType> pointTypes = PointType.GetPoints(pointsDataset);

            CassandraQueryBuilder queryBuilder = new CassandraQueryBuilder();

            queryBuilder.TableName = "points_by_dataset";
            queryBuilder.Type      = typeof(PointType);
            queryBuilder.QueryType = CassandraQueryBuilder.QueryTypes.InsertFromType;
            // if (pointsDataset.ZoomLevel != 0) queryBuilder.IgnoredColumnNames = new List<string>() { "displacements" };



            this.executionInstance.PrepareQuery(queryBuilder);

            try
            {
                await pointTypes.ParallelForEachAsync(async pointType =>
                {
                    await executionInstance.ExecuteNonQuery(new
                    {
                        pointType.dataset_id,
                        number = pointType.point_number,
                        pointType.longitude,
                        pointType.latitude,
                        pointType.height,
                        pointType.deformation_rate,
                        pointType.standard_deviation,
                        pointType.estimated_height,
                        pointType.estimated_deformation_rate,
                        pointType.observations,
                        pointType.displacements
                    });
                });
            }
            catch (Exception exception)
            {
                CoreContainers.LogsRepository.LogError(exception, Core.Database.Logs.LogTrigger.DataAccess);
            }


            return(true);
        }
Пример #39
0
        protected override PointType LocalNormalAt(PointType point, Intersection hit = null)
        {
            var maxC = Max(Math.Abs(point.X), Math.Abs(point.Y), Math.Abs(point.Z));

            if (maxC == Math.Abs(point.X))
            {
                return(PointType.Vector(point.X, 0, 0));
            }
            if (maxC == Math.Abs(point.Y))
            {
                return(PointType.Vector(0, point.Y, 0));
            }
            if (maxC == Math.Abs(point.Z))
            {
                return(PointType.Vector(0, 0, point.Z));
            }

            throw new Exception("No normal found");
        }
Пример #40
0
        private static Feature ConvertPoint(PointType point)
        {
            Feature feature = new Feature((Geometry) new OsmSharp.Geo.Geometries.Point(KmlFeatureStreamSource.ConvertCoordinates(point.coordinates)[0]));

            if (point.targetId != null)
            {
                feature.Attributes.Add("targetId", (object)point.targetId);
            }
            feature.Attributes.Add("altitude", (object)point.altitudeMode);
            if (point.extrude)
            {
                feature.Attributes.Add("extrude", (object)point.extrude);
            }
            if (point.id != null)
            {
                feature.Attributes.Add("id", (object)point.id);
            }
            return(feature);
        }
Пример #41
0
        private void addReverseGeocodeRequest(ref XLSType xLSType, string strPoint, string requestID)
        {
            RequestType requestType = xLSType.Request.Append();

            requestType.methodName.Value = "ReverseGeocodeRequest";

            ReverseGeocodeRequestType reverseGeocodeRequestType = requestType.ReverseGeocodeRequest.Append();

            ReverseGeocodePreferenceTypeType reverseGeocodePreferenceType = reverseGeocodeRequestType.ReverseGeocodePreference.Append();

            reverseGeocodePreferenceType.Value = "StreetAddress";

            PositionType positionType = reverseGeocodeRequestType.Position.Append();
            PointType    pointType    = positionType.Point.Append();

            DirectPositionType directPositionType = pointType.pos.Append();

            directPositionType.Value = strPoint;
        }
        private XLSType createRouteServiceRequest(double VDStart, double KDStart, double VDEnd, double KDEnd)
        {
            XlsDocument xLSDocument    = XlsDocument.CreateDocument();
            XLSType     xLSTypeRequest = xLSDocument.XLS.Append();

            // should be added one only
            RequestUtil.addXlsHeader(ref xLSTypeRequest);

            RequestType requestType = xLSTypeRequest.Request.Append();

            requestType.methodName.Value = "DetermineRouteRequest";

            DetermineRouteRequestType determineRouteRequest = requestType.DetermineRouteRequest.Append();

            RoutePlanType           routePlanType           = determineRouteRequest.RoutePlan.Append();
            RoutePreferenceTypeType routePreferenceTypeType = routePlanType.RoutePreference.Append();

            routePreferenceTypeType.Value = "Shortest";
            WayPointListType wayPointListType = routePlanType.WayPointList.Append();

            // start
            WayPointType       wayPointTypeStartPoint       = wayPointListType.StartPoint.Append();
            PositionType       positionTypeStartPoint       = wayPointTypeStartPoint.Position.Append();
            PointType          pointTypeStartPoint          = positionTypeStartPoint.Point.Append();
            DirectPositionType directPositionTypeStartPoint = pointTypeStartPoint.pos.Append();

            directPositionTypeStartPoint.Value = VDStart.ToString() + " " + KDStart.ToString();

            // end
            WayPointType       wayPointTypeEndPoint       = wayPointListType.EndPoint.Append();
            PositionType       positionTypeEndPoint       = wayPointTypeEndPoint.Position.Append();
            PointType          pointTypeEndPoint          = positionTypeEndPoint.Point.Append();
            DirectPositionType directPositionTypeEndPoint = pointTypeEndPoint.pos.Append();

            directPositionTypeEndPoint.Value = VDEnd.ToString() + " " + KDEnd.ToString();
            determineRouteRequest.RouteGeometryRequest.Append();
            // add this if need the text instructions
            RouteInstructionsRequestType routeInstructionsRequestType = determineRouteRequest.RouteInstructionsRequest.Append();

            routeInstructionsRequestType.format.Value = "text/plain";
            return(xLSTypeRequest);
        }
Пример #43
0
    void Compute()
    {
        Point point = null;

        if (GameManager.instance != null)
        {
            point = GameManager.instance.Point;
        }

/*
 #if UNITY_EDITOR
 *      if (point == null) {
 *                      point = new Point(-11,-1,-2,true);
 *              }
 #endif
 */

        _1st = point.GetHighestPoint();

        switch (_1st)
        {
        case PointType.PEACE:
        case PointType.VIOLENCE:
            other1 = point.GetHope();
            other2 = point.GetUsefulness();
            break;

        case PointType.MEANING:
        case PointType.FUN:
            other1 = point.GetHope();
            other2 = point.GetKind();
            break;

        case PointType.HUMANITY:
        case PointType.COMPASSION:
            other1 = point.GetUsefulness();
            other2 = point.GetKind();
            break;
        }

        special = !point.player;
    }
Пример #44
0
		public LinePoint (UITouch touch, int sequenceNumber, PointType pointType)
		{
			SequenceNumber = sequenceNumber;
			Type = touch.Type;
			PointType = pointType;

			Timestamp = touch.Timestamp;
			var view = touch.View;
			Location = touch.LocationInView (view);
			PreciseLocation = touch.GetPreciseLocation (view);
			AzimuthAngle = touch.GetAzimuthAngle (view);
			EstimatedProperties = touch.EstimatedProperties;
			EstimatedPropertiesExpectingUpdates = touch.EstimatedPropertiesExpectingUpdates;
			AltitudeAngle = touch.AltitudeAngle;
			Force = (Type == UITouchType.Stylus || touch.Force > 0) ? touch.Force : 1f;

			if (EstimatedPropertiesExpectingUpdates != 0)
				PointType = this.PointType.Add (PointType.NeedsUpdate);

			EstimationUpdateIndex = touch.EstimationUpdateIndex;
		}
Пример #45
0
 private static void DrawPoint(PointType type, PointDrawer point, Graphics g)
 {
     Pen MyPen;
     switch (type)
     {
         case PointType.CENTER:
             MyPen = new Pen(Color.Purple, 4);
             g.DrawEllipse(MyPen, (float)point.Longtitude, (float)point.Latitude, 8, 8);
             break;
         case PointType.EDAGE:
             MyPen = new Pen(Color.Blue, 2);
             g.DrawEllipse(MyPen, (float)point.Longtitude, (float)point.Latitude, 4, 4);
             break;
         case PointType.NORMAL:
             MyPen = new Pen(Color.White, 2);
             g.DrawEllipse(MyPen, (float)(point.Longtitude), (float)point.Latitude, 3, 3);
             break;
         case PointType.GROUP:
             MyPen = new Pen(Color.Blue, 3);
             g.DrawEllipse(MyPen, (float)point.Longtitude, (float)point.Latitude, 5, 5);
             break;
     }
 }
Пример #46
0
		public static void AddPointTypes(PointType[] pts) {
			foreach (PointType pt in pts) {
				points.Add(pt, 0);
			}
		}
Пример #47
0
 public void ShowShadow(Point mousePoint, PointType pointType)
 {
     if (pointType == PointType.Excursion)
     {
         plShadow.Points = this.GetPloyline(plShadow.Points, previousPoint, mousePoint);
         previousPoint = mousePoint;
     }
     else
     {
         plShadow.Points = GetMe();
     }
 }
 private List<DataPoint> GetDataPoints(PointType type, int categoryId, int itemId)
 {
     var points = new List<DataPoint>();
     var tempLabel = string.Empty;
     switch (type)
     {
         case PointType.Item:
             var itemDataSet = MySqlAccess.GetItemListFromSP(categoryId);
             foreach (DataRow row in itemDataSet.Tables[0].Rows)
             {
                 points.Add(new DataPoint { label = row.ItemArray[1].ToString(), y = Convert.ToInt32(row.ItemArray[3].ToString()), id = (int)row.ItemArray[0], sentimentValue = Convert.ToInt32(row.ItemArray[2].ToString()) });
             }
             break;
         case PointType.Feature:
             var featureDataSet = MySqlAccess.GetItemFeatureFromSP(itemId);
             foreach (DataRow row in featureDataSet.Tables[0].Rows)
             {
                 points.Add(new DataPoint { label = row.ItemArray[2].ToString(), y = Convert.ToInt32(row.ItemArray[4].ToString()), id = (int)row.ItemArray[1], sentimentValue = Convert.ToInt32(row.ItemArray[3].ToString()) });
             }
             break;
     }
     return points;
 }
Пример #49
0
 private static void DrawTexts(PointType type, TextDrawer[] t , Graphics g)
 {
     for (int i = 0; i < t.GetLength(0); i++)
     {
         DrawText(type, t[i], g);
     }
 }
Пример #50
0
		private static void AddPointsToDictionary(PointType pt, int value) {
			if (points.ContainsKey(pt)) {
				points[pt] += value;
			}
		}
Пример #51
0
 public SelectablePoint(Data.Value.IFCurve fcurve, Data.Value.IFCurveKey key, PointType type)
 {
     FCurve = fcurve;
     Key = key;
     Type = type;
 }
Пример #52
0
 public static PointType ToGmlPoint(this Point point)
 {
     PointType gmlPoint = new PointType();
     var gmlPos = ToGmlPos(point.Position);
     gmlPoint.srsDimension = gmlPos.srsDimension == "2" ? null : gmlPos.srsDimension;
     gmlPoint.Item = gmlPos;
     return gmlPoint;
 }
Пример #53
0
		public static void AddPoints(PointType pt, int value, GameObject go, Color color) {
			string sign = value < 0 ? "" : "+";
			PointFloater.Factory(go, sign + value, color);
			AddPointsToDictionary(pt, value);
		}
Пример #54
0
        public void WriteGpxPoint(GpxPoint point, PointType type)
        {
            if (point != null)
            {
                switch (type)
                {
                    case PointType.RoutePoint:
                        WriteStartElement("rtept");
                        break;
                    case PointType.TrackPoint:
                        WriteStartElement("trkpt");
                        break;
                    case PointType.WayPoint:
                    default:
                        WriteStartElement("wpt");
                        break;
                }

                WriteAttributeString("lat", point.Latitude.ToString());
                WriteAttributeString("lon", point.Longitude.ToString());

                if (point.Altitude != null)
                    WriteElementString("ele", point.Altitude.ToString());
                if (point.Time != null)
                    WriteElementString("time", point.Time.ToString());
                if (point.MagVar != null)
                    WriteElementString("magvar", point.MagVar.ToString());
                if (point.GeoidHeight != null)
                    WriteElementString("geoidheight", point.GeoidHeight.ToString());
                if (point.Name != null && point.Name != "")
                    WriteElementString("name", point.Name);
                if (point.Comment != null && point.Comment != "")
                    WriteElementString("cmt", point.Comment);
                if (point.Description != null && point.Description != "")
                    WriteElementString("desc", point.Description);
                if (point.Source != null && point.Source != "")
                    WriteElementString("src", point.Source);
                if (point.Link != null && point.Link != "")
                    WriteElementString("link", point.Link);
                if (point.Symmetry != null && point.Symmetry != "")
                    WriteElementString("sym", point.Symmetry);
                if (point.Fix != null)
                    WriteElementString("fix", point.Fix.ToString());
                if (point.SatteliteNum != null)
                    WriteElementString("sat", point.SatteliteNum.ToString());
                if (point.HDOP != null)
                    WriteElementString("hdop", point.HDOP.ToString());
                if (point.VDOP != null)
                    WriteElementString("vdop", point.VDOP.ToString());
                if (point.PDOP != null)
                    WriteElementString("pdop", point.PDOP.ToString());
                if (point.AgeOfData != null)
                    WriteElementString("ageofdata", point.AgeOfData.ToString());
                if (point.DGpsId != null && point.DGpsId != "")
                    WriteElementString("dgpsid", point.DGpsId);

                WriteGpxExtensions(point.Extensions);

                WriteEndElement();
            }
        }
Пример #55
0
 public void ShowShadow(Point point, PointType pointType, object sender)
 {
     if ((this.BeginElement == null && this.EndElement == null)
         || (this.BeginElement != null && this.EndElement != null && this.State == ElementState.Focus))
     {
         ShapeLine.ShowShadow(point, pointType);
     }
 }
Пример #56
0
 public void ShowShadow(Point point, PointType wf11PointType, object sender)
 {
     if (wf11PointType == PointType.Precision) //精确坐标点
     {
         Canvas.SetLeft(Shadow, point.X);
         Canvas.SetTop(Shadow, point.Y);
     }
     else  //偏移坐标点
     {
         Canvas.SetLeft(Shadow, point.X - this.x + this._ShadowX);
         Canvas.SetTop(Shadow, point.Y - this.y + this._ShadowX);
     }
     this.ShowLineShadow(sender);
 }
Пример #57
0
 public void AddPoint(Point p, PointType type)
 {
     Path.Add(p);
     Types.Add(type);
 }
Пример #58
0
		public static void AddPoints(PointType pt, int value) {
			AddPointsToDictionary(pt, value);
		}
Пример #59
0
		public static void AddPoints(PointType pt, int value, Vector3 screenPos, Color color) {
			string sign = value < 0 ? "" : "+";
			PointFloater.Factory(screenPos, sign + value, color);
			AddPointsToDictionary(pt, value);
		}
Пример #60
0
 public void Add(double ra, double dec, PointType pointType, string name)
 {
     Points.Add(new Linepoint(ra, dec, pointType, name));
 }