當前位置: 首頁>>代碼示例>>C#>>正文


C# Tables.Layer類代碼示例

本文整理匯總了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));
                }
            }
        }
開發者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


注:本文中的netDxf.Tables.Layer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。