Exemple #1
0
        internal Insert(List <Attribute> attributes)
            : base(EntityType.Insert, DxfObjectCode.Insert)
        {
            if (attributes == null)
            {
                throw new ArgumentNullException(nameof(attributes));
            }

            this.attributes = new AttributeCollection(attributes);
            foreach (Attribute att in this.attributes)
            {
                if (att.Owner != null)
                {
                    throw new ArgumentException("The attributes list contains at least an attribute that already has an owner.", nameof(attributes));
                }
                att.Owner = this;
            }

            this.block       = null;
            this.position    = Vector3.Zero;
            this.scale       = new Vector3(1.0);
            this.rotation    = 0.0;
            this.endSequence = new EndSequence
            {
                Owner = this
            };
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <c>Insert</c> class.
        /// </summary>
        /// <param name="block">Insert block definition.</param>
        /// <param name="position">Insert <see cref="Vector3">point</see> in world coordinates.</param>
        public Insert(Block block, Vector3 position, double scale)
            : base(EntityType.Insert, DxfObjectCode.Insert)
        {
            if (block == null)
            {
                throw new ArgumentNullException(nameof(block));
            }

            this.block    = block;
            this.position = position;
            if (scale <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(scale), scale, "The Insert scale must be greater than zero.");
            }
            this.scale  = new Vector3(scale);
            rotation    = 0.0;
            endSequence = new EndSequence(this);

            List <Attribute> atts = new List <Attribute>(block.AttributeDefinitions.Count);

            foreach (AttributeDefinition attdef in block.AttributeDefinitions.Values)
            {
                Attribute att = new Attribute(attdef)
                {
                    Position = attdef.Position + this.position - this.block.Origin,
                    Owner    = this
                };
                atts.Add(att);
            }

            attributes = new AttributeCollection(atts);
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <c>Insert</c> class.
        /// </summary>
        /// <param name="block">Insert block definition.</param>
        /// <param name="position">Insert <see cref="Vector3">point</see> in world coordinates.</param>
        public Insert(Block block, Vector3 position)
            : base(EntityType.Insert, DxfObjectCode.Insert)
        {
            if (block == null)
            {
                throw new ArgumentNullException(nameof(block));
            }

            this.block       = block;
            this.position    = position;
            this.scale       = new Vector3(1.0);
            this.rotation    = 0.0;
            this.endSequence = new EndSequence(this);

            List <Attribute> atts = new List <Attribute>(block.AttributeDefinitions.Count);

            foreach (AttributeDefinition attdef in block.AttributeDefinitions.Values)
            {
                Attribute att = new Attribute(attdef)
                {
                    Position = attdef.Position + this.position - this.block.Origin,
                    Owner    = this
                };
                atts.Add(att);
            }

            this.attributes = new AttributeCollection(atts);
        }
Exemple #4
0
        /// <summary>
        /// Initializes a new instance of the <c>PolyfaceMesh</c> class.
        /// </summary>
        /// <param name="vertexes">Polyface mesh <see cref="PolyfaceMeshVertex">vertex</see> list.</param>
        /// <param name="faces">Polyface mesh <see cref="PolyfaceMeshFace">faces</see> list.</param>
        public PolyfaceMesh(IEnumerable <PolyfaceMeshVertex> vertexes, IEnumerable <PolyfaceMeshFace> faces)
            : base(EntityType.PolyfaceMesh, DxfObjectCode.Polyline)
        {
            this.flags = PolylinetypeFlags.PolyfaceMesh;
            if (vertexes == null)
            {
                throw new ArgumentNullException(nameof(vertexes));
            }
            this.vertexes = new List <PolyfaceMeshVertex>(vertexes);
            if (this.vertexes.Count < 3)
            {
                throw new ArgumentOutOfRangeException(nameof(vertexes), this.vertexes.Count, "The polyface mesh faces list requires at least three points.");
            }

            if (faces == null)
            {
                throw new ArgumentNullException(nameof(vertexes));
            }
            this.faces = new List <PolyfaceMeshFace>(faces);
            if (this.faces.Count < 1)
            {
                throw new ArgumentOutOfRangeException(nameof(vertexes), this.faces.Count, "The polyface mesh faces list requires at least one face.");
            }

            this.endSequence = new EndSequence(this);
        }
 /// <summary>
 /// Initializes a new instance of the <c>PolyfaceMesh</c> class.
 /// </summary>
 /// <param name="vertexes">Polyface mesh <see cref="PolyfaceMeshVertex">vertex</see> list.</param>
 /// <param name="faces">Polyface mesh <see cref="PolyfaceMeshFace">faces</see> list.</param>
 public PolyfaceMesh(List<PolyfaceMeshVertex> vertexes, List<PolyfaceMeshFace> faces)
     : base(EntityType.PolyfaceMesh, DxfObjectCode.Polyline)
 {
     this.flags = PolylineTypeFlags.PolyfaceMesh;
     this.vertexes = vertexes;
     this.faces = faces;
     this.endSequence = new EndSequence();
 }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of the <c>PolyfaceMesh</c> class.
 /// </summary>
 /// <param name="vertexes">Polyface mesh <see cref="PolyfaceMeshVertex">vertex</see> list.</param>
 /// <param name="faces">Polyface mesh <see cref="PolyfaceMeshFace">faces</see> list.</param>
 public PolyfaceMesh(List <PolyfaceMeshVertex> vertexes, List <PolyfaceMeshFace> faces)
     : base(EntityType.PolyfaceMesh, DxfObjectCode.Polyline)
 {
     this.flags       = PolylineTypeFlags.PolyfaceMesh;
     this.vertexes    = vertexes;
     this.faces       = faces;
     this.endSequence = new EndSequence();
 }
 /// <summary>
 /// Initializes a new instance of the <c>Polyline3d</c> class.
 /// </summary>
 /// <param name="vertexes">3d polyline <see cref="PolylineVertex">vertex</see> list.</param>
 /// <param name="isClosed">Sets if the polyline is closed.</param>
 public Polyline(List<PolylineVertex> vertexes, bool isClosed = false) 
     : base (EntityType.Polyline, DxfObjectCode.Polyline)
 {
     if (vertexes == null)
         throw new ArgumentNullException(nameof(vertexes));
     this.vertexes = vertexes;
     this.flags = isClosed ? PolylineTypeFlags.ClosedPolylineOrClosedPolygonMeshInM | PolylineTypeFlags.Polyline3D : PolylineTypeFlags.Polyline3D;
     this.smoothType = PolylineSmoothType.NoSmooth;
     this.endSequence = new EndSequence();
 }
 /// <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();
 }
Exemple #9
0
 /// <summary>
 /// Initializes a new instance of the <c>Polyline3d</c> class.
 /// </summary>
 /// <param name="vertexes">3d polyline <see cref="Polyline3dVertex">vertex</see> list.</param>
 /// <param name="isClosed">Sets if the polyline is closed</param>
 public Polyline3d(List <Polyline3dVertex> vertexes, bool isClosed)
     : base(DxfObjectCode.Polyline)
 {
     this.flags       = isClosed ? PolylineTypeFlags.ClosedPolylineOrClosedPolygonMeshInM | PolylineTypeFlags.Polyline3D : PolylineTypeFlags.Polyline3D;
     this.vertexes    = vertexes;
     this.layer       = Layer.Default;
     this.color       = AciColor.ByLayer;
     this.lineType    = LineType.ByLayer;
     this.endSequence = new EndSequence();
 }
 /// <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();
 }
Exemple #11
0
 /// <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();
 }
Exemple #12
0
 /// <summary>
 /// Initializes a new instance of the <c>Polyline3d</c> class.
 /// </summary>
 public Polyline3d()
     : base(DxfObjectCode.Polyline)
 {
     this.flags       = PolylineTypeFlags.Polyline3D;
     this.vertexes    = new List <Polyline3dVertex>();
     this.layer       = Layer.Default;
     this.color       = AciColor.ByLayer;
     this.lineType    = LineType.ByLayer;
     this.endSequence = new EndSequence();
 }
Exemple #13
0
 /// <summary>
 /// Initializes a new instance of the <c>Polyline3d</c> class.
 /// </summary>
 /// <param name="vertexes">3d polyline <see cref="Polyline3dVertex">vertex</see> list.</param>
 /// <param name="isClosed">Sets if the polyline is closed</param>
 public Polyline3d(List<Polyline3dVertex> vertexes, bool isClosed)
     : base(DxfObjectCode.Polyline)
 {
     this.flags = isClosed ? PolylineTypeFlags.ClosedPolylineOrClosedPolygonMeshInM | PolylineTypeFlags.Polyline3D : PolylineTypeFlags.Polyline3D;
     this.vertexes = vertexes;
     this.layer = Layer.Default;
     this.color = AciColor.ByLayer;
     this.lineType = LineType.ByLayer;
     this.endSequence = new EndSequence();
 }
 /// <summary>
 /// Initializes a new instance of the <c>Polyline3d</c> class.
 /// </summary>
 /// <param name="vertexes">3d polyline <see cref="Vector3">vertex</see> list.</param>
 /// <param name="isClosed">Sets if the polyline is closed.</param>
 public Polyline(IList<Vector3> vertexes, bool isClosed = false)
     : base(EntityType.Polyline, DxfObjectCode.Polyline)
 {
     if (vertexes == null)
         throw new ArgumentNullException(nameof(vertexes));
     this.vertexes = new List<PolylineVertex>(vertexes.Count);
     foreach (Vector3 vertex in vertexes)
         this.vertexes.Add(new PolylineVertex(vertex));
     this.flags = isClosed ? PolylineTypeFlags.ClosedPolylineOrClosedPolygonMeshInM | PolylineTypeFlags.Polyline3D : PolylineTypeFlags.Polyline3D;
     this.smoothType = PolylineSmoothType.NoSmooth;
     this.endSequence = new EndSequence();
 }
Exemple #15
0
 /// <summary>
 /// Initializes a new instance of the <c>Polyline3d</c> class.
 /// </summary>
 /// <param name="vertexes">3d polyline <see cref="PolylineVertex">vertex</see> list.</param>
 /// <param name="isClosed">Sets if the polyline is closed.</param>
 public Polyline(List <PolylineVertex> vertexes, bool isClosed = false)
     : base(EntityType.Polyline, DxfObjectCode.Polyline)
 {
     if (vertexes == null)
     {
         throw new ArgumentNullException("vertexes");
     }
     this.vertexes    = vertexes;
     this.flags       = isClosed ? PolylineTypeFlags.ClosedPolylineOrClosedPolygonMeshInM | PolylineTypeFlags.Polyline3D : PolylineTypeFlags.Polyline3D;
     this.smoothType  = PolylineSmoothType.NoSmooth;
     this.endSequence = new EndSequence();
 }
Exemple #16
0
 /// <summary>
 /// Initializes a new instance of the <c>Polyline</c> class.
 /// </summary>
 public Polyline()
     : base(DxfObjectCode.Polyline)
 {
     this.vertexes    = new List <PolylineVertex>();
     this.isClosed    = false;
     this.layer       = Layer.Default;
     this.color       = AciColor.ByLayer;
     this.lineType    = LineType.ByLayer;
     this.normal      = Vector3d.UnitZ;
     this.elevation   = 0.0;
     this.flags       = PolylineTypeFlags.OpenPolyline;
     this.endSequence = new EndSequence();
 }
Exemple #17
0
 /// <summary>
 /// Initializes a new instance of the <c>Polyline</c> class.
 /// </summary>
 /// <param name="vertexes">Polyline vertex list in object coordinates.</param>
 /// <param name="isClosed">Sets if the polyline is closed</param>
 public Polyline(List<PolylineVertex> vertexes, bool isClosed)
     : base(DxfObjectCode.Polyline)
 {
     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;
     this.endSequence = new EndSequence();
 }
Exemple #18
0
 /// <summary>
 /// Initializes a new instance of the <c>Polyline</c> class.
 /// </summary>
 /// <param name="vertexes">Polyline vertex list in object coordinates.</param>
 /// <param name="isClosed">Sets if the polyline is closed</param>
 public Polyline(List <PolylineVertex> vertexes, bool isClosed)
     : base(DxfObjectCode.Polyline)
 {
     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;
     this.endSequence = new EndSequence();
 }
Exemple #19
0
 /// <summary>
 /// Initializes a new instance of the <c>Polyline3d</c> class.
 /// </summary>
 /// <param name="vertexes">3d polyline <see cref="Vector3">vertex</see> list.</param>
 /// <param name="isClosed">Sets if the polyline is closed.</param>
 public Polyline(IList <Vector3> vertexes, bool isClosed = false)
     : base(EntityType.Polyline, DxfObjectCode.Polyline)
 {
     if (vertexes == null)
     {
         throw new ArgumentNullException(nameof(vertexes));
     }
     this.vertexes = new List <PolylineVertex>(vertexes.Count);
     foreach (Vector3 vertex in vertexes)
     {
         this.vertexes.Add(new PolylineVertex(vertex));
     }
     this.flags       = isClosed ? PolylineTypeFlags.ClosedPolylineOrClosedPolygonMeshInM | PolylineTypeFlags.Polyline3D : PolylineTypeFlags.Polyline3D;
     this.smoothType  = PolylineSmoothType.NoSmooth;
     this.endSequence = new EndSequence();
 }
Exemple #20
0
        /// <summary>
        /// Initializes a new instance of the <c>PolyfaceMesh</c> class.
        /// </summary>
        /// <param name="vertexes">Polyface mesh <see cref="PolyfaceMeshVertex">vertex</see> list.</param>
        /// <param name="faces">Polyface mesh <see cref="PolyfaceMeshFace">faces</see> list.</param>
        public PolyfaceMesh(IEnumerable<PolyfaceMeshVertex> vertexes, IEnumerable<PolyfaceMeshFace> faces)
            : base(EntityType.PolyfaceMesh, DxfObjectCode.Polyline)
        {
            this.flags = PolylinetypeFlags.PolyfaceMesh;
            if (vertexes == null)
                throw new ArgumentNullException(nameof(vertexes));
            this.vertexes = new List<PolyfaceMeshVertex>(vertexes);
            if (this.vertexes.Count < 3)
                throw new ArgumentOutOfRangeException(nameof(vertexes), this.vertexes.Count, "The polyface mesh faces list requires at least three points.");

            if (faces == null)
                throw new ArgumentNullException(nameof(vertexes));
            this.faces = new List<PolyfaceMeshFace>(faces);
            if (this.faces.Count < 1)
                throw new ArgumentOutOfRangeException(nameof(vertexes), this.faces.Count, "The polyface mesh faces list requires at least one face.");

            this.endSequence = new EndSequence(this);
        }
 /// <summary>
 /// Initializes a new instance of the <c>Polyline</c> class.
 /// </summary>
 /// <param name="vertexes">Polyline <see cref="Vector2">vertex</see> list in object coordinates.</param>
 /// <param name="isClosed">Sets if the polyline is closed.</param>
 public Polyline(IEnumerable <Vector2> vertexes, bool isClosed = false)
     : base(DxfObjectCode.Polyline)
 {
     this.vertexes = new List <PolylineVertex>();
     foreach (Vector2 vertex in vertexes)
     {
         this.vertexes.Add(new PolylineVertex(vertex));
     }
     this.isClosed    = isClosed;
     this.layer       = Layer.Default;
     this.color       = AciColor.ByLayer;
     this.lineType    = LineType.ByLayer;
     this.normal      = Vector3.UnitZ;
     this.elevation   = 0.0;
     this.thickness   = 0.0;
     this.flags       = isClosed ? PolylineTypeFlags.ClosedPolylineOrClosedPolygonMeshInM : PolylineTypeFlags.OpenPolyline;
     this.endSequence = new EndSequence();
 }
Exemple #22
0
        /// <summary>
        /// Initializes a new instance of the <c>Polyline3d</c> class.
        /// </summary>
        /// <param name="vertexes">3d polyline <see cref="Vector3">vertex</see> list.</param>
        /// <param name="isClosed">Sets if the polyline is closed, by default it will create an open polyline.</param>
        public Polyline(IEnumerable<Vector3> vertexes, bool isClosed)
            : base(EntityType.Polyline, DxfObjectCode.Polyline)
        {
            if (vertexes == null)
                throw new ArgumentNullException(nameof(vertexes));
            this.vertexes = new ObservableCollection<PolylineVertex>();
            this.vertexes.BeforeAddItem += this.Vertexes_BeforeAddItem;
            this.vertexes.AddItem += this.Vertexes_AddItem;
            this.vertexes.BeforeRemoveItem += this.Vertexes_BeforeRemoveItem;
            this.vertexes.RemoveItem += this.Vertexes_RemoveItem;

            foreach (Vector3 vertex in vertexes)
                this.vertexes.Add(new PolylineVertex(vertex));

            this.flags = isClosed ? PolylinetypeFlags.ClosedPolylineOrClosedPolygonMeshInM | PolylinetypeFlags.Polyline3D : PolylinetypeFlags.Polyline3D;
            this.smoothType = PolylineSmoothType.NoSmooth;
            this.endSequence = new EndSequence(this);
        }
Exemple #23
0
        /// <summary>
        /// Initializes a new instance of the <c>Polyline3d</c> class.
        /// </summary>
        /// <param name="vertexes">3d polyline <see cref="PolylineVertex">vertex</see> list.</param>
        /// <param name="isClosed">Sets if the polyline is closed  (default: false).</param>
        public Polyline(IEnumerable <PolylineVertex> vertexes, bool isClosed)
            : base(EntityType.Polyline, DxfObjectCode.Polyline)
        {
            if (vertexes == null)
            {
                throw new ArgumentNullException("vertexes");
            }
            this.vertexes = new ObservableCollection <PolylineVertex>();
            this.vertexes.BeforeAddItem    += this.Vertexes_BeforeAddItem;
            this.vertexes.AddItem          += this.Vertexes_AddItem;
            this.vertexes.BeforeRemoveItem += this.Vertexes_BeforeRemoveItem;
            this.vertexes.RemoveItem       += this.Vertexes_RemoveItem;

            this.vertexes.AddRange(vertexes);

            this.flags       = isClosed ? PolylinetypeFlags.ClosedPolylineOrClosedPolygonMeshInM | PolylinetypeFlags.Polyline3D : PolylinetypeFlags.Polyline3D;
            this.smoothType  = PolylineSmoothType.NoSmooth;
            this.endSequence = new EndSequence(this);
        }
Exemple #24
0
        internal Insert(List <Attribute> attributes)
            : base(EntityType.Insert, DxfObjectCode.Insert)
        {
            if (attributes == null)
            {
                throw new ArgumentNullException(nameof(attributes));
            }
            this.attributes = new AttributeCollection(attributes);
            foreach (Attribute att in this.attributes)
            {
                if (att.Owner != null)
                {
                    throw new ArgumentException("The attributes list contains at least an attribute that already has an owner.", nameof(attributes));
                }
                att.Owner = this;
            }

            this.endSequence = new EndSequence(this);
        }
Exemple #25
0
        /// <summary>
        /// Initializes a new instance of the <c>Insert</c> class.
        /// </summary>
        /// <param name="block">Insert block definition.</param>
        /// <param name="insertionPoint">Insert <see cref="Vector3d">point</see>.</param>
        public Insert(Block block, Vector3d insertionPoint)
            : base(DxfObjectCode.Insert)
        {
            if (block == null)
                throw new ArgumentNullException("block");

            this.block = block;
            this.insertionPoint = insertionPoint;
            this.scale = new Vector3d(1.0f, 1.0f, 1.0f);
            this.rotation = 0.0f;
            this.normal = Vector3d.UnitZ;
            this.layer = Layer.Default;
            this.color = AciColor.ByLayer;
            this.lineType = LineType.ByLayer;
            this.attributes = new List<Attribute>();
            foreach (AttributeDefinition attdef in block.Attributes.Values)
            {
                this.attributes.Add(new Attribute(attdef));
            }
            this.endSequence = new EndSequence();
        }
Exemple #26
0
        /// <summary>
        /// Initializes a new instance of the <c>Polyline3d</c> class.
        /// </summary>
        /// <param name="vertexes">3d polyline <see cref="Vector3">vertex</see> list.</param>
        /// <param name="isClosed">Sets if the polyline is closed, by default it will create an open polyline.</param>
        public Polyline(IEnumerable <Vector3> vertexes, bool isClosed)
            : base(EntityType.Polyline, DxfObjectCode.Polyline)
        {
            if (vertexes == null)
            {
                throw new ArgumentNullException(nameof(vertexes));
            }
            this.vertexes = new ObservableCollection <PolylineVertex>();
            this.vertexes.BeforeAddItem    += Vertexes_BeforeAddItem;
            this.vertexes.AddItem          += Vertexes_AddItem;
            this.vertexes.BeforeRemoveItem += Vertexes_BeforeRemoveItem;
            this.vertexes.RemoveItem       += Vertexes_RemoveItem;

            foreach (Vector3 vertex in vertexes)
            {
                this.vertexes.Add(new PolylineVertex(vertex));
            }

            flags       = isClosed ? PolylinetypeFlags.ClosedPolylineOrClosedPolygonMeshInM | PolylinetypeFlags.Polyline3D : PolylinetypeFlags.Polyline3D;
            smoothType  = PolylineSmoothType.NoSmooth;
            endSequence = new EndSequence(this);
        }
Exemple #27
0
        /// <summary>
        /// Initializes a new instance of the <c>Insert</c> class.
        /// </summary>
        /// <param name="block">Insert <see cref="Blocks.Block">block definition</see>.</param>
        public Insert(Block block)
            : base(DxfObjectCode.Insert)
        {
            if (block == null)
            {
                throw new ArgumentNullException("block");
            }

            this.block          = block;
            this.insertionPoint = Vector3d.Zero;
            this.scale          = new Vector3d(1.0, 1.0, 1.0);
            this.rotation       = 0.0f;
            this.normal         = Vector3d.UnitZ;
            this.layer          = Layer.Default;
            this.color          = AciColor.ByLayer;
            this.lineType       = LineType.ByLayer;
            this.attributes     = new List <Attribute>();
            foreach (AttributeDefinition attdef in block.Attributes.Values)
            {
                this.attributes.Add(new Attribute(attdef));
            }
            this.endSequence = new EndSequence();
        }
Exemple #28
0
        /// <summary>
        /// Initializes a new instance of the <c>Insert</c> class.
        /// </summary>
        /// <param name="block">Insert block definition.</param>
        /// <param name="position">Insert <see cref="Vector3">point</see> in world coordinates.</param>
        public Insert(Block block, Vector3 position)
            : base(EntityType.Insert, DxfObjectCode.Insert)
        {
            if (block == null)
                throw new ArgumentNullException("block");
            
            this.block = block;
            this.position = position;
            this.scale = new Vector3(1.0);
            this.rotation = 0.0;
            this.endSequence = new EndSequence();

            List<Attribute> atts = new List<Attribute>(block.AttributeDefinitions.Count);
            foreach (AttributeDefinition attdef in block.AttributeDefinitions.Values)
            {
                Attribute att = new Attribute(attdef)
                {
                    Position = attdef.Position + this.position - this.block.Position,
                    Owner = this
                };
                atts.Add(att);
            }

            this.attributes = new AttributeDictionary(atts);
        }
Exemple #29
0
 /// <summary>
 /// Initializes a new instance of the <c>Polyline</c> class.
 /// </summary>
 public Polyline()
     : base(DxfObjectCode.Polyline)
 {
     this.vertexes = new List<PolylineVertex>();
     this.isClosed = false;
     this.layer = Layer.Default;
     this.color = AciColor.ByLayer;
     this.lineType = LineType.ByLayer;
     this.normal = Vector3d.UnitZ;
     this.elevation = 0.0;
     this.flags = PolylineTypeFlags.OpenPolyline;
     this.endSequence = new EndSequence();
 }
Exemple #30
0
 internal Insert()
     : base (EntityType.Insert, DxfObjectCode.Insert)
 {
     this.endSequence = new EndSequence();
     this.attributes = new AttributeDictionary();
 }
Exemple #31
0
 internal Insert()
     : base(EntityType.Insert, DxfObjectCode.Insert)
 {
     this.endSequence = new EndSequence();
     this.attributes  = new AttributeCollection();
 }