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

Add ViewBox documentation #35

Merged
merged 2 commits 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.
26 changes: 22 additions & 4 deletions diagrams/All.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/' Objects '/


class Circle {
+Circle(float radius, const Vector2Df& center, ColorShape fill, ColorShape stroke, float stroke_width)
+getClass() : string {query}
Expand Down Expand Up @@ -293,6 +294,20 @@ class Vector2D <template<typename T>> {
}


class ViewBox {
+ViewBox()
+ViewBox(float X, float Y, float W, float H)
+getHeight() : float {query}
+getWidth() : float {query}
+getX() : float {query}
+getY() : float {query}
-h : float
-w : float
-x : float
-y : float
}


class Viewer {
-Viewer()
+~Viewer()
Expand Down Expand Up @@ -327,8 +342,6 @@ class PathPoint {





/' Inheritance relationships '/

.Ell <|-- .Circle
Expand Down Expand Up @@ -387,17 +400,22 @@ class PathPoint {
.Parser o-- .SVGElement


.Path *-- .PathPoint
.Parser *-- .ViewBox


.Renderer --> .Renderer : -instance
.Path *-- .PathPoint

.Renderer --> .Renderer : -instance

.SVGElement *-- .ColorShape


.SVGElement o-- .Gradient


.SVGElement o-- .SVGElement


.Stop *-- .ColorShape


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





/' Objects '/

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


class ViewBox {
+ViewBox()
+ViewBox(float X, float Y, float W, float H)
+getHeight() : float {query}
+getWidth() : float {query}
+getX() : float {query}
+getY() : float {query}
-h : float
-w : float
-x : float
-y : float
}





/' Inheritance relationships '/




/' Aggregation relationships '/

.Parser o-- .Parser


.Parser *-- .ViewBox






/' Nested objects '/



@enduml
8 changes: 4 additions & 4 deletions docs/Circle_8cpp_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,16 @@
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="preprocessor">#include &quot;Circle.hpp&quot;</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160; </div>
<div class="line"><a name="l00003"></a><span class="lineno"><a class="line" href="classCircle.html#a5d018c51bfa1fa3d1081e3deef5eddc0"> 3</a></span>&#160;<a class="code" href="classCircle.html#a5d018c51bfa1fa3d1081e3deef5eddc0">Circle::Circle</a>(<span class="keywordtype">float</span> radius, <span class="keyword">const</span> <a class="code" href="classVector2D.html">Vector2Df</a> &amp;center, <a class="code" href="classmColor.html">mColor</a> fill,</div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160; <a class="code" href="classmColor.html">mColor</a> stroke, <span class="keywordtype">float</span> stroke_width)</div>
<div class="line"><a name="l00003"></a><span class="lineno"><a class="line" href="classCircle.html#ace05db36eae5455a95be7aaff49d1fd9"> 3</a></span>&#160;<a class="code" href="classCircle.html#ace05db36eae5455a95be7aaff49d1fd9">Circle::Circle</a>(<span class="keywordtype">float</span> radius, <span class="keyword">const</span> <a class="code" href="classVector2D.html">Vector2Df</a> &amp;center, <a class="code" href="classColorShape.html">ColorShape</a> fill,</div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160; <a class="code" href="classColorShape.html">ColorShape</a> stroke, <span class="keywordtype">float</span> stroke_width)</div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160; : <a class="code" href="classEll.html">Ell</a>(<a class="code" href="classVector2D.html">Vector2Df</a>(radius, radius), center, fill, stroke, stroke_width) {}</div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160; </div>
<div class="line"><a name="l00007"></a><span class="lineno"><a class="line" href="classCircle.html#a09523e46318092d42a5969a1da5613bb"> 7</a></span>&#160;std::string <a class="code" href="classCircle.html#a09523e46318092d42a5969a1da5613bb">Circle::getClass</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="stringliteral">&quot;Circle&quot;</span>; }</div>
<div class="ttc" id="aclassCircle_html_a09523e46318092d42a5969a1da5613bb"><div class="ttname"><a href="classCircle.html#a09523e46318092d42a5969a1da5613bb">Circle::getClass</a></div><div class="ttdeci">std::string getClass() const override</div><div class="ttdoc">Gets the type of the shape.</div><div class="ttdef"><b>Definition:</b> <a href="Circle_8cpp_source.html#l00007">Circle.cpp:7</a></div></div>
<div class="ttc" id="aclassCircle_html_a5d018c51bfa1fa3d1081e3deef5eddc0"><div class="ttname"><a href="classCircle.html#a5d018c51bfa1fa3d1081e3deef5eddc0">Circle::Circle</a></div><div class="ttdeci">Circle(float radius, const Vector2Df &amp;center, mColor fill, mColor stroke, float stroke_width)</div><div class="ttdoc">Constructs a Circle object.</div><div class="ttdef"><b>Definition:</b> <a href="Circle_8cpp_source.html#l00003">Circle.cpp:3</a></div></div>
<div class="ttc" id="aclassCircle_html_ace05db36eae5455a95be7aaff49d1fd9"><div class="ttname"><a href="classCircle.html#ace05db36eae5455a95be7aaff49d1fd9">Circle::Circle</a></div><div class="ttdeci">Circle(float radius, const Vector2Df &amp;center, ColorShape fill, ColorShape stroke, float stroke_width)</div><div class="ttdoc">Constructs a Circle object.</div><div class="ttdef"><b>Definition:</b> <a href="Circle_8cpp_source.html#l00003">Circle.cpp:3</a></div></div>
<div class="ttc" id="aclassColorShape_html"><div class="ttname"><a href="classColorShape.html">ColorShape</a></div><div class="ttdoc">Utility class for manipulating RGBA ColorShapes.</div><div class="ttdef"><b>Definition:</b> <a href="ColorShape_8hpp_source.html#l00011">ColorShape.hpp:11</a></div></div>
<div class="ttc" id="aclassEll_html"><div class="ttname"><a href="classEll.html">Ell</a></div><div class="ttdoc">Represents an ellipse in 2D space.</div><div class="ttdef"><b>Definition:</b> <a href="Ellipse_8hpp_source.html#l00012">Ellipse.hpp:12</a></div></div>
<div class="ttc" id="aclassVector2D_html"><div class="ttname"><a href="classVector2D.html">Vector2D&lt; float &gt;</a></div></div>
<div class="ttc" id="aclassmColor_html"><div class="ttname"><a href="classmColor.html">mColor</a></div><div class="ttdoc">Utility class for manipulating RGBA mColors.</div><div class="ttdef"><b>Definition:</b> <a href="Color_8hpp_source.html#l00011">Color.hpp:11</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath">
Expand Down
14 changes: 7 additions & 7 deletions docs/Circle_8hpp_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,23 @@
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno"><a class="line" href="classCircle.html"> 13</a></span>&#160;<span class="keyword">class </span><a class="code" href="classCircle.html">Circle</a> : <span class="keyword">public</span> <a class="code" href="classEll.html">Ell</a> {</div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; <a class="code" href="classCircle.html#a5d018c51bfa1fa3d1081e3deef5eddc0">Circle</a>(<span class="keywordtype">float</span> <a class="code" href="classEll.html#af57a48abe0e2bc8806e73dfa7762388f">radius</a>, <span class="keyword">const</span> <a class="code" href="classVector2D.html">Vector2Df</a> &amp;center, <a class="code" href="classmColor.html">mColor</a> <a class="code" href="classSVGElement.html#a6d3a39e763d3273715ea11f8959f81b1">fill</a>, <a class="code" href="classmColor.html">mColor</a> <a class="code" href="classSVGElement.html#aab937dcb566cd83d94d00d69b4083f13">stroke</a>,</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; <span class="keywordtype">float</span> <a class="code" href="classSVGElement.html#a88449b487a890e3765ae20e96ee95c06">stroke_width</a>);</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; <a class="code" href="classCircle.html#ace05db36eae5455a95be7aaff49d1fd9">Circle</a>(<span class="keywordtype">float</span> <a class="code" href="classEll.html#af57a48abe0e2bc8806e73dfa7762388f">radius</a>, <span class="keyword">const</span> <a class="code" href="classVector2D.html">Vector2Df</a> &amp;center, <a class="code" href="classColorShape.html">ColorShape</a> <a class="code" href="classSVGElement.html#af2a0e1a4228c0a6d02a26f35d8ac8c05">fill</a>,</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; <a class="code" href="classColorShape.html">ColorShape</a> <a class="code" href="classSVGElement.html#aab842e97c5d24c964607a6d6efa061f8">stroke</a>, <span class="keywordtype">float</span> <a class="code" href="classSVGElement.html#a88449b487a890e3765ae20e96ee95c06">stroke_width</a>);</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; std::string <a class="code" href="classCircle.html#a09523e46318092d42a5969a1da5613bb">getClass</a>() <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;};</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// CIRCLE_HPP_</span></div>
<div class="ttc" id="aclassCircle_html"><div class="ttname"><a href="classCircle.html">Circle</a></div><div class="ttdoc">Represents a circle in 2D space.</div><div class="ttdef"><b>Definition:</b> <a href="Circle_8hpp_source.html#l00013">Circle.hpp:13</a></div></div>
<div class="ttc" id="aclassCircle_html_a09523e46318092d42a5969a1da5613bb"><div class="ttname"><a href="classCircle.html#a09523e46318092d42a5969a1da5613bb">Circle::getClass</a></div><div class="ttdeci">std::string getClass() const override</div><div class="ttdoc">Gets the type of the shape.</div><div class="ttdef"><b>Definition:</b> <a href="Circle_8cpp_source.html#l00007">Circle.cpp:7</a></div></div>
<div class="ttc" id="aclassCircle_html_a5d018c51bfa1fa3d1081e3deef5eddc0"><div class="ttname"><a href="classCircle.html#a5d018c51bfa1fa3d1081e3deef5eddc0">Circle::Circle</a></div><div class="ttdeci">Circle(float radius, const Vector2Df &amp;center, mColor fill, mColor stroke, float stroke_width)</div><div class="ttdoc">Constructs a Circle object.</div><div class="ttdef"><b>Definition:</b> <a href="Circle_8cpp_source.html#l00003">Circle.cpp:3</a></div></div>
<div class="ttc" id="aclassCircle_html_ace05db36eae5455a95be7aaff49d1fd9"><div class="ttname"><a href="classCircle.html#ace05db36eae5455a95be7aaff49d1fd9">Circle::Circle</a></div><div class="ttdeci">Circle(float radius, const Vector2Df &amp;center, ColorShape fill, ColorShape stroke, float stroke_width)</div><div class="ttdoc">Constructs a Circle object.</div><div class="ttdef"><b>Definition:</b> <a href="Circle_8cpp_source.html#l00003">Circle.cpp:3</a></div></div>
<div class="ttc" id="aclassColorShape_html"><div class="ttname"><a href="classColorShape.html">ColorShape</a></div><div class="ttdoc">Utility class for manipulating RGBA ColorShapes.</div><div class="ttdef"><b>Definition:</b> <a href="ColorShape_8hpp_source.html#l00011">ColorShape.hpp:11</a></div></div>
<div class="ttc" id="aclassEll_html"><div class="ttname"><a href="classEll.html">Ell</a></div><div class="ttdoc">Represents an ellipse in 2D space.</div><div class="ttdef"><b>Definition:</b> <a href="Ellipse_8hpp_source.html#l00012">Ellipse.hpp:12</a></div></div>
<div class="ttc" id="aclassEll_html_af57a48abe0e2bc8806e73dfa7762388f"><div class="ttname"><a href="classEll.html#af57a48abe0e2bc8806e73dfa7762388f">Ell::radius</a></div><div class="ttdeci">Vector2Df radius</div><div class="ttdoc">Radii of the ellipse in the x and y directions.</div><div class="ttdef"><b>Definition:</b> <a href="Ellipse_8hpp_source.html#l00014">Ellipse.hpp:14</a></div></div>
<div class="ttc" id="aclassSVGElement_html_a6d3a39e763d3273715ea11f8959f81b1"><div class="ttname"><a href="classSVGElement.html#a6d3a39e763d3273715ea11f8959f81b1">SVGElement::fill</a></div><div class="ttdeci">mColor fill</div><div class="ttdoc">Fill color.</div><div class="ttdef"><b>Definition:</b> <a href="SVGElement_8hpp_source.html#l00222">SVGElement.hpp:222</a></div></div>
<div class="ttc" id="aclassSVGElement_html_a88449b487a890e3765ae20e96ee95c06"><div class="ttname"><a href="classSVGElement.html#a88449b487a890e3765ae20e96ee95c06">SVGElement::stroke_width</a></div><div class="ttdeci">float stroke_width</div><div class="ttdoc">Thickness of the shape's outline.</div><div class="ttdef"><b>Definition:</b> <a href="SVGElement_8hpp_source.html#l00224">SVGElement.hpp:224</a></div></div>
<div class="ttc" id="aclassSVGElement_html_aab937dcb566cd83d94d00d69b4083f13"><div class="ttname"><a href="classSVGElement.html#aab937dcb566cd83d94d00d69b4083f13">SVGElement::stroke</a></div><div class="ttdeci">mColor stroke</div><div class="ttdoc">Outline color.</div><div class="ttdef"><b>Definition:</b> <a href="SVGElement_8hpp_source.html#l00223">SVGElement.hpp:223</a></div></div>
<div class="ttc" id="aclassSVGElement_html_a88449b487a890e3765ae20e96ee95c06"><div class="ttname"><a href="classSVGElement.html#a88449b487a890e3765ae20e96ee95c06">SVGElement::stroke_width</a></div><div class="ttdeci">float stroke_width</div><div class="ttdoc">Thickness of the shape's outline.</div><div class="ttdef"><b>Definition:</b> <a href="SVGElement_8hpp_source.html#l00225">SVGElement.hpp:225</a></div></div>
<div class="ttc" id="aclassSVGElement_html_aab842e97c5d24c964607a6d6efa061f8"><div class="ttname"><a href="classSVGElement.html#aab842e97c5d24c964607a6d6efa061f8">SVGElement::stroke</a></div><div class="ttdeci">ColorShape stroke</div><div class="ttdoc">Outline color.</div><div class="ttdef"><b>Definition:</b> <a href="SVGElement_8hpp_source.html#l00224">SVGElement.hpp:224</a></div></div>
<div class="ttc" id="aclassSVGElement_html_af2a0e1a4228c0a6d02a26f35d8ac8c05"><div class="ttname"><a href="classSVGElement.html#af2a0e1a4228c0a6d02a26f35d8ac8c05">SVGElement::fill</a></div><div class="ttdeci">ColorShape fill</div><div class="ttdoc">Fill color.</div><div class="ttdef"><b>Definition:</b> <a href="SVGElement_8hpp_source.html#l00223">SVGElement.hpp:223</a></div></div>
<div class="ttc" id="aclassVector2D_html"><div class="ttname"><a href="classVector2D.html">Vector2D&lt; float &gt;</a></div></div>
<div class="ttc" id="aclassmColor_html"><div class="ttname"><a href="classmColor.html">mColor</a></div><div class="ttdoc">Utility class for manipulating RGBA mColors.</div><div class="ttdef"><b>Definition:</b> <a href="Color_8hpp_source.html#l00011">Color.hpp:11</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath">
Expand Down
Loading
Loading