-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Gradient class diagrams
- Loading branch information
Showing
18 changed files
with
934 additions
and
282 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.