Пример #1
0
 /// <summary>
 /// Moves all Rooms in the Story and the Story Envelope along a 3D vector calculated between the supplied Vector3 points.
 /// </summary>
 /// <param name="from">Vector3 base point of the move.</param>
 /// <param name="to">Vector3 target point of the move.</param>
 /// <returns>
 /// None.
 /// </returns>
 public void MoveFromTo(Vector3 from, Vector3 to)
 {
     if (Perimeter != null)
     {
         Perimeter = Perimeter.MoveFromTo(from, to);
     }
     foreach (var room in Corridors)
     {
         room.MoveFromTo(from, to);
     }
     foreach (var room in Exclusions)
     {
         room.MoveFromTo(from, to);
     }
     foreach (var room in Openings)
     {
         room.MoveFromTo(from, to);
     }
     foreach (var room in Rooms)
     {
         room.MoveFromTo(from, to);
     }
     foreach (var room in Services)
     {
         room.MoveFromTo(from, to);
     }
 }
Пример #2
0
 /// <summary>
 /// Moves the Room along a 3D vector calculated between the supplied Vector3 points.
 /// </summary>
 /// <param name="from">Vector3 base point of the move.</param>
 /// <param name="to">Vector3 target point of the move.</param>
 /// <returns>
 /// A Polygon represeting the Room's new Perimeter.
 /// </returns>
 public Polygon MoveFromTo(Vector3 from, Vector3 to)
 {
     if (Perimeter != null)
     {
         Perimeter = Perimeter.MoveFromTo(from, to);
     }
     return(Perimeter);
 }
Пример #3
0
 /// <summary>
 /// Moves all Rooms, the Boundary and the Row along a 3D vector calculated between the supplied Vector3 points.
 /// </summary>
 /// <param name="from">Vector3 base point of the move.</param>
 /// <param name="to">Vector3 target point of the move.</param>
 /// <returns>
 /// None.
 /// </returns>
 public void MoveFromTo(Vector3 from, Vector3 to)
 {
     foreach (var room in Rooms)
     {
         room.MoveFromTo(from, to);
     }
     Perimeter = Perimeter.MoveFromTo(from, to);
 }
Пример #4
0
 /// <summary>
 /// Moves the Room along a 3D vector calculated between the supplied Vector3 points.
 /// </summary>
 /// <param name="from">Vector3 base point of the move.</param>
 /// <param name="to">Vector3 target point of the move.</param>
 /// <returns>
 /// A Polygon represeting the Room's new Perimeter.
 /// </returns>
 public Polygon MoveFromTo(Vector3 from, Vector3 to)
 {
     if (Perimeter != null)
     {
         Perimeter = Perimeter.MoveFromTo(from, to);
     }
     Elevation = to.Z - from.Z;
     return(Perimeter);
 }
Пример #5
0
 /// <summary>
 /// Moves all Rooms in the RoomGroup and the RoomGroup Perimeter along a 3D vector calculated between the supplied Vector3 points.
 /// </summary>
 /// <param name="from">Vector3 base point of the move.</param>
 /// <param name="to">Vector3 target point of the move.</param>
 /// <returns>
 /// None.
 /// </returns>
 public void MoveFromTo(Vector3 from, Vector3 to)
 {
     foreach (Room room in Rooms)
     {
         room.MoveFromTo(from, to);
     }
     if (Perimeter != null)
     {
         Perimeter = Perimeter.MoveFromTo(from, to);
     }
     Elevation = to.Z - from.Z;
 }
Пример #6
0
 /// <summary>
 /// Moves all Cores and Stories in the Tower along a 3D vector calculated between the supplied Vector3 points.
 /// </summary>
 /// <param name="from">Vector3 base point of the move.</param>
 /// <param name="to">Vector3 target point of the move.</param>
 /// <returns>
 /// None.
 /// </returns>
 public void MoveFromTo(Vector3 from, Vector3 to)
 {
     foreach (Story story in Stories)
     {
         story.MoveFromTo(from, to);
     }
     foreach (Room core in Cores)
     {
         core.MoveFromTo(from, to);
     }
     if (Perimeter != null)
     {
         Perimeter = Perimeter.MoveFromTo(from, to);
     }
 }
Пример #7
0
        /// <summary>
        /// Moves all Rooms along a 3D vector calculated between the supplied Vector3 points.
        /// </summary>
        /// <param name="from">Vector3 base point of the move.</param>
        /// <param name="to">Vector3 target point of the move.</param>
        /// <returns>
        /// None.
        /// </returns>
        public void MoveFromTo(Vector3 from, Vector3 to)
        {
            foreach (Room room in Rooms)
            {
                room.MoveFromTo(from, to);
            }
            Perimeter = Perimeter.MoveFromTo(from, to);
            var ang = Perimeter.Segments().OrderByDescending(s => s.Length()).ToList().First();

            Angle        = Math.Atan2(ang.End.Y - ang.Start.Y, ang.End.X - ang.Start.X) * (180 / Math.PI);
            perimeterJig = Perimeter.Rotate(Vector3.Origin, Angle * -1);
            compass      = perimeterJig.Compass();
            insert.MoveFromTo(from, to);
            Row = new Line(compass.SW, compass.SE).Rotate(Vector3.Origin, Angle);
        }
Пример #8
0
        /// <summary>
        /// Places a Polygon east of another Polygon, attempting to align bounding box corners or the horizontal bounding box axis.
        /// </summary>
        /// <param name="polygon">The Polygon to be placed adjacent to another Polygon.</param>
        /// <param name="adjTo">The Polygon adjacent to which the new Polygon will be located.</param>
        /// <param name="perimeter">The Polygon that must cover the resulting Polygon.</param>
        /// <param name="among">The collection of Polygons that must not intersect the resulting Polygon.</param>
        /// <returns>
        ///  A new Polygon or null if the conditions of placement cannot be satisfied.
        /// </returns>



        /// <summary>
        /// Creates and sets a rectangular Room Perimeter with dimensions derived from Room characteristics with its southwest corner at the supplied Vector3 point. If no point is supplied, the southwest corner is placed at the origin.
        /// </summary>
        /// <param name="moveTo">The Vector3 indication the location of new Polygon's southwest corner.</param>
        /// <returns>
        /// A new rectilinear Polygon derived either from fixed DesignX and DesignY dimensions or as a rectilinear target area of a random ratio between 1 and 2 of the Room's X to Y dimensions.
        /// </returns>
        public Polygon MakePerimeter(Vector3 moveTo = null)
        {
            if (DesignX > 0.0 && DesignY > 0.0)
            {
                Perimeter = Shaper.PolygonBox(DesignX, DesignY);
            }
            else
            {
                Perimeter = Shaper.AreaFromCorner(DesignArea, Shaper.RandomDouble(1, 2));
            }
            if (moveTo != null)
            {
                Perimeter = Perimeter.MoveFromTo(new Vector3(), moveTo);
            }
            return(Perimeter);
        }