I'll attach files but I just need the programming portion of this. Not the report. I also have source code for the GL part. I have a lot of text/jpg files too that I can't upload all.
Microsoft Word - project1.docx CSCE4813–ProgrammingProject#1 DueDate–01/31/2020at11:59pm REVISED 1.ProblemStatement: Whenspreadsheetsoftwarewasintroducedinthe1980’sitdramaticallychanged howpeoplecouldstore,manipulateandvisualizedata.Thespreadsheet’ssimple userinterfaceenableduserstoeasilyenterrowsandcolumnsofdata,doarithmetic calculations,andmostimportantlydisplaytheresultsineasilyunderstoodcharts. Inthisprogrammingproject,youwillbedevelopingacollectionoffunctionsthat willletuserscreateanddisplaydatausingthefourtypesofchartsabove. Ifwelookcloselyatthesefourcharts,youwillseethatthebackgroundinformation forallfourofthesechartsarethesame. • Theyalldisplayaseriesofevenlyspacedhorizontallines. • TheyalldisplayevenlyspacedticmarksontheXandYaxis. • Theyalldisplaynumericalvaluesadjacenttotheticmarksontheaxes. • Theyalldisplaythenameofthedatafieldbeingdisplayed Themajordifferencebetweenthesefourchartsishowtheyconveyinformation aboutdatavaluesusingdifferentgeometricobjects. • Foracolumnchart,theheightofeachcolumnisdeterminedbythedata valuerelativetotheheightofthechart.Thewidthofeachcolumncanbe determinedbydividingthewidthofthechartbythenumberofdatavalues beingdisplayed. • Forapointchart,datavaluesaredisplayedusingpointsrepresentedby squares,diamonds,orcircles.Inthiscase,theXandYlocationsofpointsare determinedbythemagnitudeofthedatavaluerelativetotheheightand widthofthechart. • Foralinechart,dataisdisplayedusingasequenceoflinesegmentsthat connectthepointlocationsofthedata.Inthiscase,thewidthofthelineis chosentobelargerthanthescalelinessothelinesegmentsarevisible. • Fortheareachart,dataisdisplayedbyfillingintheareaunderthelinechart withasolidcolor.Thisareacanbedefinedusingacollectionofpolygons whereeachpolygonhasonelinesegmentgoingthroughtwodatapointsand threelinesegmentsthatmarktheright,bottom,andleftsidesofthearea beingenclosed. 1.1ChartCreation Forthisprogrammingassignment,yourfirsttaskistoimplementaC++program thatpromptstheusertoenterthenameoftheirinputdatafile,andthetypeofchart theywouldliketocreate(column,point,line,area).Yourprogramshouldthenread intheinputdatafile,dothenecessarycalculationstoscalethisdatatothesizeof theoutputwindow,andthenoutputasequenceofgraphicscommandstocreatethe specifiedchart. Youroutputchartsshouldlookassimilaraspossibletothefourexamplesabove.To simplifythisproject,youareNOTrequiredtooutputthenumbersthatareadjacent totheticmarksinthechartsorthenamedatafieldbeingdisplayed.Youonlyneed todrawlinesinthebackgroundandthegeometricobjectsrepresentingdatavalues. Thefourgraphicscommandswewillbeusingforthisprojectare: • set_color#R#G#B Thiscommandsetsthecolorofthe“pen”inthegraphicsprogram.Allobject drawnafterthiscommandwillbedisplayedwiththiscoloruntilanother set_colorcommandisexecuted.ThecolorvaluesforR,G,Bshouldbe floatingpointvaluesbetween0and1,where0=black,and1=fullcolor. • draw_point#size#x#y Thiscommanddrawsapointofthespecifiedsizeatthespecifiedlocation. Thesizevalueshouldbeanintegerbetween[1..10].The(x,y)coordinates shouldbeintegersbetween[0..width-1]and[0..height-1]respectively. • draw_line#width#x1#y1#x2#y2 Thiscommanddrawsalineofthespecifiedwidthfrom(x1,y1)to(x2,y2). Thewidthvalueshouldbeanintegerbetween[1..10].The(x,y)coordinates shouldbeintegersbetween[0..width-1]and[0..height-1]respectively. • draw_polygon#N#x1#y1#x2#y2…#xN#yN Thiscommandfillsinaconvexpolygonregionthatisdefinedbyasequence ofNpoints.ThevalueNshouldbeanintegergreaterthanorequalto3that specifiesthenumberofpointsonthepolygonboundary.The(x,y) coordinatesofeachpointshouldbeintegersbetween[0..width-1]and [0..height-1]respectively. 1.2ChartDisplay YoursecondtaskistoimplementanOpenGLprogramthatreadsasequenceof commandsintheformatabove,andcallstheappropriateOpenGLcommandsto displaythecorrespondingchartonthescreen.YouwillbegivenaskeletonOpenGL programthatdemonstrateshowtodraweachofthegraphicsprimitivesabove. Todemonstratethecorrectnessofyourprogram,youshouldrunyourfirstprogram tofourtimestogeneratefoursequencesofoutputcommands,andsavethese commandsinfourdatafiles.ThenyoushouldrunyourOpenGLprogramfourtimes togenerateimagesofthesecharts.Whenyourprogramisworking,doscreen capturesofyourfourchartsandincludetheseimagesintoyourprojectreport. 2.Design: Foreachofthecharttypesabove,themajordesigntaskistoworkoutwhat sequenceofgraphicscommandsareneeded,andexactlywhatx_posy_posvaluesto usewhendisplayingthesegeometricobjects.Thekeyhereistoworkoutthescale factorsyouneedtousetoconverttherawdatavaluesintocoordinatesthatare withinthechart.Forexample,ifthedatavaluesgofrom1..100andtheheightofthe chartis500pixels,thenthescalefactorshouldbe500/100=5.Youwillnoticethat thereissmallborderaroundtheoutsideofthedrawingarea.Yourprogramwill needtotakethisborderintoaccountwhendisplayinggraphicsobjects. 3.Implementation: ThissemesterwewillbeusingC++andOpenGLtoimplementallofour programmingprojects.IfyouareusingaMacwithXcodeinstalled,thenyoucan downloadthesrc.tarfileandcompilethesamplegraphicscodeusingtheenclosed Makefile.IfyouareusingaPC,thenyourbestoptionwouldbetodownloadand installaLinuxVMfromthedepartment’swebsite.Theinstructionsfordoingthis arepostedinREADMEfilethe“SourceCode”pageoftheclasswebsite.Onceyou haveLinuxandOpenGLinstalled,youcancompileyourgraphicsprogramusing “g++-Wallshow_chart.cpp-oshow_chart-lGL-lGLU-lglut”. YouareencouragedtolookatsampleOpenGLprogramstoseehowthe“main” functionandthe“display”functionarenormallyimplemented.Asalways,you shouldbreakthecodeintoappropriatefunctions,andthenaddcodeincrementally writingcomments,addingcode,compiling,debugging,alittlebitatatime. Remembertousegoodprogrammingstylewhencreatingyourprogram.Choose goodnamesforvariablesandconstants,useproperindentingforloopsand conditionals,andincludeclearcommentsinyourcode.Also,besuretosavebackup copiesofyourprogramsomewheresafe.Otherwise,youmayendupretypingyour wholeprogramifsomethinggoeswrong. 4.Testing: Testyourprogramwithdifferentrandomnumbergeneratorseedsuntilyouget someimagesthatlookfun/interesting.Takeascreenshotoftheseimagesto includeinyourprojectreport.Youmayalsowanttoshowsomebad/uglyimages thatillustratewhathappensifthereisaproblemsomewhere(e.g.toomanylines, linestooshort,etc.).Youcandiscusshowyoucorrectedtheseproblemsinyour projectreport. 5.Documentation: WhenyouhavecompletedyourC++program,writeashortreportusingtheproject reporttemplatedescribingwhattheobjectiveswere,whatyoudid,andthestatusof theprogram.Besuretoincludeseveraloutputimages.Finally,describeanyknown problemsand/oryourideasonhowtoimproveyourprogram.Savethisreporttobe submittedelectronicallyviaBlackboard. 6.ProjectSubmission: Inthisclass,wewillbeusingelectronicprojectsubmissiontomakesurethatall studentshandtheirprogrammingprojectsandlabsontime,andtoperform automaticplagiarismanalysisofallprogramsthataresubmitted.Whenyouhave completedthetasksabovegotoBlackboardtouploadyourdocumentation(asingle docxorpdffile),andallofyourC++programfiles.DoNOTuploadanexecutable versionofyourprogram. Thedatesonyourelectronicsubmissionwillbeusedtoverifythatyoumetthedue dateabove.Alllateprojectswillreceivereducedcredit: • 10%offiflessthan1daylate, • 20%offiflessthan2dayslate, • 30%offiflessthan3dayslate, • nocreditifmorethan3dayslate. Youwillreceivepartialcreditforallprogramsthatcompileeveniftheydonotmeet allprogramrequirements,sohandingprojectsinontimeishighlyrecommended. 7.AcademicHonestyStatement: Studentsareexpectedtosubmittheirownworkonallprogrammingprojects, unlessgroupprojectshavebeenexplicitlyassigned.StudentsareNOTallowedto distributecodetoeachother,orcopycodefromanotherindividualorwebsite. StudentsAREallowedtouseanymaterialsontheclasswebsite,orinthetextbook, orasktheinstructorand/orGTAsforassistance. Thiscoursewillbeusinghighlyeffectiveprogramcomparisonsoftwaretocalculate thesimilarityofallprogramstoeachother,andtohomeworkassignmentsfrom previoussemesters.Pleasedonotbetemptedtoplagiarizefromanotherstudent. ViolationsofthepoliciesabovewillbereportedtotheProvost'sofficeandmay resultinaZEROontheprogrammingproject,anFintheclass,orsuspensionfrom theuniversity,dependingontheseverityoftheviolationandanyhistoryofprior violations.