ScrumptiousCS1C / Scrumdidly

1 stars 0 forks source link

Implement `shapes.txt` parser object/logic #4

Open Gryuuum opened 1 year ago

Gryuuum commented 1 year ago

Implementation of shapes.txt

ShapeId: # [int, unique]

ShapeType: Line, Polyline, Polygon, Rectangle, Square[rectangle, l=w], Ellipse, Circle[ellipse, a=b], Text

ShapeDimensions:

Line - x1, y1, x2, y2 [x2 points]
Polyline - x1, y1, x2, y2, x3, y3, ... , xN, yN [sequence of N points]
Polygon - x1, y1, x2, y2, x3, y3, ... , xN, yN [sequence of N points]
Rectangle - x1, y1, l, w [x1, y1: top left, l: length, w: width]
Square - x1, y1, l [x1, y1: top left, l: length]
Ellipse - x1, y1, a, b [x1, y1: top left, a: semi major axis, b: semi minor axis]
Circle - x1, y1, r [x1, y1: top left, r: radius]
Text - x1, y1, l, w [x1, y1: top left, l: length, w: width ... defines a bounding rectangle]

PenColor: white, black, red, green, blue, cyan, magenta, yellow, gray [Qt::GlobalColor enum]

PenWidth: 0 - 20 [int]

PenStyle: NoPen, SolidLine, DashLine, DotLine, DashDotLine, DashDotDotLine [Qt::PenStyle enum]

PenCapStyle: FlatCap, SquareCap, RoundCap [Qt::PenCapStyle enum]

PenJoinStyle: MiterJoin, BevelJoin, RoundJoin [Qt::PenJoinStyle enum]

BrushColor: white, black, red, green, blue, cyan, magenta, yellow, gray [Qt::GlobalColor enum]

BrushStyle: SolidPattern, HorPattern, VerPattern, NoBrush [Qt::BrushStyle enum]

TextString: text to be displayed [string]

TextColor: white, black, red, green, blue, cyan, magenta, yellow, gray [Qt::GlobalColor enum]

TextAlignment: AlignLeft, AlignRight, AlignTop, AlignBottom, AlignCenter [Qt::AlignmentFlag enum]

TextPointSize: -1 to 50 [int]

TextFontFamily: Comic Sans MS, Courier, Helvetica, Times [string]

TextFontStyle: StyleNormal, StyleItalic, StyleOblique [QFont::Style enum]

TextFontWeight: Thin, Light, Normal, Bold [QFont::Weight enum]


## `shapes.txt`
* This is the file included  on canvas, please use as reference, or copy completely.  This can be changed later and other features 
   can be added if we wish to do so.

ShapeId: 1 ShapeType: Line ShapeDimensions: 20, 90, 100, 20 PenColor: blue PenWidth: 2 PenStyle: DashDotLine PenCapStyle: FlatCap PenJoinStyle: MiterJoin

ShapeId: 2 ShapeType: Polyline ShapeDimensions: 460, 90, 470, 20, 530, 40, 540, 80 PenColor: green PenWidth: 6 PenStyle: SolidLine PenCapStyle: FlatCap PenJoinStyle: MiterJoin

ShapeId: 3 ShapeType: Polygon ShapeDimensions: 900, 90, 910, 20, 970, 40, 980, 80 PenColor: cyan PenWidth: 6 PenStyle: DashDotDotLine PenCapStyle: FlatCap PenJoinStyle: MiterJoin BrushColor: yellow BrushStyle: SolidPattern

ShapeId: 4 ShapeType: Rectangle ShapeDimensions: 20, 200, 170, 100 PenColor: blue PenWidth: 0 PenStyle: DashLine PenCapStyle: RoundCap PenJoinStyle: RoundJoin BrushColor: red BrushStyle: VerPattern

ShapeId: 5 ShapeType: Square ShapeDimensions: 250, 150, 200 PenColor: red PenWidth: 0 PenStyle: SolidLine PenCapStyle: RoundCap PenJoinStyle: RoundJoin BrushColor: blue BrushStyle: HorPattern

ShapeId: 6 ShapeType: Ellipse ShapeDimensions: 520, 200, 170, 100 PenColor: black PenWidth: 12 PenStyle: SolidLine PenCapStyle: FlatCap PenJoinStyle: MiterJoin BrushColor: white BrushStyle: NoBrush

ShapeId: 7 ShapeType: Circle ShapeDimensions: 750, 150, 200 PenColor: black PenWidth: 12 PenStyle: SolidLine PenCapStyle: FlatCap PenJoinStyle: MiterJoin BrushColor: magenta BrushStyle: SolidPattern

ShapeId: 8 ShapeType: Text ShapeDimensions: 250, 425, 500, 50 TextString: Class Project 2 - 2D Graphics Modeler TextColor: blue TextAlignment: AlignCenter TextPointSize: 10 TextFontFamily: Comic Sans MS TextFontStyle: StyleItalic TextFontWeight: Normal



### Completion Requirements
- [x] Program should read from shape file that keeps track of all shapes being rendered by the 2D modeler
- [x] Shapes are identified by their type: line, polyline, polygon, rectangle, ellipse, text
- [x] Shapes have properties: shape dimensions, pen color, pen width pen style, pen cap style, pen join style, brush color, brush 
       shape
- [x] Text has properties: shape dimensions, text string, text color, text alignment, text point size, text font family, text font style,    
        text font weight
- [x] All shapes must have unique ID

#### ALL PUSHES TO BE SENT TO BRANCH `shapes_parser`

UNDER NO CIRCUMSTANCES WILL ANY BRANCHES BE CREATED BRANCHED MERGED RENAMED OR DELETED WITHOUT PRIOR
APPROVAL FROM SCRUM MASTER.

ANY UNAPPROVED PUSHES TO MAIN BRANCH WITHOUT APPROVAL OF TEAM OR SCRUM MASTER ARE A DETRIMENT TO THE ENTIRE GROUPS GRADE. PLEASE BE CAREFUL WITH YOUR CHANGES AND PUSHES, ALWAYS MAKE SURE YOUR REPO IS UP TO DATE.

THANK YOU AND LOVE YOU ALL!

* Gryuuum
Gryuuum commented 1 year ago

@FalconistFalconist Is also assigned on this issue, I am only allowed to assign one team member per issue