Skip to content

Commit

Permalink
Update class diagrams
Browse files Browse the repository at this point in the history
Add Gradient class diagrams
  • Loading branch information
phthtgvi committed Jan 6, 2024
1 parent c5ae7b3 commit 2d5195b
Show file tree
Hide file tree
Showing 18 changed files with 934 additions and 282 deletions.
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

0 comments on commit 2d5195b

Please sign in to comment.