Example #1
0
        public Underlay(UnderlayDefinition definition)
            : base(EntityType.Underlay, DxfObjectCode.Underlay)
        {
            if (definition == null)
            {
                throw new ArgumentNullException(nameof(definition));
            }
            this.definition       = definition;
            this.position         = Vector3.Zero;
            this.scale            = new Vector3(1.0);
            this.rotation         = 0.0;
            this.contrast         = 100;
            this.fade             = 0;
            this.displayOptions   = UnderlayDisplayFlags.ShowUnderlay;
            this.clippingBoundary = null;
            switch (this.definition.Type)
            {
            case UnderlayType.DGN:
                this.CodeName = DxfObjectCode.UnderlayDgn;
                break;

            case UnderlayType.DWF:
                this.CodeName = DxfObjectCode.UnderlayDwf;
                break;

            case UnderlayType.PDF:
                this.CodeName = DxfObjectCode.UnderlayPdf;
                break;
            }
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <c>Underlay</c> class.
        /// </summary>
        /// <param name="definition"><see cref="UnderlayDefinition">Underlay definition</see>.</param>
        /// <param name="position">Underlay <see cref="Vector3">position</see> in world coordinates.</param>
        /// <param name="scale">Underlay scale.</param>
        public Underlay(UnderlayDefinition definition, Vector3 position, double scale)
            : base(EntityType.Underlay, DxfObjectCode.Underlay)
        {
            if (definition == null)
            {
                throw new ArgumentNullException(nameof(definition));
            }
            this.definition = definition;
            this.position   = position;
            if (scale <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(scale), scale, "The Underlay scale must be greater than zero.");
            }
            this.scale            = new Vector2(scale);
            this.rotation         = 0.0;
            this.contrast         = 100;
            this.fade             = 0;
            this.displayOptions   = UnderlayDisplayFlags.ShowUnderlay;
            this.clippingBoundary = null;
            switch (this.definition.Type)
            {
            case UnderlayType.DGN:
                this.CodeName = DxfObjectCode.UnderlayDgn;
                break;

            case UnderlayType.DWF:
                this.CodeName = DxfObjectCode.UnderlayDwf;
                break;

            case UnderlayType.PDF:
                this.CodeName = DxfObjectCode.UnderlayPdf;
                break;
            }
        }
Example #3
0
        protected virtual UnderlayDefinition OnUnderlayDefinitionChangedEvent(UnderlayDefinition oldUnderlayDefinition, UnderlayDefinition newUnderlayDefinition)
        {
            UnderlayDefinitionChangedEventHandler ae = this.UnderlayDefinitionChanged;

            if (ae != null)
            {
                TableObjectChangedEventArgs <UnderlayDefinition> eventArgs = new TableObjectChangedEventArgs <UnderlayDefinition>(oldUnderlayDefinition, newUnderlayDefinition);
                ae(this, eventArgs);
                return(eventArgs.NewValue);
            }
            return(newUnderlayDefinition);
        }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <c>Underlay</c> class.
 /// </summary>
 /// <param name="definition"><see cref="UnderlayDefinition">Underlay definition</see>.</param>
 /// <param name="position">Underlay <see cref="Vector3">position</see> in world coordinates.</param>
 public Underlay(UnderlayDefinition definition, Vector3 position)
     : this(definition, position, 1.0)
 {
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <c>Underlay</c> class.
 /// </summary>
 /// <param name="definition"><see cref="UnderlayDefinition">Underlay definition</see>.</param>
 public Underlay(UnderlayDefinition definition)
     : this(definition, Vector3.Zero, 1.0)
 {
 }