## Copy this file to 3DLDF-1.1.3/ ## Apply the patch like this: ## patch -p1 -i 3DLDF-1.1.3-1.1.4.diff ## diff -Naur 3DLDF-1.1.3/.rcsfreeze.log 3DLDF-1.1.4/.rcsfreeze.log --- 3DLDF-1.1.3/.rcsfreeze.log 2003-12-01 21:40:50.000000000 +0100 +++ 3DLDF-1.1.4/.rcsfreeze.log 2003-12-10 18:37:30.000000000 +0100 @@ -1,3 +1,14 @@ +Version: C_3(C_3), Date: Wed Dec 10 18:36:59 MET 2003 +----------- + Release 1.1.4. +----------- + +Version: C_2(C_2), Date: Tue Dec 9 20:42:48 MET 2003 +----------- + About to merge changes in my development and release directories, before + I make release 1.1.4. +----------- + Version: RELEASE_1_1_3(C_1), Date: Mon Dec 1 21:40:30 MET 2003 ----------- Configuration for 3DLDF 1.1.3. Fixed bugs in 3DLDF-1.1.3/CWEB/Makefile.am diff -Naur 3DLDF-1.1.3/AUTHORS 3DLDF-1.1.4/AUTHORS --- 3DLDF-1.1.3/AUTHORS 2003-12-01 20:46:17.000000000 +0100 +++ 3DLDF-1.1.4/AUTHORS 2003-12-09 21:19:53.000000000 +0100 @@ -1,5 +1,7 @@ AUTHORS +$Id: AUTHORS,v 1.4 2003/12/09 20:19:53 lfinsto1 Exp $ + This file is part of 3DLDF, a package for three-dimensional drawing. Copyright (C) 2003 Laurence D. Finston. @@ -28,8 +30,6 @@ s246794@stud.uni-goettingen.de -$Id: AUTHORS,v 1.3 2003/12/01 19:46:17 lfinsto1 Exp $ - Authors of 3DLDF. 3DLDF Laurence D. Finston (LDF) diff -Naur 3DLDF-1.1.3/CWEB/.rcsfreeze.log 3DLDF-1.1.4/CWEB/.rcsfreeze.log --- 3DLDF-1.1.3/CWEB/.rcsfreeze.log 2003-12-01 21:45:20.000000000 +0100 +++ 3DLDF-1.1.4/CWEB/.rcsfreeze.log 2003-12-10 18:37:52.000000000 +0100 @@ -1,3 +1,14 @@ +Version: C_4(C_4), Date: Wed Dec 10 18:37:40 MET 2003 +----------- + Release 1.1.4. +----------- + +Version: C_3(C_3), Date: Tue Dec 9 20:42:59 MET 2003 +----------- + About to merge changes in my development and release directories, before + I make release 1.1.4. +----------- + Version: RELEASE_1_1_3(C_2), Date: Mon Dec 1 21:44:59 MET 2003 ----------- Configuration for 3DLDF 1.1.3. Fixed bugs in 3DLDF-1.1.3/CWEB/Makefile.am diff -Naur 3DLDF-1.1.3/CWEB/3DLDFprg.dvi 3DLDF-1.1.4/CWEB/3DLDFprg.dvi --- 3DLDF-1.1.3/CWEB/3DLDFprg.dvi 2003-12-01 21:51:47.000000000 +0100 +++ 3DLDF-1.1.4/CWEB/3DLDFprg.dvi 2003-12-10 18:45:10.000000000 +0100 @@ -1,12 +1,12 @@ -; TeX output 2003.12.01:2151n !", +; TeX output 2003.12.10:1845n !", cmsy10xK`y cmr101|{Ycmr83DLDFPRÎGTrCOPYRIGHTXANDLICENSE1n@P"V cmbx101. Cop9yrightTandLicense. CopyrightrcUU 2003UULaurenceD.Finston. -See˞thesectionhGNUˀF*reeDoGcumentationLicense@1515iforthecopyingconditionsthatapplyto][thisdoQcumen9t. -TheKprogramq 3DLDFqdoGcumentedhereisfreesoftware;youcanredistributeitand/ormoGdifyitundertheYtermsoftheGNUYGeneralPublicLicenseaspublishedbytheF*reeSoftwareF*oundation;[eitherversion2eFoftheLicense,iBor(atyouroption)anylaterversion.SeethesectionhGNUeAGeneralPublicLicense@1516iinUUthisdoGcument. +See˞thesectionhGNUˀF*reeDoGcumentationLicense@1523iforthecopyingconditionsthatapplyto][thisdoQcumen9t. +TheKprogramq 3DLDFqdoGcumentedhereisfreesoftware;youcanredistributeitand/ormoGdifyitundertheYtermsoftheGNUYGeneralPublicLicenseaspublishedbytheF*reeSoftwareF*oundation;[eitherversion2eFoftheLicense,iBor(atyouroption)anylaterversion.SeethesectionhGNUeAGeneralPublicLicense@1524iinUUthisdoGcument. 3DLDF;is;distributedinthehopGethatitwillbeuseful,ukbutWITHOUT;ANYWARRANTY;;withouteventheimpliedwarrantyofMERCHANT*ABILITYorFITNESSFORAP*ARTICULARPURPOSE.SeetheUUGNUGeneralPublicLicenseformoredetails. Y*oushouldhavereceivedacopyoftheGNUGeneralPublicLicensealongwith3DLDF;ifnot,writetotheUUF*reeSoftwareUUFoundation,Inc.,59TemplePlace,Suite330,Boston,MA02111-1307USA 3DLDFAisaGNUpackqage. ItispartoftheGNUPro8jectoftheF*reeSoftwareFoundationandispublished5undertheGNU5sGeneralPublicLicense.Seethewebsite 8BeginTLogJʄ`> +Donald}Knuth'sbGooks}TKßVE-X:ThePr}'ogramBand}MET;AFONT:TheProgramBeach}includeasection\HowtoUUreadaWEB",whichmaybGehelpful.9Ȅ`+U 8Log)j`+U [LDFT2002.11.18.]YXChangedNrnameofthis lefromcweavedriver.webtocwdriver.web.o{ItnowhasfewerthanUU8lettersandcanbGeusedunderDOS. [LDFT2003.08.16.]XChangednameofthis lefromcwdriver.webto3DLDF.websometimesince2002.11.18.F*orgotUUtonoteithere. -[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions.Ȅ` 8EndTLogA>`3. F +[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions.Ȅ`G3. F ormattingrcommands.cweaveformats\== b"as\",\!="as\6=",and\!e"as\:".U.ProgrammerswhoUUusethesetokensmusttypGethemas\== b",\!=,and\!". ThefollowingformattingcommandsarefortypGesde nedinC++6orintheC++StandardLibrary*,butnothandledUUcorrectlybycweave. format3c(bitsetT.#int @@ -57,36 +57,36 @@ format3c(ve}'ctorW?0intn썷x43DLDFPRÎG FORMAJTTINGXCOMMANDS3n@P4. ThissectioncontainscommandsforinputtingtheCWEBsource les,whichareinvisibleinthecweave output.5. PreproQcessorTv\rariablesandlibrary les(loader.web).%#ThisUUCWEB legeneratesnoC++coGde,Abut 8BeginTLogJʄ`> +[LDFT2003.07.18.]Y;SetMUthepreproGcessormacroLDF_GCC_3_3@to1inordertocompileusinggccversion3.320030226=(prerelease)(SuSE=HLinux).*TSetitto0inordertocompileusingGCCversion2.95.320010315(SuSE).UUThiscanbGefasterthanusingGCC3.3,especiallywithrespecttolinking.N99Ȅ`+U 8Log)j`+U [LDFT2003.08.21.]YSNowincludingplfmvar.h.TItcontains#de ne!xand#undef!>̫preproGcessorcommandsfor^conditionalcompilation.gThere'sadi erentversionofthis leineachofthesubGdirectoriesusedforcompilingUUwithadi erentcombinationofopGeratingsystem,compiler,andcompilerversion. [LDFT2003.07.25.]Y;MoGdi edUUtheconditionalconstructionsgoverningUUcompilationslightly*. [LDFT2003.08.14.]Z3Nowincludinggetopt.hfortheGCCpversionsunderLinux.It'sforproGcessingthecommandUUlineoptions. [LDFT2003.08.14.]ZNow_includingstreambuf.h,LifLDF_GCC_2_95HEisde ned,otherwiseios.ThisisforstreamUUformatting. [LDFT2003.08.29.]YFdRemoved~getopt.htomain.web,bGecauseit'sonlyusedthere.,ATOnDO:Move~therestofUUtheincludecommandstothe leswherethey'reneeded,andTgetridofthis le. [LDFT2003.09.03.]YAdded9#de ne"cLDF_PUBLIC[=inordertobGeabletoconditionallyincludeplfmvar.h.Thelatterisnotincludedintheversionfordistribution.Instead,thepreproGcessorvqariablesarede nedorunde nedUUhere. -[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions.Ȅ` 8EndTLogA>`6. Con guration le.Thisdsectionincludesconfig.h,h[whichisgeneratedbyconfigure3*ګ.oThisisnewinZ3DLDFZ1.1.nTheconfigure6|scriptgeneratedbyAutoGconftestswhethercertainlibrary lesarepresent,andde nespreproGcessorvqariablesinconfig.haccordingly*.HThesecanbeusedforconditionallycompilingcoGde,usothatlibrary lesareonlyincludediftheyarereallypresent.EGHowever,itwillbGenecessarytoaddcoGdeoforhandlingthecasethattheyaren'tpresent.+{I9haven'todonethisyet,althoughIhaveoputinconditionalcoGdeUUusingthesevqariablesinacoupleofplaces.qTODO:W*orkonthis.[LDFT2003.11.12.] -AutoGconfdoesnotperdefaultchecktheversionofthecompilerthat'sused,0andI'mnotsurewhetherthiswouldreallybGesensible.43DLDF{alreadycontainsconditionallycompiledcoGdebasedonwhethertheDECC++compiler,ortheGNUC++compiler(GCC)version2.95orversion3.3isused.vIftheDECcompilerisused,{thepreproGcessorvqariablesLDF_GCC_2_95HorLDF_GCC_3_3C}mustbeunde nedbyhandbGelow.Itde nes__DECCXX2itself.IfGCCisused,IoneofthemmustbGede ned,andtheotherunde ned.Perdefault,LDF_GCC_3_3@ޫisde nedandLDF_GCC_2_95EGisunde ned.JThisisbGecauseGCC3.3is,ingeneral,animprovementoverGCC2.95.However,IusuallyuseGCC2.95myself,bGecauselinkingissigni cantlyfasterUUonthecomputerIuse.q[LDFT2003.11.12.]c9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.11.12.]Y;AddedUUthissection.Ȅ` 8EndTLogA>`n썫4CONFIGURAJTIONXFILEcr3DLDFPRÎGx6n@Phloader.h56i #include'~"config.h" SeeXalsosections7,8,and9.7. LibraryT les.hloader.h56i+#de ne!LDF_PUBLIC#ifdefeLDF_PUBLIC#de ne!_GNU_SOURCE#de ne!LDF_GCC_3_3#undef *LDF_GCC_2_95#undef *__DECCXX_y{ b> +[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions.Ȅ`G6. Con guration le.Thisdsectionincludesconfig.h,h[whichisgeneratedbyconfigure3*ګ.oThisisnewinZ3DLDFZ1.1.nTheconfigure6|scriptgeneratedbyAutoGconftestswhethercertainlibrary lesarepresent,andde nespreproGcessorvqariablesinconfig.haccordingly*.HThesecanbeusedforconditionallycompilingcoGde,usothatlibrary lesareonlyincludediftheyarereallypresent.EGHowever,itwillbGenecessarytoaddcoGdeoforhandlingthecasethattheyaren'tpresent.+{I9haven'todonethisyet,althoughIhaveoputinconditionalcoGdeUUusingthesevqariablesinacoupleofplaces.qTODO:W*orkonthis.[LDFT2003.11.12.] +AutoGconfdoesnotperdefaultchecktheversionofthecompilerthat'sused,0andI'mnotsurewhetherthiswouldreallybGesensible.43DLDF{alreadycontainsconditionallycompiledcoGdebasedonwhethertheDECC++compiler,ortheGNUC++compiler(GCC)version2.95orversion3.3isused.vIftheDECcompilerisused,{thepreproGcessorvqariablesLDF_GCC_2_95HorLDF_GCC_3_3C}mustbeunde nedbyhandbGelow.Itde nes__DECCXX2itself.IfGCCisused,IoneofthemmustbGede ned,andtheotherunde ned.Perdefault,LDF_GCC_3_3@ޫisde nedandLDF_GCC_2_95EGisunde ned.JThisisbGecauseGCC3.3is,ingeneral,animprovementoverGCC2.95.However,IusuallyuseGCC2.95myself,bGecauselinkingissigni cantlyfasterUUonthecomputerIuse.q[LDFT2003.11.12.]N99Ȅ`+U 8Log)j`+U +[LDFT2003.11.12.]Y;AddedUUthissection.Ȅ`Gn썫4CONFIGURAJTIONXFILEcr3DLDFPRÎGx6n@Phloader.h56i #include'~"config.h" SeeXalsosections7,8,and9.7. LibraryT les.hloader.h56i+#de ne!LDF_PUBLIC#ifdefeLDF_PUBLIC#de ne!_GNU_SOURCE#de ne!LDF_GCC_3_3#undef *LDF_GCC_2_95#undef *__DECCXX_y{ b> -cmmi10=JustUUtobGeextrasure.q[LDFT2003.09.03.]U$=#else&=DoUUnothing.o=#endif#ifdefe__DECCXX#de ne!__USE_STD_IOSTREAM =NeededUUfor"sstream"bGelow.o=#endif#include'~#include'~#include'~#ifdefe__GNUC__#if HAVE_FLOAT_H#include'~ḵ=[LDFT2002.12.13.]T7NeededUUforFLT_MAX(.o=#endif#endif#include'~#include'~#include'~#ifdefeLDF_GCC_2_95ng=F*orUUstreamformatting.q[LDFT2003.08.14.]U$=#include'~#else#include'~#endif#include'~#include'~#ifdefe__DECCXX#include'~#else#ifdefeLDF_GCC_3_3#include'~#else#ifdefeLDF_GCC_2_95#if HAVE_LIMITS_H#include'~#endif#endif#endif#endif#include'~#include'~#ifdefeLDF_GCC_3_3#include'~1n썷x73DLDFPRÎG4LIBRARJYXFILES5n@P#else #ifdefeLDF_GCC_2_95#include'~#endif#endif#include'~#include'~#include'~#ifdefe__GNUC__#include'~#endif#if HAVE_STDLIB_H#include'~#endif8. streambuf.hKisincludedabGove,ifKLDF_GCC_2_95HpisKde ned,insteadofios,whichisincludedinallotherUUcases.q[LDFT2003.08.14.]hloader.h56i+#include'~#include'~#include'~8Jn썫6LIBRARJYXFILES43DLDFPRÎGx9n@P9.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.07.18.]XyAdded\usingnamespaceW|stde$".KThisisneededwithGCCv3.3,SbutnotwithGCC2.95orUUtheDECC++compiler.Ȅ` 8EndTLogA>`hloader.h56i+ -using(Snamespaceastdq;10. GlobalTitems(pspglb.web).$ITypGedefs,UUglobalvqariablesandconstants,andsomenon-classfunctions.q(pspglb.web.)c9Ȅ`> 8BeginTLogJʄ`> +cmmi10=JustUUtobGeextrasure.q[LDFT2003.09.03.]U$=#else&=DoUUnothing.o=#endif#ifdefe__DECCXX#de ne!__USE_STD_IOSTREAM =NeededUUfor"sstream"bGelow.o=#endif#include'~#include'~#include'~#ifdefe__GNUC__#if HAVE_FLOAT_H#include'~ḵ=[LDFT2002.12.13.]T7NeededUUforFLT_MAX(.o=#endif#endif#include'~#include'~#include'~#ifdefeLDF_GCC_2_95ng=F*orUUstreamformatting.q[LDFT2003.08.14.]U$=#include'~#else#include'~#endif#include'~#include'~#ifdefe__DECCXX#include'~#else#ifdefeLDF_GCC_3_3#include'~#else#ifdefeLDF_GCC_2_95#if HAVE_LIMITS_H#include'~#endif#endif#endif#endif#include'~#include'~#ifdefeLDF_GCC_3_3#include'~0n썷x73DLDFPRÎG4LIBRARJYXFILES5n@P#else #ifdefeLDF_GCC_2_95#include'~#endif#endif#include'~#include'~#include'~#ifdefe__GNUC__#include'~#endif#if HAVE_STDLIB_H#include'~#endif8. streambuf.hKisincludedabGove,ifKLDF_GCC_2_95HpisKde ned,insteadofios,whichisincludedinallotherUUcases.q[LDFT2003.08.14.]hloader.h56i+#include'~#include'~#include'~7ˠn썫6LIBRARJYXFILES43DLDFPRÎGx9n@P9.9Ȅ`+U 8Log)j`+U +[LDFT2003.07.18.]XyAdded\usingnamespaceW|stde$".KThisisneededwithGCCv3.3,SbutnotwithGCC2.95orUUtheDECC++compiler.Ȅ`Ghloader.h56i+ +using(Snamespaceastdq;10. GlobalTitems(pspglb.web).$ITypGedefs,UUglobalvqariablesandconstants,andsomenon-classfunctions.q(pspglb.web.)N99Ȅ`+U 8Log)j`+U [LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.1.qThey'restillusedinmydevelopmentversions. -[LDFT2003.12.01.]Y$PutR>theversioncontrolidenti ersbackintothereleaseversions,RbGecauseI'veputtheminUUtheirownRCSrepGository*.Ȅ` 8EndTLogA>`hV*ersionUUcontrolidenti er@10i -static)HstringJn'r}'csffidg(="$Id: pspglb.web,v 1k.5 2003/12/01 19:56:Ơ32 lfinsto1 Exp $"3ҫ; See -alsosections37,C54,120,196,205,262,591,615,652,935,970,1054,1096,1229,1275,1289,1398,1406,1424,1490, -andX1497.Thisco 8BeginTLogJʄ`> +[LDFT2003.12.01.]Y$PutR>theversioncontrolidenti ersbackintothereleaseversions,RbGecauseI'veputtheminUUtheirownRCSrepGository*.Ȅ`GhV*ersionUUcontrolidenti er@10i +static)HstringJn'r}'csffidg(="$Id: pspglb.web,v 1k.10 2003/12/10 16:34Ơ:02 lfinsto1 Exp $"9 ϫ; See +alsosections37,C54,120,196,205,262,591,615,652,938,973,1057,1101,1234,1280,1294,1403,1411,1429,1495, +andX1502.Thisco See +alsosections38,C55,121,197,206,263,592,616,653,939,974,1058,1102,1235,1281,1295,1404,1412,1430,1496,andX1503.Thisco` -format3c(r}'ealL o}'at +[LDFT2003.06.03.]Y;AddedUUr}'ealffshort-Ȭ.qIt'sUUthereturntypGeofPlane!6::getffdistanc}'e5y().Ȅ`G +format3c(r}'ealL o}'at format3c(r}'ealffpairaqr}'eal format3c(b}'oolffpairbVr}'ealffpair -format3c(r}'ealffpairaqr}'ealffshort -format3c(MatrixZ int;]n썷x123DLDFPRÎGTYPEXDEFINITIONS7n@P#de ne/|LDF_REAL_FLOATd1 #de ne/|LDF_REAL_DOUBLE 0΍hTypGeUUde nitions@12i#if LDF_REAL_FLOAT +format3c(r}'ealffpairaqr}'ealffshort:ޠn썷x123DLDFPRÎGTYPEXDEFINITIONS7n@P +format3c(MatrixZ int #de ne/|LDF_REAL_FLOATd1#de ne/|LDF_REAL_DOUBLE 0hTypGeUUde nitions@12i#if LDF_REAL_FLOAT t9ypQedef4_ oatN{realaق;#elif,LDF_REAL_DOUBLE t9ypQedef4_doubleYrealm;#else t9ypQedef4_ oatN{realaق;#endif @@ -94,42 +94,59 @@ t9ypQedef4_pairH۫hreal]ٱ;realiUUrealus4wpair/p; t9ypQedef4_pairH۫hreal]ٱ;signed%short?iUUrealus4wshort5i; t9ypQedef4_pairH۫hbQoolL;bQooliUUbQoolus4wpair2^; -t9ypQedef4_pairH۫hbQoolL;realiUUbQoolus4wreal1@; ΍SeeXalsosections267,268,270,and272.ThisXco 8BeginTLogJʄ`> +g; ThisXco`hGlobalUUvqariables@15i -v\ralarra9y3ZBhreal]ٷiUUnullffc}'oordinatesIb:(4);#ifdefe__DECCXX +AItalsodoGesn'tworktouseMAX_REAL5/=INVALID_REALI ^r}'ealfflimits,#:min%().Ȅ`GhGlobalUUvqariables@15i +v\ralarra9y3ZBhreal]ٷiUUnullffc}'oordinatesIb:(4); SeeXalsosections16,17,39,189,257,and586.ThisXco 8BeginTLogJʄ`> -[LDFT2003.08.14.]Y;AddedUUVERBOSE_GLOBALPandUUSILENT_GLOBALH.Ȅ` 8EndTLogA>`hGlobalUUvqariables@15i+ +extern.constLHyrealbINVALID_REALI=r}'ealfflimits/;:max();#else#if LDF_REAL_DOUBLE +extern.constLHyrealbINVALID_REALI=DBL_MAX( k;#else&=LDF_REAL_FLOATO;,UUornotspGeci ed.qLDF2003.12.08.o= +extern.constLHyrealbINVALID_REALI=FLT_MAX( k;#endif#endif#if LDF_REAL_DOUBLE +real /d(=INVALID_REALBM\; +real /%0dp3ך=& +6d¨; +unsigned:7longS]longlqip}=rein9terpretus4wcastRhunsigned07longI]longbgi(dp ]R); +unsigned:7longS]longlir=(ipQ)=l1m; +bitset&ܷh888sizeofC(unsigned07longI]long_/1)iUUb +g=i9 ; +extern.constLHyrealbMAX_REALI=(rein9terpretus4wcastO}hreal./i(&i 9));#else&=LDF_REAL_FLOATO;,UUornotspGeci ed.qLDF2003.12.08.o= +real /f)s-=INVALID_REALBM\; +real /%0fp1:=& +6f; +unsigned:7longS]˷X]ipdv֫=rein9terpretus4wcastRhunsigned07longI]ʷN]i(fp Q); +unsigned:7longS]˱iY׫=(ipQ)=l1m; +bitset&ܷh888sizeofC(unsigned07longFu)iUUb +g=i9 ; +extern.constLHyrealbMAX_REALI=(rein9terpretus4wcastO}hreal./i(&i 9));#endif Uwn썷x173DLDFPRÎG 8BeginTLogJʄ`> -[LDFT2003.08.14.]Y;AddedUUVERSION_3DLDFKpandUUCOPYRIGHT_3DLDFR.Ȅ` 8EndTLogA>`hGlobalUUconstants@19i -extern.constLHystringmmVERSION_3DLDF="1.1.3"( k; +extern.bQoolG=SILENT_GLOBAL~; SeeXalsosections20,23,27,190,192,258,275,587,611,and648.ThisXco 8BeginTLogJʄ`> -[LDFT2003.11.28.]YiChanged3VERSION_3DLDFM-Gfrom3areal߫toastring"{. RThisisnecessary*,kbGecauseI3JnowhaveUUversionswiththreedigitsseparatedbypGeriods.Ȅ` 8EndTLogA>`hDeclarationsUUfortheheader le@18i+ +extern.constMstringo}DISCLAIMER_3DLDF ="3DLDF comes with ABlSOLUTELY NO WARRANTYY\;\nfor details see the file COPYING,\nwhich you should have XOreceived\nin the dis\tribution of 3DLDF 1.1.4\nThis is free software, and you areXO welcome\nto redistr\ibute it under certain conditions;\nfor details, again, see XOthe file COPYING.\n\\nPlease send bug reports to the author at:\n\nEmail: lfinXOsto1@gwdg.de\n \ or s246794@stud.uni-goettingen.de\nWeb site: http:://wwwXOuser.gwdg.de/~lfinsto1"Er; SeeXalsosections25,26,115,191,and274.ThisXco 8BeginTLogJʄ`> -[LDFT2003.08.14.]ZpPutthisfunctiondeclarationinhDeclareutilityfunctions@21i.F*ormerly,itwasinhDeclarationsUUfortheheader le@18i. -Changed9theconditionalfrom#ifdefŝ__GNUC__Hzto#ifdefŝLDF_GCC_2_95ZK,?bGecausethelibraryversionoftrunc4;()UUisfoundwhencompilingwithGCC3.3underLinux.Ȅ` 8EndTLogA>`hDeclareUUutilityfunctions@21i#ifdefeLDF_GCC_2_95 -double/JGtruncG~(double%JFd*~);#endif SeeXalsosections29and31.ThisXco 8BeginTLogJʄ`> -[LDFT2003.08.14.]ZePutthisfunctionde nitionintohDe neutilityfunctions@22i. pEF*ormerly,j itwasinhGlobalUUvqariables@15i.Ȅ` 8EndTLogA>`hDe neUUutilityfunctions@22i #ifdef LDF_GCC_2_95nW=*KLUDGE!![LDFT2002.12.1.]Otruncg()isn'tavqailableontheLinuxmachinegwdg-wb02.gwdg.de!qFindUUoutwhynot!o= +extern.constLHystringmmDISCLAIMER_3DLDF; +gn썫10FÎORXCOMPILAJTION<3DLDFPRGx21n@P21. TODO:)Findoutwhythelibraryversionoftrunc"d()can'tbGefoundintheversionforGCC2.95under Linux!q[LDFT2002.12.10.] +TheUUproblemdoGesn'texistforGCC3.3underLinux.q[LDFT2003.08.14.]N99Ȅ`+U 8Log)j`+U +[LDFT2003.08.14.]ZpPutthisfunctiondeclarationinhDeclareutilityfunctions@21i.F*ormerly,itwasinhDeclarationsUUfortheheader le@18i. +Changed9theconditionalfrom#ifdefŝ__GNUC__Hzto#ifdefŝLDF_GCC_2_95ZK,?bGecausethelibraryversionoftrunc4;()UUisfoundwhencompilingwithGCC3.3underLinux.Ȅ`GhDeclareUUutilityfunctions@21i #ifdefeLDF_GCC_2_95 +double/JGtruncG~(double%JFd*~);#endif SeeXalsosections29and31.ThisXcovqalue. -MAX_REAL_SQRTPaisconvenientptohavepfortestingwhencomputingUUdistances.U9Ȅ`> 8BeginTLogJʄ`> +MAX_REAL_SQRTPaisconvenientptohavepfortestingwhencomputingUUdistances.9Ȅ`+U 8Log)j`+U [LDFT2002.09.25.]YAdded0 thissection.Previously*,fI/declaredandinitializedmyglobalconstantsintheheader%> le. Thismeantthateachcompilationunitthatloadedpspglb.hhaditsownversionofPI+,INVALID_REAL?D,ketc.aIRdidn'tgknowthatc}'onsts":hadinternallinkqagebydefaultandthatIRcouldmaketheirlinkqage externalbyusingextern(Ɨinthedeclarationwiththeinitialization,)yandputaseconddeclaration,alsoUUwithextern$֫,intheheader le.qThisiswhatI'vedonenow. -[LDFT2003.06.03.]Y;AddedUUINVALID_REAL_SHORTb[.Ȅ` 8EndTLogA>`25. F +[LDFT2003.06.03.]Y;AddedUUINVALID_REAL_SHORTb[.Ȅ`G25. F orTcompilation.hGlobalUUconstants@19i+ -extern.constLHyrealbPIp!=4:08atan(1:0 ); omn썷x253DLDFPRÎG 8BeginTLogJʄ`> -[LDFT2003.06.1.]Th=ChangedUUreturntypGefrompairfhreal]ٱ;realitorealus4wpair/p,whichisequivqalent.Ȅ` 8EndTLogA>`hDeclareUUutilityfunctions@21i+ -realus4wpair9psolveffquadr}'atic{%<(real.a^;real]ֱb;real]ֱc); ~n썫12SOL8VEXQUADRAJTICEQUATION璘3DLDFPRÎGx30n@P30.hDe neUUutilityfunctions@22i+ +extern.constLHyrealbMAX_REAL_SQRT;28. Utilit9yTfunctions.29. Solv9equadraticequation.[LDFT2002.09.03.]ZlTO9+DO:93MaybGeaddfunctionsforsolvingcubicandquarticUUequations,ifthisispracticable.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.1.]Th=ChangedUUreturntypGefrompairfhreal]ٱ;realitorealus4wpair/p,whichisequivqalent.Ȅ`GhDeclareUUutilityfunctions@21i+ +realus4wpair9psolveffquadr}'atic{%<(real.a^;real]ֱb;real]ֱc); n썷x303DLDFPRÎG璘SOL8VEXQUADRAJTICEQUATION13n@P30.hDe neUUutilityfunctions@22i+ realus4wpair9psolveffquadr}'atic{%<(real.a^;real]ֱb;real]ֱc) frealus4wpairCppHx;try)3fp#: rst|«=(bJ+8sqrt٫((b8b)8(48a c)))=(2a);gcatc9h.׫(:::)fp#: rst|«=INVALID_REALBM\;gtry)3fp#:se}'cond n߫=(bJ8sqrt٫((b8b)8(48a c)))=(2a);gcatc9h.׫(:::)fp#:se}'cond n߫=INVALID_REALBM\;greturn7漱p<; g31. Dynamic{TalloQcation.[LDFT2002.10.02.][TODO:T*rytogetthistowork."Ihaven'tbGeenabletogetUUthistemplatefunctiontoinstantiatecorrectly*.hDeclareUUutilityfunctions@21i+#if 0 template6_hclassQC"iUUC 2!2"cr}'eateffnew?(C -8c Sӫ=0);#endif ؠn썷x323DLDFPRÎGDYNAMICXALLOCAJTION13n@P32.hDe neUUutilityfunctions@22i+ #if 0 +8c Sӫ=0);#endifn썫14DÎYNAMICXALLOCAJTION3DLDFPRGx32n@P32.hDe neUUutilityfunctions@22i+ #if 0 template6_hclassQC"iUUC 2!2"cr}'eateffnew?(C 8c) fc}'out* Q"In create_new.\n"db ush;C8newffshap}'effptrB=newzG(C̫);if(c6=0) newffshap}'effptrJ=c ;newffshap}'effptrO~Usetffonfffr}'eeffstoreOl(trueĘ);return7newffshap}'effptruN; g#endif33. F -orw9ardfdeclarations.[LDFT2002.10.16.]Z/InwNthe lesthatarecompiled rst,someclassesrefertoother[classesthathaven't[bGeende nedyet.]tF*orward[declarationsmakeitpossibletodothis.]tTOKDO:GETCIT*ATIONUUfromStroustrup.U9Ȅ`> 8BeginTLogJʄ`> +orw9ardfdeclarations.[LDFT2002.10.16.]Z/InwNthe lesthatarecompiled rst,someclassesrefertoother[classesthathaven't[bGeende nedyet.]tF*orward[declarationsmakeitpossibletodothis.]tTOKDO:GETCIT*ATIONUUfromStroustrup.9Ȅ`+U 8Log)j`+U [LDFT2002.04.10.]YAdded"theforwarddeclarationofbQoolus4wrealus4pQoin9tQq.It'sneededbGecauseit'susedasthesreturnvqalueofP9oint::interse}'ctionffpointNګ(),whichis,ofcourse,declaredwithinthedeclarationofclassP9ointH.g~However,&abQoolus4wrealus4pQoin9tUTcanonlybGede nedafterP9oint$isde ned.ThisforwarddeclarationsolvesUUtheproblem. -[LDFT2003.07.16.]XAdded;forwarddeclarationofEllipse%$.iHIt'sneeded,@bGecauseI'vedeclaredEllipse(`tobGea!friend$Sof!P9athx.`\F*ormerly,+Circle$ǫwas!afriendofP9athx,+butnowitmustbGeEllipse% ,+becauseI'vemadetheUU\segment"functionsse}'gment'J(),half(),andquarter$Z()membGersofEllipse(insteadofCircle!.Ȅ` 8EndTLogA>`hF*orwardUUdeclarations@33i +[LDFT2003.07.16.]XAdded;forwarddeclarationofEllipse%$.iHIt'sneeded,@bGecauseI'vedeclaredEllipse(`tobGea!friend$Sof!P9athx.`\F*ormerly,+Circle$ǫwas!afriendofP9athx,+butnowitmustbGeEllipse% ,+becauseI'vemadetheUU\segment"functionsse}'gment'J(),half(),andquarter$Z()membGersofEllipse(insteadofCircle!.Ȅ`GhF*orwardUUdeclarations@33i struct+bQoolus4wpoin9t`>; struct+bQoolus4wrealus4pQoin9txY; class$RCircleCC~; @@ -185,29 +202,31 @@ hUtilityUUclasses@13i hGlobalUUvqariables@15i hGlobalUUconstants@19i -hDe neUUutilityfunctions@22iŠn썫14PUTTINGXPSPGLBTOGETHERV\3DLDFPRÎGx36n@P36. ThisUUiswhat'swrittentothepspglb.h.hpspglb.h536i +hDe neUUutilityfunctions@22in썷x363DLDFPRÎGV\PUTTINGXPSPGLBTOGETHER15n@P36. ThisUUiswhat'swrittentothepspglb.h.hpspglb.h536i hTypGeUUde nitions@12i hUtilityUUclasses@13i hDeclarationsUUfortheheader le@18i=ThisUUdoGesn'twork,apparentlybGecauseit'sincompatiblewiththeuseofsstream.o=#if 0#ifdefe__DECCXXYg=UsingUUtheDECC++uCompiler.o= const(*real>PILK=__CXXL_PI2e;#endif#endif hDeclareUUutilityfunctions@21i -hF*orwardUUdeclarations@33i37. I/O(io.web).c9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions.Ȅ` 8EndTLogA>`hV*ersionUUcontrolidenti er@10i+38. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~39. Globalv\rariables.[LDFT2002.10.16.]Zp:inffstr}'eamis=Yaninputstreamattachedtoa lewithusercoGdeforvinput.թCurrently*,~itisused,butitful llsnousefulfunction,bGecauseIvhaven'tvde nedaninputroutineyet./Soutffstr}'eam5isanoutputstreamattachedtothe leofMET*APOSTcoGdethat3DLDFcurrentlyproGducesasswitsoutput.-texffstr}'eam6Cisanoutputstreamattachedtoa leofTU>VExXKcoGde.-TheusercanwriteTU>VExXcoGdetoUUthis leandloaditintopersp.texoruseitforsomeotherpurpGose.q3DLDFmakesnouseofititself.r9Ȅ`> 8BeginTLogJʄ`> +hF*orwardUUdeclarations@33i37. I/O(io.web).N99Ȅ`+U 8Log)j`+U +[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions. +[LDFT2003.12.10.]YQPuttheversioncontrolidenti ersbackintomyreleaseversionsfor3DLDF1.1.4.MI'vealready"putsomeofthembackin,,nowI'mdoingtherestofthem.`However,,thereleaseversionsarenowintheirUUownRCSrepGository*.Ȅ`GhV*ersionUUcontrolidenti er@10i+ +static)HstringJn'r}'csffidg(="$Id: io.web,v 1.2 2k003/12/10 15:39:40 lƠfinsto1 Exp $"ޫ;38. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~39. Globalv\rariables.[LDFT2002.10.16.]Zp:inffstr}'eamis=Yaninputstreamattachedtoa lewithusercoGdeforvinput.թCurrently*,~itisused,butitful llsnousefulfunction,bGecauseIvhaven'tvde nedaninputroutineyet./Soutffstr}'eam5isanoutputstreamattachedtothe leofMET*APOSTcoGdethat3DLDFcurrentlyproGducesasswitsoutput.-texffstr}'eam6Cisanoutputstreamattachedtoa leofTU>VExXKcoGde.-TheusercanwriteTU>VExXcoGdetoUUthis leandloaditintopersp.texoruseitforsomeotherpurpGose.q3DLDFmakesnouseofititself.9Ȅ`+U 8Log)j`+U [LDFT2002.08.30.]Y]Added wtexffstr}'eam6bso wthatI HcanincludeTU>VExXKcoGdeinmyusercode..Codewrittenby3DLDFY`toYtexffstr}'eam2willYbGeloadedbypersp.tex,orwhateverTU>VExXO leincludesthePostScript legeneratedbyMET*APOSTϸfromtheoutputof3DLDF.UsercoGdeiscurrentlyinmain.web.EIInproGductionversionsusercoGdeUUwillbeinuser.web. -[LDFT2003.07.16.]Y;AddedUU gffnum%(.Ȅ` 8EndTLogA>` -format3c(ifstr}'eam__int +[LDFT2003.07.16.]Y;AddedUU gffnum%(.Ȅ`G +format3c(ifstr}'eam__int format3c(ofstr}'eamainthGlobalUUvqariables@15i+ ifstream6,inffstr}'eam`Y; -ofstream9\doutffstr}'eamh; -ofstream9\dtexffstr}'eamg_ث; -unsigned:7shortX gffnumzZ;n썷x403DLDFPRÎGZ:GLOBALXV8ARIABLES15n@P40. extern/ҫdeclarationsUUfortheglobalvqariables.hextern%~vqariableUUdeclarations@40i +ofstream9\doutffstr}'eamh;n썫16GLOBALXV8ARIABLESZ:3DLDFPRÎGx39n@P +ofstream9\dtexffstr}'eamg_ث; +unsigned:7shortX gffnumzZ;40. extern/ҫdeclarationsUUfortheglobalvqariables.hextern%~vqariableUUdeclarations@40i extern.ifstreamZinffstr}'eam/; extern.ofstream]z:outffstr}'eam֫; extern.ofstream]z:texffstr}'eam}; -extern.unsigned^Tshort| gffnumx[; ThisXco 8BeginTLogJʄ`> -[LDFT2003.08.29.]Y;Changed,UUsothatinffstr}'eam0׫isn'topGened.Ȅ` 8EndTLogA>`hDeclareUUI/Ofunctions@42i -v9oid#oinitializeffioV(string!dinffstr}'eamffnamefk;string#B outffstr}'eamffnamem;string#B texffstr}'eamffnamelrZ;c9har#pr}'ogramffnamebv); SeeXalsosections45,47,and49.ThisXcoO(asctime":(ltVe));datestampK:er}'ase^/(datestamp-:size\()818);=RemoveUUterminalline-feed.o= SeeXalsosections44,46,48,and50.ThisXcoO(asctime":(ltVe));datestampK:er}'ase^/(datestamp-:size\()818);=RemoveUUterminalline-feed.o= SeeXalsosections44,46,48,and50.ThisXco޷"%% End:"5T}endlendlګ;texffstr}'eamGc`;"\n\n%% L"?`;"ocal Variables:\n"o`;"%% mode:tex\n"Z("%% eval:(local-set-key [f9] 'mp-file)\n""%% run-mp-on-file:\kY"persp.mp\"\n",("%% run-cweb-on-file:\"main.web\"\n"Y"%% run-tex-on-file:lY\"persp.tex\"\n"9("%% run-dvips-on-file:\"persp.ps\"\n""%% End:\n"= _;#endifreturn4g; -g47. BeginT gure.U9Ȅ`> 8BeginTLogJʄ`> +g47. BeginT gure.9Ȅ`+U 8Log)j`+U [LDFT2003.07.16.]YUAdded,osilent!argument,b6and,oamessageprintedconditionallytostdout,b6sayingwhich gureUUisbGeingstarted.qThisshouldhelpin ndingwhereerrorsoccur. [LDFT2003.07.16.]Y;MadeUUnon-inline. -[LDFT2003.08.17.]Y;MadeUUsilentanon-constM.qSettingUUittotrue,ifSILENT_GLOBALKpistrue.Ȅ` 8EndTLogA>`hDeclareUUI/Ofunctions@42i+ -v9oid"b}'egin gDz(unsigned07shortNiQs;bQoolLsilent6:=falsev\);n썫18BEGINXFIGURE,\3DLDFPRÎGx48n@P48.hDe neUUI/Ofunctions@43i+ +[LDFT2003.08.17.]Y;MadeUUsilentanon-constM.qSettingUUittotrue,ifSILENT_GLOBALKpistrue.Ȅ`GhDeclareUUI/Ofunctions@42i+ +v9oid"b}'egin gDz(unsigned07shortNiQs;bQoolLsilent6:=falsev\);ĕn썷x483DLDFPRÎG,\BEGINXFIGURE19n@P48.hDe neUUI/Ofunctions@43i+ v9oid"b}'egin gDz(unsigned07shortNiQs;bQoolLsilent4") fif(SILENT_GLOBALDA)silent ~,=true; gffnum9=i9 ;outffstr}'eamF"beginfig("?w gffnum'");\n""n;if(:silent)c}'out O"Beginning figure "i_ gffnum'"."ԏendl ush;return4g; -g49. End= gure.Theјunsigned2shortOϫargumentјis\syntacticsugar".EIt'signoredbyend g(),butmaybGeUUconvenientforauserforkeepingtrackofwhat gureisbGeingended.U9Ȅ`> 8BeginTLogJʄ`> +g49. End= gure.Theјunsigned2shortOϫargumentјis\syntacticsugar".EIt'signoredbyend g(),butmaybGeUUconvenientforauserforkeepingtrackofwhat gureisbGeingended.9Ȅ`+U 8Log)j`+U [LDFT2003.07.16.]YUAdded,osilent!argument,b6and,oamessageprintedconditionallytostdout,b6sayingwhich gureUUisbGeingended.qThisshouldhelpin ndingwhereerrorsoccur. [LDFT2003.07.16.]Y;MadeUUnon-inline. -[LDFT2003.08.17.]Y;MadeUUsilentanon-constM.qSettingUUittotrue,ifSILENT_GLOBALKpistrue.Ȅ` 8EndTLogA>`hDeclareUUI/Ofunctions@42i+ +[LDFT2003.08.17.]Y;MadeUUsilentanon-constM.qSettingUUittotrue,ifSILENT_GLOBALKpistrue.Ȅ`GhDeclareUUI/Ofunctions@42i+ v9oid"end g=^(unsigned07shortNiT:=0;bQoolLsilent6:=falsev\);50.hDe neUUI/Ofunctions@43i+ v9oid"end g=^(unsigned07shortNiQs;bQoolLsilent4") fif(SILENT_GLOBALDA)silent ~,=true;outffstr}'eamF"endfig"0";\n"q;if(:silent)c}'out O"Ending figure "Zh gffnum'"."ԏendlendl ush;return4g; @@ -238,24 +257,26 @@ hIncludeUU les@11i hV*ersionUUcontrolidenti er@10i hGlobalUUvqariables@15i -hDe neUUI/Ofunctions@43iCn썷x533DLDFPRÎG&PUTTINGXI/OTOGETHER19n@P53. ThisUUiswhat'swrittentoio.h.hio.h 53i +hDe neUUI/Ofunctions@43in썫20PUTTINGXI/OTOGETHER&3DLDFPRÎGx53n@P53. ThisUUiswhat'swrittentoio.h.hio.h 53i hextern%~vqariableUUdeclarations@40i -hDeclareUUI/Ofunctions@42i54. Color(colors.web).c9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions.Ȅ` 8EndTLogA>`hV*ersionUUcontrolidenti er@10i+55. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"56. Colorxclassde nition.[LDFT2002.09.25.][f!!WRemembGertochangetheconstructors,settingfunc-tions,UUandassignmentopGeratorifIaddorchangeanythinghere!!hDe neUUclass5Color>H56i +hDeclareUUI/Ofunctions@42i54. Color(colors.web).N99Ȅ`+U 8Log)j`+U +[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions. +[LDFT2003.12.10.]YQPuttheversioncontrolidenti ersbackintomyreleaseversionsfor3DLDF1.1.4.MI'vealready"putsomeofthembackin,,nowI'mdoingtherestofthem.`However,,thereleaseversionsarenowintheirUUownRCSrepGository*.Ȅ`GhV*ersionUUcontrolidenti er@10i+ +static)HstringJn'r}'csffidg(="$Id: colors.web,v 1k.2 2003/12/10 15:22:Ơ33 lfinsto1 Exp $"3ҫ;55. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"56. Colorxclassde nition.[LDFT2002.09.25.][f!!WRemembGertochangetheconstructors,settingfunc-tions,UUandassignmentopGeratorifIaddorchangeanythinghere!!hDe neUUclass5Color>H56i class$RColorDEfstring5%OnameMS;bQool-huseffnameX#;bQool-honfffr}'eeffstoreeFZ;=LDFUU2002.10.06.qAdded.o=real*0r}'edffpartM;real*0gr}'eenffpartW;real*0blueffp}'artR6.; public)=֫:hDeclareUUColor"Hfunctions@58i g; ThisXco 8BeginTLogJʄ`> -[LDFT2002.09.25.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUColor"Hfunctions@58i+ +g SeeXalsosections61,64,66,69,71,74,76,78,81,83,85,87,89,91,93,101,106,and108.ThisXcoJ=c:getffblueffp}'art7();if(nDz6=""Z^8u vtrue)fuseffnameKIe=true;gelse+useffnameY"C=falsev\;onfffr}'eeffstoreNl =falsev\;=LDFUU2002.10.06.qAdded.o=return4g; g62. NameTandunsignedshortargumen9ts.63. Constructor.hDeclareUUColor"Hfunctions@58i+ -Color&O(const]string?nE;const unsignedPqNshortnnlrs8;const unsignedPqNshortnnlgsO;const unsignedPqNshortb"J;constJbQool9vuAF=true);n썷x643DLDFPRÎG)B|CONSTRUCTOR21n@P64.hDe neUUColor"Hfunctions@59i+ +Color&O(const]string?nE;const unsignedPqNshortnnlrs8;const unsignedPqNshortnnlgsO;const unsignedPqNshortb"J;constJbQool9vuAF=true);Tn썫22CONSTRÎUCTOR)B|3DLDFPRGx64n@P64.hDe neUUColor"Hfunctions@59i+ Color'O::ColorO(constGNstring?GnE;constunsignedPEshortn,rr;constunsignedPEshortn,gsM;constunsigned2shortOʨbTR;constJbQool9vu?0.) :qname7˫(n)UUfname/=nDz;if(nDz6=""Z^8u vtrue)fuseffnameKIe=true;gelse+useffnameY"C=falsev\;onfffr}'eeffstoreNl =falsev\;=LDFUU2002.10.06.qAdded.o=r}'edffpart:=r,=255:0!;gr}'eenffpartCȦ=g=255:0!;blueffp}'art>J=b=255:0!; @@ -265,16 +286,16 @@ fname/=nDz;if(nDz6=""Z^8u vtrue)fuseffnameKIe=true;gelse+useffnameY"C=falsev\;r}'edffpart:=r,=255:0!;gr}'eenffpartCȦ=g=255:0!;blueffp}'art>J=b=255:0!; g67. Threerealargumen9ts.[LDFT2002.10.09.][1`Addedthefollowingconstructorandsettingfunction.They areforunnamedColors$⾫.tTheDEC compilercan'tdistinguishbGetween realqand unsigned4shortarguments,so/theoverloadedfunctionsmustdi erinanotherway*.IInthiscase,theseversionshavenonameargument.I:bGelieveSthatusersaremostlikelytodeclareColors(CusingrealargumentswhentheyplantomoGdifythem,*xinwhichcasetheoutput /()functionshouldwritethered,greenandbluevqaluestooutffstr}'eamrathere*thanname+..EIfitturnsouttobGenecessary*,imoreconstructorscanbeaddedortheexistingonescanbGeUUchanged.68. Constructor.hDeclareUUColor"Hfunctions@58i+ -Color&O(const*real4бr9;constJreal6xg;[;constJreal6xb:");Ơn썫22CONSTRÎUCTOR)B|3DLDFPRGx69n@P69.hDe neUUColor"Hfunctions@59i+ +Color&O(const*real4бr9;constJreal6xg;[;constJreal6xb:");n썷x693DLDFPRÎG)B|CONSTRUCTOR23n@P69.hDe neUUColor"Hfunctions@59i+ Color'O::ColorO(const*real4бr9;constJreal6xg;[;constJreal6xb:") fname/="" z;useffnameAId=falsev\;onfffr}'eeffstoreNl =falsev\;if(r,<0)fc}'err6F0"WARNING! In Color::nKColor() (three real אarguments):\n"'&Է2"Red part argument < 0. Setting red_part to 0.\n\n"Cѫ;r}'edffpartD=0;gelse*.6if5.(r,>1)fc}'err6F0"WARNING! In Color::nKColor() (three real אarguments):\n"'&Է2"Red part argument > 1. Setting red_part to 1.\n\n"Cѫ;r}'edffpartD=1;gelse+r}'edffpartQ=r,;if(g<0)fc}'err6F0"WARNING! In Color::nKColor() (three real אarguments):\n"'&Է2"Green part argument < 0. Setting green_part to 0.\n\n"Xū;gr}'eenffpartMȧ=0;gelse*.6if5.(g>1)fc}'err6F0"WARNING! In Color::nKColor() (three real אarguments):\n"'&Է2"Green part argument > 1. Setting green_part to 1.\n\n"Xū;gr}'eenffpartMȧ=1;gelse+gr}'eenffpart[=g;if(b<0)fc}'err6F0"WARNING! In Color::nKColor() (three real אarguments):\n"'&Է2"Blue part argument < 0. Setting blue_part to 0.\n\n"N˫;blueffp}'artHJ=0;gelse*.6if5.(b>1)fc}'err6F0"WARNING! In Color::nKColor() (three real אarguments):\n"'&Է2"Blue part argument > 1. Setting blue_part to 1.\n\n"N˫;blueffp}'artHJ=1;gelse+blueffp}'artV"=b«;return4g; g70. SettingTfunction.hDeclareUUColor"Hfunctions@58i+ -v9oid"set0v](const*real4бr9;constJreal6xg;[;constJreal6xb:");6n썷x713DLDFPRÎGu@SETTINGXFUNCTION23n@P71.hDe neUUColor"Hfunctions@59i+ +v9oid"set0v](const*real4бr9;constJreal6xg;[;constJreal6xb:");fn썫24SETTINGXFUNCTIONu@3DLDFPRÎGx71n@P71.hDe neUUColor"Hfunctions@59i+ v9oid"Color@M{::setx(const*real4бr9;constJreal6xg;[;constJreal6xb:") fname/="" z;useffnameAId=falsev\;onfffr}'eeffstoreNl =falsev\;if(r,<0)fc}'err6F0"WARNING! In Color::nKColor() (three real אarguments):\n"'&Է2"Red part argument < 0. Setting red_part to 0.\n\n"Cѫ;r}'edffpartD=0;gelse*.6if5.(r,>1)fc}'err6F0"WARNING! In Color::nKColor() (three real אarguments):\n"'&Է2"Red part argument > 1. Setting red_part to 1.\n\n"Cѫ;r}'edffpartD=1;gelse+r}'edffpartQ=r,;if(g<0)fc}'err6F0"WARNING! In Color::nKColor() (three real אarguments):\n"'&Է2"Green part argument < 0. Setting green_part to 0.\n\n"Xū;gr}'eenffpartMȧ=0;gelse*.6if5.(g>1)fc}'err6F0"WARNING! In Color::nKColor() (three real אarguments):\n"'&Է2"Green part argument > 1. Setting green_part to 1.\n\n"Xū;gr}'eenffpartMȧ=1;gelse+gr}'eenffpart[=g;if(b<0)fc}'err6F0"WARNING! In Color::nKColor() (three real אarguments):\n"'&Է2"Blue part argument < 0. Setting blue_part to 0.\n\n"N˫;blueffp}'artHJ=0;gelse*.6if5.(b>1)fc}'err6F0"WARNING! In Color::nKColor() (three real אarguments):\n"'&Է2"Blue part argument > 1. Setting blue_part to 1.\n\n"N˫;blueffp}'artHJ=1;gelse+blueffp}'artV"=b«; g72. Pseudo-constructorTfordynamicalloQcation.hDeclareUUColor"Hfunctions@58i+ inline)IstaticH"Colorhxmxcr}'eateffnewffc}'olor8() -fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Color::crekate_new_color().\n" ;Color38c?=newϜ(ColorO);cSݟ~Sonfffr}'eeffstoreV=true;if(DEBUGY)c}'out O"Exiting Color::creakte_new_color().\n";n썫24PSEUDO-CONSTRÎUCTORXFORDYNAMICALLOCAJTION3DLDFPRGx72n@Preturn7漱c<:; +fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Color::crekate_new_color().\n" ;Color38c?=newϜ(ColorO);cSݟ~Sonfffr}'eeffstoreV=true;if(DEBUGY)c}'out O"Exiting Color::creakte_new_color().\n";/n썷x723DLDFPRÎGPSEUDO-CONSTRUCTORXFORDYNAMICALLOCAJTION25n@Preturn7漱c<:; g73. Assignmen9t.[LDFT2002.09.24.]Z6AddedUUthisopGeratorfunction.hDeclareUUColor"Hfunctions@58i+ v9oid"opQeratorN=V[(const*Color=ϕ&EcIꎫ);74.hDe neUUColor"Hfunctions@59i+ v9oid"Color@M{::F۹opQeratorrrn=z9(const*Color=ϕ&EcIꎫ) @@ -290,7 +311,7 @@ bQool#gColor@ ::GGopQerators6=z(const*Color=ϕ&EcIꎫ)UUconst freturn7漷:(thisϷc); g79. MoQdifying.80. SetTname.hDeclareUUColor"Hfunctions@58i+ -v9oid"setffnameKt«(const*string?OsC);n썷x813DLDFPRÎG>SETXNAME25n@P81.hDe neUUColor"Hfunctions@59i+ +v9oid"setffnameKt«(const*string?OsC);n썫26SETXNAME>3DLDFPRÎGx81n@P81.hDe neUUColor"Hfunctions@59i+ v9oid"Color@M{::setffname)v(const*string?OsC) fname/=sw; g82. SetTusename.hDeclareUUColor"Hfunctions@58i+ @@ -299,12 +320,12 @@ fuseffnameAId=b«; g84. MoQdify .hDeclareUUColor"Hfunctions@58i+ -v9oid"mo}'difyACګ(const*real4бr9;constJreal6xg>ps=0;constJreal6xb=:=0);$n썫26MODIFYHJ3DLDFPRÎGx85n@P85.hDe neUUColor"Hfunctions@59i+ +v9oid"mo}'difyACګ(const*real4бr9;constJreal6xg>ps=0;constJreal6xb=:=0);Tn썷x853DLDFPRÎGHJMODIFY27n@P85.hDe neUUColor"Hfunctions@59i+ v9oid"Color@M{::mo}'difyF(const*real4бr9;constJreal6xg;[;constJreal6xb:") fr}'edffpart:+=LgrQ2;gr}'eenffpartCȦ+=Vg[>ݫ;blueffp}'art>J+=PlbT;if(r}'edffpart&>1)fc}'err3|"WARNING! In Color::kmodify():\n"8"red_part is greaterk than 1: ">r}'edffpart(ٶ2endlH߷"Setting red_part tok 1.\n\n"M,;r}'edffpartD=1;gelse*.6if5.(r}'edffpart&<0)fc}'err3#m"WARNING! In Color::l#1modify():\n"#m"red_part is less thl#1an 0: "#mr}'edffpart)`2endlH߷"Setting red_part tok 0.\n\n"M,;r}'edffpartD=0;gif(gr}'eenffpart/Ȥ>1)fc}'err4w0"WARNING! In Color::lKmodify():\n" "green_part is greatlKer than 1: "2gr}'eenffpartaȩendl"Setting green_part kto 1.\n\n"&;gr}'eenffpartMȧ=1;gelse*.6if5.(gr}'eenffpart/Ȥ<0)fc}'err3|"WARNING! In Color::kmodify():\n"8"green_part is less kthan 0: "TAgr}'eenffpart22endlH߷"Setting green_part kto 0.\n\n"&;gr}'eenffpartMȧ=0;gif(blueffp}'art*J>1)fc}'err4O"WARNING! In Color::lmodify():\n"JO"blue_part is greatelr than 1: " 2blueffp}'art\Jendl"Setting blue_part tko 1.\n\n");blueffp}'artHJ=1;gelse*.6if5.(blueffp}'art*J<0)fc}'err3"WARNING! In Color::kmodify():\n"\*"blue_part is less tkhan 0: "\6blueffp}'art-Y 2endlH߷"Setting blue_part tko 0.\n\n");blueffp}'artHJ=0;greturn4g; g86. SetTredpart.hDeclareUUColor"Hfunctions@58i+ -v9oid"setffr}'edffpartUD(const*real4бr9);Vn썷x873DLDFPRÎG,LSETXREDPJART27n@P87.hDe neUUColor"Hfunctions@59i+ +v9oid"setffr}'edffpartUD(const*real4бr9);#n썫28SETXREDPJART,L3DLDFPRÎGx87n@P87.hDe neUUColor"Hfunctions@59i+ v9oid"Color@M{::setffr}'edffpart3o(const*real4бr9) fif(r,>1)fc}'err3|׷."WARNING! In Color::kset_red_part():\n"͔R."r is greater than 1k: "~.r Xp.endl2"Setting red_part to 1.\n\n"ņ;r}'edffpartD=1;gelse*.6if5.(r,<0)fc}'err3p "WARNING! In Color::l set_red_part():\n"G "r is less than 0: "oǺ DZr  endl3P2"Setting red_part to 0.\n\n"ņ;r}'edffpartD=0;gelse+r}'edffpartQ=r,;return4g; @@ -314,7 +335,7 @@ fif(g>1)fc}'err4Y"WARNING! In Color::lYset_green_part():\n"9Y"g is greater than 1lY: "!Yg 2endlH߷"Setting green_part kto 1.\n\n"&;gr}'eenffpartMȧ=1;gelse*.6if5.(g<0)fc}'err3Ƿ"WARNING! In Color::kset_green_part():\n"L,"g is less than 0: "oLhg endl2"Setting green_part to 0.\n\n";gr}'eenffpartMȧ=0;gelse+gr}'eenffpart[=g;return4g; g90. SetTbluepart.hDeclareUUColor"Hfunctions@58i+ -v9oid"setffblueffp}'artZ1(const*real4бb9(z);%'n썫28SETXBLUEPJART'3DLDFPRÎGx91n@P91.hDe neUUColor"Hfunctions@59i+ +v9oid"setffblueffp}'artZ1(const*real4бb9(z);0Wn썷x913DLDFPRÎG'SETXBLUEPJART29n@P91.hDe neUUColor"Hfunctions@59i+ v9oid"Color@M{::setffblueffp}'art83(const*real4бb9(z) fif(b>1)fc}'err43~<"WARNING! In Color::l~set_blue_part():\n"Bk~<"b is greater than 1l~: "B~2"Setting blue_part to 0.\n\n";blueffp}'artHJ=0;gelse+blueffp}'artV"=b«;return4g; @@ -325,7 +346,7 @@ g94. ReturningTelemen9tsandinformation.95. IsTonfreestore.hDeclareUUColor"Hfunctions@58i+ inline)IbQoolC+isffonfffr}'eeffstore()UUconst freturn7onfffr}'eeffstoreo; -g96. GetWColorparts.[LDFT2002.09.24.]ZjTheseƉfunctionsalwaysƉreturnareal$b;"theargumentde}'cimalcan'tUUmakethemreturnanunsigned3cshortN./,n썷x973DLDFPRÎG*(GETXREDPJART29n@P97. GetTredpart.hDeclareUUColor"Hfunctions@58i+ +g96. GetWColorparts.[LDFT2002.09.24.]ZjTheseƉfunctionsalwaysƉreturnareal$b;"theargumentde}'cimalcan'tUUmakethemreturnanunsigned3cshortN.:\n썫30GETXREDPJART*(3DLDFPRÎGx97n@P97. GetTredpart.hDeclareUUColor"Hfunctions@58i+ inline)Ireal@=wgetffr}'edffparts(bQoolfde}'cimal>ޫ=falsev\)UUconst fif(de}'cimal"A`)return(truncA((r}'edffpart%f82558)8+:5 );else+returnOr}'edffparts !; g98. GetTgreenpart.hDeclareUUColor"Hfunctions@58i+ @@ -343,7 +364,7 @@ inline)IstringJgetffnamesV()UUconst freturn7nameP; g103. OutputTopQerator.hDeclareUUnon-membGerfunctionsforColor#103i -ostr}'eam/&8opQerator-ϕ7ϖ(ostr}'eam%&8o;constJColor?z=&GA[cK6); ThisXcoh;gif(name"" z)fc}'err8(r"ERROR! In Color::deprfine_colors_mp():\n"k2"name is empty. Not doing anything and returning.\n"K ush;return>h;goutffstr}'eamFl,""color "0ޔ,"nameH,"";","" "ޠ,"name,"" = ("&^,"getffr}'edffpart6d(),"", "(getffgr}'eenffparte5L()", "getffblueffp}'art:}ҫ()");\n"% ush;return4g; g107. InitializeColors.[LDFT2002.09.25.]\x=ThisE\functionpresuppGosestheexistenceofnamespaceColors ګ.hDeclareUUColor"Hfunctions@58i+ -static)Hv9oidBFinitializeffc}'olorsͫ();Dn썷x1083DLDFPRÎGINITIALIZEXCOLORS31n@P108.hDe neUUColor"Hfunctions@59i+ +static)Hv9oidBFinitializeffc}'olorsͫ(); On썫32INITIALIZEXCOLORS3DLDFPRÎGx108n@P108.hDe neUUColor"Hfunctions@59i+ v9oid"Color@M{::initializeffc}'olorsD() fusing2SnamespacekColorsܫ;if(:outffstr}'eam/@:isffop}'en ())fc}'err8-P"ERROR! In Color::inpPHitialize_colors():\nP "f2"out_stream is closed! Returning.\n" ush;return>h;goutffstr}'eamF"%%% Color definitiokns.\n\n"M,;#if o0$q=!t[LDFT2002.09.25.]TK%Thesevcolorsarealreadyde nedinMET*APOSTvandtheirde nitionsare(notUUlikelytochange.qHowever,iftheydo,Icancommentthesefunctioncallsbackin.o=r}'ed"s/:de neffc}'olorffmpDn();gr}'een+:de neffc}'olorffmpDn();blue&by:de neffc}'olorffmpDn();black+ ֱ:de neffc}'olorffmpDn();white,:de neffc}'olorffmpDn();b}'ackgroundEu:de neffc}'olorffmpDn();#endifyellow0k:de neffc}'olorffmpDn();cyan)w:de neffc}'olorffmpDn();magenta9Ґ:de neffc}'olorffmpDn();or}'ange2):de neffc}'olorffmpDn();violet,:de neffc}'olorffmpDn();purple097:de neffc}'olorffmpDn();yellowffgr}'eenJhl:de neffc}'olorffmpDn();gr}'eenffyellowJ:de neffc}'olorffmpDn();blueffvioletAj:de neffc}'olorffmpDn();gr}'ay':de neffc}'olorffmpDn();lightffgr}'ay>ܱ:de neffc}'olorffmpDn();violetffr}'ed=b:de neffc}'olorffmpDn();defaultffb}'ackgroundfF!:de neffc}'olorffmpDn();=[LDFT2002.09.25.]T7Currently*,UUthisfunctiondoGesnothingifI'musingallofthecolors.o=outffstr}'eamF"\n%%% End of Color kdefinitions.\n\n"ō;return4g; g109. Namespace:Colors.Here'(I'canputeitherhMa8jorColors(@112iorhAllColors(@0iintohDeclarenamespace9Colors^109i,?&and9commentouttheother,depGendingonwhatI9want.hThis9preventstoGomuchunneededcoGdefrombeingprocessed.[VhAllColors(*ޭ0iisverylong,xsoIneitherwanttocompileit,xwritetheextern#declarations,lfromittocolors.h,4norprintoutthecoGdewhenI,bruncweave,unlessI,breallywant,ltouseUUit.q[LDFT2002.09.25.]hDeclareUUnamespace 8BeginTLogJʄ`> -[LDFT2002.10.26.]Y;AddedUUhelpffc}'olor/ɫ.Ȅ` 8EndTLogA>`hMa8jorUUColors(n3112i +hMa8jorUUColors(n3112i=hAllUUColors0i= ThisXco;173;255;47 );=Orange.o=extern8constVHzColorumor}'ange("orange"*P;255;165;0;trueo@);=Violet.o=extern8constVHzColorumviolet("violet"*P;238;130;238;trueo@);extern8constVHzColorumpurple&("purple"*P;160;32 ;240;trueo@);extern8constVHzColorumblueffvioletqի("blue_violet"DA;138;43 ;226);=Green.o=extern8constVHzColorumyellowffgr}'eenU׫("yellow_green"J>;154;205;50 );=\Unbunt"UUColors(blacks,whites,andgrays).o=extern8constVHzColorumblackA("black"%FS;0;0;0;trueo@);extern8constVHzColorumwhite,("white"%FS;255;255;255;trueo@);extern8constVHzColorumgr}'ayj("gray" V;192;192;192);extern8constVHzColorumlightffgr}'ayG("light_gray"?D;211;211;211);=6Defaults.l[LDFT2002.09.27.]SdNoteEthatdefaultffc}'olor:i,Hhelpffc}'olor2Handb}'ackgroundffcolorPtarepGointers(andthatdefaultffb}'ackgroundYEūisaplainColorq.@ItcanbGeusedtoaccesstheoriginalbackground(colorUU(currentlywhite),iftheuserpGointstheb}'ackgroundffcolorPatsomeotherColor.o=extern8constVHzColorumdefaultffb}'ackground3("default_background"i,;255;255;255;trueo@);extern8constVHzColorumzndefaultffc}'olor0a=& 6black! ;extern8constVHzColorumznb}'ackgroundffcolorޫ=& 6defaultffb}'ackground\U;extern8constVHzColorumznhelpffc}'olorn=& -6gr}'een"sC;=LDFUU2002.10.26.qAdded.o==7[LDFT2002.09.25.]T!!{uTOXDO:Xdefaultffb}'ackgroundX=isXaconvenience,Y^inXcaseIchange\background"(inS8theMET*APOSTS7coGde.qCheckMETAPOSTS7doGcumentation!!qIbelieveS8ithassomethingsimilar.(=!_Zn썷x1123DLDFPRÎGINTERNALX(WITHINITIALIZAJTION)33n@P +6gr}'een"sC;=LDFUU2002.10.26.qAdded.o==7[LDFT2002.09.25.]T!!{uTOXDO:Xdefaultffb}'ackgroundX=isXaconvenience,Y^inXcaseIchange\background"(inS8theMET*APOSTS7coGde.qCheckMETAPOSTS7doGcumentation!!qIbelieveS8ithassomethingsimilar.(="jn썫34INTERNALX(WITHINITIALIZAJTION)3DLDFPRÎGx112n@P g ThisXco;extern8ColorW˷\helpffc}'olor}@;=LDFUU2002.10.26.qAdded.o=extern8ColorW˷\b}'ackgroundffcolor$; g ThisXcodeclaration@110iabGove. -@fiUUcolall.web(Commentedout).115. GlobalTconstan9ts.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.10.26.]Y;AddedUUhelpffc}'olorffvectorL(.Ȅ` 8EndTLogA>`hGlobalUUconstants@19i+ -namespaceC{ColorsgѪfextern8constVHzv9ectoru·hconst*Color=ϕBϖiUUdefaultffc}'olorffvectorXo(1;defaultffc}'olor9&);"xn썫34GLOBALXCONSTJANTS %3DLDFPRÎGx115n@Pextern8constVHzv9ectoru·hconst*Color=ϕBϖiUUhelpffc}'olorffvectorL((1;helpffc}'olor-e); =LDFUU2002.10.26.qAdded.o=extern8constVHzv9ectoru·hconst*Color=ϕBϖiUUb}'ackgroundffcolorffvectork8 (1;b}'ackgroundffcolorK); +@fiUUcolall.web(Commentedout).115. GlobalTconstan9ts.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.26.]Y;AddedUUhelpffc}'olorffvectorL(.Ȅ`GhGlobalUUconstants@19i+ +namespaceC{ColorsgѪfextern8constVHzv9ectoru·hconst*Color=ϕBϖiUUdefaultffc}'olorffvectorXo(1;defaultffc}'olor9&);#n썷x1153DLDFPRÎG %GLOBALXCONSTJANTS35n@Pextern8constVHzv9ectoru·hconst*Color=ϕBϖiUUhelpffc}'olorffvectorL((1;helpffc}'olor-e); =LDFUU2002.10.26.qAdded.o=extern8constVHzv9ectoru·hconst*Color=ϕBϖiUUb}'ackgroundffcolorffvectork8 (1;b}'ackgroundffcolorK); g116.hextern%~globalUUconstantdeclarations@116i namespaceC{ColorsgѪfextern8constVHzv9ectoru·hconst*Color=ϕBϖiUUdefaultffc}'olorffvectorXo;extern8constVHzv9ectoru·hconst*Color=ϕBϖiUUhelpffc}'olorffvectorL(;=LDFUU2002.10.26.qAdded.o=extern8constVHzv9ectoru·hconst*Color=ϕBϖiUUb}'ackgroundffcolorffvectork8 ; g ThisXcoH56i hextern%~namespace_kColors'declaration@110i hDeclareUUnon-membGerfunctionsforColor#103i hextern%~globalUUconstantdeclarations@116i120. T -ransformations(transform.web).B9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions.Ȅ` 8EndTLogA>`hV*ersionUUcontrolidenti er@10i+121. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"122. T +ransformations(transform.web).&9Ȅ`+U 8Log)j`+U +[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions. +[LDFT2003.12.10.]YQPuttheversioncontrolidenti ersbackintomyreleaseversionsfor3DLDF1.1.4.MI'vealready"putsomeofthembackin,,nowI'mdoingtherestofthem.`However,,thereleaseversionsarenowintheirUUownRCSrepGository*.Ȅ`GhV*ersionUUcontrolidenti er@10i+ +static)HstringJn'r}'csffidg(="$Id: transfor.web,vk 1.3 2003/12/10 16:5Ơ2:21 lfinsto1 Exp $">L̫;121. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"122. T ransformclassde nition.TheT ransform:classhasa4o4transformationmatrixasitsonlydataImembGerandanumbGerofmembGerfunctions.mP9oints$a,KPictures-q9,KandF;o}'cuses)containT ransforms?asdataUUmembGers. !!qRemembGerUUtoadditemstoopQerator. -=6(()ififIaddthemtotheclassde nitionhere.B9Ȅ`> 8BeginTLogJʄ`> +=6(()ififIaddthemtotheclassde nitionhere.&9Ȅ`+U 8Log)j`+U [LDFT2003.07.04.]YRemovedfriend%OdeclarationforF oQcus A.I'veaddedsetffelement6x̫()andgetffelement6(),whichUUareusedintheF oQcus#functions,sothelatterneednolongerbGeafriend$ofT -ransform7ҫ.Ȅ` 8EndTLogA>` -format3c(T;r}'ansformj|inthDe neUUclass5T +ransform7ҫ.Ȅ`G +format3c(T;r}'ansformj|inthDe neUUclass5T ransformV'122i class$RT ransform\$ffriend5fclassPG P9ointkU;Matrix;({matrixYh;=ENWhenI'vegotthingsworking,Icantrytooptimizeuseofstoragebynot(storingdthepartsofthematrixthatId don'tneed.Thisisalittlecomplicated,gbGecausetherowor(columnUUwhichisn'tneededdi ersbGetweentheaneandpGerspectiveUUtransformations.o= public)=֫:hDeclareUUT ransform;'functions@124i -g; ZThisXcos~(); ZSee?alsosections126,128,130,132,134,136,138,140,142,145,147,150,152,155,157,158,160,166,167,168,171,173,176, -178,X181,and187.$ n썫36DEF8AÎULJTXCONSTRUCTORQ3DLDFPRGx124n@PThisXcos~(); See?alsosections126,128,130,132,134,136,138,140,142,145,147,150,152,155,157,158,160,166,167,168,171,173,176, +178,X181,and187.ThisXcos~(real.r}B);127.hDe neUUT -ransform;'functions@125i+ +ransform>s~(real.r}B);127.hDe neUUT +ransform;'functions@125i+ T ransform?s::T -ransform5s(real.r}B) -ffor%舫(in9ti=0;i 9 <4;i++)for/艫(in9tjӫ=0;j w<4;j -0++)matrix#?[iq][jī]=r,; -g128. Constructor0&with16realargumen9ts.[LDFT2002.09.06.][Addedthisconstructor.Thiscon-structorUUmakesitpGossibletospecifyalloftheelementsofmatrix!.hDeclareUUT -ransform;'functions@124i+ +ransform5s(real.r}B) +ffor%舫(in9ti=0;i 9 <4;i++)for/艫(in9tjӫ=0;j w<4;j +0++)matrix#?[iq][jī]=r,; +g128. Constructor0&with16realargumen9ts.[LDFT2002.09.06.][Addedthisconstructor.Thiscon-structorUUmakesitpGossibletospecifyalloftheelementsofmatrix!.hDeclareUUT +ransform;'functions@124i+ T -ransform>s~(real͒r0ff0*ڱ;realx:r0ff1,t;realx:r0ff2;realx:r0ff3;realx:r1ff0;realx:r1ff1;realx:r1ff2;realx:r1ff3;realr2ff01K;real]r2ff1,Z;real]r2ff2;real]r2ff3;real]r3ff0;real]r3ff1;real]r3ff2;real]r3ff3);%`n썷x1293DLDFPRÎG!CONSTRUCTORXWITH16REALARÎGUMENTS37n@P129.hDe neUUT +ransform>s~(real͒r0ff0*ڱ;realx:r0ff1,t;realx:r0ff2;realx:r0ff3;realx:r1ff0;realx:r1ff1;realx:r1ff2;realx:r1ff3;realr2ff01K;real]r2ff1,Z;real]r2ff2;real]r2ff3;real]r3ff0;real]r3ff1;real]r3ff2;real]r3ff3);&n썫38CONSTRÎUCTORXWITH16REALARGUMENTS!3DLDFPRGx129n@P129.hDe neUUT ransform;'functions@125i+ T ransform?s::T @@ -449,15 +473,15 @@ 0++)matrix#?[iq][jī]=tc:matrix?[i][jī];return7漱t;.; g132. ResetTtoiden9tityTmatrix.hDeclareUUT ransform;'functions@124i+ -v9oid"r}'eset8Đ();&àn썫38RESETXTOIDENTITYMAJTRIX,53DLDFPRÎGx133n@P133.hDe neUUT +v9oid"r}'eset8Đ();'&n썷x1333DLDFPRÎG,5RESETXTOIDENTITYMAJTRIX39n@P133.hDe neUUT ransform;'functions@125i+ v9oid"T ransformXqZ::r}'esetƻ() ffor%舫(in9ti=0;i 9 <4;i++)=Rows.o=for/艫(in9tjӫ=0;j w<4;j 0++)=Columns.o=f(matrixF?[iq][jī]=(i9 jwܫ)?1 1:0;g -g134. SettingTv\ralues.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.07.04.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUT +g134. SettingTv\ralues.9Ȅ`+U 8Log)j`+U +[LDFT2003.07.04.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUT ransform;'functions@124i+ v9oid"setffelementU(const*unsignedNashortl,Sr}'ow}8;constJunsignedP Xshortmc}'ol{#ı;real]ֱr');135.hDe neUUT ransform;'functions@125i+ @@ -467,7 +491,7 @@ 1:r,;return4g; g136. Clean.cle}'an"~()UUchangeselementsinmatrix$Ewhoseabsolutevqaluesare 8BeginTLogJʄ`> -[LDFT2003.07.04.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUT +g144. Querying.145. GetTelemen9t.9Ȅ`+U 8Log)j`+U +[LDFT2003.07.04.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUT ransform;'functions@124i+ real /getffelementSݫ(const*unsignedNashortl,Sr}'ow}8;constJunsignedP Xshortmc}'ol{#ī)UUconst*;146.hDe neUUT ransform;'functions@125i+ @@ -508,7 +532,7 @@ freturn7matrixV&W[r}'ow k][c}'ol Lɫ]; g147. Sho9w.hDeclareUUT ransform;'functions@124i+ -v9oid"show9ث(string!%Mtext5D1="" z)UUconst*;)6n썷x1483DLDFPRÎGMGSHOW41n@P148.hDe neUUT +v9oid"show9ث(string!%Mtext5D1="" z)UUconst*;*on썫42SHOÎWMG3DLDFPRGx148n@P148.hDe neUUT ransform;'functions@125i+ v9oid"T ransformXqZ::show(string!%Mtext2})UUconst @@ -517,12 +541,12 @@ g149. Ane2ctransformations.[LDFT2002.10.16.]YTheǥfunctionsfortheanetransformationsallreturnaTT ransform;ѫrepresentingTthetransformation,TnotTthis@a.qThismakesitpGossibletochainexpressionsusingopQerator+=8](),UUe.g.,(P9ointFpt0VXܫ;(P9ointFpt1VXܫ(1;2;3);(P9ointFpt2VXܫ(3;4;5);(T ransform_ֱtceH;(t+v:r}'otateo>(90 -;90 ;90);(pt0:0W=Ipt1[=k}pt2}k=;t;pt0i;,UUpt1,UUandpt2areallrotated90^O!cmsy79aroundthex,y*,andz-axes.150. Scale.9Ȅ`> 8BeginTLogJʄ`> +;90 ;90);(pt0:0W=Ipt1[=k}pt2}k=;t;pt0i;,UUpt1,UUandpt2areallrotated90^O!cmsy79aroundthex,y*,andz-axes.150. Scale.9Ȅ`+U 8Log)j`+U [LDFT2002.10.15.]XBUGFIX:-Iftheabsolutevqalueofanargumentis`hDeclareUUT +[LDFT2003.03.25.]Y;BUGUUFIX:Fixedconditionalthattestswhetheralltheargumentsare1.Ȅ`GhDeclareUUT ransform;'functions@124i+ T -ransformAsc}'aleW}ū(real.xjJ;real]ֱy g=1;real]ֱz < =1);*٠n썫42SCALEKrE3DLDFPRÎGx151n@P151.hDe neUUT +ransformAsc}'aleW}ū(real.xjJ;real]ֱy g=1;real]ֱz < =1);+n썷x1513DLDFPRÎGKrESCALE43n@P151.hDe neUUT ransform;'functions@125i+ T ransformAT @@ -537,7 +561,7 @@ g152. Shear.[LDFT2002.10.15.]Z6ReplacedUUthedummyde nitionofthisfunctionwithapropGerone.hDeclareUUT ransform;'functions@124i+ T -ransformAshe}'arY (real.xy!;real]xz%=0;real]yx&Z=0;real]yz%6=0;real]zx%Y=0;real]zy%|=0);+ n썷x1533DLDFPRÎGJF-SHEAR43n@P153.hDe neUUT +ransformAshe}'arY (real.xy!;real]xz%=0;real]yx&Z=0;real]yz%6=0;real]zx%Y=0;real]zy%|=0);,n썫44SHEARJF-3DLDFPRÎGx153n@P153.hDe neUUT ransform;'functions@125i+ T ransformAT @@ -565,7 +589,7 @@ 0)return(溱t,,;tt:matrix?[3][0]=(fabs2ҫ(x)>epsګ)?x EL:0;tt:matrix?[3][1]=(fabs2ҫ(yB)>epsګ)?y (:0;tt:matrix?[3][2]=(fabs2ҫ(z)>epsګ)?z N:0;tt:cle}'anA();(this뷫)=UOt;cle}'an+A();return7漱t;.; -g,Πn썫44POINTXARÎGUMENT 3DLDFPRGx157n@P157. P9ointargument.[LDFT2002.04.24.]\2Addedthisfunction. qItmustbGede nedinpoints.web, bGecauseUUP9oint"DisUUanincompletetypehere.hDeclareUUT +g-철n썷x1573DLDFPRÎG POINTXARGUMENT45n@P157. P9ointargument.[LDFT2002.04.24.]\2Addedthisfunction. qItmustbGede nedinpoints.web, bGecauseUUP9oint"DisUUanincompletetypehere.hDeclareUUT ransform;'functions@124i+ T ransformAshiftUP(const*P9oint=?&D]pI]);158. Shiftwithm9ultiplication.[LDFT2002.08.22.]ZAdded{thisfunction.HIttakesrealUargumentsandmultipliesUUtheappropriateelementsofmatrix$Ebythem.hDeclareUUT @@ -580,7 +604,7 @@ g160. Rotationyaroundthemainaxes.r}'otate%:()willpGerformrotationaboutthex,Dyandz-axesinthat"orderifcalledwithmultiple,non-zeroarguments.QaRotationonlyabGouttheyand/orz-axisrequiresoneorUUtwodummy0argumentssothatr}'otateē()\knows"abGoutwhichaxis(oraxes)torotate.hDeclareUUT ransform;'functions@124i+ T -ransformAr}'otate\8(real.xjJ;real]ֱy g=0;real]ֱz < =0);-Rn썷x1613DLDFPRÎG7wROTJATIONXARÎOUNDTHEMAINAXES45n@P161.hDe neUUT +ransformAr}'otate\8(real.xjJ;real]ֱy g=0;real]ֱz < =0);.6n썫46RÎOTJATIONXAROUNDTHEMAINAXES7w3DLDFPRGx161n@P161.hDe neUUT ransform;'functions@125i+ T ransformAT @@ -598,7 +622,7 @@ if(y 6=0)f=!!qReversedUUdirectionofrotationbGecauseIdidn'tlikethewayitwas.o=y =+I3_gPI>eɱ=180:0!;ssin(/=sinm(yB);c}'cos)|=c}'osf(yB);for%舫(i9 =0;i 9 <4;i++)ftemp1 8BeginTLogJʄ`> +return-tffallA.d;qǷg=EndUUofr}'otateē().o=165. RotationTaroundanarbitraryaxis.166. P9ointTarguments.De nedUUinpoints.webbGecauseP9oint"Disanincompletetypehere.9Ȅ`+U 8Log)j`+U [LDFT2002.4.7.]O?AddedUUdefaultvqalueforanglej180. -[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ` 8EndTLogA>`hDeclareUUT +[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ`GhDeclareUUT ransform;'functions@124i+ T -ransformAr}'otate\8(P9ointp0+];P9oint Ep1,;constJreal6xangleQ=180);/zn썷x1673DLDFPRÎG͘P -ATHXARGUMENT47n@P167. P9athargument.[LDFT2002.05.03.][De nedlinpaths.webbGecauseP9ath!iisanincompletetype here.9Ȅ`> 8BeginTLogJʄ`> +ransformAr}'otate\8(P9ointp0+];P9oint Ep1,;constJreal6xangleQ=180);0`n썫48P +ATHXARÎGUMENT͘3DLDFPRGx167n@P167. P9athargument.[LDFT2002.05.03.][De nedlinpaths.webbGecauseP9ath!iisanincompletetype here.9Ȅ`+U 8Log)j`+U [LDFT2002.05.03.]Y;AddedUUthisfunction. -[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ` 8EndTLogA>`hDeclareUUT +[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ`GhDeclareUUT ransform;'functions@124i+ T ransformAr}'otate\8(const*P9ath:[&AypFy;constJreal6xangleQ=180);168. Alignmen9t4withanaxis.De nedinpoints.web,bGecauseitusesP9oints$,whichhaven'tbGeende nedUUyet.hDeclareUUT ransform;'functions@124i+ T -ransformAalignffwithffaxis{K(P9ointp0+];P9oint Ep1,;c9haraxis0ѫ='z' w);=DefaultUUisthez-axis.o=169. MatrixTm9ultiplication.170. WithTassignmen9t.171. realfargumen9t.[LDFT2002.11.19.][ThisfunctionmultiplieseachelementofMatrix+5bytherealargumentır ɜandreturnsrIث.ThismakesitpGossibletochaininvoGcationsofthisfunction.Notcurrentlyusedanywhere,UUbutitmayturnouttobGeusefulforsomething.U9Ȅ`> 8BeginTLogJʄ`> +ransformAalignffwithffaxis{K(P9ointp0+];P9oint Ep1,;c9haraxis0ѫ='z' w);=DefaultUUisthez-axis.o=169. MatrixTm9ultiplication.170. WithTassignmen9t.171. realfargumen9t.[LDFT2002.11.19.][ThisfunctionmultiplieseachelementofMatrix+5bytherealargumentır ɜandreturnsrIث.ThismakesitpGossibletochaininvoGcationsofthisfunction.Notcurrentlyusedanywhere,UUbutitmayturnouttobGeusefulforsomething.9Ȅ`+U 8Log)j`+U [LDFT2002.08.22.]Y;AddedUUthisfunction. -[LDFT2002.11.19.]Y;ChangedUUreturnvqaluefromUVthisatori.Ȅ` 8EndTLogA>`hDeclareUUT +[LDFT2002.11.19.]Y;ChangedUUreturnvqaluefromUVthisatori.Ȅ`GhDeclareUUT ransform;'functions@124i+ real /opQeratorLI=Y(real.r}B);172.hDe neUUT ransform;'functions@125i+ @@ -633,15 +657,15 @@ ffor%舫(in9ti=0;i 9 <4;i++)for/艫(in9tjӫ=0;j w<4;j 0++)matrix#?[iq][jī]=UOrc;cle}'an+A();return7漱r<Ы; g173. T -ransformTargumen9t.U9Ȅ`> 8BeginTLogJʄ`> +ransformTargumen9t.9Ȅ`+U 8Log)j`+U [LDFT2002.11.06.]Y"Ifoñt {isotheidentityoT ransform7@,v^itoisreturnedrightaway*.Ifothis=is,v^itissettot -{usingopQerator+=3]().TBUGFIX:Nowt ^isalwaysreturned,insteadof this.TThismakesitpGossibletochainexpressionsUUusingthisfunction.Ȅ` 8EndTLogA>`hDeclareUUT +{usingopQerator+=3]().TBUGFIX:Nowt ^isalwaysreturned,insteadof this.TThismakesitpGossibletochainexpressionsUUusingthisfunction.Ȅ`GhDeclareUUT ransform;'functions@124i+ T ransformAopQeratorm_=z&(const*T -ransformUt&]taW);0%n썫48TRANSF9ORMXARÎGUMENT3DLDFPRGx174n@P174.hDe neUUT +ransformUt&]taW);1ߠn썷x1743DLDFPRÎGTRANSF9ORMXARGUMENT49n@P174.hDe neUUT ransform;'functions@125i+ T ransformAT @@ -665,7 +689,7 @@ ransform;'functions@124i+ T ransformAopQeratorm_r_(const*T -ransformUttY)UUconst*;1n썷x1793DLDFPRÎGTRANSF9ORMXARGUMENT49n@P179.hDe neUUT +ransformUttY)UUconst*;2);n썫50TRANSF9ORMXARÎGUMENT3DLDFPRGx179n@P179.hDe neUUT ransform;'functions@125i+ T ransformAT @@ -674,12 +698,12 @@ fT ransformKԱaS=thisϫ;aJ=+t/:;aI2:cle}'anA();return7漱a=/; g180. MatrixTin9version.181. constKwv9ersion(noassignment). ItswouldbGeeasytogeneratetheinversesofthetransformations thatIwcallexplicitlyusingr}'otateh(),"shift@2(),"etc.,asIgoalong.^However,"itisnotpGossibletodothisfortheӳonesproGducedusingopQerator/jh4ji()andopQerator/jh=<1().So,Ksinceamatrixinversionӳroutineisneededanyway*,UUIdon'tbGothertogeneratetheinversesUUasIgoalong. -TO\DO:\Getformatforreferences!inverse$()usestheGau-Jordanalgorithmwithcolumnpivotsearch.I'veUUtakenthealgorithmfromStoGer,Josef.qNumerischeMathematik1[^1 ,ΫandadaptedittoC++ G .U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.12.01.]Y!!6Changedhijfromreal6toin9t'ثbGecauseofawarning,whenItriedtocompileunderGNU/Linux.qIUUthinkhi_ޫcanbGeanin9t,buttesttobesure!Ȅ` 8EndTLogA>`hDeclareUUT +TO\DO:\Getformatforreferences!inverse$()usestheGau-Jordanalgorithmwithcolumnpivotsearch.I'veUUtakenthealgorithmfromStoGer,Josef.qNumerischeMathematik1[^1 ,ΫandadaptedittoC++ G .9Ȅ`+U 8Log)j`+U +[LDFT2002.12.01.]Y!!6Changedhijfromreal6toin9t'ثbGecauseofawarning,whenItriedtocompileunderGNU/Linux.qIUUthinkhi_ޫcanbGeanin9t,buttesttobesure!Ȅ`GhDeclareUUT ransform;'functions@124i+ T -ransformAinverseaZ()UUconst*;ff= ^1 -StoGer,NJosef.oNumerischeLMathematik1.Achte,NneuMbGearbeiteteunderweiterteAu age.oSpringer-V*erlag.BerlinUU1999.qISBN3-540-66154-9,page205.2+n썫50CONSTXVERSION(NOASSIGNMENT)33DLDFPRÎGx182n@P182.hDe neUUT +ransformAinverseaZ()UUconst*;>ff= ^1 +StoGer,NJosef.oNumerischeLMathematik1.Achte,NneuMbGearbeiteteunderweiterteAu age.oSpringer-V*erlag.BerlinUU1999.qISBN3-540-66154-9,page205.36n썷x1823DLDFPRÎG3CONSTXVERSION(NOASSIGNMENT)51n@P182.hDe neUUT ransform;'functions@125i+ T ransformAT @@ -688,7 +712,7 @@ 0++)f2t5w:matrix?[iq][jī]=matrix![i][jī];2if=(DEBUGY)f<c}'outR Umatrix![iq][jī]" " w;2g(g(if3(DEBUGY)f2c}'outH T"\n"Mt;(ggif)(DEBUGY)f(c}'out> S"\n"Mt;(t+v:show("t"F_);(c}'out> S"Enter to ckontinue.\n\n"T5 ush;(getcharI&();gin9t/p4[n];for/艫(in9tjӫ=0;j w<nDz;j 0++)p [jī]=jwܫ;for/艫(jwܫ=0;j w<nDz;j -0++)UUf34n썷x1833DLDFPRÎG3CONSTXVERSION(NOASSIGNMENT)51n@P183. PivotUUsearch.hDe neUUT +0++)UUf4?n썫52CONSTXVERSION(NOASSIGNMENT)33DLDFPRÎGx183n@P183. PivotUUsearch.hDe neUUT ransform;'functions@125i+ max k=fabs(tr:matrix?[jī][j]); r}'owӄ=jwܫ; @@ -710,7 +734,7 @@ t s:matrix?[jī][j]=hr d; for臫(kLn=0;k Lk<nDz;k S++s)if(kLn6=jwܫ)ffor/艫(i9 =0;i 9 <nDz;i++)(if3(i9 6=jwܫ)tr:matrix?[iq][kV]=lt:matrix[i][jī]8tR:matrix?[j][kV];t!u:matrix?[jī][kV]=UOmhr%;g g=outerUUfor胷= -if(DEBUGY)c}'out O"Finished Transformaktion.\n"D ush;4 8BeginTLogJʄ`> -[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions.Ȅ` 8EndTLogA>`hV*ersionUUcontrolidenti er@10i+197. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"#include'~"transfor.h"198. ShapQeTclassde nition.199. class&`MP9ointEOisUUknownwhenshapes.ciscompiled,bGecauseit'sdeclared(butnotde ned)in6Wn썫54SHAPEXCLASSDEFINITION[3DLDFPRÎGx199n@P -transfor.web,UUwhichisproGcessedbycmpl1 rst. -??^BApparently*,&|bGoththereturnvqalueandtheargumenttypGesofpurevirtualfunctionsmustbGethesame,otherwiseUUthederivedclasseswillcausecompilererrors.qCheckwherethisisstated.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.05.16.]Y;AddedUUdeclarationsofgetffminimumffzF-()andgetffme}'anffz4 _().Ȅ` 8EndTLogA>` -format3c(Shap}'eVinthDe neUUShapQe%class@199i +ransformV'122i +hDeclarationsUUfortheheader le@18i196. ShapQe(shapes.web).M0[LDFT2002.10.20.]jShape̫isUUanabstractclass.qThismeansthatnoob8jectsoftypGeShapQe&A9maybGedeclared.qShapQe(.isusedasabaseclassforall\drawable"classes,e.g.,P9oint,!,P9ath#=,andDoQdecahedronLEL.Allob8jectsthatareputontoaPicture,mustbGeeitherShapQesorUULabQels$.9Ȅ`+U 8Log)j`+U +[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions. +[LDFT2003.12.10.]YQPuttheversioncontrolidenti ersbackintomyreleaseversionsfor3DLDF1.1.4.MI'vealready"putsomeofthembackin,,nowI'mdoingtherestofthem.`However,,thereleaseversionsarenowintheirUUownRCSrepGository*.Ȅ`GhV*ersionUUcontrolidenti er@10i+ +static)HstringJn'r}'csffidg(="$Id: shapes.web,v 1k.2 2003/12/10 16:44:Ơ36 lfinsto1 Exp $"3ҫ;197. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"#include'~"transfor.h"198. ShapQeTclassde nition.199. class&`MP9ointEOisUUknownwhenshapes.ciscompiled,bGecauseit'sdeclared(butnotde ned)in +transfor.web,UUwhichisproGcessedbycmpl1 rst. +??^BApparently*,&|bGoththereturnvqalueandtheargumenttypGesofpurevirtualfunctionsmustbGethesame,otherwiseUUthederivedclasseswillcausecompilererrors.qCheckwherethisisstated.9Ȅ`+U 8Log)j`+U +[LDFT2003.05.16.]Y;AddedUUdeclarationsofgetffminimumffzF-()andgetffme}'anffz4 _().Ȅ`G +format3c(Shap}'eVinthDe neUUShapQe%class@199i class$RShapQeG!fprotected0o:static$HconstBs{signedeqshortDRAWDOTg;=const#*vqaluesUUusedforoutput.o= static)HconstGs|signedjrshortDRAW4q; static)HconstGs|signedjrshortFILL4q; @@ -765,7 +791,7 @@ static)HconstGs|signedjrshortUNDRAWDOTtb; static)HconstGs|signedjrshortUNDRAWk; static)HconstGs|signedjrshortUNFILLk; -static)HconstGs|signedjrshortUNFILLDRAW_; SeeXalsosection200.ThisXco 8BeginTLogJʄ`> -[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions.Ȅ` 8EndTLogA>`hV*ersionUUcontrolidenti er@10i+206. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"#include'~"transfor.h"#include'~"shapes.h"207. LabQel.[LDFT2002.10.20.]Z Labelso֫are+theonlyob8jects,!otherthanShapes'.t,!thatcanbGeputontoPictures*%I.[They/arecreatedbythefunctionslab}'elǫ()anddotlab}'el%"(), jwhicharecurrentlyde nedforP9ointsandUUP9aths o.208. LabQelxclassde nition.AyLabQel#3containsyapGointertoaP9ointc, whichisitsloGcation, abQool>Gtoindicate.gwhetherthelabGelshouldhave.gadotornot,dastring&,ƫforthetextofthelabelandastring&,ƫforpGositioningthetextwithrespecttothelabel.xlpt mustbeapointer,becauseP9oint" +hDe neUUstatic".ShapQeDߐmembGerUUvqariables@201i:n썫58PUTTINGXSHAPETOGETHERVW3DLDFPRÎGx204n@P204. ThisUUiswhat'swrittentoshapes.h.hshapes.h5204i +hDe neUUShapQe%class@199i205. PictureTandLabQel(pictures.web).N99Ȅ`+U 8Log)j`+U +[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions. +[LDFT2003.12.10.]YQPuttheversioncontrolidenti ersbackintomyreleaseversionsfor3DLDF1.1.4.MI'vealready"putsomeofthembackin,,nowI'mdoingtherestofthem.`However,,thereleaseversionsarenowintheirUUownRCSrepGository*.Ȅ`GhV*ersionUUcontrolidenti er@10i+ +static)HstringJn'r}'csffidg(="$Id: pictures.web,vk 1.2 2003/12/10 16:1Ơ7:06 lfinsto1 Exp $">L̫;206. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"#include'~"transfor.h"#include'~"shapes.h"207. LabQel.[LDFT2002.10.20.]Z Labelso֫are+theonlyob8jects,!otherthanShapes'.t,!thatcanbGeputontoPictures*%I.[They/arecreatedbythefunctionslab}'elǫ()anddotlab}'el%"(), jwhicharecurrentlyde nedforP9ointsandUUP9aths o.208. LabQelxclassde nition.AyLabQel#3containsyapGointertoaP9ointc, whichisitsloGcation, abQool>Gtoindicate.gwhetherthelabGelshouldhave.gadotornot,dastring&,ƫforthetextofthelabelandastring&,ƫforpGositioningthetextwithrespecttothelabel.xlpt mustbeapointer,becauseP9oint" isanincompletetypehere.p}'osition.ޫcanbGeanyofthestringsusedinMET*AFONT,i.e.,GV"top" ,GV"bot",GV"lft",GV"rt"Ͳ,GV"llft"$M,"ulft" V,UU"lrt",UUor"urt". [LDFT2002.10.09.]Y;LabQels}(/areUUcurrentlyonlyevercreatedonthefreestore. format3c(L}'abelSainthDe neUUclasses@208i class$RLabQelDw ffriend5fclassPG P9ointkU;friend5fclassPG Pictureu;P9oint27ptA=;bQool-hdot 8BeginTLogJʄ`> -[LDFT2002.10.20.]Y;AddedUUthissection.qDO_LABELS7iwasformerlyaglobalvqariablede nedinpspglb.web.Ȅ` 8EndTLogA>`hInitializeUUstatic".LabQelB4dataUUmembGers@209i -bQool#gLabQel@Ϋ::DO_LABELS3i=true; ThisXco 8BeginTLogJʄ`> -[LDFT2002.10.23.]Y;AddedUUargumentspr}'ojmandfactorY3.Ȅ` 8EndTLogA>`hDeclareUULabQel" functions@210i +g; SeeXalsosection216.ThisXcouC&F 8BeginTLogJʄ`> -[LDFT2003.05.11.]Y;AddedUUAXON۱.Ȅ` 8EndTLogA>`hDeclareUUnamespaceProjectionsAa211i -namespaceC{Projections0fextern8constVHzunsignedshortJ+PERSPל=0;extern8constVHzunsignedshortJ+PARALLEL_X_Y旇=1;extern8constVHzunsignedshortJ+PARALLEL_X_Z旇=2;extern8constVHzunsignedshortJ+PARALLEL_Z_Y旇=3;extern8constVHzunsignedshortJ+AXON=4;extern8constVHzunsignedshortJ+ISOW=5; -g; ThisXco 8BeginTLogJʄ`> -[LDFT2003.05.16.]Y;AddedUUthisnamespace.Ȅ` 8EndTLogA>`hDeclareUUnamespaceSorting,213i +g; ThisXcoclassde nition.[LDFT2002.08.06.]ZDNote|cthatLabQel#:)hasapublic&6staticEdatamembGer namedYDO_LABELS3,whichYisusedforgloballyenablingorsuppressingputtingLabQels(wQontoPictures1(seeabGove). @@ -850,17 +878,16 @@ ransformKtr}'ansformw|;v9ector3JhShapQe"Ab'AciUUshap}'es Cޫ;v9ector3JhLabQel$iUUlab}'elsE;bQool-hdofflab}'elsSK; public)=֫:hDeclareUUPicture,Ffunctions@218i g;217. Constructors.218. DefaultTconstructor.(NoUUarguments).hDeclareUUPicture,Ffunctions@218i -Picture/(); SeeXalsosections220,222,224,225,227,229,230,231,235,238,240,241,243,244,246,248,250,253,254,255,and256.ThisXcon썫62DEF8AÎULJTXCONSTRUCTORQ3DLDFPRGx219n@P219.hDe neUUPicture,Ffunctions@219i Picture0::Picture&() :qdofflab}'els*(trueĘ)UUfg Seealsosections226,228,232,236,239,242,245,247,249,251,373,396,543,544,545,546,548,549,550,551,552,553, andX554.ThisXcoVExXimacrofor\POR*TING".!!PORTING.[LDFT2002.12.05.]R)Movedtopoints.webbGecausePicture)0::cle}'ar(ݫ()andLabQel::getffc}'opy%ø()areunde nedinthis le.1Thisdidn'tcauseaUUproblemwiththeDECcompiler,butitdoGeswiththeGNUCompiler.hDeclareUUPicture,Ffunctions@218i+ v9oid"opQeratorN=V[(const*PictureG&N"pS");223. AddingTelemen9ts.224. Add/Picture.ThisfunctionmustbGede nedinpoints.web,becauseitusesP9oint>_,whichisanincompletelyUUde nedclass5here. -[LDFT2002.04.17.]Y73ItMseemstobGemostusefultohaveMtheargumentPicture,p50benon-constM, inordertobGeabletoshiftitandaddittothismultipletimes.PF*orthistowork,_itmustbGepossibletosetp:tr}'ansformtoBtheidentityBmatrixafterwards.:)ItispGossibletodothisexplicitlybycallingr}'esetfftransformG$()onthePicture)hfollowingz[thecalltoopQerator/+=>L(),butit'smoreconvenienttohaveitdoneautomatically*.IfitturnsUUouttobGeuseful,Icanaddaconst!versionofthisfunction.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.04.17.]Y;AddedUUthisdeclaration.Ȅ` 8EndTLogA>`hDeclareUUPicture,Ffunctions@218i+ +[LDFT2002.04.17.]Y73ItMseemstobGemostusefultohaveMtheargumentPicture,p50benon-constM, inordertobGeabletoshiftitandaddittothismultipletimes.PF*orthistowork,_itmustbGepossibletosetp:tr}'ansformtoBtheidentityBmatrixafterwards.:)ItispGossibletodothisexplicitlybycallingr}'esetfftransformG$()onthePicture)hfollowingz[thecalltoopQerator/+=>L(),butit'smoreconvenienttohaveitdoneautomatically*.IfitturnsUUouttobGeuseful,Icanaddaconst!versionofthisfunction.9Ȅ`+U 8Log)j`+U +[LDFT2002.04.17.]Y;AddedUUthisdeclaration.Ȅ`GhDeclareUUPicture,Ffunctions@218i+ v9oid"opQeratorN+=^"(const*PictureG&N"pS");225. AddTShapQe.hDeclareUUPicture,Ffunctions@218i+ -v9oid"opQeratorN+=^"(ShapQe"Ab'Acs+c);>Bn썫62ADDXSHAPE*3DLDFPRÎGx226n@P226.hDe neUUPicture,Ffunctions@219i+ +v9oid"opQeratorN+=^"(ShapQe"Ab'Acs+c);?n썷x2263DLDFPRÎG*ADDXSHAPE63n@P226.hDe neUUPicture,Ffunctions@219i+ v9oid"PictureI::P((opQerator{ݫ+=M(ShapQe"Ab'Acs+c) fshap}'es0:pushffb}'ack+XR(s); g227. AddTLabQel.hDeclareUUPicture,Ffunctions@218i+ @@ -870,13 +897,13 @@ g229. SuppressʕLabQels.[LDFT2002.04.25.][]yAdded*thisfunction.Sometimesit'sirritatingtohave*thelabGelswhenaPicture-3iscopiedandtransformed,עandboththeoriginalandthetransformedversionsareoutput.hDeclareUUPicture,Ffunctions@218i+ inline)Iv9oidB!suppr}'essfflabelsS() fdofflab}'els==falsev\; -g230. UnsuppressTLabQels.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.12.20.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUPicture,Ffunctions@218i+ +g230. UnsuppressTLabQels.9Ȅ`+U 8Log)j`+U +[LDFT2002.12.20.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUPicture,Ffunctions@218i+ inline)Iv9oidB!unsuppr}'essfflabelsw() fdofflab}'els==true; -g231. KillTLabQels.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.05.07.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUPicture,Ffunctions@218i+ -v9oid"killfflab}'elsLJ˫();?n썷x2323DLDFPRÎG#'KILLXLABELS63n@P232.hDe neUUPicture,Ffunctions@219i+ +g231. KillTLabQels.9Ȅ`+U 8Log)j`+U +[LDFT2003.05.07.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUPicture,Ffunctions@218i+ +v9oid"killfflab}'elsLJ˫();@ n썫64KILLXLABELS#'3DLDFPRÎGx232n@P232.hDe neUUPicture,Ffunctions@219i+ v9oid"PictureI::killfflab}'els*L() flab}'els,T:cle}'ar(٫(); g233. T @@ -897,19 +924,19 @@ T ransformAshiftUP(const*P9oint=?&D]pI]);241. Rotationyaroundthemainaxes.r}'otate%:()willpGerformrotationaboutthex,Dyandz-axesinthat"orderifcalledwithmultiple,non-zeroarguments.QaRotationonlyabGouttheyand/orz-axisrequiresoneorUUtwodummy0argumentssothatr}'otateē()\knows"abGoutwhichaxis(oraxes)torotate.hDeclareUUPicture,Ffunctions@218i+ T -ransformAr}'otate\8(const*real4бx:;constJreal6xy>=0;constJreal6xz>f=0);@n썫64RÎOTJATIONXAROUNDTHEMAINAXES7w3DLDFPRGx242n@P242.hDe neUUPicture,Ffunctions@219i+ +ransformAr}'otate\8(const*real4бx:;constJreal6xy>=0;constJreal6xz>f=0);AGn썷x2423DLDFPRÎG7wROTJATIONXARÎOUNDTHEMAINAXES65n@P242.hDe neUUPicture,Ffunctions@219i+ T ransformAPicturehd::r}'otateoB(const*real4бx:;constJreal6xy;p;constJreal6xz;) freturn7tr}'ansformc:r}'otateo>(x;y;zƫ); -g243. Rotationaroundanarbitraryaxis.[LDFT2002.05.03.]ZnThis;functionisde nedinpoints.web,bGecauseUUithasP9oint"Darguments,andP9ointisanincompletetypGeinthis le.U9Ȅ`> 8BeginTLogJʄ`> +g243. Rotationaroundanarbitraryaxis.[LDFT2002.05.03.]ZnThis;functionisde nedinpoints.web,bGecauseUUithasP9oint"Darguments,andP9ointisanincompletetypGeinthis le.9Ȅ`+U 8Log)j`+U [LDFT2002.05.03.]Y;AddedUUthisdeclaration. -[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ` 8EndTLogA>`hDeclareUUPicture,Ffunctions@218i+ +[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ`GhDeclareUUPicture,Ffunctions@218i+ T -ransformAr}'otate\8(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rű;constJreal6xangleQ=180);=RemembGerUUtoaddshear!o=244. SetTtransform.9Ȅ`> 8BeginTLogJʄ`> +ransformAr}'otate\8(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rű;constJreal6xangleQ=180);=RemembGerUUtoaddshear!o=244. SetTtransform.9Ȅ`+U 8Log)j`+U [LDFT2003.01.17.]Y;MadeUUnon-inlineandchangedt GfromplainT ransform;'toconst!T -ransformYHɫ&a.Ȅ` 8EndTLogA>`hDeclareUUPicture,Ffunctions@218i+ +ransformYHɫ&a.Ȅ`GhDeclareUUPicture,Ffunctions@218i+ T ransformAsetfftr}'ansform},(const*T ransformUt&]taW);245.hDe neUUPicture,Ffunctions@219i+ @@ -917,14 +944,14 @@ ransformAPicturehd::setfftr}'ansform 8BeginTLogJʄ`> +g246. MultiplyingTtransform.9Ȅ`+U 8Log)j`+U [LDFT2003.01.17.]Y;ChangedUUt GfromUUplainT ransform;'toconst!T -ransformYHɫ&a.Ȅ` 8EndTLogA>`hDeclareUUPicture,Ffunctions@218i+ +ransformYHɫ&a.Ȅ`GhDeclareUUPicture,Ffunctions@218i+ T ransformAopQeratorm_=z&(const*T -ransformUt&]taW);An썷x2473DLDFPRÎGTMULJTIPLYINGXTRANSF9ORM65n@P247.hDe neUUPicture,Ffunctions@219i+ +ransformUt&]taW);BFn썫66MULJTIPLYINGXTRANSF9ORMT3DLDFPRÎGx247n@P247.hDe neUUPicture,Ffunctions@219i+ T ransformAPicturehd::n"opQerator׷=P(const*T ransformUt&]taW) @@ -935,7 +962,7 @@ fc}'out* Q"Showing picture: "i_text"\n" ush;tr}'ansform?C:show("transform:"?D);c}'out* Q"shapes.size() == "i_shap}'es:size\()endl ush;c}'out* Q"labels.size() == "i_lab}'els:size\()endl ush;c}'out* Q"do_labels == "Tkdofflab}'els+endl ush;c}'out* Q"Showing shapes.\n"g G;for%ľ(v9ectorHhShapQe"'i::Biter}'ator)7iter=+M=shap}'es:b}'egin();3iternI6=shap}'es:endಫ();\3++#Siter!Q)( iter):show();if(stopƍ)fc}'out4 R"Hit return to contiknue.\n"G ush;getchar?%();gc}'out* Q"Done showing picturke.\n"TM ush; g250. Sho9wTtransform.hDeclareUUPicture,Ffunctions@218i+ -v9oid"showfftr}'ansformgSū(string!%Mtext5D1="Transform from Pictkure:"5);BΠn썫66SHOÎWXTRANSF9ORMѭ3DLDFPRGx251n@P251.hDe neUUPicture,Ffunctions@219i+ +v9oid"showfftr}'ansformgSū(string!%Mtext5D1="Transform from Pictkure:"5);Czn썷x2513DLDFPRÎGSHOWXTRANSF9ORM67n@P251.hDe neUUPicture,Ffunctions@219i+ v9oid"PictureI::showfftr}'ansformEU(string!%Mtext2}) ftr}'ansform?C:show(textW̫); g252. Output.[LDFT2002.09.18.]ZAdded|$theoptionalrealV!argumentsminffxffpr}'oj3Mr,maxffxffpr}'oj4f˫,etc.5ThepurpGosezWoftheseistosuppressoutputofShapQes,iwhosepr}'ojectiveffextremes\falloutsideoftheselimits,wherebyAKthe\z"vqaluesarenotcurrentlychecked.kTheyarenotsetforaparticularF @@ -956,7 +983,7 @@ ftr}'ansform?C:r}'esetƷ(); g257. GlobalTv\rariables.hGlobalUUvqariables@15i+ Picture2ccurr}'entffpictureu*;258.hDeclarationsUUfortheheader le@18i+ -extern.PictureW9curr}'entffpicture5;259. PuttingTPictureandLabQeltogether.Cˠn썷x2603DLDFPRÎG PUTTINGXPICTUREANDLABELTOGETHER67n@P260. ThisUUiswhat'scompiled. +extern.PictureW9curr}'entffpicture5;259. PuttingTPictureandLabQeltogether.Dxn썫68PUTTINGXPICTUREANDLABELTOGETHER 3DLDFPRÎGx260n@P260. ThisUUiswhat'scompiled. hIncludeUU les@11i hV*ersionUUcontrolidenti er@10i hDeclareUUnamespaceProjectionsAa211i @@ -964,13 +991,15 @@ hDe neUUclasses@208i hInitializeUUstatic".LabQelB4dataUUmembGers@209i hGlobalUUvqariables@15i -hDe neUUPicture,Ffunctions@219iDn썫68PUTTINGXPICTUREANDLABELTOGETHER 3DLDFPRÎGx261n@P261. ThisUUiswhat'swrittentopictures.h.hpictures.h@0261i +hDe neUUPicture,Ffunctions@219iE;n썷x2613DLDFPRÎG PUTTINGXPICTUREANDLABELTOGETHER69n@P261. ThisUUiswhat'swrittentopictures.h.hpictures.h@0261i hextern%~declarationUUofnamespaceProjectionsAa212i hextern%~declarationUUofnamespaceSorting,214i hDe neUUclasses@208i hDeclarationsUUfortheheader le@18i262. P9oint(points.web). -[LDFT2002.10.20.]YP9ointx is_themostbasicdrawable_(not llable!)typGe.All_oftheotherShapQes*4ūcontainP9oints%randareultimatelyde nedbytheirP9oints)`andtherelationshipsamongthem. Itisthereforeunderstandableyythatpoints.webisbyfarthelargestofthesource lesof3DLDFypandthatP9oint":hasthemost]functionsofanyclassin3DLDF.ManyofthefunctionsintheotherclassesdolittlemorethanapplytheUUP9oint"DversionUUofthefunctiontotheirP9oints#x٫.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions.Ȅ` 8EndTLogA>`hV*ersionUUcontrolidenti er@10i+263. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"#include'~"transfor.h"#include'~"shapes.h"#include'~"pictures.h"264. P9ointTclassde nition.[LDFT2002.10.20.] +[LDFT2002.10.20.]YP9ointx is_themostbasicdrawable_(not llable!)typGe.All_oftheotherShapQes*4ūcontainP9oints%randareultimatelyde nedbytheirP9oints)`andtherelationshipsamongthem. Itisthereforeunderstandableyythatpoints.webisbyfarthelargestofthesource lesof3DLDFypandthatP9oint":hasthemost]functionsofanyclassin3DLDF.ManyofthefunctionsintheotherclassesdolittlemorethanapplytheUUP9oint"DversionUUofthefunctiontotheirP9oints#x٫.9Ȅ`+U 8Log)j`+U +[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions. +[LDFT2003.12.10.]YQPuttheversioncontrolidenti ersbackintomyreleaseversionsfor3DLDF1.1.4.MI'vealready"putsomeofthembackin,,nowI'mdoingtherestofthem.`However,,thereleaseversionsarenowintheirUUownRCSrepGository*.Ȅ`GhV*ersionUUcontrolidenti er@10i+ +static)HstringJn'r}'csffidg(="$Id: points.web,v 1k.3 2003/12/10 16:21:Ơ48 lfinsto1 Exp $"3ҫ;263. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"#include'~"transfor.h"#include'~"shapes.h"#include'~"pictures.h"264. P9ointTclassde nition.[LDFT2002.10.20.] worldffc}'oordinatesZiTcontainsUUthecoGordinatesoftheP9oint"Dintheglobalcoordinatesystem. userffc}'oordinatesU wandUUviewffc}'oordinatesOYareUUnotcurrentlyused. userffc}'oordinatesT 8BeginTLogJʄ`> +urgentUUwhenIstartwritingtheinputroutine.qTODO.卍9Ȅ`+U 8Log)j`+U [LDFT2003.04.01.]YR\AddedvWORLD_VALUESC%,PROJ_VALUES=E,USER_VALUES,andvVIEW_VALUES=彫.P*TheyvareusedinUUlab}'el()UUforlabGellingP9oints&.usingthevqaluesinworldffc}'oordinatesPiS,pr}'ojectiveffcoordinatesb h,etc. [LDFT2003.05.06.]YDChangedWORLD_VALUE=<,PROJ_VALUE8h,USER_VALUE,andVIEW_VALUE<*4toWORLD_VALUESC9,PROJ_VALUES:FG,UUUSER_VALUES=,UUandVIEW_VALUES.qAddedWORLD_VALUES_X_YWۍ,PROJ_VALUES_X_YR,USER_VALUES_X_YOF;,UUandVIEW_VALUES_X_YUforsuppressingthez-coGordinate. -[LDFT2003.05.20.]Y;AddedUUWORLD_VALUES_ZM[.Ȅ` 8EndTLogA>` -format3c(PointUShap}'ehDe neUUclass5P9oint>264i +[LDFT2003.05.20.]Y;AddedUUWORLD_VALUES_ZM[.Ȅ`G󍍑 +format3c(PointUShap}'ehDe neUUclass5P9oint>264i class$RP9ointC:qprotected86ShapQeZxffriend5fT ransformm/T ransform::1Malignffwithffaxisū(P9ointH;P9ointD;c9har); priv\rate-:T ransform WORLD_VALUESd;static3HconstQs}shorto> PROJ_VALUESg;static3HconstQs}shorto> USER_VALUESg;static3HconstQs}shorto> VIEW_VALUESg;static3HconstQs}shorto> WORLD_VALUES_X_YX;static3HconstQs}shorto> PROJ_VALUES_X_Y[;static3HconstQs}shorto> USER_VALUES_X_Y[;static3HconstQs}shorto> VIEW_VALUES_X_Y[;static3HconstQs}shorto> WORLD_VALUES_ZD^;hDeclareUUP9oint"Dconstructors@279ihDeclareUUP9oint"Dfunctions@284i -g; ThisXco 8BeginTLogJʄ`> +public)=֫:static$HstringEn&me}'asurementffunits;static3HrealI CURR_Yj_;static3HrealI CURR_Zj_;static3HconstQs}shorto> WORLD_VALUESd;static3HconstQs}shorto> PROJ_VALUESg;static3HconstQs}shorto> USER_VALUESg;static3HconstQs}shorto> VIEW_VALUESg;static3HconstQs}shorto> WORLD_VALUES_X_YX;static3HconstQs}shorto> PROJ_VALUES_X_Y[;static3HconstQs}shorto> USER_VALUES_X_Y[;static3HconstQs}shorto> VIEW_VALUES_X_Y[;static3HconstQs}shorto> WORLD_VALUES_ZD^;hDeclareUUP9oint"Dconstructors@279ihDeclareUUP9oint"Dfunctions@284i +g; ThisXco`hDe neUUstatic".P9ointA˫dataUUmembGers@265i +LDF2003.05.22. ! BUGFIX:ChangedWORLD_VALUES_ZSlsothatit'sonelessthanVIEW_VALUES_X_YT+R.Previously*,UUithadthesamevqalue.Ȅ`GhDe neUUstatic".P9ointA˫dataUUmembGers@265i string+%NP9ointG::me}'asurementffunitsW="cm"Mt; real /P9oint=M{::CURR_Y#r=0; real /P9oint=M{::CURR_Z#r=0; @@ -1025,35 +1054,35 @@ const(*shortEFP9ointb::PROJ_VALUES_X_YS W=WORLD_VALUESD<858; const(*shortEFP9ointb::USER_VALUES_X_YS W=WORLD_VALUESD<868; const(*shortEFP9ointb::VIEW_VALUES_X_YS W=WORLD_VALUESD<878; -const(*shortEFP9ointb::WORLD_VALUES_ZMZ=WORLD_VALUESD<888; ThisXco 8BeginTLogJʄ`> -[LDFT2002.04.10.]^AAdded9theseformattinginstructions.sTheyareduplicatedusing\@s"incwdriver.web.Ȅ` 8EndTLogA>` -format3c(p}'ointffpairg]Point +const(*shortEFP9ointb::WORLD_VALUES_ZMZ=WORLD_VALUESD<888; ThisXco 8BeginTLogJʄ`> -LDFp2002.04.15.6Addedpthissection.bQoolus4wpoin9t=Kwasformerlyasimplet9ypQedef*{.I'vehadtochangeittoUUastruct!,inorderforP9oint::interse}'ctionffpointsR()toreturnone.Gln썷x2683DLDFPRÎGc\BOOLffs4#POINT71n@P -LDFx2003.05.30.1Removedthede nitionofthedefaultconstructortothenewsectionhDe nebQoolus4wpoin9t functions@269i.qSeeUUbGelowforanexplanation.Ȅ` 8EndTLogA>`hTypGeUUde nitions@12i+ +t9ypQedef4_pairH۫hbQoolus4wpoin9t5RF;bQoolus4wpoin9t6iUUbQoolus4wpoin9tus4pairQd;268. bQoolffs4#poin9t.9Ȅ`+U 8Log)j`+U +LDFp2002.04.15.6Addedpthissection.bQoolus4wpoin9t=Kwasformerlyasimplet9ypQedef*{.I'vehadtochangeittoUUastruct!,inorderforP9oint::interse}'ctionffpointsR()toreturnone.H#n썫72BOOLffs4#POINT/[3DLDFPR9Gx268n@P +LDFx2003.05.30.1Removedthede nitionofthedefaultconstructortothenewsectionhDe nebQoolus4wpoin9t functions@269i.qSeeUUbGelowforanexplanation.Ȅ`GhTypGeUUde nitions@12i+ struct+bQoolus4wpoin9tdGfbQool-hb1;P9oint2pt<<;bQoolus4wpoin9tIRH();bQoolus4wpoin9tIRH(bQoolfbb#;constJP9oint>&FpptU):qDZbq(bb W);pt䚫(ppt )UUfgv9oid,opQeratorX=`[(const*bQoolus4wpoin9tV=&^[bpisԫ)fb%ū=bp :bJ;pt*=bp :pt 䝫;g -g;H&Yn썫72BOOLffs4#POINT/[3DLDFPR9Gx269n@P269.9Ȅ`> 8BeginTLogJʄ`> -LDFk2003.05.30.'Addedthissection, andthede nitionofbQoolus4wpoin9t:(v9oid).Previously*, b0andptwereZnotset,Xsotheirvqalueswereunpredictable.IZhadtoremovethede nitionfromthedeclarationofbQoolus4wpoin9t5RF,UUbGecauseINVALID_POINTKpisn'tde ned,whenthedeclarationisreadbythecompiler.Ȅ` 8EndTLogA>`hDe neUUbQoolus4wpoin9t;functions@269i +g;I45n썷x2693DLDFPRÎGc\BOOLffs4#POINT73n@P269.9Ȅ`+U 8Log)j`+U +LDFk2003.05.30.'Addedthissection, andthede nitionofbQoolus4wpoin9t:(v9oid).Previously*, b0andptwereZnotset,Xsotheirvqalueswereunpredictable.IZhadtoremovethede nitionfromthedeclarationofbQoolus4wpoin9t5RF,UUbGecauseINVALID_POINTKpisn'tde ned,whenthedeclarationisreadbythecompiler.Ȅ`GhDe neUUbQoolus4wpoin9t;functions@269i bQoolus4wpoin9t@RK::bQoolus4wpoin9t6RJ() fbī=falsev\;pt =INVALID_POINTGY; g ThisXco;bQoolus4wpoin9t:RCc>;bQoolus4wpoin9t:RCd?):q rst'q(aI0);se}'cond"ī(bJ);thir}'dg(cS۫);fourth x(d4r)UUfgv9oid,opQeratorX=`[(const*bQoolus4wpoin9tus4quadrupleM&kar}'ge)f rst0:b«=ar}'g: rst:bJ; rst0:pt =ar}'g: rst:pt 䝫;se}'cond;ʱ:b«=ar}'g:se}'condDZ:bJ;se}'cond;ʱ:pt =ar}'g:se}'condDZ:pt 䝫;thir}'d3m:b«=ar}'g:thir}'dj:bJ;thir}'d3m:pt =ar}'g:thir}'dj:pt 䝫;fourth9x:b«=ar}'g:fourthx:bJ;fourth9x:pt =ar}'g:fourthx:pt 䝫;g -g;I*n썷x2713DLDFPRÎGHzDEF8AULJTXCONSTRUCTORFORBOOLffs4#POINTffs4QUADR9UPLE73n@P271. DefaultTConstructorforbQoolffs4#poin9tffs4quadruple.U9Ȅ`> 8BeginTLogJʄ`> -LDF2003.06.1.N`hDe neUUbQoolus4wpoin9tus4quadruples<functions@271i +g;J8Sn썫74DEF8AÎULJTXCONSTRUCTORFORBOOLffs4#POINTffs4QUADR9UPLEHzǭ3DLDFPRÎGx271n@P271. DefaultTConstructorforbQoolffs4#poin9tffs4quadruple.9Ȅ`+U 8Log)j`+U +LDF2003.06.1.NOrrHT;constJP9oint>&FpptU):qDZbq(bb W);r (rr Q);pt䚫(ppt )UUfg=ConstrucorwithbQoolf,real.,andP9oint"Darguments.o=v9oid,opQeratorX=`[(const*bQoolus4wrealus4pQoin9tnqX&v8vbrpJd)=AssignmentUUopGerator.o=fb%ū=brp:bJ;r%/=brp:r;pt*=brp:pt 䝫;g -g;J6n썫74DEF8AÎULJTXCONSTRUCTORFORBOOLffs4#REALffs4POINTs,~3DLDFPRÎGx273n@P273. DefaultTConstructorforbQoolffs4#realffs4pQoin9t.U9Ȅ`> 8BeginTLogJʄ`> -LDF82003.06.1.h Added8!thissection.Rede nedthedefaultconstructorbQoolus4wrealus4pQoin9tP)(v9oid),=sothatbis|settofalse,.,бr ΫissettoINVALID_REALC.,andptqissettoINVALID_BOOL_POINTb.Inordertodothis,itwasnecessarygtoremovegthede nitionfromthedeclarationofbQoolus4wrealus4pQoin9tOȫ,bGecausewhenthecompilerseesit,UUINVALID_REALF0andUUINVALID_POINTKparen'tUUde nedyet.Ȅ` 8EndTLogA>`hDe neUUbQoolus4wrealus4pQoin9tS functions@273i +g;KD;n썷x2733DLDFPRÎGs,~DEF8AULJTXCONSTRUCTORFORBOOLffs4#REALffs4POINT75n@P273. DefaultTConstructorforbQoolffs4#realffs4pQoin9t.9Ȅ`+U 8Log)j`+U +LDF82003.06.1.h Added8!thissection.Rede nedthedefaultconstructorbQoolus4wrealus4pQoin9tP)(v9oid),=sothatbis|settofalse,.,бr ΫissettoINVALID_REALC.,andptqissettoINVALID_BOOL_POINTb.Inordertodothis,itwasnecessarygtoremovegthede nitionfromthedeclarationofbQoolus4wrealus4pQoin9tOȫ,bGecausewhenthecompilerseesit,UUINVALID_REALF0andUUINVALID_POINTKparen'tUUde nedyet.Ȅ`GhDe neUUbQoolus4wrealus4pQoin9tS functions@273i bQoolus4wrealus4pQoin9tWf::bQoolus4wrealus4pQoin9tMe() :qDZbq(falseD);r (INVALID_REAL?D);pt䚫(INVALID_POINTDA)UUfg ThisXco 8BeginTLogJʄ`> -[LDFT2002.4.3.]NNowsettingworldffc}'oordinatesO[3],Juserffc}'oordinatesJbk[3],Jandviewffc}'oordinatesJ۶[3]=1.+XIt xesaUUbugthatshowedUUupwhenItriedtoshiftaP9oint"DwithcoGordinates0.Ȅ` 8EndTLogA>`hInitializeUUcoGordinatesandlimits@278i #ifdefe__DECCXX +extern.constLHybQoolus4wpoin9tus4quadruple/$INVALID_BOOL_POINT_QUADRUPLEO8;276. ConstructorsTandsettingfunctions.LRun썫76CONSTRÎUCTORSXANDSETTINGFUNCTIONS3DLDFPRGx277n@P277. TheQv\ralarra9ys3;ICuseQforthevqarioussetsofcoGordinatescanbedeclaredintheclassɞdeclaration,*but neitherkcantheirsizebGesetnorcantheybeinitialized. nullffc}'oordinatesN|Yisde nedinpspglb.webandisav\ralarra9y,of?Jrealsewith?J4elements=0.jnSettingworldffc}'oordinatesPSH,Cetc.tonullffc}'oordinatesLymakesthemtherightUUsize.278. InitializeTcoQordinatesandlimits.9Ȅ`+U 8Log)j`+U +[LDFT2002.4.3.]NNowsettingworldffc}'oordinatesO[3],Juserffc}'oordinatesJbk[3],Jandviewffc}'oordinatesJ۶[3]=1.+XIt xesaUUbugthatshowedUUupwhenItriedtoshiftaP9oint"DwithcoGordinates0.Ȅ`GhInitializeUUcoGordinatesandlimits@278i #ifdefe__DECCXX worldffc}'oordinatesY=nullffc}'oordinatesH; userffc}'oordinatesT}:=nullffc}'oordinatesH; viewffc}'oordinatesU ȫ=nullffc}'oordinatesH; @@ -1083,63 +1112,63 @@ userffc}'oordinatesQ"[3]=1; viewffc}'oordinatesRY[3]=1; pr}'ojectiveffextremes^R:r}'esizei(6;0); ThisXco 8BeginTLogJʄ`> -[LDFT2002.12.01.]Y;MadeUUargumentsconst*.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dconstructors@279i+ -P9oint%I(const*real4бx:;constJreal6xy>=CURR_Y"n;constJreal6xz>f=CURR_Z);283.hDe neUUP9oint"Dconstructors@280i+ +g SeeXalsosections283and287.ThisXco=CURR_Y"n;constJreal6xz>f=CURR_Z);283.hDe neUUP9oint"Dconstructors@280i+ P9oint&M::P9ointL(const*real4бx:;constJreal6xy;p;constJreal6xz;) fhInitializeUUcoGordinatesandlimits@278ionfffr}'eeffstoreNl =falsev\;doffoutputAM=true;#if hͫ0$hϱ=ҫ[LDFT2002.10.23.]Souserfftr}'ansform is *notcurrentlyinuse.XdItisintendedforuseinimplementing(user-de nedUUcoGordinatesystems.o=if(userfftr}'ansformA:isffidentity-2())#endifworldffc}'oordinatesk[0]=x~4;worldffc}'oordinatesa[1]=y ;worldffc}'oordinatesa[2]=z6;worldffc}'oordinatesa[3]=1; -g284. SettingTfunction.E9Ȅ`> 8BeginTLogJʄ`> +g284. SettingTfunction.9Ȅ`+U 8Log)j`+U [LDFT2002.12.01.]Y;MadeUUargumentsconst*. -[LDFT2003.03.25.]Y$Changedqthisfunction,xsothatitreturnsqthiseinsteadofv9oidZ.NThismakesitpGossibletoUUchaininvoGcationsofthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i -const(*P9ointG@&N^set\Y(const*real4бx:;constJreal6xy>=CURR_Y"n;constJreal6xz>f=CURR_Z); See?alsosections288,291,293,295,297,299,301,302,304,307,308,309,312,314,317,319,322,324,327,329,332,334,337, -339,341,342,344,345,349,352,354,356,357,360,362,364,368,370,375,377,392,394,398,402,404,406,410,412,414,416,419,420,422,423,425,426,428,429,431,433,438,440,442,444,445,447,449,451,457,461,463,466,468,474,X477,479,481,483,485,488,492,494,496,498,500,502,504,507,509,513,516,523,525,528,and529.ThisXco=CURR_Y"n;constJreal6xz>f=CURR_Z); See?alsosections288,291,293,295,297,299,301,302,304,307,308,309,312,314,317,319,322,324,327,329,332,334,337, +339,341,342,344,345,349,352,354,356,357,360,362,364,368,370,375,377,392,394,398,402,404,406,410,412,414,416,419,420,422,423,425,426,428,429,431,433,438,440,442,444,445,447,449,451,457,461,463,466,468,474,X477,479,481,483,485,488,492,494,496,498,500,502,504,507,509,511,513,516,523,525,528,and529.ThisXco 8BeginTLogJʄ`> -[LDFT2002.10.23.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -v9oid"set0v](const*P9oint=?&D]pI]);Nl n썫78SETTINGXFUNCTIONu?3DLDFPRÎGx289n@P289.hDe neUUP9oint"Dfunctions@285i+ +g288. Settingfunction.[LDFT2002.10.23.][iThis6$functionisunnecessary*,nWbGecauseitdoesnothingthattheassignmentopGeratorcan'tdo.JHowever,3I'vetriedtousesetYn()acoupleoftimeswithaP9oint!\argument,soUUit'sconvenientUUtohaveUUit.qIfnothingelse,itpreventsUUcompilationfromfailingoGccasionally*.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.23.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +v9oid"set0v](const*P9oint=?&D]pI]);Oxɠn썷x2893DLDFPRÎGu?SETTINGXFUNCTION79n@P289.hDe neUUP9oint"Dfunctions@285i+ v9oid"P9oint?%::setx(const*P9oint=?&D]pI]) fthis,ѫ=p;doffoutputAM=true; g290. Pseudo-constructorAfordynamicalloQcation.cr}'eateffnewffp}'ointTU()kismeanttobGeusedinsteadofTnew\()TfordynamicalloGcationofP9oints#x].qItcallsthedefaultconstructor(withoutarguments)andthensetsUUonfffr}'eeffstore>OtoUUtrue. -[LDFT2002.10.11.]X3ItMisusedinvqariousP9oint!^functions,OandinP9athUandsomeclassesderivedfromP9aths,currentlyNEllipse$7z,,Regus4wP9olygonD,,andNRectangle46.6ItNisintendedthatob8jectsofthesetypGesbedeclared,,i.e.,unlikeRegus4wClus4Planeus4Curv9ek/,theyarenotmeanttobGeusedonlyasbaseclasses.VRegus4wClus4Planeus4Curv9edoGesUUnotusecr}'eateffnewffp}'ointL+Q()anditisunlikelythatotherclassesofthiskindwilluseit.291. OptionalTpQoin9terargument.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.10.29.]YuMadeڏthisfunctionnon-inline4.tAddedargumentconst"kP9ointABFCpLC.Ifp 6="0#,thenewP9ointisUUassignedtousingthevqaluesfromp]U.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +[LDFT2002.10.11.]X3ItMisusedinvqariousP9oint!^functions,OandinP9athUandsomeclassesderivedfromP9aths,currentlyNEllipse$7z,,Regus4wP9olygonD,,andNRectangle46.6ItNisintendedthatob8jectsofthesetypGesbedeclared,,i.e.,unlikeRegus4wClus4Planeus4Curv9ek/,theyarenotmeanttobGeusedonlyasbaseclasses.VRegus4wClus4Planeus4Curv9edoGesUUnotusecr}'eateffnewffp}'ointL+Q()anditisunlikelythatotherclassesofthiskindwilluseit.291. OptionalTpQoin9terargument.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.29.]YuMadeڏthisfunctionnon-inline4.tAddedargumentconst"kP9ointABFCpLC.Ifp 6="0#,thenewP9ointisUUassignedtousingthevqaluesfromp]U.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ static)HP9ointH8wM8xcr}'eateffnewffp}'ointt(const*P9oint=?B@pIX=0);292.hDe neUUP9oint"Dfunctions@285i+ P9oint(-P9ointJ::cr}'eateffnewffp}'ointI(const*P9oint=?B@pG"@) fP9oint27a?=newϜ(P9ointH);aI2~I3onfffr}'eeffstoreW==true;if(p6=0) aI=p ;return7漱a=/; g293. RequiredTP9ointargument.hDeclareUUP9oint"Dfunctions@284i+ -static)HP9ointH8wM8xcr}'eateffnewffp}'ointt(const*P9oint=?&D]pI]);Ovn썷x2943DLDFPRÎG'REQUIREDXPOINTARGUMENT79n@P294.hDe neUUP9oint"Dfunctions@285i+ +static)HP9ointH8wM8xcr}'eateffnewffp}'ointt(const*P9oint=?&D]pI]);P~n썫80REQUIREDXPOINTARÎGUMENT'3DLDFPRGx294n@P294.hDe neUUP9oint"Dfunctions@285i+ P9oint(-P9ointJ::cr}'eateffnewffp}'ointI(const*P9oint=?&D]pI]) fP9oint27a?=newϜ(P9ointH);aI2~I3onfffr}'eeffstoreW==true;a!K=p;return7漱a=/; -g295. realTargumen9ts.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.11.06.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +g295. realTargumen9ts.9Ȅ`+U 8Log)j`+U +[LDFT2002.11.06.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ static)HP9ointH8wM8xcr}'eateffnewffp}'ointt(const*real4бx:;constJreal6xy>=0;constJreal6xz>f=0);296.hDe neUUP9oint"Dfunctions@285i+ P9oint(-P9ointJ::cr}'eateffnewffp}'ointI(const*real4бx:;constJreal6xy;p;constJreal6xz;) fP9oint27a?=newϜ(P9ointH);aI2~I3onfffr}'eeffstoreW==true;aI2~I3set*(x;y;zƫ);return7漱a=/; -g297. Destructor.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.08.27.]Y(Addeduavirtual)$,destructorwithanemptyde nition,}bGecauseGCCuwiththe\-Wall"optionUUissuedthefollowingwarning:q\`classPoint'hasvirtualfunctionsbutnon-virtualdestructor".Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +g297. Destructor.9Ȅ`+U 8Log)j`+U +[LDFT2003.08.27.]Y(Addeduavirtual)$,destructorwithanemptyde nition,}bGecauseGCCuwiththe\-Wall"optionUUissuedthefollowingwarning:q\`classPoint'hasvirtualfunctionsbutnon-virtualdestructor".Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ virtual/Է7TP9ointR:();298.hDe neUUP9oint"Dfunctions@285i+ P9oint&M::-(4P9ointP() -fg299. Assignmen9t.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.03.25.]YdChangedthisfunction,sothatitreturnsp kinsteadofv9oidZC.ThismakesitpGossibletochainUUinvoGcationsofthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -const(*P9ointG@&N^opQeratorzx=?1(const*P9oint=?&D]pI]);Pՠn썫80ASSIGNMENT-E3DLDFPRÎGx300n@P300.hDe neUUP9oint"Dfunctions@285i+ +fg299. Assignmen9t.9Ȅ`+U 8Log)j`+U +[LDFT2003.03.25.]YdChangedthisfunction,sothatitreturnsp kinsteadofv9oidZC.ThismakesitpGossibletochainUUinvoGcationsofthisfunction.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +const(*P9ointG@&N^opQeratorzx=?1(const*P9oint=?&D]pI]);QDn썷x3003DLDFPRÎG-EASSIGNMENT81n@P300.hDe neUUP9oint"Dfunctions@285i+ const(*P9ointG@&N^P9ointk{::r opQerator=g(const*P9oint=?&D]pI]) ftr}'ansformBz[=p:tr}'ansform+A;dr}'awdotffvalueT=p:dr}'awdotffvalue=Jɫ;dr}'awdotffcolorS>=p:dr}'awdotffcolor 8BeginTLogJʄ`> -[LDFT2002.10.27.]Y;Rede nedthisfunction. F*ormerly,itwasinlineandempty*. Nowitsetsallofthex,y*,andyzcoGordinatesto0,andresetstr}'ansform.,.(Itdoesn'tseemworthwhileytosetdr}'awdotffvalue?x,dr}'awdotffcolor?1,orUUp}'en]toUUanyparticularvqalues.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -v9oid"cle}'ar9&();Qdn썷x3033DLDFPRÎGIqCLEAR81n@P303.hDe neUUP9oint"Dfunctions@285i+ +g302. Clear.IUUneedthisfunctionbGecauseit'savirtual((functioninShapQe"Ab.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.27.]Y;Rede nedthisfunction. F*ormerly,itwasinlineandempty*. Nowitsetsallofthex,y*,andyzcoGordinatesto0,andresetstr}'ansform.,.(Itdoesn'tseemworthwhileytosetdr}'awdotffvalue?x,dr}'awdotffcolor?1,orUUp}'en]toUUanyparticularvqalues.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +v9oid"cle}'ar9&();ROn썫82CLEARIq3DLDFPRÎGx303n@P303.hDe neUUP9oint"Dfunctions@285i+ v9oid"P9oint?%::cle}'ar(ݫ() ffor%舫(in9ti=0;i 9 <4;i++)fworldffc}'oordinatesk[iq]=userffc}'oordinatesJ}9[i]=viewffc}'oordinatesK ǫ[i]=pr}'ojectiveffcoordinatesa}+[i]=0;gtr}'ansform?C:r}'esetƷ();return4g; g304. Clean.hDeclareUUP9oint"Dfunctions@284i+ @@ -1156,7 +1185,7 @@ freturn7漱:00001S; g309. Get8Line.De ned8inlines.web.DhMustbGede nedthere,qbecauseLineisanincompletetypehere. [LDFT2002.04.12.]Y;RemovedUUthisfunctiontolines.web.hDeclareUUP9oint"Dfunctions@284i+ -Line#getfflineD(const*P9oint=?&D]ptN)UUconst*;310. GettingTcoQordinates.??qChangeUUgetffx㼫(),UUetc.,backtoinlineH??Rn썫82GETXALLCOORDINAJTES3DLDFPRÎGx311n@P311. GetallcoQordinates.[LDFT2002.09.19.][9LAddedkthisfunction. ??[LDFT2002.12.01.]V>YCankI=make the9F +Line#getfflineD(const*P9oint=?&D]ptN)UUconst*;310. GettingTcoQordinates.??qChangeUUgetffx㼫(),UUetc.,backtoinlineH??Sn썷x3113DLDFPRÎGGETXALLCOORDINAJTES83n@P311. GetallcoQordinates.[LDFT2002.09.19.][9LAddedkthisfunction. ??[LDFT2002.12.01.]V>YCankI=make the9F oQcus#+argument9constㆫ?ZWhat9isthesyntaxforapGointertoaconstㆫ,rasoppGosedtoaconst pointer?LoGokUUup!!qMakesureIchangethisis3DLDF.texiifIchangeithere!312. Non-constTv9ersion.[LDFT2002.09.19.]Z6AddedUUthisfunction.hDeclareUUP9oint"Dfunctions@284i+ v\ralarra9y3ZBhreal]ٷiDgetffallffc}'oords>W(c9har08c}'oords:J='w'WY;const 9bQool;doffp}'erspd=trueՒ;const 9bQooldoffapplyGJ=rtrue ;F @@ -1174,7 +1203,7 @@ v\ralarra9y3ZBhreal]ٷiq2P9oint ~::getffallffc}'oords;(c9har&c}'oords5;const'bQool9jdoffp}'ersp_W;const'bQool9jdoffapply_?;F oQcus27f<;constJunsignedP Xshortmpr}'ojʾ;real]factor3a)UUconst fP9oint2p7(this뷫);v\ralarra9y=ZChreal]ٷiUUv Q*=p:getffallffc}'oords:(c}'oords ;doffp}'ersp'S;doffapply'};f);return7漱v=y; -gS)n썷x3163DLDFPRÎG2=3GETXCOORD83n@P316. GetcoQord.[LDFT2002.09.14.][!Addedgetffc}'oord,K׫().>}Fixingabugthatcausedgetffx}N('p'F_),Letc.,to callUUpr}'oject!c()UUmultipletimeswhendoingP9ath潫::outputD().317. Non-constMv9ersion.[LDFT2002.10.27.]YThe argumentc referstoeitherthex,ִy*,z,or wcoGordinate.hDeclareUUP9oint"Dfunctions@284i+ +gTn썫84GETXCOORD2=33DLDFPRÎGx316n@P316. GetcoQord.[LDFT2002.09.14.][!Addedgetffc}'oord,K׫().>}Fixingabugthatcausedgetffx}N('p'F_),Letc.,to callUUpr}'oject!c()UUmultipletimeswhendoingP9ath潫::outputD().317. Non-constMv9ersion.[LDFT2002.10.27.]YThe argumentc referstoeitherthex,ִy*,z,or wcoGordinate.hDeclareUUP9oint"Dfunctions@284i+ real!xgetffc}'oordJHh(c9harcm;c9harM:c}'oords=&U=Ϗ'w';const! bQool;Bdoffp}'erspf` =Ϗtrue';const! bQooldoffapplyGJ=rtrue ;F oQcus"'f1?r=r0s;const iunsignedQ3shortokpr}'ojC=rProjections>֫::EPERSP_m;realfactor;=1);318.hDe neUUP9oint"Dfunctions@285i+ @@ -1187,7 +1216,7 @@ g319. constTv9ersion.hDeclareUUP9oint"Dfunctions@284i+ real!xgetffc}'oordJHh(c9harcm;c9harM:c}'oords=&U=Ϗ'w';const! bQool;Bdoffp}'erspf` =Ϗtrue';const! bQooldoffapplyGJ=rtrue ;F -oQcus"'f1?r=r0s;const iunsignedQ3shortokpr}'ojC=rProjections>֫::EPERSP_m;realfactor;=1)UUconst*;Tn썫84CONSTXVERSIONon3DLDFPRÎGx320n@P320.hDe neUUP9oint"Dfunctions@285i+ +oQcus"'f1?r=r0s;const iunsignedQ3shortokpr}'ojC=rProjections>֫::EPERSP_m;realfactor;=1)UUconst*;U_n썷x3203DLDFPRÎGonCONSTXVERSION85n@P320.hDe neUUP9oint"Dfunctions@285i+ real eaP9oint<::getffc}'oord)\(c9har{cpV;c9har#c}'oords6Я;const|bQool8doffp}'ersp^L;const|bQool8doffapply^;F oQcus!{&|f,b;const2unsignedb7shortpr}'ojy;real]factor3a)UUconst fP9oint2p7(this뷫);return7漱p<:getffc}'oord(\(cS;c}'oords4;doffp}'ersp'S;doffapply'};f;pr}'ojk;factor); @@ -1206,7 +1235,7 @@ g326. GetTy .327. Non-constTv9ersion.hDeclareUUP9oint"Dfunctions@284i+ real!%>getffy7T(c9harXc}'oords9k=0'w'ˏ;const GYbQool:Zdoffp}'erspc6=0trueIȱ;const GYbQool:Zdoffapplycӫ=0true;F -oQcus#f+=0;constJunsignedP Xshortmpr}'oj֫=Projections=|::D!PERSP^;real]factor6(̫=1);Unjn썷x3283DLDFPRÎGANON-CONSTXVERSION85n@P328.hDe neUUP9oint"Dfunctions@285i+ +oQcus#f+=0;constJunsignedP Xshortmpr}'oj֫=Projections=|::D!PERSP^;real]factor6(̫=1);VLn썫86NON-CONSTXVERSIONA3DLDFPRÎGx328n@P328.hDe neUUP9oint"Dfunctions@285i+ real P9oint=:!::getffyt(c9harVc}'oords5`{;constbQool9Odoffp}'ersp^4;constbQool9Odoffapply_Zѱ;F oQcus!&f,;constunsigned2shortOʨpr}'ojbk;real]factor3a) freturn7getffc}'oord`C('y'F_;c}'oords4;doffp}'ersp'S;doffapply'};f;pr}'ojk;factor); @@ -1230,7 +1259,7 @@ real 0P9oint=@|::getffz(c9har]Jc}'oords5fֱ;constKbQool9\doffp}'ersp_;constKbQool9\doffapply_g;F oQcus!J&Kf,1;constKunsigned2shortOʨpr}'ojbk;real]factor3a)UUconst freturn7getffc}'oord`C('z'F_;c}'oords4;doffp}'ersp'S;doffapply'};f;pr}'ojk;factor); -g336. GetTw.Vײn썫86NON-CONSTXVERSIONA3DLDFPRÎGx337n@P337. Non-constTv9ersion.hDeclareUUP9oint"Dfunctions@284i+ +g336. GetTw.Wsn썷x3373DLDFPRÎGANON-CONSTXVERSION87n@P337. Non-constTv9ersion.hDeclareUUP9oint"Dfunctions@284i+ real!getffw9(c9harլc}'oords9YI=z'w'p;const @bQool:Mvdoffp}'erspcp=ztrue>;const @bQool:Mvdoffapplyc\=ztrue;F oQcus#f+=0;constJunsignedP Xshortmpr}'oj֫=Projections=|::D!PERSP^;real]factor6(̫=1);338.hDe neUUP9oint"Dfunctions@285i+ real P9oint=N::getffwo(c9har9c}'oords5B;constbQool9Vdoffp}'ersp^;constbQool9Vdoffapply_+;F @@ -1242,33 +1271,34 @@ real P9oint=N::getffwo(c9har9c}'oords5B;constbQool9Vdoffp}'ersp^;constbQool9Vdoffapply_+;F oQcus!&f,;constunsigned2shortOʨpr}'ojbk;real]factor3a)UUconst freturn7getffc}'oord`C('w'F_;c}'oords4;doffp}'ersp'S;doffapply'};f;pr}'ojk;factor); -g341. GetTtransform.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.10.27.]Y;MadeUUthisfunctionconst*.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +g341. GetTtransform.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.27.]Y;MadeUUthisfunctionconst*.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ inline)IT ransformaSgetfftr}'ansform:()UUconst freturn7tr}'ansformc; g342. GetTcop9y -.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.10.27.]Y;MadeUUthisfunctionconst*.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -ShapQe,Ac1Adgetffc}'opyV()UUconst*;W>n썷x3433DLDFPRÎG9qGETXCOPY87n@P343.hDe neUUP9oint"Dfunctions@285i+ +.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.27.]Y;MadeUUthisfunctionconst*.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +ShapQe,Ac1Adgetffc}'opyV()UUconst*;Xn썫88GETXCOPY9q3DLDFPRÎGx343n@P343.hDe neUUP9oint"Dfunctions@285i+ ShapQe,Ac1AdP9ointM۰::getffc}'opy%ø()UUconst fP9oint27p?=cr}'eateffnewffp}'ointK();p =thisϫ;return7staticus4wcastld^hShapQe"Ab'Aci(p); g344. IsTonfreestore.hDeclareUUP9oint"Dfunctions@284i+ inline)IbQoolC+isffonfffr}'eeffstore()UUconst freturn7onfffr}'eeffstoreo; -g345. SlopQe.[LDFT2002.10.27.]ZYslop}'eq&$()xreturnstheslopGeofthetr}'ace{ӫofxthelinefromythisbtop ~ontheplaneUUindicatedbythec9harargumentsmraandn U.qTheseshouldbGe'x','y','z','X','Y',or'Z'.r9Ȅ`> 8BeginTLogJʄ`> +g345. SlopQe.[LDFT2002.10.27.]ZYslop}'eq&$()xreturnstheslopGeofthetr}'ace{ӫofxthelinefromythisbtop ~ontheplaneUUindicatedbythec9harargumentsmraandn U.qTheseshouldbGe'x','y','z','X','Y',or'Z'.9Ȅ`+U 8Log)j`+U [LDFT2002.10.27.]Y;NowUUusingworldffc}'oordinatesSdirectlyinsteadof\get"functions. -[LDFT2002.10.27.]Y;ChangedUUargumentp fromconst!P9oint@o&KtoP9oint.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -real /slop}'e6(P9ointp#;c9harm&='x' w;c9harn#ܣ='y')UUconst*;Xn썫88SLOPEKm3DLDFPRÎGx346n@P346.hDe neUUP9oint"Dfunctions@285i+ +[LDFT2002.10.27.]Y;ChangedUUargumentp fromconst!P9oint@o&KtoP9oint.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +real /slop}'e6(P9ointp#;c9harm&='x' w;c9harn#ܣ='y')UUconst*;Ynn썷x3463DLDFPRÎGKmSLOPE89n@P346.hDe neUUP9oint"Dfunctions@285i+ real /P9oint=M{::slop}'e7ϫ(P9ointp#;c9harm#ܨ;c9harn!)UUconst*fUUbQoolDEBUG:,=falsev\;=trueĒ=P9oint<aB8Ы(this뷫);a#I3:applyfftr}'ansformF߫();p#:applyfftr}'ansformF߫();if)(aHp)f(c}'err=U"ERROR! In Point::sllope():\n"컷U"Points are the samel. Returning INVALID_\<REAL\n\n"nk ush;(if3(DEBUGY)f2a7I5:show("a"F_);2p7:show("p"F_);(g(returnKINVALID_REALm;gm)ҫ=tolower#(mǷ);n&ǵ=tolower#(n);if)(:((m Ϸ'x'FW_8m ǯ'y'_8m'z' w)8^(nDz'x'FW_n 'y'_n 'z' w)^(m Ϸ6=nDz)))f(c}'err=U"ERROR! In Point::sllope():\n"컷U"One or both char arlguments are invalid \<or they are the same: " AmU", "n ʷendl"Returning INVALID_RkEAL\n\n"D< ushQ;(returnKINVALID_REALm;gin9t/ctr@&=m ǯ8'x'?;real41affmffc}'oorddI=aH:worldffc}'oordinatesM[ctr ];real41pffmffc}'oorddI=p:worldffc}'oordinatesM[ctr ];ctr. =n 8'x'?;real41affnffc}'oorda[=aH:worldffc}'oordinatesM[ctr ];real41pffnffc}'oorda[=p:worldffc}'oordinatesM[ctr ];347. W*eUpoftenuseslop}'e;()inorderto ndoutwhetheralinehasslopGeornot,Uwsoanerrormessageisoutoftplacehere.y%AHwarningistoGo,-probably*,buttI'mleavingthisinherefornow,-justincaseIHchangemymind.hDe neUUP9oint"Dfunctions@285i+ if(affmffc}'oord/bpffmffc}'oord)f#if 0c}'err.η&"WARNING! In Point::qslope():\n"RW&m(" coordinates of points are equal (no slope)!\n"'L"Returning INVALID_RkEAL\n\n"M,;#endifreturn7INVALID_REALwm; g -return-滫(affnffc}'oord,y8pffnffc}'oord)=(affmffc}'oord/*8pffmffc}'oord);UUg348. IsTonsegmen9t.YVn썷x3493DLDFPRÎGNON-CONST+ԭVERSION89n@P349. Non-constv9ersion.[LDFT2002.10.29.][isffonffse}'gmenta()\1returnsabQoolus4wreal6withthebQoolsin- dicating=Vwhether =WthisfcliesonthelinesegmentbGetweenp0landp1T,wVandareal؅vqaluetrepresentingthedistanceloflthisonthewaylfromp0top1d.IfthebQool%Yistrue1<,rxthen0<=t<=1.Iflt<0ort>1,rxthenthisRliesg,onthelinepassingthroughp0andp1},kbutnotonthesegment.LIfg-thisdoGesn'tlieontheline,twillUUbGeINVALID_REALBۙ. -[LDFT2002.10.29.]Y;T*oUUcheckwhetherUVthisaliesontheline,useisffonffline-_().c9Ȅ`> 8BeginTLogJʄ`> +return-滫(affnffc}'oord,y8pffnffc}'oord)=(affmffc}'oord/*8pffmffc}'oord);UUg348. IsTonsegmen9t.Z +n썫90NON-CONST+ԭVERSION3DLDFPRÎGx349n@P349. Non-constv9ersion.[LDFT2002.10.29.][isffonffse}'gmenta()\1returnsabQoolus4wreal6withthebQoolsin- dicating=Vwhether =WthisfcliesonthelinesegmentbGetweenp0landp1T,wVandareal؅vqaluetrepresentingthedistanceloflthisonthewaylfromp0top1d.IfthebQool%Yistrue1<,rxthen0<=t<=1.Iflt<0ort>1,rxthenthisRliesg,onthelinepassingthroughp0andp1},kbutnotonthesegment.LIfg-thisdoGesn'tlieontheline,twillUUbGeINVALID_REALBۙ. +[LDFT2002.10.29.]Y;T*oUUcheckwhetherUVthisaliesontheline,useisffonffline-_().N99Ȅ`+U 8Log)j`+U [LDFT2002.10.29.]XLJBUGFIX:AddedcoGdetocheckwhethertheunitvectorsthisѷyp0ګandp1yzthisѫareequalgbGeforecalculatingr{.Z#BeforeIUdidthis,truewasreturnedforP9oints&@Rthatweren'tonthelinesegment. -[LDFT2002.10.29.]Y;NowUUusingworldffc}'oordinatesSdirectlyinsteadofgetffx㼫(),getffyk(),andgetffz]V().Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -bQoolus4wreal;@isffonffse}'gmentxuѫ(P9ointp0+];P9oint Ep1,);Z Pn썫90NON-CONST+ԭVERSION3DLDFPRÎGx350n@P350.hDe neUUP9oint"Dfunctions@285i+ -bQoolus4wreal;@P9ointWΫ::isffonffse}'gment>5S(P9ointp0+];P9oint Ep1,)fUUbQoolDEBUG:,=falsev\;=trueĒ=if)(DEBUGY)c}'out O"Entering Point::is_kon_segment().\n", ush;applyfftr}'ansformd();p0*ñ:applyfftr}'ansformF߫();p1*ñ:applyfftr}'ansformF߫();if)(DEBUGY)f(show>("this" V);(p04ı:show("p0"\);(p14ı:show("p1"\);gif)(thisϷINVALID_POINTI9_8p0INVALID_POINT_8p1INVALID_POINTGY)f(c}'err=ܷ2"ERROR! In Point::isk_on_segment():\n"Ȅ]2"One of the Points iks invalid! "Dl<"Returning false and INVALID_REAL.\n\n"  ush;(returnKpair`bϷhbQoolL;reali(falseD;INVALID_REALA0);gbQool7ib;;real41r9}E;if)(p0طp1^88this믷p0)f(c}'errBNa"ERROR! In Point::isp{_on_segment():\n"g<"*this and the arguments p0 and p1 are a ll equal. "Ng<"Returning false and INVALID_REAL.\n";(returnKpair`bϷhbQoolL;reali(falseD;INVALID_REALA0);gelse4.7if?/(p0طp1)f(c}'err=|·"ERROR! In Point::isk_on_segment():\n"T)"Arguments p0 and p1k are equal. "T5<"Returning false and INVALID_REAL.\n";(returnKpair`bϷhbQoolL;reali(falseD;INVALID_REALA0);gelse4.7if?/(thisϷp0ث)f(returnKpair`bϷhbQoolL;reali(trueĘ;0:0q);gelse4.7if?/(thisϷp1ث)f(returnKpair`bϷhbQoolL;reali(trueĘ;1:0q);g==[LDFT2002.10.29.]T7BeginningUUofnewcoGde.o=P9oint5S(P9ointp0+];P9oint Ep1,)fUUbQoolDEBUG:,=falsev\;=trueĒ=if)(DEBUGY)c}'out O"Entering Point::is_kon_segment().\n", ush;applyfftr}'ansformd();p0*ñ:applyfftr}'ansformF߫();p1*ñ:applyfftr}'ansformF߫();if)(DEBUGY)f(show>("this" V);(p04ı:show("p0"\);(p14ı:show("p1"\);gif)(thisϷINVALID_POINTI9_8p0INVALID_POINT_8p1INVALID_POINTGY)f(c}'err=ܷ2"ERROR! In Point::isk_on_segment():\n"Ȅ]2"One of the Points iks invalid! "Dl<"Returning false and INVALID_REAL.\n\n"  ush;(returnKpair`bϷhbQoolL;reali(falseD;INVALID_REALA0);gbQool7ib;;real41r9}E;if)(p0طp1^88this믷p0)f(c}'errBNa"ERROR! In Point::isp{_on_segment():\n"g<"*this and the arguments p0 and p1 are a ll equal. "Ng<"Returning false and INVALID_REAL.\n";(returnKpair`bϷhbQoolL;reali(falseD;INVALID_REALA0);gelse4.7if?/(p0طp1)f(c}'err=|·"ERROR! In Point::isk_on_segment():\n"T)"Arguments p0 and p1k are equal. "T5<"Returning false and INVALID_REAL.\n";(returnKpair`bϷhbQoolL;reali(falseD;INVALID_REALA0);gelse4.7if?/(thisϷp0ث)f(returnKpair`bϷhbQoolL;reali(trueĘ;0:0q);gelse4.7if?/(thisϷp1ث)f(returnKpair`bϷhbQoolL;reali(trueĘ;1:0q);g==[LDFT2002.10.29.]T7BeginningUUofnewcoGde.o=P9oint 8BeginTLogJʄ`> -[LDFT2002.10.29.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -bQoolus4wreal;@isffonffse}'gmentxuѫ(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rū)UUconst*;\"Ӡn썫92CONST&Fp1Rū)UUconst*;]-n썷x3533DLDFPRÎG9CONST@ VERSION93n@P353.hDe neUUP9oint"Dfunctions@285i+ bQoolus4wreal;@P9ointWΫ::isffonffse}'gment>5S(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rū)UUconst fP9oint2a88ϫ(this뷫);return7漱a=/:isffonffse}'gment=5O(p0 ;p1 h); -g354. Isonline.[LDFT2002.10.29.]ZFnTO|DO:MaybGeaddanon-constګversion.[Thisisn'turgent, though.c9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.10.29.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +g354. Isonline.[LDFT2002.10.29.]ZFnTO|DO:MaybGeaddanon-constګversion.[Thisisn'turgent, though.N99Ȅ`+U 8Log)j`+U +[LDFT2002.10.29.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ bQoolus4wreal;@isffonfflinee(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rū)UUconst*;355.hDe neUUP9oint"Dfunctions@285i+ bQoolus4wreal;@P9ointWΫ::isffonffline+[(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rū)UUconst fbQoolus4wrealE@brRo=isffonffse}'gment?g(p0 ;p1 h);if(br gs:se}'cond n߷6=INVALID_REALBM\)brgs: rst|«=true;return7brBN/; -g356. IsonPlane.[LDFT2003.06.04.]ZhThis5functionreturnstrueE,<if5thisWliesonthePlane#Lp(T,otherwisefalseD.qItUUmustbGede nedinplanes.web,becausePlane# isanincompletetypehere.r9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.06.04.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -bQool#gisffonffplaneU$A(const*Plane>aZ&F(xpK0x)UUconst*;357. Isintriangle.[LDFT2003.06.11.]YThis 8BeginTLogJʄ`> +g356. IsonPlane.[LDFT2003.06.04.]ZhThis5functionreturnstrueE,<if5thisWliesonthePlane#Lp(T,otherwisefalseD.qItUUmustbGede nedinplanes.web,becausePlane# isanincompletetypehere.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.04.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +bQool#gisffonffplaneU$A(const*Plane>aZ&F(xpK0x)UUconst*;357. Isintriangle.[LDFT2003.06.11.]YThis`hDeclareUUP9oint"Dfunctions@284i+ +[LDFT2003.06.24.]Y;RemovedUUtheargumenttestffp}'oints1}J.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ bQool#[isffinfftriangle]y(constsP9oint='&EsEp0Q;const >P9oint?Vϫ&Gp1S4;const >P9oint?Vϫ&Gp2;bQoolverb}'ose?g=@false)const8P;358. T -ransformations.359. AneTtransformations.]2(n썷x3603DLDFPRÎG7wROTJATIONXARÎOUNDTHEMAINAXES93n@P360. RotationTaroundthemainaxes.9Ȅ`> 8BeginTLogJʄ`> +ransformations.359. AneTtransformations.^=n썫94RÎOTJATIONXAROUNDTHEMAINAXES7w3DLDFPRGx360n@P360. RotationTaroundthemainaxes.9Ȅ`+U 8Log)j`+U [LDFT2003.01.22.]YReplacedbGodyoffunction.\4T ransform;ϵ::r}'otateoB()returnsaT ransform`hDeclareUUP9oint"Dfunctions@284i+ +ransform;'tBinthisfunction.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ T ransformAr}'otate\8(const*real4бx:;constJreal6xy>=0;constJreal6xz>f=0);361.hDe neUUP9oint"Dfunctions@285i+ T ransformAP9oint^c::r}'otateoB(const*real4бx:;constJreal6xy;p;constJreal6xz;) freturn7tr}'ansformc:r}'otateo>(x;y;zƫ); -g362. Scale.9Ȅ`> 8BeginTLogJʄ`> +g362. Scale.9Ȅ`+U 8Log)j`+U [LDFT2003.01.22.]Xr1ReplacedKbGodyoffunction.?T ransform9E::sc}'ale()returnsaT ransform9representingtherotationUUonly*,soIdon'tneedtousealoGcallydeclaredT -ransform;'tBinthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +ransform;'tBinthisfunction.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ T ransformAsc}'aleW}ū(real.xjJ;real]ֱy g=1;real]ֱz < =1);363.hDe neUUP9oint"Dfunctions@285i+ T ransformAP9oint^c::sc}'ale(real.xjJ;real]ֱy;real]ֱzt) freturn7tr}'ansformc:sc}'ale(x;y;zƫ); -g364. Shear.9Ȅ`> 8BeginTLogJʄ`> +g364. Shear.9Ȅ`+U 8Log)j`+U [LDFT2003.01.22.]YߞReplaced,bGodyoffunction.T ransform()returnsaT ransform`hDeclareUUP9oint"Dfunctions@284i+ +ransform;'tBinthisfunction.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ T ransformAshe}'arY (real.xy!;real]xz%=0;real]yx&Z=0;real]yz%6=0;real]zx%Y=0;real]zy%|=0);365.hDe neUUP9oint"Dfunctions@285i+ T ransformAP9oint^c::she}'ar4>(real.xy!;real]xz"ը;real]yx#;real]yz# ;real]zx"A;real]zy") freturn7tr}'ansformc:she}'ar4:(xy ;xz "z;yx V;yz Y;zx ;zy «); -g366. Shift.367. P9ointTversions.^@(n썫94THREEXREALARÎGUMENTSX3DLDFPRGx368n@P368. ThreeTrealargumen9ts.hDeclareUUP9oint"Dfunctions@284i+ +g366. Shift.367. P9ointTversions._Jn썷x3683DLDFPRÎGXTHREEXREALARGUMENTS95n@P368. ThreeTrealargumen9ts.hDeclareUUP9oint"Dfunctions@284i+ T ransformAshiftUP(real.xjJ;real]ֱy g=0;real]ֱz < =0);369.hDe neUUP9oint"Dfunctions@285i+ T @@ -1352,18 +1382,18 @@ ransformAPicturehd::shift(const*P9oint=?&D]pI]) freturn7shiftL9(p:getffxg();p:getffyt();p:getffz()); g374. ShiftTtimes. -[LDFT2003.01.19.]YG.NoteHthatshiftfftimes2()willonlyhaveHane ectifit'scalledafterիacalltoshiftū()andb}'eforeanUUopGerationisappliedthatcausesapplyfftr}'ansformIu4()tobecalled.c9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.01.19.]Y;AddedUUthissection.Ȅ` 8EndTLogA>`_Mwn썷x3753DLDFPRÎGXTHREEXREALARGUMENTS95n@P375. ThreeTrealargumen9ts.U9Ȅ`> 8BeginTLogJʄ`> +[LDFT2003.01.19.]YG.NoteHthatshiftfftimes2()willonlyhaveHane ectifit'scalledafterիacalltoshiftū()andb}'eforeanUUopGerationisappliedthatcausesapplyfftr}'ansformIu4()tobecalled.N99Ȅ`+U 8Log)j`+U +[LDFT2003.01.19.]Y;AddedUUthissection.Ȅ`G`W_n썫96THREEXREALARÎGUMENTSX3DLDFPRGx375n@P375. ThreeTrealargumen9ts.9Ȅ`+U 8Log)j`+U [LDFT2003.01.19.]Y;AddedUUthisfunction. [LDFT2003.01.22.]Yh$Got>ridofloGcalT -ransform;t?zk.Itwasn'tneeded.NowjustreturningthereturnvqalueofUUtr}'ansform/:shiftfftimes.;().Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +ransform;t?zk.Itwasn'tneeded.NowjustreturningthereturnvqalueofUUtr}'ansform/:shiftfftimes.;().Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ T ransformAshiftfftimesp(real.xjJ;real]ֱy g=1;real]ֱz < =1);376.hDe neUUP9oint"Dfunctions@285i+ T ransformAP9oint^c::shiftfftimes/?(real.xjJ;real]ֱy;real]ֱzt) freturn7tr}'ansformc:shiftfftimes.;(x;y;zƫ); -g377. P9ointTargument.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.01.19.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +g377. P9ointTargument.9Ȅ`+U 8Log)j`+U +[LDFT2003.01.19.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ T ransformAshiftfftimesp(const*P9oint=?&D]pI]);378.hDe neUUP9oint"Dfunctions@285i+ T @@ -1371,8 +1401,8 @@ freturn7tr}'ansformc:shiftfftimes.;(p:getffxg();p:getffyt();p:getffz()); g379. Alignmen9t?withanaxis.Declared.intransfor.web.De nedhere,dbGecauseitneedsP9oints$R+.[LDFT2002.10.23.]Nalignffwithffaxis()!:returnstheT ransform:neededtoalignȍ!g!N8p0|sp1KZwithoneofthemainaxes. -[LDFT2003.05.04.]Y;BUG:UUTODO:T*ryto ndoutwhyIsometimesgeterroneousresultswithr}'otateo>(P9ointH;P9ointD;real)UU(formerlyr}'otateffaround?()).qIthinktheproblemmaybGehere.c9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.12.10.]YӻMade thisfunctionafriend&SinclasșP9oint;f.HNowcallingp07:applyfftr}'ansformF߫()andp1 :applyfftr}'ansformF߫()UUatthebGeginningofthisfunctionandusingp0l:worldffc}'oordinatesPiSandp1 :worldffc}'oordinatesPiSdirectlyUUinsteadofgetffx㼫(),getffyk(),andgetffz]V().Ȅ` 8EndTLogA>``Y͠n썫96ALIGNMENTXWITHANAXIS3DLDFPRÎGx380n@P380.hDe neUUT +[LDFT2003.05.04.]Y;BUG:UUTODO:T*ryto ndoutwhyIsometimesgeterroneousresultswithr}'otateo>(P9ointH;P9ointD;real)UU(formerlyr}'otateffaround?()).qIthinktheproblemmaybGehere.N99Ȅ`+U 8Log)j`+U +[LDFT2002.12.10.]YӻMade thisfunctionafriend&SinclasșP9oint;f.HNowcallingp07:applyfftr}'ansformF߫()andp1 :applyfftr}'ansformF߫()UUatthebGeginningofthisfunctionandusingp0l:worldffc}'oordinatesPiSandp1 :worldffc}'oordinatesPiSdirectlyUUinsteadofgetffx㼫(),getffyk(),andgetffz]V().Ȅ`Gacn썷x3803DLDFPRÎGALIGNMENTXWITHANAXIS97n@P380.hDe neUUT ransform;'functions@125i+ T ransformAT @@ -1386,7 +1416,7 @@ zcoGordinates2areUUallpGositive.qSeebelowfortheexplanation.o=if)(DEBUGY)f(t+v:show("t outside of normahlization");gP9oint<pr}'ojffonffxffzffplane,"(p1 );=v[LDFT2002.10.23.]S)Get!thepro8jectionofp1Z\onthex-zplane. B= pr}'ojffonffxffzffplaneUp :shift}(0; qp1:worldffc}'oordinatesM[1]); -if(DEBUGY)pr}'ojffonffxffzffplanePp :show("proj_on_x_z_plane"dF/);afn썷x3823DLDFPRÎGALIGNMENTXWITHANAXIS97n@P382. [LDFT2002.10.23.]ZJIfwe'realigningwiththexory-axis,$ rotatep1F6ontothex-yplaneandthentothe x-axis.hDe neUUT +if(DEBUGY)pr}'ojffonffxffzffplanePp :show("proj_on_x_z_plane"dF/);bp1n썫98ALIGNMENTXWITHANAXIS3DLDFPRÎGx382n@P382. [LDFT2002.10.23.]ZJIfwe'realigningwiththexory-axis,$ rotatep1F6ontothex-yplaneandthentothe x-axis.hDe neUUT ransform;'functions@125i+ if(axis'x'FW_8axis<'y' w)fP9oint2ptffonffxffaxishЫ;ptffonffxffaxisI3:set x(1);angle.m=pr}'ojffonffxffzffplaneN7!:angleS(ptffonffxffaxis51);if(DEBUGY)c}'out O"angle of projectionk: "~SangleNendl ush;if(anglek6=0 ^8angleK6=INVALID_REALBM\)t c=p1':r}'otateo>(0; qangle!2);if(DEBUGY)p1:show("p1 after rotation tho x-y plane");angle.m=p1ر:angleS(ptffonffxffaxis51);if(DEBUGY)c}'out O"angle to x-axis: "i_angleNendl ush;if(anglek6=0 ^8angleK6=INVALID_REALBM\)t c=p1':r}'otateo>(0;0; qangle!2);if(DEBUGY)p1:show("p1 after rotation tho x-axis"); g383. [LDFT2002.10.23.]YNJIfwe'realigningwiththez-axis,2rotatep1@ontothey-zplaneandthentothez-axis.hDe neUUT @@ -1394,8 +1424,8 @@ else .5if+-(axis'z' w)UUfP9oint"DptffonffzffaxisVV; ptffonffzffaxis>e:set x(0;0;1);=<[LDFT2002.10.23.]TqThisrassumesthatpr}'ojffonffxffzffplaneO{:getffz()+H0+I.&ItshouldUUbGe,butifitisn't,thefollowingerrorhandlingcodetakescareoftheproblem.o= if(pr}'ojffonffxffzffplaneKp :getffz()<0)fc}'err.M<"ERROR! In TransformpM::align_with_axis():L\n"_("proj_on_x_z_plane.get_z() < 0\n" "@l should ensure that "("this value is >= 0.\n"[2 "Handling the error,l but find out why it happened!"o(endl>޷endl ush;ptffonffzffaxisHf:set x(0;0; qƫ1q); -g384.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.12.10.]Y:Added=Tthefollowingconditional.)T*ryingto xabugthatoGccurredwhileportingtoGNU/Linux.Ȅ` 8EndTLogA>`hDe neUUT +g384.9Ȅ`+U 8Log)j`+U +[LDFT2002.12.10.]Y:Added=Tthefollowingconditional.)T*ryingto xabugthatoGccurredwhileportingtoGNU/Linux.Ȅ`GhDe neUUT ransform;'functions@125i+ if(pr}'ojffonffxffzffplaneKp :worldffc}'oordinatesM[0]0 ^8pr}'ojffonffxffzffplaneM:worldffc}'oordinates[1]0)anglek=0; else!angle<`K=pr}'ojffonffxffzffplaneN7!:angleS(ptffonffzffaxis4d);385.hDe neUUT @@ -1403,9 +1433,9 @@ if(DEBUGY)c}'out O"angle of projectionk: "~SangleNendl ush; if(anglek6=0 ^8angleK6=INVALID_REALBM\)t c=p1':r}'otateo>(0;anglej); if(DEBUGY)p1:show("p1 after rotation tho z-y plane"); -p1:applyfftr}'ansformF߫();bsn썫98ALIGNMENTXWITHANAXIS3DLDFPRÎGx386n@P386.9Ȅ`> 8BeginTLogJʄ`> +p1:applyfftr}'ansformF߫();c|àn썷x3863DLDFPRÎGALIGNMENTXWITHANAXIS99n@P386.9Ȅ`+U 8Log)j`+U [LDFT2002.12.10.]Y:Added=Tthefollowingconditional.)T*ryingto xabugthatoGccurredwhileportingtoGNU/Linux. -[LDFT2003.06.13.]X=BUGFIX:9Changedpr}'ojffonffxffzffplaneP{top1+2inthe\if_"partofthefollowingconditional.The]/y-coGordinateofpr}'ojffonffxffzffplaneR*gisalways]/0,_&soanglezwasalwayssetto0.VI]-discoveredthisbugwhenI'tried'rotatingaP9oint!逫intheplaneofaRegus4wP9olygonGabGoutalinefromthecenteroftheRegus4wP9olygoninUUthedirectionofitsnormal,andtheresultingP9oint"Dwasnotinthesameplane.Ȅ` 8EndTLogA>`hDe neUUT +[LDFT2003.06.13.]X=BUGFIX:9Changedpr}'ojffonffxffzffplaneP{top1+2inthe\if_"partofthefollowingconditional.The]/y-coGordinateofpr}'ojffonffxffzffplaneR*gisalways]/0,_&soanglezwasalwayssetto0.VI]-discoveredthisbugwhenI'tried'rotatingaP9oint!逫intheplaneofaRegus4wP9olygonGabGoutalinefromthecenteroftheRegus4wP9olygoninUUthedirectionofitsnormal,andtheresultingP9oint"Dwasnotinthesameplane.Ȅ`GhDe neUUT ransform;'functions@125i+ if(p1 :worldffc}'oordinatesM[1]0)anglek=0; else!angle<`K=p1ر:angleS(ptffonffzffaxis4d);387.hDe neUUT @@ -1421,13 +1451,13 @@ g this"з=2At5y; if(DEBUGY)c}'out O"Exiting Transform::kalign_with_axis."T)endl ush; -return-滱t1-;qǷgcn썷x3893DLDFPRÎG>NORMALIZEXPOINT99n@P389. NormalizepQoin9t.It'qmakesiteasiertodeterminethecorrectdirectionofrotationtowardthex-y orxy-zplaneifp1'scoGordinatesareall>=0,sowerotateitinordertomakethemso.Theonlycasethatrequires.morethanarotationaroundasingleaxisisthecasethatx 0ercmmi7p1ū,6Jyp1,and.zp1 Lareall<0.dItwouldbGeniceUUifIcouldreplacethislongconditionalwithamoreelegantconstruction,butIdon'tknowone.hNormalizeUUpGoint@389i +return-滱t1-;qǷgdn썫100NORMALIZEXPOINT>3DLDFPRÎGx389n@P389. NormalizepQoin9t.It'qmakesiteasiertodeterminethecorrectdirectionofrotationtowardthex-y orxy-zplaneifp1'scoGordinatesareall>=0,sowerotateitinordertomakethemso.Theonlycasethatrequires.morethanarotationaroundasingleaxisisthecasethatx 0ercmmi7p1ū,6Jyp1,and.zp1 Lareall<0.dItwouldbGeniceUUifIcouldreplacethislongconditionalwithamoreelegantconstruction,butIdon'tknowone.hNormalizeUUpGoint@389i fif(DEBUGY)p1:show("p1 before normalizahtion");if(p1 :worldffc}'oordinatesM[0]<0 ^8p1O:worldffc}'oordinates[1]0 ^8p1O:worldffc}'oordinates[2]0)(=xUUnegative,yandzpGositive.o=t$c=3p1@:r}'otateo>(0; qƫ90q);else*.6if5.(p1 :worldffc}'oordinatesM[0]0 ^8p1O:worldffc}'oordinates[1]<0 ^8p1O:worldffc}'oordinates[2]0)(=xUUpGositive,ynegative,zpGositive.o=t$c=3p1@:r}'otateo>(90 );else*.6if5.(p1 :worldffc}'oordinatesM[0]0 ^8p1O:worldffc}'oordinates[1]0 ^8p1O:worldffc}'oordinates[2]<0)(=xUUpGositive,ypositive,znegative.o=t$c=3p1@:r}'otateo>(90 );else*.6if5.(p1 :worldffc}'oordinatesM[0]<0 ^8p1O:worldffc}'oordinates[1]<0 ^8p1O:worldffc}'oordinates[2]0)(=xUUnegative,ynegative,zpGositive.o=t$c=3p1@:r}'otateo>(0;0;180);else*.6if5.(p1 :worldffc}'oordinatesM[0]<0 ^8p1O:worldffc}'oordinates[1]0 ^8p1O:worldffc}'oordinates[2]<0)(=xUUnegative,ypGositive,znegative.o=t$c=3p1@:r}'otateo>(0;180);else*.6if5.(p1 :worldffc}'oordinatesM[0]0 ^8p1O:worldffc}'oordinates[1]<0 ^8p1O:worldffc}'oordinates[2]<0)(=xUUpGositive,ynegative,znegative.o=t$c=3p1@:r}'otateo>(180);else*.6if5.(p1 :worldffc}'oordinatesM[0]<0 ^8p1O:worldffc}'oordinates[1]<0 ^8p1O:worldffc}'oordinates[2]<0)=AllUUnegative.o=freal41a(180;180);t$c=3p1@:shift}(aI0);t$c=3p1@:r}'otateo>(0;180);t$c=3p1@:shift}(a N);gp1 ±:applyfftr}'ansformF߫();if(DEBUGY)fp0*ñ:show("p0 after normalizathion"~ );p1*ñ:show("p1 after normalizathion"~ );t!u:show("t after normalizatihon"yF#);g -g ThisXco 8BeginTLogJʄ`> +g ThisXco`hDeclareUUP9oint"Dfunctions@284i+ +[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ T ransformAr}'otate\8(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rű;constJreal6xangleQ=180);393.hDe neUUP9oint"Dfunctions@285i+ T @@ -1436,16 +1466,16 @@ ransformKԱtOeF;if(aHb J_8a I( 6b)fc}'err3K"WARNING! In Point::lfrotate().\n"L"Point to be rotatedlf lies on axis.\n"=2"Returning identity Transform.\n\n"  ush;returnA潱tE/;greturn7tr}'ansformc:r}'otateo>(p0 ;p1 h;anglej); -g394. P9ath**argument.De nedinpaths.web,bGecauseP9athϘisstillanincompletetypeinthiscompi-lationUUunit.9Ȅ`> 8BeginTLogJʄ`> +g394. P9ath**argument.De nedinpaths.web,bGecauseP9athϘisstillanincompletetypeinthiscompi-lationUUunit.9Ȅ`+U 8Log)j`+U [LDFT2002.04.07.]Y;AddedUUdefaultvqalueforanglej180. -[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ T -ransformAr}'otate\8(const*P9ath:[&AypFy;constJreal6xangleQ=180);e|n썷x3953DLDFPRÎGTRANSF9ORMXVERSION101n@P395. T -ransform"v9ersion.Declaredintransfor.web.:[LDFT2002.09.29.]TTO DO:PossibleBUG!!:Ac- tually*,qtheproblemthatoGccurredmayjusthavetodochoGosingthedirectionofrotation.;I'vechangedtheplaceUUwheretheproblemoGccurred,soI'llhaveUUtowritearoutinetotestthis.U9Ȅ`> 8BeginTLogJʄ`> +ransformAr}'otate\8(const*P9ath:[&AypFy;constJreal6xangleQ=180);fcn썫102TRANSF9ORMXVERSION3DLDFPRÎGx395n@P395. T +ransform"v9ersion.Declaredintransfor.web.:[LDFT2002.09.29.]TTO DO:PossibleBUG!!:Ac- tually*,qtheproblemthatoGccurredmayjusthavetodochoGosingthedirectionofrotation.;I'vechangedtheplaceUUwheretheproblemoGccurred,soI'llhaveUUtowritearoutinetotestthis.9Ȅ`+U 8Log)j`+U [LDFT2002.10.23.]XqChanged,KsoHthatthedirectionofȍrg!N8p0|sp1istested.mIfitisparalleltothexory-axis,thenthat^kaxisisusedforalignment. Otherwise,`thez-axisisused.Thismayhelpreduceinaccuraciescausedbyrotations.qHaven'tUUtestedityet.TODO:T*estthis! [LDFT2002.11.03.]Y;TOUUDO:SeeifIcan'tmakeP9oint"Dargumentsconst*. -[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ` 8EndTLogA>`hDe neUUT +[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ`GhDe neUUT ransform;'functions@125i+ T ransformAT @@ -1455,13 +1485,13 @@ 617)axis='y' w;else+axis@='z' w;T ransformKԱtOeF;tt:alignffwithffaxis@x(p0 ;p1 h;axisp);T ransformKԱiR=tc:inverse ();if(axis'x' w)tr:r}'otateo>(angleS);else*.6if5.(axis'y' w)tr:r}'otateo>(0;anglej);else+t/uS:r}'otateo>(0;0;anglej);tc=)ñi-c;tt:cle}'anA();this,ѷ= 8BeginTLogJʄ`> -[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ` 8EndTLogA>`hDe neUUPicture,Ffunctions@219i+ +ggϠn썷x3963DLDFPRÎG6PICTUREXVERSION103n@P396. PictureTv9ersion.[LDFT2002.10.20.]Z6angleuޫisUUindegrees.N99Ȅ`+U 8Log)j`+U +[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ`GhDe neUUPicture,Ffunctions@219i+ T ransformAPicturehd::r}'otateoB(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rű;constJreal6xangleNH˫) fT ransformKԱtOeF;tt:r}'otateo>(p0 ;p1 h;anglej);tr}'ansformBz[=RtU;return7漱t;.; -g397. Projection.[LDFT2002.10.23.]\EF*orstylisticreasons,andforthesakeofcleanprogramming,IbGelieve_$thattheprogrammerwhousespr}'oject"2()shouldensurethatapplyfftr}'ansformJ()hasbGeeninvoked rst.7However,wtr}'ansform2ispcheckedinpr}'oject!ޫ()andapplyfftr}'ansformI()isinvoked,wifrequired,soinvokingapplyfftr}'ansformF߫()UUexplicitlybGeforehandisnotstrictlyspeakingnecessary*.9Ȅ`> 8BeginTLogJʄ`> +g397. Projection.[LDFT2002.10.23.]\EF*orstylisticreasons,andforthesakeofcleanprogramming,IbGelieve_$thattheprogrammerwhousespr}'oject"2()shouldensurethatapplyfftr}'ansformJ()hasbGeeninvoked rst.7However,wtr}'ansform2ispcheckedinpr}'oject!ޫ()andapplyfftr}'ansformI()isinvoked,wifrequired,soinvokingapplyfftr}'ansformF߫()UUexplicitlybGeforehandisnotstrictlyspeakingnecessary*.9Ȅ`+U 8Log)j`+U [LDFT2002.09.09.]XmThe3newversionnowalmostworksAddeddivisionofpr}'ojectiveffcoordinatesd*ybythevqaluecalculated6forw Eث.iHowever,it6doGesn'tworkwhenIusehexffp}'attern1;~().Findoutwhynot!!TODO:AddroutineUUforcalculatingzls.qThenIcanaddsortingroutineinPicture)f::outputD(). [LDFT2002.09.14.]Y Im"bGelievem(I'vegottenthenewversiontoworknow.ALOOKm"UP:DoIneedtodividethederived]z vqalue]byw ˑ?I]don'tthinkit'snecessary*.Sincethez vqaluesofalloftheP9oints&bwouldbGedividedbythesameamount,OtheirrelativepGositionswouldremainthesame,Osinceonlytherelationship\closerorfurtherUUaway"matters,nottheexactamounts. @@ -1469,22 +1499,22 @@ oQcus#argumenta tothisfunction.(Defaultisdefaultfffo}'cus;?,dbutitwasnecessaryto*writeadummyversionofthisfunctioninordertomakethiswork,3bGecausedefaultfffo}'cus>3doesn'texistattheUUtimethatthisdeclarationiscompiled. [LDFT2002.09.18.]X*ChangedaDnameofthisfunctionfromp}'erspfftransformH`k()topr}'oject#9andaddedT ransformargument. -[LDFT2003.05.09.]YBUGEFIX:EAddedloGop,settingallelementsofpr}'ojectiveffcoordinatesgAto0.CThiswasdoneintheconditionallycompiledcoGdefortheDECcompiler,ώbutIforgottodoitforGCCwhenaddedtheUUdeclarationoftempffc}'oordinatesQQ%andresizedit.qIttoGokmeabout6{7hoursto ndthisbug!Ȅ` 8EndTLogA>`398. F -oQcusTargumen9t.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.07.11.]Y;AddedUUdefaultsforpr}'ojmandfactorY3.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +[LDFT2003.05.09.]YBUGEFIX:EAddedloGop,settingallelementsofpr}'ojectiveffcoordinatesgAto0.CThiswasdoneintheconditionallycompiledcoGdefortheDECcompiler,ώbutIforgottodoitforGCCwhenaddedtheUUdeclarationoftempffc}'oordinatesQQ%andresizedit.qIttoGokmeabout6{7hoursto ndthisbug!Ȅ`G398. F +oQcusTargumen9t.9Ȅ`+U 8Log)j`+U +[LDFT2003.07.11.]Y;AddedUUdefaultsforpr}'ojmandfactorY3.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ bQool#gpr}'ojectBu(const*F -oQcus>uC&FuC&FuC&F 8BeginTLogJʄ`> +0++)f2tempffc}'oordinates|[iq]+=lworldffc}'oordinatesb0j[jī]8f1:getfftr}'ansformffelementa=ū(j;i);(ggin썷x4003DLDFPRÎGKPJARALLELXPROJECTION105n@P400. P9arallelTprojection. [LDFT2002.11.06.]OLTODO:Addawayofpro8jectingontoaplaneotherthanthex-yplane.?It'spGossibletoacheiveJqthesamee ectbyrotatingthePicture,0bGeforeoutputtingit,LbutitwouldbGenicetodosowithoutchangingUUthePicture(b. +TheUUxandypro8jectivecoGordinatesaresimplytakenfromtheworldcoGordinates.9Ȅ`+U 8Log)j`+U [LDFT2002.10.23.]Y;AddedUUthissection. -[LDFT2002.12.18.]Y;ChangedUUPARALLEL10toUUPARALLEL_X_YF0andUUaddedPARALLEL_X_ZandPARALLEL_Z_YBۙ.Ȅ` 8EndTLogA>`hDe neUUP9oint"Dfunctions@285i+ +[LDFT2002.12.18.]Y;ChangedUUPARALLEL10toUUPARALLEL_X_YF0andUUaddedPARALLEL_X_ZandPARALLEL_Z_YBۙ.Ȅ`GhDe neUUP9oint"Dfunctions@285i+ if9(pr}'ojZCfProjections?2::E"PARALLEL_X_Y&p_ pr}'oj9MfProjections?2::E"PARALLEL_X_Z_ pr}'oj(Projectionsbh::iZPARALLEL_Z_Y)fusing2SnamespacekProjectionsb;if(factor0)fc}'err3˷""ERROR! In Point::prloject():\n"fO""factor == 0. Multilplying coordinates b\2y 0 doesn't make sense. ":"Using 1 instead.\n\kn"yV ush;factor;=1;gunsignedD7shortbhorizontal;unsignedD7shortbvertic}'al;if(pr}'oj۷PARALLEL_X_YD<_8pr}'ojPARALLEL_X_ZBM\)=[LDFT2002.12.18.]T7ExplainUUthis!!o=horizontalC}=0;else+horizontal[|\=2;if(pr}'oj۷PARALLEL_X_YD<_8pr}'ojPARALLEL_Z_YBM\)vertic}'al(=1;else+vertic}'alO=2;pr}'ojectiveffcoordinatesr[0]=worldffc}'oordinatesO[horizontal,c]8factor<;pr}'ojectiveffcoordinatesr[1]=worldffc}'oordinatesO[vertic}'al!]8factor<;pr}'ojectiveffcoordinatesr[2]=0;pr}'ojectiveffcoordinatesr[3]=1;if(DEBUGY)fc}'out6Ck1"projective_coordinamtes: ("y1pr}'ojectiveffcoordinatescD[0]1", "Z2pr}'ojectiveffcoordinates[1]B{", " Rpr}'ojectiveffcoordinatesc[2]", " R2pr}'ojectiveffcoordinates[3]")"ԏendlendl ush;greturn7trueJT; -gin썷x4013DLDFPRÎGyPERSPECTIVEXPROJECTION105n@P401. P9erspQectiveprojection.!!KLUDGE:9SeebGelow.[LDFT2002.11.08.]W 0TO9fDO:GetnumbGers9to outputUUusingonly7ҫdecimalnotation!hDe neUUP9oint"Dfunctions@285i+ +gjɠn썫106PERSPECTIVEXPRÎOJECTIONy3DLDFPRGx401n@P401. P9erspQectiveprojection.!!KLUDGE:9SeebGelow.[LDFT2002.11.08.]W 0TO9fDO:GetnumbGers9to outputUUusingonly7ҫdecimalnotation!hDe neUUP9oint"Dfunctions@285i+ if(tempffc}'oordinatesJ{[2]8+f1:getffdistanc}'e4y()0)fc}'err)|"ERROR! In Point::prkoject():\n";"temp_coordinates[2]k == "TMtempffc}'oordinatesMm[2](", f.distance == "Ϯxf^:getffdistanc}'e4y()xendl"Sum == 0. Can't perk
epsګ)?saveffz!v:0; -if(DEBUGY)fc}'out* Q"Perspective coordinkates:\n(");for%舫(i9 =0;i 9 <4;i++)fc}'out4 Rpr}'ojectiveffcoordinatesa}+[iq];if)(i9 <3)c}'out O", "Mt;gc}'out* Q")\n" T ush;jȠn썫106PERSPECTIVEXPRÎOJECTIONy3DLDFPRGx401n@P +if(DEBUGY)fc}'out* Q"Perspective coordinkates:\n(");for%舫(i9 =0;i 9 <4;i++)fc}'out4 Rpr}'ojectiveffcoordinatesa}+[iq];if)(i9 <3)c}'out O", "Mt;gc}'out* Q")\n" T ush;k탠n썷x4013DLDFPRÎGyPERSPECTIVEXPROJECTION107n@P g for臫(i9 =0;i 9 <2;i++)=%d[LDFT2002.11.07.]TSKLUDGE.zAddedthisloGop.Thevqalueusedforcomparisonisslightlylarger(thangonethatarosewhileIgwastestingtheconstructorofT;runcffOctahe}'dronT.eps2wastoGosmall.(=if(fabs2ҫ(pr}'ojectiveffcoordinates^[iq])10:0810^054)pr}'ojectiveffcoordinatesc[i]=0; if(DEBUGY)c}'out O"Exiting project().\kn"yV ush; @@ -1517,30 +1547,30 @@ freturn7pr}'ojectV]ʫ(defaultfffo}'cus7;pr}'ojk;factor); g404. Applying transformations.ThisrversionappliesthetransformationstoredinP9ointR::tr}'ansform,E.!!]AddRaversionthatappliesaT ransform9suppliedasanargument!!][LDFT2002.12.08.]R WBUGQFIX:SeebGelow.hDeclareUUP9oint"Dfunctions@284i+ -v9oid"applyfftr}'ansformi();kn썷x4053DLDFPRÎGړAPPLJYINGXTRANSFORMATIONS107n@P405.hDe neUUP9oint"Dfunctions@285i+ +v9oid"applyfftr}'ansformi();lVn썫108APPLJYINGXTRANSFÎORMATIONSړ3DLDFPRGx405n@P405.hDe neUUP9oint"Dfunctions@285i+ v9oid"P9oint?%::applyfftr}'ansformG() fbQool-hDEBUGK.٫=falsev\;=trueĒ=if?(tr}'ansform+A:isffidentity-2())=BIfOtr}'ansform/۱:matrix!5isOtheidentityOmatrix,Pwedon'tneedtobGother2toUUpGerformthematrixmultiplication.o=return>h;in9t%i);in9t%j*U;v\ralarra9y=ZChreal]ٷiUUnewffc}'oordinatesI;newffc}'oordinatesZNR:r}'esizei(4;0);=[LDFT2002.12.08.]T7BUGUUFIX.F*orGNUCC.=if(DEBUGY)fc}'out4 R"x == "*ԃworldffc}'oordinatesO[0]endl ush;c}'out4 R"y == "*ԃworldffc}'oordinatesO[1]endl ush;c}'out4 R"z == "*ԃworldffc}'oordinatesO[2]endl ush;c}'out4 R"w == "*ԃworldffc}'oordinatesO[3]endl ush;gfor%舫(i9 =0;i 9 <4;i++)ffor/艫(jwܫ=0;j w<4;j 0++)f(newffc}'oordinatesnNT[iq]+=lworldffc}'oordinatesb0j[jī]8tr}'ansform-!:matrix?[j][iq];(if3(newffc}'oordinatesFNP[iq]6=0)f2if=(DEBUGY)f<c}'outR U"new_coordinates["dbi $"] == "*ԃnewffc}'oordinatesIh[iq]endl ush;2g(gggreal*0eps< =epsilon"6();for%舫(i9 =0;i 9 <4;i++)fif)(DEBUGY)f(c}'out> S"new_coordinates["dbi $"] == "*ԃnewffc}'oordinatesIh[iq]endl ush;gworldffc}'oordinatesk[iq]=(fabs2ҫ(newffc}'oordinatesFNP[i])>epsګ)?newffc}'oordinatesIh[i]:0;gtr}'ansform?C:r}'esetƷ(); g406. SetTtransformtoiden9tity .hDeclareUUP9oint"Dfunctions@284i+ -v9oid"r}'esetfftransformf2();ln썫108SETXTRANSF9ORMTOIDENTITYũ3DLDFPRÎGx407n@P407.hDe neUUP9oint"Dfunctions@285i+ +v9oid"r}'esetfftransformf2();mn썷x4073DLDFPRÎGũSETXTRANSF9ORMTOIDENTITY109n@P407.hDe neUUP9oint"Dfunctions@285i+ v9oid"P9oint?%::r}'esetfftransformD]() ftr}'ansform?C:r}'esetƷ(); g408. Dra9wing.409. Dra9wdot. [LDFT2002.10.26.]Zdr}'awdot~0f()copies thisandputsthecopyontothev9ector)~Fshap}'esKVΫofthePictureargumentpictur}'e"ԫ.ThedatamembGersdr}'awdotffvalue@ǫ,hdr}'awdotffcolor@,handp}'enareonlysetonthecopy*,hnotonUUUVthisA .qAllUUofthedrawingand llingfunctionsbGehavesimilarly*. -[LDFT2003.05.30.]XTO@DO:@AddcoGdeforallocatingnewColor,Eifddr}'awdotffcolorD:useffname-?isfalse9,asintheUUdrawingand llingfunctionsforP9ath<andSolid,.410. NormalTv9ersion.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.07.11.]Y;MadeUUpp}'enͫandUUdr}'awdot&֫()UUitselfconst*.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +[LDFT2003.05.30.]XTO@DO:@AddcoGdeforallocatingnewColor,Eifddr}'awdotffcolorD:useffname-?isfalse9,asintheUUdrawingand llingfunctionsforP9ath<andSolid,.410. NormalTv9ersion.9Ȅ`+U 8Log)j`+U +[LDFT2003.07.11.]Y;MadeUUpp}'enͫandUUdr}'awdot&֫()UUitselfconst*.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ v9oid"Pdr}'awdotE6(const}~Color 8BeginTLogJʄ`> +gnn썫110PICTUREXARÎGUMENTFIRSTUW3DLDFPRGx412n@P412. PictureTargumen9t rst.9Ȅ`+U 8Log)j`+U [LDFT2002.01.24.]Y;AddedUUthisversion. [LDFT2003.01.31.][Removedm defaultforpictur}'e$u. Havingadefaultmadecallstodr}'awdot)()withnoargumentsUUambiguous. -[LDFT2003.07.11.]Y;MadeUUpp}'enͫandUUdr}'awdot&֫()UUitselfconst*.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +[LDFT2003.07.11.]Y;MadeUUpp}'enͫandUUdr}'awdot&֫()UUitselfconst*.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ v9oid"Edr}'awdotF_ƫ(Picture(Ϋ&0pictur}'eO±;constColor?&F3ddr}'awdotffcolor9O=Colors)::0.5defaultffc}'olorg;conststringpp}'en5>="" z)UUconst*;413.hDe neUUP9oint"Dfunctions@285i+ v9oid"P9oint?%::dr}'awdot$(Picture(b&0pictur}'eOV;constJColor?z=&GA[ddr}'awdotffcolor_;constJstring@pp}'enV0)UUconst fdr}'awdot7(ddr}'awdotffcolorA;pp}'en˱;pictur}'e ~); @@ -1550,79 +1580,79 @@ v9oid"P9oint?%::undr}'awdot/(string!%Mpp}'en6[p;Picture* &2c(pictur}'eQk) fP9oint27ptDU=cr}'eateffnewffp}'ointK();pt%=thisϫ;pt䟟~!dr}'awdotffvaluea=UNDRAWDOT2e;pt䟟~!dr}'awdotffcolora#L=Colors$::+.4b}'ackgroundffcolorur;#if 1pt䟟~!p}'en4k=pp}'en;;#endifpictur}'e5+=H%Dstaticus4wcast|hShapQe"Ab'Aci(pt 䝫); -g416. PictureTargumen9t rst.U9Ȅ`> 8BeginTLogJʄ`> +g416. PictureTargumen9t rst.9Ȅ`+U 8Log)j`+U [LDFT2002.01.24.]Y;AddedUUthisversion. -[LDFT2003.01.31.]ZdfRemoveddefaultforpictur}'e#V.HHavingadefaultmadecallstoundr}'awdot3B%()withnoargumentsUUambiguous.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -v9oid"undr}'awdotQ~(Picture(b&0pictur}'eOV;string"pp}'en:0="" z);n Pn썫110PICTUREXARÎGUMENTFIRSTUW3DLDFPRGx417n@P417.hDe neUUP9oint"Dfunctions@285i+ +[LDFT2003.01.31.]ZdfRemoveddefaultforpictur}'e#V.HHavingadefaultmadecallstoundr}'awdot3B%()withnoargumentsUUambiguous.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +v9oid"undr}'awdotQ~(Picture(b&0pictur}'eOV;string"pp}'en:0="" z);o'n썷x4173DLDFPRÎGUWPICTUREXARGUMENTFIRST111n@P417.hDe neUUP9oint"Dfunctions@285i+ v9oid"P9oint?%::undr}'awdot/(Picture(b&0pictur}'eOV;string"pp}'en8) fundr}'awdotB(pp}'en6#;pictur}'e ~); g418. Dra9w.[LDFT2002.10.26.][dr}'awq()0createsaPath!īwiththetwo0Points)?.?thisC˫and0theargumentp,aandtheconnector"--" ,callsP9ath::dr}'aw(߫()forit,andreturnstheP9ath.~Thelatterisaline,i.e.,P9athh::getfflineffswitch@ց()UUreturnstrueoBforit. -dr}'aw (ܫ()UUmustbGede nedinpaths.web,becauseP9ath<isanincompletetypehere.419. NormalTv9ersion.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.01.15.]Y;AddedUUtheargumentaarr}'ow".Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +dr}'aw (ܫ()UUmustbGede nedinpaths.web,becauseP9ath<isanincompletetypehere.419. NormalTv9ersion.9Ȅ`+U 8Log)j`+U +[LDFT2003.01.15.]Y;AddedUUtheargumentaarr}'ow".Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ P9ath&dr}'aw&FpK;const $ColorA'&Hddr}'awffcolor$=-- -.Colors+ ::1Jdefaultffc}'olori%;stringddashe}'dD,="" z;string"pp}'en:0="";Picture* -&2c(pictur}'eT3=curr}'entffpictureD߱;bQoolLaarr}'ow==falsev\)UUconst*;420. Pictureargumen9t rst.[LDFT2003.01.15.]ZcQThis0pfunctionisconvenient0pforwhenI0gwant0ptopassaPicture(bargument.U9Ȅ`> 8BeginTLogJʄ`> +&2c(pictur}'eT3=curr}'entffpictureD߱;bQoolLaarr}'ow==falsev\)UUconst*;420. Pictureargumen9t rst.[LDFT2003.01.15.]ZcQThis0pfunctionisconvenient0pforwhenI0gwant0ptopassaPicture(bargument.9Ȅ`+U 8Log)j`+U [LDFT2002.09.17.]Y;AddedUUthisfunction. -[LDFT2003.01.15.]Y;AddedUUtheargumentaarr}'ow".Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -P9ath%dr}'aw<(Picture(b&0pictur}'eOV;constJP9oint>&FpK;constJColor?z=&GA[ddr}'awffcolor~=Colors)::0.5defaultffc}'olorg;string?%Pddashe}'de3y="" z;string"pp}'en:0="";bQoolLaarr}'ow==falsev\);421. Dra9wTarrow.422. NormalTv9ersion.[LDFT2003.01.15.]Z6De nedUUinpaths.web.c9Ȅ`> 8BeginTLogJʄ`> +[LDFT2003.01.15.]Y;AddedUUtheargumentaarr}'ow".Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +P9ath%dr}'aw<(Picture(b&0pictur}'eOV;constJP9oint>&FpK;constJColor?z=&GA[ddr}'awffcolor~=Colors)::0.5defaultffc}'olorg;string?%Pddashe}'de3y="" z;string"pp}'en:0="";bQoolLaarr}'ow==falsev\);421. Dra9wTarrow.422. NormalTv9ersion.[LDFT2003.01.15.]Z6De nedUUinpaths.web.N99Ȅ`+U 8Log)j`+U [LDFT2003.01.15.]Y;AddedUUthisfunction. -[LDFT2003.06.03.]Y;MadeUUdr}'awarrow2H()UUconst*.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +[LDFT2003.06.03.]Y;MadeUUdr}'awarrow2H()UUconst*.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ P9ath&`dr}'awarrowUSz(constP9oint>7&EUpJU;const OFColor@n5&H5Sddr}'awffcolorb=fgColors*kE::0defaultffc}'olorhu^;stringddashe}'dD,="" z;string"pp}'en:0="";Picture* -&2c(pictur}'eT3=curr}'entffpictureD߫)UUconst*;o. n썷x4233DLDFPRÎGUWPICTUREXARGUMENTFIRST111n@P423. PictureTargumen9t rst.[LDFT2003.01.15.]Z6De nedUUinpaths.web.c9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.06.03.]Y;MadeUUdr}'awarrow2H()UUconst*.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -P9ath%dr}'awarrowT~(Picture(b&0pictur}'eOV;constJP9oint>&FpK;const;string#pp}'en;Z=8R"")const8P;424. Undra9w.425. Normalv9ersion.This,functionmustbGede nedinpaths.web,4becauseitusesP9ath,4whichisanincompleteUUtypGehere.U9Ȅ`> 8BeginTLogJʄ`> +&2c(pictur}'eT3=curr}'entffpictureD߫)UUconst*;p5Fn썫112PICTUREXARÎGUMENTFIRSTUW3DLDFPRGx423n@P423. PictureTargumen9t rst.[LDFT2003.01.15.]Z6De nedUUinpaths.web.N99Ȅ`+U 8Log)j`+U +[LDFT2003.06.03.]Y;MadeUUdr}'awarrow2H()UUconst*.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +P9ath%dr}'awarrowT~(Picture(b&0pictur}'eOV;constJP9oint>&FpK;const;string#pp}'en;Z=8R"")const8P;424. Undra9w.425. Normalv9ersion.This,functionmustbGede nedinpaths.web,4becauseitusesP9ath,4whichisanincompleteUUtypGehere.9Ȅ`+U 8Log)j`+U [LDFT2002.4.8.]O?AddedUUthisfunction. -[LDFT2002.11.03.]Y;ChangedUUthisfunction,sothatitreturnstheP9ath<p}'a*9R,insteadofv9oidث.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -P9ath'5undr}'awH[(constxP9oint?&G~ptQb;string$Qddashe}'dLY=Y"";string$Qpp}'en>Hͫ=Y"";Picture&%!pictur}'eG=curr}'entffpictureD߫);426. PictureTargumen9t rst.U9Ȅ`> 8BeginTLogJʄ`> +[LDFT2002.11.03.]Y;ChangedUUthisfunction,sothatitreturnstheP9ath<p}'a*9R,insteadofv9oidث.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +P9ath'5undr}'awH[(constxP9oint?&G~ptQb;string$Qddashe}'dLY=Y"";string$Qpp}'en>Hͫ=Y"";Picture&%!pictur}'eG=curr}'entffpictureD߫);426. PictureTargumen9t rst.9Ȅ`+U 8Log)j`+U [LDFT2002.09.17.]Y;AddedUUthisfunction.qIt'sconvenientUUforwhenIwantUUtopassaPicture,Fargument. -[LDFT2002.11.03.]Y;ChangedUUthisfunction,sothatitreturnstheP9ath<p}'a*9R,insteadofv9oidث.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -P9ath%undr}'awG (Picture(b&0pictur}'eOV;constJP9oint>&FptPp;string"ddashe}'dH="" z;string"pp}'en:0="");427. Dra9w+help.[LDFT2002.10.26.]Zdr}'awffhelps()islikedr}'awū(),exceptthattheP9ath8isonlydrawnifthewstatic"P9ath>(datawmembGerdoffhelpfflines>˷ttrue .Thisisconvenientfordrawingconstructionlinesthatshouldn'tUUbGeoutputinthe nalversionofadrawing.qAlso,thedefaultcolorisUVColors*.4::0rhelpffc}'olor\v.428. Normaldv9ersion.[LDFT2002.4.8.]RESThisRnfunctionmustbGede nedinpaths.web,becauseitusesP9athd,UUwhichisanincompletetypGehere.U9Ȅ`> 8BeginTLogJʄ`> +[LDFT2002.11.03.]Y;ChangedUUthisfunction,sothatitreturnstheP9ath<p}'a*9R,insteadofv9oidث.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +P9ath%undr}'awG (Picture(b&0pictur}'eOV;constJP9oint>&FptPp;string"ddashe}'dH="" z;string"pp}'en:0="");427. Dra9w+help.[LDFT2002.10.26.]Zdr}'awffhelps()islikedr}'awū(),exceptthattheP9ath8isonlydrawnifthewstatic"P9ath>(datawmembGerdoffhelpfflines>˷ttrue .Thisisconvenientfordrawingconstructionlinesthatshouldn'tUUbGeoutputinthe nalversionofadrawing.qAlso,thedefaultcolorisUVColors*.4::0rhelpffc}'olor\v.428. Normaldv9ersion.[LDFT2002.4.8.]RESThisRnfunctionmustbGede nedinpaths.web,becauseitusesP9athd,UUwhichisanincompletetypGehere.9Ȅ`+U 8Log)j`+U [LDFT2002.4.8.]O?AddedUUthisfunction. -[LDFT2003.07.13.]Y;MadeUUthisfunctionconst*.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +[LDFT2003.07.13.]Y;MadeUUthisfunctionconst*.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ P9ath&/dr}'awffhelpQO׫(constP9oint>a)&F(GptP ;const xColor@'&HEddr}'awffcolorhr=ׅׄColors*c::1>helpffc}'olor\;stringddashe}'dD,="" z;string"pp}'en:0="";Picture* -&2c(pictur}'eT3=curr}'entffpictureD߫)UUconst*;p<n썫112PICTUREXARÎGUMENTFIRSTUW3DLDFPRGx429n@P429. Pictureargumen9t rst.[LDFT2002.09.17.]ZMThislversionisconvenientforwhenI\wanttopassa Picture(bargument.U9Ȅ`> 8BeginTLogJʄ`> +&2c(pictur}'eT3=curr}'entffpictureD߫)UUconst*;qC8n썷x4293DLDFPRÎGUWPICTUREXARGUMENTFIRST113n@P429. Pictureargumen9t rst.[LDFT2002.09.17.]ZMThislversionisconvenientforwhenI\wanttopassa Picture(bargument.9Ȅ`+U 8Log)j`+U [LDFT2002.09.17.]Y;AddedUUthisfunction. -[LDFT2003.07.13.]Y;MadeUUthisfunctionconst*.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +[LDFT2003.07.13.]Y;MadeUUthisfunctionconst*.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ P9ath%dr}'awffhelpPb(Picture(b&0pictur}'eOV;constJP9oint>&FptPp;const<JColor[&c^ddr}'awffcolor-=Colors)::0.5helpffc}'olor[話;string"ddashe}'dHë="" z;string"pp}'en:ի="")8constG;430. Sho9wing.431. Sho9w.[LDFT2002.10.26.]Z6TheUUarguments:string!%Mtext IfUUtextvisUUnon-empty*,(i.e.,not""[),it'swrittentostandardoutput (stdout V).lIfqitisempty*,yorshow()iscalledwithoutanyarguments,ythe defaultUUisused,namely"Point:"-ۥ.c9harjIc}'oords Oneofthecharacters'w', 'p'j, 'u', or'v'ǫshouldbGeused,toindicate whichDsetofcoGordinatesshouldbeshown:Oworldffc}'oordinatesUc,pr}'ojec- tiveffc}'oordinates,hXuserffcoordinatesKy,hXordviewffcoordinatesK:,hXrespGectively*.hThe latter(twoexist,1butarenotcurrentlyused.IThecorrespGondinguppercase charactersUUcanalsobGeused.const*bQool7doffp}'ersp OnlyKmeaningfulifthepr}'ojectiveffcoordinateshlarebGeingshown(c}'oords argumentu'p'ԫ).'Ifudoffp}'ersp/true,thenupr}'oject#2()uiscalledon vthis bGeforeu pr}'ojectiveffcoordinatese)areu shown.Thisisusuallywhatonewants. However,itomaysometimesbGeusefultoshowthecontentsofpr}'ojectiveffco- ordinates,withoutcallingpr}'oject#((),inwhichcasedoffp}'ersp/ 6shouldbGe falseZ.const*bQool7doffapply Usually*,applyfftr}'ansformI"ɫ()OshouldbGecalledonPthisUbeforeshowingaset of/coGordinates,jsothedefaultfordoffapply+3istrueǫ.PHowever,it/maysome- times*pbGeusefultoshowthevqaluesofthecoordinateswithoutapplying tr}'ansformW,UUinwhichcasedoffapply,shouldbGefalse.F oQcus J%Jf OnlyKmeaningfulifthepr}'ojectiveffcoordinateshlarebGeingshown(c}'oords argument>'p').Refers>totheF oQcus$ȫusedforpro8jection.Ifthedefault is used,*or0ispassedastheargumentexplicitly*,thentheglobalvqariable defaultfffo}'cusSiisUUused.const*unsignedNashortl,Spr}'oj OnlyKmeaningfulifthepr}'ojectiveffcoordinateshlarebGeingshown(c}'oords argument^S'p'). Refers^Stothepro8jectionused.Currently*,I've^Sonly programmeddthepGerspectivedandtheparallelpro8jections.Thedefault isUUthepGerspectiveUUpro8jection.const*real4factor OnlyKmeaningfulifthepr}'ojectiveffcoordinateshlarebGeingshown(c}'oords argument'p'E$)andtheparallelpro8jectionisbGeingused. nThexand y.vqaluesinpr}'ojectiveffcoordinatesfoaremultipliedbyfactor ,E$soitcanbGe usedHtomagnifyorshrinkthepro8jectedimage. Thedefaultis1(no magni cationUUorshrinking). -[LDFT2002.10.26.]Y;TOUUDO:Addcase'a' forc}'oords"6forshowingallofthesetsofcoGordinates.qLen썷x4313DLDFPRÎGHFSHOW113n#ލ9Ȅ`> 8BeginTLogJʄ`> +[LDFT2002.10.26.]Y;TOUUDO:Addcase'a' forc}'oords"6forshowingallofthesetsofcoGordinates.rRqn썫114SHOÎWHF3DLDFPRGx431n9Ȅ`+U 8Log)j`+U [LDFT2002.10.26.]X!!FKLUDGE:InthetextabGove,I'vehadtotypeset\pr}'ojectiveffcoordinates"using\\it"explicitlyUUinacoupleofplaces,inordertogetthehyphenationtowork. [LDFT2002.11.12.]Z8Added\\relax V"aftertheargumentsto\\ARG\"intheTU>VExXcoGdeaboveinordertosuppressOaspaceatthebGeginningofthe rstlineofthefollowingindentedparagraph.oIOcouldn't gureoutaUUwayofsuppressingthespacewithinthede nitionof\ARG۱. -[LDFT2003.04.30.]Y;Changed,UUsothatanewlineisnotoutputfollowingtext!.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +[LDFT2003.04.30.]Y;Changed,UUsothatanewlineisnotoutputfollowingtext!.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ v9oid#show:Oϫ(string!Dtext7V«="";c9harc}'oords;&='w'Y;const AbQool;doffp}'erspd=trueJ;const AbQooldoffapplyGd=true$;F oQcus" )' *f0'=0;const *unsignedPbshortnWpr}'ojY=Projections=::Di.PERSP_/;const *realfactor;=1)UUconst*;432.hDe neUUP9oint"Dfunctions@285i+ v9oid#WP9oint@::show(string!text3;c9haroc}'oords7;const [bQool:doffp}'ersp`,;const [bQool:doffapply`;F oQcus27f<;constJunsignedP Xshortmpr}'ojʾ;constJreal6xfactorQV)UUconst fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(text"" z)text="Point:"-Mh;c}'out* Qtext" " w;c}'oords2Ц=tolower#(c}'oords );if(c}'oordsФ'w' w);=DoUUnothing.o=else*.6if5.(c}'oordsФ'p' w)c}'out O"Projective coordinaktes.\n"G ush;else*.6if5.(c}'oordsФ'u' w)c}'out O"User coordinates.\nk"tTY ush;else*.6if5.(c}'oordsФ'v' w)c}'out O"View coordinates.\nk"tTY ush;else+fc}'err45"WARNING! In |show()l|: ""Invalid character flor coords argument.\n"ڷ2"Showing world coordinates.\n"+ ush;c}'oords<Ч='w' w;gif(thisϷINVALID_POINTGY)fc}'err3|"Point is == INVALIDk_POINT.\nCan't show.Ơ Returning.\n"! ush;return>h;gif(DEBUGY)tr}'ansform0A:show("Transform before aphply_transform");v\ralarra9y=ZChreal]ٷiUUv Q*=getffallffc}'oords=n+(c}'oords ;doffp}'ersp'S;doffapply'};f;pr}'ojk;factor);c}'out* Q"("ԏvի[0]", "v[1]", "v[2]")\n" T ush;if(DEBUGY)ftr}'ansformID:show("Transform after apphly_transform");c}'out4 R"on_free_store == "i_onfffr}'eeffstore=3""\n"Mt;g g433. Sho9wTtransform.hDeclareUUP9oint"Dfunctions@284i+ -v9oid"showfftr}'ansformgSū(string!%Mtext5D1="" z);r_n썫114SHOÎWXTRANSFORM 63DLDFPRGx434n@P434.hDe neUUP9oint"Dfunctions@285i+ +v9oid"showfftr}'ansformgSū(string!%Mtext5D1="" z);sen썷x4343DLDFPRÎG 6SHOWXTRANSFORM115n@P434.hDe neUUP9oint"Dfunctions@285i+ v9oid"P9oint?%::showfftr}'ansformEU(string!%Mtext2}) fif(text"" z)text="transform:"BM\;c}'out* Qtextendlګ;tr}'ansform?C:show(); -g435. Outputting.436. OutputropQerator.[LDFT2002.10.26.][8ThisfunctionisusedinP9ath\::outputD()forwritingthex andIyvqaluesofthepr}'ojectiveffcoordinatesgtooutffstr}'eam3.AllcoGdeusingthisfunctionmustensurethatapplyfftr}'ansformF߫()UUandpr}'oject!c()arecalled rstث!c9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.09.16.]Y;RemovedUUcallstoapplyfftr}'ansformIu4()andpr}'oject!c().Ȅ` 8EndTLogA>`hDeclareUUnon-membGerfunctionsforP9oints'ݭ436i -ostr}'eam/&8opQerator-ϕ7ϖ(ostr}'eam%&8o;P9oint E&(acp-ic); SeeXalsosections490and511.ThisXco:()Hisapurevirtual.RfunctioninShapQe%4. LIt'scalledbyPicture&::outputD().E EachoftheShapQe$ApGointersonthev9ector%H|shap}'esEinthePicture+:AmustbGe\extracted".F*orP9oints$,thismeanspro8jectingtheP9oint$BusingtheF oQcus&'Fpassedtoextr}'act#[l()asanargument. 8BeginTLogJʄ`> +[LDFT2002.10.26.]YKNAWv9ector&ishreturnedratherthanthisbyitselfbGecauseitmaysometimesbGeusefultoreturn acollectionofShapQe%(pGointersratherthanasingleone._XThiswasformerlythecaseforCubQoid(m,)butatUUthepresenttime,noversionofextr}'act"ī()returnsav9ector&TwithmorethanonepGointertoShapQe"Ab.N99Ȅ`+U 8Log)j`+U [LDFT2002.09.17.]Y WAddedWqconst!/F oQcusA&I fRaargumentWqanderrorhandlingcoGde.xNow,WiftheP9oint"I*cannotbGefpro8jectedontotheprojectionplaneusingtheF -oQcus'f-,>itisnotputontothev9ector%%hShapQe$R)RiPicture&::elements',UUandconsequentlyneverreachesPicture)f::outputD()andP9oint::output().Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +oQcus'f-,>itisnotputontothev9ector%%hShapQe$R)RiPicture&::elements',UUandconsequentlyneverreachesPicture)f::outputD()andP9oint::output().Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ v9ector)IhShapQe"Ab'AciUUextr}'act"ī(const*F -oQcus>uC&FuC&FuC&F.\n"M ush;returnA潱vGz;gif(DEBUGY)fc}'out6eS+"world_coordinates: nR ("mS+worldffc}'oordinatesRg)[0]S+", " ,2worldffc}'oordinates[1]ط", " worldffc}'oordinatesP֫[2]", " worldffc}'oordinatesP֫[3]2")\n"RA'"projective_coordinan@tes: ("eA'pr}'ojectiveffcoordinatesc:[0]A'2", "KٮSMpr}'ojectiveffcoordinatesc `[1]SM", ",pr}'ojectiveffcoordinates[2]", ",2pr}'ojectiveffcoordinates[3]")\n"q;gv4:pushffb}'ack+XR(this붫);return7漱v=y; @@ -1630,7 +1660,7 @@ virtual/inlineOconstmBv\ralarra9yhreal]ٷiUUgetffextr}'emes:()UUconst freturn7pr}'ojectiveffextremes ; g445. GetTminim9umz.[LDFT2002.09.17.]Z6AddedUUthisfunction.hDeclareUUP9oint"Dfunctions@284i+ -virtual/realFAgetffminimumffzګ()UUconst*;un썷x4463DLDFPRÎGGETXMINIMUMZ117n@P446.hDe neUUP9oint"Dfunctions@285i+ +virtual/realFAgetffminimumffzګ()UUconst*;vLn썫118GETXMINIMUMZ3DLDFPRÎGx446n@P446.hDe neUUP9oint"Dfunctions@285i+ real /P9oint=M{::getffminimumffzD]ܫ()UUconst fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Point::getk_minimum_z()"T5endl ush;if(DEBUGY)c}'out O"minimum_z == "Tkpr}'ojectiveffextremesVi[4]endl ush;if(DEBUGY)c}'out O"Exiting Point::get_kminimum_z()"8endl ush;return7pr}'ojectiveffextremes [4]; g447. GetTmaxim9umz.[LDFT2002.09.17.]Z6AddedUUthisfunction.hDeclareUUP9oint"Dfunctions@284i+ @@ -1642,10 +1672,10 @@ real /P9oint=M{::getffme}'anffz1()UUconst freturn7漫((pr}'ojectiveffextremesTQ[4]8+pr}'ojectiveffextremesV=1[5])=2); g451. Setrextremes.ThisHfunctionsets\extreme"vqaluesforthex,y*,andHz-coGordinates.LThisis,ofcourse,trivialÑforP9oints#,bGecausetheyonlyhaveÑonex,yandz-coGordinate.zSothemaximaandminimaforUUeachcoGordinatearealwaysthesame. -[LDFT2002.10.20.]ZTheprogrammerwhousessetffextr}'emes;q()mustensurethatapplyfftr}'ansformK%ǫ()andpr}'ojectw()UUareinvokedUUbGeforesetffextr}'emes:ޫ()!c9Ȅ`> 8BeginTLogJʄ`> +[LDFT2002.10.20.]ZTheprogrammerwhousessetffextr}'emes;q()mustensurethatapplyfftr}'ansformK%ǫ()andpr}'ojectw()UUareinvokedUUbGeforesetffextr}'emes:ޫ()!N99Ȅ`+U 8Log)j`+U [LDFT2002.09.17.]Y;AddedUUthisfunction. -[LDFT2002.09.18.]Y;ChangedUUthenameofthisfunctionfromsetffminimumffzF0V()tosetffextr}'emes:ޫ().Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -virtual/bQoolI/:setffextr}'emesë();vn썫118SETXEXTREMES3DLDFPRÎGx452n@P452.hDe neUUP9oint"Dfunctions@285i+ +[LDFT2002.09.18.]Y;ChangedUUthenameofthisfunctionfromsetffminimumffzF0V()tosetffextr}'emes:ޫ().Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +virtual/bQoolI/:setffextr}'emesë();wKn썷x4523DLDFPRÎGSETXEXTREMES119n@P452.hDe neUUP9oint"Dfunctions@285i+ bQool#gP9oint@;::setffextr}'emes7() fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Point::setk_extremes()"8endl ush;for%舫(in9ti=0;i 9 <4;i++)fif)(pr}'ojectiveffcoordinates^[iq]INVALID_REALBM\)f(c}'err=|·"ERROR! In Point::sekt_extremes():\n","projective_coordinaktes["TMi $"]"ԏ<" == INVALID_REAL.\n"&`"Setting every elemel`Jnt in projective_ext`remes "<"to INVALID_REAL and returning false.\n"M ush;(for9芫(in9tjӫ=0;j w<6;j 0++)pr}'ojectiveffextremesYQ[jī]=INVALID_REALBM\;(returnKfalse`;ggpr}'ojectiveffextremeshS[0]=pr}'ojectiveffcoordinatesa}+[0];=minUUx=pr}'ojectiveffextremeshS[1]=pr}'ojectiveffcoordinatesa}+[0];=maxUUx=pr}'ojectiveffextremeshS[2]=pr}'ojectiveffcoordinatesa}+[1];=minUUy=pr}'ojectiveffextremeshS[3]=pr}'ojectiveffcoordinatesa}+[1];=maxUUy=pr}'ojectiveffextremeshS[4]=pr}'ojectiveffcoordinatesa}+[2];=minUUz=pr}'ojectiveffextremeshS[5]=pr}'ojectiveffcoordinatesa}+[2];=maxUUz=if(DEBUGY)c}'out O"Exiting Point::setk_extremes()"8endl ush;return7trueJT; @@ -1660,73 +1690,73 @@ Inallthreeofthesecases,theShapQes)tӫthatarefurthestfromtheF oQcus"֫areoutput rst,sothattheycanbGeUUcovered,ifnecessary*,byShapQes*thatarecloser. IfSorting)p::NO_SORT)LispassedtoPicture)::outputD(),Velements-isnotsorted,VandtheShapQes)uareoutput -inUUtheorderinwhichtheyweredrawnor lled.wn썷x4543DLDFPRÎGCOMPJAREXMINIMUMZ119n@P454. CompareTminim9umz.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.05.16.]Y;AddedUUthisclassQ.Ȅ` 8EndTLogA>`hDe neUUcomparisonclasses@454i +inUUtheorderinwhichtheyweredrawnor lled.xn썫120COMPJAREXMINIMUMZ3DLDFPRÎGx454n@P454. CompareTminim9umz.9Ȅ`+U 8Log)j`+U +[LDFT2003.05.16.]Y;AddedUUthisclassQ.Ȅ`GhDe neUUcomparisonclasses@454i class$RCompareus4wminim9umus4zf public)=֫:in9topQeratorB;()(const*ShapQe@lEls1P};constJShapQeBGs2R')UUconstfreturnAs1J͟~PgetffminimumffzU()>s2 (~)getffminimumffzU6();g -g; SeeXalsosections455and456.ThisXco 8BeginTLogJʄ`> +g; SeeXalsosections455and456.ThisXco`hDe neUUcomparisonclasses@454i+ +[LDFT2002.09.21.]X?ChangedYfrom\minimumz"to\maximumz".OThisworksforthemorecommoncases.Ȅ`GhDe neUUcomparisonclasses@454i+ class$RCompareus4wmaxim9umus4zډf public)=֫:in9topQeratorB;()(const*ShapQe@lEls1P};constJShapQeBGs2R')UUconstfreturnAs1J͟~PgetffmaximumffzeK()>s2 (~)getffmaximumffzVE();g -g;xn썫120COMPJAREXMEANZ.3DLDFPRÎGx456n@P456. CompareTmeanz.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.09.17.]Y;AddedUUthisclassQ.Ȅ` 8EndTLogA>`hDe neUUcomparisonclasses@454i+ +g;y$n썷x4563DLDFPRÎG.COMPJAREXMEANZ121n@P456. CompareTmeanz.9Ȅ`+U 8Log)j`+U +[LDFT2002.09.17.]Y;AddedUUthisclassQ.Ȅ`GhDe neUUcomparisonclasses@454i+ class$RCompareus4wmeanus4zuf public)=֫:in9topQeratorB;()(const*ShapQe@lEls1P};constJShapQeBGs2R')UUconstfreturnD(((s1 ~getffminimumffzRn()+s1 ğ~getffmaximumffzWtB())=2)+>2((s2 ~getffminimumffzRn()8+s2 I~IgetffmaximumffzUn())=2));g -g;457. Output.[LDFT2002.10.26.]\Voutputye()#isapurevirtual,4functioninShapQe$. YAftertheShapQepGointersonthev9ector'PictureN׫::shap}'es"LhavebGeenextracted,RZoutput!a()iscalledforeachoftheShapQesthey6pGointto(exceptfortheones, 8BeginTLogJʄ`> +g;457. Output.[LDFT2002.10.26.]\Voutputye()#isapurevirtual,4functioninShapQe$. YAftertheShapQepGointersonthev9ector'PictureN׫::shap}'es"LhavebGeenextracted,RZoutput!a()iscalledforeachoftheShapQesthey6pGointto(exceptfortheones,asitsargument. [LDFT2002.09.17.]YChangedltheargumentf fromF oQcus#Ptoconst!QF oQcusB&Iս.RemovedtheinvoGcationsofapplyfftr}'ansformF߫()UUandpr}'oject!c()anderrorhandlingcoGdetoextr}'act"ī(). -[LDFT2002.10.23.][hRemovedtheargumentf . Sinceextr}'act$w()takescareofapplyingpr}'oject$,((),M thepr}'ojectiveffcoordinatesc:Ыarealreadyset,Зsoalloutput!()needstodoiswritethemtooutffstr}'eam8JwiththepropGerUUMET*APOSTinstructions.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -v9oid"output@ ();yPn썷x4583DLDFPRÎG=\0OUTPUT121n@P458.hDe neUUP9oint"Dfunctions@285i+ +[LDFT2002.10.23.][hRemovedtheargumentf . Sinceextr}'act$w()takescareofapplyingpr}'oject$,((),M thepr}'ojectiveffcoordinatesc:Ыarealreadyset,Зsoalloutput!()needstodoiswritethemtooutffstr}'eam8JwiththepropGerUUMET*APOSTinstructions.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +v9oid"output@ ();zn썫122OUTPUT=\03DLDFPRÎGx458n@P458.hDe neUUP9oint"Dfunctions@285i+ v9oid"P9oint?%::outputD() fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Point::outkput().\n"TA ush;if(doffoutput-Kfalsev\)fif)(DEBUGY)c}'out O"In Point::output():k do_output == false.Ơ Returning.\n"! ush;return>h;gif(dr}'awdotffvalue@DRAWDOT( k)outffstr}'eam7"drawdot "7b;else*.6if5.(dr}'awdotffvalue@UNDRAWDOT2e)outffstr}'eam7"drawdot "7b;else:=DRAWDOT=fc}'err6"WARNING! Invalid |dn۵rawdot_value|: "=޷dr}'awdotffvalueI2". Using \"drawdot\"\n" @ ush;#if 0$=!!qDe neUUaclass5forinformationontherunstate.o=if)(:RunffState-::4nonffstop[P)getchar&%();#endifoutffstr}'eamP"drawdot "7b;goutffstr}'eamHFշ7"("Rͷ7pr}'ojectiveffcoordinatescJ[0]7me}'asurementffunits]cB", "ʷ(pr}'ojectiveffcoordinates[1]me}'asurementffunitsX")" w;if(dr}'awdotffcolor?>6=Colors$::+.4defaultffc}'olorb)outffstr}'eam7" withcolor "JTqdr}'awdotffcolorD>;#if 1if(p}'en˷6="" z)outffstr}'eam7" withpen "?wp}'en;#endifoutffstr}'eamF";\n"q;if(DEBUGY)c}'out O"Exiting Point::outpkut().\n"D ush; -g459. LabQelling.460. LabQel.z>n썫122STRINGXARÎGUMENT3DLDFPRGx461n@P461. stringTargumen9t.[LDFT2002.10.27.]Z6TheUUarguments:string!%MtextffstrlTheUUtextforthelabGel.string!%Mp}'ositionffstrlIndicatesthepGositionofthelabeltextrelativetotheP9ointz.JThesamestrings'are lpGermitted'asinMET*APOST.Theyarewrittenunchecked'tooutffstr}'eam3ë,soifanlinvqalidustring"isuused,itwon'tcauseanerrorin3DLDF,butitwillinMET*APOST.lThepGermittedstrings,$Hare:"top"'{j(thedefault),c%"bot" )~,c%"lft",c%"rt"遫,c%"ulft"l(uppGer_wleft),b"llft"&ͫ(lowerleft),b"urt"!Ы(uppGerright),b"lrt"!Ы(lowerright),band""lforputtingthelabGelrightontopoftheP9ointȫ.GTheemptystringmustbGeusedlexplicitly*,UUbGecause"top"!qisthedefault.bQoolfdotlIfgtrueW,thengdotlabQeliswrittentooutffstr}'eam6gjratherthanlabel.+ThisargumentlisUUmainlyforusebythefunctiondotlab}'el%UH(),whichcallslab}'el()withdotztrue.Picture(b&0pictur}'elIndicates}thePicture/ontowhichtheLabQel%]shouldbGeplaced.>Thedefaultislcurr}'entffpicture: -[LDFT2003.01.15.]Y;TOUUDO:Addp}'en]argumenttolab}'el()anddotlab}'el%UH()!!c9Ȅ`> 8BeginTLogJʄ`> +g459. LabQelling.460. LabQel.{Ͷn썷x4613DLDFPRÎGSTRINGXARGUMENT123n@P461. stringTargumen9t.[LDFT2002.10.27.]Z6TheUUarguments:string!%MtextffstrlTheUUtextforthelabGel.string!%Mp}'ositionffstrlIndicatesthepGositionofthelabeltextrelativetotheP9ointz.JThesamestrings'are lpGermitted'asinMET*APOST.Theyarewrittenunchecked'tooutffstr}'eam3ë,soifanlinvqalidustring"isuused,itwon'tcauseanerrorin3DLDF,butitwillinMET*APOST.lThepGermittedstrings,$Hare:"top"'{j(thedefault),c%"bot" )~,c%"lft",c%"rt"遫,c%"ulft"l(uppGer_wleft),b"llft"&ͫ(lowerleft),b"urt"!Ы(uppGerright),b"lrt"!Ы(lowerright),band""lforputtingthelabGelrightontopoftheP9ointȫ.GTheemptystringmustbGeusedlexplicitly*,UUbGecause"top"!qisthedefault.bQoolfdotlIfgtrueW,thengdotlabQeliswrittentooutffstr}'eam6gjratherthanlabel.+ThisargumentlisUUmainlyforusebythefunctiondotlab}'el%UH(),whichcallslab}'el()withdotztrue.Picture(b&0pictur}'elIndicates}thePicture/ontowhichtheLabQel%]shouldbGeplaced.>Thedefaultislcurr}'entffpicture: +[LDFT2003.01.15.]Y;TOUUDO:Addp}'en]argumenttolab}'el()anddotlab}'el%UH()!!N99Ȅ`+U 8Log)j`+U [LDFT2002.05.14.]YChangedtextffstr(кsothatitisnolongeroptional.ItdoGesn'tmakeanysensetoprintemptyUUlabGels,soI'vemadeitarequiredargument. [LDFT2002.11.12.]Z8Added\\relax V"aftertheargumentsto\\ARG\"intheTU>VExXcoGdeaboveinordertosuppressOaspaceatthebGeginningofthe rstlineofthefollowingindentedparagraph.oIOcouldn't gureoutaUUwayofsuppressingthespacewithinthede nitionof\ARG۱. -[LDFT2003.07.09.]Y;MadeUUtextffstr$,UUp}'ositionffstr67,UUanddotargumentsconst*.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -v9oid# lab}'el7A(const9rstring?mtextffstr`4ӱ;conststringA7p}'ositionffstrvC="top"!;constbQool9PdotKu%=false ;Picture&%!pictur}'eG=curr}'entffpictureD߫)UUconst*;{Ӟn썷x4623DLDFPRÎGSTRINGXARGUMENT123n@P462.hDe neUUP9oint"Dfunctions@285i+ +[LDFT2003.07.09.]Y;MadeUUtextffstr$,UUp}'ositionffstr67,UUanddotargumentsconst*.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +v9oid# lab}'el7A(const9rstring?mtextffstr`4ӱ;conststringA7p}'ositionffstrvC="top"!;constbQool9PdotKu%=false ;Picture&%!pictur}'eG=curr}'entffpictureD߫)UUconst*;|n썫124STRINGXARÎGUMENT3DLDFPRGx462n@P462.hDe neUUP9oint"Dfunctions@285i+ v9oid"ӞP9oint?m::lab}'elt(constgstring>ytextffstr_½;conststring@!p}'ositionffstrse;constbQool9":dotH#G;Picture*qϫ&28pictur}'eQAë)2const fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Point::labkel()"TM"\n" ush;if(LabQelAg::#ϥDO_LABELSV] falsev\)fif)(DEBUGY)c}'out O"Label::DO_LABELS ==k false. Returning."#"\n" ush;return>h;gif(thisϷINVALID_POINTGY)fc}'err3e1"WARNING! In Point::l1label(): "i1"*this == INVALID_POl1INT.\nNot doing anyt1D\2hing.\n\n"ig ush;return>h;gLabQel38lblF==newϜ(LabQelAc);lblAl~#Ampt/"=P9ointad::%cr}'eateffnewffp}'ointnŞ();(lbl Aj~Akpt&)=thisϫ;if(dot%true)lblAj~Akdot& =true;lblAl~#Amp}'ositionILܫ=p}'ositionffstr5\;if(textffstr#\6="" z)lblAj~Aktext(`O=textffstr;else+lbl5K~;LtextO90="Pt."q;pictur}'e5+=H%DlblSf;=[LDFT2002.10.27.]T7TheUULabQel" isUUpushedontothev9ector&Tlab}'elsA7inpictur}'e"^+.o=if(DEBUGY)c}'out O"Exiting Point::labekl()"P"\n" ush;return4g; -g|n썫124SHOR -TXARÎGUMENTa3DLDFPRGx463n@P463. shortSargumen9t.[LDFT2003.04.01.]Z"TO$DO:AMakenon-constversionofthisfunction!TO$DO: Makeb>itpGossibletousePROJ_VALUESC -ëtousethevqaluesinpr}'ojectiveffcoordinatesgzforthelabel.ThiswillrequireUUaddingargumentsforusebypr}'oject!c().c9Ȅ`> 8BeginTLogJʄ`> +g}Jn썷x4633DLDFPRÎGaSHOR +TXARGUMENT125n@P463. shortSargumen9t.[LDFT2003.04.01.]Z"TO$DO:AMakenon-constversionofthisfunction!TO$DO: Makeb>itpGossibletousePROJ_VALUESC +ëtousethevqaluesinpr}'ojectiveffcoordinatesgzforthelabel.ThiswillrequireUUaddingargumentsforusebypr}'oject!c().N99Ȅ`+U 8Log)j`+U [LDFT2003.04.01.]Z^Changed^xthisfunctionsothatittestswhethertextffshort3_isequaltoWORLD_VALUESC伫,PROJ_VALUES:FG,XUSER_VALUES=,XorVIEW_VALUES=8,whicharepublic&constDstaticdjdatamembGersinP9oint=9.ZIftextffshort.όisequaltoWORLD_VALUESCva,Ϸ thisiscopiedandapplyfftr}'ansformJ()iscalledonthecopy*.B Thisisnecessary*,bGecausethisfunctionisconstf.$0Then,theupGdatedvqaluesintheworldffc}'oordinatesT5vectorofthecopyUUareusedforthelabGel. [LDFT2003.05.06.]Y;AddedUUcomparisonoftextffshort1withWORLD_VALUES_X_YWۍ,PROJ_VALUES_X_YR,USER_VALUES_X_YOF;,orVIEW_VALUES_X_YR,whichareusedforsuppressingthez-coGordinate,whenthevqaluesfromdoneofthesetsofcoGordinatesareusedforthelabel.Also,nolongercopying dthisP,sincegetffxV(),getffyt(),UUandgetffz]V()areconst!anyway*. [LDFT2003.05.20.]Y;AddedUU\WORLD_VALUES_ZJ>"case. [LDFT2003.05.22.]X:BUG3KFIX:3TThe\WORLD_VALUES_ZJ>"casestartedwithifKinsteadofelse?if!*.fqThiscauseds:str 7()tohaveanerroneous ve-digitintegerfollowingtheclosingparenthesis, whenWORLD_VALUESHorWORLD_VALUES_X_YW waslused.@Ildon'tknowwhythisshouldhavebGeenthecase,rbutchangingif9Itoelseif xedtheproblem.^ItprobablyhadsomethingtodowiththefactthatWORLD_VALUES_ZP?hadthesamevqalueasUUVIEW_VALUES_X_YR.qI'veUU xedthisabGovetoGday*,toGo. [LDFT2003.06.06.]WChanged8thecase,qwheretextffshort/Q5=WORLD_VALUESC ortextffshort=WORLD_VALUES_X_YV:The?KcoGordinatessurroundedbyparenthesesarenowprintedoutusingTU>VExXۨ'smathmoGde,Ci.e.,\(x;y[;zp)"?Kin-steadUUof\(x,y[٫,zp)". -[LDFT2003.07.09.]Y;MadeUUtextffshort.4ī,UUp}'ositionffstr67,UUanddotargumentsconst*.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -v9oid"4lab}'el7J̫(constshort;textffshortfj;conststring@Mp}'ositionffstrvT="top"q;constbQool9'fdotJ=falsev\;Picture&%!pictur}'eG=curr}'entffpictureD߫)UUconst*;}9n썷x4643DLDFPRÎGaSHOR -TXARGUMENT125n@P464.hDe neUUP9oint"Dfunctions@285i+ +[LDFT2003.07.09.]Y;MadeUUtextffshort.4ī,UUp}'ositionffstr67,UUanddotargumentsconst*.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +v9oid"4lab}'el7J̫(constshort;textffshortfj;conststring@Mp}'ositionffstrvT="top"q;constbQool9'fdotJ=falsev\;Picture&%!pictur}'eG=curr}'entffpictureD߫)UUconst*;~토n썫126SHOR +TXARÎGUMENTa3DLDFPRGx464n@P464.hDe neUUP9oint"Dfunctions@285i+ v9oid#EP9oint@#::lab}'elt(constshort= textffshortg댱;const `stringBop}'ositionffstrt;const `bQool:dotI;Picture2&9#pictur}'eX)UUconst fbQool-hDEBUGK.٫=falsev\;=trueĒ=stringstreamW,s[ܹ;if(textffshort-WORLD_VALUESD<_8textffshort/gWORLD_VALUES_X_YWMP)fif)(DEBUGY)c}'out O"It's WORLD_VALUES okr WORLD_VALUES_X_Y.\Ơn";s%w"$("getffxU()", "getffy;.();if)(textffshort-WORLD_VALUESBM\)s w", "getffz();s%w")$"Mt;gelse*.6if5.(textffshort-WORLD_VALUES_ZLV)fif)(DEBUGY)c}'out O"It's WORLD_Z.\n"\M;s%wgetffz();gelse*.6if5.(textffshort-PROJ_VALUES= _)fif)(DEBUGY)c}'out O"It's PROJ_VALUES\n"lMD;c}'err4S"WARNING! In Point::llabel():"3endl-"text_short == PROJ_lVALUES. "2"Haven't programmed this case yet.\n""Returning.\n\n"Zh ush;return>h;gelse*.6if5.(textffshort-USER_VALUES= _)fif)(DEBUGY)c}'out O"It's USER_VALUES\n"lMD;c}'err4S"WARNING! In Point::llabel():"3endl-"text_short == USER_lVALUES. "2"Haven't programmed this case yet.\n""Returning.\n\n"Zh ush;return>h;gelse*.6if5.(textffshort-VIEW_VALUES= _)fif)(DEBUGY)c}'out O"It's VIEW_VALUES\n"lMD;c}'err4S"WARNING! In Point::llabel():"3endl-"text_short == VIEW_lVALUES. "2"Haven't programmed this case yet.\n""Returning.\n\n"Zh ush;return>h;gelse+fif)(DEBUGY)c}'out O"It's some other valkue.\n"2;s%wtextffshort-;gif(DEBUGY)c}'out O"s.str() == "JTqsw:str 7()endl ush;lab}'el(t(s:str 7();p}'ositionffstr4;dot;pictur}'e ~);return4g; -g465. DotlabQel.TOŊDO:Addanoptionalp}'enargument.ÃIfit'sused,"usedr}'awdot(Yj()withthep}'enargument,ptogether7withlab}'elfϫ().HnWhenIdothis,IshouldalsoaddrealBGarguments(tobGothlab}'elfϫ()anddotlab}'el!()),forshiftingthepGositionofthetext,4andaversionwithaP9oint!ЫargumentforthesamepurpGose.ThisUUissothatthedotwon'tcoverthetext.q[LDFT2003.07.16.]~n썫126STRINGXARÎGUMENT3DLDFPRGx466n@P466. stringTargumen9t.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.07.09.]Y;MadeUUtextffstr'qandUUp}'ositionffstr9argumentsUUconst*.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +g465. DotlabQel.TOŊDO:Addanoptionalp}'enargument.ÃIfit'sused,"usedr}'awdot(Yj()withthep}'enargument,ptogether7withlab}'elfϫ().HnWhenIdothis,IshouldalsoaddrealBGarguments(tobGothlab}'elfϫ()anddotlab}'el!()),forshiftingthepGositionofthetext,4andaversionwithaP9oint!ЫargumentforthesamepurpGose.ThisUUissothatthedotwon'tcoverthetext.q[LDFT2003.07.16.] n썷x4663DLDFPRÎGSTRINGXARGUMENT127n@P466. stringTargumen9t.9Ȅ`+U 8Log)j`+U +[LDFT2003.07.09.]Y;MadeUUtextffstr'qandUUp}'ositionffstr9argumentsUUconst*.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ v9oid$tidotlab}'elFt\(const2stringB=textffstrcS;const!KstringCp}'ositionffstr|V=7["top";Picture&%!pictur}'eG=curr}'entffpictureD߫)UUconst*;467.hDe neUUP9oint"Dfunctions@285i+ v9oid"P9oint?%::dotlab}'el"(const*string?Otextffstr`3;constJstring@p}'ositionffstrs۱;Picture* &2c(pictur}'eQk)UUconst flab}'el(t(textffstr D;p}'ositionffstr4;trueo@;pictur}'e ~); -g468. shortTargumen9t.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.07.09.]Y;MadeUUtextffshort1andUUp}'ositionffstr9argumentsUUconst*.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +g468. shortTargumen9t.9Ȅ`+U 8Log)j`+U +[LDFT2003.07.09.]Y;MadeUUtextffshort1andUUp}'ositionffstr9argumentsUUconst*.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ v9oid$[)dotlab}'elF[(constshort>textffshortiT;const!2stringC7p}'ositionffstr{= E"top"Ӟ;Picture&%!pictur}'eG=curr}'entffpictureD߫)UUconst*;469.hDe neUUP9oint"Dfunctions@285i+ v9oid"P9oint?%::dotlab}'el"(const*short;EtextffshortfԴ;constJstring@p}'ositionffstrs۱;Picture* &2c(pictur}'eQk)UUconst flab}'el(t(textffshort*o;p}'ositionffstr4;trueo@;pictur}'e ~); -g9n썷x4703DLDFPRÎGaSHOR -TXARGUMENT127n@P470. [LDFT2002.09.06.][#Commentedout LabQel'O().D3Thiswasthecauseofabugthatcausedamemory faultwhenItriedtousealabGelin gure2(b}'egin g!(2))afterhavinguseditin gure1andtheninvokingcurr}'entffpictureB%DZ:cle}'ar(٫()UUinbGetween.hDe neUULabQel" functions@470i#if 0 +g [n썫128SHOR +TXARÎGUMENTa3DLDFPRGx470n@P470. [LDFT2002.09.06.][#Commentedout LabQel'O().D3Thiswasthecauseofabugthatcausedamemory faultwhenItriedtousealabGelin gure2(b}'egin g!(2))afterhavinguseditin gure1andtheninvokingcurr}'entffpictureB%DZ:cle}'ar(٫()UUinbGetween.hDe neUULabQel" functions@470i#if 0 LabQel'Ah::-Ϧ5LabQelQ'() fif(pt 6=0)delete&ƺpt0W; g#endif SeeXalsosections471and472.ThisXco 8BeginTLogJʄ`> -[LDFT2002.10.23.]Y;AddedUUargumentspr}'ojmandfactorY3.Ȅ` 8EndTLogA>`hDe neUULabQel" functions@470i+ +g472. Outputl@LabQels.[LDFT2002.10.23.][Declared-inpictures.web.PMustbGede nedhere,becauseP9ointisUUanincompletetypGethere.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.23.]Y;AddedUUargumentspr}'ojmandfactorY3.Ȅ`GhDe neUULabQel" functions@470i+ v9oid"LabQel@(f::outputD(constF oQcus>G&FfL;constpunsignedOޤshortmmpr}'oj0;realFfactor3Jڱ;constpT ransformWph&_7tb) @@ -1734,11 +1764,11 @@ pt=&9t)_;pt䟟~!applyfftr}'ansformh();if(:pt䝟~ pr}'oject,[(f;pr}'ojk;factor))fc}'err3"WARNING! In Label::koutput():\n""Point in Label cannkot be projected! "2"Not printing Label\n"C ush;return>h;gif(dot%true)outffstr}'eam7"dot"q;outffstr}'eamF"label"( k;if(p}'osition& o6="" z)outffstr}'eam7"."ԏp}'osition;outffstr}'eamF"(btex "0text" etex, (":zpt ~getffx':('p'F_;(false 8BeginTLogJʄ`> +gn썷x4733DLDFPRÎG,MAJTRIXXOPERATIONS129n@P473. MatrixTopQerations.474. MultiplicationTb9yaT +ransformwithassignment.9Ȅ`+U 8Log)j`+U [LDFT2002.11.06.]YeBUG_|FIX:_Thisfunctionnowreturnst [pinsteadoftr}'ansform/.DThismakesitpGossibletochainUUexpressionsusingopQerator. -=;)().Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +=;)().Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ T ransformAopQeratorm_=z&(const*T ransformUt&]taW);475.hDe neUUP9oint"Dfunctions@285i+ @@ -1747,16 +1777,16 @@ ransformUt&]taW) freturn7漫(tr}'ansform.zY=>tA); g476. V -ectoruopQerations.[LDFT2002.10.27.]ZNote thatthevectoropGerationsdon'ta ectthewcoordi-nate.9Ȅ`> 8BeginTLogJʄ`> +ectoruopQerations.[LDFT2002.10.27.]ZNote thatthevectoropGerationsdon'ta ectthewcoordi-nate.9Ȅ`+U 8Log)j`+U [LDFT2002.10.27.]YwInRthefunctionsopQerator.F+6d(),opQerator++=;$(),SopQerator.Է6(),SandRopQerator.F=>w():peItdoGesn't3:seemworthittowritenon-const!versions,althoughI2}could. uNowusingtheelementsofp0 :worldffc}'oordinatesQ -directly insteadofusinggetffxks(),>getffy(),>and getffz (). This issafe,asiscallingapplyfftr}'ansformF߫()UUonp]U,andsavesUUthecostofthreefunctioncalls.Ȅ` 8EndTLogA>`477. V +directly insteadofusinggetffxks(),>getffy(),>and getffz (). This issafe,asiscallingapplyfftr}'ansformF߫()UUonp]U,andsavesUUthecostofthreefunctioncalls.Ȅ`G477. V ectorTaddition.hDeclareUUP9oint"Dfunctions@284i+ P9oint(opQeratorTS+\Mq(P9ointp#)UUconst*;478.hDe neUUP9oint"Dfunctions@285i+ P9oint(P9ointE::L(opQeratorwݫ+u(P9ointp#)UUconst fP9oint2a88ϫ;aJ=thisϫ;p:applyfftr}'ansformF߫();aI2:shift}(p:worldffc}'oordinatesM[0];p:worldffc}'oordinates[1];p:worldffc}'oordinates[2]);return7漱a=/; g479. V ectorTadditionwithassignmen9t.hDeclareUUP9oint"Dfunctions@284i+ -v9oid"opQeratorN+=^"(P9ointp#);yn썷x4803DLDFPRÎG,VECTORXADDITIONWITHASSIGNMENT129n@P480.hDe neUUP9oint"Dfunctions@285i+ +v9oid"opQeratorN+=^"(P9ointp#);#n썫130VECTORXADDITIONWITHASSIGNMENT,3DLDFPRÎGx480n@P480.hDe neUUP9oint"Dfunctions@285i+ v9oid"P9oint?%::F&copQeratorq+=KT(P9ointp#) fp:applyfftr}'ansformF߫();shift((p:worldffc}'oordinatesM[0];p:worldffc}'oordinates[1];p:worldffc}'oordinates[2]); g481. V @@ -1770,15 +1800,15 @@ v9oid"P9oint?%::F&copQeratorq=KT(P9ointp#) fp:applyfftr}'ansformF߫();shift((p :worldffc}'oordinatesM[0]; qƱpy:worldffc}'oordinates[1]; qƱpy:worldffc}'oordinates[2]); g485. V -ector-scalarTm9ultipicationwithassignment.U9Ȅ`> 8BeginTLogJʄ`> +ector-scalarTm9ultipicationwithassignment.9Ȅ`+U 8Log)j`+U [LDFT2002.10.27.]Y;MadeUUargumentr tconst&J .qChangedreturnvqaluefromP9oint"D&-aetov9oidث. -[LDFT2003.05.14.]YQChanged3returnvqaluefromv9oidtoreal .LaItnowreturnstheargumentrhG.LaThismakesitUUpGossibletochaininvoGcationsofthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -real /opQeratorLI=Y(const*real4бr9);+Sn썫130VECTOR-SCALARXMULJTIPICATIONWITHASSIGNMENTu3DLDFPRÎGx486n@P486. ??(I'm notsurewhethermultiplicationwithascalariscommutativewithtransformations.(Idoubt it.qTherefore,UUIapplytr}'ansform2]bGeforemultiplying.hDe neUUP9oint"Dfunctions@285i+ +[LDFT2003.05.14.]YQChanged3returnvqaluefromv9oidtoreal .LaItnowreturnstheargumentrhG.LaThismakesitUUpGossibletochaininvoGcationsofthisfunction.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +real /opQeratorLI=Y(const*real4бr9);.n썷x4863DLDFPRÎGuVECTOR-SCALARXMULJTIPICATIONWITHASSIGNMENT131n@P486. ??(I'm notsurewhethermultiplicationwithascalariscommutativewithtransformations.(Idoubt it.qTherefore,UUIapplytr}'ansform2]bGeforemultiplying.hDe neUUP9oint"Dfunctions@285i+ real /P9oint=M{::C۹opQeratororn=|9(const*real4бr9) fapplyfftr}'ansformZ();for%舫(in9ti=0;i 9 <3;i++)worldffc}'oordinatesR[iq]=UOrc;return7漱r<Ы; g487. V -ector-scalarTm9ultipication.488. Mem9bQerTversion(Point rst).c9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.10.27.]Y;MadeUUthisfunctionandtheargumentr tconst&J .Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +ector-scalarTm9ultipication.488. Mem9bQerTversion(Point rst).N99Ȅ`+U 8Log)j`+U +[LDFT2002.10.27.]Y;MadeUUthisfunctionandtheargumentr tconst&J .Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ P9oint(opQeratorTSYT(const*real4бr9)UUconst*;489.hDe neUUP9oint"Dfunctions@285i+ P9oint(P9ointE::L(opQeratorwݷ|ޫ(const*real4бr9)UUconst fP9oint2a88ϫ(this뷫);aI2:applyfftr}'ansformF߫();aJ=+r0h;return7漱a=/; @@ -1786,32 +1816,32 @@ P9oint(opQeratorTSYT(const*real1{;constJP9oint>&FpK);491.hDe neUUnon-membGerfunctionsforP9oints'ݭ437i+ P9oint(opQeratorTSYT(const*real4бr9;constJP9oint>&FpK) freturn7漱p?'8r; -g492. UnaryTmin9us.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.10.27.]Y;MadeUUthisfunctionconst*.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -P9oint(opQeratorTS\Mq()UUconst*;6n썷x4933DLDFPRÎG$:UNARJYXMINUS131n@P493.hDe neUUP9oint"Dfunctions@285i+ +g492. UnaryTmin9us.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.27.]Y;MadeUUthisfunctionconst*.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +P9oint(opQeratorTS\Mq()UUconst*;9n썫132UNARJYXMINUS$:3DLDFPRÎGx493n@P493.hDe neUUP9oint"Dfunctions@285i+ P9oint(P9ointE::L(opQeratorwݷu()UUconst fP9oint2a88ϫ(this뷫);aI2:applyfftr}'ansformF߫();aJ=+3e18e;return7漱a=/; g494. V -ector-scalar.divisionwithassignmen9t.??I'mnotsurewhetherdivisionwithascalariscommutativeUUwithtransformations.qIdoubtit.Therefore,Iapplytr}'ansform2]bGeforedividing.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.10.27.]Y;MadeUUtheargumentr tconst&J .Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +ector-scalar.divisionwithassignmen9t.??I'mnotsurewhetherdivisionwithascalariscommutativeUUwithtransformations.qIdoubtit.Therefore,Iapplytr}'ansform2]bGeforedividing.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.27.]Y;MadeUUtheargumentr tconst&J .Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ v9oid"opQeratorN==[[(const*real4бr9);495.hDe neUUP9oint"Dfunctions@285i+ v9oid"P9oint?%::F&copQeratorq==~7(const*real4бr9) fapplyfftr}'ansformZ();for%舫(in9ti=0;i 9 <3;i++)worldffc}'oordinatesR[iq]==UOrc; g496. V -ector-scalarTdivision.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.10.27.]Y;MadeUUthisfunctionandtheargumentr tconst&J .Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -P9oint(opQeratorTS=(const*real4бr9)UUconst*;@n썫132VECTOR-SCALARXDIVISIONf3DLDFPRÎGx497n@P497.hDe neUUP9oint"Dfunctions@285i+ +ector-scalarTdivision.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.27.]Y;MadeUUthisfunctionandtheargumentr tconst&J .Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +P9oint(opQeratorTS=(const*real4бr9)UUconst*;Cn썷x4973DLDFPRÎGfVECTOR-SCALARXDIVISION133n@P497.hDe neUUP9oint"Dfunctions@285i+ P9oint(P9ointE::L(opQeratorwݱ=(const*real4бr9)UUconst fP9oint2a88ϫ(this뷫);aI2:applyfftr}'ansformF߫();aJ==+r0h;return7漱a=/; -g498. DotTproQduct.U9Ȅ`> 8BeginTLogJʄ`> +g498. DotTproQduct.9Ȅ`+U 8Log)j`+U [LDFT2002.10.27.]X2ChangedALthisfunctionandargumentp toconst.kNowusingworldffc}'oordinatesSdirectlyinsteadUUofgetffx㼫(),getffyk(),andgetffz]V(). -[LDFT2003.07.11.]Y;Changed,UUsothatifthedotproGductislessthanP9oint::epsilon o(),0willbereturned.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +[LDFT2003.07.11.]Y;Changed,UUsothatifthedotproGductislessthanP9oint::epsilon o(),0willbereturned.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ real /dotffpr}'oductS3P(P9ointp#)UUconst*;499.hDe neUUP9oint"Dfunctions@285i+ real /P9oint=M{::dotffpr}'oduct3%(P9ointp#)UUconst fP9oint2a88ϫ(this뷫);aI2:applyfftr}'ansformF߫();p:applyfftr}'ansformF߫();real+r5S=((aI0:worldffc}'oordinatesM[0]p:worldffc}'oordinates[0])+(aI0:worldffc}'oordinates[1](p-:worldffc}'oordinatesM[1])8+(aI0:worldffc}'oordinates[2]p@:worldffc}'oordinates[2]));if(fabs2ҫ(r) 8BeginTLogJʄ`> -[LDFT2002.10.27.]X2ChangedALthisfunctionandargumentp toconst.kNowusingworldffc}'oordinatesSdirectlyinsteadUUofgetffx㼫(),getffyk(),andgetffz]V().Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -P9oint(cr}'ossffproductc|(P9ointp#)UUconst*;Hn썷x5013DLDFPRÎG-CROSSXPRODUCT133n@P501.hDe neUUP9oint"Dfunctions@285i+ +g500. CrossTproQduct.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.27.]X2ChangedALthisfunctionandargumentp toconst.kNowusingworldffc}'oordinatesSdirectlyinsteadUUofgetffx㼫(),getffyk(),andgetffz]V().Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +P9oint(cr}'ossffproductc|(P9ointp#)UUconst*;Kn썫134CRÎOSSXPRODUCT-3DLDFPRGx501n@P501.hDe neUUP9oint"Dfunctions@285i+ P9oint(P9ointE::cr}'ossffproduct;(P9ointp#)UUconst fP9oint2a88ϫ(this뷫);aI2:applyfftr}'ansformF߫();p:applyfftr}'ansformF߫();P9oint2r7;r:worldffc}'oordinatesM[0]=(aI0:worldffc}'oordinates[1]\FpdF:worldffc}'oordinates[2])(aI0:worldffc}'oordinates[2](p-:worldffc}'oordinatesM[1]);=x.o=r:worldffc}'oordinatesM[1]=(aI0:worldffc}'oordinates[2]\FpdF:worldffc}'oordinates[0])(aI0:worldffc}'oordinates[0](p-:worldffc}'oordinatesM[2]);=y*.o=r:worldffc}'oordinatesM[2]=(aI0:worldffc}'oordinates[0]\FpdF:worldffc}'oordinates[1])(aI0:worldffc}'oordinates[1](p-:worldffc}'oordinatesM[0]);=z.o=return7漱r<Ы; g502. Magnitude.[LDFT2002.10.27.]ٚ @@ -1820,54 +1850,55 @@ cmex10p UVs0fe=eЍ(xr2S+8y[ٟr2,+zpr2 )K. Since o}'atsaresolargeanyway*,JandsinceIacaneasilyrede nerealtousedouble'kordoubledoubleI`,J(orwhatever]it'scalledLoGokup!!),it'snotreallynecessarytouseanalgorithmtoapproximates0p ^s0fe=eЍ(xr2S+8y[ٟr2,+zpr2 -) (viz.,\PythagoreanWaddition"inKnuth,Metafont:zThe$YPr}'ogram.H(GetWreference!!)However,itWmightbGeniceUUtouseitanyway*.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.10.27.]ZMadej6thisfunctionconst?.kNowusingworldffc}'oordinatesUjdirectlyinsteadofgetffx(),getffyt(),UUandgetffz]V().Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -real /magnitudeN()UUconst*;T&n썫134MAÎGNITUDE+X3DLDFPRGx503n@P503.hDe neUUP9oint"Dfunctions@285i+ +) (viz.,\PythagoreanWaddition"inKnuth,Metafont:zThe$YPr}'ogram.H(GetWreference!!)However,itWmightbGeniceUUtouseitanyway*.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.27.]ZMadej6thisfunctionconst?.kNowusingworldffc}'oordinatesUjdirectlyinsteadofgetffx(),getffyt(),UUandgetffz]V().Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +real /magnitudeN()UUconst*;VEn썷x5033DLDFPRÎG+XMAGNITUDE135n@P503.hDe neUUP9oint"Dfunctions@285i+ real /P9oint=M{::magnitude/=v()UUconst freal*0r/}D;real*0tempA ;P9oint2a88ϫ(this뷫);aI2:applyfftr}'ansformF߫();if!((aI0:worldffc}'oordinatesM[0]>MAX_REAL_SQRTJ"){_(a:worldffc}'oordinatesM[1]>2MAX_REAL_SQRTvF)8_(aI0:worldffc}'oordinatesM[2]>MAX_REAL_SQRTGY))fc}'err9ܷd3"ERROR: In Point::maqcgnitude().\n"k2"Point has a coordinate too large for squaring!\n";"Returning INVALID_RkEAL.\n" /;returnAINVALID_REALm;gr.=aH:worldffc}'oordinatesM[0]8a:worldffc}'oordinates[0];temp-!=aH:worldffc}'oordinatesM[1]8a:worldffc}'oordinates[1];if(MAX_REAL,08r <temp!)fc}'err3|"In magnitude().\n"g G;c}'err3o1"Point has too greatl1 a magnitude!\n"«;=?!!1ThisWshow V()Woutputstostdout]{.It2wouldUUbGenicetooutputittostderr!=instead.qMustwritefunctionforthis.o=c}'err3|"Returning INVALID_RkEAL.\n" /;returnAINVALID_REALm;gr.+=-tempD@;temp-!=aH:worldffc}'oordinatesM[2]8a:worldffc}'oordinates[2];if(MAX_REAL,08r <temp!)fc}'err3|"In magnitude().\n"g G;c}'err3o1"Point has too greatl1 a magnitude!\n"«;=?!!1ThisWshow V()Woutputstostdout]{.It2wouldUUbGenicetooutputittostderr!=instead.qMustwritefunctionforthis.o=c}'err3|"Returning INVALID_RkEAL.\n" /;returnAINVALID_REALm;gr.+=-tempD@;return7sqrtI(r); -g504. AngleTbQet9weentwovectors.U9Ȅ`> 8BeginTLogJʄ`> +g504. AngleTbQet9weentwovectors.9Ȅ`+U 8Log)j`+U [LDFT2002.10.27.]Y;MadeUUthisfunctionconst*. -[LDFT2003.07.27.]Y;MadeUUtheargumentp aconst!P9oint@o&H6.qNolongercopyingUVthisA .qNowusingdotffpr}'oduct2!()UUinsteadofcalculatingtheangle\byhand".qSimpli edthecoGdeofthefunction.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -real /angle8s(const*P9oint=?&D]pI])UUconst*;`Zn썷x5053DLDFPRÎG4ANGLEXBETWEENTWOVECTORS135n@P505.hDe neUUP9oint"Dfunctions@285i+ +[LDFT2003.07.27.]Y;MadeUUtheargumentp aconst!P9oint@o&H6.qNolongercopyingUVthisA .qNowusingdotffpr}'oduct2!()UUinsteadofcalculatingtheangle\byhand".qSimpli edthecoGdeofthefunction.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +real /angle8s(const*P9oint=?&D]pI])UUconst*;bNn썫136ANGLEXBETWEENTWÎOVECTORS43DLDFPRGx505n@P505.hDe neUUP9oint"Dfunctions@285i+ real /P9oint=M{::angleW(const*P9oint=?&D]pI])UUconst fbQool-hDEBUGK.٫=falsev\;=true=real*0mag@&=magnitude1();real*0pffmagI=p:magnitude.=r();if(magINVALID_REALBM\)fc}'err3|"WARNING! In angle()k. magnitude() failedƠ."" Returning INVALID_kREAL.\n"M,;returnAINVALID_REALm;gelse*.6if5.(mag0)fif*2(DEBUGY)c}'errlF"WARNING! In angle()mF.\n"F"*this has magnitudemF 0.\n"<"Returning INVALID_REAL.\n"F;returnAINVALID_REALm;gelse*.6if5.(pffmagyINVALID_REALBM\)fc}'err3|"WARNING! In angle()k. p.magnitude() failƠed."" Returning INVALID_kREAL.\n"M,;returnAINVALID_REALm;gelse*.6if5.(pffmagy0)fif*軫(DEBUGY)c}'err}"WARNING! In angle()m.\n" "p has magnitude 0.\mn"}&<"Returning INVALID_REAL.\n"F;returnAINVALID_REALm;gelse+returnO(180=PI ?B8ac}'os9(dotffpr}'oduct2!(p)=(mag8pffmagLA))); -g506. UnitTv9ector.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.10.27.]YAddedasecondversion.Ifassign#Bisnotused,1unitffve}'ctor4x()canbGeconst`,1soInowhave`507. Withzassignmen9t.ThisversionshouldonlyeverbGecalledwithtrueasitsargument.WUsingfalsewillUUwork,unlessUVthisaisconst*,inwhichcaseitwillcauseancompilationerror.q[LDFT2002.10.27.] -Iftheoptionalsilent身argumentistrue]k,warningmessageswillbGesuppressed,otherwise,theywillbeissued.TheIconst"߫versionIbGelowcan'thaveanoptionalsilent argument,'EbGecausethatwouldmakeacalltothisfunctionUUwithoneargumentambiguous.U9Ȅ`> 8BeginTLogJʄ`> +g506. UnitTv9ector.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.27.]YAddedasecondversion.Ifassign#Bisnotused,1unitffve}'ctor4x()canbGeconst`,1soInowhave`hDeclareUUP9oint"Dfunctions@284i+ -P9oint(unitffve}'ctorY(const*bQool7assignS$;constJbQool9vsilentTܫ=falsev\);mנn썫136WITHXASSIGNMENT t3DLDFPRÎGx508n@P508.hDe neUUP9oint"Dfunctions@285i+ +[LDFT2003.07.01.]X'AddedAthesilentmargumenttosuppresswarningmessages.II"keptgettingwarningswhenthis/functionwascalledfromintersectionfunctions,incaseswhereitwasn'taproblem,thataP9oint ʦ(vector)hadUU0magnitude.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +P9oint(unitffve}'ctorY(const*bQool7assignS$;constJbQool9vsilentTܫ=falsev\);on썷x5083DLDFPRÎG tWITHXASSIGNMENT137n@P508.hDe neUUP9oint"Dfunctions@285i+ P9oint(P9ointE::unitffve}'ctor1y(const*bQool7assignS$;constJbQool9vsilentR-ī) fif(assign4falsev\)fif)(:silent)f(c}'errBNa"WARNING! In Point::p{unit_vector():\n"g<"Don't call this function with false as  its argument.\n"h<"Use unit_vector() without an argument i nstead.\n"Ik<"Calling unit_vector() without an argume nt.\n\n";L ush;greturnAunitffve}'ctorr|2();gapplyfftr}'ansformZ();real*0m6A=magnitude1();if(m Ϸ0)=LDFUU2002.04.10.qAddedthiserrorhandlingcoGdeforthecasewhere*thishasnomagnitude.o=fif)(:silent)f(c}'errBNa"WARNING! In Point::p{unit_vector().\n"g<"Point (vector) has no magnitude. Return ing INVALID_POINT.\nvR\n" ɷ ush;greturnAINVALID_POINT;gfor%舫(in9ti=0;i 9 <3;i++)worldffc}'oordinatesR[iq]==UOm;worldffc}'oordinatesa[3]=1;=[LDFT2002.10.27.]T7SettingUUthew-coGordinateto1,justtobesure.o=return7漷=:5 -6);})n썷x5123DLDFPRÎG/ MEDIAJTION137n@P512.hDe neUUnon-membGerfunctionsforP9oints'ݭ437i+ -P9oint(me}'diateK(P9ointp0+];P9oint Ep1,;constJreal6xr;R) -fp0 ±:applyfftr}'ansformF߫();p1 ±:applyfftr}'ansformF߫();p0"ڷ=2l(188r);p1"ڷ=2lr76%;return7漫(p0O+8p1); +g511. Mediation.9Ȅ`+U 8Log)j`+U +[LDFT2003.12.09.]Y;ChangedUUfromanon-membGertoaconst!membGerfunction.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +P9oint(me}'diateK(P9ointp#;constJreal6xr>=:5 +6)UUconst*;~n썫138MEDIAJTION/ 3DLDFPRÎGx512n@P512.hDe neUUP9oint"Dfunctions@285i+ +P9oint(P9ointE::me}'diate#y(P9ointp#;constJreal6xr;R)UUconst +fP9oint2t6(this뷫);tc=)(188r);p=+]Qr0'e;return7漫(tR+8p@); g513. Get/normal.getffnormal< -p()ĵmustbGede nedinpaths.web,becauseitusesaP9athΫinitsde nition,whichUUisanincompletelyde nedtypGeinthis le.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.07.11.]Y;AddedUUthisdeclaration.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +p()ĵmustbGede nedinpaths.web,becauseitusesaP9athΫinitsde nition,whichUUisanincompletelyde nedtypGeinthis le.9Ȅ`+U 8Log)j`+U +[LDFT2003.07.11.]Y;AddedUUthisdeclaration.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ P9oint(getffnormalYz(const*P9oint=?&D]pI];constJP9oint>&FqK^)UUconst*;514. Comparison.515. Equalit9y .!!RImayhavetoadjusttovqalueofeps[.RItwouldbGenicetobeabletouseepsilon"f(), Xbut for ,otherpurpGosesepsilon"{0()mustbesmaller.YdT*ransformationsseemtocausefairlylargeinaccuraciesinthevqaluesUUofthecoGordinates,soIneedgreatertoleranceinthefunctionstestingforequalityandinequality*. -This1functioncouldbGeformulatedmoresuccinctly*,8butI1hadsometroublegettingittoworkpropGerly*,8soI'mUUleavingitinitsmoreverbGoseform,incaseIhavetodebugitsomemore.516. Non-constTv9ersion.9Ȅ`> 8BeginTLogJʄ`> +This1functioncouldbGeformulatedmoresuccinctly*,8butI1hadsometroublegettingittoworkpropGerly*,8soI'mUUleavingitinitsmoreverbGoseform,incaseIhavetodebugitsomemore.516. Non-constTv9ersion.9Ȅ`+U 8Log)j`+U [LDFT2002.10.27.]Y1Revised~thisfunction.NowusingP9oint"Ba+`oandP9oint"Bq'j.Addedfactor"ثandusingitasthe,Rargumenttocle}'anmԫ()andforcalculatingepsN.dSincethisfunctionisanopGerator,4it'snotpossibletopassfactor:[as6}anargument,nunfortunately*.?Usingcle}'anw(factorޫ)makesitpGossibletocomparethecoordinateswith0directlyratherthanusingfabs٫()andepsɫ.WAlso,4opQerator/K7()nowusesworldffc}'oordinatesTX directlyratherUUthangetffx㼫(),getffyk(),andgetffz]V(). -[LDFT2003.07.09.]Y;MadeUUthisfunctionnon-constM,andaddedconst!versionbGelow.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ -bQool#gopQeratorO8V:(P9ointp#);n썫138NON-CONSTXVERSIONA3DLDFPRÎGx517n@P517.hDe neUUP9oint"Dfunctions@285i+ +[LDFT2003.07.09.]Y;MadeUUthisfunctionnon-constM,andaddedconst!versionbGelow.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ +bQool#gopQeratorO8V:(P9ointp#); n썷x5173DLDFPRÎGANON-CONSTXVERSION139n@P517.hDe neUUP9oint"Dfunctions@285i+ bQool#gP9oint@;::FopQeratorr`z'ī(P9ointp#)fUUbQoolDEBUG:,=falsev\;=trueĒ=if)(DEBUGY)c}'out O"Entering Point::opekrator==()">"\n" ush;unsignedN7shortlfactor̪=10 ;=LDFUU2002.10.27.qAdded.o=cle}'an5A(factorޫ);p#:cle}'anA(factorޫ);real41epsF =epsilon"6()8factor<;=ThisUUcurrentlymakesepsl:0001.o=real41tffxDՂ=worldffc}'oordinatesO[0];real41tffyD1=worldffc}'oordinatesO[1];real41tffzDO=worldffc}'oordinatesO[2];real41pffxFw=p:worldffc}'oordinatesM[0];real41pffyF&=p:worldffc}'oordinatesM[1];real41pffzF=p:worldffc}'oordinatesM[2];518. P9oints/arefrequentlycomparedtoINVALID_POINTHګ,Njsoit'sbGesttosuppressdebuggingoutputfortheseUUcomparisons,bGecausethey'reprobablynottheoneswe'reinterestedin.hDe neUUP9oint"Dfunctions@285i+ if(tffxaʷINVALID_REALD_RDtffyINVALID_REAL_RDtffz-INVALID_REAL_RDpffx~INVALID_REAL_RDpffyc(INVALID_REALi(_8pffzINVALID_REALBM\)DEBUG"q=falsev\;519. DebuggingUUoutput.hDe neUUP9oint"Dfunctions@285i+ if(DEBUGY)fc}'out* Q"t_x == "5T}tffxiendl ush;c}'out* Q"t_y == "5T}tffyendl ush;c}'out* Q"t_z == "5T}tffzcendl ush;c}'out* Q"p_x == "5T}pffx^endl ush;c}'out* Q"p_y == "5T}pffy endl ush;c}'out* Q"p_z == "5T}pffz,endl ush; -g520. CheckUUwhetherthecoGordinatesofbothP9oints&.areall0.9Ȅ`> 8BeginTLogJʄ`> +g520. CheckUUwhetherthecoGordinatesofbothP9oints&.areall0.9Ȅ`+U 8Log)j`+U [LDFT2002.10.27.]XTNow6thatcle}'an⸫(10 -)andp6:cle}'anA(10)arecalledabGove,`hDe neUUP9oint"Dfunctions@285i+ +)andp6:cle}'anA(10)arecalledabGove, 8BeginTLogJʄ`> -[LDFT2002.10.27.]XgAsintheprevioussection,ԿchangedsothatthecoGordinatesarecomparedwith0,insteadofUUusingfabs'()andepsw.Ȅ` 8EndTLogA>`hDe neUUP9oint"Dfunctions@285i+ +gѠn썫140NON-CONSTXVERSIONA3DLDFPRÎGx521n@P521. GetUUthesignsofthecoGordinates.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.27.]XgAsintheprevioussection,ԿchangedsothatthecoGordinatesarecomparedwith0,insteadofUUusingfabs'()andepsw.Ȅ`GhDe neUUP9oint"Dfunctions@285i+ signed-oshortK:tffxffsignm4; signed-oshortK:tffyffsignml*; signed-oshortK:tffzffsignl; @@ -1901,7 +1932,7 @@ if(DEBUGY)fc}'out* Q"t_x_sign == "Ontffxffsign'Jendl ush;c}'out* Q"t_y_sign == "Ontffyffsign'endl ush;c}'out* Q"t_z_sign == "Ontffzffsign&}endl ush;c}'out* Q"p_x_sign == "Onpffxffsign)R?endl ush;c}'out* Q"p_y_sign == "Onpffyffsign)endl ush;c}'out* Q"p_z_sign == "Onpffzffsign(rendl ush; g if((tffxffsign$26=pffxffsign&')8_(tffyffsign$6=pffyffsign&)_(tffzffsign$4e6=pffzffsign%Z))fif(DEBUGY)c}'out4 R"At least one coordiknate pair has signs Ơthat differ. "!"Returning false.\n"lMD;return7falseL; -gɠn썫140NON-CONSTXVERSIONA3DLDFPRÎGx522n@P522. GetUUthedi erencebGetweenUUeachpairofx,y*,andz-coGordinates.hDe neUUP9oint"Dfunctions@285i+ +gn썷x5223DLDFPRÎGANON-CONSTXVERSION141n@P522. GetUUthedi erencebGetweenUUeachpairofx,y*,andz-coGordinates.hDe neUUP9oint"Dfunctions@285i+ tffx"R=fabs(tffx [9); tffy=fabs(tffy @); tffz=fabs(tffz ӫ); @@ -1919,14 +1950,14 @@ if(DEBUGY)c}'out O"r == "*ԃr XDendl ush; if(DEBUGY)c}'out O"Exiting Point::operkator==()"TA"\n" ush; -return-滱r2ϫ;qǷg523. constcv9ersion.[LDFT2003.07.09.]YThism5functionmerelycopiesm6this!andcallsthenon-constBversiononCthecopy*.kHere,GPp canbGeaconst!\P9oint@;&H ,GPbecausethisfunctiondoesnothingbutpassittonon-constversion,UUwhereitispassedbyvqalue.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.07.09.]Y;AddedUUthisversion.qMadetheoriginalversionnon-constM.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +return-滱r2ϫ;qǷg523. constcv9ersion.[LDFT2003.07.09.]YThism5functionmerelycopiesm6this!andcallsthenon-constBversiononCthecopy*.kHere,GPp canbGeaconst!\P9oint@;&H ,GPbecausethisfunctiondoesnothingbutpassittonon-constversion,UUwhereitispassedbyvqalue.9Ȅ`+U 8Log)j`+U +[LDFT2003.07.09.]Y;AddedUUthisversion.qMadetheoriginalversionnon-constM.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ bQool#gopQeratorO8V:(const*P9oint=?&D]pI])UUconst*;524.hDe neUUP9oint"Dfunctions@285i+ bQool#gP9oint@;::FopQeratorr`z'ī(const*P9oint=?&D]pI])UUconst fP9oint2c}'opyG(this뷫);return7漫(c}'opyWp); g525. Inequalit9y .hDeclareUUP9oint"Dfunctions@284i+ -bQool#gopQeratorO86=V:(const*P9oint=?&D]pI])UUconst*;n썷x5263DLDFPRÎG+UINEQUALITY141n@P526.hDe neUUP9oint"Dfunctions@285i+ +bQool#gopQeratorO86=V:(const*P9oint=?&D]pI])UUconst*;n썫142INEQUALITY+U3DLDFPRÎGx526n@P526.hDe neUUP9oint"Dfunctions@285i+ bQool#gP9oint@;::FopQeratorr`6=z'(const*P9oint=?&D]pI])UUconst freturn7漷:(thisϷp); g527. In9tersection. @@ -1935,15 +1966,15 @@ ectorWv9ersion.[LDFT2003.06.29.][%De nedDinlines.web,?bGecauseLine isanincompletetypehere. ThevalgorithmusedinthisfunctionistakenfromJones,IHuw.xComputerGr}'aphicsThroughKeyMathe-matics,UUpp.208{311.qSeeReferencesforthecompletereference. !!&ItmaybGenecessaryordesirabletoaddtry4:::catc9h>iblockswherecalculationsareperformedbelow,justUUincaseover owUUoGccurs. -!!>BUnderD)Linux,bGoththisfunctionandtheversionofinterse}'ctionffpointsU()usingtraceshavefailedinthecksamecases,fwhichinvolvedcoplanarlineswhichhadbGeenrotatedaboutthez-axisortheyandz-axes.IsuspGectithastodowiththeroutinesforsineandcosine,sinceI'vehadtroublewithrotationintheconstructorsUUforP9olyhedra6ֱ.q[LDFT2003.06.29.]c9Ȅ`> 8BeginTLogJʄ`> +!!>BUnderD)Linux,bGoththisfunctionandtheversionofinterse}'ctionffpointsU()usingtraceshavefailedinthecksamecases,fwhichinvolvedcoplanarlineswhichhadbGeenrotatedaboutthez-axisortheyandz-axes.IsuspGectithastodowiththeroutinesforsineandcosine,sinceI'vehadtroublewithrotationintheconstructorsUUforP9olyhedra6ֱ.q[LDFT2003.06.29.]N99Ȅ`+U 8Log)j`+U [LDFT2002.04.10.]Y;AddedUUthisfunction.qItreplacestheoldversion,bGelow. [LDFT2002.04.12.]YRemoved?thede nitionofthisfunctiontolines.web,zbGecauseitrequirestheuseofLinesΎ,UUandLine-isanincompletetypGehere. -[LDFT2003.06.29.]YStartedusingthisversionagain.خBug xesI'vemadeelsewhereseemtohavemadeitfunction.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +[LDFT2003.06.29.]YStartedusingthisversionagain.خBug xesI'vemadeelsewhereseemtohavemadeitfunction.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ static(޺bQoolus4wpoin9ta5interse}'ctionffpoint (constP9oint 8BeginTLogJʄ`> -[LDFT2002.10.27.]XtChanged2theconst!:iP9oint@?&KargumentstoP9oint֫,9bGecauseI2hadtocopythemanywayinUUordertocallapplyfftr}'ansformIu4()onthem.sn썫142TRAÎCEXVERSIONS3DLDFPRGx529n@P -[LDFT2003.06.29.]YkAddedthebQool{argumenttr}'aceƫ,эinordertobGeabletouseboththevectorandtrace versions.;Previously*,Hthevectorversiondidn'twork,Handwascommented-out.;Now,Hbug xeselsewhereseemtoghavemadethevectorversionwork.Bothversions,lhowever,failedgunderLinux.SeetheTU>VExXl/sectionfortheUUvectorversion,abGove,formoreinformation.Ȅ` 8EndTLogA>`hDeclareUUP9oint"Dfunctions@284i+ +ThebQoolL?argumenttr}'ace?servesonlytodistinguishthisfunctionfromthevectorversion. ItdoGesn'tmatterUUwhetherit'strueoBorfalse.q[LDFT2003.06.29.]N99Ȅ`+U 8Log)j`+U +[LDFT2002.10.27.]XtChanged2theconst!:iP9oint@?&KargumentstoP9oint֫,9bGecauseI2hadtocopythemanywayinUUordertocallapplyfftr}'ansformIu4()onthem.;n썷x5293DLDFPRÎGSTRACEXVERSION143n@P +[LDFT2003.06.29.]YkAddedthebQool{argumenttr}'aceƫ,эinordertobGeabletouseboththevectorandtrace versions.;Previously*,Hthevectorversiondidn'twork,Handwascommented-out.;Now,Hbug xeselsewhereseemtoghavemadethevectorversionwork.Bothversions,lhowever,failedgunderLinux.SeetheTU>VExXl/sectionfortheUUvectorversion,abGove,formoreinformation.Ȅ`GhDeclareUUP9oint"Dfunctions@284i+ static)HbQoolus4wpoin9tauinterse}'ctionffpointK(P9ointp0+];P9oint Ep1,;P9oint Eq0,.,;P9oint Eq1;constJbQool9vtr}'aceO);530.hDe neUUP9oint"Dfunctions@285i+ bQoolus4wpoin9tBP9oint_kL::interse}'ctionffpointNګ(P9ointp0+/;P9oint ép1,i;P9oint éq0,W;P9oint éq1;constbQool9xtr}'aceO)f2bQoolKkDEBUGi.ܫ=falsev\;=trueĒ=if)(DEBUGY)f(c}'out> S"Entering Point::intkersection_point().\nƠ"T ush;(p04ı:show("p0"\);(p14ı:show("p1"\);(q03:show("q0"\);(q13:show("q1"\);gbQoolus4wpoin9tVbpa;=ReturnUUvqalue.o=if)(DEBUGY)c}'out O"Error after here 0.k\n"~S ush;531. Applythetransformations,%sowehavethecorrectvqaluesforx,%y*,andzineachoftheP9oints#=*.]ThenassignUUthemtovqariables.hDe neUUP9oint"Dfunctions@285i+ p0:applyfftr}'ansformF߫(); @@ -1962,7 +1993,7 @@ real /q1ffx79 =q1Z:worldffc}'oordinatesM[0]; real /q1ffy7=q1Z:worldffc}'oordinatesM[1]; real /q1ffz6=q1Z:worldffc}'oordinatesM[2]; -if(DEBUGY)c}'out O"Error after here 1.k\n"~S ush;n썷x5323DLDFPRÎGSTRACEXVERSION143n@P532. GetUUdeltas.hDe neUUP9oint"Dfunctions@285i+ +if(DEBUGY)c}'out O"Error after here 1.k\n"~S ush;Un썫144TRAÎCEXVERSIONS3DLDFPRGx532n@P532. GetUUdeltas.hDe neUUP9oint"Dfunctions@285i+ real /deltaffxffpJn=p1ffxA8p0ffxz~; real /deltaffyffpJ|=p1ffy'E8p0ffy`-; real /deltaffzffpI9=p1ffz08p0ffz; @@ -1992,7 +2023,7 @@ if(slop}'effqffxffy2Ce6=INVALID_REALBM\)=xq16=0.o= fyffintffq5=q0ffyl8(slop}'effqffxffy1-q0ffx); g -if(DEBUGY)c}'out O"Error after here 6.k\n"~S ush;n썫144TRAÎCEXVERSIONS3DLDFPRGx536n@P536.  +if(DEBUGY)c}'out O"Error after here 6.k\n"~S ush;ꁠn썷x5363DLDFPRÎGSTRACEXVERSION145n@P536.  IfvbGothofthetracesof~p andpU~q «inthex-yplaneareparalleltothey-axis(i.e.,~xs=0),wevtestwhether px9=0qx..IfYtheyare,thenwesetxffitothatvqalue.Ifthey'renot,thelinesdon'tintersect,sowereturn INVALID_POINTNB. @@ -2004,7 +2035,7 @@ if(yffintffp!AINVALID_REALD<^8yffintffq#8INVALID_REALBM\)=q~pxzǫandO~UUqxzEareUUbGothparalleltothez-axis.o= fif(DEBUGY)c}'out O"Error after here 7.k\n"~S ush;if(p0ffxq0ffxݫ)=TheyUUhavethesamevqalueforx.o=fif)(DEBUGY)c}'out O"Error after here 8.k\n"~S ush;if)(DEBUGY)c}'out O"Traces on x-y planek are coincident.\n"# ush;xffi-=p0ffx;real41yffintffpffz^S =INVALID_REALBM\;real41yffintffqffz]4=INVALID_REALBM\;if)(slop}'effpffzffy29q6=INVALID_REALBM\)yffintffpffz.ܫ=p0ffy'E8slop}'effpffzffy38p0ffz;if)(slop}'effqffzffy16=INVALID_REALBM\)yffintffqffz.=q0ffyl8slop}'effqffzffy3a@8q0ffzq?;if)(DEBUGY)c}'out O"Error after here 9.k\n"~S ush;if)(slop}'effpffzffy29qINVALID_REALD<^8slop}'effqffzffy3xINVALID_REALBM\)f(if3(DEBUGY)c}'out O"Both traces on z-y kplane are vertical\nƠ"T ush;(if3(DEBUGY)c}'out O"Error after here 10k.\n"P ush;(if3(p0ffzPq0ffzw)c}'err|"Lines are coincidenkt.\n"5;(else?c}'errUU"Lines do not interskect.\n" /;(c}'err=|·"Returning INVALID_BkOOL_POINT.\n\n"/ ush;(returnKINVALID_BOOL_POINT;gelse4.7if?/(slop}'effpffzffy29qINVALID_REALBM\)f(if3(DEBUGY)c}'out O"The p-trace is vertkical\n"G ush;(if3(DEBUGY)c}'out O"Error after here 11k.\n"P ush;(zffi7$=p0ffzP;(yffi7=zffi]8slop}'effqffzffy3a@+8yffintffqffz(˫;(if3(DEBUGY)f2c}'outH T"x_i == "5T}xffixendl ush;2c}'outH T"y_i == "5T}yffi endl ush;2c}'outH T"z_i == "5T}zffiǷendl ush;2c}'outH T"slope_q_z_y == "_Teslop}'effqffzffy4}endl ush;2c}'outH T"y_int_q_z == "Tkyffintffqffz+endl ush;(ggelse4.7if?/(slop}'effqffzffy1INVALID_REALBM\)f(if3(DEBUGY)c}'out O"The q-trace is vertkical\n"G ush;(if3(DEBUGY)c}'out O"Error after here 12k.\n"P ush;(zffi7$=q0ffzw;(yffi7=zffi]8slop}'effpffzffy3+8yffintffpffz);(if3(DEBUGY)f2c}'outH T"x_i == "5T}xffixendl ush;2c}'outH T"y_i == "5T}yffi -endl ush;n썷x5363DLDFPRÎGSTRACEXVERSION145n@P2c}'outH T"z_i == "5T}zffiǷendl ush; 2c}'outH T"slope_p_z_y == "_Teslop}'effpffzffy5endl ush;2c}'outH T"y_int_p_z == "Tkyffintffpffz,fendl ush;(ggelse5f(if3(DEBUGY)c}'out O"Neither trace is vekrtical\n"TA ush;(if3(DEBUGY)c}'out O"Error after here 13k.\n"P ush;(zffi7$=(yffintffqffz(˷8yffintffpffz))=(slop}'effpffzffy198slop}'effqffzffy1(`);(yffi7=slop}'effpffzffy4rQ8zffiW+8yffintffpffz);(if3(DEBUGY)f2c}'outH T"x_i == "5T}xffixendl ush;2c}'outH T"y_i == "5T}yffi +endl ush;n썫146TRAÎCEXVERSIONS3DLDFPRGx536n@P2c}'outH T"z_i == "5T}zffiǷendl ush; 2c}'outH T"slope_p_z_y == "_Teslop}'effpffzffy5endl ush;2c}'outH T"y_int_p_z == "Tkyffintffpffz,fendl ush;(ggelse5f(if3(DEBUGY)c}'out O"Neither trace is vekrtical\n"TA ush;(if3(DEBUGY)c}'out O"Error after here 13k.\n"P ush;(zffi7$=(yffintffqffz(˷8yffintffpffz))=(slop}'effpffzffy198slop}'effqffzffy1(`);(yffi7=slop}'effpffzffy4rQ8zffiW+8yffintffpffz);(if3(DEBUGY)f2c}'outH T"x_i == "5T}xffixendl ush;2c}'outH T"y_i == "5T}yffi endl ush;2c}'outH T"z_i == "5T}zffiǷendl ush;2c}'outH T"slope_p_z_y == "_Teslop}'effpffzffy5endl ush;2c}'outH T"y_int_p_z == "Tkyffintffpffz,fendl ush;2c}'outH T"slope_q_z_y == "_Teslop}'effqffzffy4}endl ush;2c}'outH T"y_int_q_z == "Tkyffintffqffz+endl ush;(gggelse:=TheyUUdon'thaveUUthesamevqalueforx.o=fif)(DEBUGY)c}'out O"Error after here 14k.\n"P ush;c}'err3|"Lines do not interskect:\n" /;c}'err3 Hc"("%Hcp0ffxdHc", ""Hcp0ffyHc", "Hcp0ffzKHc") -- ("1Hcp1ffxHc", "Hcp1ffy2", "J Qp1ffz^Q")\n("&Qq0ffxbQ", ")Qq0ffyGķQ", "Qq0ffzۯQ") -- ("1)Qq1ffx2", "JMyq1ffy2", "q1ffzƏ")\nReturning INVALIkD_BOOL_POINT.\n", ush;returnAINVALID_BOOL_POINT;g g else .5if+-(yffintffp!AINVALID_REALBM\)=q~pxyisUUparalleltothey-axis.o= @@ -2012,7 +2043,7 @@ g else .5if+-(yffintffq!INVALID_REALBM\)=Ʊ~qxy#isUUparalleltothey-axis.o= fif(DEBUGY)c}'out O"Error after here 16k.\n"P ush;xffi#~=q0ffxݫ;yffi#=slop}'effpffxffy48xffi\$+8yffintffp ; -g̠n썫146TRAÎCEXVERSIONS3DLDFPRGx537n@P537. [LDFT2002.11.12.]ZB!!ZBUG:OccurredwhenItriedto ndanintersectionoftwolinesinthex-zplane. ThiscoGdeshouldn'tbereached.n썷x5373DLDFPRÎGSTRACEXVERSION147n@P537. [LDFT2002.11.12.]ZB!!ZBUG:OccurredwhenItriedto ndanintersectionoftwolinesinthex-zplane. ThiscoGdeshouldn'tbereached.6=slop}'effqffxffy2Ce)fxffi-=(yffintffq qʷ8yffintffp )=(slop}'effpffxffy288slop}'effqffxffy1-);yffi-=slop}'effpffxffy48xffi\$+8yffintffp ;g @@ -2028,10 +2059,10 @@ fzffintffq4;=q0ffz8W8(slop}'effqffxffz1Iq0ffx); g if(DEBUGY)fc}'out* Q"z_int_p == "JTqzffintffp#D˷endl ush;c}'out* Q"z_int_q == "JTqzffintffq#׷endl ush; -g539. [LDFT2003.06.24.]ZxffijΫwillXbGeequaltoINVALID_REALB,Yifthetracesofthelinesonthex-yplanewerecolinear.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.06.24.]Y;AddedUUthisconditional.Ȅ` 8EndTLogA>`hDe neUUP9oint"Dfunctions@285i+ +g539. [LDFT2003.06.24.]ZxffijΫwillXbGeequaltoINVALID_REALB,Yifthetracesofthelinesonthex-yplanewerecolinear.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.24.]Y;AddedUUthisconditional.Ȅ`GhDe neUUP9oint"Dfunctions@285i+ if(xffi|INVALID_REALD<^8:(zffintffp }INVALID_REAL_zffintffq"tINVALID_REALBM\))fxffi#~=(zffintffq8zffintffp{)=(slop}'effpffxffz18slop}'effqffxffz1I);yffi#=p0ffye; -g+n썷x5403DLDFPRÎGSTRACEXVERSION147n@P540. In̓thefollowingcase,ֱ~bpxzjand\~qxz4larebGothparalleltothez-axis.׀Theyhavethesamevqalueforx. W*e'veUUsetxffiabGove,sothere'snoneedtodosohereagain.hDe neUUP9oint"Dfunctions@285i+ +g+n썫148TRAÎCEXVERSIONS3DLDFPRGx540n@P540. In̓thefollowingcase,ֱ~bpxzjand\~qxz4larebGothparalleltothez-axis.׀Theyhavethesamevqalueforx. W*e'veUUsetxffiabGove,sothere'snoneedtodosohereagain.hDe neUUP9oint"Dfunctions@285i+ if(zffintffp }INVALID_REALD<^8zffintffq"tINVALID_REALBM\)fif(DEBUGY)c}'out O"Error after here 19k.\n"P ush;if(p0ffx6=q0ffxݫ)fif)(DEBUGY)c}'out O"Error after here 20k.\n"P ush;c}'err4FL"Lines do not intersmFect:\n"үFL"("FLp0ffx6FL", "FLp0ffzGзFL", "2p0ffzIܷ") -- ("2p1ffxJܷ", "p1ffzv", "p1ffz")\n("(q0ffx2", "K Cq0ffzݷC", " ڷCq0ffzC") -- ("3 ηCq1ffxFCC", "Cq1ffzCq1ffz2")\nReturning INVALID_BOOL_POINT.\n"M ush;returnAINVALID_BOOL_POINT;g g else .5if+-(zffintffp }INVALID_REALBM\)fif(DEBUGY)c}'out O"Error after here 21k.\n"P ush;zffi#$=p0ffzP; @@ -2040,7 +2071,7 @@ g else!fif(DEBUGY)c}'out O"Error after here 23k.\n"P ush;zffi#$=slop}'effpffxffz4 8xffi\$+8zffintffp{; g -g?Bn썫148TRAÎCEXVERSIONS3DLDFPRGx541n@P541. [LDFT2002.10.27.]ZuIfxffi|,yffiþ,andzffiareallvqalid,setbpm :pt w1usingthosevqalues.)Otherwise,setitto INVALID_POINTDA.mJIfGthisP9oint"*isonbGothofthelinesegmentsȍƍg!N8p0|sp1andȍW!N8q0|sq1.g,Jsetbp"X:btotrue w,otherwisesetitUUtofalse.hDe neUUP9oint"Dfunctions@285i+ +g?n썷x5413DLDFPRÎGSTRACEXVERSION149n@P541. [LDFT2002.10.27.]ZuIfxffi|,yffiþ,andzffiareallvqalid,setbpm :pt w1usingthosevqalues.)Otherwise,setitto INVALID_POINTDA.mJIfGthisP9oint"*isonbGothofthelinesegmentsȍƍg!N8p0|sp1andȍW!N8q0|sq1.g,Jsetbp"X:btotrue w,otherwisesetitUUtofalse.hDe neUUP9oint"Dfunctions@285i+ if(DEBUGY)fc}'out* Q"Error after here 24k.\n"P ush;c}'out* Q"x_i == "5T}xffixendl ush;c}'out* Q"y_i == "5T}yffi endl ush;c}'out* Q"z_i == "5T}zffiǷendl ush; g @@ -2058,17 +2089,17 @@ fcle}'ar*(۫();tr}'ansformBz[=p:tr}'ansform+A;for%舫(v9ectorHhShapQe"Ab'Aci::Bc}'onstffiteratorCiterW=p:shap}'es:b}'egin();iter6=p:shap}'es:endಫ();iterJ++")fshap}'es::pushffb}'ack+XR((iter)~getffc}'opy(õ());gLabQel38lblC%;for%舫(v9ectorHhLabQel$i::Bc}'onstffiteratorCiterW=p:lab}'elsT:b}'egin();iter6=p:lab}'els:endಫ();iterJ++")flbl,=(iter)~getffc}'opy(õ();lab}'els6T:pushffb}'ack+XR(lbl Aj);g g544. Cop9yOconstructor.!!JPOR*TING}[LDFT2002.12.05.]QsMovedherefrompictures.web.Seethat leforUUexplanation.hDe neUUPicture,Ffunctions@219i+ Picture0::Picture&(const*PictureG&N"pS") -:qdofflab}'els*(trueĘ)UUfJ3n썷x5443DLDFPRÎGZCOPYXCONSTRUCTOR149n@Pthis,ѫ=p; -g545. Com9biningTPictures.[LDFT2002.04.17.]Z6AddedUUthisfunction.c9Ȅ`> 8BeginTLogJʄ`> +:qdofflab}'els*(trueĘ)UUfJzn썫150COPYXCONSTRÎUCTORZ3DLDFPRGx544n@Pthis,ѫ=p; +g545. Com9biningTPictures.[LDFT2002.04.17.]Z6AddedUUthisfunction.N99Ȅ`+U 8Log)j`+U [LDFT2002.10.29.]Y;MadeUUp const)LandUU xedbugsthatchangedp (seebGelow). [LDFT2002.10.29.]YiBUGFIX:Now,p:tr}'ansform/iisappliedto(shap}'es:b}'ackë()),previouslyitwasappliedtoUUUV UWiter U,UUwhichwasnotwhatIwanted. [LDFT2002.10.29.]XBUGFIX:"Now,,p ,:tr}'ansform.cisappliedto#(lab}'elsT:b}'ackë()~pt 䞫),,previouslyitwasappliedtoUUUV((iter)~pt 䞫),UUwhichisnotwhatIwanted. -[LDFT2002.10.29.]Y;BUGUUFIX:Now,p]U:tr}'ansform+A:r}'esetƷ()isnolongercalled.Ȅ` 8EndTLogA>`hDe neUUPicture,Ffunctions@219i+ +[LDFT2002.10.29.]Y;BUGUUFIX:Now,p]U:tr}'ansform+A:r}'esetƷ()isnolongercalled.Ȅ`GhDe neUUPicture,Ffunctions@219i+ v9oid"PictureI::P((opQerator{ݫ+=M(const*PictureG&N"pS") ffor%舫(v9ectorHhShapQe"Ab'Aci::Bc}'onstffiteratorCiterW=p:shap}'es:b}'egin();iter6=p:shap}'es:endಫ();iterJ++")fshap}'es::pushffb}'ack+XR((iter)~getffc}'opy(õ());(=<[LDFT2002.10.29.]SNormally*,8tr}'ansform2in1aPicture+5isappliedtoitsShapQes)qwhenit'soutput,2however,itmustbGedonenowforthecopiesoftheShapQes*fromPicture,Qp5Lthatarecopied2onto==this),BbGecause=pE:tr}'ansform./is=onlyknownwithinpE;itheShapQes)%don't\know"abGoutit.=#(shap}'es:b}'ackë())=UOp]O:tr}'ansform+A;gfor%舫(v9ectorHhLabQel$i::Bc}'onstffiteratorCiterW=p:lab}'elsT:b}'egin();iter6=p:lab}'els:endಫ();iterJ++")flab}'els6T:pushffb}'ack+XR((iter)~getffc}'opy(õ());#(lab}'elsT:b}'ackë()~pt 䞫)=UOp]O:tr}'ansform+A;g g546. ClearTPicture.hDe neUUPicture,Ffunctions@219i+ v9oid"PictureI::cle}'ar(ݫ() -fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Picture::cklear().\n"> ush;if(shap}'es:size\()0 ^8lab}'elsб:size()0)return%e;tr}'ansform?C:r}'esetƷ();for%舫(v9ectorHhShapQe"Ab'Aci::Biter}'ator)7iter=+M=shap}'es:b}'egin();iter6=shap}'es:endಫ();iterJ++")f(iter)~cle}'ar(ګ();delete?ƽ(iter);gfor%舫(v9ectorHhLabQel$i::Biter}'ator)7iter=+M=lab}'els:b}'egin();iter6=lab}'els:endಫ();iterJ++")f(=I??ɪIrtriedrtouse 9LabQel'{"()here,ybutitdidn'twork.Irgotrun-timeerrorshavingtodowith2\Unalignedaccesspid=299273::: "(didn'tunderstand).yThisworks,Jthough.IfIchangethe2de nitionUUofLabQel,I'llhaveUUtomakecorrespGondingchangeshere.o=delete?ƽ(iter)~pt 䞫;delete?ƽ(iter);gshap}'es0:cle}'ar(٫();\n썫150CLEARXPICTURE 3DLDFPRÎGx546n@Plab}'els,T:cle}'ar(٫(); if(DEBUGY)c}'out O"Exiting Picture::clkear().\n"TA ush; +fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Picture::cklear().\n"> ush;if(shap}'es:size\()0 ^8lab}'elsб:size()0)return%e;tr}'ansform?C:r}'esetƷ();for%舫(v9ectorHhShapQe"Ab'Aci::Biter}'ator)7iter=+M=shap}'es:b}'egin();iter6=shap}'es:endಫ();iterJ++")f(iter)~cle}'ar(ګ();delete?ƽ(iter);gfor%舫(v9ectorHhLabQel$i::Biter}'ator)7iter=+M=lab}'els:b}'egin();iter6=lab}'els:endಫ();iterJ++")f(=I??ɪIrtriedrtouse 9LabQel'{"()here,ybutitdidn'twork.Irgotrun-timeerrorshavingtodowith2\Unalignedaccesspid=299273::: "(didn'tunderstand).yThisworks,Jthough.IfIchangethe2de nitionUUofLabQel,I'llhaveUUtomakecorrespGondingchangeshere.o=delete?ƽ(iter)~pt 䞫;delete?ƽ(iter);gshap}'es0:cle}'ar(٫();\Vn썷x5463DLDFPRÎG CLEARXPICTURE151n@Plab}'els,T:cle}'ar(٫(); if(DEBUGY)c}'out O"Exiting Picture::clkear().\n"TA ush; g547. Output.TheUUarguments: sortffvalue9 is6usedtodeterminehowtosorttheShapQes&).gThevqaluestobGeusedarefoundinnamespace Sorting/jG.S 8BeginTLogJʄ`> +oQcus#{Jwhereitwon'tbGeableto\see"partoftheimage.kInthesecases,UUitwillbGeannoyingtoseethewarnings.9Ȅ`+U 8Log)j`+U [LDFT2002.09.21.]Y;AddedUUtheargumentsdoffsort&oanddoffwarnings9. -[LDFT2003.05.16.]XCChangede]bQooldoffsort=toe]constunsignedNshortksortffvalue.!AbGoute]toaddnamespaceSorting(withUUconstantsfordi erentwaysofsorting,i.e.,\nosort",\nearest-last",or\furthest- rst".Ȅ` 8EndTLogA>`548. F +[LDFT2003.05.16.]XCChangede]bQooldoffsort=toe]constunsignedNshortksortffvalue.!AbGoute]toaddnamespaceSorting(withUUconstantsfordi erentwaysofsorting,i.e.,\nosort",\nearest-last",or\furthest- rst".Ȅ`G548. F oQcusTargumen9t.hDe neUUPicture,Ffunctions@219i+ v9oid#9PictureJJ::outputD(constF -oQcus@Z&H!!fN;const ǪunsignedQshortppr}'ojޱ;realP6factor4T;const2unsignedbshortBsortffvalue\;const 2bQool:0 S"Entering Picture::okutput(const Focus& .Ơ..).\n"  ush;(c}'out> S"min_x_proj == "Zhminffxffpr}'oj5_~endl ush;(c}'out> S"max_x_proj == "Zhmaxffxffpr}'oj6o#endl ush;(c}'out> S"min_y_proj == "Zhminffyffpr}'oj5endl ush;(c}'out> S"max_y_proj == "Zhmaxffyffpr}'oj6endl ush;g=CheckUUwhetherthev9ector&Tshap}'esFЫhasanythinginit.qIfitdoGesn't,return.o=if)(shap}'es:size\()0 ^8lab}'elsб:size()0)f(if3(DEBUGY)c}'out O"Picture is empty. Rketurning.\n"8 ush;(returnHi;gn̠n썷x5493DLDFPRÎGXEF9OCUSXARGUMENT151n@P549. [LDFT2002.09.17.]ZF1SomePShapQes)mayPconsistofotherShapQes&, andnothaveanoutput "()functionof theirMown,O3sowemustextracttheircontentsrecursivelyuntilwegettoShapQes*thathaveone.o9Sofar,O3onlyP9ointH,UUP9ath湫,UUandSolid (haveUUoutput d()UUfunctions,andallotherShapQes*reducetoP9aths#JorSolids!\h. +oQcus@Z&H!!fN;const ǪunsignedQshortppr}'ojޱ;realP6factor4T;const2unsignedbshortBsortffvalue\;const 2bQool:0 S"Entering Picture::okutput(const Focus& .Ơ..).\n"  ush;(c}'out> S"min_x_proj == "Zhminffxffpr}'oj5_~endl ush;(c}'out> S"max_x_proj == "Zhmaxffxffpr}'oj6o#endl ush;(c}'out> S"min_y_proj == "Zhminffyffpr}'oj5endl ush;(c}'out> S"max_y_proj == "Zhmaxffyffpr}'oj6endl ush;g=CheckUUwhetherthev9ector&Tshap}'esFЫhasanythinginit.qIfitdoGesn't,return.o=if)(shap}'es:size\()0 ^8lab}'elsб:size()0)f(if3(DEBUGY)c}'out O"Picture is empty. Rketurning.\n"8 ush;(returnHi;gnn썫152F9OCUSXARÎGUMENTXE3DLDFPRGx549n@P549. [LDFT2002.09.17.]ZF1SomePShapQes)mayPconsistofotherShapQes&, andnothaveanoutput "()functionof theirMown,O3sowemustextracttheircontentsrecursivelyuntilwegettoShapQes*thathaveone.o9Sofar,O3onlyP9ointH,UUP9ath湫,UUandSolid (haveUUoutput d()UUfunctions,andallotherShapQes*reducetoP9aths#JorSolids!\h. [LDFT2002.09.17.]Y5~extr}'actw()checksthatalloftheP9oints'(containedintheShapQe%=canbGepro8jectedwiththeF -oQcus"*thatisbGeingused.BPIfanyofthemcannotbe,jthenextr}'act!^()returnsanemptyv9ector%8&ofShapQes&<8.This )meansthatanyShapQe$_mustbGeentirelypro8jectable;"partialShapQes)willnotbGeoutput.Xcproblem,etoo.U9Ȅ`> 8BeginTLogJʄ`> +oQcus"*thatisbGeingused.BPIfanyofthemcannotbe,jthenextr}'act!^()returnsanemptyv9ector%8&ofShapQes&<8.This )meansthatanyShapQe$_mustbGeentirelypro8jectable;"partialShapQes)willnotbGeoutput.Xcproblem,etoo.9Ȅ`+U 8Log)j`+U [LDFT2003.01.05.]Y;MoGdi edUUtheTU>VExXGtextaboveUUtoaccountforthefactthatI'veaddedSolid,. [LDFT2003.01.05.]Z_BUGaFIX:MovedthecoGdethatcausestr}'ansform5 tobeappliedtotheelementsofshap}'es.Thiscisnowdoneb}'efore$thecextremes-arecset.ThewaycitwasbGeforedidn'tworkpropGerly*,gSbecauseextr}'acto()W -usedtheuntransformedvqaluestodecidewhetheraShapQe%!waspro8jectable.vInordertodothis,WwIhadUUtomakeapplyfftr}'ansformIu4()aShapQe%function.Ȅ` 8EndTLogA>`hDe neUUPicture,Ffunctions@219i+ +usedtheuntransformedvqaluestodecidewhetheraShapQe%!waspro8jectable.vInordertodothis,WwIhadUUtomakeapplyfftr}'ansformIu4()aShapQe%function.Ȅ`GhDe neUUPicture,Ffunctions@219i+ v9ector)IhShapQe"Ab'AciUUv; v9ector)IhShapQe"Ab'AciUUelements*;P; v9ector)IhShapQe"Ab'Aci::Biter}'ator)7iter:d5; @@ -2098,8 +2129,8 @@ for臫(iter=shap}'es:b}'egin();iter6=shap}'es:endಫ();++Giter")fif(dofftr}'ansform94)f( iter)=UOtr}'ansform>;gv׫=(iter)~extr}'act"p(f;pr}'ojk;factor);if(DEBUG9^8vm:size\()0)c}'err3|"WARNING! In Picturek::output():\n"2"extract() returned kan empty vector. "͔&2"Continuing.\n" X ush;for%舫(v9ectorHhShapQe"Ab'Aci::Biter}'ator)7i/C=v:b}'egin();i 9 6=v:endಫ();++Gi)felementsD:pushffb}'ack+XR(iq);g g -DEBUG'r=falsev\;n썫152F9OCUSXARÎGUMENTXE3DLDFPRGx550n@P550. SetUUtheextremesfortheShapQe%andhandletheerrorifitreturnsfalse.q(LDFUndated)c9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.09.18.]Y`hDe neUUPicture,Ffunctions@219i+ +DEBUG'r=falsev\;n썷x5503DLDFPRÎGXEF9OCUSXARGUMENT153n@P550. SetUUtheextremesfortheShapQe%andhandletheerrorifitreturnsfalse.q(LDFUndated)N99Ȅ`+U 8Log)j`+U +[LDFT2002.09.18.]Y0)fif(sortffvalue.2MIN_Zq)sort2ҫ(elements&:b}'egin();elements(:endಫ();Compareus4wminim9umus4zn;());else*.6if5.(sortffvalue.2MAX_Zq)sort2ҫ(elements&:b}'egin();elements(:endಫ();Compareus4wmaxim9umus4zpO());else*.6if5.(sortffvalue.2MEAN_Z"n)sort2ҫ(elements&:b}'egin();elements(:endಫ();Compareus4wmeanus4zYxv());if(DEBUGY)fif)(sortffvalue.2MIN_Zq)c}'out O" *** MIN_Z sort. **k*\n"M8;else4.7if?/(sortffvalue.2MAX_Zq)c}'out O" *** MAX_Z sort. **k*\n"M8;else4.7if?/(sortffvalue.2MEAN_Z"n)c}'out O" *** MEAN_Z sort. *k**\n"5;for/艫(iter=elements):b}'egin();iter6=elements:endಫ();++Giter")f(c}'out@y "Min z: ": ( iter):getffminimumffzC]ث()endl3*"Max z: "<( @@ -2142,7 +2173,7 @@ g=Ы[LDFT2002.04.25.]T'Addede(followingline.@This xesabug.IfIe$don'tresettr}'ansform2}toidentity*,(itUUwillbGeappliedagaineachtimeIoutputaPicture(b,whichisnotwhatIwant.o= tr}'ansform5B:r}'esetƷ(); if(DEBUGY)c}'out O"Exiting Picture::ouktput(const Focus& ..Ơ.).\n" ush; -gn썫154NOXF9OCUSARÎGUMENT3DLDFPRGx554n@P554. NoTF +gn썷x5543DLDFPRÎGNOXF9OCUSARGUMENT155n@P554. NoTF oQcusargumen9t.hDe neUUPicture,Ffunctions@219i+ v9oid#UPictureJf::outputD(const'unsignedPZshorto!pr}'oj;realZRfactor4^0;const unsignedRPshort2sortffvalue];const 3bQool:doffwarningsp=D;const 3real7Jminffxffpr}'ojf똱;const 3real7Jmaxffxffpr}'ojg=;const2realH3minffyffpr}'ojx;constJreal6xmaxffyffpr}'ojg;constJreal6xminffzffpr}'oje;constJreal6xmaxffzffpr}'ojfܞ) foutput1B(defaultfffo}'cus7;pr}'ojk;factor;sortffvalue-±;doffwarnings7j;minffxffpr}'oj1{;maxffxffpr}'oj2;minffyffpr}'oj1l;(maxffyffpr}'ojYm;minffzffpr}'oj0);maxffzffpr}'oj1Ϋ); @@ -2166,23 +2197,23 @@ oQcus#functions@558i g; ThisXco 8BeginTLogJʄ`> +fg SeeXalsosections560,562,565,567,569,571,573,576,577,578,579,580,581,583,and584.ThisXco`560. Constructor.hDeclareUUF +ransform7ҫ.Ȅ`G560. Constructor.hDeclareUUF oQcus#functions@558i+ F oQcus&M(const:real4p}'osffxLz;constreal6Op}'osffyN ܱ;constreal6Op}'osffzMDZ;constreal6OdirffxL[;constreal6OdirffyL ;constreal41dirffzJ~;constJreal6xdistG;constJreal6xangJ -6=0;c9harax)S$='z' w);An썫156CONSTRÎUCTORBz3DLDFPRGx561n@P561.hDe neUUF +6=0;c9harax)S$='z' w);ޠn썷x5613DLDFPRÎGBzCONSTRUCTOR157n@P561.hDe neUUF oQcus#functions@561i F oQcus'Q::F @@ -2190,7 +2221,7 @@ :qdistanc}'e(ī(dist m);angleP(ang);axis<ū(ax w)UUfbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Focus() (7k real arguments).\n"  ush;axis)=tolower#(axis<ȫ);if(axis6='x'FW^8axis<6='y'^8axis6='z' w)fc}'err7A "WARNING! In Focus()p \ (7 real arguments): \n"]2"axis argument has invalid value: " axis". Using 'z'\n"Tk ush;axis3='z' w;gp}'osition7DY:set x(p}'osffxՅ;p}'osffyeܱ;p}'osffzǫ);dir}'ection::set x(dirffxm;dirffy ;dirffz);#if 0tr}'ansform?C:r}'esetƷ();=[LDFT2002.12.10.]T7ThisUUdoGesn'tseemtobenecessary*.qIbelieveIaddeditwhiledebugging.o=#endifif(DEBUGY)ftr}'ansformID:show("transform before alhignment.");gtr}'ansform?C:alignffwithffaxis@x(p}'osition#DW;dir}'ection(;axisp);if(DEBUGY)ftr}'ansformID:show("transform after alihgnment.");c}'out4 R"Enter to ckontinue.\n\n"T5 ush;gT ransformK/unalignffup~=Ztr}'ansform.:inverse ();=XUsehthepGositivey-axisforthe\up"direction,(ifUUaxisY5'x'b̫orUU'z',UUandthepGositivex-axisifaxis'y' w.o=if(axis'z'FW_8axis<'x' w)up:set x(0;1;0);else+up7w:set x(1;0;0);if(anglek6=0)fif)(axis'z' w)upeַ=" tr}'ansformNN:r}'otateo>(0;0; qangle!2);else4.7if?/(axis'x' w)upeַ=" tr}'ansformNN:r}'otateo>(angleq);else4.7if?/(axis'y' w)upeַ=" tr}'ansformNN:r}'otateo>(0; qangle!2);else5f(c}'err@hP"ERROR! In Focus::Foncus():\n",P"This can't happen! n\< axis has invalid value: "ȐaxisQendlܷ"Rotating around z-alQxis.\n"[1<"Enter to try to continue.\n" ush;(up6eڷ=Etr}'ansformqR:r}'otateo>(0;0; qangle!2);gif)(DEBUGY)up:show("up after rotation"dF/);gup"eط=1unalignffupa2;up:applyfftr}'ansformF߫();tr}'ansform?C:shift}(0;0; qdistanc}'e-ë);p}'ersp+G:setffelement2׫(2;2;0);p}'ersp+G:setffelement2׫(2;3;1=distanc}'e$E);if(DEBUGY)c}'out O"Exiting Focus() (7 kreal arguments).\n"# ush; -g SeeXalsosections563,566,568,570,572,574,582,and585.ݽn썷x5613DLDFPRÎGBzCONSTRUCTOR157n@PThisXcouC&FuC&F(angleq);else4.7if?/(axis'y' w)upeַ=" tr}'ansformNN:r}'otateo>(0; qangle!2);else5f(c}'err@hP"ERROR! In Focus::Foncus():\n",P"This can't happen! n\< axis has invalid value: "ȐaxisQendlܷ"Rotating around z-alQxis.\n"[1<"Enter to try to continue.\n" ush;(up6eڷ=Etr}'ansformqR:r}'otateo>(0;0; qangle!2);ggup"eط=1unalignffupa2;up:applyfftr}'ansformF߫();tr}'ansform?C:shift}(0;0; qdistanc}'e-ë);p}'ersp+G:setffelement2׫(2;2;0);p}'ersp+G:setffelement2׫(2;3;1=distanc}'e$E); -g573. Sho9w.9Ȅ`> 8BeginTLogJʄ`> +g573. Sho9w.9Ȅ`+U 8Log)j`+U [LDFT2002.09.17.]Y;AddedUUthisfunction. -[LDFT2003.07.09.]Y;MadeUUtheargumentsconst*.Ȅ` 8EndTLogA>`hDeclareUUF +[LDFT2003.07.09.]Y;MadeUUtheargumentsconst*.Ȅ`GhDeclareUUF oQcus#functions@558i+ -v9oid"show9ث(const*string?OtextffstrbK="Focus:"-Mh;constJbQool9vshowfftr}'ansforms2=falsev\)UUconst*;Cn썫160SHOÎWHF3DLDFPRGx574n@P574.hDe neUUF +v9oid"show9ث(const*string?OtextffstrbK="Focus:"-Mh;constJbQool9vshowfftr}'ansforms2=falsev\)UUconst*;n썷x5743DLDFPRÎGHFSHOW161n@P574.hDe neUUF oQcus#functions@561i+ v9oid"F oQcus@)::show(const*string?Otextffstr`3;constJbQool9vshowfftr}'ansforms)UUconst fc}'out* Qtextffstr&Utendlګ;p}'osition7DY:show("position:":FG);dir}'ection::show("direction:"?D);up:show("up:"Y);c}'out* Q"distance == "Ondistanc}'e)-". ""axis == ":zaxisendl ush;c}'out* Q"angle == "?wangleNendl ush;if(showfftr}'ansformsKAtrue)ftr}'ansformID:show("transform:"?D);p}'ersp5H:show("persp:"*P);greturn4g; g575. Returning֕elemen9tsandinformation.[LDFT2002.09.18.]ZMAddedVlthissection.u ThefunctionsinthisEnsectionarenownecessary*,tsinceI'vemadeF -oQcus%(aclass ث(itwasformerlyastruct"),tandthedatamembGersUUpriv\rate&ӫ.576. GetTpQosition.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.09.18.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUF +oQcus%(aclass ث(itwasformerlyastruct"),tandthedatamembGersUUpriv\rate&ӫ.576. GetTpQosition.9Ȅ`+U 8Log)j`+U +[LDFT2002.09.18.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUF oQcus#functions@558i+ inline)IconstGP9ointf&nkgetffp}'osition㹫()UUconst freturn7p}'osition[+; -g577. GetTdirection.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.07.09.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUF +g577. GetTdirection.9Ȅ`+U 8Log)j`+U +[LDFT2003.07.09.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUF oQcus#functions@558i+ inline)IconstGP9ointf&nkgetffdir}'ectionS()UUconst freturn7dir}'ection^߭; @@ -2263,43 +2294,43 @@ oQcus#functions@558i+ inline)IconstGreal^h&f/7getffdistanc}'e()UUconst freturn7distanc}'e\,; -g579. GetTup.[LDFT2002.09.18.]Z6AddedUUthisfunction.Ơn썷x5793DLDFPRÎGA1GETXUP161n@PhDeclareUUF +g579. GetTup.[LDFT2002.09.18.]Z6AddedUUthisfunction.n썫162GETXUPA13DLDFPRÎGx579n@PhDeclareUUF oQcus#functions@558i+ inline)IconstGP9ointf&nkgetffup> ()UUconst freturn7upCz; -g580. GetTtransform.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.09.18.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUF +g580. GetTtransform.9Ȅ`+U 8Log)j`+U +[LDFT2002.09.18.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUF oQcus#functions@558i+ inline)IconstGT ransform}&Dgetfftr}'ansform+ث()UUconst freturn7tr}'ansformc; -g581. GetTtransformelemen9t.9Ȅ`> 8BeginTLogJʄ`> +g581. GetTtransformelemen9t.9Ȅ`+U 8Log)j`+U [LDFT2002.09.18.]Y;AddedUUthisfunction. [LDFT2003.07.04.]Y;MadeUUnon-inline.qItnowcallsT ransform8֫::getffelement4#()insteadofaccessingtr}'ansform+A:matrix!directly*.qThisUUisnolongerpGossible,becauseF oQcus#isnolongerafriend$ofT ransform7ҫ. -[LDFT2003.07.09.]Y;ChangedUUtheconst!unsignedQin9tc[argumentstoconst!unsignedQshortl,S.Ȅ` 8EndTLogA>`hDeclareUUF +[LDFT2003.07.09.]Y;ChangedUUtheconst!unsignedQin9tc[argumentstoconst!unsignedQshortl,S.Ȅ`GhDeclareUUF oQcus#functions@558i+ real /getfftr}'ansformffelement(const*unsignedNashortl,Sr}'ow}8;constJunsignedP Xshortmc}'olumn -B)UUconst*;͠n썫162GETXTRANSFÎORMELEMENT 3DLDFPRGx582n@P582.hDe neUUF +B)UUconst*; n썷x5823DLDFPRÎG GETXTRANSFORMELEMENT163n@P582.hDe neUUF oQcus#functions@561i+ real lF oQcus>a::getfftr}'ansformffelementb=ɫ(constunsignedMԞshortkXr}'ow|e#;constunsignedOFshortm`c}'olumn6)const freturn7tr}'ansformc:getffelement3#(r}'ow k;c}'olumn!); -g583. GetTpQersp.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.09.18.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUF +g583. GetTpQersp.9Ȅ`+U 8Log)j`+U +[LDFT2002.09.18.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUF oQcus#functions@558i+ inline)IconstGT ransform}&Dgetffp}'ersp:ܫ()UUconst freturn7p}'erspO; -g584. GetTpQerspelemen9t.U9Ȅ`> 8BeginTLogJʄ`> +g584. GetTpQerspelemen9t.9Ȅ`+U 8Log)j`+U [LDFT2002.09.18.]Y;AddedUUthisfunction. [LDFT2003.07.04.]Y;MadeUUnon-inline.qItnowcallsT ransform8֫::getffelement4#()insteadofaccessingtr}'ansform+A:matrix!directly*.qThisUUisnolongerpGossible,becauseF oQcus#isnolongerafriend$ofT ransform7ҫ. -[LDFT2003.07.09.]Y;ChangedUUtheconst!unsignedQin9tc[argumentstoconst!unsignedQshortl,S.Ȅ` 8EndTLogA>`hDeclareUUF +[LDFT2003.07.09.]Y;ChangedUUtheconst!unsignedQin9tc[argumentstoconst!unsignedQshortl,S.Ȅ`GhDeclareUUF oQcus#functions@558i+ real /getffp}'erspffelementn"ë(const*unsignedNashortl,Sr}'ow}8;constJunsignedP Xshortmc}'olumn B)UUconst*;585.hDe neUUF @@ -2314,7 +2345,7 @@ oQcus*Jdefaultfffo}'cusb((0;10 ; qƫ10qȱ;0;10;0;10);587.hDeclarationsUUfortheheader le@18i+ extern.F oQcusNhxdefaultfffo}'cusFv;588. PuttingTP9ointandF -oQcustogether.&Ƞn썷x5893DLDFPRÎGiPUTTINGXPOINTANDF9OCUSTOGETHER163n@P589. ThisUUiswhat'scompiled. +oQcustogether.%gn썫164PUTTINGXPOINTANDF9OCUSTOGETHERi3DLDFPRÎGx589n@P589. ThisUUiswhat'scompiled. hIncludeUU les@11i hV*ersionUUcontrolidenti er@10i hDe neUUclass5P9oint>264i @@ -2336,7 +2367,7 @@ hDe neUUF oQcus#functions@561i hDe neUULabQel" functions@470i -hDe neUUPicture,Ffunctions@219i2n썫164PUTTINGXPOINTANDF9OCUSTOGETHERi3DLDFPRÎGx590n@P590. ThisUUiswhat'swrittentopoints.h.hpoints.h5590i +hDe neUUPicture,Ffunctions@219i14n썷x5903DLDFPRÎGiPUTTINGXPOINTANDF9OCUSTOGETHER165n@P590. ThisUUiswhat'swrittentopoints.h.*hpoints.h5590i hDe neUUclass5P9oint>264i hDe neUUclass5F oQcus?j556i @@ -2344,15 +2375,17 @@ hDeclareUUnon-membGerfunctionsforP9oints'ݭ436i hTypGeUUde nitions@12i hDeclarationsUUfortheheader le@18i591. Line(lines.web).@`[LDFT2002.10.29.]mHLinesareUUnotShapQes&ʞ.qTheyareusedforpGerformingvectorQopGerations.pAQLine|isde nedbyaP9oint">BrepresentingapGositionvectorandaP9oint">BrepresentingadirectionUUvector. -[LDFT2003.06.03.]Y;TOUUDO:Addsettingfunctions.c9Ȅ`> 8BeginTLogJʄ`> +[LDFT2003.06.03.]Y;TOUUDO:Addsettingfunctions..9Ȅ`+U 8Log)j`+U [LDFT2002.04.08.]YAdded=thissection.+[LDFT2002.04.12.]WCreatedthis le.+Removed=thecoGdeforLinefromUUpoints.webandputithere. -[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions.Ȅ` 8EndTLogA>`hV*ersionUUcontrolidenti er@10i+592. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"#include'~"transfor.h"#include'~"shapes.h"#include'~"pictures.h"#include'~"points.h"593. LineTstructde nition. +[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions. +[LDFT2003.12.10.]YQPuttheversioncontrolidenti ersbackintomyreleaseversionsfor3DLDF1.1.4.MI'vealready"putsomeofthembackin,,nowI'mdoingtherestofthem.`However,,thereleaseversionsarenowintheirUUownRCSrepGository*.Ȅ`GhV*ersionUUcontrolidenti er@10i+ +static)HstringJn'r}'csffidg(="$Id: lines.web,v 1.k2 2003/12/10 15:40:4Ơ8 lfinsto1 Exp $".ի;592. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"#include'~"transfor.h"#include'~"shapes.h"#include'~"pictures.h"#include'~"points.h"593. LineTstructde nition. format3c(LinePNPointhDe neUUstruct$LLine?ӭ593i struct+LineEMзf public)=֫:P9oint#p}'ositionG3;P9oint2dir}'ectionY萫;hDeclareUULine-constructors@595ihDeclareUULine-functions@599i -g; ThisXco 8BeginTLogJʄ`> +g; *ThisXco`595. Defaultconstructor.This2constructortakestwooptionalP9oint"arguments.fJThedefaultfortheP9ointargumentsUUisoriginKv.hDeclareUULine-constructors@595i +It$toGokmeawhileto gureoutwhyIwashavingproblemswithLines.:bTheconstructorwasmakingtheoppGositeassumption,Ɏnamely*,thatitwassuppGosedtocalculatetheLinefromitsarguments,ratherUUthanjusttakingthemastheywere.qThiscausedaprobleminPlane!6::interse}'ctionfflineH().Ȅ`G595. Defaultconstructor.This2constructortakestwooptionalP9oint"arguments.fJThedefaultfortheP9ointargumentsUUisoriginKv.hDeclareUULine-constructors@595i Line X(const*P9oint=?&D]p}'osV7=origin9;constJP9oint>&FdirWNy=origin); SeeXalsosection597.ThisXco&FdirTa) :qp}'osition'(p}'os!«);dir}'ection+(dir \)UUfp}'osition7DY:applyfftr}'ansformF߫();dir}'ection::applyfftr}'ansformF߫(); @@ -2362,30 +2395,30 @@ Line!X::LineX(const*Line7z&?lBҫ) :qp}'osition'(l.::p}'osition#DW);dir}'ection+(l:dir}'ection&)UUfp}'osition7DY:applyfftr}'ansformF߫();dir}'ection::applyfftr}'ansformF߫(); g599. Assignmen9t.hDeclareUULine-functions@599i -v9oid"opQeratorN=V[(const*Line7z&?lBҫ); SeeXalsosections602,604,and608.ThisXco 8BeginTLogJʄ`> -[LDFT2003.06.06.]XBUG"!FIX:".ChangedthecalltoLinez(),,isothattheargumentfordir}'ection-=Mispt]ҒғthisinsteadUUofpt 9.Ȅ` 8EndTLogA>`hDe neUUP9oint"Dfunctions@285i+ +g SeeXalsosections605,606,607,609,and934.ThisXco 8BeginTLogJʄ`> -[LDFT2003.06.06.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUULine-functions@599i+ +g602. GetP9ath.[LDFT2003.06.06.]ZReturns[alinearPathIDconsistingoftwo[Points#t,]and[correspGondingtoUUtheLineث.qMustbGede nedinpaths.web,becauseP9ath<isanincompletetypehere.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.06.]Y;AddedUUthisfunction.Ȅ`GhDeclareUULine-functions@599i+ P9ath%getffp}'athI(v9oid)UUconst*;603. In9tersection.[LDFT2003.06.06.][MCommented-out.fThis5functiondoGesn'twork.fUsingadi erentversion,Cthat?# ndstheintersectionpGointsofthetracesofthelinesontwoorallofthema8joraxes.jaTO?DO:FixUUit! -LDF ;Undated.YDeclared Minpoints.web,butmustbGede nedhere,bGecauseLinesisanincompletetypeinpoints.web.r9Ȅ`> 8BeginTLogJʄ`> +LDF ;Undated.YDeclared Minpoints.web,butmustbGede nedhere,bGecauseLinesisanincompletetypeinpoints.web.9Ȅ`+U 8Log)j`+U [LDFT2002.04.12.]ZXMoved5thisfunctionde nitionherefrompoints.webbGecauseitrequirestheuseofLinesΎ,UUandLine-isanincompletetypGethere. [LDFT2002.04.15.]Z=Commented-out,zbGecause WI'mhavingproblemswithit. Commentedoldversioninpoints.webUUbackin.qIdon'tquiteunderstandthis,bGecauseitseemedtobeworking. -[LDFT2002.04.22.]XChangeda0returnvqaluetobQoolus4wpoin9t7v,tocorrespGondwiththeoldversion. fThisfacilitatestesting,Asince`O?n썷x6033DLDFPRÎG WINTERSECTION167n@PhDe neUUP9oint"Dfunctions@285i+ #if 1$=0= +[LDFT2002.04.22.]XChangeda0returnvqaluetobQoolus4wpoin9t7v,tocorrespGondwiththeoldversion. fThisfacilitatestesting,Asince۫&FRpp0W);const P9oint@6&Gpp1Y0ѱ;const P9oint2&9#qq0I;constJP9oint>&Fqq1V) f=ST*ARTUUHERE.DEBUGGING.[LDFT2003.06.24.]P=bQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Point::intkersection_point()\n"M;Line-lffp<=pp0H:getffline!O(pp130); Line-lffq<+=qq0:getffline!O(qq1-~);if(DEBUGY)fpp0/33:show("pp0"Y);pp1/33:show("pp1"Y);qq0.-:show("qq0"Y);qq1.-:show("qq1"Y);lffp*}0:show("l_p"Y);lffq*;<:show("l_q"Y);gbQoolus4wrealus4pQoin9tdFbrpv=lffpDE:getffdistanc}'e4y(lffq ;9);if(DEBUGY)fc}'out4 R"brp.b == "?wbrp:b·endl ush;c}'out4 R"brp.r == "?wbrp:r,endl ush;brp-:pt 䝱:show("brp.pt"*P);gif(brp:r,6=0 _8brpJα:b·false<_8brp:pt INVALID_POINTGY)return(INVALID_BOOL_POINT;bQoolus4wpoin9tLbpW;bp{:pt =brp:pt 䝫;bQoolus4wrealE@brffpZǜ=brp:pt 䝱:isffonffse}'gment=5O(pp030;pp1ث);bQoolus4wrealE@brffqZ=brp:pt 䝱:isffonffse}'gment=5O(qq0-~;qq1&);if(DEBUGY)fc}'out4 R"br_p.first == "Zhbrffp: rst|·endl ush;c}'out4 R"br_p.second == "_Tebrffp:se}'cond n߷endl ush;c}'out4 R"br_q.first == "ZhbrffqE%: rst|·endl ush;c}'out4 R"br_q.second == "_TebrffqE%:se}'cond n߷endl ush;gbp{:b«=(brffp: rst^8brffq: rst);if(DEBUGY)c}'out O"Exiting Point::intekrsection_point()\n" ;return7bpB5; g#endif604. GetOdistance.[LDFT2002.04.22.]ZuRenamedSthisgetffdistanc}'e7M()frominterse}'ctionffpointPj().q1TheoldversionofP9oint!::interse}'ctionffpointNګ(),HwhichI^amcurrentlyusingagain,Hsincethenewversionwasn'tworking,returnsFabQoolus4wpoin9t8ጫ,whichissensible.IfI7startusingthecommented-outversionabGoveagain,I;should;haveitreturnabQoolus4wpoin9t;toGo,@insteadofabQoolus4wrealus4pQoin9tP-@.iJThiswillmakeiteasiertoswitchbackUUtotheoldversion,ifIhaveproblemsagain. -[LDFT2003.06.11.]X"ST*ART!/HERE.! 8BeginTLogJʄ`> -[LDFT2002.04.10.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUULine-functions@599i+ +[LDFT2003.06.11.]X"ST*ART!/HERE.!::getffdistanc}'e5y(const*Line7z&?lBҫ)UUconst*fUUbQoolDEBUG:,=falsev\;=trueĒ=if)(DEBUGY)c}'out O"Entering Line::get_kdistance()\n";bQoolus4wrealus4pQoin9tnFbrp}X;P9oint);if)(normalffunit8origin9)f(if3(DEBUGY)c}'out O"Lines are parallel.k\n"~S ush;(brp7:b«=falsev\;=NoUUintersection.o=(brp7:pt =INVALID_POINTGY;(P9ointFtempffptiS(l.::p}'osition#DW);(tempffptMη=_"p}'osition)y;(tempffptMΫ=tempffpt%ʱ:cr}'ossffproduct:(dir}'ection&);(brp7:r,=tempffpt%ʱ:magnitude.=r()=dir}'ection&:magnitude();=[LDFT2002.10.29.]T7Distance.o=(if3(DEBUGY)f2c}'outH T"distance == "Onbrp:r,endl ush;(g(if3(DEBUGY)c}'out O"Exiting Line::get_dkistance()\n"M ;(returnKbrpZ;gelse4.7fif)(DEBUGY)c}'out O"Lines are not paralklel.\n"G ush;brp-:r,=fabs((l.::p}'osition%}78p}'osition):dotffpr}'oduct2!(normalffunit5Oɫ));if)(DEBUGY)c}'out O"distance == "Onbrp:r,endl ush;q<n썷x6063DLDFPRÎG pGETXDISTJANCE169n@P606. LinesUUhaveanintersection.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.08.27.]XCommented-outthedeclarationsofvffxZ,vffy,andvffz,sincetheyarenotused.QIhaven'tdeletedUUthem,incaseIneedthemsomeday*.Ȅ` 8EndTLogA>`hDe neUULine-functions@600i+ -if(brp:r,<P9ointad::%epsilonE^())fif(DEBUGY)c}'out O"Lines have an interksection.\n"; ush;brp#:r,=0;brp#:b«=true;real*0affx'=lR:dir}'ection&:getffxg();real*0wffy> =lR:dir}'ection&:getffyt();real*0wffz==lR:dir}'ection&:getffz();real*0uffx<=normal#б:getffxg();real*0uffy<Ƒ=normal#б:getffyt();real*0uffz::getffdistanc}'e5y(const*Line7z&?lBҫ)UUconst*fUUbQoolDEBUG:,=falsev\;=trueĒ=if)(DEBUGY)c}'out O"Entering Line::get_kdistance()\n";bQoolus4wrealus4pQoin9tnFbrp}X;P9oint);if)(normalffunit8origin9)f(if3(DEBUGY)c}'out O"Lines are parallel.k\n"~S ush;(brp7:b«=falsev\;=NoUUintersection.o=(brp7:pt =INVALID_POINTGY;(P9ointFtempffptiS(l.::p}'osition#DW);(tempffptMη=_"p}'osition)y;(tempffptMΫ=tempffpt%ʱ:cr}'ossffproduct:(dir}'ection&);(brp7:r,=tempffpt%ʱ:magnitude.=r()=dir}'ection&:magnitude();=[LDFT2002.10.29.]T7Distance.o=(if3(DEBUGY)f2c}'outH T"distance == "Onbrp:r,endl ush;(g(if3(DEBUGY)c}'out O"Exiting Line::get_dkistance()\n"M ;(returnKbrpZ;gelse4.7fif)(DEBUGY)c}'out O"Lines are not paralklel.\n"G ush;brp-:r,=fabs((l.::p}'osition%}78p}'osition):dotffpr}'oduct2!(normalffunit5Oɫ));if)(DEBUGY)c}'out O"distance == "Onbrp:r,endl ush;pn썫170GETXDISTJANCE p3DLDFPRÎGx606n@P606. LinesUUhaveanintersection.9Ȅ`+U 8Log)j`+U +[LDFT2003.08.27.]XCommented-outthedeclarationsofvffxZ,vffy,andvffz,sincetheyarenotused.QIhaven'tdeletedUUthem,incaseIneedthemsomeday*.Ȅ`GhDe neUULine-functions@600i+ +if(brp:r,<P9ointad::%epsilonE^())fif(DEBUGY)c}'out O"Lines have an interksection.\n"; ush;brp#:r,=0;brp#:b«=true;real*0affx'=lR:dir}'ection&:getffxg();real*0wffy> =lR:dir}'ection&:getffyt();real*0wffz==lR:dir}'ection&:getffz();real*0uffx<=normal#б:getffxg();real*0uffy<Ƒ=normal#б:getffyt();real*0uffz 8BeginTLogJʄ`> +hDeclarationsUUfortheheader le@18i615. Plane(planes.web). [LDFT2002.10.29.]ZPlanesѫareUUnotShapQes&ʞ.qTheyareusedforpGerformingvectorvopGerations.՚AvPlane#Αisde nedbyaP9oint"~representingapGointontheplane,~aP9oint"~representingtheUUnormaltotheplane,andthedistanceoftheplanefromtheorigin.9Ȅ`+U 8Log)j`+U [LDFT2002.04.12.]Y;CreatedUUthis le.qRemovedUUthecoGdeforPlane# frompoints.webandputithere. -[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions.Ȅ` 8EndTLogA>`hV*ersionUUcontrolidenti er@10i+616. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"#include'~"transfor.h"#include'~"shapes.h"#include'~"pictures.h"#include'~"points.h"#include'~"lines.h"617. PlaneTstructde nition. +[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions. +[LDFT2003.12.10.]YQPuttheversioncontrolidenti ersbackintomyreleaseversionsfor3DLDF1.1.4.MI'vealready"putsomeofthembackin,,nowI'mdoingtherestofthem.`However,,thereleaseversionsarenowintheirUUownRCSrepGository*.Ȅ`GhV*ersionUUcontrolidenti er@10i+ +static)HstringJn'r}'csffidg(="$Id: planes.web,v 1k.2 2003/12/10 16:18:Ơ26 lfinsto1 Exp $"3ҫ;616. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"#include'~"transfor.h"#include'~"shapes.h"#include'~"pictures.h"#include'~"points.h"#include'~"lines.h"617. PlaneTstructde nition. format3c(PlaneULinehDe neUUstruct$LPlaneF617i struct+PlaneKְf public)=֫:P9oint#normalDFU;P9oint2p}'ointJ+;real*0distanc}'eN-;hDeclareUUPlane# functions@619i -g; ThisXco 8BeginTLogJʄ`> -[LDFT2003.06.06.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUPlane# functions@619in썫172DEF8AÎULJTXCONSTRUCTORQ3DLDFPRGx619n@P -Plane&d(v9oid); SeeXalsosections621,623,625,628,630,633,635,640,642,643,and645.ThisXco 8BeginTLogJʄ`> -[LDFT2003.06.06.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUPlane# functions@619i+ -Plane&d(const*Plane>aZ&F(xpK0x);622.hDe neUUPlane# functions@620i+ -Plane'h::Planeg(const*Plane>aZ&F(xpK0x) -fthis,ѫ=p;return4g; -g623. P9ointTarguments.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.06.03.]Y_Changedthisfunction.xPBUGFIX:distanc}'e+isnowcalculated,¸insteadofbGeingpassedasUUanargument.qnormal(ԫisnowmadeaunitvector. -[LDFT2003.06.06.]YpCChanged,_so]thatifp}'ointFornormal'risequaltoINVALID_POINTH,theotheroneisalsosetUUtoINVALID_POINTH,anddistanc}'e*issettoINVALID_REALBۙ. -[LDFT2003.06.06.]Y Argumentsa%arenolongeroptional.8I'vemadethischange,dbGecauseI'veaddedadefaultconstructor. -[LDFT2003.06.06.]XAddedFconditionaltotestforcasethatp}'ointug"`hDeclareUUPlane# functions@619i+ -Plane&d(const*P9oint=?&D]pI];constJP9oint>&FnL);^n썷x6243DLDFPRÎGPOINTXARGUMENTS173n@P624.hDe neUUPlane# functions@620i+ +g; ThisXcoaZ&F(xpK0x);)n썫174COPYXCONSTRÎUCTORZ3DLDFPRGx622n@P622.hDe neUUPlane# functions@620i+ +Plane'h::Planeg(const*Plane>aZ&F(xpK0x) +fthis,ѫ=p;return4g; +g623. P9ointTarguments.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.03.]Y_Changedthisfunction.xPBUGFIX:distanc}'e+isnowcalculated,¸insteadofbGeingpassedasUUanargument.qnormal(ԫisnowmadeaunitvector. +[LDFT2003.06.06.]YpCChanged,_so]thatifp}'ointFornormal'risequaltoINVALID_POINTH,theotheroneisalsosetUUtoINVALID_POINTH,anddistanc}'e*issettoINVALID_REALBۙ. +[LDFT2003.06.06.]Y Argumentsa%arenolongeroptional.8I'vemadethischange,dbGecauseI'veaddedadefaultconstructor. +[LDFT2003.06.06.]XAddedFconditionaltotestforcasethatp}'ointug"&FnL);n썷x6243DLDFPRÎGPOINTXARGUMENTS175n@P624.hDe neUUPlane# functions@620i+ Plane'h::Planeg(const*P9oint=?&D]pI];constJP9oint>&FnL) :qnormal$(n);p}'oint.(p)UUfp}'oint+.:applyfftr}'ansformF߫();normal4V:applyfftr}'ansformF߫();if(p}'ointINVALID_POINTGY)fnormalAӫ=INVALID_POINTGY;distanc}'eE =INVALID_REALBM\;return>h;gelse*.6if5.(normal#зINVALID_POINTGY)fp}'oint7=INVALID_POINTGY;distanc}'eE =INVALID_REALBM\;return>h;gelse*.6if5.(normal#зorigin9)fc}'err3"WARNING! In Plane()k:\nnormal == origin.ۛ ""Plane is INVALID_PLkANE.\n\n"~72 ushG;p}'oint7=INVALID_POINTGY;distanc}'eE =INVALID_REALBM\;return>h;gnormal4V:unitffve}'ctor0u(trueĘ);distanc}'e; = 6p}'oint!±:dotffpr}'oduct2!(normal V);if(fabs2ҫ(distanc}'e$E) 8BeginTLogJʄ`> -[LDFT2003.06.06.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUPlane# functions@619i+ -const(*PlaneHa[&P(yopQerator{.=L(const*Plane>aZ&F(xpK0x);n썫174ASSIGNMENT(D3DLDFPRÎGx626n@P626.hDe neUUPlane# functions@620i+ +g625. Assignmen9t.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.06.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUPlane# functions@619i+ +const(*PlaneHa[&P(yopQerator{.=L(const*Plane>aZ&F(xpK0x);En썫176ASSIGNMENT(D3DLDFPRÎGx626n@P626.hDe neUUPlane# functions@620i+ const(*PlaneHa[&P(yPlanen ::topQerator.ӫ=(const*Plane>aZ&F(xpK0x) fif(thisη& 6p6)=MakeUUsureit'snotself-assignment.q[LDFT2003.06.06.]U$=returnA潷FthisWt;p}'oint-=p:p}'oint.;normal7ҫ=p:normal V;distanc}'e; =p:distanc}'e$E;return7漱p<; -g627. ComparingTPlanes.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.06.06.]Y;AddedUUthissection.Ȅ` 8EndTLogA>`628. Equalit9y -.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.06.06.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUPlane# functions@619i+ +g627. ComparingTPlanes.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.06.]Y;AddedUUthissection.Ȅ`G628. Equalit9y +.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.06.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUPlane# functions@619i+ bQool#gopQeratorO8V:(const*Plane>aZ&F(xpK0x)UUconst*;629.hDe neUUPlane# functions@620i+ bQool#gPlaneAΫ::H opQerators{n߫(const*Plane>aZ&F(xpK0x)UUconst freturn7漫((p}'ointp:p}'oint.)8^(normal#зp:normal V)^(distanc}'e' p:distanc}'e$E)); g630. Inequalit9y -.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.06.06.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUPlane# functions@619i+ -bQool#gopQeratorO86=V:(const*Plane>aZ&F(xpK0x)UUconst*;n썷x6313DLDFPRÎG+UINEQUALITY175n@P631.hDe neUUPlane# functions@620i+ +.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.06.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUPlane# functions@619i+ +bQool#gopQeratorO86=V:(const*Plane>aZ&F(xpK0x)UUconst*;@n썷x6313DLDFPRÎG+UINEQUALITY177n@P631.hDe neUUPlane# functions@620i+ bQool#gPlaneAΫ::H opQerators6={n(const*Plane>aZ&F(xpK0x)UUconst freturn7漷:(opQerator+3]ӫ(p)); g632. GetTdistance.633. P9oint6argument.[LDFT2003.06.03.][Thisfunctionreturnsarealus4wshort;%۱r?,Ւwherer R: rst>cisthe distance>oftheP9oint"FfromthePlane b.jUr 4i: rstisalways>pGositive.jUr:se}'cond ƫcan>takeonthefollowingvqalues:0 IfUUtheP9oint"DliesinthePlane 6.1 If,itliesonthesideofthePlane#;5pGointedatbythenormaltothePlane L,4consideredtobGethe\outside".-1 -If1itliesonthesideofthePlane"not pGointedatbythenormaltothePlane,ÞconsideredtobGethe\inside".U9Ȅ`> 8BeginTLogJʄ`> +If1itliesonthesideofthePlane"not pGointedatbythenormaltothePlane,ÞconsideredtobGethe\inside".9Ȅ`+U 8Log)j`+U [LDFT2003.06.03.]XChangedAthede nitionofthisfunction.kFTheoldde nitionwasincorrect.AlsochangedreturnUUtypGefromrealtorealus4wshort5i. -[LDFT2003.06.04.]X1{BUG~^FIX:~Inthecasethatrfffabs^<P9ointad::%epsilonE^(),nowrfffabsissetto0.*2Previously*,r>was,A_which*waswrong,A_bGecauserfffabs".FAlso,Inowsetrfffabs"`hDeclareUUPlane# functions@619i+ +[LDFT2003.06.04.]X1{BUG~^FIX:~Inthecasethatrfffabs^<P9ointad::%epsilonE^(),nowrfffabsissetto0.*2Previously*,r>was,A_which*waswrong,A_bGecauserfffabs".FAlso,Inowsetrfffabs" 8BeginTLogJʄ`> -[LDFT2003.06.03.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUPlane# functions@619i+ -realus4wshort?igetffdistanc}'esx(v9oid)UUconst*;Рn썫176NOXARÎGUMENTv3DLDFPRGx636n@P636.hDe neUUPlane# functions@620i+ +'ThisFversionofgetffdistanc}'e7P()returnsthedatamembGerdistanc}'eandJitssign,Li.e.,theJdistanceoforigin!tothePlane ,$,LandwhichsideofthePlane#vitlieson.n@I'mnotusingoriginTas3thedefaultforanoptionalP9oint!argument,۠bGecauseofproblemsthatmayarise,۠whenI implementuserffc}'oordinatesK vandUUviewffc}'oordinatesK.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.03.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUPlane# functions@619i+ +realus4wshort?igetffdistanc}'esx(v9oid)UUconst*;Ӡn썫178NOXARÎGUMENTv3DLDFPRGx636n@P636.hDe neUUPlane# functions@620i+ realus4wshort?iPlane]K&::getffdistanc}'e5y(v9oid)UUconst freal*0f3s.=fabs(distanc}'e$E);signed7oshortU:s\=staticus4wcast7Dhsigned#oshort=Di(distanc}'e$E=f);return7realus4wshorti%(f;sZ); -g637. P9ointlisonPlane.[LDFT2003.06.04.]ZThislfunctionreturnstrue1|,riftheP9oint"tliesonthePlanep,YotherwiseXfalse.{DeclaredXinpoints.web.MustbGede nedhere,YbecausePlane#ɫisanincompletetypeinthatUU le.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.06.04.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDe neUUP9oint"Dfunctions@285i+ +g637. P9ointlisonPlane.[LDFT2003.06.04.]ZThislfunctionreturnstrue1|,riftheP9oint"tliesonthePlanep,YotherwiseXfalse.{DeclaredXinpoints.web.MustbGede nedhere,YbecausePlane#ɫisanincompletetypeinthatUU le.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.04.]Y;AddedUUthisfunction.Ȅ`GhDe neUUP9oint"Dfunctions@285i+ bQool#gP9oint@;::isffonffplane2ޫ(const*Plane>aZ&F(xpK0x)UUconst fif(p:getffdistanc}'e4y(this뷫):se}'cond n߷0)return(true;R;else+returnOfalsedn߫; -g638. In9tersection.639. In9tersectionTwithaline.640. P9ointTarguments.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.06.03.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUPlane# functions@619i+ -bQoolus4wpoin9tBinterse}'ctionffpoint>r(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rū)UUconst*;8n썷x6413DLDFPRÎGPOINTXARGUMENTS177n@P641.hDe neUUPlane# functions@620i+ +g638. In9tersection.639. In9tersectionTwithaline.640. P9ointTarguments.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.03.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUPlane# functions@619i+ +bQoolus4wpoin9tBinterse}'ctionffpoint>r(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rū)UUconst*;n썷x6413DLDFPRÎGPOINTXARGUMENTS179n@P641.hDe neUUPlane# functions@620i+ bQoolus4wpoin9tBPlane`::interse}'ctionffpointNګ(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rū)UUconst fbQoolus4wpoin9tLbpW;real*0denominatorf#=(p0O8p1):dotffpr}'oduct2!(normal V);if9(denominator; ,0 -)=(nt&,):"g海2"denominator is 0. Can't divide. ","Path is either in Pk`lane, or parallel to$\2 Plane."a 8BeginTLogJʄ`> -[LDFT2003.06.03.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUPlane# functions@619i+ -bQoolus4wpoin9tBinterse}'ctionffpoint>r(const*P9ath:[&AypFy)UUconst*;643. In9tersectionToftwoPlanes. [LDFT2002.10.29.]Z6TOUUDO:LoGokupandexplain!c9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.06.04.]Y;ChangedUUtoconst*.Ȅ` 8EndTLogA>`hDeclareUUPlane# functions@619i+ -Line#interse}'ctionfflinek1(const*Plane>aZ&F(xplO^)UUconst*;}n썫178INTERSECTIONXOFTWÎOPLANES^3DLDFPRGx644n@P644.hDe neUUPlane# functions@620i+ +g642. P9athzargument.[LDFT2003.06.03.]Z8De nedinpaths.web,bGecauseP9athhisanincompletetypeinthisUU le.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.03.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUPlane# functions@619i+ +bQoolus4wpoin9tBinterse}'ctionffpoint>r(const*P9ath:[&AypFy)UUconst*;643. In9tersectionToftwoPlanes. [LDFT2002.10.29.]Z6TOUUDO:LoGokupandexplain!N99Ȅ`+U 8Log)j`+U +[LDFT2003.06.04.]Y;ChangedUUtoconst*.Ȅ`GhDeclareUUPlane# functions@619i+ +Line#interse}'ctionfflinek1(const*Plane>aZ&F(xplO^)UUconst*;Ԡn썫180INTERSECTIONXOFTWÎOPLANES^3DLDFPRGx644n@P644.hDe neUUPlane# functions@620i+ Line#PlaneA@::interse}'ctionfflineH(const*Plane>aZ&F(xplO^)UUconst fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Plane::intkersection_line()\n" ;P9oint2plffnormal^(pl 6 :normal V);P9oint2dir}'ectionffvectorz1=normal#б:cr}'ossffproduct:(plffnormal+s);=[LDFT2002.10.29.]T7Needed??o=if(DEBUGY)dir}'ectionffvectorIz:show("direction_vector"_2);if(dir}'ectionffvectorGorigin9)fc}'err3|"In Plane::intersectkion_line().\n"2"Planes are parallelk\n"| ;;if)(distanc}'e' pl #:distanc}'e$E)f2=fEllipse'C::interse}'ctionffpointsR(Ellipse%L&-)ccallsthisfunctionto ndoutwhethertwocPlanes<arecoincident,%sosometimeswedon'twanttoseethesemessages."Imaydecidetoaddan<argumentUUbQoolsilent9$toUUthisfunction.q??AddUUbQoolsilent5ϫ??o=(c}'err=ܷ2"Planes are coincideknt.\n"~2"Returning Line withk origin as position ޺\n"K<"and INVALID_POINT as direction.\n\n" ush;(returnKINVALID_LINEm;gelse5f(c}'err=|·"Planes are not coinkcident.\n">"Returning INVALID_LkINE.\n\n"TA ush;(returnKINVALID_LINEm;gg=OuterUUif .o=if(DEBUGY)c}'out O"Planes are not parakllel\n"G ush;(= uAtbleastoneofthex,f+y*,orbzcompGonentsofdir}'ectionffvectorKmustbGenon-zero,f+otherwise,this2functionUUwouldhaveexitedbynow.o=real*0x0jL;y B;z @@ -2494,123 +2529,125 @@ 618((dmRmxe nx2ӫ)=vy );gelse+fx&~7= 618((dmRmyߚe ny)=vz -mܫ);Ƞn썷x6443DLDFPRÎG^INTERSECTIONXOFTWOPLANES179n@Py& +mܫ);ɠn썷x6443DLDFPRÎG^INTERSECTIONXOFTWOPLANES181n@Py& =(dmR8mx8e 8nx2ӫ)=vz mܫ; z%9=0;gP9oint2p}'ointffonfflinek۳(x;y;zƫ);if(DEBUGY)f p}'ointffonfflineV:show("point_on_line:"T8);dir}'ectionffvectorb}:show("direction_vector:"dF/);getchar?%();gif(DEBUGY)fc}'out4 R"Exiting Plane::intekrsection_line()\n";getchar?%();greturn7LineN??(p}'ointffonffline8;dir}'ectionffvectorF"); -g645. Sho9w.9Ȅ`> 8BeginTLogJʄ`> +g645. Sho9w.9Ȅ`+U 8Log)j`+U [LDFT2003.06.06.]Y;MinorUUchangetotheconditionalthathandlestext!. -[LDFT2003.06.06.]Y;MadeUUshowT()UUconst*.Ȅ` 8EndTLogA>`hDeclareUUPlane# functions@619i+ +[LDFT2003.06.06.]Y;MadeUUshowT()UUconst*.Ȅ`GhDeclareUUPlane# functions@619i+ v9oid"show9ث(string!%Mtext5D1="" z)UUconst*;646.hDe neUUPlane# functions@620i+ v9oid"Plane@@::show(string!%Mtext2})UUconst fif(text"" z)text="Plane:"-Mh;c}'out* Qtextendlګ;if(thisϷINVALID_PLANEGY)fc}'out4 R"INVALID_PLANE. Can'kt show."Dendlendl ush;return>h;gnormal4V:show("normal:"/M);p}'oint+.:show("point:"*P);c}'out* Q"distance == "Ondistanc}'e)-endlendl ush; g647. GlobalTconstan9tsforPlane.hPlane!`globalUUconstants@647i extern.constLHyPlanel1INVALID_PLANEEr(INVALID_POINTDA;INVALID_POINTFp); ThisXco 8BeginTLogJʄ`> -[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions.Ȅ` 8EndTLogA>` -format3c(PathQSShap}'ehV*ersionUUcontrolidenti er@10i+653. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"#include'~"transfor.h"#include'~"shapes.h"#include'~"pictures.h"#include'~"points.h"#include'~"lines.h"#include'~"planes.h"654. P9athTclassde nition.9Ȅ`> 8BeginTLogJʄ`> +hDeclarationsUUfortheheader le@18i652. P9ath(paths.web).N99Ȅ`+U 8Log)j`+U +[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions. +[LDFT2003.12.10.]YQPuttheversioncontrolidenti ersbackintomyreleaseversionsfor3DLDF1.1.4.MI'vealready"putsomeofthembackin,,nowI'mdoingtherestofthem.`However,,thereleaseversionsarenowintheirUUownRCSrepGository*.Ȅ`G +format3c(PathQSShap}'ehV*ersionUUcontrolidenti er@10i+ +static)HstringJn'r}'csffidg(="$Id: paths.web,v 1.k3 2003/12/10 16:10:5Ơ7 lfinsto1 Exp $".ի;653. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"#include'~"transfor.h"#include'~"shapes.h"#include'~"pictures.h"#include'~"points.h"#include'~"lines.h"#include'~"planes.h"654. P9athTclassde nition.9Ȅ`+U 8Log)j`+U [LDFT2002.09.18.]XAddedpr}'ojectiveffextremesW .W=Itcontainstheminimumandmaximumvqaluesforx,y*,andzUUoftheP9oints&.inp}'ointsy.qIt'susedinPicture)f::outputD()forsurfacehiding. -[LDFT2002.4.8.]SAddedstatic*2vqariablesforhelplinesandcurves: helpffc}'olor7,Phelpffdashffp}'atternTMë,doffhelpfflines89.TheVvqariablesforhelplines(orcurves)arepartofP9ath'sinterfaceandcanbGesetany-whereUUbyanyone.Ȅ` 8EndTLogA>`hDe neUUclass5P9ath;654i +[LDFT2002.4.8.]SAddedstatic*2vqariablesforhelplinesandcurves: helpffc}'olor7,Phelpffdashffp}'atternTMë,doffhelpfflines89.TheVvqariablesforhelplines(orcurves)arepartofP9ath'sinterfaceandcanbGesetany-whereUUbyanyone.Ȅ`GhDe neUUclass5P9ath;654i class$RP9ath@ :qprotected86ShapQeZxf -protected:o:bQoolflineffswitchND';bQool-hcycleffswitchb;bQool-honfffr}'eeffstoreeFZ;bQool-hdoffoutputX;=LDFUU2002.09.18.qAdded.o=signed7oshortU: llffdr}'awffvalue欫;=V*ariablesUUfordrawingand lling.o=const2*ColorQϗVϘdr}'awffcolorѫ;const2*ColorQϗVϘ llffc}'olor|g;string5%Odashe}'dSO;string5%Op}'enE?;bQool-harr}'owH;=LDFUU2003.01.15.qAdded.Neededfordr}'awarrow2H().o=v\ralarra9y=ZChreal]ٷiUUpr}'ojectiveffextremesWY;=LDFUU2002.09.18.qAdded.o=v9ector3JhP9oint#iUUp}'ointsy;v9ector3JhstringiUUc}'onnectors2; n썫182P -ATHXCLASSDEFINITION3DLDFPRÎGx654n@P -public)=֫:static$HconstBs{Colorbngohelpffc}'olor; static3HstringTn(helpffdashffp}'attern;static3HbQoolLAdoffhelpfflines#ث;hDeclareUUP9ath<functions@656i -g; ThisXco 8BeginTLogJʄ`> +bQool#gP9ath=2ϫ::doffhelpfflines<=true; ThisXcoNow XallofthedatamembGersofclassP9ath<;hareassignedtoexceptforonfffr}'eeffstore;J.ThisyhasbGecomenecessarybecauseofchangesinSolidT::outputD(),wheretemporaryP9aths&YhaveytobecreatedUUinordertosortthem. [LDFT2002.12.18.]XwMoved`here. 1WiththeDEC`ScompilerunderCompaqT*ru64ontheDECAlphacomputer,it&workedtohavethisfollowingtheconstructors.9bWiththeGNUC++Fcompiler(GCC)underGNU/LinuxontheInteli686computer,itdidn't:8ThecopyconstructorusedthedefaultassignmentopGeratorinsteadofthisfunction,presumablybGecausethisfunctionwasn'tknownatthetimethecopyconstructorwascompiled,althoughsithadb}'eensdeclaredpreviously}!f.URGENT:2MoveassignmentopGeratorsfortheotherclasses$#beforetheUUconstructors! -[LDFT2003.04.09.]Y;??qBUGUUFIX:Nowresizingpr}'ojectiveffextremesWY,ifaftersettingittop:pr}'ojectiveffextremesTQ,{pr}'ojectiveffextremesX̱:size\()0.JThis preventsaMemoryF*aulterroratrun-time.JIdon't:%knowwhyitshouldbGenecessary*,?though,since:%alloftheconstructorsofP9athanditsderivedclassesresizeUUpr}'ojectiveffextremesWY;UUatleast,Ithoughttheydid.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i +[LDFT2003.04.09.]Y;??qBUGUUFIX:Nowresizingpr}'ojectiveffextremesWY,ifaftersettingittop:pr}'ojectiveffextremesTQ,{pr}'ojectiveffextremesX̱:size\()0.JThis preventsaMemoryF*aulterroratrun-time.JIdon't:%knowwhyitshouldbGenecessary*,?though,since:%alloftheconstructorsofP9athanditsderivedclassesresizeUUpr}'ojectiveffextremesWY;UUatleast,Ithoughttheydid.Ȅ`GhDeclareUUP9ath<functions@656i virtual/P9athKt&S;opQerator~`=~(const*P9ath:[&AypFy); See?alsosections660,663,665,668,670,673,675,677,680,682,684,686,688,690,692,695,697,700,702,704,706,708,713, -719,721,723,725,728,730,733,735,738,740,742,747,749,751,754,756,758,762,767,769,775,777,784,786,793,795,801,803,806,808,812,814,820,823,825,829,831,834,836,839,841,845,846,848,850,852,854,856,866,868,871,X872,874,876,877,878,879,881,887,889,891,893,899,905,908,912,914,917,and929.ThisXco;dr}'awffcolorES=p:dr}'awffcolor.9;=R[LDFT2002.10.23.]Sdr}'awffcolorīand> llffc}'olor,pGoint>tothesameColor(asUUp]U:dr}'awffcolor2AandUUp: llffc}'olor%U.qNoUUmemoryalloGcationisperformed.o= llffc}'olor<_o=p: llffc}'olor%U;dashe}'d4=p:dashe}'d*;p}'en&ͫ=p:p}'en;pr}'ojectiveffextremesjk=p:pr}'ojectiveffextremesTQ;=LDFUU2002.09.18.qAddedthisline.o=if(pr}'ojectiveffextremesTQ:size\()0)=LDFUU2003.04.09.qAddedthisconditional.o=pr}'ojectiveffextremesrT:r}'esizei(6;0);for%舫(v9ectorHhP9oint#i::Bc}'onstffiteratorCpffiter_ߔ=p:p}'oints$:b}'egin();pffiter!\6=p:p}'oints:endಫ();pffiter~++*ܞ)p}'oints9$:pushffb}'ack+XR(P9ointL::#(cr}'eateffnewffp}'ointk(pffiter));for&Q((v9ectorHhstringi::Bc}'onstffiteratorCcffiter` =uxp}x:c}'onnectors/4.:b}'egin();hcffiter!6=uxp:c}'onnectors:endಫ();2cffiterK++WYͫ)fc}'onnectorsM41:pushffb}'ack+XR(cffiter);greturn7漷 8BeginTLogJʄ`> +722,724,726,729,731,734,736,739,741,743,748,750,752,755,757,759,763,764,765,766,768,770,771,776,778,785,787,794,796,802,804,807,809,813,815,821,824,826,830,832,835,837,840,842,843,844,847,849,851,853,855,857,858,859,860,861,862,863,867,869,873,875,880,882,883,884,885,886,889,891,893,897,898,899,900,903,X909,912,913,914,916,918,921,and933.ThisXco`659. DiscardTpQoin9tsandconnectors.ThisUUisusefulinthesettingfunctions.hDiscardUUp}'oints!?andUUc}'onnectors6ɇ659i +ͫ=Ao""Gѫ,p}'en 9=Ao"",andarr}'ow!@|=AofalsepinallconstructorsandFsettingfunctions.This xedaproblemI+washavingwithIcosahedron@:?OneoftheRegus4wP9olygonswasUUdrawnwithanarrow.Ȅ`G659. DiscardTpQoin9tsandconnectors.ThisUUisusefulinthesettingfunctions.hDiscardUUp}'oints!?andUUc}'onnectors6ɇ659i if(p}'oints$:size\()>0)ffor%舫(v9ectorHhP9oint#i::Biter}'ator)7iter=+M=p}'oints뭱:b}'egin();iter6=p}'oints:endಫ();++Giter")fdelete?ƽDƾiterU;gp}'oints/$:cle}'ar(٫(); g -if(c}'onnectors/4.:size\()>0)c}'onnectors44.:cle}'ar(٫(); Ƞn썫184DISCARDXPOINTSANDCONNECTORS +if(c}'onnectors/4.:size\()>0)c}'onnectors44.:cle}'ar(٫(); n썫186DISCARDXPOINTSANDCONNECTORS 3DLDFPRÎGx659n@PThisXco&Fp1Rū); 3Mn썷x6643DLDFPRÎGBzCONSTRUCTOR185n@P664.hDe neUUP9ath<functions@657i+ +P9ath"e(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rū); 3bn썷x6643DLDFPRÎGBzCONSTRUCTOR187n@P664.hDe neUUP9ath<functions@657i+ P9ath#i::P9athh(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rū) fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Path() (likne version).\n"/ ush;onfffr}'eeffstoreNl =falsev\;lineffswitchFi۫=true;cycleffswitchKǴ=falsev\;doffoutputAM=true;=LDFUU2002.09.18.qAddedthisline.o=pr}'ojectiveffextremeshS:r}'esizei(6;0);=LDFUU2002.09.18.qAddedthisline.o= llffdr}'awffvalueUs+=0;dr}'awffcolorES=0; llffc}'olor<_o=0;dashe}'d4="" z;=LDFUU2003.04.06.qAddedthesethreelines.o=p}'en&ͫ="" z;arr}'ow1'j=falsev\;p}'oints/$:pushffb}'ack+XR(P9ointL::#(cr}'eateffnewffp}'ointk(p0 ));p}'oints/$:pushffb}'ack+XR(P9ointL::#(cr}'eateffnewffp}'ointk(p1 ));c}'onnectorsC40:pushffb}'ack+XR("--"\);if(DEBUGY)c}'out O"Exiting Path() (linke version).\n"2 ush;return4g; g665. SettingTfunction.hDeclareUUP9ath<functions@656i+ -v9oid"set0v](const*P9oint=?&D]p0P;constJP9oint>&Fp1Rū); &Fp1Rū); 3DLDFPRÎGx666n@P666.hDe neUUP9ath<functions@657i+ v9oid"P9ath&Fp1Rū) flineffswitchFi۫=true;cycleffswitchKǴ=falsev\;doffoutputAM=true;=LDFUU2002.09.18.qAddedthisline.o= llffdr}'awffvalueUs+=0;dr}'awffcolorES=0; llffc}'olor<_o=0;dashe}'d4="" z;=LDFUU2003.04.06.qAddedthesethreelines.o=p}'en&ͫ="" z;arr}'ow1'j=falsev\;hDiscardUUp}'oints!?andUUc}'onnectors6ɇ659ipr}'ojectiveffextremesjk=0;=LDFUU2002.09.18.qAddedthisline.o=p}'oints/$:pushffb}'ack+XR(P9ointL::#(cr}'eateffnewffp}'ointk(p0 ));p}'oints/$:pushffb}'ack+XR(P9ointL::#(cr}'eateffnewffp}'ointk(p1 ));c}'onnectorsC40:pushffb}'ack+XR("--"\);lineffswitchFi۫=true; g667. P9oints|andonet9ypQeofconnector.This+ constructortakesavqariablenumbGerofP9oint%Zarguments,'butmonlyallowsonetypGeofconnector.Theargumentlistmustendwith0.Iftheorderofthe?]namedargumentsisreversed,ythecompilercan'tresolvecertaincallstoP9ath()./Itcouldn'tresolvebGetweenP9ath>(bQoolLcycle0 ;stringzc}'onnectorR/:::_)andP9ath (P9oint#( rstffp}'ointffptrj>:::|/g).tVIdon'tknowwhyUUitshouldhavehadtrouble,though,sincepGointerstoP9oints&.arenotbQools*. [LDFT2002.4.6.]O5Probablyitcouldn'tdistinguishbGetweenapointerandanin9tՒontheonehandandabQoolandUUanin9tLontheother.qIhopGethatbQools!aremoreecientlyimplementedthanasints,though! [LDFT2002.10.29.]Y.??I{don't{knowwhycweaveneedsinstructionstoputthinspacesafterthe\bQoolL"intheUUdeclarationandde nitionbGelow.qMaybeUUit'sbecauseofthe\::: ".668. Constructor.hDeclareUUP9ath<functions@656i+ -P9ath"e(string!%Mc}'onnectorL';bQoolLcycle8o:::E>); E5n썷x6693DLDFPRÎGBzCONSTRUCTOR187n@P669.hDe neUUP9ath<functions@657i+ +P9ath"e(string!%Mc}'onnectorL';bQoolLcycle8o:::E>); EJn썷x6693DLDFPRÎGBzCONSTRUCTOR189n@P669.hDe neUUP9ath<functions@657i+ P9ath#i::P9athh(string!%Mc}'onnectorL';bQoolLcycle8o:::E>) fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Path() (coknnector, cycle, ...)Ơ.\n" ush;onfffr}'eeffstoreNl =falsev\;lineffswitchFi۫=falsev\;cycleffswitchKǴ=cycle@M;c}'onnectorsC40:pushffb}'ack+XR(c}'onnector+^ګ);doffoutputAM=true;=LDFUU2002.09.18.qAddedthisline.o=pr}'ojectiveffextremeshS:r}'esizei(6;0);=LDFUU2002.09.18.qAddedthisline.o= llffdr}'awffvalueUs+=0;dr}'awffcolorES=0; llffc}'olor<_o=0;dashe}'d4="" z;=LDFUU2003.04.06.qAddedthesethreelines.o=p}'en&ͫ="" z;arr}'ow1'j=falsev\;v\raus4wlist7'apBO;=F*orUUthevqariablelengthargumentlist.o=vaffstart6i(ap ]R;cycle#ݫ);P9oint27ar}'gffptrWE;while2C.((ar}'gffptr"=vaffar}'g,(ap ]R;P9oint E%F))6=staticus4wcast7DhP9oint#i(0))p}'oints9$:pushffb}'ack+XR(P9ointL::#(cr}'eateffnewffp}'ointk(ar}'gffptrU}));vaffend2DΫ(ap ]R);if(DEBUGY)c}'out O"Exiting Path() (conknector, cycle, ...).Ơ\n" ush;return4g; g670. SettingTfunction.hDeclareUUP9ath<functions@656i+ -v9oid"set0v](string!%Mc}'onnectorL';bQoolLcycle8o:::E>); Q۠n썫188SETTINGXFUNCTION +v9oid"set0v](string!%Mc}'onnectorL';bQoolLcycle8o:::E>); Qn썫190SETTINGXFUNCTION u>3DLDFPRÎGx671n@P671.hDe neUUP9ath<functions@657i+ v9oid"P9ath) fonfffr}'eeffstoreNl =falsev\;lineffswitchFi۫=falsev\;cycleffswitchKǴ=cycle@M;doffoutputAM=true;=LDFUU2002.09.18.qAddedthisline.o=hDiscardUUp}'oints!?andUUc}'onnectors6ɇ659i llffdr}'awffvalueUs+=0;dr}'awffcolorES=0; llffc}'olor<_o=0;dashe}'d4="" z;=LDFUU2003.04.06.qAddedthesethreelines.o=p}'en&ͫ="" z;arr}'ow1'j=falsev\;pr}'ojectiveffextremesjk=0;=LDFUU2002.09.18.qAddedthisline.o=c}'onnectorsC40:pushffb}'ack+XR(c}'onnector+^ګ);v\raus4wlist7'apBO;=F*orUUthevqariablelengthargumentlist.o=vaffstart6i(ap ]R;cycle#ݫ);P9oint27ar}'gffptrWE;while2C.((ar}'gffptr"=vaffar}'g,(ap ]R;P9oint E%F))6=staticus4wcast7DhP9oint#i(0))p}'oints9$:pushffb}'ack+XR(P9ointL::#(cr}'eateffnewffp}'ointk(ar}'gffptrU}));vaffend2DΫ(ap ]R); g672. V -ariablen9umbQerofPointsandconnectors. TheseLfunctionstakesavqariablenumbGerofalternatingZP9oint"+WandZconnectorarguments,startingwithaP9oint"'.sTheargumentlistmustendwith0.^WW*edon'tneedanargumentforwhetherit'sacycleornot,&bGecauseifitis,itwillhaveaconnectorattheend.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.10.29.]Y;BUGUUFIX:Nolongerpushing rstffp}'ointffptrC`673. Constructor.hDeclareUUP9ath<functions@656i+ -P9ath%溫(UUP9oint"D'D rstffp}'ointffptreZ:::v+)UU; \Rn썷x6743DLDFPRÎGBzCONSTRUCTOR189n@P674.hDe neUUP9ath<functions@657i+ +ariablen9umbQerofPointsandconnectors. TheseLfunctionstakesavqariablenumbGerofalternatingZP9oint"+WandZconnectorarguments,startingwithaP9oint"'.sTheargumentlistmustendwith0.^WW*edon'tneedanargumentforwhetherit'sacycleornot,&bGecauseifitis,itwillhaveaconnectorattheend.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.29.]Y;BUGUUFIX:Nolongerpushing rstffp}'ointffptrCze=vaffar}'g,(ap ]R;c9har ))6=staticus4wcast7Dhc9harjIjJi(0))f2c}'onnectorsa43:pushffb}'ack+XR((c}'onnectorffstringJ=c}'onnectorffptr>ze));2if=((p}'ointffptr*j̫=vaffar}'g,(ap ]R;P9oint E%F))staticus4wcast7DhP9oint#i(0))f<cycleffswitchsǸ=true;<breakXj;2g2p}'ointsM$:pushffb}'ack+XR(P9ointL::#(cr}'eateffnewffp}'ointk(p}'ointffptr'));(g(vaffendFDЫ(ap ]R);(if3(DEBUGY)c}'out O"Exiting Path() (Poiknt* ...).\n"8 ush;g675. SettingTfunction.hDeclareUUP9ath<functions@656i+ -v9oid"set3˲(UUP9oint"D'D rstffp}'ointffptreZ:::v+)UU; hVn썫190SETTINGXFUNCTION +v9oid"set3˲(UUP9oint"D'D rstffp}'ointffptreZ:::v+)UU; hAn썫192SETTINGXFUNCTION u>3DLDFPRÎGx676n@P676.hDe neUUP9ath<functions@657i+ -v9oid"P9athze=vaffar}'g,(ap ]R;c9har ))6=(c9harjIjJ)UU0UV)f2c}'onnectorsa43:pushffb}'ack+XR((c}'onnectorffstringJ=c}'onnectorffptr>ze));2if=((p}'ointffptr*j̫=vaffar}'g,(ap ]R;P9oint E%F))staticus4wcast7DhP9oint#i(0))f<cycleffswitchsǸ=true;<breakXj;2g2p}'ointsM$:pushffb}'ack+XR(P9ointL::#(cr}'eateffnewffp}'ointk(p}'ointffptr'));(g(vaffendFDЫ(ap ]R);g677. Cop9yconstructor.[LDFT2003.04.06.][!??>>!!BUG:GotamemoryfaultwhenItriedtousethisfunction.Haven't[testedityet.Itworked[tousethedefaultconstructorandthentheassignmentopGerator.MaybGeUUit'snotkoshertouse\thisϫ=p"inacopyconstructor.U9Ȅ`> 8BeginTLogJʄ`> +v9oid"P9athze=vaffar}'g,(ap ]R;c9har ))6=(c9harjIjJ)UU0UV)f2c}'onnectorsa43:pushffb}'ack+XR((c}'onnectorffstringJ=c}'onnectorffptr>ze));2if=((p}'ointffptr*j̫=vaffar}'g,(ap ]R;P9oint E%F))staticus4wcast7DhP9oint#i(0))f<cycleffswitchsǸ=true;<breakXj;2g2p}'ointsM$:pushffb}'ack+XR(P9ointL::#(cr}'eateffnewffp}'ointk(p}'ointffptr'));(g(vaffendFDЫ(ap ]R);g677. Cop9yconstructor.[LDFT2003.04.06.][!??>>!!BUG:GotamemoryfaultwhenItriedtousethisfunction.Haven't[testedityet.Itworked[tousethedefaultconstructorandthentheassignmentopGerator.MaybGeUUit'snotkoshertouse\thisϫ=p"inacopyconstructor.9Ȅ`+U 8Log)j`+U [LDFT2002.10.15.]YPRewrotejthisfunction.TheoldversioncausedamemoryfaultwhenIJtriedtouseit.I'vetakencoGdefromthedefaultconstructorandtheassignmentopGeratorandputitherewithoutbotheringto֠seewhatwascausingtheproblem.GProbablytheoldversiondidn'taccountforchangesI'vemadeinotherplaces,UUpGerhapsintheclassde nition. -[LDFT2002.11.03.]Y;RewroteUUthisfunction.qNowjustusingtheassignmentopGerator.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -P9ath"e(const*P9ath:[&AypFy); un썷x6783DLDFPRÎGZCOPYXCONSTRUCTOR191n@P678.hDe neUUP9ath<functions@657i+ +[LDFT2002.11.03.]Y;RewroteUUthisfunction.qNowjustusingtheassignmentopGerator.Ȅ`GhDeclareUUP9ath<functions@656i+ +P9ath"e(const*P9ath:[&AypFy); un썷x6783DLDFPRÎGZCOPYXCONSTRUCTOR193n@P678.hDe neUUP9ath<functions@657i+ P9ath#i::P9athh(const*P9ath:[&AypFy) fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Path copy kconstructor.\n" ;this,ѫ=p;onfffr}'eeffstoreNl =falsev\;if(DEBUGY)c}'out O"Exiting Path() (copky constructor).\n"͔& ush;return4g; -g679. Pseudo-constructorTfordynamicalloQcation.680. OptionalTpQoin9terargument.U9Ȅ`> 8BeginTLogJʄ`> +g679. Pseudo-constructorTfordynamicalloQcation.680. OptionalTpQoin9terargument.9Ȅ`+U 8Log)j`+U [LDFT2002.10.29.]X~Addedargumentconst mmP9ath;@pE.DIfp -(6=0,thenewP9ath)isassignedtousingthevqaluesfromUUp]U.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +(6=0,thenewP9ath)isassignedtousingthevqaluesfromUUp]U.Ȅ`GhDeclareUUP9ath<functions@656i+ static)HP9athE/J/cr}'eateffnewffp}'athC3(const*P9ath:[?\pFt=0);681.hDe neUUP9ath<functions@657i+ P9ath%溷*P9athDx#::cr}'eateffnewffp}'athF(const*P9ath:[?\pD\) fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering create_newk_path().\n"; ush;P9ath/滷4漱a<=newϜ(P9athd);aI2~I3onfffr}'eeffstoreW==true;if(p6=0)f#a+L=p ;gelse+fa!I3~'I4 llffdr}'awffvalueh]=0;a!I3~'I4dr}'awffcolorX=0;a!I3~'I4 llffc}'olorO=0;gif(DEBUGY)c}'out O"Exiting create_new_kpath().\n"> ush;return7漱a=/; -g682. RequiredTP9athargument.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.10.29.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -static)HP9athE/J/cr}'eateffnewffp}'athC3(const*P9ath:[&AypFy); n썫192REQUIREDXP +g682. RequiredTP9athargument.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.29.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUP9ath<functions@656i+ +static)HP9athE/J/cr}'eateffnewffp}'athC3(const*P9ath:[&AypFy); n썫194REQUIREDXP ATHARÎGUMENT_3DLDFPRGx683n@P683.hDe neUUP9ath<functions@657i+ P9ath%溷*P9athDx#::cr}'eateffnewffp}'athF(const*P9ath:[&AypFy) fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering create_newk_path().\n"; ush;P9ath/滷4漱a<=newϜ(P9athd);aI2~I3onfffr}'eeffstoreW==true;a!K=p;if(DEBUGY)c}'out O"Exiting create_new_kpath().\n"> ush;return7漱a=/; -g684. Destructor.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.08.27.]ZMadeevirtual&n,bGecauseeGCCewiththe\-Wall"optionissuedthefollowingwarning:\`classUUPath'hasvirtualfunctionsbutnon-virtualdestructor".Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -virtual/Է7TP9athOV(); n썷x6853DLDFPRÎG&dDESTRUCTOR193n@P685. !!qMakeUUsuretodeleteanythingelsethatIalloGcatedynamically!hDe neUUP9ath<functions@657i+ +g684. Destructor.9Ȅ`+U 8Log)j`+U +[LDFT2003.08.27.]ZMadeevirtual&n,bGecauseeGCCewiththe\-Wall"optionissuedthefollowingwarning:\`classUUPath'hasvirtualfunctionsbutnon-virtualdestructor".Ȅ`GhDeclareUUP9ath<functions@656i+ +virtual/Է7TP9athOV(); ]n썷x6853DLDFPRÎG&dDESTRUCTOR195n@P685. !!qMakeUUsuretodeleteanythingelsethatIalloGcatedynamically!hDe neUUP9ath<functions@657i+ P9ath#i::*1P9athJx)() fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)fc}'out4 R"Entering ~Path().\nk"tTY ush;show4("Path:"%FS);getchar?%();gfor%舫(v9ectorHhP9oint#i::Biter}'ator)7iter=+M=p}'oints뭱:b}'egin();iter6=p}'oints:endಫ();iterJ++")fdelete?ƽDƾiterU;gp}'oints/$:cle}'ar(٫();=[LDFT2002.11.03.]T7ThisUUreplacesawhile!loGopinwhichp}'opffback)Ң()wasusedtoemptyp}'ointsy.o=c}'onnectorsC40:cle}'ar(٫();=LDFUU2002.11.03.qAdded.o==LDFUU2002.10.07.qAddedcoGdeforhandlingdr}'awffcolor5and llffc}'olor(.o=if(dr}'awffcolor1Q6=0 ^8dr}'awffcolor/%~5%isffonfffr}'eeffstorew()true)fif)(DEBUGY)c}'out O"Deleting draw_colork\n"| ;;delete?ƽdr}'awffcolorn;dr}'awffcolorOT=0;gelse*.6if5.(DEBUGY)fc}'out4 R"Not deleting draw_ckolor\n" /;gif( llffc}'olor(_m6=0 ^8 llffc}'olor%5~+6isffonfffr}'eeffstorenL ()true)fif)(DEBUGY)c}'out O"Deleting fill_colork\n"| ;;delete?ƽ llffc}'olore_; llffc}'olorF_p=0;gelse*.6if5.(DEBUGY)fc}'out4 R"Not deleting fill_ckolor\n" /;gif(DEBUGY)fc}'out4 R"Exiting ~Path().\n"o\ ush;getchar?%();g g686. Clear.LDFUndated.VCThisfunctionisneededbGecauseit'sapurevirtual(>functioninShapQe!֫,KandforUUgettingridofitemsinPicture)f::cle}'ar(ݫ(). -[LDFT2002.10.07.]YlDcle}'aro()^isneededbGecauseit'scalledontheShapQes*thatarestoredinPictures-ާ,`andIOmdon'tOknowofawayofoverloadingdestructors.`Thatis,CinPicture*뿫::cle}'ar(ݫ(),theactualtypGesoftheShapQes'ʾareUuunknown,}soIU3can'tcall P9ath$(), \Circle*ǫ(),orUuotherdestructorsdirectly*.r'ButanamedfunctionUUsuchascle}'ar~.()canservethesamepurpGose.c9Ȅ`> 8BeginTLogJʄ`> +[LDFT2002.10.07.]YlDcle}'aro()^isneededbGecauseit'scalledontheShapQes*thatarestoredinPictures-ާ,`andIOmdon'tOknowofawayofoverloadingdestructors.`Thatis,CinPicture*뿫::cle}'ar(ݫ(),theactualtypGesoftheShapQes'ʾareUuunknown,}soIU3can'tcall P9ath$(), \Circle*ǫ(),orUuotherdestructorsdirectly*.r'ButanamedfunctionUUsuchascle}'ar~.()canservethesamepurpGose.N99Ȅ`+U 8Log)j`+U [LDFT2002.10.07.]X Added#coGdefordeallocatingthememoryallocatedfordr}'awffcolor5 -and llffc}'olor(x,-ifany*.Ȅ` 8EndTLogA>` -??I1tried=calling M[P9ath#޿()insideP9athޫ:Әcle}'arq(),xbutIgotamemoryfault.Don'tknowwhy*.TO1DO:T*ryUUto ndout.qHowever,UUthisisn'turgent. n썫194CLEARDp3DLDFPRÎGx686n@PhDeclareUUP9ath<functions@656i+ +and llffc}'olor(x,-ifany*.Ȅ`G +??I1tried=calling M[P9ath#޿()insideP9athޫ:Әcle}'arq(),xbutIgotamemoryfault.Don'tknowwhy*.TO1DO:T*ryUUto ndout.qHowever,UUthisisn'turgent. Ϡn썫196CLEARDp3DLDFPRÎGx686n@PhDeclareUUP9ath<functions@656i+ virtual/v9oidHcle}'ar^();687.hDe neUUP9ath<functions@657i+ v9oid"P9ath 8BeginTLogJʄ`> +.9Ȅ`+U 8Log)j`+U [LDFT2002.11.03.]Y;MadeUUvirtual%ӫ.qChangedUUdynamicus4wcastF&()UUtostaticus4wcast7().qThismaynotwork. -[LDFT2003.01.29.]Y;ItUUseemstowork.qAtUUleast,Ihaven'tUUhadanyproblemswithit.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -virtual/ShapQeQ6V7getffc}'opy{()UUconst*; ۠n썷x6893DLDFPRÎG4qGETXCOPY195n@P689.hDe neUUP9ath<functions@657i+ +[LDFT2003.01.29.]Y;ItUUseemstowork.qAtUUleast,Ihaven'tUUhadanyproblemswithit.Ȅ`GhDeclareUUP9ath<functions@656i+ +virtual/ShapQeQ6V7getffc}'opy{()UUconst*; n썷x6893DLDFPRÎG4qGETXCOPY197n@P689.hDe neUUP9ath<functions@657i+ ShapQe,Ac1AdP9athJ̫::getffc}'opy%ø()UUconst fP9ath/滷4漱p<ԫ=cr}'eateffnewffp}'athGڷ(this붫);return7staticus4wcastld^hShapQe"Ab'Aci(p); g690. SetTonfreestore.hDeclareUUP9ath<functions@656i+ @@ -2626,7 +2663,7 @@ fdr}'awffcolorES=& 6c;return4g; g697. ColorTpQoin9terversion.hDeclareUUP9ath<functions@656i+ -virtual/v9oidHsetffdr}'awffcolor(ʫ(const*Color=ϕBϖcG#q); n썫196COLORXPOINTERVERSIONg3DLDFPRÎGx698n@P698.hDe neUUP9ath<functions@657i+ +virtual/v9oidHsetffdr}'awffcolor(ʫ(const*Color=ϕBϖcG#q); n썫198COLORXPOINTERVERSIONg3DLDFPRÎGx698n@P698.hDe neUUP9ath<functions@657i+ v9oid"P9ath(const*Color=ϕBϖcG#q) fif( llffc}'olor(_m6=0 ^8 llffc}'olor%5~+6isffonfffr}'eeffstorenL ()true)fdelete?ƽ llffc}'olore_;g llffc}'olor<_o=c;return4g; g704. SetTdashpattern.hDeclareUUP9ath<functions@656i+ -virtual/v9oidHsetffdashffp}'atterniB(const*string?OsF="" z); sn썷x7053DLDFPRÎG VPSETXDASHPJATTERN197n@P705.hDe neUUP9ath<functions@657i+ +virtual/v9oidHsetffdashffp}'atterniB(const*string?OsF="" z); [n썷x7053DLDFPRÎG VPSETXDASHPJATTERN199n@P705.hDe neUUP9ath<functions@657i+ v9oid"P9ath 8BeginTLogJʄ`> -[LDFT2003.02.08.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +g708. Set4connectors.[LDFT2003.02.08.]ZTODO:Overloadwithaversiontakingav9ector#1hstringiasitsUUargument.qarguments.9Ȅ`+U 8Log)j`+U +[LDFT2003.02.08.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUP9ath<functions@656i+ virtual/v9oidHsetffc}'onnectorsp(const*string?OsF=".."Mt);709.hDe neUUP9ath<functions@657i+ v9oid"P9ath=0;constJreal6xz>f=0); ?n썫198RÎOTJATIONXAROUNDTHEMAINAXES7v3DLDFPRGx714n@P714.hDe neUUP9ath<functions@657i+ +ransformgVr}'otate(const*real4бx:;constJreal6xy>=0;constJreal6xz>f=0); 'n썫200RÎOTJATIONXAROUNDTHEMAINAXES7v3DLDFPRGx714n@P714.hDe neUUP9ath<functions@657i+ T ransformAP9ath[Z;::r}'otateoB(const*real4бx:;constJreal6xy;p;constJreal6xz;) fT ransformKԱtOeF;tt:r}'otateo>(x;y;zƫ);return7漷 8BeginTLogJʄ`> +ransformv9ersion.Declared'intransfor.web. MustbGede nedhere,2becauseP9ath"फisan incompleteUUtypGethere.9Ȅ`+U 8Log)j`+U [LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments. -[LDFT2003.07.06.]Y;Changed,UUsothatisffline}'ar(jҫ()isused,insteadofgetfflineffswitchC+ҫ().Ȅ` 8EndTLogA>`hDe neUUT +[LDFT2003.07.06.]Y;Changed,UUsothatisffline}'ar(jҫ()isused,insteadofgetfflineffswitchC+ҫ().Ȅ`GhDe neUUT ransform;'functions@125i+ T ransformAT ransformw(p:getffp}'oint'bH(0);p:getfflastffp}'oint:$>();anglej);return7漫(thisϷ=(At+x); -g ϥn썷x7173DLDFPRÎGPPOINTXVERSION199n@P717. P9ointlversion.Declaredinpoints.web.\uMustbGede nedhere,!becauseP9ath ,isanincomplete typGeUUthere.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ` 8EndTLogA>`hDe neUUP9oint"Dfunctions@285i+ +g bn썷x7173DLDFPRÎGPPOINTXVERSION201n@P717. P9ointlversion.Declaredinpoints.web.\uMustbGede nedhere,!becauseP9ath ,isanincomplete typGeUUthere.9Ȅ`+U 8Log)j`+U +[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ`GhDe neUUP9oint"Dfunctions@285i+ T ransformAP9oint^c::r}'otateoB(const*P9ath:[&AypFy;constJreal6xangleNH˫) fif(:p:getfflineffswitch?}())fc}'err8(r"ERROR! In Point::roprtate(Path, real).\n"k2"Path is not a line. Returning INVALID_TRANSFORM.\n\n"SEȫ;returnAINVALID_TRANSFORM;gP9oint2pt0E=p:getffp}'oint'bH(0);P9oint2pt1E=p:getffp}'oint'bH(1);return7r}'otateRU(pt0i;;pt1;anglej); -g718. P9athTversions.719. P9ointTarguments.U9Ȅ`> 8BeginTLogJʄ`> +g718. P9athTversions.719. P9ointTarguments.9Ȅ`+U 8Log)j`+U [LDFT2002.4.7.]O?AddedUUdefaultvqalueforanglej180. -[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +[LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments.Ȅ`GhDeclareUUP9ath<functions@656i+ virtual/T ransformgVr}'otate(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rű;constJreal6xangleQ=180);720. TO]DO:]Changethis,_sothatIuseopQerator.d=;(T ransform4s})hereandintheothertransformationfunctions.hDe neUUP9ath<functions@657i+ @@ -2685,12 +2722,12 @@ ransformAP9ath[Z;::r}'otateoB(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rű;constJreal6xangleNH˫) fT ransformKԱtOeF;tt:r}'otateo>(p0 ;p1 h;anglej);return7漫(thisϷ=(At+x); -g Ln썫200P -ATHXARÎGUMENTS3DLDFPRGx721n@P721. P9athTarguments.U9Ȅ`> 8BeginTLogJʄ`> +g ޠn썫202P +ATHXARÎGUMENTS3DLDFPRGx721n@P721. P9athTarguments.9Ȅ`+U 8Log)j`+U [LDFT2002.4.7.]O?AddedUUdefaultvqalueforanglej180. [LDFT2002.11.03.]Y;GotUUridofloGcalP9oints&.p06:Candp1l. [LDFT2003.05.02.]YSChangedmnameofthisfunctionfromr}'otateffaround@()tor}'otate().ThisfunctionnowoverloadsUUr}'otateē()UUwiththreerealarguments. -[LDFT2003.07.13.]Y;Changed,UUsothatisffline}'ar(jҫ()isusedinsteadofcheckingUUthereturnvqalueofgetfflineffswitch?}().MyAlso,3getfflastffp}'oint="q()jpassedasthesecondargumenttor}'otateW(),3insteadofgetffp}'oint*J(1).Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +[LDFT2003.07.13.]Y;Changed,UUsothatisffline}'ar(jҫ()isusedinsteadofcheckingUUthereturnvqalueofgetfflineffswitch?}().MyAlso,3getfflastffp}'oint="q()jpassedasthesecondargumenttor}'otateW(),3insteadofgetffp}'oint*J(1).Ȅ`GhDeclareUUP9ath<functions@656i+ T ransformAr}'otate\8(const*P9ath:[&AypFy;constJreal6xangleQ=180);722.hDe neUUP9ath<functions@657i+ T @@ -2705,7 +2742,7 @@ ransformKԱtOeF;tt:sc}'ale(x;y;zƫ);return7漫(thisϷ=(At+x); g725. Shear.hDeclareUUP9ath<functions@656i+ T -ransformAshe}'arY (real.xy!;real]xz%=0;real]yx&Z=0;real]yz%6=0;real]zx%Y=0;real]zy%|=0); נn썷x7263DLDFPRÎGEF,SHEAR201n@P726.hDe neUUP9ath<functions@657i+ +ransformAshe}'arY (real.xy!;real]xz%=0;real]yx&Z=0;real]yz%6=0;real]zx%Y=0;real]zy%|=0); n썷x7263DLDFPRÎGEF,SHEAR203n@P726.hDe neUUP9ath<functions@657i+ T ransformAP9ath[Z;::she}'ar4>(real.xy!;real]xz"ը;real]yx#;real]yz# ;real]zx"A;real]zy") fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Path::sheakr().\n" /;T @@ -2727,15 +2764,15 @@ g732. ShiftTtimes. [LDFT2003.01.19.]Z}shiftfftimes()Ureturnsv9oid,bGecauseP9ath!ifit'scalledafter6ja"calltoshift@Z()andb}'efore8an"opGerationisappliedthatcausesP9oint)::applyfftr}'ansformG()tobGecalled.c9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.01.19.]Y;AddedUUthissection.Ȅ` 8EndTLogA>` 6n썫202REALXARÎGUMENTS3DLDFPRGx733n@P733. realTargumen9ts.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.01.19.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +[LDFT2003.01.19.]Y;Notethatshiftfftimes2u(()willonlyhaveane ectontheP9oints'5^onaP9ath>ifit'scalledafter6ja"calltoshift@Z()andb}'efore8an"opGerationisappliedthatcausesP9oint)::applyfftr}'ansformG()tobGecalled.N99Ȅ`+U 8Log)j`+U +[LDFT2003.01.19.]Y;AddedUUthissection.Ȅ`G Gn썫204REALXARÎGUMENTS3DLDFPRGx733n@P733. realTargumen9ts.9Ȅ`+U 8Log)j`+U +[LDFT2003.01.19.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUP9ath<functions@656i+ virtual/v9oidHshiftfftimesww(real.xjJ;real]ֱy g=1;real]ֱz < =1);734.hDe neUUP9ath<functions@657i+ v9oid"P9ath 8BeginTLogJʄ`> -[LDFT2003.01.19.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +g735. P9ointTargument.9Ȅ`+U 8Log)j`+U +[LDFT2003.01.19.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUP9ath<functions@656i+ virtual/v9oidHshiftfftimesww(const*P9oint=?&D]pI]);736.hDe neUUP9ath<functions@657i+ v9oid"P9ath 8BeginTLogJʄ`> -[LDFT2002.11.03.]Y;ChangedUUc9harargumentUUtoconst!c9har7.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +ransform thatOwouldtransformP9ath0suchthatitwouldcometolieonthema8joraxisindicatedbyitsargument(bydefault,UUthez-axis).qItdoGesnotactuallyperformthetransformationontheP9ath湫.N99Ȅ`+U 8Log)j`+U +[LDFT2002.11.03.]Y;ChangedUUc9harargumentUUtoconst!c9har7.Ȅ`GhDeclareUUP9ath<functions@656i+ T -ransformAalignffwithffaxis{K(const*c9har7axisL˫='z' w)UUconst*; -n썫204NOXASSIGNMENT3DLDFPRÎGx748n@P748.hDe neUUP9ath<functions@657i+ +ransformAalignffwithffaxis{K(const*c9har7axisL˫='z' w)UUconst*; +rn썫206NOXASSIGNMENT3DLDFPRÎGx748n@P748.hDe neUUP9ath<functions@657i+ T ransformAP9ath[Z;::alignffwithffaxisA|(const*c9har7axisIѳ)UUconst fT ransformKԱtOeF;if(:getfflineffswitch?}())fc}'err8m"ERROR! In Path::alipgn_with_axis().\n"u2"Path is not a line. Returning INVALID_TRANSFORM.\n\n"SEȫ;returnAINVALID_TRANSFORM;gP9oint2p0?_(p}'oints $[0]);P9oint2p1?_(p}'oints $[1]);return7漱t;.:alignffwithffaxis@x(p0 ;p1 h;axisp); -g749. WithDassignmen9t.[LDFT2002.11.03.]YIThisdhfunctionshouldneverbGecalledwiththebQoolargumentassign4falsev\.qItUUwon'tcauseanyharm,though,sinceitwilljustcalltheconst!versionabGove.U9Ȅ`> 8BeginTLogJʄ`> +g749. WithDassignmen9t.[LDFT2002.11.03.]YIThisdhfunctionshouldneverbGecalledwiththebQoolargumentassign4falsev\.qItUUwon'tcauseanyharm,though,sinceitwilljustcalltheconst!versionabGove.9Ȅ`+U 8Log)j`+U [LDFT2002.11.03.]Y;AddedUUthisfunction. [LDFT2003.07.18.]Y`^Changed,Ásoxthatisffline}'ar(()isused,ratherthangetfflineffswitchC().z1Also,changedthewayRT -ransform;!tC)isRset.Thelatterchangewasnecessary*,bGecauseGCC:3.3couldn'tcompilethis lethewayUUitwasbGefore.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +ransform;!tC)isRset.Thelatterchangewasnecessary*,bGecauseGCC:3.3couldn'tcompilethis lethewayUUitwasbGefore.Ȅ`GhDeclareUUP9ath<functions@656i+ T ransformAalignffwithffaxis{K(bQoolfassign5|;constJc9har9?axisNCs='z' w);750.hDe neUUP9ath<functions@657i+ T ransformAP9ath[Z;::alignffwithffaxisA|(bQoolfassign5|;constJc9har9?axisK|[) fif(:isffline}'ar%}())fc}'err8m"ERROR! In Path::alipgn_with_axis().\n"u2"Path is not linear. Returning INVALID_TRANSFORM.\n\n"SEȫ;returnAINVALID_TRANSFORM;gT ransformKԱtOeF;tt:alignffwithffaxis@x(getffp}'oint'bH(0);getfflastffp}'oint;();axisp);if(assign4falsev\)fc}'err8(r"WARNING! In Path::aprlign_with_axis():\n"k2"Don't call this function with the \"assign\" "0]2"argument == false.\nIt won't cause any harm, though.\n"[{"Continuing.\n\n"_2 ushG;returnA潱tE/;greturn7漫(thisϷ=(At+x); -g -Mn썷x7513DLDFPRÎGWFORXNON-LINES205n@P751. F -orSnon-lines.(P9oint_andaxisarguments).<[LDFT2002.11.03.]U)Thisfunction ndsthetransfor- mation(thatwouldalignthelinesegmentȍ ܍g!N8p0|sp1ZЫwiththema8joraxisindicatedbytheaxisargument,]andappliesUUittoUVthisA .qp0ܫandp1jarenotchanged.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.11.03.]Y;ChangedUUP9oint"DargumentsUUtoconst!P9oint@o&Kandc9harargumenttoconst!c9har7.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +g +n썷x7513DLDFPRÎGWFORXNON-LINES207n@P751. F +orSnon-lines.(P9oint_andaxisarguments).<[LDFT2002.11.03.]U)Thisfunction ndsthetransfor- mation(thatwouldalignthelinesegmentȍ ܍g!N8p0|sp1ZЫwiththema8joraxisindicatedbytheaxisargument,]andappliesUUittoUVthisA .qp0ܫandp1jarenotchanged.9Ȅ`+U 8Log)j`+U +[LDFT2002.11.03.]Y;ChangedUUP9oint"DargumentsUUtoconst!P9oint@o&Kandc9harargumenttoconst!c9har7.Ȅ`GhDeclareUUP9ath<functions@656i+ T ransformAalignffwithffaxis{K(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rű;constJc9har9?axisK|[);752.hDe neUUP9ath<functions@657i+ T ransformAP9ath[Z;::alignffwithffaxisA|(const*P9oint=?&D]p0P;constJP9oint>&Fp1Rű;constJc9har9?axisNCs='z' w) fT ransformKԱtOeF;tt:alignffwithffaxis@x(p0 ;p1 h;axisp);return7漫(thisϷ=(At+x); -g753. AddingTP9ointstoPaths.754. WithTassignmen9t.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.4.6.]OAdded(thisfunction.bCurrently*,1itdoGesn'treturnaP9atha.IfitturnsoutthatitwouldbGeusefulUUtoreturnUVthisA ,Icanchangeit.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +g753. AddingTP9ointstoPaths.754. WithTassignmen9t.9Ȅ`+U 8Log)j`+U +[LDFT2002.4.6.]OAdded(thisfunction.bCurrently*,1itdoGesn'treturnaP9atha.IfitturnsoutthatitwouldbGeusefulUUtoreturnUVthisA ,Icanchangeit.Ȅ`GhDeclareUUP9ath<functions@656i+ v9oid"opQeratorN+=^"(const*P9oint=?&D]ptN);755.hDe neUUP9ath<functions@657i+ v9oid"P9ath 8BeginTLogJʄ`> -[LDFT2002.4.6.]O?AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -P9ath%opQeratorQ}o+YD(const*P9oint=?&D]ptN)UUconst*; - n썫206WITHOUTXASSIGNMENT3DLDFPRÎGx757n@P757.hDe neUUP9ath<functions@657i+ +g756. WithoutTassignmen9t.9Ȅ`+U 8Log)j`+U +[LDFT2002.4.6.]O?AddedUUthisfunction.Ȅ`GhDeclareUUP9ath<functions@656i+ +P9ath%opQeratorQ}o+YD(const*P9oint=?&D]ptN)UUconst*; +n썫208WITHOUTXASSIGNMENT3DLDFPRÎGx757n@P757.hDe neUUP9ath<functions@657i+ P9ath%P9ath?x"::F`opQeratorq+yd3(const*P9oint=?&D]ptN)UUconst fP9ath/p}'a:(this뷫);p}'aF:p}'oints$:pushffb}'ack+XR(P9ointL::#(cr}'eateffnewffp}'ointk(pt 䝫));return7p}'aB; -g758. AddingTconnectorstoP9aths.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.02.09.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +g758. AddingTconnectorstoP9aths.9Ȅ`+U 8Log)j`+U +[LDFT2003.02.09.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUP9ath<functions@656i+ v9oid"opQeratorN+=^"(const*string?OsC);759.hDe neUUP9ath<functions@657i+ v9oid"P9ath 8BeginTLogJʄ`> +ersionsTusing\&".762. WithTassignmen9t.ThisUUfunctionappGendsthePath<argumentp}'atoUVthisA .9Ȅ`+U 8Log)j`+U [LDFT2002.4.6.]O?AddedUUthisfunction. -[LDFT2002.11.03.]Y;MadeUUnon-inline4.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +[LDFT2002.11.03.]Y;MadeUUnon-inline4.Ȅ`GhDeclareUUP9ath<functions@656i+ v9oid"opQeratorN&=^"(const*P9ath:[&Ayp}'aLս);763.hDe neUUP9ath<functions@657i+ -v9oid"P9ath;(returnHi;gstring?%Plastffc}'onnector}F ; -,n썷x7643DLDFPRÎG tWITHXASSIGNMENT207n@P764. [LDFT2002.4.6.]QIfthereisn'tanexplicitconnectorforeverypairofP9oints'«inthis՟~p}'oints3k,Rthenwe haveto llupc}'onnectors7P4sothatthereareenough.Otherwise,;(returnHi;gstring?%Plastffc}'onnector}F ; +)an썷x7643DLDFPRÎG tWITHXASSIGNMENT209n@P764. [LDFT2002.4.6.]QIfthereisn'tanexplicitconnectorforeverypairofP9oints'«inthis՟~p}'oints3k,Rthenwe haveto llupc}'onnectors7P4sothatthereareenough.Otherwise, Ы);765. [LDFT2002.4.6.]PIftheP9aths# bdon'ttouch,_theyarejoinedusing\.."VKinsteadof\&".ThismimicsthebGehaviorUUofMET*AFONT.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.11.03.]Y;NowUUusingUV(p}'oints$:b}'ackë())insteadofgetffp}'oint*(p}'oints:size\()818).Ȅ` 8EndTLogA>`hDe neUUP9ath<functions@657i+ +while(C-(c}'onnectors/4.:size\() Ы);765. [LDFT2002.4.6.]PIftheP9aths# bdon'ttouch,_theyarejoinedusing\.."VKinsteadof\&".ThismimicsthebGehaviorUUofMET*AFONT.9Ȅ`+U 8Log)j`+U +[LDFT2002.11.03.]Y;NowUUusingUV(p}'oints$:b}'ackë())insteadofgetffp}'oint*(p}'oints:size\()818).Ȅ`GhDe neUUP9ath<functions@657i+ if((p}'oints$:b}'ackë())6=p}'a \:getffp}'oint'bH(0))fc}'err+l"ERROR! In Path::opem0rator&(Path&)."׷l"Paths don't touch.\m0n"}("Using \"..\" to join them instead of \"&\".\n""  ush;c}'onnectorsC40:pushffb}'ack+XR(".."\); g else!c}'onnectorsQ :pushffb}'ack+XR("&"F_); @@ -2828,14 +2865,14 @@ for (v9ectorHhstringi::Bc}'onstffiteratorCiterW=p}'a \:c}'onnectors/4.:b}'egin();iterE6=p}'a:c}'onnectors:endಫ();iter~++!Ş)fc}'onnectorsC40:pushffb}'ack+XR(iter); g -return*f;qǷg767. WithoutTassignmen9t.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.4.6.]O?AddedUUthisfunction.qItbGehavesUUthewayUUtheoperator\&"doesinMET*AFONT.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -P9ath%opQeratorQ}o&YD(const*P9ath:[&Ayp}'aLս)UUconst*; -6n썫208WITHOUTXASSIGNMENT3DLDFPRÎGx768n@P768.hDe neUUP9ath<functions@657i+ +return*f;qǷg767. WithoutTassignmen9t.9Ȅ`+U 8Log)j`+U +[LDFT2002.4.6.]O?AddedUUthisfunction.qItbGehavesUUthewayUUtheoperator\&"doesinMET*AFONT.Ȅ`GhDeclareUUP9ath<functions@656i+ +P9ath%opQeratorQ}o&YD(const*P9ath:[&Ayp}'aLս)UUconst*; +3Yn썫210WITHOUTXASSIGNMENT3DLDFPRÎGx768n@P768.hDe neUUP9ath<functions@657i+ P9ath%P9ath?x"::F`opQeratorq&yd3(const*P9ath:[&Ayp}'aLս)UUconst fP9ath/滱r4ϫ(this뷫);r.&=-p}'a8ƫ;return7漱r<Ы; -g769. AppQendingQwithaconnectorargumen9t.[LDFT2002.4.7.]QItwouldnothavebGeenpossibletospGecifyd}aconnectorifI'dde nedthisfunctionasabinaryoperator,hGe.g.,opQerator.+=>8(),sod}I'vemadeitanamed&function.b ItcanbGeusefulwhen,/forinstance,rotationcausestwo&P9oints#I,which&shouldbGeidentical,to0di erbyasmallamount,7{like1=10;000inonecoGordinate.eWThishasactuallyhappened,7{whichiswhyI'veaddedthisfunction.TMET*APOSTcanrecovergracefullybyusing\.. b"insteadof\&"toconnectthepaths,butitissuesanerrormessageandstopstowaitforarespGonse.Usingthisfunctioncanhelptoavoidsuchproblems.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.4.7.]O?AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +g769. AppQendingQwithaconnectorargumen9t.[LDFT2002.4.7.]QItwouldnothavebGeenpossibletospGecifyd}aconnectorifI'dde nedthisfunctionasabinaryoperator,hGe.g.,opQerator.+=>8(),sod}I'vemadeitanamed&function.b ItcanbGeusefulwhen,/forinstance,rotationcausestwo&P9oints#I,which&shouldbGeidentical,to0di erbyasmallamount,7{like1=10;000inonecoGordinate.eWThishasactuallyhappened,7{whichiswhyI'veaddedthisfunction.TMET*APOSTcanrecovergracefullybyusing\.. b"insteadof\&"toconnectthepaths,butitissuesanerrormessageandstopstowaitforarespGonse.Usingthisfunctioncanhelptoavoidsuchproblems.9Ȅ`+U 8Log)j`+U +[LDFT2002.4.7.]O?AddedUUthisfunction.Ȅ`GhDeclareUUP9ath<functions@656i+ P9ath%app}'endE(const*P9ath:[&Ayp}'aLս;string"c}'onnectorP="--"Mt;bQoolLassign9B=true);770.hDe neUUP9ath<functions@657i+ P9ath%P9ath?x"::app}'end -(const*P9ath:[&Ayp}'aLս;string"c}'onnectorN.ϱ;bQoolLassign7'*)fUUP9ath<r$"(this뷫);string?Vlastffc}'onnector}w;=1[LDFT2002.4.6.]K+kIfthereisn'tanexplicitconnectorforeverypairof2P9ointsU6inethisQc~Qdp}'oints3u,ithenewehaveto llupc}'onnectors5sothatthereareenough.Otherwise,2theUU\&"willbGeatthewrongplace.qW*edon'thaveUUtoworryabouttheconnectorsforp}'aR.o=if)(r:c}'onnectors/4.:size\()0)lastffc}'onnectorE="--"Mt;else5lastffc}'onnectorvʫ=r,:c}'onnectors/4.:b}'ackë();while Ы);r":c}'onnectors/4.:pushffb}'ack+XR(c}'onnector+^ګ);(=[LDFT2002.4.6.]J;CopyUUtheP9oints&.inp}'aandputthecopiesontop}'ointsy.o=for/艫(v9ectorHhP9oint#i::Bc}'onstffiteratorCiterW=p}'a \:p}'oints$:b}'egin();iter6=p}'a:p}'oints:endಫ();iterJ++")(r,:p}'oints$:pushffb}'ack+XR(P9ointL::#(cr}'eateffnewffp}'ointk(iter));771. Put-theconnectorsfromp}'a?ontothenewP9ath2.UNSincethey'restrings%},#andnotpGointers,#wedon'thavetocopythem.)Itestedthistomakesureit'strue.)Idon'tknowhowstrings* 8BeginTLogJʄ`> -[LDFT2002.10.07.]Y;AddedUUcoGdeforhandlingdr}'awffcolor5and llffc}'olor(.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +return-滱r2ϫ;qǷg772. Dra9wingTand lling.773. Dra9w. +Cdn썷x7743DLDFPRÎGhIP +ATHXVERSIONS211n@P774. P9athTversions.775. NormalTv9ersion.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.07.]Y;AddedUUcoGdeforhandlingdr}'awffcolor5and llffc}'olor(.Ȅ`GhDeclareUUP9ath<functions@656i+ virtual0mv9oidJdr}'aw`ǹ(const4;Color?ǫ&Gddr}'awffcolor4M= Colors+Z::1defaultffc}'olorid;const stringddashe}'dD"F=2"" ᔱ;constZstringApp}'enY$ =2"";Picture*&2o8pictur}'eTS@=2curr}'entffpictureE;bQoolXaarr}'ow==2falsev)const8P;776.hDe neUUP9ath<functions@657i+ v9oid#MP9ath<(::dr}'aw(߫(constzColor>oc&F6ddr}'awffcolorz?*;const %1stringAeddashe}'ddv;const %1stringAepp}'enVЈ;Picture2&9#pictur}'eX;bQoolLaarr}'ow:Ϋ)UUconst fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Path::drawk().\n"J ush;if(p}'oints$:size\()0)=LDFUU2002.09.27.qAddedthiserrorhandlingcoGde.IftheP9ath<isempty*,don'tdrawit.=fc}'err4Vi"WARNING! In Path::dlraw():\n""Path doesn't contailn any Points.\n"|2"Not doing anything.\n\n": ush;return>h;gP9ath/滷4漱p<ԫ=cr}'eateffnewffp}'athGڷ(this뷫);p~ llffdr}'awffvalue^{,=DRAWMt;p~arr}'ow:/k=aarr}'ow"Cث;if(DEBUGY)c}'out4 R"ddraw_color.get_usek_name() == "8ddr}'awffcolor6:getffuseffname:()endl ush;if(ddr}'awffcolor4:getffuseffname:()falsev\)fif)(DEBUGY)c}'out O"Allocating memory fkor Color.\n"8 ush;Color=BcI=Color ::&cr}'eateffnewffc}'olorn();#c*=ddr}'awffcolor6;p!~'dr}'awffcolorXU=c;gelse+fif)(DEBUGY)c}'out O"ddraw_color.get_namke() == "Dddr}'awffcolor6:getffname(()endl ush;p!~'dr}'awffcolorXU=& 6ddr}'awffcolor>߫;gp~ llffc}'olorEgp=Colors$::+.4b}'ackgroundffcolorur;p~dashe}'d==ddashe}'d&);p~p}'en/Ϋ=pp}'en;;pictur}'e5+=H%Dstaticus4wcast|hShapQe"Ab'Aci(p);=LDFUU2002.11.03.qChangeddynamicus4wcastF&()tostaticus4wcast7().o=if(DEBUGY)c}'out O"Exiting Path::draw(k).\n"TM ush;return4g; -g -ZQn썫210PICTUREXARÎGUMENTFIRSTUW3DLDFPRGx777n@P777. Pictureދargumen9t rst.[LDFT2002.09.17.]Z:Added]Ythisfunction.It'sconvenient]YforwhenI]Wwant to\>passaPicture,Targument.IfI\passaPicture,Targument.IfI\ 8BeginTLogJʄ`> -[LDFT2003.01.15.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +g782. Dra9wTarrow.783. P9athTversions. +fՠn썷x7843DLDFPRÎG4NORMALXVERSION213n@P784. NormalTv9ersion.9Ȅ`+U 8Log)j`+U +[LDFT2003.01.15.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUP9ath<functions@656i+ virtual0v9oidJϦdr}'awarrowyj(constLColor@&Gڭddr}'awffcolor=f gColors+E::2defaultffc}'olori^;stringddashe}'dD,="" z;string"pp}'en:0="";Picture* &2c(pictur}'eT3=curr}'entffpictureD߫)UUconst*;785.hDe neUUP9ath<functions@657i+ v9oid#&FP9ath<::dr}'awarrow/ȫ(constSColor> o&Eddr}'awffcolory6;string"bddashe}'dF?s;string"bpp}'en8.;Picture*w&2pictur}'eQk)2const fdr}'aw*(ݫ(ddr}'awffcolor4;ddashe}'d$;pp}'en˱;pictur}'e ~;trueo@); -g786. PictureTargumen9t rst.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.01.15.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +g786. PictureTargumen9t rst.9Ȅ`+U 8Log)j`+U +[LDFT2003.01.15.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUP9ath<functions@656i+ virtual.v9oidGidr}'awarrowv\(Picture(`q&0'pictur}'eO0e;constDYColor>X[&Fyddr}'awffcolor|:=Colors)::0.5defaultffc}'olorg;stringddashe}'dD,="" z;string"pp}'en:0="")UUconst*;787.hDe neUUP9ath<functions@657i+ v9oid#&FP9ath<::dr}'awarrow/ȫ(Picture)ϫ&0pictur}'eOñ;constColor?&G5ddr}'awffcolor{ޱ;string"bddashe}'dF?s;string"bpp}'en8.)2const fdr}'aw*(ݫ(pictur}'eֱ;ddr}'awffcolor5Q;ddashe}'d$;pp}'en˱;trueo@); -g788. P9ointTversions.789. NormalTv9ersion.9Ȅ`> 8BeginTLogJʄ`> +g788. P9ointTversions.789. NormalTv9ersion.9Ȅ`+U 8Log)j`+U [LDFT2003.01.15.]Y;AddedUUthisfunction. -[LDFT2003.06.03.]Y;MadeUUdr}'awarrow2H()UUconst*.Ȅ` 8EndTLogA>`hDe neUUP9oint"Dfunctions@285i+ +[LDFT2003.06.03.]Y;MadeUUdr}'awarrow2H()UUconst*.Ȅ`GhDe neUUP9oint"Dfunctions@285i+ P9ath&} P9ointCX::dr}'awarrow/ȫ(constP9oint>F&FpK;const kColor@&Hmddr}'awffcolor|v;string#fGddashe}'dFX;string2pp}'enG6(;Picture* &2c(pictur}'eQk)UUconst fP9ath/p}'a:(this뷱;p);p}'aF:dr}'awarrow.ī(ddr}'awffcolor4;ddashe}'d$;pp}'en˱;pictur}'e ~);return7p}'aB; -g -yn썫212PICTUREXARÎGUMENTFIRSTUW3DLDFPRGx790n@P790. PictureTargumen9t rst.U9Ȅ`> 8BeginTLogJʄ`> +g +uLn썫214PICTUREXARÎGUMENTFIRSTUW3DLDFPRGx790n@P790. PictureTargumen9t rst.9Ȅ`+U 8Log)j`+U [LDFT2003.01.15.]Y;AddedUUthisfunction. -[LDFT2003.06.03.]Y;MadeUUdr}'awarrow2H()UUconst*.Ȅ` 8EndTLogA>`hDe neUUP9oint"Dfunctions@285i+ +[LDFT2003.06.03.]Y;MadeUUdr}'awarrow2H()UUconst*.Ȅ`GhDe neUUP9oint"Dfunctions@285i+ P9ath&QP9ointBd::dr}'awarrow/ȫ(Picture)[&1"pictur}'eP+;const ?P9oint?&G`pLh;const ?Color@N&Hddr}'awffcolor|;string2ddashe}'dUG;string"pp}'en8)UUconst freturn7dr}'awarrowfـ(p;ddr}'awffcolor5Q;ddashe}'d$;pp}'en˱;pictur}'e ~); -g791. Dra9wThelp.9Ȅ`> 8BeginTLogJʄ`> +g791. Dra9wThelp.9Ȅ`+U 8Log)j`+U [LDFT2002.05.10.]Y|Changedɟthewayɟthedefaultargumentsarehandled.ΤThewayitwasdidn'tworkforbGothUUversions,i.e.,theP9ath<versionandtheP9oint"Dversion. [LDFT2002.4.8.]OAdded~thissection.!!It~wouldbGenicetodosomethingtomakesurethatthehelplinesandtcurvesarenotdrawnoverby llingcommands.#MaybGeitwillbepossibletotakecareofthiswhenIimplementthehiddensurfacealgorithminoutput!ԫ().[LDFT2002.11.03.]V>Ifcouldhavehelplinesoutputtedlast,UUifIputthemonav9ector&Toftheirown. -[LDFT2003.07.13.]Y;MadeUUallversionsofdr}'awffhelp.()const*.Ȅ` 8EndTLogA>`792. P9athTversions.[LDFT2002.12.20.]Z6??qCouldUUthesefunctionsbGeconst*?793. NormalTv9ersion.[LDFT2002.4.8.]QH:AddedUUthisfunction.hDeclareUUP9ath<functions@656i+ +[LDFT2003.07.13.]Y;MadeUUallversionsofdr}'awffhelp.()const*.Ȅ`G792. P9athTversions.[LDFT2002.12.20.]Z6??qCouldUUthesefunctionsbGeconst*?793. NormalTv9ersion.[LDFT2002.4.8.]QH:AddedUUthisfunction.hDeclareUUP9ath<functions@656i+ v9oid#dr}'awffhelpM߀(constFColor>&Eαddr}'awffcolor|=helpffc}'olor36;string"ddashe}'dI(ƫ=helpffdashffp}'atternO14;stringpp}'en5>="" z;Picture* &2c(pictur}'eT3=curr}'entffpictureD߫)UUconst*;794.hDe neUUP9ath<functions@657i+ v9oid#6yP9ath<::dr}'awffhelp+Ŭ(constcBColor>@ի&Fddr}'awffcolorz;string#ddashe}'dFO;string#pp}'en8>;Picture*Ԫ&2pictur}'eQ)2const fif(doffhelpfflines;falsev\)return%e;dr}'aw*(ݫ(ddr}'awffcolor4;ddashe}'d$;pp}'en˱;pictur}'e ~); g795. PictureTargumen9t rst.hDeclareUUP9ath<functions@656i+ v9oid$Ddr}'awffhelpO -T(Picture*85&1Spictur}'eQ);const!ColorB&Iddr}'awffcolort=ʷ helpffc}'olor5?;stringddashe}'dD,=helpffdashffp}'atternO;string"pp}'en:0="" z)UUconst*; -Hn썷x7963DLDFPRÎGUWPICTUREXARGUMENTFIRST213n@P796.hDe neUUP9ath<functions@657i+ +T(Picture*85&1Spictur}'eQ);const!ColorB&Iddr}'awffcolort=ʷ helpffc}'olor5?;stringddashe}'dD,=helpffdashffp}'atternO;string"pp}'en:0="" z)UUconst*; +~n썷x7963DLDFPRÎGUWPICTUREXARGUMENTFIRST215n@P796.hDe neUUP9ath<functions@657i+ v9oid#6yP9ath<::dr}'awffhelp+Ŭ(Picture)*&0 pictur}'eO;const Color?}&Gddr}'awffcolor{D;string#ddashe}'dFO;string#pp}'en8>)2const fdr}'awffhelp>Ū(ddr}'awffcolor4;ddashe}'d$;pp}'en˱;pictur}'e ~); g797. P9ointTversions.798. NormalXJv9ersion.[LDFT2002.4.8.]RAddedthisfunction.c 8BeginTLogJʄ`> -[LDFT2002.10.07.]Y;AddedUUcoGdeforhandlingand llffc}'olor(.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -v9oid#[ ll0%(constColor>]&FR{llffc}'olorr*=ccColors*]&FR{llffc}'olorr*=ccColors*h;gP9ath/滷4漱p<ԫ=cr}'eateffnewffp}'athGڷ(this붫);p~ llffdr}'awffvalue^{,=FILLMt;if(DEBUGY)c}'out4 R"ffill_color.get_usek_name() == "8llffc}'olor+3:getffuseffname:()endl ush;if(llffc}'olor(:getffuseffname:()falsev\)fif)(DEBUGY)c}'out O"Allocating memory fkor Color.\n"8 ush;Color=BcI=Color ::&cr}'eateffnewffc}'olorn();#c*=llffc}'olor+3;p!~' llffc}'olorOgq=c;gelse+fif)(DEBUGY)c}'out O"ffill_color.get_namke() == "Dllffc}'olor+3:getffname(()endl ush;p!~' llffc}'olorOgq=& 6llffc}'olor3XQ;gp~p}'en/Ϋ="" z;p~dashe}'d=="" z;p~dr}'awffcolorNT=Colors$::+.4b}'ackgroundffcolorur;pictur}'e5+=H%Dstaticus4wcast|hShapQe"Ab'Aci(p);if(DEBUGY)c}'out O"Exiting Path::fill(k).\n"TM ush;return4g; g803. Pictureދargumen9t rst.[LDFT2002.09.17.]Z:Added]Ythisfunction.It'sconvenient]YforwhenI]WwanttoUUpassaPicture,Fargument.hDeclareUUP9ath<functions@656i+ -v9oid" ll/̫(Picture(b&0pictur}'eOV;constJColor?z=&GA[llffc}'olorrҎ=Colors)::0.5defaultffc}'olorg); -an썷x8043DLDFPRÎGUWPICTUREXARGUMENTFIRST215n@P804.hDe neUUP9ath<functions@657i+ +v9oid" ll/̫(Picture(b&0pictur}'eOV;constJColor?z=&GA[llffc}'olorrҎ=Colors)::0.5defaultffc}'olorg); +n썷x8043DLDFPRÎGUWPICTUREXARGUMENTFIRST217n@P804.hDe neUUP9ath<functions@657i+ v9oid"P9ath 8BeginTLogJʄ`> -[LDFT2003.07.16.]Y;MadeUUbGothversionsconst*.Ȅ` 8EndTLogA>`806. NormalTv9ersion.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.10.07.]Y;AddedUUcoGdeforhandlingdr}'awffcolor5and llffc}'olor(.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +[LDFT2002.03.25]WA8([LDFT2002.11.03.]ORevised thefollowingtext).Atthepresenttime,R lldr}'aw%4()di ersfromthe lldra9wcommandinMET*AFONTnandMETAPOST:Inthedefaultcase,Atheoutlineisdrawninthedefaultcolor(currentlyblack)andtheP9athis lledwiththebackgroundcolor(currentlywhitebydefault).ThiszmakesitpGossibletohideob8jectsthatarebehindtheP9athbyusingthepainter'salgorithmwhen5rendering.gIfyouwantaP9athtobGe lledwithanothercolor,;youwillhavetouseexplicitargumentsforb~ddr}'awffcolor:ͥandb~llffc}'olor,,.AEitherb~orbGothofthesecanbe""h,ewhichcausesthedefaultcolor(currentlyblack)UUtobGeused.qOfcourse,plain llH()followedbyplaindr}'aw~0()willproGducethesameresult.N99Ȅ`+U 8Log)j`+U +[LDFT2003.07.16.]Y;MadeUUbGothversionsconst*.Ȅ`G806. NormalTv9ersion.9Ȅ`+U 8Log)j`+U +[LDFT2002.10.07.]Y;AddedUUcoGdeforhandlingdr}'awffcolor5and llffc}'olor(.Ȅ`GhDeclareUUP9ath<functions@656i+ v9oid$u lldr}'awE܋(constColor@#&HAddr}'awffcoloru=8 -8Colors,j::2defaultffc}'olorj;const!LColor&%!llffc}'olorR,%=Colors*sȫ::1b}'ackgroundffcolor{F^;string#O ddashe}'dJ1=""K;string#O pp}'en< ="";Picture&%!pictur}'eG=curr}'entffpictureD߫)UUconst*; -n썫216NORMALXVERSION43DLDFPRÎGx807n@P807.hDe neUUP9ath<functions@657i+ +8Colors,j::2defaultffc}'olorj;const!LColor&%!llffc}'olorR,%=Colors*sȫ::1b}'ackgroundffcolor{F^;string#O ddashe}'dJ1=""K;string#O pp}'en< ="";Picture&%!pictur}'eG=curr}'entffpictureD߫)UUconst*; +ՠn썫218NORMALXVERSION43DLDFPRÎGx807n@P807.hDe neUUP9ath<functions@657i+ v9oid#RQP9ath<㹫:: lldr}'aw"go(constColor>x&F?ddr}'awffcolorzHL;const )Color@#-&GKllffc}'olorpf;string#$mddashe}'dFk~;string2pp}'enG6(;Picture* &2c(pictur}'eQk)UUconst fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Path::fillkdraw().\n"> ush;if(p}'oints$:size\()0)=LDFUU2002.09.27.qAddedthiserrorhandlingcoGde.IftheP9ath<isempty*,don't lldrawit.o=fc}'err3K"WARNING! In Path::flfilldraw():\n"I"Path doesn't contailfn any Points.\n"@2"Not doing anything.\n\n": ush;return>h;gP9ath/滷4漱p<ԫ=cr}'eateffnewffp}'athGڷ(this붫);p~ llffdr}'awffvalue^{,=FILLDRAW-Mh;if(DEBUGY)c}'out4 R"ddraw_color.get_usek_name() == "8ddr}'awffcolor6:getffuseffname:()endl ush;if(DEBUGY)c}'out4 R"ffill_color.get_usek_name() == "8llffc}'olor+3:getffuseffname:()endl ush;if(ddr}'awffcolor4:getffuseffname:()falsev\)fif)(DEBUGY)c}'out O"Allocating memory fkor Color.\n"8 ush;Color=BcI=Color ::&cr}'eateffnewffc}'olorn();#c*=ddr}'awffcolor6;p!~'dr}'awffcolorXU=c;gelse+fif)(DEBUGY)c}'out O"ddraw_color.get_namke() == "Dddr}'awffcolor6:getffname(()endl ush;p!~'dr}'awffcolorXU=& 6ddr}'awffcolor>߫;gif(llffc}'olor(:getffuseffname:()falsev\)fif)(DEBUGY)c}'out O"Allocating memory fkor Color.\n"8 ush;Color=BcI=Color ::&cr}'eateffnewffc}'olorn();#c*=llffc}'olor+3;p!~' llffc}'olorOgq=c;gelse+fif)(DEBUGY)c}'out O"ffill_color.get_namke() == "Dllffc}'olor+3:getffname(()endl ush;p!~' llffc}'olorOgq=& 6llffc}'olor3XQ;gp~dashe}'d==ddashe}'d&);p~p}'en/Ϋ=pp}'en;;pictur}'e5+=H%Dstaticus4wcast|hShapQe"Ab'Aci(p);if(DEBUGY)c}'out O"Exiting Path::filldkraw().\n"TA ush;return4g; -g -n썷x8083DLDFPRÎGUWPICTUREXARGUMENTFIRST217n@P808. Pictureދargumen9t rst.[LDFT2002.09.17.]Z:Added]Ythisfunction.It'sconvenient]YforwhenI]Wwant toUUpassaPicture,Fargument.hDeclareUUP9ath<functions@656i+ +g +n썷x8083DLDFPRÎGUWPICTUREXARGUMENTFIRST219n@P808. Pictureދargumen9t rst.[LDFT2002.09.17.]Z:Added]Ythisfunction.It'sconvenient]YforwhenI]Wwant toUUpassaPicture,Fargument.hDeclareUUP9ath<functions@656i+ v9oid#42 lldr}'awD(Picture)'&0pictur}'eO;const Color?&G ddr}'awffcolor~a=!!Colors)::0defaultffc}'olorh;const Color&%!llffc}'olorQXT=Colors)::0.5b}'ackgroundffcolorzr;string"ddashe}'dH="" z;string"pp}'en:0="")UUconst*;809.hDe neUUP9ath<functions@657i+ v9oid#&]P9ath<ū:: lldr}'aw"go(Picture)&0pictur}'eOڱ;constColor?E&Gcddr}'awffcolor{ ;constColor?E&Gcllffc}'olorp\~;string2ddashe}'dUG;string"pp}'en8)UUconst f lldr}'aw5gm(ddr}'awffcolor4;llffc}'olor*tñ;ddashe}'d$;pp}'en˱;pictur}'e ~); @@ -2950,75 +2987,75 @@ &2c(pictur}'eQk) fif(p}'oints$:size\()0)=LDFUU2002.09.27.qAddedthiserrorhandlingcoGde.IftheP9ath<isempty*,don'tundrawit.o=fc}'err4ڷ_1"WARNING! In Path::ul^ndraw():\n"m_1"Path doesn't contail^n any Points.\n"D^2"Not doing anything.\n\n": ush;return>h;gP9ath/滷4漱p<ԫ=cr}'eateffnewffp}'athGڷ(this붫);p~ llffdr}'awffvalue^{,=UNDRAW"n;p~dr}'awffcolorNT=0;p~ llffc}'olorEgp=0;p~dashe}'d==ddashe}'d&);p~p}'en/Ϋ=pp}'en;;pictur}'e5+=H%Dstaticus4wcast|hShapQe"Ab'Aci(p); g814. Pictureދargumen9t rst.[LDFT2002.09.17.]Z:Added]Ythisfunction.It'sconvenient]YforwhenI]WwanttoUUpassaPicture,Fargument.hDeclareUUP9ath<functions@656i+ -v9oid"undr}'awD#ث(Picture(b&0pictur}'eOV;string"ddashe}'dH="" z;string"pp}'en:0=""); -|n썫218PICTUREXARÎGUMENTFIRSTUW3DLDFPRGx815n@P815.hDe neUUP9ath<functions@657i+ +v9oid"undr}'awD#ث(Picture(b&0pictur}'eOV;string"ddashe}'dH="" z;string"pp}'en:0=""); +ݠn썫220PICTUREXARÎGUMENTFIRSTUW3DLDFPRGx815n@P815.hDe neUUP9ath<functions@657i+ v9oid"P9ath 8BeginTLogJʄ`> +g816. P9ointTversions.817. Normal+?v9ersion.This~functionisdeclaredinpoints.web,butmustbGede nedhere,bGecause P9ath湫isUUanincompletetypGehere.9Ȅ`+U 8Log)j`+U [LDFT2002.4.8.]O?AddedUUthisfunction. -[LDFT2002.11.03.]Y;ChangedUUthisfunction,sothatitreturnstheP9ath<p}'a*9R,insteadofv9oidث.Ȅ` 8EndTLogA>`hDe neUUP9oint"Dfunctions@285i+ +[LDFT2002.11.03.]Y;ChangedUUthisfunction,sothatitreturnstheP9ath<p}'a*9R,insteadofv9oidث.Ȅ`GhDe neUUP9oint"Dfunctions@285i+ P9ath%P9ointB::undr}'aw"&(const*P9oint=?&D]ptN;string"ddashe}'dF;string"pp}'en8;Picture* &2c(pictur}'eQk) fP9ath/p}'a:(this뷱;pt E);p}'aF:undr}'aw!%(ddashe}'d#G;pp}'en˱;pictur}'e ~);return7p}'aB; -g818. PictureTargumen9t rst.U9Ȅ`> 8BeginTLogJʄ`> +g818. PictureTargumen9t rst.9Ȅ`+U 8Log)j`+U [LDFT2002.09.17.]Y;AddedUUthisfunction.qIt'sconvenientUUforwhenIwantUUtopassaPicture,Fargument. -[LDFT2002.09.17.]Y;AddedUUthisfunction.qIt'sconvenientUUforwhenIwantUUtopassaPicture,Fargument.Ȅ` 8EndTLogA>`hDe neUUP9oint"Dfunctions@285i+ +[LDFT2002.09.17.]Y;AddedUUthisfunction.qIt'sconvenientUUforwhenIwantUUtopassaPicture,Fargument.Ȅ`GhDe neUUP9oint"Dfunctions@285i+ P9ath%P9ointB::undr}'aw"&(Picture(b&0pictur}'eOV;constJP9oint>&FptPp;string"ddashe}'dF;string"pp}'en8) freturn7undr}'awY (pt 䝱;ddashe}'d$;pp}'en˱;pictur}'e ~); g819. Un ll.820. NormalTv9ersion.hDeclareUUP9ath<functions@656i+ -v9oid"un ll:(Picture(b&0pictur}'eRn=curr}'entffpictureD߫); -n썷x8213DLDFPRÎG4NORMALXVERSION219n@P821.hDe neUUP9ath<functions@657i+ +v9oid"un ll:(Picture(b&0pictur}'eRn=curr}'entffpictureD߫); +yn썷x8213DLDFPRÎG4NORMALXVERSION221n@P821.hDe neUUP9ath<functions@657i+ v9oid"P9athh;gP9ath/滷4漱p<ԫ=cr}'eateffnewffp}'athGڷ(this붫);p~ llffdr}'awffvalue^{,=UNFILL"n;p~dr}'awffcolorNT=0;p~ llffc}'olorEgp=0;p~dashe}'d=="" z;p~p}'en/Ϋ="" z;pictur}'e5+=H%Dstaticus4wcast|hShapQe"Ab'Aci(p); g822. Un lldra9w.823. NormalTv9ersion.hDeclareUUP9ath<functions@656i+ v9oid"3un lldr}'awOc«(const+Color=I&Egddr}'awffcolor|ki=YZColors)8::00vb}'ackgroundffcolorztα;string"Oddashe}'dHṫ=Y"" ϻ;stringpp}'en5>="" z;Picture* -&2c(pictur}'eT3=curr}'entffpictureD߫); -匠n썫220NORMALXVERSION43DLDFPRÎGx824n@P824.hDe neUUP9ath<functions@657i+ +&2c(pictur}'eT3=curr}'entffpictureD߫); +ߗn썫222NORMALXVERSION43DLDFPRÎGx824n@P824.hDe neUUP9ath<functions@657i+ v9oid"P9ath"2"Not doing anything.\n\n": ush;return>h;gP9ath/滷4漱p<ԫ=cr}'eateffnewffp}'athGڷ(this붫);p~ llffdr}'awffvalue^{,=UNFILLDRAW7b;=!OLDFv2002.10.07.ռAddedvcoGdeforhandlingdr}'awffcolor5هand llffc}'olor).WillgetridofthisifIvdo(actuallyUUchangeittomakeitactmorelikeun lldra9winMET*APOST.=if(ddr}'awffcolor4:getffuseffname:()falsev\)fif)(DEBUGY)c}'out O"Allocating memory fkor Color.\n"8 ush;Color=BcI=Color ::&cr}'eateffnewffc}'olorn();#c*=ddr}'awffcolor6;p!~'dr}'awffcolorXU=c;gelse+fif)(DEBUGY)c}'out O"ddraw_color.get_namke() == "Dddr}'awffcolor6:getffname(()endl ush;p!~'dr}'awffcolorXU=& 6ddr}'awffcolor>߫;gp~ llffc}'olorEgp=0;p~dashe}'d==ddashe}'d&);p~p}'en/Ϋ=pp}'en;;pictur}'e5+=H%Dstaticus4wcast|hShapQe"Ab'Aci(p);if(DEBUGY)c}'out O"Exiting Path::unfilkldraw().\n"; ush;return4g; g825. Pictureދargumen9t rst.[LDFT2002.09.17.]Z:Added]Ythisfunction.It'sconvenient]YforwhenI]WwanttoUUpassaPicture,Fargument.hDeclareUUP9ath<functions@656i+ -v9oid#0un lldr}'awOZ(Picture)$T&0rpictur}'eOH;const  8BeginTLogJʄ`> +g827. LabQelling.828. LabQel.9Ȅ`+U 8Log)j`+U [LDFT2002.03.25.]ZAddedUargumentdotandchangedde nitionofdotlab}'el&U()bGelowsothatitjustcallslab}'elt(). -[LDFT2003.04.01.]XKBUGVFIX:eGotridofthe rstargumentunsigned3in9tDiG~,&.andmadethethirdargumentshortztextffshortK_the rstargument.W2F*ormerly,theP9oints&.inP9aths#%̫werealwaysnumbGeredstartingfrom0,bGecauseptheargumenttextffshort2XOwaspassedtoP9oint V::lab}'elt(),7noti.d.AlsochangedthefollowingversionsofUUlab}'el()UUanddotlab}'el%UH(),thatcallthisfunction.Ȅ` 8EndTLogA>`829. NormalTv9ersion.9Ȅ`> 8BeginTLogJʄ`> +[LDFT2003.04.01.]XKBUGVFIX:eGotridofthe rstargumentunsigned3in9tDiG~,&.andmadethethirdargumentshortztextffshortK_the rstargument.W2F*ormerly,theP9oints&.inP9aths#%̫werealwaysnumbGeredstartingfrom0,bGecauseptheargumenttextffshort2XOwaspassedtoP9oint V::lab}'elt(),7noti.d.AlsochangedthefollowingversionsofUUlab}'el()UUanddotlab}'el%UH(),thatcallthisfunction.Ȅ`G829. NormalTv9ersion.9Ȅ`+U 8Log)j`+U [LDFT2003.05.06.]Y;ChangedUUtheconditional,wheretextffshort1iscomparedwithWORLD_VALUESBۙ,PROJ_VALUES:FG,etc.0FIhadtochangeit,bGecauseI'veaddedWORLD_VALUES_X_YW ,etc.0FNow,theconditionaltestsfor"=VIEW_VALUES_X_YShx[/textffshort#WORLD_VALUES\g.Of"=course,UwthismakesanassumptionabGoutthevqaluesthatareusedtosignalthatcoGordinatevqaluesshouldbeusedforthelabel,butIthinkit'sworthit,toavoidtestingUUtextffshort1againstUUeachvqalueindividually*. -[LDFT2003.07.09.]Y;MadeUUp}'ositionffstringFͫandUUdotargumentsUUconst*.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -v9oid"lab}'el72(shorttextffshortK1O=0;constostring@zp}'ositionffstring=="top"q;constobQool8dotJ=falsev\;Picture&%!pictur}'eG=curr}'entffpictureD߫)UUconst*; -n썫222NORMALXVERSION43DLDFPRÎGx830n@P830.hDe neUUP9ath<functions@657i+ +[LDFT2003.07.09.]Y;MadeUUp}'ositionffstringFͫandUUdotargumentsUUconst*.Ȅ`GhDeclareUUP9ath<functions@656i+ +v9oid"lab}'el72(shorttextffshortK1O=0;constostring@zp}'ositionffstring=="top"q;constobQool8dotJ=falsev\;Picture&%!pictur}'eG=curr}'entffpictureD߫)UUconst*; +n썫224NORMALXVERSION43DLDFPRÎGx830n@P830.hDe neUUP9ath<functions@657i+ v9oid#&2P9ath<::lab}'elt(shorttextffshortHk;conststringAKIp}'ositionffstringFl;constbQool9bdotHo;Picture*c&2pictur}'eQW)2const fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)c}'out O"Entering Path::labekl()"P"\n" ush;if(LabQelAg::#ϥDO_LABELSV] falsev\)return%e;if(p}'oints$:size\()0)=LDFUU2002.09.27.qAddedthiserrorhandlingcoGde.IftheP9ath<isempty*,don'tlabGelit.o=fc}'err45"WARNING! In Path::llabel():\n""Path doesn't contailn any Points.\n"ą2"Not doing anything.\n\n": ush;return>h;gfor%舫(v9ectorHhP9oint#i::Bc}'onstffiteratorCiterW=p}'oints뭱:b}'egin();iter6=p}'oints:endಫ();iterJ++")f( iter):lab}'elt(textffshort*o;p}'ositionffstringA˱;dot;pictur}'e ~);if)(textffshort-P9ointad::%WORLD_VALUESgƷ^8textffshort/gP9ointad::%VIEW_VALUES`5)2=LDFUU2003.05.06.qChangedthisconditional.o=(;=DoUUnothing.o=else6X++B textffshortlq;gif(DEBUGY)c}'out O"Exiting Path::labelk()"~S"\n" ush; g831. Pictureދargumen9t rst.[LDFT2002.09.17.]Z:Added]Ythisfunction.It'sconvenient]YforwhenI]WwanttoUUpassaPicture,Fargument. -[LDFT2003.07.09.]Y;MadeUUp}'ositionffstringFͫandUUdotargumentsUUconst*.c9Ȅ`> 8BeginTLogJʄ`>Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +[LDFT2003.07.09.]Y;MadeUUp}'ositionffstringFͫandUUdotargumentsUUconst*.N99Ȅ`+U 8Log)j`+UȄ`GhDeclareUUP9ath<functions@656i+ v9oid#lab}'el7:(Picture)+&0Ipictur}'eO;shorttextffshortMX=0;conststringA()p}'ositionffstring^="top"k;constbQooldot/(=falsev\)UUconst*;832.hDe neUUP9ath<functions@657i+ v9oid#&2P9ath<::lab}'elt(Picture)&0pictur}'eO鯱;shorttextffshortJ};conststringAKIp}'ositionffstringFl;constbQool9bdotHo)2const flab}'el(t(textffshort*o;p}'ositionffstringA˱;dot;pictur}'e ~); -g833. DotlabQel. qn썷x8343DLDFPRÎG4NORMALXVERSION223n@P834. NormalTv9ersion.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.07.09.]Y;MadeUUtextffshort1andUUp}'ositionffstringFͫargumentsUUconst*.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +g833. DotlabQel. 'n썷x8343DLDFPRÎG4NORMALXVERSION225n@P834. NormalTv9ersion.9Ȅ`+U 8Log)j`+U +[LDFT2003.07.09.]Y;MadeUUtextffshort1andUUp}'ositionffstringFͫargumentsUUconst*.Ȅ`GhDeclareUUP9ath<functions@656i+ v9oid#ڤdotlab}'elEڗ(constmshort=textffshortl^=70 7;const stringB-p}'ositionffstringd=7"top"m;Picture&%!pictur}'eG=curr}'entffpictureD߫)UUconst*;835.hDe neUUP9ath<functions@657i+ v9oid"P9ath 8BeginTLogJʄ`> +g836. PictureTargumen9t rst.9Ȅ`+U 8Log)j`+U [LDFT2002.09.17.]Y;AddedUUthisfunction.qIt'sconvenientUUforwhenIwantUUtopassaPicture,Fargument. -[LDFT2003.07.09.]Y;MadeUUtextffshort1andUUp}'ositionffstringFͫargumentsUUconst*.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +[LDFT2003.07.09.]Y;MadeUUtextffshort1andUUp}'ositionffstringFͫargumentsUUconst*.Ȅ`GhDeclareUUP9ath<functions@656i+ v9oid#5mdotlab}'elE5`(Picture)(&0pictur}'eO;const short>textffshortl==#0#;const stringAip}'ositionffstring=#"top")const8P;837.hDe neUUP9ath<functions@657i+ v9oid"P9ath 8BeginTLogJʄ`> +[LDFT2003.01.31.]Y;??qDoUUIneedtocallP9oint::pr}'ojectw()ontheP9oints&.hereandinP9ath潫::pr}'oject()?N99Ȅ`+U 8Log)j`+U [LDFT2002.09.17.]XAdded2const!; F oQcusAc9&I*WfRVargument2anderrorhandlingcoGde.fKNow,9ifanyoftheP9ointson{pv9ector#%hP9oint$i{pp}'oints"ucannot{pbGepro8jectedontotheprojectionplaneusingtheF oQcus#,f),theP9athDisnot#putontothev9ector"VhShapQe"'iPicture)::elements',-andconsequentlyneverreachesPicture)::outputD()andUUP9ath潫::outputD(). -[LDFT2003.05.09.]WRewrote?thisfunction.7ItnowcallsP9oint::extr}'acts()insteadofcallingapplyfftr}'ansformH_()andU}pr}'oject!̋()U}ontheP9oints&~directly*.r?Thismakesmuchmoresense,UsinceanychangestoP9ointɫ::extr}'acts()wouldUUotherwisenothavebGeenappliedtoP9oints&.onP9aths o.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +[LDFT2003.05.09.]WRewrote?thisfunction.7ItnowcallsP9oint::extr}'acts()insteadofcallingapplyfftr}'ansformH_()andU}pr}'oject!̋()U}ontheP9oints&~directly*.r?Thismakesmuchmoresense,UsinceanychangestoP9ointɫ::extr}'acts()wouldUUotherwisenothavebGeenappliedtoP9oints&.onP9aths o.Ȅ`GhDeclareUUP9ath<functions@656i+ v9ector)IhShapQe"Ab'AciUUextr}'act"ī(const*F -oQcus>uC&FuC&FuC&FQ"Entering Path::set_kjextremes()"7Wendl ush;=IfstherearenoP9oints' on<theUUP9ath湫,UUsetalltheelementsofpr}'ojectiveffextremesZtoINVALID_REALF0andreturnfalse.o=if)(p}'oints$:size\()0)f(c}'err?6h"ERROR! In Path::setmhP_extremes():\n"h"points.size() <= 0.mhP "|><"Setting extremes to INVALID_REAL and re turning.\n"K  ush;(pr}'ojectiveffextremes~m=INVALID_REALBM\;(returnKfalse`;g &ˠn썷x8433DLDFPRÎGSETXEXTREMES225n@P843. [LDFT2002.09.18.]YAdded=thisroutine.3jSettheminimum^vqaluestoMAX_REAL/ʫandthemaximumvqalues toU sMAX_REAL65ë.*ThisUway*, anyvqalidpGerspectivecoordinateswillreplacethemonthe rstiterationofthefor膫loGop. +bQool#gP9ath=2ϫ::setffextr}'emes7()fUUbQoolDEBUG:,=falsev\;=trueĒ=if)(DEBUGY)(c}'out>Q"Entering Path::set_kjextremes()"7Wendl ush;=IfstherearenoP9oints' on<theUUP9ath湫,UUsetalltheelementsofpr}'ojectiveffextremesZtoINVALID_REALF0andreturnfalse.o=if)(p}'oints$:size\()0)f(c}'err?6h"ERROR! In Path::setmhP_extremes():\n"h"points.size() <= 0.mhP "|><"Setting extremes to INVALID_REAL and re turning.\n"K  ush;(pr}'ojectiveffextremes~m=INVALID_REALBM\;(returnKfalse`;g ֠n썷x8433DLDFPRÎGSETXEXTREMES227n@P843. [LDFT2002.09.18.]YAdded=thisroutine.3jSettheminimum^vqaluestoMAX_REAL/ʫandthemaximumvqalues toU sMAX_REAL65ë.*ThisUway*, anyvqalidpGerspectivecoordinateswillreplacethemonthe rstiterationofthefor膫loGop. [LDFT2002.09.18.]XWI$ehad$qsomedicultydebuggingthisbGecauseinsteadofusing MAX_REAL5q߫,.9Ide nedandusedB1MIN_REAL3[=Qn9umericus4wlimitsN@hreal]ٷi::BminW().8[However,}hthisB1isn'tthenegativereal;withthelargestmagnitude,UUbutthesmallestpGositivereal..hDe neUUP9ath<functions@657i+ pr}'ojectiveffextremes^R[0]=MAX_REAL-Mh;=Minima.o= @@ -3053,7 +3090,7 @@ iter):getffz('p'F_;falseY;false));=MaxUUz= g if(DEBUGY)ffor%舫(in9ti=0;i 9 <6;i++)c}'out4 R"projective_extremesk["yVi $"] == "*ԃpr}'ojectiveffextremesVi[iq]endl ush; -g 4n썫226SETXEXTREMES3DLDFPRÎGx844n@P844. [LDFT2002.09.18.][=Added\thiserrorhandlingcoGde.(ThereisaremotechancethatavqalidP9oint couldBhaveacoGordinateMAX_REAL3 +g -n썫228SETXEXTREMES3DLDFPRÎGx844n@P844. [LDFT2002.09.18.][=Added\thiserrorhandlingcoGde.(ThereisaremotechancethatavqalidP9oint couldBhaveacoGordinateMAX_REAL3 or 8MIN_REAL6,}Khowever,itBisvirtuallyimpGossiblethatitwouldbepro8jectable.ծIfvit'sthexory-coGordinate,~itwouldprobablylieoutsidethelimitsde nedfortheinvoGcationof7Picture*ӽ::outputD(),pAand7ifitwasthez Nʫ,itwouldeitherbGebehindtheF oQcus%dorsofaraway7astobepractically.invisible.SIbGelievethatthisisthecase,ؤeventhoughthez-coGordinatesaremadesmallerbyapplyingUUtheequationzpfj=zp=(zw+8p).hDe neUUP9ath<functions@657i+ for臫(in9ti=0;i 9 <6;i+=]2"^)fif(pr}'ojectiveffextremesTQ[iq]MAX_REALAMi=Minima=8_8pr}'ojectiveffextremesV=1[iԫ+818] @@ -3064,7 +3101,7 @@ virtual/inlineOconstmBv\ralarra9yhreal]ٷiUUgetffextr}'emes:()UUconst freturn7pr}'ojectiveffextremes ; g846. GetTminim9umz.[LDFT2003.05.16.]Z6AddedUUthisfunction.hDeclareUUP9ath<functions@656i+ -virtual/realFAgetffminimumffzګ()UUconst*; Kn썷x8473DLDFPRÎGGETXMINIMUMZ227n@P847.hDe neUUP9ath<functions@657i+ +virtual/realFAgetffminimumffzګ()UUconst*; D'n썷x8473DLDFPRÎGGETXMINIMUMZ229n@P847.hDe neUUP9ath<functions@657i+ real /P9ath:D::getffminimumffzD]ܫ()UUconst fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)fc}'out4 R"Entering Path::get_kminimum_z()"8endl ush;c}'out4 R"projective_extremesk[4] == "Dpr}'ojectiveffextremesVi[4]endl ush;c}'out4 R"Exiting Path::get_mkinimum_z()";endl ush;greturn7pr}'ojectiveffextremes [4]; g848. GetTmaxim9umz.[LDFT2002.09.17.]Z6AddedUUthisfunction.hDeclareUUP9ath<functions@656i+ @@ -3076,19 +3113,19 @@ real /P9ath:D::getffme}'anffz1()UUconst freturn7漫((pr}'ojectiveffextremesTQ[4]8+pr}'ojectiveffextremesV=1[5])=2); g852. Suppressxoutput.[LDFT2002.09.18.][Addedthisfunction.It'sneededbGecausetryingtoeraseaShapQe"Ab*fromUUelements-inUUPicture)f::outputD()UUcausesamemoryfault.hDeclareUUP9ath<functions@656i+ -virtual/v9oidHsuppr}'essffoutputr.(); Wn썫228SUPPRESSXOUTPUTe3DLDFPRÎGx853n@P853.hDe neUUP9ath<functions@657i+ +virtual/v9oidHsuppr}'essffoutputr.(); Pn썫230SUPPRESSXOUTPUTe3DLDFPRÎGx853n@P853.hDe neUUP9ath<functions@657i+ v9oid"P9ath 8BeginTLogJʄ`> -[LDFT2003.01.15.]YIAddedccoGdeforwriting\drawarrow"ctooutffstr}'eam3X,I'ifarr}'ow" /trueǫ.Thisisforthedr}'awarrow.ī()UUfunctionsforP9ath<andP9oint"DthatI'veaddedtoGday*.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +g856. Output.[LDFT2002.09.17.]Z Removed+errorchecking+coGdetoextr}'act!().ENowoutputk()assumesthatalloftheP9oints%inp}'oints canbGepro8jectedusingfo}'cus_.=Iftheycan'tbe,سextr}'act!"()willalreadyhaveensuredthatUUtheP9ath<isnotonv9ector"hShapQe"Ab'Acielements-inthePicture(b.N99Ȅ`+U 8Log)j`+U +[LDFT2003.01.15.]YIAddedccoGdeforwriting\drawarrow"ctooutffstr}'eam3X,I'ifarr}'ow" /trueǫ.Thisisforthedr}'awarrow.ī()UUfunctionsforP9ath<andP9oint"DthatI'veaddedtoGday*.Ȅ`GhDeclareUUP9ath<functions@656i+ virtual/v9oidHoutpute();857.hDe neUUP9ath<functions@657i+ -v9oid"P9ath to continue.\n"* ush;getchar5%();c}'err*SI"WARNING! In Path::oleutput():\n"M"Path doesn't contailen any Points.\n">("Not doing anything.\n\n"9 ush;return4g; -g mԠn썫230OUTPUT=\03DLDFPRÎGx859n@P859.hDe neUUP9ath<functions@657i+ +g fn썫232OUTPUT=\03DLDFPRÎGx859n@P859.hDe neUUP9ath<functions@657i+ v9ector)IhP9oint#i::Biter}'ator)7p}'ointffiterV:=p}'oints뭱:b}'egin(); v9ector)Ihstringi::Biter}'ator)7c}'onnectorffiterjӫ=c}'onnectors1F:b}'egin(); string+%Nc}'onnectorffstringrʫ; @@ -3107,8 +3144,8 @@ hOutputUUP9ath &864i outffstr}'eam<" withcolor "JTq llffc}'olor-_n; outffstr}'eam<";\n" T ush; -p}'ointffiter6=p}'oints뭱:b}'egin(); sln썷x8603DLDFPRÎG=\0OUTPUT231n@P860.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.05.10.]X_Added`ythecoGdeinthissection. )It xesabug.Ifit'snotdone,rthenthecorrectconnectorsareUUnotusedwhentheP9ath<isoutputthesecondtime.Ȅ` 8EndTLogA>`hDe neUUP9ath<functions@657i+ +p}'ointffiter6=p}'oints뭱:b}'egin(); lLn썷x8603DLDFPRÎG=\0OUTPUT233n@P860.9Ȅ`+U 8Log)j`+U +[LDFT2002.05.10.]X_Added`ythecoGdeinthissection. )It xesabug.Ifit'snotdone,rthenthecorrectconnectorsareUUnotusedwhentheP9ath<isoutputthesecondtime.Ȅ`GhDe neUUP9ath<functions@657i+ c}'onnectorffiterK=c}'onnectors1F:b}'egin(); if(c}'onnectors/4.:size\()>0)c}'onnectorffstringO=c}'onnectorffiterF++RO; else!c}'onnectorffstringlft="--"Mt;861.hDe neUUP9ath<functions@657i+ @@ -3119,30 +3156,30 @@ if(dashe}'d 6="" z)outffstr}'eam7" dashed ":zdashe}'d; if(p}'en˷6="" z)outffstr}'eam7" withpen "?wp}'en; outffstr}'eam<";\n" T ush;UUgg -elseif( llffdr}'awffvalueAs)UNDRAW"n)fif)(DEBUGY)c}'out O"Undrawing.\n"On ush;outffstr}'eamP"undraw "5T} p}'ointffiter7y++C@%;hOutputUUP9ath &864iif)(dashe}'d 6="" z)outffstr}'eam7" dashed ":zdashe}'d;if)(p}'en˷6="" z)outffstr}'eam7" withpen "?wp}'en;outffstr}'eamP";\n" T ush;gelse*.6if5.( llffdr}'awffvalueAs)UNFILL"n)fif)(DEBUGY)c}'out O"Unfilling.\n"On ush;outffstr}'eamP"unfill "5T} p}'ointffiter7y++C@%;hOutputUUP9ath &864ioutffstr}'eamP";\n" T ush;g n썫232OUTPUT=\03DLDFPRÎGx862n@P862. FilldrawUUcase.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.03.25.][ WChangedYqthissection,xsothattheoutlineoftheP9ath#DFisdrawn,ifdr}'awffcolor:h6=Colors!ޫ::(gb}'ackgroundffcolorrt.Ȅ` 8EndTLogA>`hDe neUUP9ath<functions@657i+ -elseif( llffdr}'awffvalueAs)UNFILLDRAW7b)fif)(DEBUGY)c}'out O"Unfilldrawing.\n"db ush;if)(dr}'awffcolor1QColors$::+.4b}'ackgroundffcolorur)f(outffstr}'eamZ"unfilldraw "JTq p}'ointffiter7y++C@%;(hOutputUUP9ath &864i(if3(dashe}'d 6="" z)outffstr}'eam7" dashed ":zdashe}'d;(if3(p}'en˷6="" z)outffstr}'eam7" withpen "?wp}'en;(outffstr}'eamZ";\n" T ush;gelse5f(outffstr}'eamZ"unfill "5T} p}'ointffiter7y++C@%;(hOutputUUP9ath &864i(outffstr}'eamZ";\n" T ush;(p}'ointffiterT=p}'oints뭱:b}'egin();(c}'onnectorffiteri=c}'onnectors1F:b}'egin();(if3(c}'onnectors/4.:size\()>0)c}'onnectorffstringO=c}'onnectorffiterF++RO;(else?c}'onnectorffstringfw="--"Mt;(outffstr}'eamZ"draw "*ԃ p}'ointffiter7y++C@%;(hOutputUUP9ath &864i(if3(dr}'awffcolor1Q6=Colors$::+.4defaultffc}'olorb)outffstr}'eam7" withcolor "JTqdr}'awffcolor6R;(if3(dashe}'d 6="" z)outffstr}'eam7" dashed ":zdashe}'d;(if3(p}'en˷6="" z)outffstr}'eam7" withpen "?wp}'en;(outffstr}'eamZ";\n" T ush;gg=EndUUofUNFILLDRAW;case.q[LDFT2003.03.25.]U$= n썷x8633DLDFPRÎG=\0OUTPUT233n@P863. DefaultUUcase.q[LDFT2003.03.25.]hDe neUUP9ath<functions@657i+ +elseif( llffdr}'awffvalueAs)UNDRAW"n)fif)(DEBUGY)c}'out O"Undrawing.\n"On ush;outffstr}'eamP"undraw "5T} p}'ointffiter7y++C@%;hOutputUUP9ath &864iif)(dashe}'d 6="" z)outffstr}'eam7" dashed ":zdashe}'d;if)(p}'en˷6="" z)outffstr}'eam7" withpen "?wp}'en;outffstr}'eamP";\n" T ush;gelse*.6if5.( llffdr}'awffvalueAs)UNFILL"n)fif)(DEBUGY)c}'out O"Unfilling.\n"On ush;outffstr}'eamP"unfill "5T} p}'ointffiter7y++C@%;hOutputUUP9ath &864ioutffstr}'eamP";\n" T ush;g dn썫234OUTPUT=\03DLDFPRÎGx862n@P862. FilldrawUUcase.9Ȅ`+U 8Log)j`+U +[LDFT2003.03.25.][ WChangedYqthissection,xsothattheoutlineoftheP9ath#DFisdrawn,ifdr}'awffcolor:h6=Colors!ޫ::(gb}'ackgroundffcolorrt.Ȅ`GhDe neUUP9ath<functions@657i+ +elseif( llffdr}'awffvalueAs)UNFILLDRAW7b)fif)(DEBUGY)c}'out O"Unfilldrawing.\n"db ush;if)(dr}'awffcolor1QColors$::+.4b}'ackgroundffcolorur)f(outffstr}'eamZ"unfilldraw "JTq p}'ointffiter7y++C@%;(hOutputUUP9ath &864i(if3(dashe}'d 6="" z)outffstr}'eam7" dashed ":zdashe}'d;(if3(p}'en˷6="" z)outffstr}'eam7" withpen "?wp}'en;(outffstr}'eamZ";\n" T ush;gelse5f(outffstr}'eamZ"unfill "5T} p}'ointffiter7y++C@%;(hOutputUUP9ath &864i(outffstr}'eamZ";\n" T ush;(p}'ointffiterT=p}'oints뭱:b}'egin();(c}'onnectorffiteri=c}'onnectors1F:b}'egin();(if3(c}'onnectors/4.:size\()>0)c}'onnectorffstringO=c}'onnectorffiterF++RO;(else?c}'onnectorffstringfw="--"Mt;(outffstr}'eamZ"draw "*ԃ p}'ointffiter7y++C@%;(hOutputUUP9ath &864i(if3(dr}'awffcolor1Q6=Colors$::+.4defaultffc}'olorb)outffstr}'eam7" withcolor "JTqdr}'awffcolor6R;(if3(dashe}'d 6="" z)outffstr}'eam7" dashed ":zdashe}'d;(if3(p}'en˷6="" z)outffstr}'eam7" withpen "?wp}'en;(outffstr}'eamZ";\n" T ush;gg=EndUUofUNFILLDRAW;case.q[LDFT2003.03.25.]U$= 5n썷x8633DLDFPRÎG=\0OUTPUT235n@P863. DefaultUUcase.q[LDFT2003.03.25.]hDe neUUP9ath<functions@657i+ else0=UseUUDRAWasdefault.q[LDFT2003.03.25.]U$= fc}'err):"WARNING! Invalid |fkill_draw_value|: "ͼj: llffdr}'awffvalueDb:". Using \"draw\"\n"o<( ush=;#if 0$=!!qDe neUUaclass5forinformationontherunstate.o=if(:RunffState-::4nonffstop[P)getchar&%();#endifif(arr}'ow'htrue)outffstr}'eam7"drawarrow "Et p}'ointffiter7y++C@%;else+outffstr}'eam]"draw "*ԃ p}'ointffiter7y++C@%;hOutputUUP9ath &864iif(dr}'awffcolor1Q6=Colors$::+.4defaultffc}'olorb)outffstr}'eam7" withcolor "JTqdr}'awffcolor6R;if(dashe}'d 6="" z)outffstr}'eam7" dashed ":zdashe}'d;if(p}'en˷6="" z)outffstr}'eam7" withpen "?wp}'en;outffstr}'eamF";\n" T ush; g if(DEBUGY)c}'out O"Exiting Path::outpukt(Focus)"TA"\n" ush; -return*f;qǷg n썫234OUTPUT=\03DLDFPRÎGx864n@P864. Whenv llffc}'olor,qandvdr}'awffcolor5Uarevdi erent,~ 8BeginTLogJʄ`> +return*f;qǷg n썫236OUTPUT=\03DLDFPRÎGx864n@P864. Whenv llffc}'olor,qandvdr}'awffcolor5Uarevdi erent,~`hOutputUUP9ath &864i +[LDFT2002.12.20.]XIhadtoaddpreproGcessorcodeforconditionalcompilation,#xbecause\ xe}'df"isunknowntontheGNUnC++֫Compiler.However,uitndoGesn'tneeditinthiscase,sincetheproblemonlyoGccurredwhenusingUUtheDECC++ucompileronaDECAlphacomputerunderCompaqT*ru64.Ȅ`GhOutputUUP9ath &864i if(DEBUGY)c}'out O"Entering Output |Pakth|.\n"G ush; for臫(unsigned07shortNc}'ounterr =2;p}'ointffiter16=p}'oints뭱:endಫ();)foutffstr}'eamF" "ԏc}'onnectorffstringMT" " p}'ointffiter7y++C@%;=ThisUUbreaksthelineandindentsaftertwopGoints=if(c}'ounter$X2 ^8p}'ointffiter/16=p}'oints뭱:endಫ())foutffstr}'eamP"\n ""n;c}'ounterB[=1;gelse+f++*G#c}'ounterL1c;gif(c}'onnectorffiterA6=c}'onnectors1F:endಫ())c}'onnectorffstringO=c}'onnectorffiterF++RO; g if(isffcycle!O())outffstr}'eam7" "ԏc}'onnectorffstringMT" cycle"-Mh; -if(DEBUGY)c}'out O"Exiting Output |Patkh|.\n"J ush; ThisXco 8BeginTLogJʄ`> +if(DEBUGY)c}'out O"Exiting Output |Patkh|.\n"J ush; ThisXco`hDeclareUUP9ath<functions@656i+ +[LDFT2003.08.20.]XNowprintingp}'oints t:size\()andc}'onnectors2 :size()tostdout.MIfthelatteris0,amessageisUUprinted,that"--"1willbGeusedastheconnector.Ȅ`GhDeclareUUP9ath<functions@656i+ v9oid#show:Oϫ(string!Dtext7V«="";c9harc}'oords;&='w'Y;const AbQool;doffp}'erspd=trueJ;const AbQooldoffapplyGd=true$;F -oQcus" )' *f0'=0;const *unsignedPbshortnWpr}'ojY=Projections=::Di.PERSP_/;const *realfactor;=1)UUconst*; n썷x8673DLDFPRÎGHFSHOW235n@P867.hDe neUUP9ath<functions@657i+ +oQcus" )' *f0'=0;const *unsignedPbshortnWpr}'ojY=Projections=::Di.PERSP_/;const *realfactor;=1)UUconst*; yn썷x8673DLDFPRÎGHFSHOW237n@P867.hDe neUUP9ath<functions@657i+ v9oid#P9ath=!W::show(string!ctext3/;c9harc}'oords7;const g`bQool:doffp}'ersp`D;const g`bQool:doffapply`;F oQcus27f<;constJunsignedP Xshortmpr}'ojʾ;constJreal6xfactorQV)UUconst fif(text"" z)text="Path:"( k;c}'out* Qtextendlګ;#if 0c}'out* Q"fill_draw_value == k"tTY llffdr}'awffvalueD:Aendl ush;#endifc}'oords2Ц=tolower#(c}'oords );if(c}'oordsФ'w' w);=DoUUnothing.o=else*.6if5.(c}'oordsФ'p' w)c}'out O"Projective coordinaktes.\n"G ush;else*.6if5.(c}'oordsФ'u' w)c}'out O"User coordinates.\nk"tTY ush;else*.6if5.(c}'oordsФ'v' w)c}'out O"View coordinates.\nk"tTY ush;else+fc}'err45"WARNING! In |show()l|: ""Invalid character flor coords argument.\n"ڷ2"Showing world coordinates.\n"+ ush;c}'oords<Ч='w' w;gv\ralarra9y=ZChreal]ٷiUUv;v4:r}'esizei(4;0);=LDFUU2002.12.13.qAddedthisline.NeededforpGortingtoIntelLinux(i686).o=string5%Oc}'onnectorffstring|˫;v9ector3Jhstringi::Bc}'onstffiteratorCc}'onnectorsffiterW=c}'onnectors1F:b}'egin();c}'out* Q"points.size() == "i_p}'oints뭱:size\()endl ush;c}'out* Q"connectors.size() =k= "~Sc}'onnectors1F:size\()endl ush;if(c}'onnectors/4.:size\()0)fc}'out4 R"Using \"--\" as conknector.\n"> ush;c}'onnectorffstringh="--"Mt;gfin9t/lo}'opffctrU4«=0;for0EY(v9ectorHhP9ointLm$Lni::Bc}'onstffiteratorCp}'ointsffiteru-n=ap}'oints]:b}'egin();\p}'ointsffiter7@6=ap}'oints:endಫ();<++HG&p}'ointsffitervѫ)f(if3(p}'ointsffiter1÷6=p}'oints뭱:b}'egin())f2c}'outH T" "ԏc}'onnectorffstringMT" " w;(g(if3(c}'onnectorsffiterE\6=c}'onnectors1F:endಫ())c}'onnectorffstringO=c}'onnectorsffiterJ]++Vf};(if3(lo}'opffctr%ȷ2)=BreakUUeachlineafter2P9oints#x٫.o=(f2c}'outH Tendlګ;2lo}'opffctrWͫ=0;(g(++4G$lo}'opffctrWԫ;(v/٫=( -p}'ointsffiter8H):getffallffc}'oords:(c}'oords ;doffp}'ersp'S;doffapply'};f;pr}'ojk;factor);(c}'out> S"("ԏvի[0]", "v[1]", "v[2]")" w;ggif(cycleffswitch5)fif)(c}'onnectorsffiterE\6=c}'onnectors1F:endಫ())c}'onnectorffstringO=c}'onnectorsffiterJ]++Vf};c}'out4 R" "ԏc}'onnectorffstringMT" cycle;"5T}endlګ; An썫236SHOÎWHF3DLDFPRGx867n@Pg else+c}'outA0";\n"q; +p}'ointsffiter8H):getffallffc}'oords:(c}'oords ;doffp}'ersp'S;doffapply'};f;pr}'ojk;factor);(c}'out> S"("ԏvի[0]", "v[1]", "v[2]")" w;ggif(cycleffswitch5)fif)(c}'onnectorsffiterE\6=c}'onnectors1F:endಫ())c}'onnectorffstringO=c}'onnectorsffiterJ]++Vf};c}'out4 R" "ԏc}'onnectorffstringMT" cycle;"5T}endlګ; un썫238SHOÎWHF3DLDFPRGx867n@Pg else+c}'outA0";\n"q; g868. Sho9wTColors.hDeclareUUP9ath<functions@656i+ v9oid"showffc}'olorsV!(bQoolfstop// =falsev\);869.hDe neUUP9ath<functions@657i+ v9oid"P9athIfitdoGes,H isffplanar+n()returnstrue R,H otherwise,itDreturnsfalse.IfDthisisUUlinear,isffplanar+{()issuesawarningandreturnstrue.c9Ȅ`> 8BeginTLogJʄ`> +g872. IsTplanar.[LDFT2002.11.05.]Z6isffplanarū()UUusesthereturnvqalueofgetffnormal3ɫ()todeterminewhetherDDthisu+liesDinaplaneornot.l>IfitdoGes,H isffplanar+n()returnstrue R,H otherwise,itDreturnsfalse.IfDthisisUUlinear,isffplanar+{()issuesawarningandreturnstrue.N99Ȅ`+U 8Log)j`+U [LDFT2002.11.03.]Y;RewroteUUthisfunction.qItshouldnowworkforallP9aths o. [LDFT2002.11.05.]Y;RewroteUUthisfunctionagain.qItnowusesthenewversionofgetffnormal3ɫ(). [LDFT2002.11.06.]YCvAddedoptionalconst!mbQool;verb}'ose_andstring$text9targumentsforwritingamessagetoUUthestandardoutput. -[LDFT2003.08.14.]Y;MadeUUverb}'ose'<non-constM.qSettingUUittotrueoBifVERBOSE_GLOBALPistrue.AddedUUVERBOSE_GLOBALPtoUUpspglb.webtoGday*.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -virtual/bQoolI/:isffplanarqUɫ(bQoolfverb}'ose<۫=falsev\;string"text6٫="" z)UUconst*; n썷x8733DLDFPRÎG3TISXPLANAR237n@P873.hDe neUUP9ath<functions@657i+ +[LDFT2003.08.14.]Y;MadeUUverb}'ose'<non-constM.qSettingUUittotrueoBifVERBOSE_GLOBALPistrue.AddedUUVERBOSE_GLOBALPtoUUpspglb.webtoGday*.Ȅ`GhDeclareUUP9ath<functions@656i+ +virtual/bQoolI/:isffplanarqUɫ(bQoolfverb}'ose<۫=falsev\;string"text6٫="" z)UUconst*; <n썷x8733DLDFPRÎG3TISXPLANAR239n@P873.hDe neUUP9ath<functions@657i+ bQool#gP9ath=2ϫ::isffplanar)&(bQoolfverb}'ose:2ñ;string"text4')UUconst fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(VERBOSE_GLOBALJ>)verb}'ose(Xu=true;if(DEBUG9_8verb}'ose"=)c}'out O"Entering Path::is_pklanar().\n" #;P9oint2p7(getffnormal0t());if(pINVALID_POINTGY)fif)(DEBUGY)c}'out O"Exiting Path::is_plkanar(). Returning faƠlse.\n\n"T ush;if)(verb}'ose ])f(if3(text"" z)text="Path""n;(c}'out> Stext" is non-planar.\n\nk"qA;greturnAfalseV;gelse*.6if5.(porigin9)fc}'err3|"WARNING! In Path::iks_planar():\n"2"Path is linear. Rekturning true.\n\n"͔&2 ushG;if)(verb}'ose ])f(if3(text"" z)text="Path""n;(c}'out> Stext" is planar.\n\n"\M;greturnAtrueTU;gelse+fif)(verb}'ose ])f(if3(text"" z)text="Path""n;(c}'out> Stext" is planar.\n\n"\M;gif)(DEBUGY)c}'out O"Exiting Path::is_plkanar(). Returning trƠue.\n\n" ush;returnAtrueTU;g -g874. Islinear.[LDFT2003.04.09.]Zisffline}'ar()y3 rstchecksy3whetherlineffswitch6'istrue=˫.aIfitis,+itreturnstrueright<)away*.icOtherwise,A2itusesthereturnvqalueofgetffnormal3Ɲ()todeterminewhether<*thisd islinearornot.qIfUUitis,isffline}'ar(jҫ()returnstrue,otherwise,itreturnsfalse.c9Ȅ`> 8BeginTLogJʄ`> +g874. Islinear.[LDFT2003.04.09.]Zisffline}'ar()y3 rstchecksy3whetherlineffswitch6'istrue=˫.aIfitis,+itreturnstrueright<)away*.icOtherwise,A2itusesthereturnvqalueofgetffnormal3Ɲ()todeterminewhether<*thisd islinearornot.qIfUUitis,isffline}'ar(jҫ()returnstrue,otherwise,itreturnsfalse.N99Ȅ`+U 8Log)j`+U [LDFT2002.11.05.]Y;AddedUUthisfunction. [LDFT2002.11.06.]YCvAddedoptionalconst!mbQool;verb}'ose_andstring$text9targumentsforwritingamessagetoUUthestandardoutput. [LDFT2003.04.09.]YNowKcheckingwhetherlineffswitch8:istrue\|bGeforecallinggetffnormal4f().U!!IfaP9athwhoselineffswitch9+trueMgismoGdi edsuchthatit'snolongerlinear,$theprogrammermustensurethatlineffswitch2isUUsettofalse! -[LDFT2003.08.14.]Y;MadeUUverb}'ose'<non-constM.qSettingUUittotrueoBifVERBOSE_GLOBALPistrue.AddedUUVERBOSE_GLOBALPtoUUpspglb.webtoGday*.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -bQool#gisffline}'arH(bQoolfverb}'ose<۫=falsev\;string"text6٫="" z)UUconst*; n썫238ISXLINEAR73DLDFPRÎGx875n@P875.hDe neUUP9ath<functions@657i+ +[LDFT2003.08.14.]Y;MadeUUverb}'ose'<non-constM.qSettingUUittotrueoBifVERBOSE_GLOBALPistrue.AddedUUVERBOSE_GLOBALPtoUUpspglb.webtoGday*.Ȅ`GhDeclareUUP9ath<functions@656i+ +bQool#gisffline}'arH(bQoolfverb}'ose<۫=falsev\;string"text6٫="" z)UUconst*; n썫240ISXLINEAR73DLDFPRÎGx875n@P875.hDe neUUP9ath<functions@657i+ bQool#gP9ath=2ϫ::isffline}'ar&(bQoolfverb}'ose:2ñ;string"text4')UUconst fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(VERBOSE_GLOBALJ>)verb}'ose(Xu=true;if(DEBUG9_8verb}'ose"=)c}'out O"Entering Path::is_lkinear().\n" #;if(lineffswitch/)=LDFUU2003.04.09.qAddedthisconditional.o=returnAtrueTU;P9oint2p7(getffnormal0t());if(porigin9)fif)(verb}'ose ])f(if3(text"" z)text="Path""n;(c}'out> Stext" is linear.\n\n"\M;gif)(DEBUGY)c}'out O"Exiting Path::is_liknear(). "TA"Returning true.\n\nk"tTY ush;returnAtrueTU;gelse+fif)(verb}'ose ])f(if3(text"" z)text="Path""n;(c}'out> Stext" is non-linear.\n\nk"qA;gif)(DEBUGY)c}'out O"Exiting Path::is_liknear(). "TA"Returning false.\n\kn"yV ush;returnAfalseV;g g876. Get$lineswitc9h.[LDFT2002.11.03.]ZThis9functionreturnstrue -forP9aths$OthatarecreatedorsetusingUUtwoP9oints&.only*,andnoconnectors,asarguments.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.11.03.]XIRenamedthisfunctiongetfflineffswitchBm()fromisfflineS().2\AbGouttoaddisffline}'ar'(),!whichwillUUtestwhetheralltheP9oints&.arecolinearornot.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +forP9aths$OthatarecreatedorsetusingUUtwoP9oints&.only*,andnoconnectors,asarguments.9Ȅ`+U 8Log)j`+U +[LDFT2002.11.03.]XIRenamedthisfunctiongetfflineffswitchBm()fromisfflineS().2\AbGouttoaddisffline}'ar'(),!whichwillUUtestwhetheralltheP9oints&.arecolinearornot.Ȅ`GhDeclareUUP9ath<functions@656i+ inline)IbQoolC+getfflineffswitch,()UUconst freturn7lineffswitchg}; g877. T estTforcycles.hDeclareUUP9ath<functions@656i+ inline)IbQoolC+isffcycledzǫ()UUconst freturn7cycleffswitchlV; -g878. SizeT(n9umbQerofpoin9ts).hDeclareUUP9ath<functions@656i+ ,n썷x8783DLDFPRÎG}PSIZEX(NUMBEROFPOINTS)239n@P +g878. SizeT(n9umbQerofpoin9ts).hDeclareUUP9ath<functions@656i+ +n썷x8783DLDFPRÎG}PSIZEX(NUMBEROFPOINTS)241n@P inline)Iin9t;/@sizeLJ() freturn7p}'ointsS Q:size\(); -g879. SlopQe.[LDFT2002.11.05.]\Oslop}'er()canonlybGeusedforlinearP9aths"7. ȃItreturnsarealvqaluerepresentingtheslopGeofthetr}'aceClofalineonthema8jorplanerepresentedbythec9hararguments,orINVALID_REAL?D,B*if=`theP9ath $isnon-linear.iF*orexample,ifȍGg!N8p0|sp1isaP9ath $p'QandȍM!N8q0|sq1aHisthetraceofp onthex-y.plane,$thenp.:slop}'e7˫('x'F_;'y')returnsareal05msuchthatm=(bpy[٫)=x.wherebisthey-interceptofȍ!N8q0|sq1;ݫandUUxandy.arethexandy-coGordinatesofpointsonȍe !N8q0|sq1;ݫ.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.11.05.]X؃Changed%thisfunction,/(sothatisffline}'ar(;()isusedinsteadofgetfflineffswitchB()(formerly\isffline?()").qNow,U)itUcanbGeusedforalllinearP9aths o,notjustonescreatedusingtheconstructorforlines.Also,UUitwascommented-out.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ +g879. SlopQe.[LDFT2002.11.05.]\Oslop}'er()canonlybGeusedforlinearP9aths"7. ȃItreturnsarealvqaluerepresentingtheslopGeofthetr}'aceClofalineonthema8jorplanerepresentedbythec9hararguments,orINVALID_REAL?D,B*if=`theP9ath $isnon-linear.iF*orexample,ifȍGg!N8p0|sp1isaP9ath $p'QandȍM!N8q0|sq1aHisthetraceofp onthex-y.plane,$thenp.:slop}'e7˫('x'F_;'y')returnsareal05msuchthatm=(bpy[٫)=x.wherebisthey-interceptofȍ!N8q0|sq1;ݫandUUxandy.arethexandy-coGordinatesofpointsonȍe !N8q0|sq1;ݫ.9Ȅ`+U 8Log)j`+U +[LDFT2002.11.05.]X؃Changed%thisfunction,/(sothatisffline}'ar(;()isusedinsteadofgetfflineffswitchB()(formerly\isffline?()").qNow,U)itUcanbGeusedforalllinearP9aths o,notjustonescreatedusingtheconstructorforlines.Also,UUitwascommented-out.Ȅ`GhDeclareUUP9ath<functions@656i+ real /slop}'e6(c9harjIa!z='x' w;c9harb"&='y');880.hDe neUUP9ath<functions@657i+ real /P9ath:D::slop}'e7ϫ(c9harjIay;c9harb_) fif(:isffline}'ar%}())fc}'err7_J"ERROR! In Path::sloo_pe(). Path is not li^near!\n" Dl2"Returning INVALID_REAL\n"7 ush;returnAINVALID_REALm;greturn7p}'ointsS Q[1]~slop}'e7̫(p}'oints $[0];a;bR); g881. Subpath.[LDFT2002.11.05.]Z6subp}'ath|()UUreturnsanewP9ath<usingp}'ointsy[startM]throughp}'oints$[end1]fromthis ._HIftheoptionalbQoolargumentcycleisused,(thenthenewP9athwillbGeacycle,whether'(thisis'ornot.TbOneoptionalconnectorargumentcanbGeused.Ifitis,itwillbGetheonlyconnector.Otherwise,UUtheconnectorsfromUVthisaareused. -[LDFT2002.11.05.]Y;startqݫmustUUbGeUUend6,UUevenifUVthisaisacycle.c9Ȅ`> 8BeginTLogJʄ`> +[LDFT2002.11.05.]Y;startqݫmustUUbGeUUend6,UUevenifUVthisaisacycle.N99Ȅ`+U 8Log)j`+U [LDFT2002.11.05.]YRewrote !thisfunction.,Madesubp}'ath%()itselfanditsargumentsconstn.AddederrorhandlingUUcoGde. [LDFT2003.07.16.]Y;PleaseUUnotethatstart/andend\cannotbGemadeconst*. [LDFT2003.08.27.]YEChangedin9ttiytosizeus4wt#"i*'7inthefor{loGopsthatcomparei ->tostartandendsW.)ThewayitUUwasbGeforecausedGCCwiththe\-Wall"optiontoissueawarning.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -P9ath%subp}'athG`O(sizeus4wtQstart4);sizeus4wt end16;const}bQool9ucycleRc=falsev\;const}string@c}'onnectoro="" z)Tconst)ի; Dn썫240SUBPJATH:k3DLDFPRÎGx882n@P882.hDe neUUP9ath<functions@657i+ +>tostartandendsW.)ThewayitUUwasbGeforecausedGCCwiththe\-Wall"optiontoissueawarning.Ȅ`GhDeclareUUP9ath<functions@656i+ +P9ath%subp}'athG`O(sizeus4wtQstart4);sizeus4wt end16;const}bQool9ucycleRc=falsev\;const}string@c}'onnectoro="" z)Tconst)ի; n썫242SUBPJATH:k3DLDFPRÎGx882n@P882.hDe neUUP9ath<functions@657i+ P9ath%6P9ath?`::subp}'ath"zf(sizeus4wt;%start4r;sizeus4wt end1;constbQool9GcycleOݱ;conststring@ˏc}'onnectorl*i)=constf=bQool2DEBUGOv=falsev\;=trueĒ=P9ath9漱p>;883. [LDFT2002.11.05.][Theree!isno\INVALID_PATH?D",soIdreturnanemptyone,ifstartvendlǫ.+SinceopQerator+3]ӫ()=currentlydoGesn'texist,wthere'snotmuchpGointinde ningINVALID_PATHC,wsincethere'snowayUUtocompareanotherP9ath<toit.hDe neUUP9ath<functions@657i+ if(startLeendʫ)fc}'err*'cq"ERROR! In Path::sublqpath():\n"鄷q"The \"start\" argumlqent is < the \"end\"qC\( argument.\n"o]"Returning empty Patkh.\n\n"G ush;return7漱p<; g884. [LDFT2002.11.05.]Z6MoreUUerrorhandling.qInthesecases,it'spGossibletorecover.hDe neUUP9ath<functions@657i+ @@ -3199,7 +3237,7 @@ if(endʱ>p}'oints뭱:size\())fc}'err);J"ERROR! In Path::subl;path():\n"|;J"\"end\" argument isl; > points.size().\n"("Will try to recover by setting end = points.size().\n\n"Vٷ ush;end'̫=p}'oints뭱:size\(); g885. [LDFT2002.11.05.]YIfx4ac}'onnector0OBargumentisspGeci ed,nallwehavetodoisputtheappropriateP9ointsfromUUp}'oints!?ontoUUp]U:p}'oints$,UUputc}'onnector2 ontop]U:c}'onnectors/4.,andreturnp.hDe neUUP9ath<functions@657i+ if(c}'onnector.%6="" z)ffor%舫(sizeus4wtRi%=startLe;i 9 <endʫ;i++)fif)(i9 p}'oints뭱:size\())f(c}'err>Y"ERROR! In Path::sublpath():\n"M̷"end argument > poinlts.size().\n" ÷<"Breaking out of loop.\n\n" 5 ush;(breakDh;gp#:p}'oints$:pushffb}'ack+XR(P9ointL::#(cr}'eateffnewffp}'ointk(p}'oints[iq]));gp:c}'onnectors/4.:pushffb}'ack+XR(c}'onnector+^ګ);p:setffcycle&*(cycley5);return7漱p<; -g n썷x8863DLDFPRÎG:kSUBPJATH241n@P886. [LDFT2002.11.05.]ZNTIfsnoc}'onnector1argumentisspGeci ed,'thenwehavetogettheappropriateconnec- tors Pfrom Qthis.YpThisisslightlytricky*,bGecausec}'onnectors5LΫdoesn'thave Ptocontainac}'onnector1wzforeachpairoffjP9oints&XthatfjisjoinedinaP9athΫ.So,j rstwemust lluppnj:c}'onnectors2sothatwecantellwhichonestouse. +g n썷x8863DLDFPRÎG:kSUBPJATH243n@P886. [LDFT2002.11.05.]ZNTIfsnoc}'onnector1argumentisspGeci ed,'thenwehavetogettheappropriateconnec- tors Pfrom Qthis.YpThisisslightlytricky*,bGecausec}'onnectors5LΫdoesn'thave Ptocontainac}'onnector1wzforeachpairoffjP9oints&XthatfjisjoinedinaP9athΫ.So,j rstwemust lluppnj:c}'onnectors2sothatwecantellwhichonestouse. [LDFT2002.11.05.]YEActually*,-withtheconstructorsthatexist,therewilleitherbGeonlyoneconnectororaconnector0$foreachpairofP9oints&̫thatneedtobGejoined.eaHowever,7itwouldbGeeasytowritefunctionsthataddUUorremoveUUconnectors,soit'sbGesttohaveUUthisroutine.hDe neUUP9ath<functions@657i+ p=thisϫ; unsigned:7shortXa`=p}'oints뭱:size\(); @@ -3213,22 +3251,29 @@ for臫(sizeus4wtRi%=startLe;i 9 <endʫ;i++)fqҬ:p}'oints$:pushffb}'ack+XR(P9ointL::#(cr}'eateffnewffp}'ointk(p:p}'oints[iq]));if(i9 <p:c}'onnectors/4.:size\())q Ҫ:c}'onnectors:pushffb}'ack+XR(p:c}'onnectors[iq]); g qҫ:setffcycle&*(cycley5); -return-滱q2e;qǷg887. Get;pQoin9t.[LDFT2002.11.05.]\hNotekthatapplyfftr}'ansformKf()isnotcalledonthePoint&qVthat'sreturned.qIfUUitwas,getffp}'oint*()couldn'tbGeconst*.c9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.11.05.]Y;MadeUUnon-inline4.qChangedreturnvqaluetoconst!P9oint@o&H6.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -const(*P9ointG@&N^getffp}'ointvC(const*unsignedNashortl,Saqu)UUconst*; n썫242GETXPOINT1b03DLDFPRÎGx888n@P888.hDe neUUP9ath<functions@657i+ -const(*P9ointG@&N^P9athhrƫ::getffp}'oint(bL(const*unsignedNashortl,Saqu)UUconst -fif(aH<p}'oints뭱:size\())return(溷-p}'ointsI P[aI0];else+fc}'err4w0"ERROR! In Path::getlK_point():\n" "Argument is >= sizelK of Path.\n"2"Returning INVALID_POINT.\n\n"+ ush;returnAINVALID_POINT;g -g889. GetTlastpQoin9t.U9Ȅ`> 8BeginTLogJʄ`> +return-滱q2e;qǷg887. GetTpQoin9t.888. non-constTv9ersion.9Ȅ`+U 8Log)j`+U +[LDFT2002.11.05.]Y;MadeUUnon-inline4.qChangedreturnvqaluetoconst!P9oint@o&H6. +[LDFT2003.11.28.]Y{BUGpFIX:Changed, sothatapplyfftr}'ansformJt()iscalledontheP9ointݫ."Thisentailedmakingthisfunctionnon-constM.Addedconst"`ӫversionbGelow.ThismayactuallybGeabug,ratherthanabugs x,mdepGendingonhowthisfunctionisusedelsewhere.U|However,mI]reallythinkapplyfftr}'ansformI R()shouldbGeUUcalled.Ȅ`GhDeclareUUP9ath<functions@656i+ +const(*P9ointG@&N^getffp}'ointvC(const*unsignedNashortl,Saqu); +\n썫244NON-CONSTXVERSIONA3DLDFPRÎGx889n@P889.hDe neUUP9ath<functions@657i+ +const(*P9ointG@&N^P9athhrƫ::getffp}'oint(bL(const*unsignedNashortl,Saqu) +fif(aH<p}'oints뭱:size\())f(p}'oints$[aI0])~applyfftr}'ansformJ();returnA潷Fp}'ointsb S[aI0];gelse+fc}'err4w0"ERROR! In Path::getlK_point():\n" "Argument is >= sizelK of Path.\n"2"Returning INVALID_POINT.\n\n"+ ush;returnAINVALID_POINT;g +g890. constTv9ersion.9Ȅ`+U 8Log)j`+U +[LDFT2003.11.28.]Y;AddedUUthisversion.Ȅ`GhDeclareUUP9ath<functions@656i+ +P9oint(getffp}'ointPQ(const*unsignedNashortl,Saqu)UUconst*;891.hDe neUUP9ath<functions@657i+ +P9oint(P9athB::getffp}'oint(bL(const*unsignedNashortl,Saqu)UUconst +fif(aH<p}'oints뭱:size\())fP9oint<pD=(p}'oints$[aI0]);p#:applyfftr}'ansformF߫();returnA潱pF;gelse+fc}'err4w0"ERROR! In Path::getlK_point():\n" "Argument is >= sizelK of Path.\n"2"Returning INVALID_POINT.\n\n"+ ush;returnAINVALID_POINT;g +g892. GetTlastpQoin9t.9Ȅ`+U 8Log)j`+U [LDFT2002.05.10.]Y;AddedUUthisfunction. -[LDFT2002.11.05.]Y;MadeUUnon-inline4.qChangedreturnvqaluetoconst!P9oint@o&H6.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -const(*P9ointG@&N^getfflastffp}'oint()UUconst*;890.hDe neUUP9ath<functions@657i+ +[LDFT2002.11.05.]Y;MadeUUnon-inline4.qChangedreturnvqaluetoconst!P9oint@o&H6.Ȅ`GhDeclareUUP9ath<functions@656i+ +const(*P9ointG@&N^getfflastffp}'oint()UUconst*; ܠn썷x8933DLDFPRÎGGETXLASTPOINT245n@P893.hDe neUUP9ath<functions@657i+ const(*P9ointG@&N^P9athhrƫ::getfflastffp}'oint;$B()UUconst fif(p}'oints$:size\()6=0)return(溷-p}'ointsI P[p}'oints:size\()818];else+fc}'err54"ERROR! In Path::getmO_last_point():\n"̗"Path is empty.\n"hH2"Returning INVALID_POINT.\n\n"+ ush;returnAINVALID_POINT;g -g891. GetTsize.hDeclareUUP9ath<functions@656i+ +g894. GetTsize.hDeclareUUP9ath<functions@656i+ virtual/inlineOsizeus4wtnjgetffsizeݫ()UUconst freturn7p}'ointsS Q:size\(); -g892. GetTnormal. n썷x8933DLDFPRÎG!1P -ATHXVERSION243n@P893. P9athversion.[LDFT2002.11.05.]YgetffnormalPO()returnsaunitvectorrepresentingthenormaltothe planef +g895. GetTnormal. !n썫246P +ATHXVERSION!13DLDFPRÎGx896n@P896. P9athversion.[LDFT2002.11.05.]YgetffnormalPO()returnsaunitvectorrepresentingthenormaltothe planef oftheP9ath]x$]ythis5I/,j8iff this˫isplanar.IftheP9oints&onf thisarecolinearandtherearenoconnectorsthatpcouldmaketheP9athDnon-linear,6thenorigin"'((0;0;0))pisreturned.;IftheP9athisneitherplanarnorlinear,UUgetffnormal3ɫ()UUreturnsINVALID_POINTH. [LDFT2002.11.05.] getffnormal:u()> rstchecks>whetheraP9ath containsnoP9oints(ZoronlyoneP9oint.ÂIfso,Lgetffnormal4,() @@ -3247,17 +3292,17 @@ allbx,thentheP9athw`isplanar,andgetffnormal3}r()returnsb0oq(seeexplanationofsignbGelow).QOtherwise, theUUP9ath<isUUnon-planar,andgetffnormal3ɫ()returnsINVALID_POINTH. [LDFT2003.06.04.]XPReversingthesignofb0&ensuresthatthenormalwillpGointinthedirectionofthepGositivey-axis,ςwhen aplane gureiscreatedinthex-zplane,usingoneoftheconstructorstakingaP9oint bargumentforthecenter,vreal argumentsforthedimensions,vandthreerealUargumentsfortherotationabGoutthema8joraxes.iIfnon-zeroargumentsareusedforrotation,' -thenormalwillbGerotatedaccordingly*.Thisdirectionconsidered%jtobGe\outside".aIn3DLDF,theconstructorsgenerallygenerateP9oints&nXmovingaboutthe gurein[9thecounter-cloGckwise[9direction(asseenfromaP9oint"Pwithapositivey-coordinate).rHowever,\accordingto$HuwJones,.KComputergGr}'aphicsThroughKeyMathematics,.Kp.$197,\outside"isconsideredtobGethesideoftaplane,;wheretheP9oints%laremeanttobGetraversedinthecloGckwisedirection.E'!!W*atchtoutforproblemsthatUUmayarisefromthisdiscrepancy!U9Ȅ`> 8BeginTLogJʄ`> +thenormalwillbGerotatedaccordingly*.Thisdirectionconsidered%jtobGe\outside".aIn3DLDF,theconstructorsgenerallygenerateP9oints&nXmovingaboutthe gurein[9thecounter-cloGckwise[9direction(asseenfromaP9oint"Pwithapositivey-coordinate).rHowever,\accordingto$HuwJones,.KComputergGr}'aphicsThroughKeyMathematics,.Kp.$197,\outside"isconsideredtobGethesideoftaplane,;wheretheP9oints%laremeanttobGetraversedinthecloGckwisedirection.E'!!W*atchtoutforproblemsthatUUmayarisefromthisdiscrepancy!9Ȅ`+U 8Log)j`+U [LDFT2002.11.05.]Y;RewroteUUthisfunction. -[LDFT2003.06.04.]Y75ChangedOsignofthenormal, whenit'sreturned,inthecaseswhereapropGernormalisfoundUU(notINVALID_POINTKpororiginKv).qSeeexplanationabGove.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -virtual/P9ointN}qgetffnormal()UUconst*;894.hDe neUUP9ath<functions@657i+ -P9oint(P9athB::getffnormal1x()UUconst*fUUbQoolDEBUG:,=falsev\;=trueĒ=if)(DEBUGY)c}'out O"Entering Path::get_knormal().\n"8 ush;if)(p}'oints$:size\()0)f(c}'errBMݣ"WARNING! In Path::gpget_normal():\n"E<"Path is empty or contains only one Poin t. "&M"Returning INVALID_PkOINT.\n\n">< ushQ;(returnKINVALID_POINT;g (}n썫244P -ATHXVERSION!13DLDFPRÎGx895n@P895. [LDFT2002.11.05.]ZWConnectorskvotherthantheonesintheconditionalbGelowcouldcausetheP9athhPto bGeUUnon-linearornon-planar,eveniftheP9oints&.lieonalineorinaplane.hDe neUUP9ath<functions@657i+ +[LDFT2003.06.04.]Y75ChangedOsignofthenormal, whenit'sreturned,inthecaseswhereapropGernormalisfoundUU(notINVALID_POINTKpororiginKv).qSeeexplanationabGove.Ȅ`GhDeclareUUP9ath<functions@656i+ +virtual/P9ointN}qgetffnormal()UUconst*;897.hDe neUUP9ath<functions@657i+ +P9oint(P9athB::getffnormal1x()UUconst*fUUbQoolDEBUG:,=falsev\;=trueĒ=if)(DEBUGY)c}'out O"Entering Path::get_knormal().\n"8 ush;if)(p}'oints$:size\()0)f(c}'errBMݣ"WARNING! In Path::gpget_normal():\n"E<"Path is empty or contains only one Poin t. "&M"Returning INVALID_PkOINT.\n\n">< ushQ;(returnKINVALID_POINT;g &n썷x8983DLDFPRÎG!1P +ATHXVERSION247n@P898. [LDFT2002.11.05.]ZWConnectorskvotherthantheonesintheconditionalbGelowcouldcausetheP9athhPto bGeUUnon-linearornon-planar,eveniftheP9oints&.lieonalineorinaplane.hDe neUUP9ath<functions@657i+ for臫(v9ectorHhstringi::Bc}'onstffiteratorCiterW=c}'onnectors1F:b}'egin();iter6=c}'onnectors:endಫ();++Giter")fif(:(iter".."T_88iter"--"_88iter"..."Q_88iter"---"q))fc}'err3|"WARNING! In Path::gket_normal():\n"/"Connector may make kPath non-linear or nƠ\2on-planar: "tMaiterY/endl"Returning INVALID_PkOINT.\n\n"> ush;returnAINVALID_POINT;g -g896. [LDFT2002.11.05.]Z6TwoUUpGointsdeterminealine.hDe neUUP9ath<functions@657i+ +g899. [LDFT2002.11.05.]Z6TwoUUpGointsdeterminealine.hDe neUUP9ath<functions@657i+ if(p}'oints$:size\()2)fc}'err/`"WARNING! In Path::gq`et_normal():\n"շ("Path has 2 Points. Returning origin.\n\n"  ush;return7originRݫ; -g >n썷x8973DLDFPRÎG!1P -ATHXVERSION245n@P897.hDe neUUP9ath<functions@657i+ +g ;n썫248P +ATHXVERSION!13DLDFPRÎGx900n@P900.hDe neUUP9ath<functions@657i+ v9ector)IhP9oint#i::Bc}'onstffiteratorCiterW=p}'oints뭱:b}'egin(); P9oint(p05^( iterK++' ); @@ -3282,25 +3327,25 @@ 6b0"))fif)(DEBUGY)(c}'out> S"Exiting Path::get_nkormal(). ">"Returning INVALID_PkOINT.\n\n" ush;returnAINVALID_POINT;g g if(DEBUGY)c}'out O"Exiting Path::get_nkormal(). ">"Returning normal.\nk\n"~S ush; -return-滷5b0AA;UUg EBn썫246POINTXVERSIONP3DLDFPRÎGx898n@P898. P9oint version.Point(H::getffnormal1x()isdeclaredpoints.web,ibutitmustbGede nedhere,bGecause itUUcallsP9ath潫::getffnormal1x().q[LDFT2003.07.11.]c9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.07.11.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDe neUUP9oint"Dfunctions@285i+ +return-滷5b0AA;UUg Bn썷x9013DLDFPRÎGPPOINTXVERSION249n@P901. P9oint version.Point(H::getffnormal1x()isdeclaredpoints.web,ibutitmustbGede nedhere,bGecause itUUcallsP9ath潫::getffnormal1x().q[LDFT2003.07.11.]N99Ȅ`+U 8Log)j`+U +[LDFT2003.07.11.]Y;AddedUUthisfunction.Ȅ`GhDe neUUP9oint"Dfunctions@285i+ P9oint(P9ointE::getffnormal1x(const*P9oint=?&D]pI];constJP9oint>&FqK^)UUconst fP9ath/滱r4ϫ;r:setffc}'onnectors>("--"\);r.+=-悷2thisC9;r.+=-悱p2;r.+=-悱q2,;if(:r:isffplanar(&())fc}'err8fA"ERROR! In Point::geqAt_normal():\n"É|2"The Points do not determine a plane.\n"M "Returning INVALID_PkOINT.\n\n"> ush;returnAINVALID_POINT;gelse+returnOrT:getffnormal0t(); -g899. GetTplane.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.11.05.]Y;RewroteUUthisfunctiontocorrespGondtothenewde nitionofgetffnormal3ɫ().Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -virtual/PlaneOČgetffplanex;t()UUconst*; Rzn썷x9003DLDFPRÎG/4GETXPLANE247n@P900.hDe neUUP9ath<functions@657i+ +g902. GetTplane.9Ȅ`+U 8Log)j`+U +[LDFT2002.11.05.]Y;RewroteUUthisfunctiontocorrespGondtothenewde nitionofgetffnormal3ɫ().Ȅ`GhDeclareUUP9ath<functions@656i+ +virtual/PlaneOČgetffplanex;t()UUconst*; OҠn썫250GETXPLANE/43DLDFPRÎGx903n@P903.hDe neUUP9ath<functions@657i+ Plane*6P9athC!::getffplane)v()UUconst fP9oint2normalSFW(getffnormal0t());if(normal#зINVALID_POINTI9_8normal%Vorigin9)fc}'err8fA"WARNING! In Path::gqAet_plane().\n"É|2"Path is not a Plane. Returning INVALID_PLANE.\n\n"A  ush;returnAINVALID_PLANE;gP9oint2p}'ointJ+(getffp}'oint'bH(0));return7PlaneT(p}'oint.;normal"`); -g901. P9ointԆlieswithintriangle.[LDFT2003.06.11.][fDeclared3>inpoints.web. MustbGede nedhere,bGecauseUUP9ath<isUUanincompletelyde nedtypethere.U9Ȅ`> 8BeginTLogJʄ`> +g904. P9ointԆlieswithintriangle.[LDFT2003.06.11.][fDeclared3>inpoints.web. MustbGede nedhere,bGecauseUUP9ath<isUUanincompletelyde nedtypethere.9Ȅ`+U 8Log)j`+U [LDFT2003.06.11.]Y;AddedUUthisfunction. [LDFT2003.06.24.]Y;RemovedUUtheargumenttestffp}'oints1}J.qNow,planarityisalwaystested. [LDFT2003.06.24.]Y;BUGUUFIX:WhentheP9oints&.alllayinthex-zplane,oraplaneparalleltoit,lamb}'daffdenominator^+wasq0.SThiscausedisffinfftriangle>%()toreturnfalse ȫ,evenwhen qthisοdidlieinthetriangle. :Now,uifClamb}'daffdenominatoreorCmuffdenominatorThMisCequalto0,theyandz-coGordinatesareexchanged,,and"lamb}'daffdenominator`and"muffdenominatorP'are"recalculated.`Ifeitherofthenewvqaluesis0,theCxandz-coGordinatesareexchanged(basedontheoriginalcoordinatevqalues),andlamb}'daffdenominatorand4muffdenominatorPK]are4againrecalculated.fOnlyoneexchangehasbGeenneededinthecasesI'vetestedsofar. -[LDFT2003.08.14.]Y;SettingUUverb}'ose'<toUUtrueoBifUUVERBOSE_GLOBALPisUUtrue.qAddedUUVERBOSE_GLOBALtopspglb.webUUtoGday*.Ȅ` 8EndTLogA>`hDe neUUP9oint"Dfunctions@285i+ -bQool#P9oint@::isffinfftriangle:(constrP9oint=&Eqp0Q;const P9oint?Ua&Gp1S3?;const P9oint?Ua&Gp2;bQoolKverb}'ose<%)2constLRfUUbQoolDEBUG:,=falsev\;=trueĒ=if)(VERBOSE_GLOBALJ>)verb}'ose(Xu=true;P9ath9漱q>f;q%ū+=7p0D٫;q%ū+=7p1D٫;q%ū+=7p2D٫;Plane>6qffplR{=q:getffplane(v();if)(qffplDͷINVALID_PLANEGY)f(if3(verb}'ose ])f2c}'errK]"WARNING! In Point::ovis_in_triangle():\n"eTF"The Point arguments do not determine a plane.\n"J"Returning false.\n\kn"yVF ush[;(g(returnKfalse`;gelse4.7if?/(:isffonffplane1ګ(qffpl}))f(if3(verb}'ose ])f Z$n썫248POINTXLIESWITHINTRIANGLE 3DLDFPRÎGx901n@P2c}'errK]"WARNING! In Point::ovis_in_triangle():\n"eT F"*this doesn't lie in the plane determined "1 /D"by the arguments.\nl"uұF"Returning false.\n\n"E ush;(g(returnKfalse`;gP9oint<t@(this뷫);P9oint<cAC{(p0 );P9oint<dB$(p1 );P9oint<eA(p2 );t!u:applyfftr}'ansformF߫();c"S:applyfftr}'ansformF߫();d#4u:applyfftr}'ansformF߫();e":applyfftr}'ansformF߫();if)(DEBUGY)f(show>("t:"\);(c,S:show("c:"\);(d-4v:show("d:"\);(e,:show("e:"\);greal41tffxDՂ=tc:worldffc}'oordinatesM[0];real41tffyD1=tc:worldffc}'oordinatesM[1];real41tffzDO=tc:worldffc}'oordinatesM[2];real41cffxF=c:worldffc}'oordinatesM[0];real41cffyFM=c:worldffc}'oordinatesM[1];real41cffzE8=c:worldffc}'oordinatesM[2];real41dffxFw=d:worldffc}'oordinatesM[0];real41dffyF&=d:worldffc}'oordinatesM[1];real41dffzF=d:worldffc}'oordinatesM[2];real41effxF=eo:worldffc}'oordinatesM[0];real41effyFM=eo:worldffc}'oordinatesM[1];real41effzE8=eo:worldffc}'oordinatesM[2];real41lamb}'daffdenominator=(((effx58cffx)8(dffyCcffy))((effycffy)(dffx^cffx5)));real41muffdenominator\=((effx58cffx)8(dffyCcffy))((effycffy)(dffx^cffx5));bQool7iexchangeffyffzsV=falsev\;bQool7iexchangeffxffzs=falsev\;UUif +[LDFT2003.08.14.]Y;SettingUUverb}'ose'<toUUtrueoBifUUVERBOSE_GLOBALPisUUtrue.qAddedUUVERBOSE_GLOBALtopspglb.webUUtoGday*.Ȅ`GhDe neUUP9oint"Dfunctions@285i+ +bQool#P9oint@::isffinfftriangle:(constrP9oint=&Eqp0Q;const P9oint?Ua&Gp1S3?;const P9oint?Ua&Gp2;bQoolKverb}'ose<%)2constLRfUUbQoolDEBUG:,=falsev\;=trueĒ=if)(VERBOSE_GLOBALJ>)verb}'ose(Xu=true;P9ath9漱q>f;q%ū+=7p0D٫;q%ū+=7p1D٫;q%ū+=7p2D٫;Plane>6qffplR{=q:getffplane(v();if)(qffplDͷINVALID_PLANEGY)f(if3(verb}'ose ])f2c}'errK]"WARNING! In Point::ovis_in_triangle():\n"eTF"The Point arguments do not determine a plane.\n"J"Returning false.\n\kn"yVF ush[;(g(returnKfalse`;gelse4.7if?/(:isffonffplane1ګ(qffpl}))f(if3(verb}'ose ])f W'n썷x9043DLDFPRÎG POINTXLIESWITHINTRIANGLE251n@P2c}'errK]"WARNING! In Point::ovis_in_triangle():\n"eT F"*this doesn't lie in the plane determined "1 /D"by the arguments.\nl"uұF"Returning false.\n\n"E ush;(g(returnKfalse`;gP9oint<t@(this뷫);P9oint<cAC{(p0 );P9oint<dB$(p1 );P9oint<eA(p2 );t!u:applyfftr}'ansformF߫();c"S:applyfftr}'ansformF߫();d#4u:applyfftr}'ansformF߫();e":applyfftr}'ansformF߫();if)(DEBUGY)f(show>("t:"\);(c,S:show("c:"\);(d-4v:show("d:"\);(e,:show("e:"\);greal41tffxDՂ=tc:worldffc}'oordinatesM[0];real41tffyD1=tc:worldffc}'oordinatesM[1];real41tffzDO=tc:worldffc}'oordinatesM[2];real41cffxF=c:worldffc}'oordinatesM[0];real41cffyFM=c:worldffc}'oordinatesM[1];real41cffzE8=c:worldffc}'oordinatesM[2];real41dffxFw=d:worldffc}'oordinatesM[0];real41dffyF&=d:worldffc}'oordinatesM[1];real41dffzF=d:worldffc}'oordinatesM[2];real41effxF=eo:worldffc}'oordinatesM[0];real41effyFM=eo:worldffc}'oordinatesM[1];real41effzE8=eo:worldffc}'oordinatesM[2];real41lamb}'daffdenominator=(((effx58cffx)8(dffyCcffy))((effycffy)(dffx^cffx5)));real41muffdenominator\=((effx58cffx)8(dffyCcffy))((effycffy)(dffx^cffx5));bQool7iexchangeffyffzsV=falsev\;bQool7iexchangeffxffzs=falsev\;UUif M(lamb}'daffdenominator]E0 _8muffdenominatorN50)UUfif+H(DEBUGY)c}'outg"lambda_denominator ngnor mu_denominator ==g2 0. "5<"Exchanging y and z-coordinates.\n"  ush;real41tempK ;temp7!=tffy;tffy.=tffz;tffz-=temp!;temp7!=cffyO;cffy/O=cffz;cffz. =temp!;temp7!=dffy;dffy/=dffze;dffz/e=temp!;temp7!=effyO;effy/O=effz;effz. -=temp!; in썷x9013DLDFPRÎG POINTXLIESWITHINTRIANGLE249n@Plamb}'daffdenominator{E«=(((effx58cffx)8(dffyCcffy))((effycffy)(dffx^cffx5))); muffdenominatorjX=((effx58cffx)8(dffyCcffy))((effycffy)(dffx^cffx5));if)(:(lamb}'daffdenominator]E0 _8muffdenominatorN50))f(if5^֫(DEBUGY)c}'out "Exchanging y and z-ncoordinates worked.\׌^n"F"lambda_denominator and mu_denominator are no longer 0.\n"yٷ ush;(exchangeffyffzc=true;gelse4.7fif+Ϋ(DEBUGY)c}'out}#"Exchanging y and z-n#coordinates didn't w#Rork.\n"o<"Exchanging x and z-coordinates.\n"  ush;902. First,UUputthingsbackthewaytheywere.qIt'swasteful,butlessconfusing.q[LDFT2003.06.24.]hDe neUUP9oint"Dfunctions@285i+ +=temp!; fn썫252POINTXLIESWITHINTRIANGLE 3DLDFPRÎGx904n@Plamb}'daffdenominator{E«=(((effx58cffx)8(dffyCcffy))((effycffy)(dffx^cffx5))); muffdenominatorjX=((effx58cffx)8(dffyCcffy))((effycffy)(dffx^cffx5));if)(:(lamb}'daffdenominator]E0 _8muffdenominatorN50))f(if5^֫(DEBUGY)c}'out "Exchanging y and z-ncoordinates worked.\׌^n"F"lambda_denominator and mu_denominator are no longer 0.\n"yٷ ush;(exchangeffyffzc=true;gelse4.7fif+Ϋ(DEBUGY)c}'out}#"Exchanging y and z-n#coordinates didn't w#Rork.\n"o<"Exchanging x and z-coordinates.\n"  ush;905. First,UUputthingsbackthewaytheywere.qIt'swasteful,butlessconfusing.q[LDFT2003.06.24.]hDe neUUP9oint"Dfunctions@285i+ temp#!=tffy; tffy=tffz; tffz=temp!; @@ -3312,7 +3357,7 @@ dffze=temp!; temp#!=effyO; effyO=effz; -effz=temp!; {n썫250POINTXLIESWITHINTRIANGLE 3DLDFPRÎGx903n@P903. Now,UUexchangethexandz-coGordinates.q[LDFT2003.06.24.]hDe neUUP9oint"Dfunctions@285i+ +effz=temp!; xZn썷x9063DLDFPRÎG POINTXLIESWITHINTRIANGLE253n@P906. Now,UUexchangethexandz-coGordinates.q[LDFT2003.06.24.]hDe neUUP9oint"Dfunctions@285i+ temp#!=tffx"Q; tffx"R=tffz; tffz=temp!; @@ -3340,91 +3385,91 @@ bQool#gb*)=(lamb}'da"60 ^8muґ0^8((lamb}'da!+mu y)1)); if(verb}'ose ])fc}'out* Q"In Point::is_in_trikangle:\n");if(bJ)c}'out O"The Point lies withkin the triangle. "͔&"Returning true."\M;else+c}'outA0"The Point doesn't lkie within the triangƠle. "T"Returning false."aJ;c}'out* Qendlendl ush; g -return-滱b21e;qǷg904. ManipulatingTP9aths.905. SetTcycle.#s9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.4.7.]O?Changed,UUsothattheargumentbQoolc$istrueoBbydefault. n썷x9053DLDFPRÎG1SETXCYCLE251n@P -[LDFT2002.11.05.]Y;MadeUUbQoolc$argumentUUconst*.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -v9oid"setffcycleI'(const*bQool7c>=true);906.hDe neUUP9ath<functions@657i+ +return-滱b21e;qǷg907. ManipulatingTP9aths.908. SetTcycle.;9Ȅ`+U 8Log)j`+U +[LDFT2002.4.7.]O?Changed,UUsothattheargumentbQoolc$istrueoBbydefault. Πn썫254SETXCYCLE13DLDFPRÎGx908n@P +[LDFT2002.11.05.]Y;MadeUUbQoolc$argumentUUconst*.Ȅ`GhDeclareUUP9ath<functions@656i+ +v9oid"setffcycleI'(const*bQool7c>=true);909.hDe neUUP9ath<functions@657i+ v9oid"P9ath 8BeginTLogJʄ`> +g910. Rev9erse.911. WithTassignmen9t.9Ȅ`+U 8Log)j`+U [LDFT2002.4.6.]O?AddedUUthisfunction. -[LDFT2003.07.16.]Y AddedXerrorhandlingcoGdeforthecasethatthisfunctioniscalledwithassign"false|4.I'venowaddedaconst Sversion,Fsothere'snoneedtocallthisversionwithassign!falsev\.O,Ifassign!"isfalseǫ,theUUconst!versionUUiscalled,soIcouldsimplifythecoGdeinthisversion.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -P9ath%r}'everseE(bQoolfassign5|);909.hDe neUUP9ath<functions@657i+ -P9ath%P9ath?x"::r}'everse f(bQoolfassign5|)fUUbQoolDEBUG:,=falsev\;=trueĒ=if)(isffcycle!O())=ReturnUUUVthisaifUUUVthisisUUacycle.o=f(c}'err=2A"ERROR! In Path::revlALerse().\n"A"*this is a cycle. ClALan't reverse.\n" <"Returning *this.\n\n",;(returnK澷Pthisau;gif)(:assign)f(c}'err?}ɷ"WARNING! In Path::rmeverse(bool):\n":"assign == false. Dom\<n't call this function " "with false as its an Grgument.\n"<"Use reverse() without an argument inste ad.\n"0"Calling reverse(voikd).\n\n"D< ushQ;(returnKr}'eversek ();g n썫252WITHXASSIGNMENT t3DLDFPRÎGx910n@P910. [LDFT2002.4.6.]QΆIfۡthereismorethanoneconnector,4butthereisn'tanexplicitconnectorforevery pairofP9oints'(inp}'ointsg,thenwehaveto llupc}'onnectors7 ҫsothatthereisoneforeachpairofP9oints$V.Otherwise,UUtheconnectorsandtheP9oints&.won'tmatchuppropGerlywhenwereversethem.hDe neUUP9ath<functions@657i+ +[LDFT2003.07.16.]Y AddedXerrorhandlingcoGdeforthecasethatthisfunctioniscalledwithassign"false|4.I'venowaddedaconst Sversion,Fsothere'snoneedtocallthisversionwithassign!falsev\.O,Ifassign!"isfalseǫ,theUUconst!versionUUiscalled,soIcouldsimplifythecoGdeinthisversion.Ȅ`GhDeclareUUP9ath<functions@656i+ +P9ath%r}'everseE(bQoolfassign5|);912.hDe neUUP9ath<functions@657i+ +P9ath%P9ath?x"::r}'everse f(bQoolfassign5|)fUUbQoolDEBUG:,=falsev\;=trueĒ=if)(isffcycle!O())=ReturnUUUVthisaifUUUVthisisUUacycle.o=f(c}'err=2A"ERROR! In Path::revlALerse().\n"A"*this is a cycle. ClALan't reverse.\n" <"Returning *this.\n\n",;(returnK澷Pthisau;gif)(:assign)f(c}'err?}ɷ"WARNING! In Path::rmeverse(bool):\n":"assign == false. Dom\<n't call this function " "with false as its an Grgument.\n"<"Use reverse() without an argument inste ad.\n"0"Calling reverse(voikd).\n\n"D< ushQ;(returnKr}'eversek ();g Ǡn썷x9133DLDFPRÎG tWITHXASSIGNMENT255n@P913. [LDFT2002.4.6.]QΆIfۡthereismorethanoneconnector,4butthereisn'tanexplicitconnectorforevery pairofP9oints'(inp}'ointsg,thenwehaveto llupc}'onnectors7 ҫsothatthereisoneforeachpairofP9oints$V.Otherwise,UUtheconnectorsandtheP9oints&.won'tmatchuppropGerlywhenwereversethem.hDe neUUP9ath<functions@657i+ if(c}'onnectors/4.:size\()>1 ^8c}'onnectors1m:size()6=p}'oints뭱:size()818)fstring5%Olastffc}'onnectorsF;lastffc}'onnectorT=c}'onnectors1F:b}'ackë();while2C.(c}'onnectors/4.:size\() Ы); -g911. [LDFT2002.4.7.]PIfIdon'texplicitlyrefertothestdnamespacehere,%thisfunctioniscalled,andsincetheUUargumentsaredi erentfromtheoneusedforthisfunction,thiscausesanerroratcompiletime.hDe neUUP9ath<functions@657i+ +g914. [LDFT2002.4.7.]PIfIdon'texplicitlyrefertothestdnamespacehere,%thisfunctioniscalled,andsincetheUUargumentsaredi erentfromtheoneusedforthisfunction,thiscausesanerroratcompiletime.hDe neUUP9ath<functions@657i+ if(DEBUGY)c}'out O"Reversing connectorks and points.\n", ush; std::!"r}'everseA3(c}'onnectors/4.:b}'egin();c}'onnectors0ֱ:endಫ()); std::!"r}'everseA3(p}'oints$:b}'egin();p}'oints=:endಫ()); if(DEBUGY)fc}'out* Q"Showing connectors:k\n"| ;;for%舫(v9ectorHhstringi::Biter}'ator)7iter=+M=c}'onnectors1F:b}'egin();iter6=c}'onnectors:endಫ();iterJ++")c}'out4 RiterY/endlګ;c}'out* Q"Showing points:\n"g G;for%舫(v9ectorHhP9oint#i::Biter}'ator)7iter=+M=p}'oints뭱:b}'egin();iter6=p}'oints:endಫ();iterJ++")( iter):show();getchar5%(); g=if(DEBUGY)= -return-滷2thisCr;UUg912. NoFassignmen9t.Thisversionmerelycopiesthis[andcallsr}'everse#db(trueĘ)onthecopy*,ЫreturningtheUUreturnvqalueofthatfunctioncall.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.07.16.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -P9ath%r}'everseE(v9oid)UUconst*;913.hDe neUUP9ath<functions@657i+ +return-滷2thisCr;UUg915. NoFassignmen9t.Thisversionmerelycopiesthis[andcallsr}'everse#db(trueĘ)onthecopy*,ЫreturningtheUUreturnvqalueofthatfunctioncall.9Ȅ`+U 8Log)j`+U +[LDFT2003.07.16.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUP9ath<functions@656i+ +P9ath%r}'everseE(v9oid)UUconst*;916.hDe neUUP9ath<functions@657i+ P9ath%P9ath?x"::r}'everse f(v9oid)UUconst fP9ath/滱p7ӫ=thisϫ;return7漱p<:r}'everseb(trueĘ); -g914. Equalit9y +g917. Equalit9y .TODO:MI'llneedtomakeallconnectorsexplicitinordertomakethiswork. ]SeeopQerator+&3]()UUforanexampleofhowtomakethiswork.hDeclareUUP9ath<functions@656i+#if 0 -virtual/bQoolI/:opQeratort| (P9ath湫&#ױp(׫);#endif 7n썷x9153DLDFPRÎG4DEQUALITY253n@P915.hDe neUUP9ath<functions@657i+ #if 0 +virtual/bQoolI/:opQeratort| (P9ath湫&#ױp(׫);#endif n썫256EQUALITY4D3DLDFPRÎGx918n@P918.hDe neUUP9ath<functions@657i+ #if 0 virtual/bQoolI/:P9athb::iNopQerator啷(P9ath湫&#ױp(׫) -fg#endif916. In9tersection.917. In9tersectionToftwolinearPaths. IfUUUVthisaisUUalineandtheargumentp}'aisaline, interse}'ctionffpointM֫()UUcallstheversionforP9oints&.inpoints.web. +fg#endif919. In9tersection.920. In9tersectionToftwolinearPaths. IfUUUVthisaisUUalineandtheargumentp}'aisaline, interse}'ctionffpointM֫()UUcallstheversionforP9oints&.inpoints.web. OtherUUkindsofP9aths#Jandotherclasseswillneedtheirownversionsofthisfunction. -IUUmayhaveaproblemwiththeconstancyofUVthisaandp}'aR.qIfIdo,justremoveit.U9Ȅ`> 8BeginTLogJʄ`> +IUUmayhaveaproblemwiththeconstancyofUVthisaandp}'aR.qIfIdo,justremoveit.9Ȅ`+U 8Log)j`+U [LDFT2002.04.15.]X Changed_'returnvqaluefrombQoolus4wrealus4pQoin9tQtobQoolus4wpoin9t7m,csinceI'vehadtocomment-outUUtheversionofP9oint::interse}'ctionffpointNګ()thatusestheLine-version. [LDFT2002.04.10.]ZChangedEreturntypGetobQoolus4wrealus4pQoin9tW}MtocorrespondwiththesamechangetoP9ointL::interse}'ctionffpointNګ(). -[LDFT2003.07.04.]ZAdded6tr}'ace Q}argument. kAdded6conditionalusingtr}'acetochoGosewhichversionofP9ointL::interse}'ctionffpointNګ()UUshouldbGecalled.qChangedsothatisffline}'ar(jҫ()isusedinsteadofgetfflineffswitch?}().qNowUUusinggetfflastffp}'oint=y()insteadofUVp}'oints#y[1].Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -bQoolus4wpoin9tBinterse}'ctionffpoint>r(const*P9ath:[&Ayp}'aLս;constJbQool9vtr}'aceRT٫=falsev\)UUconst*; n썫254INTERSECTIONXOFTWÎOLINEARP -ATHSr3DLDFPRGx918n@P918.hDe neUUP9ath<functions@657i+ +[LDFT2003.07.04.]ZAdded6tr}'ace Q}argument. kAdded6conditionalusingtr}'acetochoGosewhichversionofP9ointL::interse}'ctionffpointNګ()UUshouldbGecalled.qChangedsothatisffline}'ar(jҫ()isusedinsteadofgetfflineffswitch?}().qNowUUusinggetfflastffp}'oint=y()insteadofUVp}'oints#y[1].Ȅ`GhDeclareUUP9ath<functions@656i+ +bQoolus4wpoin9tBinterse}'ctionffpoint>r(const*P9ath:[&Ayp}'aLս;constJbQool9vtr}'aceRT٫=falsev\)UUconst*; Vn썷x9213DLDFPRÎGrINTERSECTIONXOFTWOLINEARP +ATHS257n@P921.hDe neUUP9ath<functions@657i+ bQoolus4wpoin9tBP9ath\9::interse}'ctionffpointNګ(const*P9ath:[&Ayp}'aLս;constJbQool9vtr}'aceO)UUconst fif(isffline}'ar%}()8^p}'a 6$:isffline}'ar())fif)(tr}'ace)return(P9ointE::interse}'ctionffpointNګ(p}'oints $[0];getfflastffp}'oint;();p}'a:p}'oints$[0];<p}'aFJ:getfflastffp}'oint:$>();tr}'ace);else5returnYP9ointvDL::interse}'ctionffpointNګ(p}'oints $[0];getfflastffp}'oint;();p}'a:p}'oints$[0];p}'a :getfflastffp}'oint:$>();<tr}'aceR);gelse+fc}'out4 R"Haven't coded this kcase yet. ";"Returning INVALID_BkOOL_POINT.\n"T5 ush;returnAINVALID_BOOL_POINT;g -g919. In9tersectionofalinearPathwithaPlane. [LDFT2003.06.03.]ZThisfunctionmustbGede nedhere,UUbGecauseP9ath<isanincompletetypeinplanes.web.r9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.06.03.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDe neUUPlane# functions@620i+ +g922. In9tersectionofalinearPathwithaPlane. [LDFT2003.06.03.]ZThisfunctionmustbGede nedhere,UUbGecauseP9ath<isanincompletetypeinplanes.web.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.03.]Y;AddedUUthisfunction.Ȅ`GhDe neUUPlane# functions@620i+ bQoolus4wpoin9tBPlane`::interse}'ctionffpointNګ(const*P9ath:[&AypFy)UUconst fif(p:isffline}'ar%}())return(interse}'ctionffpointv}(p:getffp}'oint'bH(0);p:getfflastffp}'oint:$>());else+fc}'err5j"ERROR! In Plane::inm.tersection_point(const Path&):"*jendl֖2"Path is not linear! Returning INVALID_BOOL_POINT."FLendlendl ush;returnAINVALID_BOOL_POINT;g -g920. Dra9wingZaxes.ThisfunctiondrawsandlabGelsarrowsforthemainaxesattheorigin.+ItcanbGehelpfulUUfordeterminingwhetherthe\up "directioniscorrectforaF +g923. Dra9wingZaxes.ThisfunctiondrawsandlabGelsarrowsforthemainaxesattheorigin.+ItcanbGehelpfulUUfordeterminingwhetherthe\up "directioniscorrectforaF oQcus J. -[LDFT2003.04.01.]YSometimesKplaceholdersareneededforthedistandpGositionarguments.UIfdistisanumbGer5x80,mthenit'ssettothedefault,currently2.5.gIfapGositionargument(p}'osffxՅ,mp}'osffyR,morp}'osffzT)is"d"F_,UUit'ssettothedefault.U9Ȅ`> 8BeginTLogJʄ`> +[LDFT2003.04.01.]YSometimesKplaceholdersareneededforthedistandpGositionarguments.UIfdistisanumbGer5x80,mthenit'ssettothedefault,currently2.5.gIfapGositionargument(p}'osffxՅ,mp}'osffyR,morp}'osffzT)is"d"F_,UUit'ssettothedefault.9Ȅ`+U 8Log)j`+U [LDFT2003.02.05.]ZMovedjthisfunctionfrommain.webtohere,(soIjcanuseitinmyexamplesfortheT*exinfodoGcumentation.T7Also,aaddedadditionalargumentsspGecifyingthepositionsoflabelsandsuppressingdrawingUUtheaxes(andtheirlabGels). [LDFT2003.04.01.]Z<>AddedXargumentsfordashpattern(ddashe}'d#G)andpGen(pp}'en6#). Rearrangedorderofarguments.HyAlso,tgot;ridoftheargumentssuppr}'essffx2$(,tsuppr}'essffy21,tandsuppr}'essffz1«.HyNowusingtheemptystringh("" b)intheargumentsp}'osffx>{,p}'osffy,andp}'osffz"! toindicatethatthecorrespGondingaxesshouldbGesuppressed. Addederrorhandlingcodethatprintsawarningtostderr%4cifallaxesaresuppressed.([LDFT2003.05.06.]PNoteathat""ɤwillneverbGeneededforlabellinganaxis,becauseputtingthelabelontopUUoftheP9oint"Dwouldinterferewiththearrow.) -[LDFT2003.04.01.]Y Added:argumentsshiftffx ë,.shiftffy ,.andshiftffz$0foradjustingthepGositionofthelabels.Note1thattheadjustmenta ectsthepGositionofthethree-dimensionalP9oint#PwithintheLabQel rg,gnot#ܫthetwo-dimensionalvpro8jectedpGoint.)Therefore,it'snotpossibletoadjustthepositionoftheLabQel#Oprecisely n썷x9203DLDFPRÎGDRA8WINGXAXES255n@PwithoutYchangingtheMetapGostcode.[TOHDO:Changelab}'el(),sothatit'spossibletoadjustthepositionof theypGointsinthepro8jection!ThismayopGenacanofworms,though,espGeciallyyifthesamecodeisusedtogenerateUUdrawingsusingdi erentpro8jectionsand/ordi erentF;o}'cuses%F. -[LDFT2003.07.13.]Y;MadeUUddashe}'d)andUUpp}'enconst: oinUUbGothversions.Ȅ` 8EndTLogA>`921. LengthTargumen9t rst.hDeclareUUdr}'awffaxes/[+()@921i +[LDFT2003.04.01.]Y Added:argumentsshiftffx ë,.shiftffy ,.andshiftffz$0foradjustingthepGositionofthelabels.Note1thattheadjustmenta ectsthepGositionofthethree-dimensionalP9oint#PwithintheLabQel rg,gnot#ܫthetwo-dimensionalvpro8jectedpGoint.)Therefore,it'snotpossibletoadjustthepositionoftheLabQel#Oprecisely n썫258DRA8WINGXAXES3DLDFPRÎGx923n@PwithoutYchangingtheMetapGostcode.[TOHDO:Changelab}'el(),sothatit'spossibletoadjustthepositionof theypGointsinthepro8jection!ThismayopGenacanofworms,though,espGeciallyyifthesamecodeisusedtogenerateUUdrawingsusingdi erentpro8jectionsand/ordi erentF;o}'cuses%F. +[LDFT2003.07.13.]Y;MadeUUddashe}'d)andUUpp}'enconst: oinUUbGothversions.Ȅ`G924. LengthTargumen9t rst.hDeclareUUdr}'awffaxes/[+()@924i v9oid$dr}'awffaxesP%(realdist-=2:5q:;string#p}'osffx@qe="bot"pt;string#p}'osffy@W="lft";stringp}'osffz9=}"bot"D;const ColorA&IOddr}'awffcolor1=}÷ }Colors+V::1defaultffc}'olori`;const stringddashe}'dEpj=)V""/;const stringBpp}'en\(=)V"";const P9oint@m&H5shiftffxi=)Voriginw;const P9oint&%!shiftffyE$q=origin9;constJP9oint>&Fshiftffze}@=origin;Picture* -&2c(pictur}'eT3=curr}'entffpictureD߫); SeeXalsosection926.ThisXcoS-&FKshiftffxbԱ;constmP9oint>S-&FKshiftffyb;constmP9oint2&9#shiftffzUF;Picture* -&2c(pictur}'eQk)f SeeXalsosections923,924,925,and927.ThisXco 8BeginTLogJʄ`> -[LDFT2003.04.01.]Y;AddedUUthissection.Ȅ` 8EndTLogA>`hDe neUUdr}'awffaxes/[+()@922i+ +&2c(pictur}'eQk)f SeeXalsosections926,927,928,and930.ThisXco 8BeginTLogJʄ`> -[LDFT2003.04.01.]Y;AddedUUthiserrorhandlingcoGde.Ȅ` 8EndTLogA>`hDe neUUdr}'awffaxes/[+()@922i+ +if(p}'osffz7"d" w)p}'osffz7="bot"q;927.9Ȅ`+U 8Log)j`+U +[LDFT2003.04.01.]Y;AddedUUthiserrorhandlingcoGde.Ȅ`GhDe neUUdr}'awffaxes/[+()@925i+ if(p}'osffx""Z^8p}'osffy,""^8p}'osffzO"" z)fc}'err)=T"WARNING! In draw_axl=es():"·=Tendllj=T"All axes are supprel=ssed. Returning."@(endl>޷endl ush;return4g; -g Rn썫256LENGTHXARÎGUMENTFIRSTBH3DLDFPRGx925n@P925.hDe neUUdr}'awffaxes/[+()@922i+ +g Jn썷x9283DLDFPRÎGBHLENGTHXARGUMENTFIRST259n@P928.hDe neUUdr}'awffaxes/[+()@925i+ if(p}'osffx6="" z)fP9oint2x0>|(distӋ);P9oint2x1>|(dist m);x0߱:dr}'awarrow.ī(x1 ݱ;ddr}'awffcolor5Q;ddashe}'d$;pp}'en˱;pictur}'e ~);x1"d+=4KshiftffxQjԫ;x1߱:lab}'elt("x"F_;p}'osffx-;falseY;pictur}'e ~); g if(p}'osffyL6="" z)fP9oint2y0>(0; qdist~3);P9oint2y1>(0;dist);y0U:dr}'awarrow.ī(y1 S;ddr}'awffcolor5Q;ddashe}'d$;pp}'en˱;pictur}'e ~);y1"m+=4shiftffyQ;y1U:lab}'elt("y"F_;p}'osffyeܱ;falseY;pictur}'e ~); g if(p}'osffz76="" z)fP9oint2z0>(0;0; qdist~3);P9oint2z1>(0;0;dist);z0:dr}'awarrow.ī(z1 ;ddr}'awffcolor5Q;ddashe}'d$;pp}'en˱;pictur}'e ~);z1!*+=4-~shiftffzPW;z1:lab}'elt("z"F_;p}'osffzDZ;falseY;pictur}'e ~); g -return*f;qǷg926. ColorTargumen9t rst.U9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.05.02.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUdr}'awffaxes/[+()@921i+ -v9oid#dr}'awffaxesO(constColor?v&G=-ddr}'awffcolor{Eֱ;real1dist.d=''2:5F;string#2p}'osffx?ޫ=''"bot"퀱;stringp}'osffy8,="lft"N;string"yp}'osffz<="bot";conststringA ddashe}'dg+="" W;conststringA pp}'enY="";constP9oint=&&DDshiftffxde=Loriginm;constP9oint>&Fshiftffyf4=Lorigin;constP9oint>&FshiftffzeȀ=Lorigin;Picture&%!pictur}'eG=curr}'entffpictureD߫); n썷x9273DLDFPRÎGËCOLORXARGUMENTFIRST257n@P927.hDe neUUdr}'awffaxes/[+()@922i+ +return*f;qǷg929. ColorTargumen9t rst.9Ȅ`+U 8Log)j`+U +[LDFT2003.05.02.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUdr}'awffaxes/[+()@924i+ +v9oid#dr}'awffaxesO(constColor?v&G=-ddr}'awffcolor{Eֱ;real1dist.d=''2:5F;string#2p}'osffx?ޫ=''"bot"퀱;stringp}'osffy8,="lft"N;string"yp}'osffz<="bot";conststringA ddashe}'dg+="" W;conststringA pp}'enY="";constP9oint=&&DDshiftffxde=Loriginm;constP9oint>&Fshiftffyf4=Lorigin;constP9oint>&FshiftffzeȀ=Lorigin;Picture&%!pictur}'eG=curr}'entffpictureD߫); vn썫260COLORXARÎGUMENTFIRSTË3DLDFPRGx930n@P930.hDe neUUdr}'awffaxes/[+()@925i+ v9oid#5dr}'awffaxesO (constAColor=M&Ekddr}'awffcolory;realu2dist);string"Qp}'osffx:ֱ;string"Qp}'osffy:;string"Qp}'osffz:6p;const2stringRuddashe}'dv3;constmstring@pp}'enU;constmP9oint>S-&FKshiftffxbԱ;constmP9oint>S-&FKshiftffyb;constmP9oint2&9#shiftffzUF;Picture* &2c(pictur}'eQk) fdr}'awffaxes@ث(dist m;p}'osffx-;p}'osffyeܱ;p}'osffzDZ;ddr}'awffcolor5Q;ddashe}'d$;pp}'en˱;shiftffx[1;shiftffy@;shiftffz˱;pictur}'e ~); -g928. P9athsTandLines.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.06.06.]Y;AddedUUthisheading.Ȅ` 8EndTLogA>`929. GetLine.Returns8aLineȳcorrespGondingto8this#ϫ,=if8this[islinear.hOtherwise,getffline$ ()returnsINVALID_LINE?D.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.06.06.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDeclareUUP9ath<functions@656i+ -Line#getfflineD(v9oid)UUconst*;930.hDe neUUP9ath<functions@657i+ +g931. P9athsTandLines.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.06.]Y;AddedUUthisheading.Ȅ`G932. GetLine.Returns8aLineȳcorrespGondingto8this#ϫ,=if8this[islinear.hOtherwise,getffline$ ()returnsINVALID_LINE?D.ō9Ȅ`+U 8Log)j`+U +[LDFT2003.06.06.]Y;AddedUUthisfunction.Ȅ`GhDeclareUUP9ath<functions@656i+ +Line#getfflineD(v9oid)UUconst*;933.hDe neUUP9ath<functions@657i+ Line#P9ath=?A::getffline"O(v9oid)UUconst fif(isffline}'ar%}())return(p}'ointsD O:fr}'ontI()~getffline%O((p}'oints$:b}'ackë()));else+fc}'err3˷""ERROR! In Path::getl_line():\n"fO""Path is not linear.l Returning INVALID_L\2INE.\n\n"dj ush;returnAINVALID_LINEm;g -g931. GetjP9ath.Declaredinlines.web.MustbGede nedhere,KbecauseP9ath >isanincompletetypethere.9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.06.06.]Y;AddedUUthisfunction.Ȅ` 8EndTLogA>`hDe neUULine-functions@600i+ +g934. GetjP9ath.Declaredinlines.web.MustbGede nedhere,KbecauseP9ath >isanincompletetypethere.9Ȅ`+U 8Log)j`+U +[LDFT2003.06.06.]Y;AddedUUthisfunction.Ȅ`GhDe neUULine-functions@600i+ P9ath%Line=?A::getffp}'ath$(v9oid)UUconst fP9oint2p7(p}'osition%}7+8dir}'ection)1ѫ);return7P9athPx (p}'osition#DW;p); -g932. PuttingTP9athtogether. ^n썫258PUTTINGXP -ATHTOGETHER23DLDFPRÎGx933n@P933. ThisUUiswhat'scompiled. +g935. PuttingTP9athtogether. 贠n썷x9363DLDFPRÎG2PUTTINGXP +ATHTOGETHER261n@P936. ThisUUiswhat'scompiled. hIncludeUU les@11i hV*ersionUUcontrolidenti er@10i hDe neUUclass5P9ath;654i @@ -3435,42 +3480,43 @@ hDe neUUPlane# functions@620i hDe neUUP9ath<functions@657i hDe neUULine-functions@600i -hDe neUUdr}'awffaxes/[+()@922i n썷x9343DLDFPRÎG2PUTTINGXP -ATHTOGETHER259n@P934. ThisUUiswhat'swrittentopaths.h.捷hpaths.h0p934i +hDe neUUdr}'awffaxes/[+()@925i Ơn썫262PUTTINGXP +ATHTOGETHER23DLDFPRÎGx937n@P937. ThisUUiswhat'swrittentopaths.h.hpaths.h0p937i hDe neUUclass5P9ath;654i -hDeclareUUdr}'awffaxes/[+()@921i935. Curv9es(curves.web).[9Ȅ`> 8BeginTLogJʄ`> -[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions.Ȅ` 8EndTLogA>` -format3c(CurveVPathhV*ersionUUcontrolidenti er@10i+936. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"#include'~"transfor.h"#include'~"shapes.h"#include'~"pictures.h"#include'~"points.h"#include'~"lines.h"#include'~"planes.h"#include'~"paths.h"937. RegularTclosedplanecurv9e.A"9Ȅ`> 8BeginTLogJʄ`> -[LDFT2002.11.12.]ZChangedthename\R}'egularffClosedffPlaneffCurve{"to\Regus4wClus4Planeus4Curv9eh",BbGe-causeUUtheformercausedtoGomany\OverfullbGoxes"whenrunningcweave.Ȅ` 8EndTLogA>`938. Regffs4#Clffs4Planeffs4Curv9evclassde nition.A/&Regus4wClus4Planeus4Curv9eoUis/0assumedtobGeclosed,6pla-nar,UUconvex,andhaveatleast3pGoints.qThefunctionsthatcreateandmoGdifyRegus4wClus4Planeus4Curv9esp)mustUUensurethattheseassumptionsarecorrect! -[LDFT2002.11.05.]ZhRegus4wClus4Planeus4Curv9e8isintendedtobGeusedasabaseclass.^Noob8jectsoftypGeRegus4wClus4Planeus4Curv9elLshouldUUbGede ned,however,UUitisnotanabstractclass,soitispossibletodoso.捍 -format3c(R}'egffClffPlaneffCurve'CurvehDe neUUclass5Regus4wClus4Planeus4Curv9emB938i +hDeclareUUdr}'awffaxes/[+()@924i938. Curv9es(curves.web).N99Ȅ`+U 8Log)j`+U +[LDFT2003.11.12.]ZCRemovedtheversioncontrolidenti ersfromtheCWEB lesforthedistributionof3DLDFUU1.1.qThey'restillusedinmydevelopmentversions. +[LDFT2003.12.10.]YQPuttheversioncontrolidenti ersbackintomyreleaseversionsfor3DLDF1.1.4.MI'vealready"putsomeofthembackin,,nowI'mdoingtherestofthem.`However,,thereleaseversionsarenowintheirUUownRCSrepGository*.Ȅ`G +format3c(CurveVPathhV*ersionUUcontrolidenti er@10i+ +static)HstringJn'r}'csffidg(="$Id: curves.web,v 1k.2 2003/12/10 15:27:Ơ57 lfinsto1 Exp $"3ҫ;939. IncludeT les.hIncludeUU les@11i+#include'~"loader.h"#include'~"pspglb.h"#include'~"io.h"#include'~"colors.h"#include'~"transfor.h"#include'~"shapes.h"#include'~"pictures.h"#include'~"points.h"#include'~"lines.h"#include'~"planes.h"#include'~"paths.h"940. RegularTclosedplanecurv9e.9Ȅ`+U 8Log)j`+U +[LDFT2002.11.12.]ZChangedthename\R}'egularffClosedffPlaneffCurve{"to\Regus4wClus4Planeus4Curv9eh",BbGe-causeUUtheformercausedtoGomany\OverfullbGoxes"whenrunningcweave.Ȅ`G941. Regffs4#Clffs4Planeffs4Curv9evclassde nition.A/&Regus4wClus4Planeus4Curv9eoUis/0assumedtobGeclosed,6pla-nar,UUconvex,andhaveatleast3pGoints.qThefunctionsthatcreateandmoGdifyRegus4wClus4Planeus4Curv9esp)mustUUensurethattheseassumptionsarecorrect! +[LDFT2002.11.05.]ZhRegus4wClus4Planeus4Curv9e8isintendedtobGeusedasabaseclass.^Noob8jectsoftypGeRegus4wClus4Planeus4Curv9elLshouldUUbGede ned,however,UUitisnotanabstractclass,soitispossibletodoso. +format3c(R}'egffClffPlaneffCurve'CurvehDe neUUclass5Regus4wClus4Planeus4Curv9emB941i class$RRegus4wClus4Planeus4Curv9e-?:qpublic'P9athB몷f -protected:o:P9oint#c}'enter?(;unsignedD7shortbnumb}'erffofffpoints\;捍 -public)=֫:hDeclareUURegus4wClus4Planeus4Curv9eoBfunctions@940i -g; 捭ThisXco 8BeginTLogJʄ`> -[LDFT2002.11.03.]Y;RemovedUURegus4wClus4Planeus4Curv9emL::isffplanar)&().ARegus4wClus4Planeus4Curv9enվcan bGemanipulatedintoanon-planarstate,soit'ssafertousetheP9athoversion,whichUUtestswhetherit'sreallyplanarornot.Ȅ` 8EndTLogA>`940. IsTquadratic.hDeclareUURegus4wClus4Planeus4Curv9eoBfunctions@940i +protected:o:P9oint#c}'enter?(;unsignedD7shortbnumb}'erffofffpoints\; +public)=֫:hDeclareUURegus4wClus4Planeus4Curv9eoBfunctions@943i n썷x9413DLDFPRÎGREGffs4#CLffs4PLANEffs4CURVEXCLASSDEFINITION263n@P +g; ThisXco 8BeginTLogJʄ`> +The4followingvqaluesarereturnediftheP9oint"Nisinthesameplaneas4thisTandthisfunctionhasworkedpropGerly:-1 UVTheUUP9oint"DliesUUoutsidetheRegus4wClus4Planeus4Curv9elL.0 UVTheUUP9oint"DliesUUonthepGerimeteroftheRegus4wClus4Planeus4Curv9elL.1 UVTheUUP9oint"DliesUUinsidethepGerimeteroftheRegus4wClus4Planeus4Curv9elL.TheseUUvqaluesarereturnedincaseswhereerrorshaveUUoGccurred:-2 UVTheUUP9oint"DisUUnotinthesameplaneastheRegus4wClus4Planeus4Curv9elL.-3 UVSomethingUUhasgoneterriblywrong.-4 UVTheUUnormaltotheRegus4wClus4Planeus4Curv9eoBhas0magnitude,i.e.,theP9oints&.onthe UVRegus4wClus4Planeus4Curv9eCareUUcolinear.-5 UVAnUUerroroGccurredinputtingtheRegus4wClus4Planeus4Curv9eoBinoneofthema8jorplanes.-6 UVTheUURegus4wClus4Planeus4Curv9eoBisUUnon-planar.9Ȅ`+U 8Log)j`+U [LDFT2002.04.03.]Y;AddedUUandtestedallcases.qSeemstoworkpropGerly*. [LDFT2002.11.12.]ZKAddede\\relax V"aftertheargumentsto\\RVF_"intheTU>VExX['coGdeaboveeinordertosuppressOaspaceatthebGeginningofthe rstlineofthefollowingindentedparagraph.oIOcouldn't gureoutaUUwayofsuppressingthespacewithinthede nitionof\RV (whichiscurrently\\let\"to\ARG۱). [LDFT2003.06.03.]Y;ChangedUUthelinewherePlane!6::getffdistanc}'e5y()iscalledbGelow.qItnowreturnsarealus4wshort2i,UUso\: rst @@ -3479,31 +3525,30 @@ [LDFT2003.06.14.]Y;AddedUUerrorhandlingcoGdeforthecasethatgetffplane+=()fails. [LDFT2003.06.14.]X^Nolongertakingabsolutevqalueofthereal[valuer0GreturnedbyPlane (::getffdistanc}'e5y(),sinceUUitwillalwaysUUbGepositive,anyway*.qCommentatplacebGelow,whereImadethischange. [LDFT2003.07.01.]Y;AddedUUargumentsuppr}'essffwarningsSzf. -[LDFT2003.07.16.]YChangedknameofc}'enter"kargumenttor}'efffpt],qbGecauseI'vemadec}'enter"kadatamembGerofUURegus4wClus4Planeus4Curv9elL.Ȅ` 8EndTLogA>`hDeclareUURegus4wClus4Planeus4Curv9eoBfunctions@940i+ -virtual/signedRshortpmlo}'cation(P9ointr}'efffpt7ᐱ;P9oint Ept00;constJbQool9vsuppr}'essffwarningsb٫=falsev\)UUconst*; n썫262LOCAJTIONXOFAPOINT3DLDFPRÎGx946n@P946.hDe neUURegus4wClus4Planeus4Curv9eoBfunctions@946i +[LDFT2003.07.16.]YChangedknameofc}'enter"kargumenttor}'efffpt],qbGecauseI'vemadec}'enter"kadatamembGerofUURegus4wClus4Planeus4Curv9elL.Ȅ`GhDeclareUURegus4wClus4Planeus4Curv9eoBfunctions@943i+ +virtual/signedRshortpmlo}'cation(P9ointr}'efffpt7ᐱ;P9oint Ept00;constJbQool9vsuppr}'essffwarningsb٫=falsev\)UUconst*; n썷x9493DLDFPRÎGLOCAJTIONXOFAPOINT265n@P949.hDe neUURegus4wClus4Planeus4Curv9eoBfunctions@949i signed,qshortJ7Regus4wClus4Planeus4Curv9e/*::lo}'cation#(P9ointnr}'efffpt7` ;P9oint pt0/;constSbQool8ssuppr}'essffwarnings)2const fbQool-hDEBUGK.٫=falsev\;=trueĒ=if(DEBUGY)fc}'out4 R"Entering Reg_Cl_Plakne_Curve::location()Ơ\n" ;r}'efffpt6:show("ref_pt"*P);pt0-i>:show("pt0"Y);gunsignedD7shortborientationt;const2*unsignedbashort,UX_Y9̫=0;const2*unsignedbashort,UX_Z9̫=1;const2*unsignedbashort,UZ_Y9̫=2;Plane46pl=lū(getffplane(v());if(pl #INVALID_PLANEGY)=LDFUU2003.06.14.qAddedthiserrorhandlingcoGde.o=fc}'err7A "ERROR! In Reg_Cl_Plp \ane_Curve::location( ):"]2"The Reg_Cl_Plane_Curve is non-planar.\n" -"Returning -6\n\n"db ush;returnA潷I۫6N;greal*0r08 =pl #:getffdistanc}'e4y(pt0i;): rst;if(r0 ݱ>P9ointad::%epsilonE^())=LDF82003.06.14.h Changed.r0will8alwaysbGepositive,=soI8nowlongertakeitsabsolutevqalue.=fif*9j(:suppr}'essffwarningsP%)c}'errYv"WARNING! In Reg_Cl_lPlane_Curve::locatioգXn().\n"{<"Point is not in plane of regular closed plane curve.\n"h<"Returning -2.\n\n" M ush;returnA潷I۫2N;gRegus4wClus4Planeus4Curv9eLc}'opy(this뷫);if(r}'efffpt 6=origin9)pt00S=&r}'efffptBw=Rc}'opyfı:shift}(r}'efffpt );=LDFUU2002.11.05.qSimpli ed.o=P9oint2c}'opyffnormall#=c}'opyW:getffnormal0t();if(DEBUGY)c}'opyffnormalP9ointad::%epsilonE^())=LDF82003.06.14.h Changed.r0will8alwaysbGepositive,=soI8nowlongertakeitsabsolutevqalue.=fif*9j(:suppr}'essffwarningsP%)c}'errYv"WARNING! In Reg_Cl_lPlane_Curve::locatioգXn().\n"{<"Point is not in plane of regular closed plane curve.\n"h<"Returning -2.\n\n" M ush;returnA潷I۫2N;gRegus4wClus4Planeus4Curv9eLc}'opy(this뷫);if(r}'efffpt 6=origin9)pt00S=&r}'efffptBw=Rc}'opyfı:shift}(r}'efffpt );=LDFUU2002.11.05.qSimpli ed.o=P9oint2c}'opyffnormall#=c}'opyW:getffnormal0t();if(DEBUGY)c}'opyffnormal:dotlab}'el!("pt0"Y);pt0-i>:show("pt0"Y);gT ransformKt3V;P9oint2pt1E=c}'opyW:getffp}'oint'bH(0);pt1&0U=8r}'efffptQw;pt1#i=:unitffve}'ctor0u(trueĘ);P9oint2xffaxisM~(1;0;0);P9oint2zffaxisL:(0;0;1);if(orientation4:WX_YFW_8orientation6s7X_Z w)fif)(pt10S6=xffaxis`^8pt1i36= 6xffaxis%)f(t32Lϱ:alignffwithffaxis@x(r}'efffpt;pt1;'x');(c}'opy?W=NKr}'efffptjV=z,pt0\=t37;ggelse*.6if5.(orientation4:WZ_Y w)fif)(pt10S6=zffaxis^8pt1i36= -6zffaxis$ѫ)f(t32Lϱ:alignffwithffaxis@x(r}'efffpt;pt1;'z');(c}'opy?W=NKt3Y2;(r}'efffptC=SGFt3];(pt0:0W=It3T Y;ggrealus4wpairCprrMuԫ;real*0pt0ffvB;=[LDFT2002.11.05.]T7V*ertical.o=real*0pt0ffhBPK;=[LDFT2002.11.05.]T7Horizontal.o=if(orientation4:WX_Y w)fpt0ffh8d6=pt00S:getffxg();pt0ffv80=pt00S:getffyt(); ?n썫264LOCAJTIONXOFAPOINT3DLDFPRÎGx946n@Pg else*.6if5.(orientation4:WX_Z w)fpt0ffh8d6=pt00S:getffxg();pt0ffv80=pt00S:getffz();gelse*.6if5.(orientation4:WZ_Y w)fpt0ffh8d6=pt00S:getffz();pt0ffv80=pt00S:getffyt();gelse+fc}'err7|UƬ"ERROR! In Reg_Cl_Plopane_Curve::location(4).\n"S92"orientation has invalid value: ""orientation7o"\nReturning -5\n\n"o\ ush;returnA潷I۫5N;grr k=solve('v'F_;pt0ffhGë);=[LDFT2002.11.05.]T7TOUUDO:Explain.o=if(rr +6zffaxis$ѫ)f(t32Lϱ:alignffwithffaxis@x(r}'efffpt;pt1;'z');(c}'opy?W=NKt3Y2;(r}'efffptC=SGFt3];(pt0:0W=It3T Y;ggrealus4wpairCprrMuԫ;real*0pt0ffvB;=[LDFT2002.11.05.]T7V*ertical.o=real*0pt0ffhBPK;=[LDFT2002.11.05.]T7Horizontal.o=if(orientation4:WX_Y w)fpt0ffh8d6=pt00S:getffxg();pt0ffv80=pt00S:getffyt(); ;Ġn썷x9493DLDFPRÎGLOCAJTIONXOFAPOINT267n@Pg else*.6if5.(orientation4:WX_Z w)fpt0ffh8d6=pt00S:getffxg();pt0ffv80=pt00S:getffz();gelse*.6if5.(orientation4:WZ_Y w)fpt0ffh8d6=pt00S:getffz();pt0ffv80=pt00S:getffyt();gelse+fc}'err7|UƬ"ERROR! In Reg_Cl_Plopane_Curve::location(4).\n"S92"orientation has invalid value: ""orientation7o"\nReturning -5\n\n"o\ ush;returnA潷I۫5N;grr k=solve('v'F_;pt0ffhGë);=[LDFT2002.11.05.]T7TOUUDO:Explain.o=if(rr Q: rst|·INVALID_REALD<^8rr >1:se}'cond n߷INVALID_REALBM\)fif)(DEBUGY)f(c}'out> S"Point is outside rekgular closed plane cƠurve. " "Returning -1.\n"\M;(c}'out> S"Exiting Reg_Cl_Planke_Curve::location()\Ơn";greturnA潷I۫1N;gelse)if4:((fabs2ҫ(fabs(pt0ffvil)1fabsd(rr Q: rst)) S"Point is inside regkular closed plane cuƠrve. ""Returning 1.\n"WMP;(c}'out> S"Exiting Reg_Cl_Planke_Curve::location()\Ơn";(getcharI&();greturnA潫1F;gelse*.6if5.(fabs2ҫ(pt0ffvil)>fabs(rr -Q: rst))=ThisUUcaseshouldneveroGccur,Ibelieve.q[LDFT2002.11.05.]SzWhyUUnot??o=fif)(DEBUGY)f(c}'out>U"Point is outside rel~gular closed plane c~urve. "D"Returning -1.\n"`i<"Exiting Reg_Cl_Plane_Curve::location()\ n";(getcharI&();greturnA潷I۫1N;gelse+fc}'err7|UƬ"ERROR! In Reg_Cl_Plopane_Curve::location(4).\n"S92"This can't happen! Returning -3.\n"M ush; P'n썷x9463DLDFPRÎGLOCAJTIONXOFAPOINT265n@Pgetchar?%(); if)(DEBUGY)c}'out O"Exiting Reg_Cl_Planke_Curve::location()\Ơn";returnA潷I۫3N;g -g SeeXalsosections948,951,952,953,954,955,956,957,958,959,960,962,and965.ThisXcoU"Point is outside rel~gular closed plane c~urve. "D"Returning -1.\n"`i<"Exiting Reg_Cl_Plane_Curve::location()\ n";(getcharI&();greturnA潷I۫1N;gelse+fc}'err7|UƬ"ERROR! In Reg_Cl_Plopane_Curve::location(4).\n"S92"This can't happen! Returning -3.\n"M ush; L]n썫268LOCAJTIONXOFAPOINT3DLDFPRÎGx949n@Pgetchar?%(); if)(DEBUGY)c}'out O"Exiting Reg_Cl_Planke_Curve::location()\Ơn";returnA潷I۫3N;g +g SeeXalsosections951,954,955,956,957,958,959,960,961,962,963,965,and968.ThisXco 8BeginTLogJʄ`> +TheBversionsofinterse}'ctionffpointsTͫ()bGelongingtoclassesderivedfromRegus4wClus4Planeus4Curv9eo}twillmostlikelyP&callonthefunctionsdescribGedinthissection,cpassingc}'enter ׫asther}'efffpt?argument.However,cthisneednot[bGethecase,]iandRegus4wClus4Planeus4Curv9est8lneednothave[ameaningfulc}'entereW.+r}'efffpt inthesefunctionsmerelyUUreferstotheP9oint"DwhichshouldbGeplacedattheoriginbythetransformation.q[LDFT2003.07.16.]953. P9ointTarguments.9Ȅ`+U 8Log)j`+U [LDFT2003.06.20.]ZdRewrote~thisfunction. AThepGerpendicular~andnon-parallel,Bnon-coplanarcasesarehandledUUinexactlythesameway*.qInUUthesecases,therecanonlybGeoneintersectionpoint.Planeg::interse}'ctionffpointNګ()UUandRegus4wClus4Planeus4Curv9emL::lo}'cation#()arenowusedto ndit,ifitexists. [LDFT2003.06.20.]YThe!!coplanarcasewastheonethatwascausingdiculty*.*Thecopyof !"this-isnowalwayscputintothex-zplane,gevenifitisinoneofthema8jorplanes,gorinaplaneparalleltooneofthese.Theadvqantageofthis,Qisthatitsimpli esthecoGde.Thedisadvantageis,QthatadditionalrotationsreducetheUUaccuracyofthecalculationoftheintersectionpGoints. [LDFT2003.06.20.]YkT @@ -3513,16 +3558,16 @@ [LDFT2003.07.01.]Y9Addedtrue2assilentĮargumenttounitffve}'ctor4B()whenIcallitoncr}'osss./Thispreventsunitffve}'ctor0u()O]fromissuingawarningmessage,whencr}'ossثhasmagnitude0,whichoGccurswhensurfac}'effvectorand@ptffve}'ctor.1are@colinear.jSincethiscaseishandledcorrectly*,thewarningmessagesareunnecessaryanddistracting. [LDFT2003.07.01.]XBUG9FIX::Madechangestothewayonffse}'gment8risusedinthecoplanarcase.hThewayitUUwasbGeforehandledcertaincaseswrong. [LDFT2003.07.04.]XvRemovedunreachablestatementatendoffunction:)return'~Dbpp7u-.AHGCCòdidn'tcomplain,butUUtheDECcompilerissuedawarning. -[LDFT2003.07.16.]YChangedknameofc}'enter"kargumenttor}'efffpt],qbGecauseI'vemadec}'enter"kadatamembGerofUURegus4wClus4Planeus4Curv9elL.Ȅ` 8EndTLogA>`hDeclareUURegus4wClus4Planeus4Curv9eoBfunctions@940i+ aNn썷x9503DLDFPRÎGPOINTXARGUMENTS267n@P -virtual/bQoolus4wpoin9tus4pairinterse}'ctionffpoints(P9ointr}'efffpt7ᐱ;P9oint Ep0,;P9oint Ep1)UUconst*;951.hDe neUURegus4wClus4Planeus4Curv9eoBfunctions@946i+ -bQoolus4wpoin9tus4pair[Regus4wClus4Planeus4Curv9eŨ::interse}'ctionffpointsR(P9oint;r}'efffpt8-;P9oint tpt00O;P9oint tpt1)2constLRfUUbQoolDEBUG:,=falsev\;=true=if)(DEBUGY)(c}'out> S" *** Entering Reg_Ckl_Plane_Curve::","intersection_pointsk()\n"TM ush;bQoolus4wpoin9tus4pairodbpp"=INVALID_BOOL_POINT_PAIR| ;;Plane>6plJ3ޫ=getffplane+>();if)(DEBUGY)pl6 :normal V:show("pl.normal":FG);P9oint":show("cross"%FS);(pl16:normal V:show("pl.normal":FG);gshort;ʦdistanc}'eb׻=pl #:getffdistanc}'e4y(pt0i;):se}'condǫ;952. DegenerateTcases,errorhandling.hDe neUURegus4wClus4Planeus4Curv9eoBfunctions@946i+ +[LDFT2003.07.16.]YChangedknameofc}'enter"kargumenttor}'efffpt],qbGecauseI'vemadec}'enter"kadatamembGerofUURegus4wClus4Planeus4Curv9elL.Ȅ`GhDeclareUURegus4wClus4Planeus4Curv9eoBfunctions@943i+