*-----------------------------------------------------------------------
      SUBROUTINE SGTNXV(N,VPX,VPY,ITPAT,ICOLOR)

      REAL      VPX(*),VPY(*)
      LOGICAL   LFCATR
      INTEGER   ITPATX

      CALL SGIGET('IFCIDX',IFCIDX)

      CALL SWQFCC(LFCATR)
      IF(.NOT.LFCATR) THEN
        CALL MSGDMP('M','SGTNXV','FULL COLOR MODE IS NOT SUPPORTED.')
      END IF

      IF (N.LT.3) THEN
        CALL MSGDMP('E','SGTNXV','NUMBER OF POINTS IS LESS THAN 3.')
      END IF
      IF (ITPAT.EQ.0) THEN
        CALL MSGDMP('M','SGTNXV','TONE PAT. INDEX IS 0 / DO NOTHING.')
        RETURN
      END IF
      IF (ITPAT.LT.0) THEN
        CALL MSGDMP('E','SGTNXV','TONE PAT. INDEX IS LESS THAN 0.')
      END IF

      CALL SWSFCM(.TRUE.)
      CALL SWSTCL(ICOLOR)
      CALL SWSLCL(ICOLOR)


      ITPATX=IFCIDX*1000+MOD(ITPAT,1000)
      CALL SZTNOP(ITPATX)
      CALL SZTNZV(N,VPX,VPY)
      CALL SZTNCL

      CALL SWSFCM(.FALSE.)

      END
