Hello Jeff,
The problem is allready solved, but I don't know which code was not correct and after many alterations I cannot trace it back. may be I had some bad declarations....
Below is the code of my (prelininary) translater from CVF to SF containing move_to and line_to for your info.
The call to move _to and line_to as described before is done in several routines; for instance in the following:
Subroutine draw3D_cube(p, maxpnts)
use appgraphics
Use W_ords_to_pixels
Dimension p(maxpnts,3)
!.....
.....
In the first versions I wrote:
Call Moveto_w(dble(p(i,1)),dble(p(i,2))), wxy)
It did not work and I used:
Call Moveto_w(xw,yw,wxy)
......
Now in a new test the first statement works - so the problem is solved.
I am more and more contented with SF2 and will recommend it anywhere!
Regards, Klaus
PS
For your info the translate module
Module W_ords_to_pixels
Use AppGraphics
Real*8 xw,xwtot, scale_x
Real*8 yw,ywtot, scale_y
Integer dx,dy, x_offset, y_offset
TYPE wxycoord
Real*8 x
Real*8 y
end type wxycoord
TYPE (wxycoord)wxy
contains
!!!!! ===================== warning ==============================!!!!! a
! The pixel window to show graphics has to be opened prior to apply this function !!!!!
Function setwindow (origin , x_left, y_up, x_rght, y_bot) ! same as CVF but little changed functionallity!!
! i2 = setwindow (.TRUE. , x_left, y_up, x_rght, y_bot) ! make this work in module
! make returnvalue =1 if OK, otherwise 0
! In this this function a world coordinate system y from top down is not defined and has to return zero (diff from CVF)
integer setwindow
logical origin ! to be true for lower left corner and y up warts
Real*8 x_left, y_up, x_rght, y_bot !virtual world corners of the viewport
! If negative lower left corner there is an offset to the origin xw,yw = 0.,0.
Real*8 dxw, dyw ! absolute "world"dimensions in xy direction
integer dx, dy
setwindow = 0
! the window size in world ordinates is defined by the arguments of this routine!!!!!!!!!!!!!!!!!!
dxw = x_rght - x_left
dyw = y_up - y_bot
If(dwx == 0. .or. dwy == 0.)return
If( .not. origin) return
! get the pre-defiened window size of the CURRENT window in pixels x,y may be the max screen or lower defined
dx = getmaxx()
dy = getmaxy()
IF(dx > 0 .and. dy > 0 )then
! only works in a predefined actual window!
xwtot = dxw ! May ..tot should be replaced by ..w !!!
scale_x = dble(dx)/dxw
x_offset= -int(x_left*scale_x)
ywtot = dyw
scale_y = dble(dy)/dyw
y_offset= -int(y_bot*scale_y)
! End subroutine init_world_window
setwindow =1 ! does not work with origin in top left
End if
End function setwindow
Subroutine Moveto_w(xw,yw,wxy)
! Use W_ords_to_pixels
! Use AppGraphics
Integer x,y
Real*8 xw,yw
TYPE (wxycoord)wxy
wxy%x = xw
wxy%y = yw
x= int((xw)*scale_x) + x_offset
y= int((ywtot- yw)*scale_y) - y_offset
Call moveto (x, y)
Call settextxy (x, y) ! this is because CVF has no different textpos for outgtext
end subroutine Moveto_w
Function lineto_w(xw,yw)
! Use W_ords_to_pixels
Integer x,y
Real*8 xw,yw
! TYPE (wxycoord)wxy ! neccessary to keep the end point in wxy?? Don't thinck so !!!
! wxy%x = xw
! wxy%y = yw
lineto_w = 0
x= int((xw)*scale_x) + x_offset
y= int((ywtot- yw)*scale_y) - y_offset
Call lineto (x, y)
lineto_w = 1
End function lineto_w
!++++++++++++++++++++++++++++++++++++++++++++++++++++=
! still to do:
! Add procedures for all other used graphic function using world coordinates also for graph. text
End module W_ords_to_pixels