Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29031 Discussions

Drawing lines and circles in my text output?

GTWatson77459
Beginner
580 Views

I have a crude console Fortran EXE I use as a post processor to a pole analysis program to design several base plates based on some user input. I would like to figure out how to draw some lines and circles based on some variables in the Fortran code.  The program designs several different plates with different OD, ID, and number and diameter of holes. The pole shaft is mostly 12 sides but can be 8 sides. I know the width across flats but could draw lines between corner points if the polygon shape is not available.  Ideally, I would be going through my design Do Loop and have the data available and call a plot or print program where I would pass the data and get a graphic printed in my output. I have attached the current output and would call the plot routine and insert a graphic after the table of bolt coordinates.  I did D/L the Sample programs but did not look very close at them. (Visual Studio 2022 with the oneAPI Fortran compiler)

Thanks

GTWatson77459_0-1744643154534.png

 

0 Kudos
11 Replies
Steve_Lionel
Honored Contributor III
529 Views

Take a look at Graphics Library Routines A combination of ELLIPSE and POLYGON should handle this - these are part of QuickWin support that is Windows-only.

GTWatson77459
Beginner
514 Views

Hi Steve,

I'll take a look to see if I can figure out how to use the QuickWin and intersperse the resulting figure within my antiquated output Write statements. It looks like I can build the circles from the ellipse and the vertexes of the pole with the polygon.  

Thanks

0 Kudos
AlHill
Super User
512 Views

Just curious - is the source code for the old Plot 10 (~1975) still around?  It had some excellent routines for lines and circles and such.

 

Doc (not an Intel employee or contractor)
[If it weren’t for C, we’d all be programming in BASI and OBOL.]

0 Kudos
Steve_Lionel
Honored Contributor III
500 Views

That's one of the nice things about QuickWin, as ancient as it is, in that you can mix standard Fortran I/O and graphics in the same window. 

0 Kudos
GWats1
New Contributor I
442 Views

I keep forgetting to Login with my home eMail address. I created this thread with my work eMail address. I must be registered for the Intel Fortran compiler with my home address, but I'm old and forgetful.   

Back in the 1980's when we ran Timeshare at CDC, I wrote a Fortran program to analyze a redundant system on a transmission tower and grabbed a plot routine from somewhere that would plot to a tractor feed line printer.  Anyway, this is about the level of my Fortran skills in getting output printed. I had * for the members and labeled the joints and member numbers. 

 

I'll play with the POLYGON and ELLIPSE functions and see where it leads me. 

0 Kudos
cean
New Contributor II
373 Views
      !plot-main.f90
      integer,parameter :: JCT=3  !num of points
      integer,parameter :: NM=3   !num of lines
      DIMENSION CORD(JCT,2)       !node (x,y)
      DIMENSION MCON(NM,3)        !line points (pointA,pointB,?) why need 3 value? 

      CORD(1,1)=0.
      CORD(1,2)=0.
      CORD(2,1)=10.
      CORD(2,2)=0.
      CORD(3,1)=5.
      CORD(3,2)=5.
      
      MCON(1,1)=1
      MCON(1,2)=2
      MCON(1,3)=3

      MCON(2,1)=2
      MCON(2,2)=3
      MCON(2,3)=3
            
      MCON(3,1)=3
      MCON(3,2)=1
      MCON(3,3)=3

      call PLOT(CORD,MCON,JCT,NM)
      
      end

plot.jpg

Change this line in plot-sub.for to:

      DIMENSION CORD(JCT,2),MCON(NM,3),GRAF(125,127),VAL(10)

 

0 Kudos
GWats1
New Contributor I
344 Views

This is likely a Steve question, but is there a revised Fortran Examples download? IIRC, I have the old examples from when I ran VS 2017 and Fortran XE and I think I compiled a few.  I will try to compile the old examples, but I was wondering if the examples were ready to be opened by the new oneAPI. 

0 Kudos
Steve_Lionel
Honored Contributor III
325 Views

The Windows Fortran samples have not been touched, really, since I left Intel at the end of 2016. However, I have since built and run many of them using IFX and not had any issues. Intel had moved to putting samples up on Github, but the Fortran samples were left behind.  If you encounter a problem with any of them, let me know and I'll take a look.

0 Kudos
GWats1
New Contributor I
292 Views

Hi Dr Fortran,

I was playing around and got a couple to compile by opening the .SLN files in VS 2022. I got an error on POKER that said fatal error RC1015: can't open include file afxres.h  I'm wondering if I installed the Fortran compiler correctly or the VS 2022?

 

GWats1_0-1744830400829.png

 

0 Kudos
Steve_Lionel
Honored Contributor III
261 Views

OK, two things to do to fix this.

1. Edit Poker.rc and replace "afxres.h" with "winres.h".

2. Add a new source file unusedqq.f90 with contents:

subroutine unusedqq
end

I'm not sure why Intel is no longer providing UNUSEDQQ - it was a gimmick Microsoft invented to disable warnings for unused dummy arguments. 

0 Kudos
GWats1
New Contributor I
215 Views

For those readers who are trying to compile the Samples with the new oneAPI and IFX, I found more files that may need editing.

 

Doing a search of the .RC files in the Samples folders, I found the following .RC files with afxres.h inside:

c:\Data\Intel-Docs\Fortran-compiler\Samples\tbb\parallel_for\polygon_overlay\msvs\pover.rc
c:\Data\Intel-Docs\Fortran-compiler\Samples\tbb\parallel_for\game_of_life\msvs\app.rc
c:\Data\Intel-Docs\Fortran-compiler\Samples\compiler_f\Dialog\WHIZZY\src\WHIZZY.RC
c:\Data\Intel-Docs\Fortran-compiler\Samples\compiler_f\Dialog\TEMP\src\TEMP.RC
c:\Data\Intel-Docs\Fortran-compiler\Samples\compiler_c\nqueens_samples\src\common\nq.rc

 

I did the editing and added the .f90 empty file and got POKER to compile and run.

 

GWats1_0-1744889635740.png

 

0 Kudos
Reply