本文整理汇总了C#中IAxis类的典型用法代码示例。如果您正苦于以下问题:C# IAxis类的具体用法?C# IAxis怎么用?C# IAxis使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IAxis类属于命名空间,在下文中一共展示了IAxis类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Transform
public virtual void Transform(IAxis axis, IEnumerable<IAxis> dependentAxes)
{
foreach (var ax in dependentAxes)
{
Transform(axis, ax);
}
}
示例2: Draw
public void Draw(Chart2DSpriteContainer sprites, IAxis axis1, IAxis axis2, Vector2 offset)
{
if (this.HorizontalLines != null)
foreach (var line in this.HorizontalLines)
line.Draw(sprites, axis1, axis2, offset, Vector2.UnitX, Vector2.UnitY);
if (this.VerticalLines != null)
foreach (var line in this.VerticalLines)
line.Draw(sprites, axis2, axis1, offset, Vector2.UnitY, Vector2.UnitX);
}
示例3: mInput_AxisAdded
void mInput_AxisAdded(IAxis axis)
{
AxisPanel panel = new AxisPanel(axis, AxisBinding.MouseX, AxisBinding.MouseY);
panel.Anchor = AnchorStyles.Left | AnchorStyles.Right;
panel.Width = axesBox.Width - PADDING * 2;
axesBox.Controls.Add(panel);
panel.SizeChanged += new EventHandler(panel_SizeChanged);
RepositionPanels();
}
示例4: mPlugin_AxisAdded
void mPlugin_AxisAdded(IAxis axis)
{
AxisPanel panel = new AxisPanel(axis, AxisBinding.X, AxisBinding.Y, AxisBinding.Z, AxisBinding.Pitch, AxisBinding.Yaw, AxisBinding.Z);
panel.Anchor = AnchorStyles.Left | AnchorStyles.Right;
panel.Width = axesBox.Width - PADDING * 2;
axesBox.Controls.Add(panel);
panel.SizeChanged += new EventHandler(panel_SizeChanged);
RepositionPanels();
}
示例5: mAxis_AxisAdded
private void mAxis_AxisAdded(IAxis axis)
{
positivePulldown.Items.Add(axis);
negativePulldown.Items.Add(axis);
if (axis == mAxis.Positive)
positivePulldown.SelectedItem = axis;
if (axis == mAxis.Negative)
negativePulldown.SelectedItem = axis;
}
示例6: GetActualDataPointAxisValue
/// <summary>
/// Retrieves the value for a given access from a data point.
/// </summary>
/// <param name="dataPoint">The data point to retrieve the value from.</param>
/// <param name="axis">The axis to retrieve the value for.</param>
/// <returns>A function that returns a value appropriate for the axis
/// when provided a DataPoint.</returns>
protected virtual object GetActualDataPointAxisValue(DataPoint dataPoint, IAxis axis)
{
if (axis == InternalActualIndependentAxis)
{
return dataPoint.ActualIndependentValue;
}
else if (axis == InternalActualDependentAxis)
{
return dataPoint.ActualDependentValue;
}
return null;
}
示例7: GetActualMargin
/// <summary>
/// Returns the actual margin for a given framework element and axis.
/// </summary>
/// <param name="element">The framework element.</param>
/// <param name="axis">The axis along which to return the margin.
/// </param>
/// <returns>The margin for a given framework element and axis.
/// </returns>
public static double GetActualMargin(this FrameworkElement element, IAxis axis)
{
double length = 0.0;
if (axis.Orientation == AxisOrientation.X)
{
length = element.ActualWidth;
}
else if (axis.Orientation == AxisOrientation.Y)
{
length = element.ActualHeight;
}
return length / 2.0;
}
示例8: ConfigureAxis
public void ConfigureAxis(IAxis axis, Core core)
{
if (core != null && axis is ITickListener)
(axis as ITickListener).Init(core);
if (axis is ConstrainedAxis) {
ConstrainedAxis ax = axis as ConstrainedAxis;
ax.Deadzone.Value = GetDeadzone(axis.Name);
ax.Scale.Value = GetScale(axis.Name);
}
if (axis.Binding == AxisBinding.NotSet)
axis.Binding = GetBinding(axis.Name);
}
示例9: GetMargin
/// <summary>
/// Returns the margin for a given framework element and axis.
/// </summary>
/// <param name="element">The framework element.</param>
/// <param name="axis">The axis along which to return the margin.
/// </param>
/// <returns>The margin for a given framework element and axis.
/// </returns>
public static double GetMargin(this FrameworkElement element, IAxis axis)
{
double length = 0.0;
if (axis.Orientation == AxisOrientation.X)
{
length = !double.IsNaN(element.Width) ? element.Width : element.ActualWidth;
}
else if (axis.Orientation == AxisOrientation.Y)
{
length = !double.IsNaN(element.Height) ? element.Height : element.ActualHeight;
}
return length / 2.0;
}
示例10: UpdateVerticalTicks
private void UpdateVerticalTicks(IAxis axis)
{
axisGrid.BeginTicksUpdate();
if (axis != null)
{
axisGrid.VerticalTicks = axis.ScreenTicks;
axisGrid.MinorVerticalTicks = axis.MinorScreenTicks;
}
else
{
axisGrid.VerticalTicks = null;
axisGrid.MinorHorizontalTicks = null;
}
axisGrid.EndTicksUpdate();
}
示例11: OgcCrsVertical
/// <summary>
/// Constructs a new vertical CRS.
/// </summary>
/// <param name="name">The name of the CRS.</param>
/// <param name="datum">The datum the CRS is based on.</param>
/// <param name="linearUnit">The linear unit for the CRS.</param>
/// <param name="axis">The axis for the linear CRS.</param>
/// <param name="authority">The authority.</param>
public OgcCrsVertical(
string name,
IDatum datum,
IUnit linearUnit,
IAxis axis,
IAuthorityTag authority
)
: base(name, authority)
{
if(datum == null) throw new ArgumentNullException("datum");
if(linearUnit == null) throw new ArgumentNullException("linearUnit");
if(axis == null) throw new ArgumentNullException("axis");
Contract.Requires(name != null);
Datum = datum;
Unit = linearUnit;
Axis = axis;
}
示例12: AxisPanel
public AxisPanel(IAxis axis, params AxisBinding[] ignoredBindings)
: this(ignoredBindings)
{
mAxis = axis;
bindingDropdown.SelectedItem = axis.Binding;
mainGroup.Text = axis.Name;
UserControl control = mAxis.ControlPanel;
mExpandedSize = MinimumSize.Height + control.Height;
Height = editBox.Checked ? mExpandedSize : MinimumSize.Height;
control.Visible = editBox.Checked;
control.Width = configPanel.Width;
control.Dock = DockStyle.Fill;
//control.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
configPanel.Controls.Add(control);
}
示例13: Draw
public void Draw(Chart2DSpriteContainer sprites, IAxis parallelAxis, IAxis perpendicularAxis,
Vector2 offset, Vector2 direction, Vector2 axisUnit)
{
sprites.Color = this.color;
var minOffset = offset + direction * (float)parallelAxis.DataToChart(parallelAxis.MinValue);
var maxOffset = offset + direction * (float)parallelAxis.DataToChart(parallelAxis.MaxValue);
int minI = this.repeat ? (int)((perpendicularAxis.MinValue - this.StartValue) / this.interval) : 0;
int maxI = this.repeat ? (int)((perpendicularAxis.MaxValue - this.StartValue) / this.interval) : 0;
for (int i = minI; i <= maxI; i++)
{
var position = axisUnit * (float)perpendicularAxis.DataToChart(this.StartValue + this.interval * i);
sprites.DrawLine(
minOffset + position,
maxOffset + position,
sprites.ThinLineWidth);
}
}
示例14: UpdateVerticalTicks
private void UpdateVerticalTicks(IAxis axis)
{
if (axis != null)
{
axisGrid.VerticalTicks = axis.ScreenTicks;
}
else
{
axisGrid.VerticalTicks = null;
}
}
示例15: OnIndependentAxisPropertyChanged
/// <summary>
/// IndependentAxisProperty property changed handler.
/// </summary>
/// <param name="newValue">New value.</param>
private void OnIndependentAxisPropertyChanged(IAxis newValue)
{
this.InternalIndependentAxis = (IAxis)newValue;
}