-+-+-+-+-+-+-+-+ START OF PART 13 -+-+-+-+-+-+-+-+ Xh(only)0 357 y(exists)d(while)g(traversal)h(is)g(active,)g(and)g(traversal)g X(is)f(an)h(atomic)g(process,)h(the)f(application)e(cannot)h(access)j(and)e X(inquire)e(the)0 407 y(contents)g(of)g(the)g(TSL.)h(This)f(means)h(that)f X(the)g(application)f(cannot)h(monitor)e(the)i(particular)g(path)g(taken)g X(through)e(a)j(structure)0 457 y(network)h(as)h(it)f(is)h(traversed,)g(nor)f X(the)h(state)g(of)f(the)h(accumulated)g(modelling)f(transformations)f(and)i X(attributes.)18 b(T)m(o)13 b(deter)o(-)0 506 y(mine)g(exactly)g(what)g(is)g X(happening,)g(an)g(application)f(programmer)h(is)g(forced)g(to)g(simulate)g X(the)f(PHIGS)i(traversal)f(process)0 556 y(`60on)e(paper)r(',)g(which)g(for) Vg X(anything)e(but)i(the)g(most)g(simple)g(model)h(is)f(a)h(tedious)e(and)h X(error)o(-prone)g(exercise.)0 634 y(The)k(module)f(provides)g(functions)f X(for)h(simulating)e(the)j(traversal)f(of)g(a)h(structure)f(network,)h X(enabling)e(an)i(application)e(to)0 684 y(interactively)d(control)g(and)h X(inquire)f(the)h(traversal)h(process.)64 800 y Fl(\267)21 b XFq(Simulating)9 b(the)i(traversal)g(of)g(a)g(structure)g(network,)f X(maintaining)g(a)h(`60traversal)g(state)g(list')f(which)h(may)g(be)g(inquire Vd.) X64 882 y Fl(\267)21 b Fq(Inquiring)9 b(the)i(contents)g(of)g(the)g(TSL.)64 X964 y Fl(\267)21 b Fq(Computing)10 b(the)i(coordinate)f(range)h(of)g(a)g X(structure)g(\(its)f(`60bounding)e(box'\).)17 b(This)12 b(is)g(very)f(useful V)h X(when)g(calculating)104 1013 y(viewing)e(parameters)i(and)g(transformation)e X(matrices.)0 1130 y(These)j(functions)c(are)k(also)e(used)g(for)g(the)g X(implementation)f(interactive)h(PHIGS)g(Debugger)g(tool)f(\(Chapter)h(10\).) V0 X1297 y Fr(4.5)59 b(The)17 b(Colour)e(Library)0 1418 y Fq(Specifying)c X(colours)g(is)h(often)f(a)h(dif)o(\256cult)f(task,)h(when)g(it)f(is)h X(necessary)h(to)e(specify)h(numerical)g(values)g(in)f(a)h(speci\256c)h X(colour)0 1468 y(model,)h(such)g(as)g(RGB,)f(CIE)g(or)g(HSV)-5 Xb(.)14 b(One)f(problem)g(is)g(the)h(need)f(to)g(convert)g(between)h(colour)f X(models.)21 b(Another)13 b(is)g(to)0 1518 y(how)f(to)f(derive)h(the)f X(speci\256c)i(parameter)g(values)g(to)e(represent)h(a)h(colour)e(\261)g(try) Vh X(guessing)f(what)h(the)g(RGB)f(values)h(for)g(`60dark)0 1568 Xy(brown')e(might)h(be,)h(for)e(example.)0 1646 y(This)e(module)g(provides)f X(a)i(set)f(of)g(functions)e(for)i(using)f(a)i(simple)f(textual)f(colour)g X(speci\256cation)h(method,)h(the)f(Colour)e(Naming)0 1696 y(Scheme)13 Xb(\(CNS\),)e(and)g(for)g(manipulating)f(colours,)h(including:)64 X1812 y Fl(\267)21 b Fq(Converting)9 b(between)j(the)f(HLS,)h(RGB,)f(HSV)h X(and)f(CNS)g(colour)g(models.)64 1894 y Fl(\267)21 b Fq(Specifying)10 Xb(colours)h(textually)e(using)i(CNS.)64 1975 y Fl(\267)21 b XFq(Setting)10 b(the)h(colour)f(of)h(primitive)f(types,)i(and)f(the)g X(background.)0 2091 y(The)h(Colour)d(Naming)i(Scheme)h(\(CNS\))f(`5B5)o(,)h( V6)o X(`5D)f(is)g(a)h(colour)e(model)g(which)h(aims)g(to)g(simplify)e(the)i X(speci\256cation)g(of)g(colours,)0 2141 y(by)j(using)g(a)h(number)g(of)f X(standard)h(English)e(words)i(and)f(phrases,)j(which)d(may)h(be)g(combined)g X(to)f(express)h(a)g(wide)g(range)0 2191 y(of)f(colours.)23 Xb(Some)15 b(examples)g(of)e(colours)h(expressed)h(using)e(the)h(CIE)g(scheme V) Xh(are:)21 b(`60light)12 b(green',)k(`60orangish-red')c(and)0 2241 Xy(`60moderate)g(dark)f(brown'.)0 2319 y(There)h(are)g(three)g(parameters)g X(used)g(in)e(CNS)i(\261)f(hue,)h(lightness)e(and)h(saturation)f(\261)h(which V) Xg(are)h(de\256ned)g(as)g(follows:)64 2435 y Fl(\267)21 b Fp(Hue)p XFq(.)15 b(Seven)10 b(generic)f(hues)g(are)h(de\256ned,)g(called)f(red,)h X(orange,)g(brown,)f(yellow)m(,)g(green,)i(blue)d(and)h(purple.)14 Xb(T)m(o)9 b(specify)104 2485 y(hues)j(intermediate)h(between)g(these,)g X(combination)e(terms)i(such)g(as)g(`60blue-green')f(are)h(used.)19 Xb(These)14 b(can)f(be)g(further)104 2535 y(modi\256ed)g(with)f(the)h(suf)o X(\256x)g(`60-ish',)g(so)h(we)g(might)e(have)i(`60blueish-green')e(meaning)h( Va)h X(colour)e(that)h(is)g(between)h(blue)104 2585 y(and)d(green,)h(but)f(nearer) Vh X(green)f(than)g(blue.)64 2666 y Fl(\267)21 b Fp(Lightness)p XFq(.)15 b(This)c(is)g(expressed)h(with)f(`60very)g(dark',)g(`60dark',)g X(`60medium',)h(`60light')d(and)i(`60very)g(light'.)64 2748 y Fl(\267)21 Xb Fp(Saturation)p Fq(.)15 b(Saturation)10 b(can)i(be)f(`60greyish',)g X(`60moderate',)h(`60strong')e(and)h(`60vivid'.)0 2956 y(13th)22 b(May)m(,)12 Xb(1992)636 b(31)839 b(2.01)p eop X%%Page: 32 33 Xbop 0 -137 a Fq(PHIGS)11 b(T)m(oolkit)f(User)i(Manual)1235 Xb(PTK/100)0 8 y(Using)13 b(these)i(names)g(phrases)g(may)g(be)f(built)e(such V) Xj(`60greyish)e(medium)h(yellow'.)23 b(The)15 b(hyphenated)f(hue)g(names)h X(de\256ne)g(a)0 58 y(position)9 b(between)i(the)f(two)g(colours)h X(speci\256ed,)g(for)g(example)g(`60yellow-green')f(de\256nes)h(the)g(hue)f X(halfway)h(between)g(yellow)0 108 y(and)f(green)h(and)g(`60yellowish-green') Vd X(is)j(nearer)g(to)f(green)g(than)g(yellow)m(.)15 b(Lightness)10 Xb(and)g(saturation)g(names)h(are)h(optional)c(and)0 158 y(when)j(omitted)g X(defaults)f(are)j(used.)0 237 y(The)f(hue,)g(lightness)e(and)h(saturation)f X(names)j(are)f(as)g(follows:)p 273 322 1320 2 v 272 372 2 50 Xv 840 357 a(Hue)f(names)p 1592 372 V 273 373 1320 2 v 273 383 XV 272 433 2 50 v 298 418 a(red)278 b(orangish-red)109 b(brownish-red)f X(orange-red)p 1592 433 V 272 483 V 298 468 a(red-orange)151 Xb(brown-red)146 b(red-brown)157 b(reddish-orange)p 1592 483 XV 272 533 V 298 518 a(reddish-brown)87 b(orange)207 b(brown)224 Xb(yellowish-orange)p 1592 533 V 272 583 V 298 568 a(yellowish-brown)47 Xb(yellow-orange)79 b(orange-yellow)90 b(yellow-brown)p 1592 X583 V 272 632 V 298 618 a(brown-yellow)96 b(orangish-yellow)48 Xb(brownish-yellow)f(yellow)p 1592 632 V 272 682 V 298 667 a(greenish-yellow) X62 b(green-yellow)100 b(yellow-green)111 b(yellowish-green)p X1592 682 V 272 732 V 298 717 a(green)239 b(bluish-green)111 Xb(blue)259 b(green-blue)p 1592 732 V 272 782 V 298 767 a(greenish-blue)104 Xb(blue)248 b(purplish-blue)107 b(purple-blue)p 1592 782 V 272 X832 V 298 817 a(blue-purple)138 b(bluish-purple)96 b(purple)224 Xb(reddish-purple)p 1592 832 V 272 882 V 298 867 a(red-purple)157 Xb(purple-red)146 b(purplish-red)126 b(magenta)p 1592 882 V X272 931 V 298 916 a(cyan)253 b(black)230 b(grey)257 b(white)p X1592 931 V 273 933 1320 2 v 503 1009 861 2 v 502 1059 2 50 Xv 794 1044 a(Lightness)10 b(names)p 1362 1059 V 503 1061 861 X2 v 503 1071 V 502 1121 2 50 v 528 1106 a(very-dark)49 b(dark)h(medium)g X(light)d(very-light)p 1362 1121 V 503 1122 861 2 v 601 1199 X666 2 v 600 1248 2 50 v 789 1234 a(Saturation)10 b(names)p X1265 1248 V 601 1250 666 2 v 601 1260 V 600 1310 2 50 v 625 X1295 a(greyish)49 b(moderate)i(strong)d(vivid)p 1265 1310 V X601 1312 666 2 v 0 1439 a Fu(4.5.1)i(Example)0 1546 y Fq(The)12 Xb(demonstration)e(program)h Fi(cnstest)i Fq(illustrates)c(the)j(use)f(of)g X(the)g(functions)f(in)h(this)f(library)m(.)0 1715 y Fr(4.6)59 Xb(Miscellaneous)16 b(functions)0 1837 y Fq(This)11 b(section)h(lists)e(the)h X(miscellaneous)h(functions)e(of)h(the)h(PHIGS)f(T)m(oolkit.)j(Some)f(of)e X(these)h(functions)e(have)i(been)g(written)0 1886 y(because)e(of)f(dif)o X(ferences)g(in)g(the)f(C)h(language)g(bindings)e(of)h(SunPHIGS)h(and)g(DEC)g X(PHIGS.)g(These)h(functions)d(will)h(hopefully)0 1936 y(become)j(obsolete)f X(when)g(both)f(implementations)g(adopt)h(the)g(ISO)g(C)g(PHIGS)g(binding.)j X(Other)d(functions)f(have)h(been)h(added)0 1986 y(to)g(the)h(library)e X(because)j(of)f(the)f(policy)g(of)g(the)h(PHIGS)f(T)m(oolkit)f(to)h(use)i X(the)e Fi(Ppoint)i Fq(and)f Fi(Ppoint3)h Fq(datatypes)e(in)g(all)h(cases)0 X2036 y(where)e(a)g(pair)g(or)f(triplet)f(of)h(\257oating)g(point)f(numbers)i X(are)g(required,)g(with)f(the)g(exception)g(of)h(colour)f(representations.)1 V4 Xb(These)0 2086 y(functions)c(enable)i(standard)f(PHIGS)g(functions)f(to)g(be V) Xi(called)g(using)e(the)h Fi(Ppoint)h Fq(and)g Fi(Ppoint3)g XFq(datatypes)f(instead)g(of)g(the)0 2135 y Fi(Pvector)i Fq(and)e XFi(Pvector3)i Fq(datatypes.)0 2214 y(The)e(Fortran)f(interface)h(to)f(the)g X(PHIGS)h(T)m(oolkit)e(provides)h(two)f(\256le)i(handling)e(functions)g XFi(ptkf_fopen)k Fq(and)d Fi(ptkf_fclose)0 2264 y Fq(to)f(enable)i(the)f X(programmer)g(to)g(obtain)f(the)h(C)f(\256le)i(pointer)d(to)i(a)g(\256le.)16 Xb(This)10 b(\256le)g(pointer)f(is)g(then)h(used)g(in)g(the)g(PHIGS)g(T)m X(oolkit)0 2314 y(functions)j(which)h(perform)g(input)e(and)i(output)f(on)h X(text)f(\256les.)25 b(Examples)15 b(are)g Fi(ptkf_outputmatrix3)p XFq(,)j Fi(ptkf_phinter)0 2364 y Fq(and)12 b Fi(ptkf_storetopology)q(layout)q XFq(.)21 b(The)13 b(Fortran)f(interface)h(to)f(DEC)g(PHIGS)h(C)f(also)g(uses) Vh X(\256le)g(pointers)e(to)h(functions)0 2414 y(like)f(OPEN)g(PHIGS)h(and)f(NOT V) Xh(the)f(usual)g(logical)f(unit)h(numbers.)0 2956 y(13th)22 Xb(May)m(,)12 b(1992)636 b(32)839 b(2.01)p eop X%%Page: 33 34 Xbop 0 349 a Fj(Chapter)24 b(5)0 585 y Fs(Phinter)-10 b(,)29 Xb(the)h(PHIGS)f(T)-10 b(extual)29 b(Interpr)n(eter)0 835 y XFq(Phinter)13 b(\()p Fk(PH)q Fq(IGS)g Fk(inter)p Fq(preter\))g(is)g(a)i(tool V) Xd(which)h(accepts)i(textual)e(representations)g(of)g(calls)h(to)f(PHIGS)g X(procedures,)i(and)0 885 y(arranges)9 b(for)g(their)f(execution,)h(just)f(as V) Xh(if)g(they)f(had)h(been)g(compiled)f(as)i(part)e(of)h(a)g(program.)15 Xb(It)8 b(is)g(a)i(good)e(idea)h(to)f(use)h(Phinter)0 935 y(for)i(test)f X(programs,)i(because)g(you)f(are)h(not)e(shackled)h(to)g(the)g(edit,)g X(compile)f(and)i(link)d(cycle.)16 b(Linking)10 b(a)i(test)f(program)f(with)0 X984 y(the)i(PHIGS)f(library)g(can)h(be)g(very)g(time-consuming.)j(Phinter)c X(is)g(also)h(useful)f(for)h(reading)f(`60startup')f(scripts)h(and)h(provides V)0 X1034 y(an)g(alternative)e(method)h(for)g(storing)f(and)h(restoring)f X(structure)h(networks.)0 1113 y(The)h(Phinter)e(module)h(provides)g X(functions)f(for:)64 1234 y Fl(\267)21 b Fq(Invoking)9 b(Phinter)h(on)h(a)h X(named)g(script)f(\256le.)64 1317 y Fl(\267)21 b Fq(Sending)10 Xb(input)g(obtained)g(from)i(a)f(PHIGS)h(string)e(input)f(device)j(to)f X(Phinter)n(.)64 1400 y Fl(\267)21 b Fq(W)n(riting)8 b(the)i(contents)f(of)h X(structures)f(and)h(structure)g(networks)f(to)g(script)g(\256les)h(in)g(a)g X(format)g(which)f(may)i(later)f(be)g(read)104 1449 y(using)g(Phinter)n(.)64 X1532 y Fl(\267)21 b Fq(A)11 b(standalone)g(interactive)g(version)f(of)h X(Phinter)n(.)0 1701 y Fr(5.1)59 b(Using)17 b(Phinter)0 1823 Xy Fq(Phinter)12 b(is)h(a)h(procedure)f(callable)g(from)g(an)h(application)d X(program.)21 b(Phinter)12 b(reads)i(PHIGS)f(commands)h(from)f(a)h(\256le,)g X(and)0 1873 y(returns)d(to)f(the)i(calling)e(program)h(when)g(the)g(end)h(of V) Xf(the)g(\256le)g(or)g(the)h(command)g(`60exit')e(occurs.)0 1952 Xy(If)g(the)g(\256le)h(pointer)e(is)h(set)h(to)f(`60stdin')f(then)h(Phinter)f X(will)g(read)i(from)f(standard)h(input)d(and)j(will)e(issue)i(prompts)e X(giving)g(details)0 2001 y(of)k(each)i(parameter)g(required)e(for)h(a)g X(function.)21 b(Input)13 b(to)g(Phinter)g(consists)g(of)g(a)i(`60script')d X(containing)g(PHIGS)i(procedure)0 2051 y(names)c(and)f(their)g(associated)g X(parameters)i(separated)f(by)e(spaces)j(or)d(newlines.)15 b(When)9 Xb(Phinter)f(expects)i(a)g(parameter)g(which)0 2101 y(is)j(a)g(character)h X(string,)e(it)g(will)g(accept)i(the)f(next)f(sequence)i(of)f(characters)h X(bounded)e(by)g(white-space.)21 b(T)m(o)13 b(include)f(white-)0 X2151 y(space)h(in)d(the)h(string,)g(the)g(entire)g(string)f(should)g(be)h X(enclosed)h(in)f(double)f(quotes)h Fi("like)19 b(this")p Fq(.)d(A)c(single)e X(string)g(may)i(not)0 2201 y(be)e(split)e(across)i(lines,)g(even)g(if)f(it)f X(is)h(quoted.)14 b(If)c(the)f(\256rst)g(non-blank)f(character)j(of)e(a)h X(line)e(is)i(`60!',)f(the)h(line)f(is)g(considered)g(to)g(be)0 X2250 y(a)i(comment.)16 b(Comment)10 b(lines)f(must)h(not)g(appear)h(in)e(the V) Xi(midst)e(of)h(parameter)h(lists.)k(Phinter)9 b(is)h(insensitive)f(to)g X(case,)k(except)0 2300 y(when)d(reading)f(string)g(parameters.)16 Xb(In)10 b(general,)h(Phinter)e(doesn')o(t)g(care)i(about)f(white)f(space)i X(and)f(blank)f(lines)h(between)g(calls)0 2350 y(or)h(parameters.)17 Xb(Phinter)10 b(does)i(not)e(issue)h(prompts)g(when)g(reading)g(from)g X(\256les.)0 2519 y Fr(5.2)59 b(An)17 b(example)e(script)0 2641 Xy Fq(Here)10 b(is)e(an)h(example)h(script)e(to)g(draw)h(a)h(rectangle.)k X(Note)9 b(the)g(use)g(of)f(the)h(C-preprocessor)g(directives)f(to)g(use)h X(the)g(appropriate)0 2690 y(version)i(of)g(the)g(`60open_workstation')d X(function.)912 2956 y(33)p eop X%%Page: 34 35 Xbop 0 -137 a Fq(PHIGS)11 b(T)m(oolkit)f(User)i(Manual)1235 Xb(PTK/100)54 8 y Fi(open_phigs)20 b(0)e(0)54 108 y(#if)h(SUN)54 X158 y(open_workstation)i(1)d(0)g(PHIGS_SUN_TOOL)j(0)54 208 Xy(#endif)54 307 y(#if)e(VMS)54 357 y(open_workstation)i(1)d(0)g(0)54 X407 y(#endif)54 506 y(open_structure)i(1)54 606 y(polyline)f(5)54 X656 y(0.100000)g(0.100000)54 706 y(0.100000)g(0.900000)54 756 Xy(0.900000)g(0.900000)54 805 y(0.900000)g(0.100000)54 855 y(0.100000)g X(0.100000)54 955 y(close_structure)54 1054 y(post_structure)h(1)f(1)f(0)54 X1154 y(close_workstation)j(1)54 1204 y(close_phigs)0 1373 y XFr(5.3)59 b(Hashtables)16 b(in)h(Phinter)0 1494 y Fq(Phinter)c(recognises)h X(several)g(hashtables)g(to)f(enable)h(strings)e(to)h(be)h(used)g(instead)f X(of)g(integers)g(in)g(Phinter)g(scripts.)22 b(These)0 1544 Xy(tables)9 b(are)h(the)f("structureid",)g("pickid",)g("label",)g X("colourindex",)g("viewindex")f(and)h("name")h(hashtables.)15 Xb(The)10 b(hashtables)0 1594 y(must)g(have)h(been)f(created)h(by)f(the)g X(application)f(before)h(Phinter)f(is)h(called)g(in)g(order)g(for)f(Phinter)g X(to)h(recognise)g(them.)15 b(Strings)0 1644 y(must)c(always)g(be)g(bounded)f X(by)h(quotation)e(marks)i(in)g(the)f(scripts,)h(for)g(instance)g(the)f X(following)f(line)h(may)i(be)f(used)g(to)f(post)h(a)0 1694 Xy(structure)54 1864 y Fi(post_structure)20 b(1)f("lamp")g(0.0)0 X2082 y Fr(5.4)59 b(Registers)16 b(in)g(Phinter)0 2204 y Fq(Phinter)d X(recognises)h(several)g(registers)g(to)f(assist)h(in)f(the)h(writing)d(of)j X(scripts)f(and)h(the)g(interactive)f(use)h(of)f(certain)h(PHIGS)0 X2254 y(functions.)g(V)-5 b(alues)12 b(are)f(inserted)g(into)e(Phinter)h X(registers)h(after)g(calls)g(to)f(certain)h(PHIGS)g(functions.)j(For)d X(instance,)g(the)g(TM)0 2304 y(register)h(stores)h(the)f(transformation)f X(matrix)h(generated)h(by)f(a)h(call)g(to)f(SCALE,)h(TRANSLA)-5 Xb(TE,)15 b(ROT)m(A)-5 b(TE)13 b(or)g(any)f(of)g(the)0 2354 Xy(standard)g(PHIGS)g(functions)f(which)h(generate)g(a)h(transformation)e X(matrix.)17 b(The)c(word)f(TM)g(may)h(then)f(be)g(used)h(in)e(a)i(script)0 X2403 y(in)e(place)h(of)f(an)g(actual)h(transformation)e(matrix:)54 X2524 y Fi(scale)19 b(1.0)f(1.0)54 2574 y(set_local_transformat)q(ion)j(TM)e +-+-+-+-+-+-+-+- END OF PART 13 +-+-+-+-+-+-+-+-