!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!                                                                      !
! GLE - Graphics Layout Engine <http://www.gle-graphics.org/>          !
!                                                                      !
! Modified BSD License                                                 !
!                                                                      !
! Copyright (C) 2009 GLE.                                              !
!                                                                      !
! Redistribution and use in source and binary forms, with or without   !
! modification, are permitted provided that the following conditions   !
! are met:                                                             !
!                                                                      !
!    1. Redistributions of source code must retain the above copyright !
! notice, this list of conditions and the following disclaimer.        !
!                                                                      !
!    2. Redistributions in binary form must reproduce the above        !
! copyright notice, this list of conditions and the following          !
! disclaimer in the documentation and/or other materials provided with !
! the distribution.                                                    !
!                                                                      !
!    3. The name of the author may not be used to endorse or promote   !
! products derived from this software without specific prior written   !
! permission.                                                          !
!                                                                      !
! THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR   !
! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED       !
! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE   !
! ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY       !
! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL   !
! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE    !
! GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS        !
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER !
! IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR      !
! OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN  !
! IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                        !
!                                                                      !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

size 9 4.1

set font psh

sub red_bullet
   ! draw a red bullet
   gsave
   set color red fill red
   circle 0.06
   grestore
end sub

begin object house
   ! draw a house with a named door and window
   set join round
   ! draw the roof
   begin path stroke fill lightsalmon
      amove 0 1.625
      aline 1.25 2.5
      aline 2.5 1.625
      closepath
   end path
   ! draw the brick wall
   amove 0 0
   box 2.5 1.625 fill cornsilk
   ! draw the door
   amove 1.5 0
   box 0.75 1.375 fill burlywood name door
   ! draw the window
   amove 0.25 0.625
   box 1 0.75 fill skyblue name window
end object

! draw the house
amove pagewidth()/2 1.5
draw house.bc
red_bullet

! mark the door and window with a red bullet
move house.door.cc
red_bullet
move house.window.cc
red_bullet

! draw the labels
set just bc
amove pagewidth()/2 0.1
begin name drawcmd add 0.05
   begin text
      amove pagewidth()/2 1.5
      draw house.bc
   end text
end name

set just lc
amove pointx(house.rc)+0.5 pointy(house.door.cc)
begin name doorlabel add 0.05
   write "house.door.cc"
end name

set just rc
amove pointx(house.lc)-0.5 pointy(house.window.cc)
begin name windowlabel add 0.05
   write "house.window.cc"
end name

! draw the arrows
join drawcmd.tc -> house.bc
join windowlabel.rc -> house.window.cc
join doorlabel.lc -> house.door.cc

