Beispiel #1
0
    private void Init(MarkerBase obj)
    {
        UnityEngine.Debug.Log("初始化!");
        var pos = MapHelper.instance.GeoToWorldPositon(obj.longitude, obj.latitude);

        obj.transform.localPosition = new Vector3(pos.x, hight, pos.z);
    }
Beispiel #2
0
        public MarkerBase markerBase;   // @brief Player,Enemy両方で使うcurrentMarkerの基底クラス

        public ShipObject(GameObject ship, float distance, int rank, MarkerBase markerBase)
        {
            this.ship       = ship;
            this.distance   = distance;
            this.rank       = rank;
            this.markerBase = markerBase;
        }
Beispiel #3
0
        /// <summary>
        /// Удалить объект Маркер из графика
        /// </summary>
        /// <param name="marker">Объект Маркер</param>
        public void RemoveMarker(MarkerBase marker)
        {
            var visual = marker.GetVisual();

            _chartData.RemoveVisual(visual);
            _markers.Remove(marker);
        }
Beispiel #4
0
        //fill the marker background
        public override void RenderElement(IRenderable element, Graphics graphics, Render render)
        {
            MarkerBase markerBase = element as MarkerBase;

            graphics.SmoothingMode = markerBase.SmoothingMode;
            if (markerBase.DrawBackground)
            {
                SolidBrush brush;
                brush = new SolidBrush(render.AdjustColor(markerBase.BackColor, 0, markerBase.Opacity));
                graphics.FillPath(brush, markerBase.GetPath());
            }

            base.RenderElement(element, graphics, render);

            //Draw any images and annotations
            if (markerBase.Image != null)
            {
                IFormsRenderer renderer = render.GetRenderer(markerBase.Image);
                renderer.RenderElement(markerBase.Image, graphics, render);
            }
            if (markerBase.Label != null)
            {
                IFormsRenderer renderer = render.GetRenderer(markerBase.Image);
                renderer.RenderElement(markerBase.Label, graphics, render);
            }
        }
Beispiel #5
0
        //fill the marker background
        public override void RenderShadow(IRenderable element, Graphics graphics, Render render)
        {
            MarkerBase markerBase  = element as MarkerBase;
            Layer      layer       = render.CurrentLayer;
            Color      shadowColor = render.AdjustColor(layer.ShadowColor, markerBase.BorderWidth, markerBase.Opacity);

            if (markerBase.DrawBackground)
            {
                SolidBrush brush = new SolidBrush(shadowColor);

                //Draw soft shadows
                if (layer.SoftShadows)
                {
                    shadowColor = Color.FromArgb(10, shadowColor);
                    graphics.CompositingQuality = CompositingQuality.HighQuality;
                    graphics.SmoothingMode      = SmoothingMode.HighQuality;
                }

                graphics.FillPath(brush, markerBase.GetPath());

                if (layer.SoftShadows)
                {
                    graphics.CompositingQuality = render.CompositingQuality;
                    graphics.SmoothingMode      = markerBase.SmoothingMode;
                }
            }

            base.RenderShadow(element, graphics, render);
        }
    private int rendererLine;          // @brief 描画するLineを指定

    /// <summary>
    /// @brief 初期化
    /// </summary>
    protected override void MarkerInitialize()
    {
        base.MarkerInitialize();

        playerObject = GameObject.Find("Player");
        markerBase   = playerObject.GetComponent <MarkerBase>();

        lineRenderer = GetComponent <LineRenderer>();

        startPosition = playerObject.transform.position;
        goalPosition  = hitMarkerList[markerBase.CurrentMarker].gameObject.transform.position;
        yondPosition  = hitMarkerList[markerBase.CurrentMarker + 1].gameObject.transform.position;
    }
Beispiel #7
0
    private GameObject gideArrow;       //GideArrowを格納する

    /// <summary>
    /// @breif 初期化
    /// </summary>
    protected override void MarkerInitialize()
    {
        base.MarkerInitialize();

        playerObject = GameObject.Find("Player");
        markerbase   = playerObject.GetComponent <MarkerBase>();

        startPosition = playerObject.transform.position;
        goalPosition  = lineMarkerList[markerbase.CurrentMarker].gameObject.transform.position;
        yondPosition  = lineMarkerList[markerbase.CurrentMarker + 1].gameObject.transform.position;

        this.transform.position = playerObject.transform.position + playerObject.transform.forward * 3.0f + Vector3.up * 0.5f;
        //gideArrow.transform.position = playerObject.transform.position + playerObject.transform.forward * 3.0f + Vector3.up * 0.5f;
    }
        //Renders a graphics marker
        protected virtual void RenderMarkerAction(MarkerBase marker, PointF markerPoint, PointF referencePoint, Graphics graphics, ControlRender render)
        {
            if (marker == null)
            {
                return;
            }

            //Save the graphics state
            Matrix gstate = graphics.Transform;

            //Apply the marker transform and render the marker
            graphics.Transform = Link.GetMarkerTransform(marker, markerPoint, referencePoint, graphics.Transform);

            IFormsRenderer renderer = render.GetRenderer(marker);

            renderer.RenderAction(marker, graphics, render);

            //Restore the graphics state
            graphics.Transform = gstate;
        }
Beispiel #9
0
		private string ExtractMarkerImplementation(MarkerBase marker, float rotation, bool invert)
		{
			GraphicsPath path = marker.GetPath();

			Matrix translateMatrix = new Matrix();
			RectangleF rectF = new RectangleF();

			rectF = path.GetBounds();

			translateMatrix.Translate(-rectF.X, -rectF.Y);
			path.Transform(translateMatrix);
			translateMatrix.Dispose();

			StringBuilder def = new StringBuilder();

			def.Append("<marker id=\"\" viewbox=\"0 0 ");

			//Add viewbox data
			def.Append(XmlConvert.ToString(Math.Round(rectF.Width, 2)));
			def.Append(" ");
			def.Append(XmlConvert.ToString(Math.Round(rectF.Height, 2)));
			def.Append("\" ");
			
			//Add ref x and y
			if (!invert)
			{
				def.Append("refX=\"");
				def.Append(XmlConvert.ToString(Math.Round(rectF.Width, 2)));
				def.Append("\" ");
			}
			def.Append("refY=\"");
			def.Append(XmlConvert.ToString(Math.Round(rectF.Height/2, 2)));
			def.Append("\" ");
			
			//Units
			def.Append("markerUnits=\"strokeWidth\" ");

			//markerWidth and Height
			def.Append("markerWidth=\"");
			def.Append(XmlConvert.ToString(Math.Round(rectF.Width, 2)));
			def.Append("\" ");
			def.Append("markerHeight=\"");
			def.Append(XmlConvert.ToString(Math.Round(rectF.Height, 2)));
			def.Append("\" ");

			//Orient
			def.Append("orient=\"auto\" ");

			//Stroke-width
			def.Append("stroke=\"");
			def.Append(Style.GetCompatibleColor(marker.BorderColor));
			def.Append("\" ");

			//Stroke-width
			def.Append("stroke-width=\"");
			def.Append(XmlConvert.ToString(Math.Round(marker.BorderWidth, 2)));
			def.Append("\" ");

			//Fill
			def.Append("fill=\"");
			
			if (marker.DrawBackground)
			{
				def.Append(Style.GetCompatibleColor(marker.BackColor));
			}
			else
			{
				def.Append("white");
			}
			def.Append("\" ");
			
			def.Append(">");

			//Append path
			if (mDefinition == null)
			{
				mDefinition = new Definition(marker.GetPath());
				mDefinition.IncludeId = false;
			}
			else
			{
				mDefinition.Path = marker.GetPath();
			}

			mDefinition.Rotate(rotation);
			def.Append(mDefinition.ExtractPath());

			//Close tag
			def.Append("</marker>");

			return def.ToString();
		}
Beispiel #10
0
		//Constructors
		//Create a new graphicspath holder
		public Marker(MarkerBase marker)
		{
			MarkerBase = marker;
		}
Beispiel #11
0
 //Constructors
 //Create a new graphicspath holder
 public Marker(MarkerBase marker)
 {
     MarkerBase = marker;
 }
Beispiel #12
0
 private void OnEndDrag(MarkerBase obj)
 {
     UnityEngine.Debug.Log("拖拽结束!");
 }
Beispiel #13
0
 private void OnRightClick(MarkerBase obj)
 {
     UnityEngine.Debug.Log("右击!");
 }
Beispiel #14
0
 private void OnLeftClick(MarkerBase obj)
 {
     UnityEngine.Debug.Log("左击!");
 }
Beispiel #15
0
 private void OnExit(MarkerBase obj)
 {
     UnityEngine.Debug.Log("移出!");
 }
Beispiel #16
0
 private void OnEnter(MarkerBase obj)
 {
     UnityEngine.Debug.Log("移入!");
 }
Beispiel #17
0
 private void OnDoubleClick(MarkerBase obj)
 {
     UnityEngine.Debug.Log("双击!");
 }
Beispiel #18
0
 private void OnDestory(MarkerBase obj)
 {
     UnityEngine.Debug.Log("销毁!");
 }
Beispiel #19
0
        private string ExtractMarkerImplementation(MarkerBase marker, float rotation, bool invert)
        {
            GraphicsPath path = marker.GetPath();

            Matrix     translateMatrix = new Matrix();
            RectangleF rectF           = new RectangleF();

            rectF = path.GetBounds();

            translateMatrix.Translate(-rectF.X, -rectF.Y);
            path.Transform(translateMatrix);
            translateMatrix.Dispose();

            StringBuilder def = new StringBuilder();

            def.Append("<marker id=\"\" viewbox=\"0 0 ");

            //Add viewbox data
            def.Append(XmlConvert.ToString(Math.Round(rectF.Width, 2)));
            def.Append(" ");
            def.Append(XmlConvert.ToString(Math.Round(rectF.Height, 2)));
            def.Append("\" ");

            //Add ref x and y
            if (!invert)
            {
                def.Append("refX=\"");
                def.Append(XmlConvert.ToString(Math.Round(rectF.Width, 2)));
                def.Append("\" ");
            }
            def.Append("refY=\"");
            def.Append(XmlConvert.ToString(Math.Round(rectF.Height / 2, 2)));
            def.Append("\" ");

            //Units
            def.Append("markerUnits=\"strokeWidth\" ");

            //markerWidth and Height
            def.Append("markerWidth=\"");
            def.Append(XmlConvert.ToString(Math.Round(rectF.Width, 2)));
            def.Append("\" ");
            def.Append("markerHeight=\"");
            def.Append(XmlConvert.ToString(Math.Round(rectF.Height, 2)));
            def.Append("\" ");

            //Orient
            def.Append("orient=\"auto\" ");

            //Stroke-width
            def.Append("stroke=\"");
            def.Append(Style.GetCompatibleColor(marker.BorderColor));
            def.Append("\" ");

            //Stroke-width
            def.Append("stroke-width=\"");
            def.Append(XmlConvert.ToString(Math.Round(marker.BorderWidth, 2)));
            def.Append("\" ");

            //Fill
            def.Append("fill=\"");

            if (marker.DrawBackground)
            {
                def.Append(Style.GetCompatibleColor(marker.BackColor));
            }
            else
            {
                def.Append("white");
            }
            def.Append("\" ");

            def.Append(">");

            //Append path
            if (mDefinition == null)
            {
                mDefinition           = new Definition(marker.GetPath());
                mDefinition.IncludeId = false;
            }
            else
            {
                mDefinition.Path = marker.GetPath();
            }

            mDefinition.Rotate(rotation);
            def.Append(mDefinition.ExtractPath());

            //Close tag
            def.Append("</marker>");

            return(def.ToString());
        }
Beispiel #20
0
 /// <summary>
 /// Добавить объект Маркер в график
 /// </summary>
 /// <param name="marker">Объект Маркер</param>
 /// <param name="isLeftAxis">true-по левой шкале Y, по умолчанию - по правой</param>
 public void AddMarker(MarkerBase marker, bool isLeftAxis = false)
 {
     _chartData.AddVisual(marker.GetVisual(), isLeftAxis);
     _markers.Add(marker);
 }