示例#1
0
        public ArrowDialog( VectorSetting setting )
        {
            InitializeComponent();

            this.previewSetting = new VectorSetting();
            this.set = setting;
        }
示例#2
0
        /// <summary>
        /// 新しいベクトル描画マネージャを作成します。
        /// </summary>
        /// <param name="g">グラフィックデバイス</param>
        /// <param name="arrow">矢印の設定オブジェクト</param>
        /// <param name="MaxValue">データの最大値</param>
        public ArrowDrawer( Graphics g, VectorSetting arrow, double MaxValue, double MinValue )
        {
            this.Arrow = arrow;
            this.G = g;

            this.maxValue = MaxValue;
            this.minValue = MinValue;
            this.refValue = arrow.ReferredLength;
            this.unitLength = 500/20.0;
            this.magnitude = this.Arrow.Length/100.0/this.refValue*this.unitLength*2;
            this.tipMagnitude = this.Arrow.TipLength/100.0*this.magnitude;
            this.halfTipAngle = arrow.TipAngle/180.0*Math.PI/2.0;
            this.tan_halfTipAngle = Math.Tan( this.halfTipAngle );
            this.linePen = new Pen( arrow.LineColor, arrow.LineWidth );
            this.innerBrush = new SolidBrush( arrow.InnerColor );

            switch( arrow.TipType )
            {
                case TipType.FillTriangle:
                    this.arrowDrawer = this.drawTrAnglArrow;
                    break;
                case TipType.LineTip:
                    this.arrowDrawer = this.drawLineArrow;
                    break;
                default:
                    throw new NotImplementedException();
            }
            if( arrow.FixTipSize )
            {
                this.pointCalculator = this.calcFixPoints;
            }
            else
            {
                this.pointCalculator = this.calcVarPoints;
            }
            if( arrow.Colorful )
            {
                this.lineColorSetter = this.setColorfulColor;
                this.innerColorSetter = this.setColorfulColor;
            }
            else
            {
                this.lineColorSetter = this.setFixedPenColor;
                this.innerColorSetter = this.setFixedBrushColor;
            }
        }
示例#3
0
 /// <summary>
 /// 設定を別の ArrowSettings クラスへコピーします。
 /// </summary>
 /// <param name="arrow">コピー先の ArrowSettings クラス</param>
 public void CopyTo( VectorSetting arrow )
 {
     arrow.Colorful = this.Colorful;
     arrow.FixTipSize = this.FixTipSize;
     arrow.InnerColor = this.InnerColor;
     arrow.Length = this.Length;
     arrow.LineColor = this.LineColor;
     arrow.TipType = this.TipType;
     arrow.TipAngle = this.TipAngle;
     arrow.TipLength = this.TipLength;
 }