/// <summary>デフォルトコンストラクタ。</summary> public FluxAnalysisData() { _FluxDirection = Direction.X; Center = new Vector3(); Size = new Vector3(); Name = "flux"; VirtualShape = new VirtualLine(); }
/// <summary>コピーコンストラクタ。</summary> /// <param name="previous"></param> public FluxAnalysisData(FluxAnalysisData previous) : base(previous) { CenterWavelength = previous.CenterWavelength; WavelengthSpan = previous.WavelengthSpan; PointNum = previous.PointNum; FluxDirection = previous.FluxDirection; Center = previous.Center; Size = previous.Size; VirtualShape = new VirtualLine(); }
/// <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); } } }
private void AddLine(int virtualLineIndex, int width) { int v0, v1, v2, v3; v0 = totalRealVertices; v1 = totalRealVertices + 1; v2 = totalRealVertices + 2; v3 = totalRealVertices + 3; virtualLines[virtualLineIndex] = new VirtualLine(); virtualLines[virtualLineIndex].v0 = v0; virtualLines[virtualLineIndex].v1 = v1; virtualLines[virtualLineIndex].v2 = v2; virtualLines[virtualLineIndex].v3 = v3; virtualLines[virtualLineIndex].widthLevel = width; lightningPoints[v0].TextureCoordinates = new Vector2(0, 0); lightningPoints[v0].ColorGradient = new Vector2(1, 0); lightningPoints[v1].TextureCoordinates = new Vector2(1, 0); lightningPoints[v1].ColorGradient = new Vector2(1, 0); lightningPoints[v2].TextureCoordinates = new Vector2(1, 1); lightningPoints[v2].ColorGradient = new Vector2(-1, 0); lightningPoints[v3].TextureCoordinates = new Vector2(0, 1); lightningPoints[v3].ColorGradient = new Vector2(-1, 0); indices[totalIndices] = v0; indices[totalIndices + 1] = v1; indices[totalIndices + 2] = v2; indices[totalIndices + 3] = v0; indices[totalIndices + 4] = v2; indices[totalIndices + 5] = v3; totalRealVertices += 4; totalIndices += 6; }