예제 #1
0
 public Door(List <Point3D> boundary)
 {
     Geometry = new Face3D {
         Boundary = boundary
     };
     BoundaryCondition = new Outdoors();
     Properties        = new HB.DoorPropertiesAbridged();
 }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Door" /> class.
        /// </summary>
        /// <param name="name">Name of the object used in all simulation engines. Must not contain spaces and use only letters, digits and underscores/dashes. It cannot be longer than 100 characters. (required).</param>
        /// <param name="geometry">Planar Face3D for the geometry. (required).</param>
        /// <param name="boundaryCondition">boundaryCondition (required).</param>
        /// <param name="properties">Extension properties for particular simulation engines (Radiance, EnergyPlus). (required).</param>
        /// <param name="displayName">Display name of the object with no restrictions..</param>
        /// <param name="type">type (default to &quot;Door&quot;).</param>
        /// <param name="isGlass">Boolean to note whether this object is a glass door as opposed to an opaque door. (default to false).</param>
        /// <param name="indoorShades">Shades assigned to the interior side of this object..</param>
        /// <param name="outdoorShades">Shades assigned to the exterior side of this object (eg. entryway awning)..</param>
        public Door(string name, Face3D geometry, AnyOf <Outdoors, Surface> boundaryCondition, DoorPropertiesAbridged properties, string displayName = default, string type = "Door", bool isGlass = false, List <Shade> indoorShades = default, List <Shade> outdoorShades = default)
        {
            // to ensure "name" is required (not null)
            if (name == null)
            {
                throw new InvalidDataException("name is a required property for Door and cannot be null");
            }
            else
            {
                this.Name = name;
            }

            // to ensure "geometry" is required (not null)
            if (geometry == null)
            {
                throw new InvalidDataException("geometry is a required property for Door and cannot be null");
            }
            else
            {
                this.Geometry = geometry;
            }

            // to ensure "boundaryCondition" is required (not null)
            if (boundaryCondition == null)
            {
                throw new InvalidDataException("boundaryCondition is a required property for Door and cannot be null");
            }
            else
            {
                this.BoundaryCondition = boundaryCondition;
            }

            // to ensure "properties" is required (not null)
            if (properties == null)
            {
                throw new InvalidDataException("properties is a required property for Door and cannot be null");
            }
            else
            {
                this.Properties = properties;
            }

            this.DisplayName = displayName;
            // use default value if no "type" provided
            if (type == null)
            {
                this.Type = "Door";
            }
            else
            {
                this.Type = type;
            }
            // use default value if no "isGlass" provided
            if (isGlass == null)
            {
                this.IsGlass = false;
            }
            else
            {
                this.IsGlass = isGlass;
            }
            this.IndoorShades  = indoorShades;
            this.OutdoorShades = outdoorShades;
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Door" /> class.
        /// </summary>
        /// <param name="geometry">Planar Face3D for the geometry. (required).</param>
        /// <param name="boundaryCondition">boundaryCondition (required).</param>
        /// <param name="properties">Extension properties for particular simulation engines (Radiance, EnergyPlus). (required).</param>
        /// <param name="isGlass">Boolean to note whether this object is a glass door as opposed to an opaque door. (default to false).</param>
        /// <param name="indoorShades">Shades assigned to the interior side of this object..</param>
        /// <param name="outdoorShades">Shades assigned to the exterior side of this object (eg. entryway awning)..</param>
        /// <param name="identifier">Text string for a unique object ID. This identifier remains constant as the object is mutated, copied, and serialized to different formats (eg. dict, idf, rad). This identifier is also used to reference the object across a Model. It must be &lt; 100 characters and not contain any spaces or special characters. (required).</param>
        /// <param name="displayName">Display name of the object with no character restrictions..</param>
        /// <param name="userData">Optional dictionary of user data associated with the object.All keys and values of this dictionary should be of a standard data type to ensure correct serialization of the object (eg. str, float, int, list)..</param>
        public Door
        (
            string identifier, Face3D geometry, AnyOf <Outdoors, Surface> boundaryCondition, DoorPropertiesAbridged properties,                                      // Required parameters
            string displayName = default, Object userData = default, bool isGlass = false, List <Shade> indoorShades = default, List <Shade> outdoorShades = default // Optional parameters
        ) : base(identifier: identifier, displayName: displayName, userData: userData)                                                                               // BaseClass
        {
            // to ensure "geometry" is required (not null)
            this.Geometry = geometry ?? throw new ArgumentNullException("geometry is a required property for Door and cannot be null");
            // to ensure "boundaryCondition" is required (not null)
            this.BoundaryCondition = boundaryCondition ?? throw new ArgumentNullException("boundaryCondition is a required property for Door and cannot be null");
            // to ensure "properties" is required (not null)
            this.Properties    = properties ?? throw new ArgumentNullException("properties is a required property for Door and cannot be null");
            this.IsGlass       = isGlass;
            this.IndoorShades  = indoorShades;
            this.OutdoorShades = outdoorShades;

            // Set non-required readonly properties with defaultValue
            this.Type = "Door";

            // check if object is valid, only check for inherited class
            if (this.GetType() == typeof(Door))
            {
                this.IsValid(throwException: true);
            }
        }