Пример #1
0
 private void CreateZAxisLabels()
 {
     for (int i = 0; i < _zAxisMayorTicks.Count; i++)
     {
         TickLabelVisual3D yozMayorTickLabel = new TickLabelVisual3D(this.TicksProvider.GetLabelText(_zAxisMayorTicks[i]), Brushes.Black, true, _ticklabelHeight, new Point3D(-0.3, _length + 0.1, _zAxisMayorTicks[i].AxisValue), Location.Start, new Vector3D(0.0, 1.0, 0.0), new Vector3D(0.0, 0.0, 1.0));
         TickLabelVisual3D xozMayorTickLabel = new TickLabelVisual3D(this.TicksProvider.GetLabelText(_zAxisMayorTicks[i]), Brushes.Black, true, _ticklabelHeight, new Point3D(_length + 0.1, -0.3, _zAxisMayorTicks[i].AxisValue), Location.End, new Vector3D(-1.0, 0.0, 0.0), new Vector3D(0.0, 0.0, 1.0));
         _yozZAxisTickLabels.Children.Add(yozMayorTickLabel);
         _xozZAxisTickLabels.Children.Add(xozMayorTickLabel);
         if (_maxZAxisTickWidth < yozMayorTickLabel.ScreenWidth)
         {
             _maxZAxisTickWidth = yozMayorTickLabel.ScreenWidth;
         }
     }
     if (_zAxisMayorTicks.Count > 1)
     {
         _yozZAxisTitle = new TickLabelVisual3D("Z Axis", Brushes.Black, true, _axisTitleHeight, new Point3D(-0.1, _length + _axisLabelDistance, _length / 2.0), Location.Center, new Vector3D(0.0, 1.0, 0.0), new Vector3D(0.0, 0.0, 1.0));
         _xozZAxisTitle = new TickLabelVisual3D("Z Axis", Brushes.Black, true, _axisTitleHeight, new Point3D(_length + _axisLabelDistance, -0.1, _length / 2.0), Location.Center, new Vector3D(-1.0, 0.0, 0.0), new Vector3D(0.0, 0.0, 1.0));
         _axisTitleGroup.Children.Add(_xozZAxisTitle);
         _axisTitleGroup.Children.Add(_yozZAxisTitle);
     }
     _axisTickLabelVisuals.Children.Add(_yozZAxisTickLabels);
     _axisTickLabelVisuals.Children.Add(_xozZAxisTickLabels);
 }
Пример #2
0
 private void CreateXAxisLabels()
 {
     foreach (TickInfo tick in _xAxisMayorTicks)
     {
         TickLabelVisual3D xozMayorTickLabel = new TickLabelVisual3D(this.TicksProvider.GetLabelText(tick), Brushes.Black, true, _ticklabelHeight, new Point3D(tick.AxisValue, -0.2, _length + 0.2), Location.End, new Vector3D(0.0, 1.0, 0.0), new Vector3D(0.0, 0.0, 1.0));
         TickLabelVisual3D xoyMayorTickLabel = new TickLabelVisual3D(this.TicksProvider.GetLabelText(tick), Brushes.Black, true, _ticklabelHeight, new Point3D(tick.AxisValue, _length + 0.2, -0.1), Location.Start, new Vector3D(0.0, 1.0, 0.0), new Vector3D(0.0, 0.0, 1.0));
         _xozXAxisTickLabels.Children.Add(xozMayorTickLabel);
         _xoyXAxisTickLabels.Children.Add(xoyMayorTickLabel);
         if (_maxXAxisTickWidth < xozMayorTickLabel.ScreenWidth)
         {
             _maxXAxisTickWidth = xozMayorTickLabel.ScreenWidth;
         }
     }
     if (_xAxisMayorTicks.Count > 1)
     {
         _xozXAxisTitle = new TickLabelVisual3D("X Axis", Brushes.Black, true, _axisTitleHeight, new Point3D(_length / 2.0, -_axisLabelDistance, _length + 0.5), Location.Center, new Vector3D(0.0, 1.0, 0.0), new Vector3D(0.0, 0.0, 1.0));
         _xoyXAxisTitle = new TickLabelVisual3D("X Axis", Brushes.Black, true, _axisTitleHeight, new Point3D(_length / 2.0, _length + _axisLabelDistance, -0.5), Location.Center, new Vector3D(0.0, 1.0, 0.0), new Vector3D(0.0, 0.0, 1.0));
         _axisTitleGroup.Children.Add(_xozXAxisTitle);
         _axisTitleGroup.Children.Add(_xoyXAxisTitle);
     }
     _axisTickLabelVisuals.Children.Add(_xozXAxisTickLabels);
     _axisTickLabelVisuals.Children.Add(_xoyXAxisTickLabels);
 }
Пример #3
0
        private void UpdateAxisLabel()
        {
            TickLabelVisual3D xoyTickLabel = (TickLabelVisual3D)_xoyXAxisTickLabels.Children[0];
            TickLabelVisual3D xozTickLabel = (TickLabelVisual3D)_xozXAxisTickLabels.Children[0];
            TickLabelVisual3D yozTickLabel = (TickLabelVisual3D)_yozYAxisTickLabels.Children[0];

            if (this.XoZOverCamera && !this.XoYOverCamera)
            {
                _xoyXAxisTickLabels.Transform = new TranslateTransform3D(0.0, -_length - xoyTickLabel.ModelWidth - 0.4, 0.0);
                _xozXAxisTickLabels.Transform = new TranslateTransform3D(0.0, _length + xozTickLabel.ModelWidth + 0.4, 0.0);
                _xoyXAxisTitle.Transform      = new TranslateTransform3D(0.0, -_length - _axisLabelDistance * 2.0, 0.0);
                _xozXAxisTitle.Transform      = new TranslateTransform3D(0.0, _length + 2.0 * _axisLabelDistance, 0.0);
            }
            else if (!this.XoZOverCamera && this.XoYOverCamera)
            {
                _xoyXAxisTickLabels.Transform = new TranslateTransform3D(0.0, 0.0, _length + 0.2);
                _xozXAxisTickLabels.Transform = new TranslateTransform3D(0.0, 0.0, -_length - 0.4);
                _xoyXAxisTitle.Transform      = new TranslateTransform3D(0.0, 0.0, _length + 1.0);
                _xozXAxisTitle.Transform      = new TranslateTransform3D(0.0, 0.0, -_length - 1.0);
            }
            else
            {
                _xozXAxisTickLabels.Transform = Transform3D.Identity;
                _xoyXAxisTickLabels.Transform = Transform3D.Identity;
                _xoyXAxisTitle.Transform      = Transform3D.Identity;
                _xozXAxisTitle.Transform      = Transform3D.Identity;
            }
            if (this.YoZOverCamera && !this.XoYOverCamera)
            {
                _yozYAxisTickLabels.Transform = new TranslateTransform3D(_length + 0.4 + yozTickLabel.ModelWidth, 0.0, 0.0);
                _xoyYAxisTickLabels.Transform = new TranslateTransform3D(-_length - 0.4 - xoyTickLabel.ModelWidth, 0.0, 0.0);
                _yozYAxisTitle.Transform      = new TranslateTransform3D(_length + 2.0 * _axisLabelDistance, 0.0, 0.0);
                _xoyYAxisTitle.Transform      = new TranslateTransform3D(-_length - 2.0 * _axisLabelDistance, 0.0, 0.0);
            }
            else if (!this.YoZOverCamera && this.XoYOverCamera)
            {
                _yozYAxisTickLabels.Transform = new TranslateTransform3D(0.0, 0.0, -_length - 0.4);
                _xoyYAxisTickLabels.Transform = new TranslateTransform3D(0.0, 0.0, _length + 0.2);
                _yozYAxisTitle.Transform      = new TranslateTransform3D(0.0, 0.0, -_length - 1.0);
                _xoyYAxisTitle.Transform      = new TranslateTransform3D(0.0, 0.0, _length + 1.0);
            }
            else
            {
                _yozYAxisTickLabels.Transform = Transform3D.Identity;
                _xoyYAxisTickLabels.Transform = Transform3D.Identity;
                _xoyYAxisTitle.Transform      = Transform3D.Identity;
                _yozYAxisTitle.Transform      = Transform3D.Identity;
            }
            if ((this.XoZOverCamera && !this.YoZOverCamera) || (!this.XoZOverCamera && this.YoZOverCamera))
            {
                _xozZAxisTickLabels.Transform = new TranslateTransform3D(0.0, _length + 0.6, 0.0);
                _yozZAxisTickLabels.Transform = new TranslateTransform3D(0.0, -_length - 1.0, 0.0);
                _xozZAxisTitle.Transform      = new TranslateTransform3D(0.0, _length + 1.0, 0.0);
                _yozZAxisTitle.Transform      = new TranslateTransform3D(0.0, -_length - 2.0 * _axisLabelDistance, 0.0);
            }
            else
            {
                _yozZAxisTickLabels.Transform = Transform3D.Identity;
                _xozZAxisTickLabels.Transform = Transform3D.Identity;
                _yozZAxisTitle.Transform      = Transform3D.Identity;
                _xozZAxisTitle.Transform      = Transform3D.Identity;
            }
        }