Пример #1
0
 /// <summary>コピーコンストラクタ。</summary>
 /// <param name="previous"></param>
 public VirtualShapeBase(VirtualShapeBase previous)
 {
     Visible         = previous.Visible;
     ParentLayer     = null;
     Tag             = previous.Tag;
     ShapeFill       = previous.ShapeFill;
     ShapeBorder     = previous.ShapeBorder;
     DoesGlobalScale = previous.DoesGlobalScale;
 }
		/// <summary>コピーコンストラクタ。</summary>
		/// <param name="previous"></param>
		public VirtualShapeBase(VirtualShapeBase previous)
			{
			Visible = previous.Visible;
			ParentLayer = null;
			Tag = previous.Tag;
			ShapeFill = previous.ShapeFill;
			ShapeBorder = previous.ShapeBorder;
			DoesGlobalScale = previous.DoesGlobalScale;
			}
Пример #3
0
		/// <summary>バーチャルシェイプを更新する。</summary>
		public void UpdateVirtualShape()
			{
			if( Size.Amplitude == 0 )
				{
				VirtualEllipse ellipse = VirtualShape as VirtualEllipse ?? new VirtualEllipse();
				ellipse.Center = new PointD( Center.X, Center.Y );
				ellipse.Radius = new SizeD( 3, 3 );
				ellipse.DoesGlobalScale = false;
				VirtualShape = ellipse;
				}
			else if( Size.X == 0 || Size.Y == 0 )
				{
				VirtualLine line = VirtualShape as VirtualLine ?? new VirtualLine();
				PointD p1, p2;
				p1 = new PointD( Center.X - Size.X / 2, Center.Y - Size.Y / 2 );
				p2 = new PointD( Center.X + Size.X / 2, Center.Y + Size.Y / 2 );
				line.Vertices = new PointD[] { p1, p2 };
				line.DoesGlobalScale = false;
				VirtualShape = line;
				}
			else
				{
				VirtualRectangle rect = VirtualShape as VirtualRectangle ?? new VirtualRectangle();
				rect.Location = new PointD( Center.X - Size.X / 2, Center.Y - Size.Y / 2 );
				rect.Size = new SizeD( Size.X, Size.Y );
				rect.DoesGlobalScale = false;
				VirtualShape = rect;
				}
			VirtualShape.ShapeFill = Brushes.Red;
			VirtualShape.ShapeBorder = new Pen( Brushes.Red, 3 );

			if( ( Parent as ProjectManifestData ) != null )
				if( !( Parent as ProjectManifestData ).ManifestVisualizingLayer.Shapes.Contains( VirtualShape ) )
					( Parent as ProjectManifestData ).ManifestVisualizingLayer.Shapes.Add( VirtualShape );
			}