/// <summary>コピーコンストラクタ。</summary>
		/// <param name="previous"></param>
		public VirtualGraphics(VirtualGraphics previous)
			{
			Layers = new VirtualLayerCollection( this );
			foreach( VirtualLayer layer in previous.Layers ) Layers.Add( new VirtualLayer( layer ) );
			AxesLine = (Pen)previous.AxesLine.Clone();
			Background = previous.Background;
			GlobalOffset = previous.GlobalOffset;
			ViewOffset = previous.ViewOffset;
			ViewScale = previous.ViewScale;
			Mirroring = previous.Mirroring;
			}
예제 #2
0
 /// <summary>コピーコンストラクタ。</summary>
 /// <param name="previous"></param>
 public VirtualGraphics(VirtualGraphics previous)
 {
     Layers = new VirtualLayerCollection(this);
     foreach (VirtualLayer layer in previous.Layers)
     {
         Layers.Add(new VirtualLayer(layer));
     }
     AxesLine     = (Pen)previous.AxesLine.Clone();
     Background   = previous.Background;
     GlobalOffset = previous.GlobalOffset;
     ViewOffset   = previous.ViewOffset;
     ViewScale    = previous.ViewScale;
     Mirroring    = previous.Mirroring;
 }
예제 #3
0
        void OutlineView_Paint(object sender, PaintEventArgs e)
        {
            if (ViewerTarget == null)
            {
                return;
            }
            VirtualGraphics vg = new VirtualGraphics(ViewerTarget.VirtualGraphics);
            //for( int i = vg.Shapes.Count - 1 ; i >= 0 ; i-- ) if( vg.Shapes[i].GetType() == typeof( VirtualString ) ) vg.Shapes.RemoveAt( i );

            PointD LeftTop     = new PointD();
            PointD RightBottom = new PointD(ViewerTarget.Width, ViewerTarget.Height);

            LeftTop     = ViewerTarget.VirtualGraphics.FromViewToGlobal(LeftTop);
            RightBottom = ViewerTarget.VirtualGraphics.FromViewToGlobal(RightBottom);

            double X = Math.Min(LeftTop.X, RightBottom.X),
                   Y = Math.Min(LeftTop.Y, RightBottom.Y),
                   W = Math.Max(LeftTop.X, RightBottom.X) - X,
                   H = Math.Max(LeftTop.Y, RightBottom.Y) - Y;

            if (W < 1)
            {
                X -= 0.5; W += 1;
            }
            if (H < 1)
            {
                Y -= 0.5; H += 1;
            }

            VirtualRectangle rect = new VirtualRectangle();

            rect.Location = new PointD(X, Y);
            rect.Size     = new SizeD(W, H);

            rect.ShapeBorder = (FocusBoxBorder != null) ? FocusBoxBorder : DefaultFocusBoxBorder;
            rect.ShapeFill   = (FocusBoxFill != null) ? FocusBoxFill : DefaultFocusBoxFill;

            //vg.Shapes.Add( rect );

            vg.AxesLine = null;
            vg.MoveViewToPerspective(e.Graphics, ViewPadding);
            vg.Mirroring = new SizeD(1, -1);
            vg.RenderToView(e.Graphics);
        }
예제 #4
0
		void OutlineView_Paint(object sender, PaintEventArgs e)
			{
			if( ViewerTarget == null ) return;
			VirtualGraphics vg = new VirtualGraphics(ViewerTarget.VirtualGraphics);
			//for( int i = vg.Shapes.Count - 1 ; i >= 0 ; i-- ) if( vg.Shapes[i].GetType() == typeof( VirtualString ) ) vg.Shapes.RemoveAt( i );

			PointD LeftTop = new PointD();
			PointD RightBottom = new PointD( ViewerTarget.Width, ViewerTarget.Height );

			LeftTop = ViewerTarget.VirtualGraphics.FromViewToGlobal( LeftTop );
			RightBottom = ViewerTarget.VirtualGraphics.FromViewToGlobal( RightBottom );

			double X = Math.Min( LeftTop.X, RightBottom.X ),
				Y = Math.Min( LeftTop.Y, RightBottom.Y ),
				W = Math.Max( LeftTop.X, RightBottom.X ) - X,
				H = Math.Max( LeftTop.Y, RightBottom.Y ) - Y;

			if( W < 1 ) { X -= 0.5; W += 1; }
			if( H < 1 ) { Y -= 0.5; H += 1; }

			VirtualRectangle rect = new VirtualRectangle();
			rect.Location = new PointD( X, Y );
			rect.Size = new SizeD( W, H );

			rect.ShapeBorder = ( FocusBoxBorder != null ) ? FocusBoxBorder : DefaultFocusBoxBorder;
			rect.ShapeFill = ( FocusBoxFill != null ) ? FocusBoxFill : DefaultFocusBoxFill;

			//vg.Shapes.Add( rect );

			vg.AxesLine = null;
			vg.MoveViewToPerspective( e.Graphics, ViewPadding );
			vg.Mirroring= new SizeD( 1, -1 ) ;
			vg.RenderToView( e.Graphics );


			}
 internal VirtualLayerCollection(VirtualGraphics parent)
 {
     ParentGraphics = parent;
     AlwaysTopLayer = null;
 }
		/// <summary>コピーコンストラクタ。</summary>
		/// <param name="previous"></param>
		public WaveguideDesignerProjectData(WaveguideDesignerProjectData previous) : base( previous )
			{
			VirtualGraphics = new VirtualGraphics();

			Layers = new LayerList( previous.Layers );
			Materials = new MaterialList( previous.Materials );
			ProjectManifest = new ProjectManifestData( previous.ProjectManifest );
			GlobalRenderingSetting = new GlobalRenderingSettingData( previous.GlobalRenderingSetting );
			GlobalStructureNumerics = new GlobalStructureNumericsData( previous.GlobalStructureNumerics );

			_Projects.Add( this );
			}
		/// <summary>デフォルトコンストラクタ。</summary>
		public WaveguideDesignerProjectData()
			{
			VirtualGraphics = new VirtualGraphics();

			Name = "New Project";
			Layers = new LayerList();
			Materials = new MaterialList();
			ProjectManifest = new ProjectManifestData();
			GlobalRenderingSetting = new GlobalRenderingSettingData();
			GlobalStructureNumerics = new GlobalStructureNumericsData();

			_Projects.Add( this );
			}