Skip to content

Commit

Permalink
Update class diagrams
Browse files Browse the repository at this point in the history
Replace clang-uml (also remove .clang-uml config) to hpp2plantuml. These diagrams use for MIlestone 2 report
  • Loading branch information
phthtgvi committed Dec 11, 2023
1 parent 51a7f67 commit 5386e36
Show file tree
Hide file tree
Showing 14 changed files with 787 additions and 187 deletions.
30 changes: 0 additions & 30 deletions .clang-uml

This file was deleted.

Binary file added docs/diagrams/All.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
330 changes: 330 additions & 0 deletions docs/diagrams/All.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,330 @@
@startuml





/' Objects '/

class Circle {
+Circle(float radius, const Vector2Df& center, mColor fill, mColor stroke, float stroke_width)
+getClass() : std::string {query}
}


class Ell {
+Ell(const Vector2Df& radius, const Vector2Df& center, mColor fill, mColor stroke, float stroke_width)
+getRadius() : Vector2Df {query}
-radius : Vector2Df
+getClass() : std::string {query}
+printData() : void {query}
+setRadius(const Vector2Df& radius) : void
}


class Group {
+Group()
+Group(Attributes attributes)
+~Group()
-attributes : Attributes
+getAttributes() : Attributes {query}
+getClass() : std::string {query}
+getElements() : std::vector<SVGElement*> {query}
-shapes : std::vector<SVGElement*>
+addElement(SVGElement* shape) : void
+printData() : void {query}
}


class Line {
+Line(const Vector2Df& point1, const Vector2Df& point2, mColor stroke, float stroke_width)
-direction : Vector2Df
+getDirection() : Vector2Df {query}
+getLength() : float {query}
+getClass() : std::string {query}
+setDirection(const Vector2Df& direction) : void
}


class Parser {
-Parser(const std::string& file_name)
+~Parser()
-parseCircle(xml_node<>* node, const mColor& fill_color, const mColor& stroke_color, float stroke_width) : Circle*
+getRoot() : Group*
-parseLine(xml_node<>* node, const mColor& stroke_color, float stroke_width) : Line*
+{static} getInstance(const std::string& file_name) : Parser*
-parsePath(xml_node<>* node, const mColor& fill_color, const mColor& stroke_color, float stroke_width) : Path*
-parseRect(xml_node<>* node, const mColor& fill_color, const mColor& stroke_color, float stroke_width) : Rect*
-parseElements(std::string file_name) : SVGElement*
-parseShape(xml_node<>* node) : SVGElement*
-root : SVGElement*
-parseText(xml_node<>* node, const mColor& fill_color, const mColor& stroke_color, float stroke_width) : Text*
-parseEllipse(xml_node<>* node, const mColor& fill_color, const mColor& stroke_color, float stroke_width) : class Ell*
-parsePolygon(xml_node<>* node, const mColor& fill_color, const mColor& stroke_color, float stroke_width) : class Plygon*
-parsePolyline(xml_node<>* node, const mColor& fill_color, const mColor& stroke_color, float stroke_width) : class Plyline*
-getFloatAttribute(xml_node<>* node, std::string name) : float
-parseColor(xml_node<>* node, std::string color) : mColor
-{static} instance : static Parser*
-getAttribute(xml_node<>* node, std::string name) : std::string
-parsePathPoints(xml_node<>* node) : std::vector<PathPoint>
-parsePoints(xml_node<>* node) : std::vector<Vector2Df>
-getTransformOrder(xml_node<>* node) : std::vector<std::string>
+printShapesData() : void
}


class Path {
+Path(const mColor& fill, const mColor& stroke, float stroke_width)
-fill_rule : std::string
+getClass() : std::string {query}
+getFillRule() : std::string {query}
+getPoints() : std::vector<PathPoint> {query}
-points : std::vector<PathPoint>
+addPoint(PathPoint point) : void
+printData() : void {query}
+setFillRule(std::string fill_rule) : void
}


class Plygon {
+Plygon(mColor fill, mColor stroke, float stroke_width)
-fill_rule : std::string
+getClass() : std::string {query}
+getFillRule() : std::string {query}
+setFillRule(std::string fill_rule) : void
}


class Plyline {
+Plyline(const mColor& fill, const mColor& stroke, float stroke_width)
-fill_rule : std::string
+getClass() : std::string {query}
+getFillRule() : std::string {query}
+setFillRule(std::string fill_rule) : void
}


abstract class PolyShape {
#PolyShape(const mColor& fill, const mColor& stroke, float stroke_width)
+{abstract} getClass() : std::string {query}
#points : std::vector<Vector2Df>
+getPoints() : std::vector<Vector2Df>& {query}
+addPoint(const Vector2Df& point) : void
+printData() : void {query}
}


class Rect {
+Rect(float width, float height, Vector2Df position, Vector2Df radius, const mColor& fill, const mColor& stroke, float stroke_width)
+getRadius() : Vector2Df {query}
-radius : Vector2Df
+getHeight() : float {query}
+getWidth() : float {query}
-height : float
-width : float
+getClass() : std::string {query}
+printData() : void {query}
+setHeight(float height) : void
+setRadius(const Vector2Df& radius) : void
+setWidth(float width) : void
}


class Renderer {
-Renderer()
+{static} getInstance() : Renderer*
-{static} instance : static Renderer*
-applyTransform(std::vector<std::string> transform_order, Gdiplus::Graphics& graphics) : void {query}
+draw(Gdiplus::Graphics& graphics, Group* group) : void {query}
-drawCircle(Gdiplus::Graphics& graphics, Circle* circle) : void {query}
-drawEllipse(Gdiplus::Graphics& graphics, Ell* ellipse) : void {query}
-drawLine(Gdiplus::Graphics& graphics, Line* line) : void {query}
-drawPath(Gdiplus::Graphics& graphics, Path* path) : void {query}
-drawPolygon(Gdiplus::Graphics& graphics, Plygon* polygon) : void {query}
-drawPolyline(Gdiplus::Graphics& graphics, Plyline* polyline) : void {query}
-drawRectangle(Gdiplus::Graphics& graphics, Rect* rectangle) : void {query}
-drawText(Gdiplus::Graphics& graphics, Text* text) : void {query}
}


abstract class SVGElement {
#SVGElement()
+~SVGElement()
+getParent() : SVGElement* {query}
#parent : SVGElement*
+getPosition() : Vector2Df {query}
-position : Vector2Df
+getOutlineThickness() : float {query}
-stroke_width : float
-fill : mColor
-stroke : mColor
+getFillColor() : mColor& {query}
+getOutlineColor() : mColor& {query}
+{abstract} getClass() : std::string {query}
+getTransforms() : std::vector<std::string> {query}
-transforms : std::vector<std::string>
+addElement(SVGElement* element) : void
+printData() : void {query}
+setFillColor(const mColor& color) : void
+setOutlineColor(const mColor& color) : void
+setOutlineThickness(float thickness) : void
+setParent(SVGElement* parent) : void
+setPosition(float x, float y) : void
+setPosition(const Vector2Df& position) : void
+setTransforms(const std::vector<std::string>& transforms) : void
}


class Text {
+Text(Vector2Df pos, std::string text, float font_size, const mColor& fill, const mColor& stroke, float stroke_width)
-font_size : float
+getFontSize() : float {query}
-anchor : std::string
-content : std::string
+getAnchor() : std::string {query}
+getClass() : std::string {query}
+getContent() : std::string {query}
+getFontStyle() : std::string {query}
-style : std::string
+printData() : void {query}
+setAnchor(std::string anchor) : void
+setContent(std::string content) : void
+setFontSize(float font_size) : void
+setFontStyle(std::string style) : void
}


class Vector2D <template<typename T>> {
+Vector2D()
+Vector2D(T X, T Y)
+Vector2D(const Vector2D<U>& vector)
+x : T
+y : T
}


class Viewer {
-Viewer()
+~Viewer()
-last_mouse_pos : POINT
+{static} getInstance() : Viewer*
-is_dragging : bool
+needs_repaint : bool
+offset_x : float
+offset_y : float
+rotate_angle : float
+zoom_factor : float
-{static} instance : static Viewer*
-handleKeyDown(WPARAM wParam) : void
+handleKeyEvent(WPARAM wParam) : void
-handleLeftButtonDown(LPARAM lParam) : void
-handleLeftButtonUp() : void
+handleMouseEvent(UINT message, WPARAM wParam, LPARAM lParam) : void
-handleMouseMove(LPARAM lParam) : void
-handleMouseWheel(WPARAM wParam) : void
}


class mColor {
+mColor()
+mColor(int red, int green, int blue, int alpha)
+mColor(int color)
+a : int
+b : int
+g : int
+r : int
+{static} Black : static const mColor
+{static} Blue : static const mColor
+{static} Cyan : static const mColor
+{static} Green : static const mColor
+{static} Magenta : static const mColor
+{static} Red : static const mColor
+{static} Transparent : static const mColor
+{static} White : static const mColor
+{static} Yellow : static const mColor
+operator<<(std::ostream& os, const mColor& color) : std :: ostream&
}


class PathPoint {
+Point : Vector2Df
+TC : char
}





/' Inheritance relationships '/

.Ell <|-- .Circle


.PolyShape <|-- .Plygon


.PolyShape <|-- .Plyline


.PolyShape <|-- .Rect


.SVGElement <|-- .Ell


.SVGElement <|-- .Group


.SVGElement <|-- .Line


.SVGElement <|-- .Path


.SVGElement <|-- .PolyShape


.SVGElement <|-- .Text





/' Aggregation relationships '/

.Group o-- .SVGElement


.Parser --> .Parser : -instance


.Parser o-- .SVGElement


.Path *-- .PathPoint


.Renderer --> .Renderer : -instance


.SVGElement --> .SVGElement : #parent


.SVGElement "2" *-- .mColor


.Viewer --> .Viewer : -instance


.mColor "9" *-- .mColor






/' Nested objects '/



@enduml
Binary file modified docs/diagrams/Parser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5386e36

Please sign in to comment.