home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1997 September / Macworld (1997-09).dmg / Serious Software / Cherwell Scientific Demos / pro Fit / pro Fit 5.0 demo (68k).sea / pro Fit 5.0 demo (68k) / External Modules / External modules sources / C / Contour plotting / ContourPlotter.h < prev   
MacBinary  |  1996-03-15  |  2.1 KB  |  [TEXT/CWIE]

view JSON data     |     view as text     |     open on a Mac     |     open on a PC

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: ContourPlotter.h

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Fri Mar 15 11:46:13 1996, modified Fri Mar 15 11:46:13 1996, creator 'CWIE', type ASCII, 1476 bytes "ContourPlotter.h" , at 0x644 410 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 10 43 6f 6e 74 6f 75 | 72 50 6c 6f 74 74 65 72 |..Contou|rPlotter|
|00000010| 2e 68 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.h......|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 05 c4 00 | 00 01 9a ad 6f 4f 55 ad |........|....oOU.|
|00000060| 6f 4f 55 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |oOU.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 15 75 00 00 |........|.....u..|
|00000080| 23 69 66 6e 64 65 66 20 | 5f 5f 43 4f 4e 54 4f 55 |#ifndef |__CONTOU|
|00000090| 52 5f 50 4c 4f 54 54 45 | 52 5f 5f 0d 23 64 65 66 |R_PLOTTE|R__.#def|
|000000a0| 69 6e 65 20 5f 5f 43 4f | 4e 54 4f 55 52 5f 50 4c |ine __CO|NTOUR_PL|
|000000b0| 4f 54 54 45 52 5f 5f 0d | 0d 0d 0d 0d 74 79 70 65 |OTTER__.|....type|
|000000c0| 64 65 66 20 73 74 72 75 | 63 74 20 50 72 69 76 61 |def stru|ct Priva|
|000000d0| 74 65 50 6c 6f 74 74 69 | 6e 67 44 61 74 61 20 50 |tePlotti|ngData P|
|000000e0| 6c 6f 74 74 69 6e 67 44 | 61 74 61 3b 0d 0d 74 79 |lottingD|ata;..ty|
|000000f0| 70 65 64 65 66 20 42 6f | 6f 6c 65 61 6e 20 28 2a |pedef Bo|olean (*|
|00000100| 46 75 6e 63 74 69 6f 6e | 50 74 72 29 28 64 6f 75 |Function|Ptr)(dou|
|00000110| 62 6c 65 20 78 31 2c 20 | 64 6f 75 62 6c 65 20 78 |ble x1, |double x|
|00000120| 32 2c 20 64 6f 75 62 6c | 65 2a 20 63 6f 6e 73 74 |2, doubl|e* const|
|00000130| 20 78 33 2c 20 76 6f 69 | 64 2a 20 70 61 72 61 6d | x3, voi|d* param|
|00000140| 29 3b 0d 09 2f 2f 20 74 | 68 65 20 66 75 6e 63 74 |);..// t|he funct|
|00000150| 69 6f 6e 20 74 6f 20 70 | 6c 6f 74 2e 20 49 73 20 |ion to p|lot. Is |
|00000160| 63 61 6c 6c 65 64 20 61 | 74 20 65 61 63 68 20 70 |called a|t each p|
|00000170| 6f 69 6e 74 20 78 31 2c | 20 78 32 20 6f 66 20 74 |oint x1,| x2 of t|
|00000180| 68 65 20 6d 61 74 72 69 | 78 0d 09 2f 2f 20 61 6e |he matri|x..// an|
|00000190| 64 20 6d 75 73 74 20 72 | 65 74 75 72 6e 20 74 68 |d must r|eturn th|
|000001a0| 65 20 76 61 6c 75 65 20 | 78 33 0d 09 2f 2f 20 72 |e value |x3..// r|
|000001b0| 65 74 75 72 6e 73 20 66 | 61 6c 73 65 20 69 66 20 |eturns f|alse if |
|000001c0| 78 33 20 69 73 20 69 6e | 76 61 6c 69 64 0d 09 2f |x3 is in|valid../|
|000001d0| 2f 20 70 61 72 61 6d 3a | 20 74 68 65 20 70 61 72 |/ param:| the par|
|000001e0| 61 6d 65 74 65 72 20 70 | 61 73 73 65 64 20 74 6f |ameter p|assed to|
|000001f0| 20 43 61 6c 63 75 6c 61 | 74 65 43 6f 6e 74 6f 75 | Calcula|teContou|
|00000200| 72 4d 61 74 72 69 78 0d | 0d 0d 50 6c 6f 74 74 69 |rMatrix.|..Plotti|
|00000210| 6e 67 44 61 74 61 2a 20 | 49 6e 69 74 43 6f 6e 74 |ngData* |InitCont|
|00000220| 6f 75 72 50 6c 6f 74 74 | 65 72 28 6c 6f 6e 67 20 |ourPlott|er(long |
|00000230| 6e 72 52 6f 77 73 2c 20 | 6c 6f 6e 67 20 6e 72 43 |nrRows, |long nrC|
|00000240| 6f 6c 73 2c 0d 09 09 64 | 6f 75 62 6c 65 20 78 31 |ols,...d|ouble x1|
|00000250| 4d 69 6e 2c 20 64 6f 75 | 62 6c 65 20 78 31 4d 61 |Min, dou|ble x1Ma|
|00000260| 78 2c 20 64 6f 75 62 6c | 65 20 78 32 4d 69 6e 2c |x, doubl|e x2Min,|
|00000270| 20 64 6f 75 62 6c 65 20 | 78 32 4d 61 78 29 3b 0d | double |x2Max);.|
|00000280| 09 2f 2f 20 63 61 6c 6c | 20 74 68 69 73 20 72 6f |.// call| this ro|
|00000290| 75 74 69 6e 65 20 74 6f | 20 69 6e 69 74 69 61 6c |utine to| initial|
|000002a0| 69 7a 65 20 74 68 65 20 | 63 6f 6e 74 6f 75 72 20 |ize the |contour |
|000002b0| 70 6c 6f 74 74 65 72 20 | 66 6f 72 20 0d 09 2f 2f |plotter |for ..//|
|000002c0| 20 77 6f 72 6b 69 6e 67 | 20 6f 6e 20 61 20 6d 61 | working| on a ma|
|000002d0| 74 72 69 78 20 6f 66 20 | 73 69 7a 65 20 6e 72 52 |trix of |size nrR|
|000002e0| 6f 77 73 2c 20 6e 72 43 | 6f 6c 73 0d 09 2f 2f 20 |ows, nrC|ols..// |
|000002f0| 78 31 4d 69 6e 2c 20 78 | 31 4d 61 78 2c 20 65 74 |x1Min, x|1Max, et|
|00000300| 63 2e 20 63 6f 72 72 65 | 73 70 6f 6e 64 20 74 6f |c. corre|spond to|
|00000310| 20 74 68 65 20 6e 75 6d | 65 72 69 63 61 6c 20 76 | the num|erical v|
|00000320| 61 6c 75 65 73 20 6f 66 | 20 74 68 65 20 62 6f 75 |alues of| the bou|
|00000330| 6e 64 73 20 6f 66 20 74 | 68 65 20 6d 61 74 72 69 |nds of t|he matri|
|00000340| 78 0d 09 2f 2f 20 72 65 | 74 75 72 6e 73 20 6e 69 |x..// re|turns ni|
|00000350| 6c 20 69 66 20 6e 6f 74 | 20 65 6e 6f 75 67 68 20 |l if not| enough |
|00000360| 6d 65 6d 6f 72 79 0d 09 | 2f 2f 20 69 66 20 49 6e |memory..|// if In|
|00000370| 69 74 43 6f 6e 74 6f 75 | 72 20 69 73 20 73 75 63 |itContou|r is suc|
|00000380| 63 65 73 73 66 75 6c 2c | 20 69 74 20 72 65 74 75 |cessful,| it retu|
|00000390| 72 6e 73 20 74 68 65 20 | 61 62 6f 76 65 20 64 65 |rns the |above de|
|000003a0| 66 69 6e 65 64 20 73 74 | 72 75 63 74 2e 0d 0d 0d |fined st|ruct....|
|000003b0| 76 6f 69 64 20 44 69 73 | 70 6f 73 65 43 6f 6e 74 |void Dis|poseCont|
|000003c0| 6f 75 72 50 6c 6f 74 74 | 65 72 28 50 6c 6f 74 74 |ourPlott|er(Plott|
|000003d0| 69 6e 67 44 61 74 61 2a | 20 70 29 3b 0d 09 2f 2f |ingData*| p);..//|
|000003e0| 20 64 65 61 6c 6c 6f 63 | 61 74 65 73 20 61 6c 6c | dealloc|ates all|
|000003f0| 20 6d 65 6d 6f 72 79 20 | 61 6c 6c 6f 63 61 74 65 | memory |allocate|
|00000400| 64 20 62 79 20 49 6e 69 | 74 43 6f 6e 74 6f 75 72 |d by Ini|tContour|
|00000410| 50 6c 6f 74 74 65 72 09 | 0d 09 2f 2f 20 64 6f 65 |Plotter.|..// doe|
|00000420| 73 20 6e 6f 74 68 69 6e | 67 20 69 66 20 70 3d 3d |s nothin|g if p==|
|00000430| 6e 69 6c 0d 0d 0d 42 6f | 6f 6c 65 61 6e 20 43 61 |nil...Bo|olean Ca|
|00000440| 6c 63 75 6c 61 74 65 43 | 6f 6e 74 6f 75 72 4d 61 |lculateC|ontourMa|
|00000450| 74 72 69 78 28 46 75 6e | 63 74 69 6f 6e 50 74 72 |trix(Fun|ctionPtr|
|00000460| 20 66 75 6e 63 2c 20 76 | 6f 69 64 2a 20 70 61 72 | func, v|oid* par|
|00000470| 61 6d 2c 20 50 6c 6f 74 | 74 69 6e 67 44 61 74 61 |am, Plot|tingData|
|00000480| 2a 20 70 29 3b 0d 09 2f | 2f 20 61 66 74 65 72 20 |* p);../|/ after |
|00000490| 68 61 76 69 6e 67 20 63 | 61 6c 6c 65 64 20 49 6e |having c|alled In|
|000004a0| 69 74 43 6f 6e 74 6f 75 | 72 50 6c 6f 74 74 65 72 |itContou|rPlotter|
|000004b0| 2c 20 63 61 6c 6c 20 74 | 68 69 73 20 72 6f 75 74 |, call t|his rout|
|000004c0| 69 6e 65 20 74 6f 20 69 | 6e 69 74 69 61 6c 69 7a |ine to i|nitializ|
|000004d0| 65 0d 09 2f 2f 20 74 68 | 65 20 70 6c 6f 74 74 69 |e..// th|e plotti|
|000004e0| 6e 67 20 6d 61 74 72 69 | 78 2e 0d 09 2f 2f 20 66 |ng matri|x...// f|
|000004f0| 75 6e 63 3a 20 61 20 66 | 75 6e 63 74 69 6f 6e 20 |unc: a f|unction |
|00000500| 74 68 61 74 20 72 65 74 | 75 72 6e 73 20 78 33 20 |that ret|urns x3 |
|00000510| 66 6f 72 20 65 61 63 68 | 20 6d 61 74 72 69 78 20 |for each| matrix |
|00000520| 70 6f 69 6e 74 20 78 31 | 2c 20 78 32 0d 09 2f 2f |point x1|, x2..//|
|00000530| 20 70 61 72 61 6d 20 69 | 73 20 70 61 73 73 65 64 | param i|s passed|
|00000540| 20 74 6f 20 66 75 6e 63 | 0d 0d 0d 42 6f 6f 6c 65 | to func|...Boole|
|00000550| 61 6e 20 44 72 61 77 43 | 6f 6e 74 6f 75 72 28 64 |an DrawC|ontour(d|
|00000560| 6f 75 62 6c 65 20 6c 65 | 76 65 6c 2c 20 50 6c 6f |ouble le|vel, Plo|
|00000570| 74 74 69 6e 67 44 61 74 | 61 2a 20 70 29 3b 0d 09 |ttingDat|a* p);..|
|00000580| 2f 2f 20 61 66 74 65 72 | 20 68 61 76 69 6e 67 20 |// after| having |
|00000590| 63 61 6c 6c 65 64 20 43 | 61 6c 63 75 6c 61 74 65 |called C|alculate|
|000005a0| 43 6f 6e 74 6f 75 72 4d | 61 74 72 69 78 2c 20 63 |ContourM|atrix, c|
|000005b0| 61 6c 6c 20 74 68 69 73 | 20 72 6f 75 74 69 6e 65 |all this| routine|
|000005c0| 20 66 6f 72 20 61 6c 6c | 20 6c 65 76 65 6c 73 0d | for all| levels.|
|000005d0| 09 2f 2f 20 28 69 2e 65 | 2e 20 78 33 2d 76 61 6c |.// (i.e|. x3-val|
|000005e0| 75 65 73 29 20 77 68 65 | 72 65 20 79 6f 75 20 77 |ues) whe|re you w|
|000005f0| 61 6e 74 20 74 6f 20 68 | 61 76 65 20 61 20 63 6f |ant to h|ave a co|
|00000600| 6e 74 6f 75 72 20 6c 69 | 6e 65 0d 09 2f 2f 20 52 |ntour li|ne..// R|
|00000610| 65 74 75 72 6e 73 20 66 | 61 6c 73 65 20 69 66 20 |eturns f|alse if |
|00000620| 65 78 65 63 75 74 69 6f | 6e 20 6d 75 73 74 20 62 |executio|n must b|
|00000630| 65 20 73 74 6f 70 70 65 | 64 0d 0d 0d 0d 23 65 6e |e stoppe|d....#en|
|00000640| 64 69 66 0d 00 00 00 00 | 00 00 00 00 00 00 00 00 |dif.....|........|
|00000650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000660| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000670| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000680| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00000690| 99 66 66 08 00 ff ff 99 | 99 33 33 08 00 ff ff 99 |.ff.....|.33.....|
|000006a0| 99 00 00 08 00 ff ff 66 | 66 ff ff 08 00 ff ff 66 |.......f|f......f|
|000006b0| 10 43 6f 6e 74 6f 75 72 | 50 6c 6f 74 74 65 72 2e |.Contour|Plotter.|
|000006c0| 68 74 02 00 00 00 54 45 | 58 54 43 57 49 45 01 00 |ht....TE|XTCWIE..|
|000006d0| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 14 01 80 |..TEXTCW|IE......|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 ad 6e cc f5 00 00 | 05 c4 00 00 01 9a ff 33 |...n....|.......3|
|00000700| 33 00 00 08 00 ff ff 00 | 00 ff ff 08 00 ff ff 00 |3.......|........|
|00000710| 00 cc cc 08 00 ff ff 00 | 00 99 99 08 00 ff ff 00 |........|........|
|00000720| 00 66 66 08 00 ff ff 00 | 00 33 33 08 00 ff ff 00 |.ff.....|.33.....|
|00000730| 00 00 00 08 00 cc cc ff | ff ff ff 08 00 cc cc ff |........|........|
|00000740| ff cc cc 08 00 cc cc ff | ff 99 99 08 00 cc cc ff |........|........|
|00000750| ff 66 66 08 00 cc cc ff | ff 33 33 08 00 cc cc ff |.ff.....|.33.....|
|00000760| ff 00 00 08 00 cc cc cc | cc ff ff 08 00 cc cc cc |........|........|
|00000770| cc cc cc 08 00 cc cc cc | cc 99 99 08 00 cc cc cc |........|........|
|00000780| 00 00 00 04 00 01 00 01 | 00 00 00 48 00 09 4d 6f |........|...H..Mo|
|00000790| 6e 61 63 6f 00 00 00 00 | 00 00 00 00 00 00 00 00 |naco....|........|
|000007a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 06 |........|........|
|000007b0| 00 04 00 2a 00 03 03 63 | 02 7d 00 b4 00 0d 03 73 |...*...c|.}.....s|
|000007c0| 02 6c ad 6f 09 06 00 00 | 03 ae 00 00 03 ae 00 00 |.l.o....|........|
|000007d0| 00 00 00 00 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|000007e0| 00 00 00 46 01 c5 74 f0 | 1f f4 00 00 00 1c 00 46 |...F..t.|.......F|
|000007f0| 00 01 4d 57 42 42 00 00 | 00 12 4d 50 53 52 00 00 |..MWBB..|..MPSR..|
|00000800| 00 1e 03 f0 ff ff 00 00 | 00 00 00 00 00 00 03 ed |........|........|
|00000810| ff ff 00 00 00 08 01 c5 | 73 44 00 00 00 00 00 00 |........|sD......|
|00000820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+