本文整理汇总了C#中LineType类的典型用法代码示例。如果您正苦于以下问题:C# LineType类的具体用法?C# LineType怎么用?C# LineType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LineType类属于命名空间,在下文中一共展示了LineType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProjectOnto
public static Point ProjectOnto(this Point p, LineSegment seg, LineType type, out int? end)
{
end = 0;
Vector v = seg.Vector();
Vector w = p.Sub(seg.A);
T c1 = w.Dot(v); // c1 == |w|*|v|*cos(angle between them)
if (c1 <= 0) { // angle between line segment and (p-seg.A) is negative (-180..0)?
if (v.X == 0 && v.Y == 0) {
// seg.A == seg.B
end = null;
return seg.A;
} else if (c1 < 0)
end = -1;
if (type != LineType.Infinite)
return seg.A;
}
T c2 = v.Quadrance(); // == |v|*|v|
if (c1 >= c2) { // quadrance from seg.A to projected point >= quadrance of seg
if (c1 > c2)
end = 1;
if (type == LineType.Segment)
return seg.B;
}
if (c2 == 0) {
// seg.A and seg.B are infitessimally close together; c2 was truncated to zero
end = null;
return seg.A;
}
T frac = c1 / c2; // == |w|/|v|*cos(angle)
Point projected = seg.A.Add(v.Mul(frac)); // == p0 + v/|v|*|w|*cos(angle)
return projected;
}
示例2: LineData
public LineData(string text, int left, int right, LineType type)
{
_text = text;
_left = left;
_right = right;
_type = type;
}
示例3: LineInfo
public LineInfo(LineType aType, int aLineNumber, int aIncludeFileID, string aLine)
{
Type = aType;
LineNumber = aLineNumber;
Line = aLine;
IncludeFileID = aIncludeFileID;
}
示例4: BeginLine
protected override void BeginLine(string label, TextWriter fw, LineType type)
{
if (m_textProps.TextLabels)
{
if (TextFormatter.IsLabel(label))
{
RtfTools.SetFont(fw, Fonts.LabelFont, 3);
fw.Write(label);
}
else
{
RtfTools.SetFont(fw, Fonts.TextFont, 1);
fw.Write(label);
}
}
switch (type)
{
case LineType.TEXT:
RtfTools.SetFont(fw, Fonts.TextFont, 1);
break;
case LineType.CHORD:
RtfTools.SetFont(fw, Fonts.ChordFont, 2);
break;
}
}
示例5: ParcourChannel
public ParcourChannel(Vector Start, Vector End, LineType type, List<Line> lines, Converter c)
{
this.Start = Start;
this.End = End;
List<Line> pointLine = lines.Where(p => p.Type == (int)LineType.Point).ToList();
int i = 0;
if (type == LineType.START_B)
{
i = 9;
}
else if (type == LineType.START_C)
{
i = 18;
}
else if (type == LineType.START_D)
{
i = 27;
}
List<Line> corridorPoints = new List<Line>();
for (int j = 0; j < 9; j++)
{
corridorPoints.Add(pointLine[i + j]);
}
foreach (Line l in corridorPoints)
{
Vector v = ParcourModel.getVector(c, l.A);
if (isEdited(l))
{
ImmutablePoints.Add(v);
}
LinearCombinations.Add(v);
}
LinearCombinations.Add(End);
}
示例6: Line
public Line(Point start, Point stop, LineType type, LineStyle style)
{
Start = start;
Stop = stop;
Type = type;
Style = style;
}
示例7: LinePrimitive
/// <summary>
/// Construction
/// </summary>
public LinePrimitive(LineType type, int penIndex, PointF p1, PointF p2)
{
this.m_LineType = type;
this.m_PenIndex = penIndex;
this.m_P1 = p1;
this.m_P2 = p2;
}
示例8: CreateResult
protected override RuleResult CreateResult(LineType lineType, string key)
{
RuleResult result = base.CreateResult(lineType, key);
if(lineType != LineType.Unknown && lineType != LineType.Empty)
result.EventType = EventType.Sql;
return result;
}
示例9: GetLineStyle
public static Paint.Style GetLineStyle(LineType lineType)
{
if (lineType == LineType.Solid)
return Paint.Style.Fill;
if (lineType == LineType.Stroke)
return Paint.Style.Stroke;
return Paint.Style.Fill;
}
示例10: BorderBrush
public BorderBrush(Color backgroundColor, LineType lineType, Color lineColor, int lineWidth = 1)
{
BackgroundColor = backgroundColor;
this.lineType = lineType;
this.lineColor = lineColor;
this.lineWidth = lineWidth;
RebuildTexture();
}
示例11: Line
public Line(PointD tstartpnt, PointD tendpnt, Color tcolor, LineType ttype, float twidth)
{
this.Color = tcolor;
this.LineType = ttype;
this.LineWidth = twidth;
this.p1 = tstartpnt.Clone() as PointD;
this.p2 = tendpnt.Clone() as PointD;
}
示例12: TestItsc
private void TestItsc(LineSegment<float> p, LineSegment<float> q, Point<float>? expected, float expect_pFrac, LineType pt = LineType.Segment, LineType qt = LineType.Segment)
{
float pFrac, qFrac;
bool intersected = p.ComputeIntersection(pt, out pFrac, q, qt, out qFrac);
Assert.AreEqual(expected.HasValue, intersected);
Point<float>? result = p.ComputeIntersection(pt, q, qt);
Assert.AreEqual(expected, result);
Assert.AreEqual(expect_pFrac, pFrac);
}
示例13: UpdateWinnerInfo
public void UpdateWinnerInfo(LineType lineType, int index, bool first)
{
WinnerLine = lineType;
WinnerIndex = index;
if (first)
Wins++;
else
Losses++;
}
示例14: FilterSource
public FilterSource ()
{
// Initialize the linetype member.
SrcLineType = LineType.None;
SrcLangType = LangType.None;
StrConstIdentifier = " ";
SnippetMode = true;
OriginalIsText = true;
token = new StringBuilder ();
SetFileType ("source");
}
示例15: DrawLine
public static void DrawLine(IInputOutputArray image,
Point start,
Point end,
MCvScalar color,
int thickness = 1,
LineType lineType = LineType.EightConnected,
int shift = 0)
{
using (InputOutputArray array = image.GetInputOutputArray())
{
cveLine(array, ref start, ref end, ref color, thickness, lineType, shift);
}
}