• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Axis类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Axis的典型用法代码示例。如果您正苦于以下问题:C# Axis类的具体用法?C# Axis怎么用?C# Axis使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Axis类属于命名空间,在下文中一共展示了Axis类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CartesianChart

        void PersistentChart.CreateGraph()
        {
            _employeesInCompanyChart = new CartesianChart();
            _employeesInCompanyChart.Name = "Chart";
            _employeesInCompanyChart.Series = _viewModel.SeriesCollection;
            _employeesInCompanyChart.LegendLocation = LegendLocation.Left;

            Axis AxisX = new Axis();
            AxisX.Title = "Mes";
            AxisX.Labels = _viewModel.Labels;
            _employeesInCompanyChart.AxisX.Add(AxisX);

            Axis AxisY = new Axis();
            AxisY.Title = "Empleados";
            //AxisY.LabelFormatter = _viewModel.Formatter;

            LiveCharts.Wpf.Separator sep = new LiveCharts.Wpf.Separator();
            sep.IsEnabled = false;
            sep.Step = 1;
            AxisX.Separator = sep;

            _employeesInCompanyChart.AxisY.Add(AxisY);

            GridContainer.Children.Add(_employeesInCompanyChart);
            _gContainer = GridContainer;
        }
开发者ID:yureru,项目名称:tkUI,代码行数:26,代码来源:EmployeesInCompanyView.xaml.cs


示例2: detectSelectedAxis

        /// <summary>
        /// Detectar el eje seleccionado
        /// </summary>
        public void detectSelectedAxis(TgcPickingRay pickingRay)
        {
            pickingRay.updateRay();
            Vector3 collP;

            //Buscar colision con eje con Picking
            if (TgcCollisionUtils.intersectRayAABB(pickingRay.Ray, boxX.BoundingBox, out collP))
            {
                selectedAxis = Axis.X;
                selectedAxisBox = boxX;
            }
            else if (TgcCollisionUtils.intersectRayAABB(pickingRay.Ray, boxY.BoundingBox, out collP))
            {
                selectedAxis = Axis.Y;
                selectedAxisBox = boxY;
            }
            else if (TgcCollisionUtils.intersectRayAABB(pickingRay.Ray, boxZ.BoundingBox, out collP))
            {
                selectedAxis = Axis.Z;
                selectedAxisBox = boxZ;
            }
            else
            {
                selectedAxis = Axis.None;
                selectedAxisBox = null;
            }

            //Desplazamiento inicial
            if (selectedAxis != Axis.None)
            {
                TgcD3dInput input = GuiController.Instance.D3dInput;
                initMouseP = new Vector2(input.XposRelative, input.YposRelative);
            }
        }
开发者ID:JesusHerrera,项目名称:tgc-viewer,代码行数:37,代码来源:SceneEditorTranslateGizmo.cs


示例3: On

        /// <summary>
        /// Starts a configuration for an axis change.
        /// </summary>
        /// <param name="axis">The axis for which a configuration should be added.</param>
        /// <returns>An axis action.</returns>
        public IAxisAction On(Axis axis)
        {
            var action = new AxisAction(axis);
            mAxesActions.Add(axis, action);

            return action;
        }
开发者ID:Christof,项目名称:afterglow,代码行数:12,代码来源:SlimDXMouse.cs


示例4: AttachAxes

        public void AttachAxes(IChart chart, int dimension, string[] axisLabels)
        {
            const double margin = 0.0;
            const double spaceBetweenAxes = 200;

            var horizontalHelperAxis = new Axis();
            horizontalHelperAxis.IsHelper = true;
            horizontalHelperAxis.Orientation = AxisOrientation.Horizontal;
            horizontalHelperAxis.Dimension = dimension;
            horizontalHelperAxis.Label = axisLabels[dimension];
            horizontalHelperAxis.Scale = 1.0;

            for (int i = 0; i < dimension; i++)
            {
                var axis = new Axis();
                axis.Dimension = i;
                axis.Label = axisLabels[i];
                axis.Orientation = AxisOrientation.Vertical;
                axis.OriginalValue = i * spaceBetweenAxes + margin;

                horizontalHelperAxis.DependentAxes.Add(axis);

                chart.Axes.Add(axis);
            }

            horizontalHelperAxis.Transformation.Transform(horizontalHelperAxis, horizontalHelperAxis.DependentAxes);
            chart.Axes.Add(horizontalHelperAxis);
        }
开发者ID:pwlodek,项目名称:CodeGallery,代码行数:28,代码来源:ParallelCoordinatesChartDataProvider.cs


示例5: ViewDidLoad

		public override void ViewDidLoad()
		{
			base.ViewDidLoad();

			chart.ItemsSource = FinancialData.GetFinancialDataList();

			chart.Palette = XuniPalettes.Superhero;

			chart.BindingX = "Date";

			Axis axisT = new Axis(Position.Right, chart)
			{
				Min = 0,
				Max = 150,
				MajorUnit = 10,
				Title = "Volume",
				AxisLineVisible = false,
				MajorGridVisible = false,
				MajorGridWidth = 1,
				MajorTickWidth = 0,
				TitleTextColor = new UIColor(0.984f, 0.698f, 0.345f, 1.0f),
				LabelsVisible = true
			};

			chart.AxesArray.Add(axisT);

			chart.Series.Add(new Series(chart, "Volume", "Volume") { AxisY = axisT });
			chart.Series.Add(new Series(chart, "High", "High") { ChartType = ChartType.Line });
			chart.Series.Add(new Series(chart, "Low", "Low") { ChartType = ChartType.Line });

			chart.Header = "Drag to scroll/Pinch to zoom";
			chart.ZoomMode = ZoomMode.X;
			chart.AxisX.DisplayedRange = 10;
		}
开发者ID:GoXuni,项目名称:Xamarin.iOS-Samples,代码行数:34,代码来源:ScrollingController.cs


示例6: PlotViewModel

        public PlotViewModel(LineMode mode, int dataPointsCount, Axis yAxis)
        {
            Mode = mode;
            DataPointsCount = dataPointsCount;
            _series = new Dictionary<string, LineSeries>();
            _lastPointOfSeries = new Dictionary<string, DataPoint>();

            LinearAxis xAxis = new LinearAxis();
            xAxis.Position = AxisPosition.Bottom;
            xAxis.Title = "Time";

            yAxis.Position = AxisPosition.Left;
            yAxis.Title = "Values";

            var plot = new PlotModel
            {
                Title = Title,
                TitleHorizontalAlignment = TitleHorizontalAlignment.CenteredWithinPlotArea,
                LegendOrientation = LegendOrientation.Horizontal,
                LegendPlacement = LegendPlacement.Outside,
                LegendPosition = LegendPosition.TopCenter
            };

            plot.Axes.Add(xAxis);
            plot.Axes.Add(yAxis);

            Plot = plot;
        }
开发者ID:HukehrsEngineering,项目名称:FlightDisplay,代码行数:28,代码来源:PlotViewModel.cs


示例7: AccelerateToPoint

        /// <summary>
        /// Sets the x and y acceleration of an object or group of objects to move towards a given point.
        /// </summary>
        /// <param name="objectOrGroup">The object or group of objects to move.</param>
        /// <param name="point">The point to move towards.</param>
        /// <param name="speed">The acceleration to move the object at.</param>
        /// <param name="radius">The radius extending from the point. An object will need to be within this area to accelerate. A value of 0 will not use a radius.</param>
        /// <param name="axis">The allowed movement axis of the object.</param>
        /// <param name="allowImmovable">A flag used to determine if an object set to immovable will be affected.</param>
        public static void AccelerateToPoint(GenBasic objectOrGroup, Vector2 point, float speed, float radius = 0, Axis axis = Axis.Both, bool allowImmovable = false)
        {
            if (speed != 0)
            {
                if (objectOrGroup is GenObject)
                {
                    if (allowImmovable || !(objectOrGroup as GenObject).Immovable)
                    {
                        // Get a normalized distance vector to calculate the horizontal and vertical speeds.
                        Vector2 distanceNormal = GetDistanceNormal(objectOrGroup as GenObject, point, axis);

                        if (radius <= 0)
                            (objectOrGroup as GenObject).Velocity += distanceNormal * speed * GenG.TimeStep;
                        else
                        {
                            // If the object is within the radius from the point, accelerate the object towards the point.
                            // The closer the object is to the point, the higher its acceleration will be.
                            float accelerationFactor = MathHelper.Clamp(radius - Vector2.Distance((objectOrGroup as GenObject).CenterPosition, point), 0, 1);

                            (objectOrGroup as GenObject).Velocity += distanceNormal * speed * accelerationFactor * GenG.TimeStep;
                        }
                    }
                }
                else if (objectOrGroup is GenGroup)
                {
                    foreach (GenBasic basic in (objectOrGroup as GenGroup).Members)
                        AccelerateToPoint(basic, point, speed, radius, axis, allowImmovable);
                }
            }
        }
开发者ID:GeneticSpartan,项目名称:Genetic,代码行数:39,代码来源:GenMove.cs


示例8: CursorEventArgs

		public CursorEventArgs(ChartArea chartArea, Axis axis, double newSelectionStart, double newSelectionEnd)
		{
			this.ChartArea = chartArea;
			this.Axis = axis;
			this.NewSelectionStart = newSelectionStart;
			this.NewSelectionEnd = newSelectionEnd;
		}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:CursorEventArgs.cs


示例9: ToVector3

	public static List<Vector3> ToVector3(this List<Vector2> v2, Axis axis, float z)
	{
		List<Vector3> v = new List<Vector3>();
		for(int i = 0; i < v2.Count; i++)
			v.Add(v2[i].ToVector3(axis, z));
		return v;
	}
开发者ID:wtrebella,项目名称:Grappler,代码行数:7,代码来源:PolydrawExtensions.cs


示例10: WriteMemoryTO

 void WriteMemoryTO(ushort address, byte value)
 {
     if (address >= 0xC000)
         SystemRam[address & RamSizeMask] = value;
     else if (address == 0x6000)
         axis = ((value & 1) == 0) ? Axis.XAxis : Axis.YAxis;
 }
开发者ID:cas1993per,项目名称:bizhawk,代码行数:7,代码来源:TerebiOekaki.cs


示例11: DrawLines

	// Draw a row of lines.
	void DrawLines(int from, int to, Axis axis)
	{
		for(int lineMultiplicator = from; lineMultiplicator <= to; lineMultiplicator+=4)
		{
			DrawLine(lineMultiplicator, axis);
		}
	}
开发者ID:JulianVallee,项目名称:RTS,代码行数:8,代码来源:TerrainGrid.cs


示例12: Block

 public Block(Axis axis, Colour colour)
     : this(new List<Tuple<Axis, Colour>>()
     {
         new Tuple<Axis, Colour>(axis, colour)
     })
 {
 }
开发者ID:JakeColtman,项目名称:Kill-Sudoku-Solver,代码行数:7,代码来源:Block.cs


示例13: Chart

 public Chart(bool dateTimeAxis = true, Axis xAxis = null, Axis yAxis = null)
 {
     InitializeComponent();
     Random rand = new Random();
     if (dateTimeAxis) {
         plot.Axes.Add(new DateTimeAxis());
     }
     if (xAxis != null) {
         xAxis.Position = AxisPosition.Bottom;
         if (plot.Axes.Count() > 0) {
             plot.Axes[0] = xAxis;
         } else {
             plot.Axes.Add(xAxis);
         }
     }
     if (yAxis != null) {
         yAxis.Position = AxisPosition.Left;
         if (plot.Axes.Count() > 1) {
             plot.Axes[1] = yAxis;
         } else {
             plot.Axes.Add(yAxis);
         }
     }
     this.Root.Model = plot;
 }
开发者ID:Amichai,项目名称:FinancialData,代码行数:25,代码来源:Graph.xaml.cs


示例14: Scrollbar

        public Scrollbar(ScrollbarStyle Style, Axis Direction)
        {
            this._Style = Style;
            this._Direction = Direction;

            if (Direction == Axis.Horizontal)
            {
                this._TopLeftButton = new Button(Style.LeftButtonStyle);
                this._BottomRightButton = new Button(Style.RightButtonStyle);
            }
            else
            {
                this._TopLeftButton = new Button(Style.UpButtonStyle);
                this._BottomRightButton = new Button(Style.DownButtonStyle);
            }

            this._TopLeftButton.Click += delegate
            {
                this.Value = this._Value - this._MinorIncrement;
            };
            this._BottomRightButton.Click += delegate
            {
                this.Value = this._Value + this._MinorIncrement;
            };

            this._Value = 0.0;
            this._SliderSize = 0.1;
            this._MinorIncrement = 0.1;
            this._MajorIncrement = 0.3;
            this._Enabled = true;
        }
开发者ID:alexcmd,项目名称:OpenTKGUI,代码行数:31,代码来源:Scrollbar.cs


示例15: GetAxis

 public override float GetAxis(Axis axis, int joyNum, bool isRaw = false)
 {
     float scale = 1;
     string axisName = "";
     switch (axis)
     {
         case Axis.LeftStickX:
             axisName = getAxisName(joyNum, "X", "X", "X");
             break;
         case Axis.LeftStickY:
             axisName = getAxisName(joyNum, "Y", "Y", "Y");
             scale = -1;
             break;
         case Axis.RightStickX:
             axisName = getAxisName(joyNum, "3", "3", "3");
             break;
         case Axis.RightStickY:
             axisName = getAxisName(joyNum, "6", "4", "4");
             scale = -1;
             break;
     }
     //Debug.Log(axisName);
     if (isRaw)
     {
         return Input.GetAxisRaw(axisName) * scale;
     }
     else
     {
         return Input.GetAxis(axisName) * scale;
     }
 }
开发者ID:kkiniaes,项目名称:Fire-On-Ice,代码行数:31,代码来源:PS4ControllerWrapper.cs


示例16: DependentAxes

        public DependentAxes()
        {
            InitializeComponent();

              chart.Data.Children.Add(CreateTestData(new DateTime(2007,3,1), 50));
              chart.View.AxisX.IsTime = true;

              CreateTitle( chart.View.AxisY ,"°C", null);

              Axis axf = new Axis()
            {
              AxisType = AxisType.Y,
              IsDependent = true,
              Foreground = new SolidColorBrush(Colors.Red),
              DependentAxisConverter= (x) =>  x*9/5 + 32
            };
              CreateTitle(axf, "°F", new SolidColorBrush(Colors.Red));
              chart.View.Axes.Add(axf);

              Axis axk = new Axis()
              {
            IsDependent = true,
            Foreground = new SolidColorBrush(Colors.Purple),
            DependentAxisConverter = (x) => x + 273.15
              };
              CreateTitle(axk, "K", new SolidColorBrush(Colors.Purple));
              chart.View.Axes.Add(axk);
        }
开发者ID:mdjabirov,项目名称:C1Decompiled,代码行数:28,代码来源:DependentAxes.xaml.cs


示例17: OrdinalValue

		public static int OrdinalValue(Axis axis)
		{
			if (axis == AXIS_X) {
				return 0;
			} else if (axis == AXIS_Y) {
				return 1;
			} else if (axis == AXIS_Z) {
				return 2;
			} else if (axis == AXIS_RZ) {
				return 3;
			} else if (axis == AXIS_HAT_X) {
				return 4;
			} else if (axis == AXIS_HAT_Y) {
				return 5;
			} else if (axis == AXIS_LTRIGGER) {
				return 6;
			} else if (axis == AXIS_RTRIGGER) {
				return 7;
			} else if (axis == AXIS_BRAKE) {
				return 8;
			} else if (axis == AXIS_GAS) {
				return 9;
			} else if (axis == AXIS_RX) {
				return 10;
			} else if (axis == AXIS_RY) {
				return 11;
			} else {
				return -1;
			}


		}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:32,代码来源:AxesMapping.cs


示例18: ChangeThrust

        /// <summary>
        /// Changes thrust value for the specified axis. If set is false, the value will be added to the current thrust value.
        /// </summary>
        /// <param name="axis">Axis to change</param>
        /// <param name="value">Percentage value to change (-1 - 1)</param>
        /// <param name="set">Whether to set or add the value</param>
        private void ChangeThrust(Axis axis, float value, bool set)
        {
            string stickTag = "ThrustStick"+axis;
            var thrust = 0f;
            switch (axis) {
                case Axis.Z:
                    thrustZ = Mathf.Clamp((set)? value : thrustZ += value, -1f, 1f);
                    thrust = thrustZ;
                    break;
                case Axis.X:
                    thrustX = Mathf.Clamp((set)? value : thrustX += value, -1f, 1f);
                    thrust = thrustX;
                    break;
                case Axis.Y:
                    thrustY = Mathf.Clamp((set)? value : thrustY += value, -1f, 1f);
                    thrust = thrustY;
                    break;
                case Axis.Roll:
                    thrustRoll = Mathf.Clamp((set)? value : thrustRoll += value, -1f, 1f);
                    thrust = thrustRoll;
                    break;
                case Axis.Yaw:
                    thrustYaw = Mathf.Clamp((set)? value : thrustYaw += value, -1f, 1f);
                    thrust = thrustYaw;
                    break;
                case Axis.Pitch:
                    thrustPitch = Mathf.Clamp((set)? value : thrustPitch += value, -1f, 1f);
                    thrust = thrustPitch;
                    break;

            }
            if (!stickTag.Equals("")) GameObject.FindWithTag(stickTag).transform.localEulerAngles = new Vector3(-56 * thrust, 0, 0);
            EventSystem.UpdateThrust(axis, thrust);
        }
开发者ID:MMasaYamGithub,项目名称:Project-Discovery,代码行数:40,代码来源:ShipStats.cs


示例19: Init

        internal bool Init()
        {
            //buttons
            Button[] buttons = new Button[ 2 ];
            buttons[ 0 ] = new Button( JoystickButtons.Button1, 0 );
            buttons[ 1 ] = new Button( JoystickButtons.Button2, 1 );

            //axes
            Axis[] axes = new Axis[ 1 ];
            axes[ 0 ] = new JoystickInputDevice.Axis( JoystickAxes.X, new Range( -1, 1 ), false );

            //povs
            POV[] povs = new POV[ 0 ];
            //povs[ 0 ] = new JoystickInputDevice.POV( JoystickPOVs.POV1 );

            //sliders
            Slider[] sliders = new Slider[ 0 ];
            //sliders[ 0 ] = new Slider( JoystickSliders.Slider1 );

            //forceFeedbackController
            ForceFeedbackController forceFeedbackController = null;

            //initialize data
            InitDeviceData( buttons, axes, povs, sliders, forceFeedbackController );

            return true;
        }
开发者ID:huytd,项目名称:fosproject,代码行数:27,代码来源:ExampleCustomInputDevice.cs


示例20: Average

        public static float Average(this Vector4 vector, Axis axis)
        {
            float average = 0;
            int axisCount = 0;

            if (axis.Contains(Axis.X)) {
                average += vector.x;
                axisCount += 1;
            }

            if (axis.Contains(Axis.Y)) {
                average += vector.y;
                axisCount += 1;
            }

            if (axis.Contains(Axis.Z)) {
                average += vector.z;
                axisCount += 1;
            }

            if (axis.Contains(Axis.W)) {
                average += vector.w;
                axisCount += 1;
            }

            return average / axisCount;
        }
开发者ID:Dracir,项目名称:Tarata-tesseract,代码行数:27,代码来源:Vector4Extensions.cs



注:本文中的Axis类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AxisDimension类代码示例发布时间:2022-05-24
下一篇:
C# Axes类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap