本文整理汇总了C#中netDxf.Tables.Layer类的典型用法代码示例。如果您正苦于以下问题:C# Layer类的具体用法?C# Layer怎么用?C# Layer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Layer类属于netDxf.Tables命名空间,在下文中一共展示了Layer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
}
}
}
开发者ID:Spritutu,项目名称:ntxx,代码行数:40,代码来源:Fan.cs
示例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;
}
开发者ID:fearog,项目名称:axecalc,代码行数:15,代码来源:PolyfaceMeshFace.cs
示例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;
}
开发者ID:steve-stanton,项目名称:backsight,代码行数:14,代码来源:Attribute.cs
示例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;
}
开发者ID:steve-stanton,项目名称:backsight,代码行数:12,代码来源:Polyline3dVertex.cs
示例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;
}
开发者ID:steve-stanton,项目名称:backsight,代码行数:13,代码来源:PolyfaceMeshVertex.cs
示例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();
}
开发者ID:steve-stanton,项目名称:backsight,代码行数:13,代码来源:PolyfaceMesh.cs
示例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();
}
开发者ID:fearog,项目名称:axecalc,代码行数:14,代码来源:Polyline3d.cs
示例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);
}
开发者ID:Spritutu,项目名称:ntxx,代码行数:10,代码来源:Slash.cs
示例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;
}
开发者ID:fearog,项目名称:axecalc,代码行数:13,代码来源:Point.cs
示例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);
}
开发者ID:Spritutu,项目名称:ntxx,代码行数:61,代码来源:Wind.cs
示例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;
}
开发者ID:NTUST-PTL,项目名称:PTL-Project,代码行数:11,代码来源:EntityObject.cs
示例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;
}
开发者ID:steve-stanton,项目名称:backsight,代码行数:14,代码来源:Circle.cs
示例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;
}
开发者ID:fearog,项目名称:axecalc,代码行数:14,代码来源:Line.cs
示例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;
}
开发者ID:fearog,项目名称:axecalc,代码行数:16,代码来源:PolylineVertex.cs
示例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;
}
开发者ID:steve-stanton,项目名称:backsight,代码行数:21,代码来源:Arc.cs
示例16: Solid
/// <summary>
/// Initializes a new instance of the <c>Solid</c> class.
/// </summary>
/// <param name="firstVertex">Solid <see cref="Vector3d">first vertex</see>.</param>
/// <param name="secondVertex">Solid <see cref="Vector3d">second vertex</see>.</param>
/// <param name="thirdVertex">Solid <see cref="Vector3d">third vertex</see>.</param>
/// <param name="fourthVertex">Solid <see cref="Vector3d">fourth vertex</see>.</param>
public Solid(Vector3d firstVertex, Vector3d secondVertex, Vector3d thirdVertex, Vector3d fourthVertex)
: base(DxfObjectCode.Solid)
{
this.firstVertex = firstVertex;
this.secondVertex = secondVertex;
this.thirdVertex = thirdVertex;
this.fourthVertex = fourthVertex;
this.thickness = 0.0f;
this.normal = Vector3d.UnitZ;
this.layer = Layer.Default;
this.color = AciColor.ByLayer;
this.lineType = LineType.ByLayer;
}
开发者ID:fearog,项目名称:axecalc,代码行数:20,代码来源:Solid.cs
示例17: NurbsCurve
/// <summary>
/// Initializes a new instance of the <c>NurbsCurve</c> class.
/// </summary>
public NurbsCurve()
{
this.controlPoints = new List<NurbsVertex>();
this.normal = Vector3d.UnitZ;
this.layer = Layer.Default;
this.color = AciColor.ByLayer;
this.lineType = LineType.ByLayer;
this.order = 0;
this.curvePoints = 30;
this.elevation = 0.0;
this.thickness = 0.0f;
this.normal = Vector3d.UnitZ;
}
开发者ID:steve-stanton,项目名称:backsight,代码行数:16,代码来源:NURBSCurve.cs
示例18: LightWeightPolyline
/// <summary>
/// Initializes a new instance of the <c>Polyline</c> class.
/// </summary>
/// <param name="vertexes">Polyline <see cref="LightWeightPolylineVertex">vertex</see> list in object coordinates.</param>
/// <param name="isClosed">Sets if the polyline is closed</param>
public LightWeightPolyline(List<LightWeightPolylineVertex> vertexes, bool isClosed)
: base(DxfObjectCode.LightWeightPolyline)
{
this.vertexes = vertexes;
this.isClosed = isClosed;
this.layer = Layer.Default;
this.color = AciColor.ByLayer;
this.lineType = LineType.ByLayer;
this.normal = Vector3d.UnitZ;
this.elevation = 0.0;
this.thickness = 0.0f;
this.flags = isClosed ? PolylineTypeFlags.ClosedPolylineOrClosedPolygonMeshInM : PolylineTypeFlags.OpenPolyline;
}
开发者ID:steve-stanton,项目名称:backsight,代码行数:18,代码来源:LightWeightPolyline.cs
示例19: Block
/// <summary>
/// Initializes a new instance of the <c>Block</c> class.
/// </summary>
/// <param name="name">Block name.</param>
public Block(string name)
: base(DxfObjectCode.Block)
{
if (string.IsNullOrEmpty(name))
throw (new ArgumentNullException("name"));
this.name = name;
this.basePoint = Vector3d.Zero;
this.layer = Layer.Default;
this.attributes = new Dictionary<string, AttributeDefinition>();
this.entities = new List<IEntityObject>();
this.record=new BlockRecord(name);
this.end = new BlockEnd(this.layer);
}
开发者ID:steve-stanton,项目名称:backsight,代码行数:18,代码来源:Block.cs
示例20: Text
/// <summary>
/// Initializes a new instance of the <c>Text</c> class.
/// </summary>
public Text()
: base(DxfObjectCode.Text)
{
this.value = string.Empty;
this.basePoint = Vector3d.Zero;
this.alignment = TextAlignment.BaselineLeft;
this.layer = Layer.Default;
this.color = AciColor.ByLayer;
this.lineType = LineType.ByLayer;
this.normal = Vector3d.UnitZ;
this.style = TextStyle.Default;
this.rotation = 0.0f;
this.height = 0.0f;
this.widthFactor = 1.0f;
this.obliqueAngle = 0.0f;
}
开发者ID:steve-stanton,项目名称:backsight,代码行数:19,代码来源:Text.cs
注:本文中的netDxf.Tables.Layer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论