forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using DRAW_FILLED_POLYGON@ to plot a mesh
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Thu Jan 07, 2010 1:18 pm    Post subject: Reply with quote

Eddie,

In my %gr windows, I normally use
"s_width = clearwin_info@ ('SCREEN_WIDTH') " to return the screen width, which I assume is the pixel width of the physical screen, and
"iswidth = clearwin_info@ ('GRAPHICS_WIDTH')" to return the pixel width of the graphics window, and it works fine.

I noted in my example above in this post that 'GRAPHICS_WIDTH' returned a value of zero, as your example implies is possible. Thats why I looked in the help file to find another way of getting the window dimension. I'm not sure why this happens in this case, although I did not check all the winio@ calls for the start of the example above. Do you know why the graphics window dimension is not being returned ?

Your comments on clipping are interesting. I've always clipped. It was in the tektronix plot10 approach and I have always used this. I thought I had problems in clearwin+ if I did not truncate text.
Not clipping is much simpler. I should try the polygon filling without clipping, but the simple test that the polygon is totally outside the window can save a lot of calls to the graphics routines. The other suggestion from Smib, of defining a clipping region by:
Code:
        ijhndl=clearwin_info@('GRAPHICS_HDC')
        ihdr=CreateRectRgn(ixtop,iytop,ixbot,iybot)
        call SelectClipRgn(ijhndl,ihdr)   

is also worth checking

Something to check in the summer break !!

Thanks John
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Thu Jan 07, 2010 1:56 pm    Post subject: Reply with quote

John,

I only get graphics width as zero if the screen has been resized, and in that case, I make it 1 before calculating any scaling etc, because 0 doesn't work. I tend to get depth as well as width, and work out scaling based on whichever (depth or width) is the controlling factor.

Without Smib's code resetting the clip limits, they are the edge of the graphics region.

Eddie
Back to top
View user's profile Send private message
jjgermis



Joined: 21 Jun 2006
Posts: 404
Location: Nürnberg, Germany

PostPosted: Fri Feb 05, 2010 9:13 am    Post subject: Reply with quote

I played a bit the code and managed to get the desired result of the FEA polygons (input for the triangular mesher). Adding menus is still something I have to practice with! Anyway, many colleagues were amazed when I told them I did it using Fortran! Image:



I used http://www.bilder-space.de/ to upload the image.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group