🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
3 messages
3 total messages Started by William J. Murphy Tue, 04 Aug 1992 06:19
Using User Paths in a graphing program
#432
Author: William J. Murphy
Date: Tue, 04 Aug 1992 06:19
19 lines
1475 bytes
I am aware that user paths may provide an increase in speed of drawing in 
a program that for instance plots data points.  What I don't know is where 
to find a good reference for how to set them up and use them sensibly.
For now, my plotView would have to cycle through the data every time the view
parameters were changed.  That seems wasteful.  Particularly, when one draws
thousands of symbols, the delay can be tremendously long, try it in nxyplot
some time.  I have considered creating a font for the symbol part and already
have a font example I did for another program.  Would that decrease the
rendering time significantly?

So, what/where are some good examples of using user paths? (I prefer simple
illustrative examples)  Would fontifying the symbols increase the drawing
speed?

Thanks,
Bill Murphy               | Old Home Cottage Cheese:  The only cottage 
			  | cheese that's not made from formaldehyde, 
murphy@physics.purdue.edu | arsenic, or rodent parts.
Re: Using User Paths in a graphing program
#442
Author: Alex Blakemore
Date: Tue, 04 Aug 1992 18:20
16 lines
1143 bytes
In article <8003@dirac.physics.purdue.edu> murphy@gibbs.physics.purdue.edu (William J. Murphy) writes:
> I am aware that user paths may provide an increase in speed of drawing in 
> a program that for instance plots data points.  What I don't know is where 
> to find a good reference for how to set them up and use them sensibly.
 
first get the purple book from Adobe
"Programming the Display PostScript System with NeXTstep"
1-800-344-8335

its full of examples using fancier PS features and discusses
timing issues in detail.

the examples are on the archives. (AdobeExamples)
-- 
---------------------------------------------------
Alex Blakemore alex@cs.umd.edu   NeXT mail accepted
Re: Using User Paths in a graphing program
#443
Author: Paul Hagstrom
Date: Tue, 04 Aug 1992 20:45
45 lines
3011 bytes
In article <8003@dirac.physics.purdue.edu> murphy@gibbs.physics.purdue.edu  
(William J. Murphy) writes:
> 
> I am aware that user paths may provide an increase in speed of drawing in 
> a program that for instance plots data points.  What I don't know is where 
> to find a good reference for how to set them up and use them sensibly.
> For now, my plotView would have to cycle through the data every time the view
> parameters were changed.  That seems wasteful.  Particularly, when one draws
> thousands of symbols, the delay can be tremendously long, try it in nxyplot
> some time.  I have considered creating a font for the symbol part and already
> have a font example I did for another program.  Would that decrease the
> rendering time significantly?
> 
> So, what/where are some good examples of using user paths? (I prefer simple
> illustrative examples)  Would fontifying the symbols increase the drawing
> speed?
> 
> Thanks,
> Bill Murphy               | Old Home Cottage Cheese:  The only cottage 
> 			  | cheese that's not made from formaldehyde, 
> murphy@physics.purdue.edu | arsenic, or rodent parts.

Using user paths managed to speed up plotting by quite a significant amount in  
the differential equation plotting program that I've been working on..  They  
are not very difficult to use, but there are a couple of things that you need  
to watch out for.. The main one worth mentioning is this: don't let yourself  
get a path that is more than 32767 elements long.. it takes an int as an  
argument, and it is easy to forget that.. 

To create a user path, you just need to allocate two arrays (a "coordinate"  
array and an "operator" array) and then send them to DSPDoUserPath().  For all  
of the commands, look in the documentation for DPSDoUserPath(); it is pretty  
complete.  Additionally, there is a nice little example program in there which  
draws vertical lines and should show you enough about how to do it.  Another  
thing to be watchful for: I've always had to do a dps_setbbox first.  I'm not  
sure why, but it had tendencies not to work otherwise, so I just dps_setbbox to  
the size of the entire view before doing anything further.

Anyway, I hope that is of some help anyway.. I REALLY LIKE User Paths and do my  
best to refrain from plotting any other way.  The disadvantages are the size  
limitation and the fact that you can't change the color in mid-path (at least  
as far as I know), but the speed outweighs all of those.
-------------
Paul Hagstrom (hagstrop@carleton.edu)
        "I could tell from her eyes that she'd just taken out a loan..."
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads