本文整理汇总了C#中netDxf.Tables.Layer类的典型用法代码示例。如果您正苦于以下问题:C# Layer类的具体用法?C# Layer怎么用?C# Layer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Layer类属于netDxf.Tables命名空间,在下文中一共展示了Layer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
/// <summary>
/// 绘制风扇
/// </summary>
/// <param name="dxf"></param>
/// <param name="startPoint">风扇起点,如果为横置,由左向右;如果为竖置,由下到上</param>
/// <param name="endPoint">风扇终点,如果为横置,由左向右;如果为竖置,由下到上</param>
/// <param name="pointerLocation">箭头位置,默认=0为无,=1代表箭头在中间,=2代表箭头在底部</param>
public static void Draw(DxfDocument dxf, Vector3f startPoint, Vector3f endPoint,int pointerLocation=0)
{
Layer layer = new Layer("line");
Line line = new Line(startPoint, endPoint);
line.Layer = layer;
dxf.AddEntity(line);
//如果为横置
if (startPoint.Y == endPoint.Y)
{
float segment = (endPoint.X - startPoint.X) / 4;
Slash.Draw(dxf, new Location(startPoint.X + segment, startPoint.Y, startPoint.Z));
Slash.Draw(dxf, new Location(startPoint.X + 2 * segment, startPoint.Y, startPoint.Z));
Slash.Draw(dxf, new Location(startPoint.X + 3 * segment, startPoint.Y, startPoint.Z));
}
//如果为竖置
else if (startPoint.X == endPoint.X)
{
float segment = (endPoint.Y - startPoint.Y) / 5;
Slash.Draw(dxf, new Location(startPoint.X, startPoint.Y + segment, startPoint.Z));
Slash.Draw(dxf, new Location(startPoint.X, startPoint.Y + 2 * segment, startPoint.Z));
Slash.Draw(dxf, new Location(startPoint.X, startPoint.Y + 3 * segment, startPoint.Z));
Slash.Draw(dxf, new Location(startPoint.X, startPoint.Y + 4 * segment, startPoint.Z));
if (pointerLocation == 1)
{
LinePointer.Draw(dxf,new Location(startPoint.X,(startPoint.Y+endPoint.Y)/2,startPoint.Z));
}
else if(pointerLocation==2)
{
LinePointer.Draw(dxf, new Location(startPoint.X, startPoint.Y, startPoint.Z));
}
}
}
示例2: PolyfaceMeshFace
/// <summary>
/// Initializes a new instance of the <c>PolyfaceMeshFace</c> class.
/// </summary>
/// <remarks>
/// By default the face is made up of three vertexes.
/// </remarks>
public PolyfaceMeshFace()
: base(DxfObjectCode.Vertex)
{
this.flags = VertexTypeFlags.PolyfaceMeshVertex;
this.vertexIndexes = new int[3];
this.layer = Layer.Default;
this.color = AciColor.ByLayer;
this.lineType = LineType.ByLayer;
}
示例3: Attribute
/// <summary>
/// Intitializes a new instance of the <c>Attribute</c> class.
/// </summary>
/// <param name="definition"><see cref="AttributeDefinition">Attribute definition</see>.</param>
/// <param name="value">Attribute value.</param>
public Attribute(AttributeDefinition definition, object value)
: base(DxfObjectCode.Attribute)
{
this.definition = definition;
this.value = value;
this.color = definition.Color;
this.layer = definition.Layer;
this.lineType = definition.LineType;
}
示例4: Polyline3dVertex
/// <summary>
/// Initializes a new instance of the <c><Polyline3dVertex/c> class.
/// </summary>
public Polyline3dVertex()
: base(DxfObjectCode.Vertex)
{
this.flags = VertexTypeFlags.Polyline3dVertex;
this.location = Vector3d.Zero;
this.layer = Layer.Default;
this.color = AciColor.ByLayer;
this.lineType = LineType.ByLayer;
}
示例5: PolyfaceMeshVertex
/// <summary>
/// Initializes a new instance of the <c>PolylineVertex</c> class.
/// </summary>
/// <param name="location">Polyface mesh vertex <see cref="Vector3d">location</see>.</param>
public PolyfaceMeshVertex(Vector3d location)
: base(DxfObjectCode.Vertex)
{
this.flags = VertexTypeFlags.PolyfaceMeshVertex | VertexTypeFlags.Polygon3dMesh;
this.location = location;
this.layer = Layer.Default;
this.color = AciColor.ByLayer;
this.lineType = LineType.ByLayer;
}
示例6: PolyfaceMesh
/// <summary>
/// Initializes a new instance of the <c>PolyfaceMesh</c> class.
/// </summary>
public PolyfaceMesh()
: base(DxfObjectCode.Polyline)
{
this.flags = PolylineTypeFlags.PolyfaceMesh;
this.faces = new List<PolyfaceMeshFace>();
this.layer = Layer.Default;
this.color = AciColor.ByLayer;
this.lineType = LineType.ByLayer;
this.endSequence = new EndSequence();
}
示例7: Polyline3d
/// <summary>
/// Initializes a new instance of the <c>Polyline3d</c> class.
/// </summary>
/// <param name="vertexes">3d polyline <see cref="Polyline3dVertex">vertex</see> list.</param>
public Polyline3d(List<Polyline3dVertex> vertexes)
: base(DxfObjectCode.Polyline)
{
this.flags = PolylineTypeFlags.Polyline3D;
this.vertexes = vertexes;
this.layer = Layer.Default;
this.color = AciColor.ByLayer;
this.lineType = LineType.ByLayer;
this.endSequence = new EndSequence();
}
示例8: Draw
public static void Draw(DxfDocument dxf, Location location)
{
Vector3f v1 = new Vector3f(location.X - 2.0f, location.Y - 4.0f, location.Z);
Vector3f v2 = new Vector3f(location.X + 2.0f, location.Y + 4.0f, location.Z);
Layer layer = new Layer("line");
Line line12 = new Line(v1, v2);
line12.Layer = layer;
dxf.AddEntity(line12);
}
示例9: Point
/// <summary>
/// Initializes a new instance of the <c>Point</c> class.
/// </summary>
public Point()
: base(DxfObjectCode.Point)
{
this.location = Vector3d.Zero;
this.thickness = 0.0f;
this.layer = Layer.Default;
this.color = AciColor.ByLayer;
this.lineType = LineType.ByLayer;
this.normal = Vector3d.UnitZ;
}
示例10: Draw
/// <summary>
/// 风向绘制
/// </summary>
/// <param name="dxf"></param>
/// <param name="location"></param>
/// <param name="isRight"></param>
public static void Draw(DxfDocument dxf, Location location, bool isRight)
{
float factor = 0.5f;
Vector3f v1 = new Vector3f();
Vector3f v2 = new Vector3f();
Vector3f v3 = new Vector3f();
Vector3f v4 = new Vector3f();
Vector3f v5 = new Vector3f();
Vector3f v6 = new Vector3f();
Vector3f v7 = new Vector3f();
if (isRight)
{
v1 = new Vector3f(10*factor + location.X, location.Y, location.Z);
v2 = new Vector3f(location.X, location.Y + 10 * factor, location.Z);
v3 = new Vector3f(location.X + 10 * factor, location.Y + 10 * factor, location.Z);
v4 = new Vector3f(location.X + 20 * factor, location.Y + 15 * factor, location.Z);
v5 = new Vector3f(location.X, location.Y + 20 * factor, location.Z);
v6 = new Vector3f(location.X + 10 * factor, location.Y + 20 * factor, location.Z);
v7 = new Vector3f(location.X + 10 * factor, location.Y + 30 * factor, location.Z);
}
else
{
v1 = new Vector3f(10 * factor + location.X, location.Y, location.Z);
v2 = new Vector3f(location.X + 20 * factor, location.Y + 10 * factor, location.Z);
v3 = new Vector3f(location.X + 10 * factor, location.Y + 10 * factor, location.Z);
v4 = new Vector3f(location.X, location.Y + 15 * factor, location.Z);
v5 = new Vector3f(location.X + 20 * factor, location.Y + 20 * factor, location.Z);
v6 = new Vector3f(location.X + 10 * factor, location.Y + 20 * factor, location.Z);
v7 = new Vector3f(location.X + 10 * factor, location.Y + 30 * factor, location.Z);
}
Layer layer = new Layer("line");
Line line23 = new Line(v2, v3);
line23.Layer = layer;
dxf.AddEntity(line23);
Line line56 = new Line(v5, v6);
line56.Layer = layer;
dxf.AddEntity(line56);
Line line14 = new Line(v1, v4);
line14.Layer = layer;
dxf.AddEntity(line14);
Line line74 = new Line(v7, v4);
line74.Layer = layer;
dxf.AddEntity(line74);
Line line25 = new Line(v2, v5);
line25.Layer = layer;
dxf.AddEntity(line25);
Line line71 = new Line(v7, v1);
line71.Layer = layer;
dxf.AddEntity(line71);
}
示例11: OnLayerChangeEvent
protected virtual Layer OnLayerChangeEvent(Layer oldLayer, Layer newLayer)
{
LayerChangeEventHandler ae = this.LayerChange;
if (ae != null)
{
TableObjectChangeEventArgs<Layer> eventArgs = new TableObjectChangeEventArgs<Layer>(oldLayer, newLayer);
ae(this, eventArgs);
return eventArgs.NewValue;
}
return newLayer;
}
示例12: Circle
/// <summary>
/// Initializes a new instance of the <c>Circle</c> class.
/// </summary>
public Circle()
: base(DxfObjectCode.Circle)
{
this.center = Vector3d.Zero;
this.radius = 1.0;
this.thickness = 0.0f;
this.layer = Layer.Default;
this.color = AciColor.ByLayer;
this.lineType = LineType.ByLayer;
this.normal = Vector3d.UnitZ;
}
示例13: Line
/// <summary>
/// Initializes a new instance of the <c>Line</c> class.
/// </summary>
public Line()
: base(DxfObjectCode.Line)
{
this.startPoint = Vector3d.Zero;
this.endPoint = Vector3d.Zero;
this.thickness = 0.0f;
this.layer = Layer.Default;
this.color = AciColor.ByLayer;
this.lineType = LineType.ByLayer;
this.normal = Vector3d.UnitZ;
}
示例14: PolylineVertex
/// <summary>
/// Initializes a new instance of the <c>PolylineVertex</c> class.
/// </summary>
/// <param name="location">Polyline <see cref="Vector2d">vertex</see> coordinates.</param>
public PolylineVertex(Vector2d location)
: base(DxfObjectCode.Vertex)
{
this.flags = VertexTypeFlags.PolylineVertex;
this.location = location;
this.layer = Layer.Default;
this.color = AciColor.ByLayer;
this.lineType = LineType.ByLayer;
this.bulge = 0.0f;
this.beginThickness = 0.0f;
this.endThickness = 0.0f;
}
示例15: Arc
/// <summary>
/// Initializes a new instance of the <c>Arc</c> class.
/// </summary>
/// <param name="center">Arc <see cref="netDxf.Vector3d">center</see> in object coordinates.</param>
/// <param name="radius">Arc radius.</param>
/// <param name="startAngle">Arc start angle in degrees.</param>
/// <param name="endAngle">Arc end angle in degrees.</param>
/// <remarks>The center Z coordinate represents the elevation of the arc along the normal.</remarks>
public Arc(Vector3d center, double radius, double startAngle, double endAngle)
: base(DxfObjectCode.Arc)
{
this.center = center;
this.radius = radius;
this.startAngle = startAngle;
this.endAngle = endAngle;
this.thickness = 0.0f;
this.layer = Layer.Default;
this.color = AciColor.ByLayer;
this.lineType = LineType.ByLayer;
this.normal = Vector3d.UnitZ;
}