⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pig.f

📁 Programs in the irregular grid design package described in this manual are used to carry out five ma
💻 F
📖 第 1 页 / 共 5 页
字号:
		  call WPigSetLineColour (LineColour)
        end if
	endif
	return

* ------------------------------------------------------------------------- *
	entry PigGetLineColour(CurColour)

*       PUBLIC
*+
*+      entry PigGetLineColour(CurColour)
*+ Call Sequence:
*+       call PigGetLineColour(CurColour)
*+ Purpose:  Returns the current line colour
*+ Givens :  None
*+ Returns:  integer     CurColour: the current new line colour
*+ Effects:  resets the line colour
*+
	  CurColour = LineColour

	return

* ------------------------------------------------------------------------- *
	entry PigSetLineWidth(NewWidth)

*       PUBLIC
*+
*+      entry PigSetLineWidth(NewWidth)
*+ Call Sequence:
*+       call PigSetLineWidth(NewWidth)
*+ Purpose:  Set the current line Width for use to NewWidth.  Lines
*+           drawn are in the current line Width.
*+ Givens :  integer      NewWidth: the new Width to change to
*+ Returns:  None
*+ Effects:  Changes current line Width to Width passed in

	if (NewWidth.lt.0) then
	       call PigPutMessage('Illegal Width number, must be >= 0')
	else
		LineWidth = NewWidth
		call WPigSetLineWidth (LineWidth)
	endif
	return

* ------------------------------------------------------------------------- *
	entry PigGetLineWidth(CurWidth)

*       PUBLIC
*+
*+      entry PigGetLineWidth(CurWidth)
*+ Call Sequence:
*+       call PigGetLineWidth(CurWidth)
*+ Purpose:  Returns the current line Width
*+ Givens :  None
*+ Returns:  integer     CurWidth: the current new line Width
*+ Effects:  resets the line Width
*+
	  CurWidth = LineWidth

	return

* ------------------------------------------------------------------------- *
	entry PigSetSymbolColour(NewColour)

*       PUBLIC
*+
*+      entry PigSetSymbolColour(NewColour)
*+ Call Sequence:
*+       call PigSetSymbolColour(NewColour)
*+ Purpose:  Set the current symbol colour for use to NewColour.  Symbols
*+           drawn are in the current symbol colour.
*+ Givens :  integer     NewColour: the new colour to change to
*+ Returns:  None
*+ Effects:  Changes the current symbol colour to NewColour
*+
	  if (NewColour.lt.0) then
	    call PigPutMessage('Illegal colour number, must be > 0')
	  endif
		tmpColour = mod (NewColour,16)
        if(tmpColour .ne. SymbolColour) then
	    SymbolColour = tmpColour
CW        call gspmci(SymbolColour)
	    call WPigSetSymbolColour (SymbolColour)
        end if
	return

* ------------------------------------------------------------------------- *
	entry PigGetSymbolColour(CurColour)

*       PUBLIC
*+
*+      entry PigGetSymbolColour(CurColour)
*+ Call Sequence:
*+       call PigGetSymbolColour(CurColour)
*+ Purpose:  Returns the current symbol colour.
*+ Givens :  None
*+ Returns:  integer     CurColour: the current symbol colour
*+ Effects:  resets the symbol colour
*+
	CurColour = SymbolColour

	return

* ------------------------------------------------------------------------- *
	entry PigSetSymbolNumber(NewSymbolNumber)

*       PUBLIC
*+
*+      entry PigSetSymbolNumber(NewSymbolNumber)
*+ Call Sequence:
*+       call PigSetSymbolNumber(NewSymbolNumber)
*+ Purpose:  Set the current symbol for use to NewSymbolNumber.  Symbols
*+           drawn are the current symbol.
*+ Givens :  integer     NewSymbolNumber: the new symbol to change to
*+ Returns:  None
*+ Effects:  Changes the current symbol to NewSymbolNumber
*+
        SymbolNumber = max(1, min(MAXSYMBOLNUMBER, NewSymbolNumber))
CW        call gsmk(SymbolNumber)

	call WPigSetSymbolNumber (SymbolNumber)
	return

* ------------------------------------------------------------------------- *
	entry PigGetSymbolNumber(CurSymbolNumber)

*       PUBLIC
*+
*+      entry PigGetSymbolNumber(CurSymbolNumber)
*+ Call Sequence:
*+       call PigGetSymbolNumber(CurSymbolNumber)
*+ Purpose:  Returns the current symbol number.
*+ Givens :  None
*+ Returns:  integer     CurSymbolNumber: the current symbol colour
*+ Effects:  Resets the symbol number
*+
	CurSymbolNumber = SymbolNumber

	return
* ------------------------------------------------------------------------- *
	entry PigSetSymbolSize(NewSymbolSize)

*       PUBLIC
*+
*+      entry PigSetSymbolSize(NewSymbolSize)
*+ Call Sequence:
*+       call PigSetSymbolSize(NewSymbolSize)
*+ Purpose:  Set the size of the current symbol to NewSymbolSize.
*+ Givens :  real       NewSymbolSize: the new symbol size to change to
*+ Returns:  None
*+ Effects:  Changes the current symbol size to NewSymbolSize
*+
	  SymbolSize = NewSymbolSize
CW        call gsmksc(SymbolSize)

	call WPigSetSymbolSize (SymbolSize)
	return

	entry PigGetSymbolSize(CurSymbolSize)

*       PUBLIC
*+
*+      entry PigGetSymbolSize(NewSymbolSize)
*+ Call Sequence:
*+       call PigGetSymbolSize(NewSymbolSize)
*+ Purpose:  Get the current symbol size.
*+ Givens :  real       NewSymbolSize: the new symbol size to change to
*+ Returns:  None
*+ Effects:  None
*+
	  CurSymbolSize = SymbolSize
	  return
* ------------------------------------------------------------------------- *

	entry PigSetFillColour(NewColour)

*       PUBLIC
*+
*+      entry PigSetFillColour(NewColour)
*+ Call Sequence:
*+       call PigSetFillColour(NewColour)
*+ Purpose:  Set the current fill colour for use to NewColour.  Polylines
*+           are filled in the current fill colour.
*+ Givens :  integer     NewColour: the new fill colour
*+ Returns:  None
*+ Effects:  changes the current fill colour to NewColour
*+
	if (NewColour.lt.0) then
	       call PigPutMessage('Illegal colour number, must be > 0')
	else
	      FillColour = mod(NewColour,16)
	      call WPigSetFillColour (FillColour)
	endif
	return

* ------------------------------------------------------------------------- *
	entry PigGetFillColour(CurColour)

*       PUBLIC
*+
*+      entry PigGetFillColour(CurColour)
*+ Call Sequence:
*+       call PigGetFillColour(CurColour)
*+ Purpose:  Returns the current fill colour.
*+ Givens :  None
*+ Returns:  integer     CurColour: the current fill colour
*+ Effects:  Resets the fill colour
*+
	  CurColour = FillColour

	return

* ------------------------------------------------------------------------- *
	entry PigSetTextColour(NewColour)

*       PUBLIC
*+
*+      entry PigSetTextColour(NewColour)
*+ Call Sequence:
*+       call PigSetTextColour(NewColour)
*+ Purpose:  Set the current text colour for use to NewColour.  Text are
*+           drawn in the current text colour.
*+ Givens :  integer     NewColour: the new text colour
*+ Returns:  None
*+ Effects:  changes the text colour to NewColour
*+
	  if (NewColour.lt.0) then
	     call PigPutMessage('Illegal colour number, must be > 0')
	  else
	     TextColour = mod(NewColour,16)
	     call WPigSetTextColour(TextColour)
	  endif

	return
* ------------------------------------------------------------------------- *
	entry PigGetTextColour(CurColour)

*       PUBLIC
*+
*+      entry PigGetTextColour(CurColour)
*+ Call Sequence:
*+       call PigGetTextColour(CurColour)
*+ Purpose:  Returns the current text colour
*+ Givens :  None
*+ Returns:  integer     CurColour: the current text colour
*+ Effects:  Resets the text colour
*+
	CurColour = TextColour
	return

* ------------------------------------------------------------------------- *
	entry PigSetTextHeight(NewTextHeight)

*       PUBLIC
*+
*+      entry PigSetTextHeight(NewTextHeight)
*+ Call Sequence:
*+       call PigSetTextHeight(NewTextHeight)
*+ Purpose:  Set the current character height for use to NewTextHeight in
*+           world coordinates.
*+ Givens :  integer     NewTextHeight: the new text height
*+ Returns:  None
*+ Effects:  Changes the text height to NewTextHeight
*+
	  TextHeight = NewTextHeight
CW        call gschh(TextHeight)

	return
* ------------------------------------------------------------------------- *
	entry PigGetTextHeight(CurTextHeight)

*       PUBLIC
*+
*+      entry PigGetTextHeight(CurTextHeight)
*+ Call Sequence:
*+       call PigGetTextHeight(CurTextHeight)
*+ Purpose:  Returns the current text height.
*+ Givens :  None
*+ Returns:  integer     CurTextHeight: the current text height
*+ Effects:  Resets the text height
*+
	  CurTextHeight = TextHeight

	return

* ------------------------------------------------------------------------- *
	entry PigSetJustification(NewJustification)

*       PUBLIC
*+
*+      entry PigSetJustification(NewJustification)
*+ Call Sequence:
*+       call PigSetJustification(NewJustification)
*+ Purpose:  Set the current Justification to NORMAL, LEFT, CENTRE, or RIGHT.
*+           All text printed is with the current Justification.
*+ Givens :  integer     NewJustification: the new text justification
*+ Returns:  None
*+ Effects:  Changes the current text justification to NewJustification
*+

	Justification = NewJustification
	call IPigSetTextAlignment(NewJustification, BOTTOM_JUSTIFY)
	return

* ------------------------------------------------------------------------- *
	entry PigGetJustification(CurJustification)

*       PUBLIC
*+
*+      entry PigGetJustification(CurJustification)
*+ Call Sequence:
*+       call PigGetJustification(CurJustification)
*+ Purpose:  Returns the current Justification.
*+ Givens :  None
*+ Returns:  ineteger    CurJustification: the current text justification
*+ Effects:  Resets the text justification

	CurJustification = Justification

	return

	end
*------------------------------------------------------------------*
	subroutine IPigMouseRoutines

*       PRIVATE
*-
*-      subroutine IPigMouseRoutines
*- Call Sequence:
*-      NOT CALLABLE
*- Purpose: To contain all mouse handling routines
*- Givens : None
*- Returns: None
*- Effects: Not directly callable

	include 'ipig.def'
	integer         Window
c        integer*2       stat
c        integer*2       NormTrans

	integer         MouseButton
	real            ipx, ipy

c        character*80    datr
	integer         PrevMouseWindow, PrevWindow
	real            PrevMouseX, PrevMouseY
	character*(80)  Message
	logical         PigDebug

	integer         curWindow
	
c        integer*2       errind, il, rl, sl, ia(1), lstr(1), oldr
c        real            ra(1)
c        character*80    str(1)
*        save

	return

* ------------------------------------------------------------------------- *
	entry PigGetMouseAndButton(Window, MouseButton, ipx, ipy)

*       PUBLIC
*+
*+      entry PigGetMouseAndButton(Window, MouseButton, ipx, ipy)
*+ Call Sequence:
*+       call PigGetMouseAndButton(Window, MouseButton, ipx, ipy)
*+ Purpose:  To activate the mouse. PigGetMouse returns the world
*+           coordinates (ipx, ipy) and the current normalization
*+           transformation number (Window number) of the current
*+           mouse location when the mouse button is released. To
*+           ensure the mouse cursor doesn't 'fly away' each time
*+           the mouse is clicked, PigGetMouse should be called
*+           with the same values as it returned on the previous
*+           call.
*+ Givens :  None
*+ Returns:  integer     Window: the normalization transformation number
*+                               where the mouse was clicked
*+           integer     MouseButton: Button number, from (0..n)
*+           real        ipx   : the x world coordinate of the mouse location
*+           real        ipy   : the y world coordinate of the mouse location
*+ Effects:  Routine waits for mouse input

* Move the window number into an integer*2 var. and re-initialize the
* last x/y coords.
	  
c          NormTrans = PrevMouseWindow
	  ipx = PrevMouseX
	  ipy = PrevMouseY

	  call WPigGetMouseAndButton (Window, MouseButton, ipx, ipy)

	  PrevMouseWindow = Window

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -