      subroutine gstriangle(iopt,x,y,dx,irelief)
      include 'Parametres.f'
c
      ix = origine_x + facteur_en_x*x
      iy = origine_y + facteur_en_y*y
      id = nint(facteur_en_x*dx)
      id2 = nint(facteur_en_x*dx*.70710678)
      call gsitriangle(iopt,ix,iy,id,id2,irelief)
      end
c-----------------------------------------------------------------------
      subroutine gsrect(x0,x1,y0,y1)
      call gsmove(x0,y0)
      call gsline(x1,y0)
      call gsline(x1,y1)
      call gsline(x0,y1)
      call gsline(x0,y0)
      end
c-----------------------------------------------------------------------
      subroutine gsrectangle(iopt,x,y,dx,irelief)
      include 'Parametres.f'
c
      ix = origine_x + facteur_en_x*x
      iy = origine_y + facteur_en_y*y
      id = nint(facteur_en_x*dx)
      id2 = nint(facteur_en_x*dx*.5)
      if (irelief.ge.0) then
        ib1 = 15
        ib2 = 7
      else
        ib1 = 7
        ib2 = 15
      endif
      call x11loadcolor(ib1)
      do i=1,iopt
        id2n = id2+i-1
        idn  = id+i-1
        call x11linsrn(ix-idn,iy+id2n,ix+idn,iy+id2n)
        call x11linsrn(ix+idn,iy+id2n,ix+idn,iy-id2n)
      enddo
      call x11loadcolor(ib2)
      do i=1,iopt
        id2n = id2+i-1
        idn  = id+i-1
        call x11linsrn(ix-idn,iy-id2n,ix+idn,iy-id2n)
        call x11linsrn(ix-idn,iy+id2n,ix-idn,iy-id2n)
      enddo
      call x11loadcolor(icoul_courante)
      end
c-----------------------------------------------------------------------
      subroutine gsitriangle(iopt,ix,iy,id,id2,irelief)
      include 'Parametres.f'
      if (irelief.ge.0) then
        ib1 = 15
        ib2 = 7
      else
        ib1 = 7
        ib2 = 15
      endif
      if (iopt.gt.0) then
        call x11loadcolor(ib1)
        do i=1,iopt
          id2n = id2+i-1
          idn  = id+i-1
          call x11linsrn(ix-id2n,iy+id2n,ix+id2n,iy+id2n)
          call x11linsrn(ix+id2n,iy+id2n,ix,iy-idn)
        enddo
        call x11loadcolor(ib2)
        do i=1,iopt
          id2n = id2+i-1
          idn  = id+i-1
          call x11linsrn(IX,iy-idn,ix-id2n,iy+id2n)
        enddo
      elseif(iopt.lt.0) then
        call x11loadcolor(ib2)
        do i=1,-iopt
          id2n = id2+i-1
          idn  = id+i-1
          call x11linsrn(ix+id2n,iy-id2n,IX-id2n,iy-id2n)
          call x11linsrn(ix-id2n,iy-id2n,IX,iy+idn)
        enddo
        call x11loadcolor(ib1)
        do i=1,-iopt
          id2n = id2+i-1
          idn  = id+i-1
          call x11linsrn(IX,iy+idn,ix+id2n,iy-id2n)
        enddo
      endif
      call x11loadcolor(icoul_courante)
      end
