Exemplo n.º 1
0
 /// <summary>Draws the grip in the graphics context.</summary>
 /// <param name="g">Graphics context.</param>
 /// <param name="pageScale">Current zoom factor that can be used to calculate pen width etc. for displaying the handle. Attention: this factor must not be used to transform the path of the handle.</param>
 public void Show(IOverlayContext3D g)
 {
     foreach (var ele in GripList)
     {
         ele.Show(g);
     }
 }
            /// <summary>Draws the grip in the graphics context.</summary>
            /// <param name="g">Graphics context.</param>
            public void Show(IOverlayContext3D g)
            {
                var buf = g.PositionColorLineListBuffer;

                foreach (var line in _displayedPath.AsLines)
                {
                    buf.AddLine(line.P0.X, line.P0.Y, line.P0.Z, line.P1.X, line.P1.Y, line.P1.Z, 0, 0, 1, 1);
                }
            }
Exemplo n.º 3
0
        public void SetMarkerGeometry(IOverlayContext3D markerGeometry)
        {
            if (null == markerGeometry)
            {
                throw new ArgumentNullException();
            }

            _scene.SetMarkerGeometry((D3D10OverlayContext)markerGeometry);
        }
Exemplo n.º 4
0
        public void SetOverlayGeometry(IOverlayContext3D overlayGeometry)
        {
            if (null == overlayGeometry)
            {
                throw new ArgumentNullException();
            }

            _scene.SetOverlayGeometry((D3D10OverlayContext)overlayGeometry);
        }
Exemplo n.º 5
0
        /// <summary>
        /// This function is called just after the paint event. The graphic context is in graph coordinates.
        /// </summary>
        /// <param name="g"></param>
        public override void AfterPaint(IOverlayContext3D g)
        {
            {
                DisplayedGrips = GetGripsFromSelectedObjects(); // Update grip positions according to the move
                DisplayGrips(g);
            }

            base.AfterPaint(g);
        }
            /// <summary>Draws the grip in the graphics context.</summary>
            /// <param name="g">Graphics context.</param>
            public void Show(IOverlayContext3D g)
            {
                var buf = g.PositionColorLineListBuffer;

                var vec  = new VectorD3D(_gripRadius, _gripRadius, _gripRadius);
                var rect = new RectangleD3D(_gripCenter - vec, 2 * vec);

                foreach (var line in rect.Edges)
                {
                    buf.AddLine(line.P0.X, line.P0.Y, line.P0.Z, line.P1.X, line.P1.Y, line.P1.Z, 1, 0, 0, 1);
                }
            }
Exemplo n.º 7
0
        /// <summary>
        /// Draws the <see cref="DisplayedGrips"/> on the graphics context.
        /// </summary>
        /// <param name="g">Graphics context.</param>
        public void DisplayGrips(IOverlayContext3D g)
        {
            if (null == DisplayedGrips || DisplayedGrips.Length == 0)
            {
                return;
            }

            for (int i = 0; i < DisplayedGrips.Length; i++)
            {
                DisplayedGrips[i].Show(g);
            }
        }
        /// <summary>
        /// Draws the temporary line(s) from the first point to the mouse.
        /// </summary>
        /// <param name="g"></param>
        public override void AfterPaint(IOverlayContext3D g)
        {
            base.AfterPaint(g);

            PointD3D p0, p1;

            for (int i = 1; i < _currentPoint; i++)
            {
                // first transform this points to root layer coordinates
                p0 = _cachedActiveLayerTransformation.Transform(_Points[i - 1]);
                p1 = _cachedActiveLayerTransformation.Transform(_Points[i]);
                g.PositionColorLineListBuffer.AddLine(p0.X, p0.Y, p0.Z, p1.X, p1.Y, p1.Z, 0, 0, 1, 1);
            }

            if (_currentPoint > 0)
            {
                p0 = _cachedActiveLayerTransformation.Transform(_Points[_currentPoint - 1]);
                p1 = _cachedActiveLayerTransformation.Transform(_positionCurrentMouseInActiveLayerCoordinates);
                g.PositionColorLineListBuffer.AddLine(p0.X, p0.Y, p0.Z, p1.X, p1.Y, p1.Z, 0, 0, 1, 1);
            }
        }
Exemplo n.º 9
0
 /// <summary>
 /// This function is called just after the paint event. The graphic context is in graph coordinates.
 /// </summary>
 /// <param name="g"></param>
 public virtual void AfterPaint(IOverlayContext3D g)
 {
 }
Exemplo n.º 10
0
		/// <summary>
		/// This function is called just after the paint event. The graphic context is in graph coordinates.
		/// </summary>
		/// <param name="g"></param>
		public override void AfterPaint(IOverlayContext3D g)
		{
			{
				DisplayedGrips = GetGripsFromSelectedObjects(); // Update grip positions according to the move
				DisplayGrips(g);
			}

			base.AfterPaint(g);
		}
Exemplo n.º 11
0
		/// <summary>
		/// Draws the <see cref="DisplayedGrips"/> on the graphics context.
		/// </summary>
		/// <param name="g">Graphics context.</param>
		public void DisplayGrips(IOverlayContext3D g)
		{
			if (null == DisplayedGrips || DisplayedGrips.Length == 0)
				return;

			for (int i = 0; i < DisplayedGrips.Length; i++)
				DisplayedGrips[i].Show(g);
		}
Exemplo n.º 12
0
			/// <summary>Draws the grip in the graphics context.</summary>
			/// <param name="g">Graphics context.</param>
			/// <param name="pageScale">Current zoom factor that can be used to calculate pen width etc. for displaying the handle. Attention: this factor must not be used to transform the path of the handle.</param>
			public void Show(IOverlayContext3D g)
			{
				foreach (var ele in GripList)
					ele.Show(g);
			}
Exemplo n.º 13
0
		public void SetOverlayGeometry(IOverlayContext3D overlayGeometry)
		{
			if (null == overlayGeometry)
				throw new ArgumentNullException();

			_scene.SetOverlayGeometry((D3D10OverlayContext)overlayGeometry);
		}
Exemplo n.º 14
0
		public void SetMarkerGeometry(IOverlayContext3D markerGeometry)
		{
			if (null == markerGeometry)
				throw new ArgumentNullException();

			_scene.SetMarkerGeometry((D3D10OverlayContext)markerGeometry);
		}
Exemplo n.º 15
0
		/// <summary>
		/// This function is called just after the paint event. The graphic context is in graph coordinates.
		/// </summary>
		/// <param name="g"></param>
		public virtual void AfterPaint(IOverlayContext3D g)
		{
		}
Exemplo n.º 16
0
		public void DrawRootLayerMarkers(IOverlayContext3D gc)
		{
			var buf = gc.PositionColorIndexedTriangleBuffers;

			VectorD3D size = Doc.RootLayer.Size;

			double markerLen = Math.Max(size.X, Math.Max(size.Y, size.Z)) / 20.0;
			double markerLenBy2 = markerLen / 2;
			double markerThicknessBy2 = markerLenBy2 / 5.0;

			RectangleD3D rect = new RectangleD3D(PointD3D.Empty, size);

			if (_cachedResultingRootLayerMarkersVisibility.HasFlag(RootLayerMarkersVisibility.Arrows))
			{
				foreach (var pos in rect.Vertices)
				{
					var posX = pos.WithXPlus(pos.X == 0 ? markerLenBy2 : -markerLenBy2);
					DrawMarkerX(buf, posX, markerLenBy2, markerThicknessBy2);

					var posY = pos.WithYPlus(pos.Y == 0 ? markerLenBy2 : -markerLenBy2);
					DrawMarkerY(buf, posY, markerLenBy2, markerThicknessBy2);

					var posZ = pos.WithZPlus(pos.Z == 0 ? markerLenBy2 : -markerLenBy2);
					DrawMarkerZ(buf, posZ, markerLenBy2, markerThicknessBy2);
				}
			}

			if (_cachedResultingRootLayerMarkersVisibility.HasFlag(RootLayerMarkersVisibility.Lines))
			{
				var lineBuffer = gc.PositionColorLineListBuffer;
				foreach (var line in rect.Edges)
				{
					lineBuffer.AddLine(line.P0.X, line.P0.Y, line.P0.Z, line.P1.X, line.P1.Y, line.P1.Z, 1, 0, 0, 1);
				}
			}
		}
Exemplo n.º 17
0
			/// <summary>Draws the grip in the graphics context.</summary>
			/// <param name="g">Graphics context.</param>
			public void Show(IOverlayContext3D g)
			{
				var buf = g.PositionColorLineListBuffer;

				var vec = new VectorD3D(_gripRadius, _gripRadius, _gripRadius);
				var rect = new RectangleD3D(_gripCenter - vec, 2 * vec);

				foreach (var line in rect.Edges)
					buf.AddLine(line.P0.X, line.P0.Y, line.P0.Z, line.P1.X, line.P1.Y, line.P1.Z, 1, 0, 0, 1);
			}
Exemplo n.º 18
0
			/// <summary>Draws the grip in the graphics context.</summary>
			/// <param name="g">Graphics context.</param>
			public void Show(IOverlayContext3D g)
			{
				var buf = g.PositionColorLineListBuffer;
				foreach (var line in _displayedPath.AsLines)
				{
					buf.AddLine(line.P0.X, line.P0.Y, line.P0.Z, line.P1.X, line.P1.Y, line.P1.Z, 0, 0, 1, 1);
				}
			}
Exemplo n.º 19
0
		/// <summary>
		/// Draws the temporary line(s) from the first point to the mouse.
		/// </summary>
		/// <param name="g"></param>
		public override void AfterPaint(IOverlayContext3D g)
		{
			base.AfterPaint(g);

			PointD3D p0, p1;

			for (int i = 1; i < this._currentPoint; i++)
			{
				// first transform this points to root layer coordinates
				p0 = _cachedActiveLayerTransformation.Transform(_Points[i - 1]);
				p1 = _cachedActiveLayerTransformation.Transform(_Points[i]);
				g.PositionColorLineListBuffer.AddLine(p0.X, p0.Y, p0.Z, p1.X, p1.Y, p1.Z, 0, 0, 1, 1);
			}

			if (_currentPoint > 0)
			{
				p0 = _cachedActiveLayerTransformation.Transform(_Points[_currentPoint - 1]);
				p1 = _cachedActiveLayerTransformation.Transform(_positionCurrentMouseInActiveLayerCoordinates);
				g.PositionColorLineListBuffer.AddLine(p0.X, p0.Y, p0.Z, p1.X, p1.Y, p1.Z, 0, 0, 1, 1);
			}
		}