本文整理汇总了C#中LineTypes类的典型用法代码示例。如果您正苦于以下问题:C# LineTypes类的具体用法?C# LineTypes怎么用?C# LineTypes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LineTypes类属于命名空间,在下文中一共展示了LineTypes类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ProcessProperty
internal override void ProcessProperty(int index, LineTypes.Property line, IParentObject obj, Stack<GameObject> objectStack, ParserContext context)
{
if (objectStack.Count > 0) {
base.ObjectProcessProperty(index, line, obj, objectStack, context);
return;
}
if (context == this.context) {
ShipTilePrefab tile = (ShipTilePrefab)obj;
switch (index) {
case 0:
tile.ID = line.argumentsData[0].ToString();
break;
case 1:
tile.EditorName = line.argumentsData[0].ToString();
break;
case 2:
tile.EditorDescription = line.argumentsData[0].ToString();
break;
case 3:
tile.EditorThumbnail = (Texture2D)line.argumentsData[0];
break;
case 4:
tile.Mass = (float)line.argumentsData[0];
break;
case 5:
tile.HP = (int)line.argumentsData[0];
break;
}
return;
}
throw new Exception("Invalid member in parsed lines list");
}
开发者ID:Bullshitzu,项目名称:SGU,代码行数:35,代码来源:ShipTileParser.cs
示例2: ParserContext
public ParserContext(bool objectsAllowed, LineTypes.Property[] properties, LineTypes.Component[] components, ContextType type)
{
this.ObjectsAllowed = objectsAllowed;
this.Properties = properties;
this.Components = components;
this.Type = type;
}
开发者ID:Bullshitzu,项目名称:SGU,代码行数:7,代码来源:ParserContext.cs
示例3: ObjectProcessComponent
internal void ObjectProcessComponent(int index, LineTypes.Component line, IParentObject obj, Stack<GameObject> objectStack, Stack<ParserContext> contextStack, ParserContext context)
{
#region Object context
if (context == this.objectContext) {
switch (index) {
case 0:
case 2:
return;
case 1:
MeshFilter filter = objectStack.Peek().AddComponent<MeshFilter>();
MeshRenderer renderer = objectStack.Peek().AddComponent<MeshRenderer>();
filter.mesh = Utility.MeshHelper.GetQuad();
renderer.material = new Material(Shader.Find("Standard"));
return;
}
}
#endregion
if (context == this.objectContext.Components[2].context) {
// COLLIDER
// todo: this
}
// other components that have sub-components
throw new Exception("Invalid member in parsed lines list");
}
开发者ID:Bullshitzu,项目名称:SGU,代码行数:28,代码来源:ParserObject.cs
示例4: ProcessComponent
internal override void ProcessComponent(int index, LineTypes.Component line, IParentObject obj, Stack<GameObject> objectStack, Stack<ParserContext> contextStack, ParserContext context)
{
if (objectStack.Count > 0) {
base.ObjectProcessComponent(index, line, obj, objectStack, contextStack, context);
return;
}
throw new Exception("Invalid member in parsed lines list");
}
开发者ID:Bullshitzu,项目名称:SGU,代码行数:9,代码来源:ShipTileParser.cs
示例5: TryParse
public static Boolean TryParse(String lineType, out LineTypes type)
{
type = LineTypes.Comment;
if (lineType.ToLower().Equals("dialogue")) {
type = LineTypes.Dialogue;
return true;
}
if (!lineType.ToLower().Equals("comment")) return false;
type = LineTypes.Comment;
return true;
}
开发者ID:Rinecamo,项目名称:SParser,代码行数:11,代码来源:ParseAnnotations.cs
示例6: Line
public Line(Int32 layer, STime start, STime end, LineTypes type, String styleName, String name,
Margin margin, String effect, String text)
{
Layer = layer;
StartTime = start;
EndTime = end;
LineType = type;
Text = text;
Effect = effect;
Name = name;
Margin = margin;
Style = styleName;
}
开发者ID:Rinecamo,项目名称:SParser,代码行数:13,代码来源:Line.cs
示例7: ProcessProperty
internal override void ProcessProperty(int index, LineTypes.Property line, IParentObject obj, System.Collections.Generic.Stack<GameObject> objectStack, ParserContext context)
{
Floor tempObj = (Floor)obj;
switch (index) {
case 0:
tempObj.name = line.argumentsData[0].ToString();
break;
case 1:
tempObj.diffuse = (Texture2D)line.argumentsData[0];
break;
case 2:
tempObj.normal = (Texture2D)line.argumentsData[0];
break;
}
}
开发者ID:Bullshitzu,项目名称:SGU,代码行数:15,代码来源:FloorParser.cs
示例8: DrawLine
public string DrawLine(LineTypes lineType)
{
switch (lineType)
{
case LineTypes.Stars:
return "***********************************************";
case LineTypes.Equals:
return "===============================================";
case LineTypes.UnderScore:
return "_______________________________________________";
case LineTypes.Fishy:
return " <º)))><¸.·´¯`·.¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º> ";
default:
return "ERRORDAMMIT!";
}
}
开发者ID:alexgrbach,项目名称:Projects,代码行数:17,代码来源:Lines.cs
示例9: Draw
//*******************************************************************************************
/// <summary>
///
/// </summary>
//*******************************************************************************************
static public void Draw(int x, int y, int dxpLength, LineTypes lineType)
{
g_LineType = lineType;
Draw(g_graphics, x, y, dxpLength);
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:10,代码来源:FwDrawing.cs
示例10: LineDrawing
//*******************************************************************************************
/// <summary>
/// Constructor 4
/// </summary>
//*******************************************************************************************
public LineDrawing(Graphics g, int x, int y, int dxpLength, LineTypes lineType)
{
Draw(g, x, y, dxpLength, lineType);
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:9,代码来源:FwDrawing.cs
示例11: GetTotalLineCount
public int GetTotalLineCount(LineTypes lineType, FileTypes fileType, bool scale)
{
var sloc = from v in Sloc.ToDictionary()[fileType]
from x in v.Lines
where x.LineType == lineType
select x;
return sloc.Count();
}
开发者ID:ucswift,项目名称:Insight,代码行数:9,代码来源:Project.cs
示例12: FillConvexPoly
/// <summary>
/// 塗りつぶされた凸ポリゴンを描きます.
/// </summary>
/// <param name="img">画像</param>
/// <param name="pts">ポリゴンの頂点.</param>
/// <param name="color">ポリゴンの色.</param>
/// <param name="lineType">ポリゴンの枠線の種類,</param>
/// <param name="shift">ポリゴンの頂点座標において,小数点以下の桁を表すビット数.</param>
#else
/// <summary>
/// Fills a convex polygon.
/// </summary>
/// <param name="img">Image</param>
/// <param name="pts">The polygon vertices</param>
/// <param name="color">Polygon color</param>
/// <param name="lineType">Type of the polygon boundaries</param>
/// <param name="shift">The number of fractional bits in the vertex coordinates</param>
#endif
public static void FillConvexPoly(Mat img, IEnumerable<Point> pts, Scalar color,
LineTypes lineType = LineTypes.Link8, int shift = 0)
{
if (img == null)
throw new ArgumentNullException(nameof(img));
img.ThrowIfDisposed();
Point[] ptsArray = EnumerableEx.ToArray(pts);
NativeMethods.imgproc_fillConvexPoly_Mat(img.CvPtr, ptsArray, ptsArray.Length, color, (int)lineType, shift);
GC.KeepAlive(img);
}
开发者ID:shimat,项目名称:opencvsharp,代码行数:29,代码来源:Cv2_imgproc.cs
示例13: Ellipse
/// <summary>
/// 枠だけの楕円,楕円弧,もしくは塗りつぶされた扇形の楕円を描画する
/// </summary>
/// <param name="img">楕円が描画される画像</param>
/// <param name="center">楕円の中心</param>
/// <param name="axes">楕円の軸の長さ</param>
/// <param name="angle">回転角度</param>
/// <param name="startAngle">楕円弧の開始角度</param>
/// <param name="endAngle">楕円弧の終了角度</param>
/// <param name="color">楕円の色</param>
/// <param name="thickness">楕円弧の線の幅 [既定値は1]</param>
/// <param name="lineType">楕円弧の線の種類 [既定値はLineType.Link8]</param>
/// <param name="shift">中心座標と軸の長さの小数点以下の桁を表すビット数 [既定値は0]</param>
#else
/// <summary>
/// Draws simple or thick elliptic arc or fills ellipse sector
/// </summary>
/// <param name="img">Image. </param>
/// <param name="center">Center of the ellipse. </param>
/// <param name="axes">Length of the ellipse axes. </param>
/// <param name="angle">Rotation angle. </param>
/// <param name="startAngle">Starting angle of the elliptic arc. </param>
/// <param name="endAngle">Ending angle of the elliptic arc. </param>
/// <param name="color">Ellipse color. </param>
/// <param name="thickness">Thickness of the ellipse arc. [By default this is 1]</param>
/// <param name="lineType">Type of the ellipse boundary. [By default this is LineType.Link8]</param>
/// <param name="shift">Number of fractional bits in the center coordinates and axes' values. [By default this is 0]</param>
#endif
public static void Ellipse(
InputOutputArray img, Point center, Size axes, double angle, double startAngle, double endAngle, Scalar color,
int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0)
{
if (img == null)
throw new ArgumentNullException(nameof(img));
img.ThrowIfNotReady();
NativeMethods.imgproc_ellipse1(img.CvPtr, center, axes, angle, startAngle, endAngle, color, thickness, (int)lineType, shift);
img.Fix();
}
开发者ID:shimat,项目名称:opencvsharp,代码行数:38,代码来源:Cv2_imgproc.cs
示例14: Circle
/// <summary>
/// 円を描画する
/// </summary>
/// <param name="img">画像</param>
/// <param name="centerX">円の中心のx座標</param>
/// <param name="centerY">円の中心のy座標</param>
/// <param name="radius">円の半径</param>
/// <param name="color">円の色</param>
/// <param name="thickness">線の幅.負の値を指定した場合は塗りつぶされる.[既定値は1]</param>
/// <param name="lineType">線の種類. [既定値はLineType.Link8]</param>
/// <param name="shift">中心座標と半径の小数点以下の桁を表すビット数. [既定値は0]</param>
#else
/// <summary>
/// Draws a circle
/// </summary>
/// <param name="img">Image where the circle is drawn. </param>
/// <param name="centerX">X-coordinate of the center of the circle. </param>
/// <param name="centerY">Y-coordinate of the center of the circle. </param>
/// <param name="radius">Radius of the circle. </param>
/// <param name="color">Circle color. </param>
/// <param name="thickness">Thickness of the circle outline if positive, otherwise indicates that a filled circle has to be drawn. [By default this is 1]</param>
/// <param name="lineType">Type of the circle boundary. [By default this is LineType.Link8]</param>
/// <param name="shift">Number of fractional bits in the center coordinates and radius value. [By default this is 0]</param>
#endif
public static void Circle(InputOutputArray img, int centerX, int centerY, int radius, Scalar color,
int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0)
{
Circle(img, new Point(centerX, centerY), radius, color, thickness, lineType, shift);
}
开发者ID:shimat,项目名称:opencvsharp,代码行数:29,代码来源:Cv2_imgproc.cs
示例15: DrawContours
/// <summary>
/// 輪郭線,または内側が塗りつぶされた輪郭を描きます.
/// </summary>
/// <param name="image">出力画像</param>
/// <param name="contours"> 入力される全輪郭.各輪郭は,点のベクトルとして格納されています.</param>
/// <param name="contourIdx">描かれる輪郭を示します.これが負値の場合,すべての輪郭が描画されます.</param>
/// <param name="color">輪郭の色.</param>
/// <param name="thickness">輪郭線の太さ.これが負値の場合(例えば thickness=CV_FILLED ),輪郭の内側が塗りつぶされます.</param>
/// <param name="lineType">線の連結性</param>
/// <param name="hierarchy">階層に関するオプションの情報.これは,特定の輪郭だけを描画したい場合にのみ必要になります.</param>
/// <param name="maxLevel">描画される輪郭の最大レベル.0ならば,指定された輪郭のみが描画されます.
/// 1ならば,指定された輪郭と,それに入れ子になったすべての輪郭が描画されます.2ならば,指定された輪郭と,
/// それに入れ子になったすべての輪郭,さらにそれに入れ子になったすべての輪郭が描画されます.このパラメータは,
/// hierarchy が有効な場合のみ考慮されます.</param>
/// <param name="offset">輪郭をシフトするオプションパラメータ.指定された offset = (dx,dy) だけ,すべての描画輪郭がシフトされます.</param>
#else
/// <summary>
/// draws contours in the image
/// </summary>
/// <param name="image">Destination image.</param>
/// <param name="contours">All the input contours. Each contour is stored as a point vector.</param>
/// <param name="contourIdx">Parameter indicating a contour to draw. If it is negative, all the contours are drawn.</param>
/// <param name="color">Color of the contours.</param>
/// <param name="thickness">Thickness of lines the contours are drawn with. If it is negative (for example, thickness=CV_FILLED ),
/// the contour interiors are drawn.</param>
/// <param name="lineType">Line connectivity. </param>
/// <param name="hierarchy">Optional information about hierarchy. It is only needed if you want to draw only some of the contours</param>
/// <param name="maxLevel">Maximal level for drawn contours. If it is 0, only the specified contour is drawn.
/// If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function draws the contours,
/// all the nested contours, all the nested-to-nested contours, and so on. This parameter is only taken into account
/// when there is hierarchy available.</param>
/// <param name="offset">Optional contour shift parameter. Shift all the drawn contours by the specified offset = (dx, dy)</param>
#endif
public static void DrawContours(
InputOutputArray image,
IEnumerable<IEnumerable<Point>> contours,
int contourIdx,
Scalar color,
int thickness = 1,
LineTypes lineType = LineTypes.Link8,
IEnumerable<HierarchyIndex> hierarchy = null,
int maxLevel = Int32.MaxValue,
Point? offset = null)
{
if (image == null)
throw new ArgumentNullException(nameof(image));
if (contours == null)
throw new ArgumentNullException(nameof(contours));
image.ThrowIfNotReady();
Point offset0 = offset.GetValueOrDefault(new Point());
Point[][] contoursArray = EnumerableEx.SelectToArray(contours, EnumerableEx.ToArray);
int[] contourSize2 = EnumerableEx.SelectToArray(contoursArray, pts => pts.Length);
using (var contoursPtr = new ArrayAddress2<Point>(contoursArray))
{
if (hierarchy == null)
{
NativeMethods.imgproc_drawContours_vector(image.CvPtr, contoursPtr.Pointer, contoursArray.Length, contourSize2,
contourIdx, color, thickness, (int)lineType, IntPtr.Zero, 0, maxLevel, offset0);
}
else
{
Vec4i[] hiearchyVecs = EnumerableEx.SelectToArray(hierarchy, hi => hi.ToVec4i());
NativeMethods.imgproc_drawContours_vector(image.CvPtr, contoursPtr.Pointer, contoursArray.Length, contourSize2,
contourIdx, color, thickness, (int)lineType, hiearchyVecs, hiearchyVecs.Length, maxLevel, offset0);
}
}
image.Fix();
}
开发者ID:shimat,项目名称:opencvsharp,代码行数:70,代码来源:Cv2_imgproc.cs
示例16: Polylines
/// <summary>
/// draws one or more polygonal curves
/// </summary>
/// <param name="img"></param>
/// <param name="pts"></param>
/// <param name="isClosed"></param>
/// <param name="color"></param>
/// <param name="thickness"></param>
/// <param name="lineType"></param>
/// <param name="shift"></param>
public static void Polylines(
InputOutputArray img, InputArray pts, bool isClosed, Scalar color,
int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0)
{
if (img == null)
throw new ArgumentNullException(nameof(img));
if (pts == null)
throw new ArgumentNullException(nameof(pts));
img.ThrowIfDisposed();
pts.ThrowIfDisposed();
NativeMethods.imgproc_polylines_InputOutputArray(
img.CvPtr, pts.CvPtr, isClosed ? 1 : 0, color, thickness, (int)lineType, shift);
img.Fix();
GC.KeepAlive(pts);
}
开发者ID:shimat,项目名称:opencvsharp,代码行数:27,代码来源:Cv2_imgproc.cs
示例17: FillPoly
/// <summary>
/// 1つ,または複数のポリゴンで区切られた領域を塗りつぶします.
/// </summary>
/// <param name="img">画像</param>
/// <param name="pts">ポリゴンの配列.各要素は,点の配列で表現されます.</param>
/// <param name="color">ポリゴンの色.</param>
/// <param name="lineType">ポリゴンの枠線の種類,</param>
/// <param name="shift">ポリゴンの頂点座標において,小数点以下の桁を表すビット数.</param>
/// <param name="offset"></param>
#else
/// <summary>
/// Fills the area bounded by one or more polygons
/// </summary>
/// <param name="img">Image</param>
/// <param name="pts">Array of polygons, each represented as an array of points</param>
/// <param name="color">Polygon color</param>
/// <param name="lineType">Type of the polygon boundaries</param>
/// <param name="shift">The number of fractional bits in the vertex coordinates</param>
/// <param name="offset"></param>
#endif
public static void FillPoly(
InputOutputArray img, InputArray pts, Scalar color,
LineTypes lineType = LineTypes.Link8, int shift = 0, Point? offset = null)
{
if (img == null)
throw new ArgumentNullException(nameof(img));
if (pts == null)
throw new ArgumentNullException(nameof(pts));
img.ThrowIfDisposed();
pts.ThrowIfDisposed();
Point offset0 = offset.GetValueOrDefault(new Point());
NativeMethods.imgproc_fillPoly_InputOutputArray(
img.CvPtr, pts.CvPtr, color, (int)lineType, shift, offset0);
GC.KeepAlive(pts);
img.Fix();
}
开发者ID:shimat,项目名称:opencvsharp,代码行数:38,代码来源:Cv2_imgproc.cs
示例18: PutText
/// <summary>
/// renders text string in the image
/// </summary>
/// <param name="img"></param>
/// <param name="text"></param>
/// <param name="org"></param>
/// <param name="fontFace"></param>
/// <param name="fontScale"></param>
/// <param name="color"></param>
/// <param name="thickness"></param>
/// <param name="lineType"></param>
/// <param name="bottomLeftOrigin"></param>
public static void PutText(InputOutputArray img, string text, Point org,
HersheyFonts fontFace, double fontScale, Scalar color,
int thickness = 1, LineTypes lineType = LineTypes.Link8, bool bottomLeftOrigin = false)
{
if (img == null)
throw new ArgumentNullException(nameof(img));
if (String.IsNullOrEmpty(text))
throw new ArgumentNullException(text);
img.ThrowIfDisposed();
NativeMethods.core_putText(img.CvPtr, text, org, (int)fontFace, fontScale, color,
thickness, (int)lineType, bottomLeftOrigin ? 1 : 0);
img.Fix();
}
开发者ID:shimat,项目名称:opencvsharp,代码行数:25,代码来源:Cv2_imgproc.cs
注:本文中的LineTypes类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论