Paper Writing Services scene -> SCENE IDENTIFIER number_list grapcs END ‘.’ grapcs -> grapc grapcs | grapc grapc -> text | transformable_grapc transformations END transformable_grapc

Abstract
(500, 500) Isosceles Color (0.0, 0.0, 1.0) Angle 90; Rotate Angle 45; Translate (100.0, 0.0); Scale (50.0, 50.0); End RegularPolygon Color (1.0, 0.0, 0.0) Sides 7; Translate (-100.0, 0.0); Scale (75.0, 75.0); End Parallelogram Color (0.0, 1.0, 0.0) Angle 45; Rotate Angle 45; Translate (100.0, -100.0); Scale (90.0, 90.0); End Text Color(0.0, 0.0, 0.0) at (-200., 200.) “Hello

The second project builds on the first project by adding the ability to specify transformations of some of the grapc objects. The specification for those objects now will require less information about their position and size because both will be able to be modified using the transformations. As before, you must complete the skeleton project provided by defining some of the remaining classes. The UML diagram for the whole project is shown below: The code for all the classes shown in black is provided in the attached .zip file.  You must complete the project by writing those classes shown in red. The skeleton project contains a parser that will parse a scene definition file that defines the scene to be displayed. The new grammar for the scene definition file is shown below: scene -> SCENE IDENTIFIER number_list grapcs END ‘.’ grapcs -> grapc grapcs | grapc grapc -> text | transformable_grapc transformations END transformable_grapc -> isosceles | parallelogram | regular_polygon isosceles -> ISOSCELES COLOR number_list ANGLE NUMBER ‘;’ parallelogram -> PARALLELOGRAM COLOR number_list ANGLE NUMBER ‘;’ regular_polygon -> REGULAR_POLYGON COLOR number_list SIDES NUMBER RADIUS NUMBER ‘;’ text -> TEXT COLOR number_list AT number_list STRING ‘;’ transformations -> transformation transformations | transformation transformation -> rotation | scaling | translation rotation -> ROTATE ANGLE NUMBER ‘;’ scaling -> SCALE number_list ‘;’ translation -> TRANSLATE number_list ‘;’ number_list -> ‘(‘ numbers ‘)’ numbers -> NUMBER | NUMBER ‘,’ numbers Below is a description of the modifications required to each of the five classes from the first project: The Text class is unchanged from the first project. The ConvexPolygon class must now have an additional data element, wch is a vector of pointers to Transformations. The constructor must now be passed ts vector in addition to what was previously required. The draw function must now perform each of the transformations before drawing the object. The constructor for the IsoscelesTriangle class will now require the list of transformation and the color, but the only information specifying the shape will the angle of the top vertex. The base of the triangle should be centered at the origin and the height of the triangle should be 1.  It should perform the transformations using the built in functions of OpenGL, glTranslated, glRotated, and glScaled for translating, rotating and scaling respectively. The constructor for the Parallelogram class will now require the list of transformation and the color, but the only information specifying the shape will be the angle of the lower left vertex. The lower left vertex should be placed at the origin, the top and bottom sides should be parallel to the x-axis and all sizes should have a length of 1. It should perform the transformations using the built in matrix multiplication function of OpenGL, glMultMatrixd. The constructor of the RegularPolygon class will now require the list of transformation and the color, but the only information specifying the shape will be the number of sides. The center of the polygon should be placed at the origin and the radius should be 1.   It should perform the transformations using the built in functions of OpenGL, glTranslated, glRotated, and glScaled for translating, rotating and scaling respectively. In addition to modifying the above classes, you must write the following new classes: The Rotation class must have a member variable containing the angle of rotation, wch is passed to and saved by the constructor, so that it can be used to call the rotate method defined in the Transformable interface, when the transform method that it is required to implement, is called. The Translation class must have member variables containing the x and y distances of translation, wch are passed to and saved by the constructor, so that they can be used to call the translate method defined in the Transformable interface, when the transform method that it is required to implement, is called. The Scaling class must have member variables containing the x and y scale factors, wch are passed to and saved by the constructor, so that they can be used to call the scale method defined in the Transformable interface, when the transform method that it is required to implement, is called. Sample Input and Output Below is a sample of a scene definition file that would provide input to the program: Scene Polygons (500, 500) Isosceles Color (0.0, 0.0, 1.0) Angle 90; Rotate Angle 45; Translate (100.0, 0.0); Scale (50.0, 50.0); End RegularPolygon Color (1.0, 0.0, 0.0) Sides 7; Translate (-100.0, 0.0); Scale (75.0, 75.0); End Parallelogram Color (0.0, 1.0, 0.0) Angle 45; Rotate Angle 45; Translate (100.0, -100.0); Scale (90.0, 90.0); End Text Color(0.0, 0.0, 0.0) at (-200., 200.) “Hello World”; End. Shown below is the scene that should be produced when the program is provided with the above scene definition.

Sample references
  • (‘He, J., Staggs, V. S., Bergquist? Beringer, S., & Dunton, N. (2013). Unit-level timetrends and seasonality in the rate of hospital-acquired pressure ulcers in USacute care hospitals. Research in Nursing & Health, 36(2), 171-180.’,)
  • (‘Kundzewicz, Z. W., L. J. Mata, N. W. Arnell, P. Döll, P. Kabat, B. Jiménez, K. A. Miller, T. Oki, Z. Sen, and I. A. Shiklomanov. 2007. Freshwater res … (205 characters truncated) … imate Change, M. L. Parry, O. F. Canziani, J. P. Palutikof, P. J. van der Linden, and C. E. Hanson, eds. Cambridge, U.K.: Cambridge University Press.’,)
  • (‘Baba, VV & HakemZadeh, F. 2012. Toward a theory of evidence based decision-making. Mgt Dec., 50: 832-67 ‘,)
  • (‘Gullison, R. E., P. C. Frumhoff, J. G. Canadell, C. B. Field, D. C. Nepstad, K. Hayhoe, R. Avissar, L. M. Curran, P. Friedlingstein, C. D. Jones, and C. Nobre. 2007. Environment: Tropical forests and climate policy. Science 316(5827):985-986.’,)

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer