Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update class diagrams #33

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified 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.
307 changes: 196 additions & 111 deletions diagrams/All.puml

Large diffs are not rendered by default.

Binary file removed diagrams/Color.png
Binary file not shown.
51 changes: 0 additions & 51 deletions diagrams/Color.puml

This file was deleted.

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





/' Objects '/

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


abstract class SVGElement {
#SVGElement()
#SVGElement(const ColorShape& fill, const ColorShape& stroke, float stroke_width)
#SVGElement(const ColorShape& fill, const ColorShape& stroke, float stroke_width, const Vector2Df& position)
+~SVGElement()
-fill : ColorShape
-stroke : ColorShape
+getFillColor() : ColorShape& {query}
+getOutlineColor() : ColorShape& {query}
+getGradient() : Gradient* {query}
-gradient : Gradient*
+getParent() : SVGElement* {query}
#parent : SVGElement*
+getMaxBound() : Vector2Df {query}
+getMinBound() : Vector2Df {query}
+getPosition() : Vector2Df {query}
-position : Vector2Df
+getOutlineThickness() : float {query}
-stroke_width : float
+{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 ColorShape& color) : void
+setGradient(Gradient* gradient) : void
+setOutlineColor(const ColorShape& 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 Stop {
+Stop(const ColorShape& color, float offset)
-color : ColorShape
+getColor() : ColorShape {query}
+getOffset() : float {query}
-offset : float
}





/' Inheritance relationships '/




/' Aggregation relationships '/

.SVGElement *-- .ColorShape

.Stop *-- .ColorShape






/' Nested objects '/



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





/' Objects '/

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

abstract class Gradient {
+Gradient(vector<Stop> stops,
pair<Vector2Df, Vector2Df> points, string units)
+~Gradient()
+getPoints() : pair<Vector2Df , Vector2Df> {query}
-points : pair<Vector2Df, Vector2Df>
+{abstract} getClass() : string {query}
+getUnits() : string {query}
-units : string
+getStops() : vector<Stop> {query}
-stops : vector<Stop>
+getTransforms() : vector<string> {query}
-transforms : vector<string>
+addStop(Stop stop) : void
+setTransforms(vector<string> transforms) : void
+setUnits(string units) : void
}

class LinearGradient {
+LinearGradient(vector<Stop> stops,
pair<Vector2Df, Vector2Df> points, string units)
+getClass() : string {query}
}


class Parser {
-Parser(const string& file_name)
+~Parser()
-parseCircle(xml_node<>* node, const ColorShape& fill_color, const ColorShape& stroke_color, float stroke_width) : Circle*
-parseColor(xml_node<>* node, string color, string& id) : ColorShape
-parseGradient(string id) : Gradient*
+getRoot() : Group*
-parseLine(xml_node<>* node, const ColorShape& stroke_color, float stroke_width) : Line*
+{static} getInstance(const string& file_name) : Parser*
-parsePath(xml_node<>* node, const ColorShape& fill_color, const ColorShape& stroke_color, float stroke_width) : Path*
-parseRect(xml_node<>* node, const ColorShape& fill_color, const ColorShape& stroke_color, float stroke_width) : Rect*
-parseElements(string file_name) : SVGElement*
-parseShape(xml_node<>* node) : SVGElement*
-root : SVGElement*
-parseText(xml_node<>* node, const ColorShape& fill_color, const ColorShape& stroke_color, float stroke_width) : Text*
+getViewPort() : Vector2Df {query}
-viewport : Vector2Df
-parseEllipse(xml_node<>* node, const ColorShape& fill_color, const ColorShape& stroke_color, float stroke_width) : class Ell*
-parsePolygon(xml_node<>* node, const ColorShape& fill_color, const ColorShape& stroke_color, float stroke_width) : class Plygon*
-parsePolyline(xml_node<>* node, const ColorShape& fill_color, const ColorShape& stroke_color, float stroke_width) : class Plyline*
-getFloatAttribute(xml_node<>* node, string name) : float
-{static} instance : static Parser*
-gradients : map<string, Gradient*>
+getViewBox() : pair<Vector2Df , Vector2Df> {query}
-viewbox : pair<Vector2Df, Vector2Df>
-getAttribute(xml_node<>* node, string name) : string
-parsePathPoints(xml_node<>* node) : vector<PathPoint>
-getGradientStops(xml_node<>* node) : vector<Stop>
-parsePoints(xml_node<>* node) : vector<Vector2Df>
-getTransformOrder(xml_node<>* node) : vector<string>
-GetGradients(xml_node<>* node) : void
+printShapesData() : void
}

class RadialGradient {
+RadialGradient(vector<Stop> stops, pair<Vector2Df, Vector2Df> points,
Vector2Df radius, string units)
+getRadius() : Vector2Df {query}
-radius : Vector2Df
+getClass() : string {query}
}

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


class Stop {
+Stop(const ColorShape& color, float offset)
-color : ColorShape
+getColor() : ColorShape {query}
+getOffset() : float {query}
-offset : float
}

/' Inheritance relationships '/

.Gradient <|-- .LinearGradient


.Gradient <|-- .RadialGradient


/' Aggregation relationships '/

.Gradient *-- .Stop

.Parser o-- .Gradient


.Parser --> .Parser : -instance


.Parser o-- .SVGElement


.SVGElement *-- .ColorShape


.SVGElement o-- .Gradient

.Stop *-- .ColorShape


/' Nested objects '/



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