本文整理汇总了C#中PointD类的典型用法代码示例。如果您正苦于以下问题:C# PointD类的具体用法?C# PointD怎么用?C# PointD使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PointD类属于命名空间,在下文中一共展示了PointD类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ArrowItem
/// <summary>
/// Constructor
/// </summary>
/// <param name="position">The position the arrow points to.</param>
/// <param name="angle">angle of arrow with respect to x axis.</param>
/// <param name="text">The text associated with the arrow.</param>
public ArrowItem( PointD position, double angle, string text )
{
to_ = position;
angle_ = -angle;
text_ = text;
Init();
}
开发者ID:helloyou2012,项目名称:ChartProject,代码行数:13,代码来源:ArrowItem.cs
示例2: DrawTemplates
public static void DrawTemplates(List<Tools.IToolFilter> templates, System.Drawing.Graphics gc, Tools.Render.RenderParameter rp, Tools.Render.RenderHint state, Tools.Render.IDrawVisitor drawMethods, PointD mousePosition)
{
foreach (Tools.IToolFilter filter in templates)
{
filter.Draw(gc, rp, state, drawMethods, mousePosition);
}
}
开发者ID:rhfung,项目名称:KinematicTemplates,代码行数:7,代码来源:FilterManager.cs
示例3: ProduceIMAGE
static void ProduceIMAGE()
{
BitmapData data_bac = IMAGE.GetBitmapData();
PointD p = data_bac.Half();
PointD vector;
double angle;
for (int i = 0; i < 50; i++)
{
angle = i * 0.04 * Math.PI;
vector = new PointD(Math.Sin(angle), -Math.Cos(angle));
data_bac.DrawLine(Color.FromArgb(255, 255, 0), p.Add(vector, i % 5 == 0 ? 35 : 45), p.Add(vector, i % 5 == 0 ? 25 : 40));
}
for (int i = 0; i < 10; i++)
{
angle = i * 0.2 * Math.PI;
vector = new PointD(Math.Sin(angle), -Math.Cos(angle));
data_bac.Paste(i.ToString(),
p.Add(vector, 40.0),
Color.FromArgb(255, 255, 255),
FONT_FOR_INITIALIZE,
StringAlign.Middle,
StringRowAlign.Middle);
}
data_bac.Multiply_A(0.5);
IMAGE.UnlockBits(data_bac);
}
开发者ID:fsps60312,项目名称:Digging-Game-2,代码行数:26,代码来源:Altimeter.cs
示例4: MoveHandleAction
public MoveHandleAction(Handle handle, Session session, PointD oldLocation)
{
this.handle = handle;
this.session = session;
this.oldLocation = oldLocation;
this.newLocation = handle.Location;
}
开发者ID:romanbdev,项目名称:quickroute-gps,代码行数:7,代码来源:MoveHandleAction.cs
示例5: Map
public Map(PointU16 mapSize, Orientation orientation, PointD cellSize, PointD origin, MapShapes mapShape = MapShapes.Rectangle)
{
_mapSize = mapSize;
_shape = mapShape;
mapLayout = new Layout(orientation, cellSize, origin);
hexes = new List<Hex>();
}
开发者ID:astr0wiz,项目名称:Hex-Demo,代码行数:7,代码来源:Map.cs
示例6: distance
public static double distance(PointD a, PointD b)
{
double xCuadrado = (a.X - b.X) * (a.X - b.X);
double yCuadrado = (a.Y - b.Y) * (a.Y - b.Y);
double distancia = Math.Sqrt(xCuadrado + yCuadrado);
return distancia;
}
开发者ID:aclemotte,项目名称:LookAndPlay,代码行数:7,代码来源:PointD.cs
示例7: RegularPolygonInscribedIntoCircle
/// <summary>
/// Returns a list of regular polygon's vertices, which has a
/// specified amount of sides and is inscribed into
/// a circle of certain radius and center point.
///
/// The first vertice will be located at specified angle (counting counterclockwise)
/// from the circle's rightmost point.
/// </summary>
/// <param name="sideCount">The total amount of polygon's sides. May be equal to 2 (then the resulting vertices will make up a line).</param>
/// <param name="circleCenter">The center of the surrounding circle.</param>
/// <param name="circleRadius">The radius of the surrounding circle.</param>
/// <param name="initialAngle">The angle (in radians, counting counterclockwise from the circle's rightmost point) at which the first vertice will be located.</param>
/// <returns>The list of regular polygon's vertices.</returns>
public static List<PointD> RegularPolygonInscribedIntoCircle(int sideCount, PointD circleCenter, double circleRadius, double initialAngle = 0)
{
// Вектор в ноль градусов.
VectorD initialVector = new VectorD(circleCenter, new PointD(circleCenter.X + circleRadius, circleCenter.Y));
List<PointD> points = new List<PointD>(sideCount);
// Вектор установлен на начальный угол.
if(initialAngle != 0)
initialVector = initialVector.VectorRotatedNewStartPoint(initialAngle, initialVector.StartPoint);
points.Add(initialVector.EndPoint);
double rotationAngle = 2 * Math.PI / sideCount;
VectorD currentVector;
for(int i=1; i<sideCount; i++)
{
currentVector = initialVector.VectorRotatedNewStartPoint(i * rotationAngle, initialVector.StartPoint);
points.Add(currentVector.EndPoint);
}
return points;
}
开发者ID:Kadavercian,项目名称:whitemath,代码行数:39,代码来源:Figures.cs
示例8: getLatLong
private PointLatLng getLatLong(PointD i_location)
{
PointLatLng coordinates;
coordinates = new PointLatLng(i_location.X, i_location.Y);
return coordinates;
}
开发者ID:danielbz88,项目名称:DesignPatternsOrAndDaniel,代码行数:7,代码来源:EventLocationsForm.cs
示例9: Draw
/// <summary>
/// Draws the point plot on a GDI+ surface against the provided x and y axes.
/// </summary>
/// <param name="g">The GDI+ surface on which to draw.</param>
/// <param name="xAxis">The X-Axis to draw against.</param>
/// <param name="yAxis">The Y-Axis to draw against.</param>
public virtual void Draw( Graphics g, PhysicalAxis xAxis, PhysicalAxis yAxis )
{
SequenceAdapter data_ =
new SequenceAdapter( this.DataSource, this.DataMember, this.OrdinateData, this.AbscissaData );
float leftCutoff_ = xAxis.PhysicalMin.X - marker_.Size;
float rightCutoff_ = xAxis.PhysicalMax.X + marker_.Size;
for (int i=0; i<data_.Count; ++i)
{
if ( !Double.IsNaN(data_[i].X) && !Double.IsNaN(data_[i].Y) )
{
PointF xPos = xAxis.WorldToPhysical( data_[i].X, false);
if (xPos.X < leftCutoff_ || rightCutoff_ < xPos.X)
continue;
PointF yPos = yAxis.WorldToPhysical( data_[i].Y, false);
marker_.Draw( g, (int)xPos.X, (int)yPos.Y );
if (marker_.DropLine)
{
PointD yMin = new PointD( data_[i].X, Math.Max( 0.0f, yAxis.Axis.WorldMin ) );
PointF yStart = yAxis.WorldToPhysical( yMin.Y, false );
g.DrawLine( marker_.Pen, (int)xPos.X,(int)yStart.Y, (int)xPos.X,(int)yPos.Y );
}
}
}
}
开发者ID:helloyou2012,项目名称:ChartProject,代码行数:33,代码来源:PointPlot.cs
示例10: MainForm_MouseDown
private void MainForm_MouseDown(object sender, MouseEventArgs e)
{
if (checkBoxAddPoint.Checked)
{
scene.DataPoints.Add(new PointD(e.X, e.Y));
this.Invalidate();
return;
}
mouse_start = e.Location;
this.Text = mouse_start.ToString();
capture = scene.HitTest(e.X, e.Y);
switch (capture)
{
case 1:
point_start = scene.CurrentBezier.Point1;
break;
case 2:
point_start = scene.CurrentBezier.Point2;
break;
case 3:
point_start = scene.CurrentBezier.Point3;
break;
case 4:
point_start = scene.CurrentBezier.Point4;
break;
default:
break;
}
}
开发者ID:EFanZh,项目名称:EFanZh,代码行数:34,代码来源:MainForm.cs
示例11: DrawRegionRepresentation
public override void DrawRegionRepresentation(System.Drawing.Graphics gc, Render.RenderParameter r, Render.IDrawVisitor drawMethods, PointD mousePosition)
{
if (m_Param.Path.IsVisible((System.Drawing.Point)mousePosition))
{
gc.DrawString(ToString(), r.FontType, new System.Drawing.SolidBrush(r.RegionGuides.Color), new System.Drawing.PointF((float)mousePosition.X, (float)mousePosition.Y - 15));
}
}
开发者ID:rhfung,项目名称:KinematicTemplates,代码行数:7,代码来源:SteadyHandFilter.cs
示例12: AddPoint
public void AddPoint(PointD p)
{
lock (tempRoute)
{
tempRoute.Add(p);
}
}
开发者ID:hunsteve,项目名称:RobotNavigation,代码行数:7,代码来源:PositionPredictor.cs
示例13: DoMouseWheel
public override bool DoMouseWheel(MouseEventArgs e, Control ctr, KeyEventArgs lastKeyEventArgs)
{
NPlot.PlotSurface2D ps = ((NPlot.Windows.PlotSurface2D)ctr).Inner;
((NPlot.Windows.PlotSurface2D)ctr).CacheAxes();
double delta = e.Delta / (double)SystemInformation.MouseWheelScrollDelta;
double zoomFactor = Math.Pow(sensitivity_, delta);
PointD pMin = new PointD((double)ps.PhysicalXAxis1Cache.PhysicalMin.X, (double)ps.PhysicalYAxis1Cache.PhysicalMin.Y);
PointD pMax = new PointD((double)ps.PhysicalXAxis1Cache.PhysicalMax.X, (double)ps.PhysicalYAxis1Cache.PhysicalMax.Y);
PointD pMinRelative = new PointD(pMin.X - e.X, pMin.Y - e.Y);
PointD pMaxRelative = new PointD(pMax.X - e.X, pMax.Y - e.Y);
Point pMinZoomed = new Point((int)Math.Round((pMinRelative.X * zoomFactor) + e.X, 0), (int)Math.Round((pMinRelative.Y * zoomFactor) + e.Y, 0));
Point pMaxZoomed = new Point((int)Math.Round((pMaxRelative.X * zoomFactor) + e.X, 0), (int)Math.Round((pMaxRelative.Y * zoomFactor) + e.Y, 0));
ps.XAxis1.WorldMin = ps.PhysicalXAxis1Cache.PhysicalToWorld(pMinZoomed, false);
ps.XAxis1.WorldMax = ps.PhysicalXAxis1Cache.PhysicalToWorld(pMaxZoomed, false);
ps.YAxis1.WorldMin = ps.PhysicalYAxis1Cache.PhysicalToWorld(pMinZoomed, false);
ps.YAxis1.WorldMax = ps.PhysicalYAxis1Cache.PhysicalToWorld(pMaxZoomed, false);
return true;
}
开发者ID:JesusFreke,项目名称:didjimp,代码行数:26,代码来源:MouseWheelZoom.cs
示例14: Effect
public Effect(Bitmap image, PointD worldorpod, ImagePasteMode imagepastemode, EffectDock effectdock, Rectangle region = default(Rectangle))
: base(null, image, default(Point), imagepastemode, region)
{
if (effectdock == EffectDock.Screen) throw new ArgumentException("Can't handle this parameter : effectdock");
LOC = worldorpod;
EFFECT_DOCK = effectdock;
}
开发者ID:fsps60312,项目名称:Digging-Game-2,代码行数:7,代码来源:Effect.cs
示例15: normalized2Pixels
public static PointD normalized2Pixels(PointD normalized)
{
double posX = normalized.X * (double)(Screen.PrimaryScreen.Bounds.Size.Width + Screen.PrimaryScreen.Bounds.X);
double posY = normalized.Y * (double)(Screen.PrimaryScreen.Bounds.Size.Height + Screen.PrimaryScreen.Bounds.Y);
PointD posicionMousePx = new PointD(posX, posY);
return posicionMousePx;
}
开发者ID:aclemotte,项目名称:LookAndPlay,代码行数:7,代码来源:eyetrackingFunctions.cs
示例16: ActivateScript
public override string ActivateScript(CandleChartControl chart, PointD worldCoords)
{
if (!AccountStatus.Instance.isAuthorized)
{
MessageBox.Show("Не авторизован");
return "Не авторизован";
}
var accountId = AccountStatus.Instance.accountID;
var numStepsMax = (VolumeMax - VolumeMin) / VolumeStep;
var rand = new Random();
var sb = new StringBuilder();
// закрытые сделки
var closedOrders = MakeClosedOrders(chart, accountId, rand, numStepsMax);
// SQL по закрытым сделкам
MakeClosedOrdersSQL(closedOrders, accountId, sb);
// найти все отметки на графике
// и по ним сбацать "сделки"
var positions = MakeMarketOrders(chart, accountId, rand, numStepsMax);
// слепить SQL по открытым позам
MakeMarketOrdersSQL(positions, accountId, sb);
if (sb.Length > 0)
Clipboard.SetText(sb.ToString());
return (positions.Count + closedOrders.Count) + " сделок скопировано в буфер обмена";
}
开发者ID:johnmensen,项目名称:TradeSharp,代码行数:30,代码来源:MakeOpenPosSql.cs
示例17: Line
public Line(DataRecordRow row)
: this()
{
ID = LoadAttributeID( row.Fields, DirectoryDataType.LINE );
PolygonIDLeft = LoadAttributeID( row.Fields, DirectoryDataType.PIDL );
PolygonIDRight = LoadAttributeID( row.Fields, DirectoryDataType.PIDR );
StartNodeID = LoadAttributeID( row.Fields, DirectoryDataType.SNID );
EndNodeID = LoadAttributeID( row.Fields, DirectoryDataType.ENID );
AttributeIDs = new List<KeyValuePair<string, int>>();
var attr = row.Fields.Where( field => field.FieldDefinition.Directory.Tag == DirectoryDataType.ATID );
if( attr.Any() )
{
for( int i = 0; i < attr.Count(); i += 2 )
AttributeIDs.Add( new KeyValuePair<string,int>(attr.ElementAt( i ).AsString, attr.ElementAt( i + 1 ).AsInt) );
}
var firstX = row.Fields.First( field => field.FieldDefinition.Name == "X" );
var startIndex = row.Fields.IndexOf( firstX );
for( int i = startIndex; i < row.Fields.Count; i += 2 )
{
var point = new PointD { X = row.Fields[ i ].AsInt / 100.0, Y = row.Fields[ i + 1 ].AsInt / 100.0 };
Points.Add( point );
}
DataRow = row;
}
开发者ID:PeteFohl,项目名称:SDTS-Browser,代码行数:27,代码来源:LineSet.cs
示例18: FromPoint
/// <summary>Returns a new BoundingBox bounding a single point.</summary>
public static BoundingBoxD FromPoint(ref PointD pt)
{
BoundingBoxD box = new BoundingBoxD();
box.Xmin = box.Xmax = pt.X;
box.Ymin = box.Ymax = pt.Y;
return box;
}
开发者ID:RT-Projects,项目名称:RT.Util,代码行数:8,代码来源:BoundingBoxD.cs
示例19: VectorScaledNewStartPoint
/// <summary>
/// Vector with new start point
/// with the length scaled by specified double factor.
/// </summary>
/// <param name="coefficient">Should be from 0 to 1.</param>
/// <param name="newStartPoint">New start point.</param>
public VectorD VectorScaledNewStartPoint(double coefficient, PointD newStartPoint)
{
double newX = this.X * coefficient;
double newY = this.Y * coefficient;
return new VectorD(newStartPoint, new PointD(newStartPoint.X + newX, newStartPoint.Y + newY));
}
开发者ID:Kadavercian,项目名称:whitemath,代码行数:13,代码来源:VectorD.cs
示例20: toPoint
public Point toPoint(PointD pD)
{
Point p = new Point(0, 0);
p.X = Convert.ToInt32(pD.X + 0.5);
p.Y = Convert.ToInt32(pD.Y + 0.5);
return p;
}
开发者ID:jekain314,项目名称:KMLReader,代码行数:7,代码来源:PointD.cs
注:本文中的PointD类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论