      SUBROUTINE QUEST_POSANG(ILANG,ANGX,ANGY,ANGZ,IRC)
C
      parameter(nbq=3,nbc=0)
      include 'com_quest.f'
c
      do i=1,nbq
        ial(i) = 2
        iqpos(i) = 0
        if (ilang.eq.0) then
          longq(i) = 12
        else
          longq(i) = 8
        endif
        eps(i) = 0.1
      enddo
      if (ilang.eq.0) then
        ctitre = 'Positions angulaires (deg)'
        ltitre = 26
        question(1) = 'autour de Ox'
        question(2) = 'autour de Oy'
        question(3) = 'autour de Oz'
      else
        ctitre = 'Angular positions (deg)'
        ltitre = 23
        question(1) = 'about Ox'
        question(2) = 'about Oy'
        question(3) = 'about Oz'
      endif
      epseps = 1.e-3
      if (abs(angx).lt.epseps) angx = 0.
      if (abs(angy).lt.epseps) angy = 0.
      if (abs(angz).lt.epseps) angz = 0.
      rinit(1) = angx
      rinit(2) = angy
      rinit(3) = angz
      ix = 240
      iy = 180
      facpos = 0.6
      lblablabla = 0
 1    call gsquestion(ix,iy,nbq,nbc,ial,question,longq,iqpos,facpos
     &               ,cretour,longr,iretour,rretour
     &               ,cinit,longi,iinit,rinit,ctitre,ltitre,1
     &               ,blablabla,lblablabla,iexcl,ieps,eps,irc)
      if (irc.eq.0.or.irc.eq.-2) then
        if (rretour(1).eq.rinit(1).and.rretour(2).eq.rinit(2)
     & .and.rretour(3).eq.rinit(3)) then
          if (irc.eq.0) then
            irc = -1
          else
            goto 1
          endif
        endif
        if (irc.eq.0.or.irc.eq.-2) then
          angx = rretour(1)
          angy = rretour(2)
          angz = rretour(3)
        endif
      endif
      end
c-----------------------------------------------------------------------
      SUBROUTINE QUEST_EXA3(ILANG,FACEXAX,FACEXAY,FACEXAZ,IRC)
C
      parameter(nbq=3,nbc=0)
      include 'com_quest.f'
c
      do i=1,nbq
        ial(i) = 2
        iqpos(i) = 0
        longq(i) = 11
        eps(i) = 0.1
      enddo
      if (ilang.eq.0) then
        ctitre = 'Facteurs d''exagération'
        ltitre = 22
      else
        ctitre = 'Exageration factors'
        ltitre = 19
      endif
      question(1) = 'direction x'
      question(2) = 'direction y'
      question(3) = 'direction z'
      rinit(1) = facexax
      rinit(2) = facexay
      rinit(3) = facexaz
      ix = 200
      iy = 170
      facpos = 0.6
      lblablabla = 0
      call gsquestion(ix,iy,nbq,nbc,ial,question,longq,iqpos,facpos
     &               ,cretour,longr,iretour,rretour
     &               ,cinit,longi,iinit,rinit,ctitre,ltitre,0
     &               ,blablabla,lblablabla,iexcl,ieps,eps,irc)
      if (irc.eq.0) then
        if (rretour(1).eq.rinit(1).and.rretour(2).eq.rinit(2)
     & .and.rretour(3).eq.rinit(3)) irc = -1
        if (irc.eq.0) then
          facexax = rretour(1)
          facexay = rretour(2)
          facexaz = rretour(3)
        endif
      endif
      end
c-----------------------------------------------------------------------
      SUBROUTINE QUEST_EXAFLE(ILANG,FACVIT,IRC)
C
      parameter(nbq=1,nbc=0)
      include 'com_quest.f'
c
      ial(1) = 2
      iqpos(1) = 0
      eps(1) = 0.05
      if (ilang.eq.0) then
        ctitre = 'Taille des flèches'
        ltitre = 18
        question(1) = 'Facteur multiplicatif'
      else
        ctitre = 'Arrows size'
        ltitre = 11
        question(1) = 'Multiplicative factor'
      endif
      longq(1) = 22
      rinit(1) = facvit
      ix = 250
      iy = 120
      facpos = 0.7
      lblablabla = 0
      call gsquestion(ix,iy,nbq,nbc,ial,question,longq,iqpos,facpos
     &               ,cretour,longr,iretour,rretour
     &               ,cinit,longi,iinit,rinit,ctitre,ltitre,0
     &               ,blablabla,lblablabla,iexcl,ieps,eps,irc)
      if (irc.eq.0) then
        if (rretour(1).eq.rinit(1)) irc = -1
        if (irc.eq.0) facvit = rretour(1)
      endif
      end
c-----------------------------------------------------------------------
      SUBROUTINE QUEST_BORNES(ILANG,VMIN0,VMAX0,VMIN,VMAX,IRC)
C
      parameter(nbq=2,nbc=0)
      include 'com_quest.f'
c
      dv = (VMAX0-VMIN0)*0.01
      ii = int(log10(dv))
      dv = 10.**ii
      do i=1,nbq
        ial(i) = 2
        iqpos(i) = 0
        longq(i) = 9
        eps(i) = dv
      enddo
      if (ilang.eq.0) then
        ctitre = 'Bornes des isovaleurs'
        ltitre = 21
        question(1) = 'Borne inf'
        question(2) = 'Borne sup'
      else
        ctitre = 'Bounds for contour plot'
        ltitre = 23
        question(1) = 'Inf bound'
        question(2) = 'Sup bound'
      endif
      rinit(1) = vmin
      rinit(2) = vmax
      ix = 240
      iy = 150
      facpos = 0.5
      lblablabla = 0
 1    call gsquestion(ix,iy,nbq,nbc,ial,question,longq,iqpos,facpos
     &               ,cretour,longr,iretour,rretour
     &               ,cinit,longi,iinit,rinit,ctitre,ltitre,1
     &               ,blablabla,lblablabla,iexcl,ieps,eps,irc)
      if (irc.eq.0.or.irc.eq.-2) then
        if (rretour(1).eq.rinit(1).and.rretour(2).eq.rinit(2)) then
          if (irc.eq.0) then
            irc = -1
          else
            goto 1
          endif
        endif
        if (irc.eq.0.or.irc.eq.-2) then
          vmin = rretour(1)
          vmax = rretour(2)
        endif
      endif
      end
c-----------------------------------------------------------------------
      SUBROUTINE QUEST_NBISO(ILANG,NBCOUL,IEPISO,IRC)
C
      parameter(nbq=2,nbc=0)
      include 'com_quest.f'
c
      do i=1,nbq
        ial(i) = 1
        iqpos(i) = 0
        ieps(i) = 1
      enddo
      if (ilang.eq.0) then
        ctitre = 'Contrôle des isovaleurs'
        ltitre = 23
        question(2) = 'Nombre d''isovaleurs'
        question(1) = 'Epaisseur des iso au trait (pixels)'
        longq(2) = 19
        longq(1) = 35
      else
        ctitre = 'Contour plot'
        ltitre = 12
        question(2) = 'Number of colors'
        question(1) = 'Lines thickness (pixels)'
        longq(2) = 16
        longq(1) = 24
      endif
      iinit(2) = NBCOUL
      iinit(1) = IEPISO
      ix = 350
      iy = 140
      facpos = 0.8
      lblablabla = 0
      call gsquestion(ix,iy,nbq,nbc,ial,question,longq,iqpos,facpos
     &               ,cretour,longr,iretour,rretour
     &               ,cinit,longi,iinit,rinit,ctitre,ltitre,0
     &               ,blablabla,lblablabla,iexcl,ieps,eps,irc)
      if (irc.eq.0) then
        if (iretour(1).eq.iinit(1).and.iretour(2).eq.iinit(2)) irc = -1
        if (irc.eq.0) then
          nbcoul = iretour(2)
          iepiso = iretour(1)
        endif
      endif
      end
c-----------------------------------------------------------------------
      SUBROUTINE QUEST_EXAG(ILANG,DIMMAXREF,DIMMAX,DEPMAX,FACEXA,CONSEIL
     &                     ,IRC)
C
      parameter(nbq=1,nbc=0)
      include 'com_quest.f'
      character*32 CDIMMAXREF,CDIMMAX,CDEPMAX,CFACEXA,CCONSEIL,BLANC
c
      ii = int(log10(conseil))-2
      eps(1) = 10.**ii
      ial(1) = 2
      iqpos(1) = 0
      blanc = '                '
      call reduitreel1(dimmaxref,cdimmaxref,ldimmaxref,0)
      call reduitreel1(dimmax,cdimmax,ldimmax,0)
      call reduitreel1(depmax,cdepmax,ldepmax,0)
      call reduitreel1(facexa,cfacexa,lfacexa,0)
      call reduitreel1(conseil,cconseil,lconseil,0)
      ll = 18
      l0 = 0
      if (ilang.eq.0) then
        l = 43
        blablabla(l0+1:l0+l) =
     &       "Dimension maximale de l'objet non-déformé ="
        blablabla(l0+l+1:l0+l+ll) = blanc(1:17-ldimmaxref)
     &       //cdimmaxref(1:ldimmaxref)//char(10)
        l0 = l0+l+ll
        blablabla(l0+1:l0+l) =
     &       "Dimension maximale de l'objet déformé     ="
        blablabla(l0+l+1:l0+l+ll) = blanc(1:17-ldimmax)
     &       //cdimmax(1:ldimmax)//char(10)
        l0 = l0+l+ll
        blablabla(l0+1:l0+l) =
     &       "Déplacement maximal                       ="
        blablabla(l0+l+1:l0+l+ll) = blanc(1:17-ldepmax)
     &       //cdepmax(1:ldepmax)//char(10)
        l0 = l0+l+ll
        blablabla(l0+1:l0+l) =
     &       "Facteur d'exagération précédent           ="
        blablabla(l0+l+1:l0+l+ll) = blanc(1:17-lfacexa)
     &       //cfacexa(1:lfacexa)//char(10)
        l0 = l0+l+ll
        blablabla(l0+1:l0+l) =
     &       "Facteur d'exagération conseillé           ="
        blablabla(l0+l+1:l0+l+ll-1) = blanc(1:17-lconseil)
     &       //cconseil(1:lconseil)
        l0 = l0+l+ll-1
        question(1) = "Nouveau facteur d'exagération"
        longq(1) = 29
      else
        l = 44
        blablabla(l0+1:l0+l) =
     &       "Maximum dimension of the undeformed object ="
        blablabla(l0+l+1:l0+l+ll) = blanc(1:17-ldimmaxref)
     &       //cdimmaxref(1:ldimmaxref)//char(10)
        l0 = l0+l+ll
        blablabla(l0+1:l0+l) =
     &       "Maximum dimension of the deformed object   ="
        blablabla(l0+l+1:l0+l+ll) = blanc(1:17-ldimmax)
     &       //cdimmax(1:ldimmax)//char(10)
        l0 = l0+l+ll
        blablabla(l0+1:l0+l) =
     &       "Maximal displacement                       ="
        blablabla(l0+l+1:l0+l+ll) = blanc(1:17-ldepmax)
     &       //cdepmax(1:ldepmax)//char(10)
        l0 = l0+l+ll
        blablabla(l0+1:l0+l) =
     &       "Previous exageration factor                ="
        blablabla(l0+l+1:l0+l+ll) = blanc(1:17-lfacexa)
     &       //cfacexa(1:lfacexa)//char(10)
        l0 = l0+l+ll
        blablabla(l0+1:l0+l) =
     &       "Recommended exageration factor             ="
        blablabla(l0+l+1:l0+l+ll-1) = blanc(1:17-lconseil)
     &       //cconseil(1:lconseil)
        l0 = l0+l+ll-1
        question(1) = 'New exageration factor'
        longq(1) = 22
      endif
c
      ltitre = 0
      rinit(1) = facexa
      ix = 400
      iy = 180
      facpos = 0.8
      lblablabla = l0
 1    call gsquestion(ix,iy,nbq,nbc,ial,question,longq,iqpos,facpos
     &               ,cretour,longr,iretour,rretour
     &               ,cinit,longi,iinit,rinit,ctitre,ltitre,1
     &               ,blablabla,lblablabla,iexcl,ieps,eps,irc)
      if (irc.eq.0.or.irc.eq.-2) then
        if (rretour(1).eq.rinit(1)) then
          if (irc.eq.0) then
            irc = -1
          else
            goto 1
          endif
        endif
        if (irc.eq.0.or.irc.eq.-2) facexa = rretour(1)
      endif
      end
c-----------------------------------------------------------------------
      SUBROUTINE QUEST_ISOSURF(ILANG,VMINISO,VMAXISO,NSURF,VISO,ICALSU
     &                        ,BSOMB,ICSUR,IOPT,IRC)
C
      parameter(nbq=1,nbc=7)
      include 'com_quest.f'
      character*25 c
c
      dv = (VMAXISO-VMINISO)*0.01
      ii = int(log10(dv))
      eps(1) = 10.**ii
      ial(1) = 2
      iqpos(1) = 0
c
      ctitre = 'Isosurface'
      ltitre = 10
      write(c,'(g11.5,3h , ,g11.5)') vminiso,vmaxiso
      if (ilang.eq.0) then
        blablabla(1:19) = 'Bornes des valeurs'//char(10)
        blablabla(20:45) = c//char(10)
        lblablabla = 45
        question(1) = 'Valeur de l''isosurface'
        longq(1) = 22
        question(2) = 'Iso seule'
        longq(2) = 9
        question(5) = 'Bord clair'
        longq(5) = 10
        question(6) = 'Bord moyen'
        longq(6) = 10
        question(7) = 'Bord sombre'
        longq(7) = 11
        question(8) = 'Arêtes visibles'
        longq(8) = 15
      else
        blablabla(1:27) = 'Bounds of the scalar field'//char(10)
        blablabla(28:53) = c//char(10)
        lblablabla = 53
        question(1) = 'Isosurface''s value'
        longq(1) = 18
        question(2) = 'Iso alone'
        longq(2) = 9
        question(5) = 'Light boundary'
        longq(5) = 14
        question(6) = 'Medium boundary'
        longq(6) = 15
        question(7) = 'Dark boundary'
        longq(7) = 13
        question(8) = 'Vertices drawn'
        longq(8) = 14
      endif
      question(3) = 'Volume < iso'
      question(4) = 'Volume > iso'
      longq(3) = 12
      longq(4) = 12
      iexcl(1) = 0
      iexcl(2) = 2004
      iexcl(3) = 2004
      iexcl(4) = 2004
      iexcl(5) = 5007
      iexcl(6) = 5007
      iexcl(7) = 5007
      iexcl(8) = 0
      do i=nbq+1,nbq+nbc
        iinit(i) = 0
        ial(i) = 3
      enddo
      if (nsurf.ge.0) then
        rinit(1) = viso
        if (icalsu.eq.0) then
          iinit(2) = 1
        elseif(icalsu.eq.1) then
          iinit(3) = 1
        else
          iinit(4) = 1
        endif
        if (bsomb.gt.0.49) then
          iinit(5) = 1
        elseif(bsomb.gt.0.29) then
          iinit(6) = 1
        else
          iinit(7) = 1
        endif
        if (icsur.ge.0.and.icsur.le.15) then
          iinit(8) = 1
          icsur = 1
        else
          icsur = 16
        endif
      else
        if (iopt.eq.1) then
          rinit(1) = 0.3
          iinit(4) = 1
        elseif(iopt.eq.2) then
          rinit(1) = 0.
          iinit(3) = 1
        else
          rinit(1) = (vminiso+vmaxiso)*0.5
          iinit(4) = 1
        endif
        iinit(5) = 1
      endif
      rretour(1) = rinit(1)
      ix = 260
      iy = 350
      facpos = 0.65
 1    call gsquestion(ix,iy,nbq,nbc,ial,question,longq,iqpos,facpos
     &               ,cretour,longr,iretour,rretour
     &               ,cinit,longi,iinit,rinit,ctitre,ltitre,1
     &               ,blablabla,lblablabla,iexcl,ieps,eps,irc)
      if (irc.eq.0.or.irc.eq.-2) then
        if (nsurf.ge.0) then
          irc2 = 0
          if (rretour(1).ne.rinit(1)) irc2 = 1
          do i=2,nbq+nbc
            if (iretour(i).ne.iinit(i)) irc2 = 1
          enddo
        else
          irc2 = 1
        endif
        if (irc2.eq.0) then
          if (irc.eq.0) then
            irc = -1
          else
            goto 1
          endif
        else
          viso = rretour(1)
          if (iretour(2).gt.0) then
            icalsu = 0
          elseif(iretour(3).gt.0) then
            icalsu = 1
          else
            icalsu = 2
          endif
          if (iretour(5).gt.0) then
            bsomb = 0.5
          elseif(iretour(6).gt.0) then
            bsomb = 0.3
          else
            bsomb = 0.1
          endif
          if (iretour(8).gt.0) then
            icsur = 1
          else
            icsur = 16
          endif
        endif
      endif
      end
c-----------------------------------------------------------------------
      SUBROUTINE QUEST_COUPE(ILANG,VMINXYZ,VMAXXYZ,VCOUPXYZ,VCOUP
     &                      ,IPCOUP,IPCOUP0,ICOUPSU,IRC)
C
      parameter(nbq=1,nbc=6)
      include 'com_quest.f'
      character*25 c
      dimension vminxyz(3),vmaxxyz(3),vcoupxyz(3)
c
      dv1 = (VMAXXYZ(1)-VMINXYZ(1))*0.01
      dv2 = (VMAXXYZ(2)-VMINXYZ(2))*0.01
      dv3 = (VMAXXYZ(3)-VMINXYZ(3))*0.01
      dv = (dv1+dv2+dv3)/3.
      ii = int(log10(dv))
      eps(1) = 10.**ii
      ial(1) = 2
      iqpos(1) = 0
c
      write(c,'(g11.5,3h , ,g11.5)') vminxyz(1),vmaxxyz(1)
      blablabla(1:39) = 'Xmin, Xmax = '//c//char(10)
      write(c,'(g11.5,3h , ,g11.5)') vminxyz(2),vmaxxyz(2)
      blablabla(40:78) = 'Ymin, Ymax = '//c//char(10)
      write(c,'(g11.5,3h , ,g11.5)') vminxyz(3),vmaxxyz(3)
      blablabla(79:117) = 'Zmin, Zmax = '//c//char(10)
      lblablabla = 117
      if (ilang.eq.0) then
        ctitre = 'Coupe // aux axes'
        ltitre = 17
        question(1) = 'Coordonnée de la coupe'
        longq(1) = 22
        question(2) = 'Plan X=Cste'
        longq(2) = 11
        question(3) = 'Plan Y=Cste'
        longq(3) = 11
        question(4) = 'Plan Z=Cste'
        longq(4) = 11
        question(5) = 'Plan de coupe seul'
        longq(5) = 18
        question(6) = 'Volume < plan de coupe'
        longq(6) = 22
        question(7) = 'Volume > plan de coupe'
        longq(7) = 22
      else
        ctitre = 'Cross section'
        ltitre = 13
        question(1) = 'Cross-section''s value'
        longq(1) = 21
        question(2) = 'Plane X=value'
        longq(2) = 13
        question(3) = 'Plane Y=value'
        longq(3) = 13
        question(4) = 'Plane Z=value'
        longq(4) = 13
        question(5) = 'Cross-section alone'
        longq(5) = 19
        question(6) = 'Volume < cross-section'
        longq(6) = 22
        question(7) = 'Volume > cross-section'
        longq(7) = 22
      endif
      iexcl(1) = 0
      iexcl(2) = 2004
      iexcl(3) = 2004
      iexcl(4) = 2004
      iexcl(5) = 5007
      iexcl(6) = 5007
      iexcl(7) = 5007
      do i=nbq+1,nbq+nbc
        iinit(i) = 0
        ial(i) = 3
      enddo
      rinit(1) = vcoupxyz(ipcoup)
      iinit(ipcoup+1) = 1
      iinit(icoupsu+5) = 1
      rretour(1) = rinit(1)
      ix = 300
      iy = 350
      facpos = 0.65
 1    call gsquestion(ix,iy,nbq,nbc,ial,question,longq,iqpos,facpos
     &               ,cretour,longr,iretour,rretour
     &               ,cinit,longi,iinit,rinit,ctitre,ltitre,1
     &               ,blablabla,lblablabla,iexcl,ieps,eps,irc)
      if (irc.eq.0.or.irc.eq.-2) then
        irc2 = 0
        if (iretour(2).gt.0) then
          ipcoup = 1
        elseif(iretour(3).gt.0) then
          ipcoup = 2
        else
          ipcoup = 3
        endif
        if (rretour(1).ne.rinit(1)) irc2 = 1
        if (ipcoup.ne.ipcoup0) irc2 = 1
        do i=2,nbq+nbc
          if (iretour(i).ne.iinit(i)) irc2 = 1
        enddo
        if (irc2.eq.0) then
          if (irc.eq.0) then
            irc = -1
          else
            goto 1
          endif
        else
          vcoup = rretour(1)
          if (iretour(5).gt.0) then
            icoupsu = 0
          elseif(iretour(6).gt.0) then
            icoupsu = 1
          else
            icoupsu = 2
          endif
        endif
      endif
      end
c-----------------------------------------------------------------------
      SUBROUTINE QUEST_BIDON(ilang)
C
      parameter(nbq=1,nbc=3)
      include 'com_quest.f'
c
      do i=1,nbq
        ial(i) = 1
        iqpos(i) = 0
      enddo
      if (ilang.eq.0) then
        ctitre = 'Contrôle des isovaleurs'
        ltitre = 23
        question(1) = 'Nombre d''isovaleurs'
        longq(1) = 19
      else
        ctitre = 'Contour plot'
        ltitre = 12
        question(1) = 'Number of colors'
        longq(1) = 16
      endif
      iinit(1) = 7
      iinit(2) = 0
      iinit(3) = 0
      iinit(4) = 1
      question(2) = 'Choix 1'
      question(3) = 'Choix 2'
      question(4) = 'Choix 3'
      iexcl(1) = 0
      iexcl(2) = 2004
      iexcl(3) = 2002
      iexcl(4) = 2002
      do i=nbq+1,nbq+nbc
        ial(i) = 3
        longq(i) = 7
      enddo
      ix = 200
      iy = 200
      facpos = 0.8
      lblablabla = 0
      call gsquestion(ix,iy,nbq,nbc,ial,question,longq,iqpos,facpos
     &               ,cretour,longr,iretour,rretour
     &               ,cinit,longi,iinit,rinit,ctitre,ltitre,0
     &               ,blablabla,lblablabla,iexcl,ieps,eps,irc)
      if (irc.eq.0) then
        do i=1,nbq+nbc
          if (iretour(i).eq.iinit(i)) irc = -1
          print*,i,iretour(i),iinit(i)
        enddo
        if (irc.eq.0) then
          NBCOUL = iretour(2)
          IEPISO = iretour(1)
        endif
      endif
      end
