@@ -174,47 +174,121 @@ class ofxSvg : public ofxSvgGroup {
174174 ofxSvgCssClass& getCurrentCss () { return mCurrentCss ;}
175175
176176 ofxSvgCssStyleSheet& getCssStyleSheet () {return mSvgCss ; }
177- // / \brief Add a group to the document. This will also push back the group as current.
177+ // / \brief Add a ofxSvgGroup to the document. This will also push back the group as current.
178178 // / \param aname is the name of the group.
179179 // / \return std::shared_ptr<ofxSvgGroup> as the group that was created.
180180 std::shared_ptr<ofxSvgGroup> addGroup (std::string aname);
181181
182+ // / \brief Add a ofxSvgPath to the document. The ofxSvgPath will be added to the current group.
183+ // / \param ofPath apath is the path to be added.
184+ // / \return std::shared_ptr<ofxSvgPath> as the path that was created and added to the document.
182185 std::shared_ptr<ofxSvgPath> add ( const ofPath& apath );
186+ // / \brief Add multiple ofxSvgPaths to the document. The ofxSvgPaths will be added to the current group.
187+ // / \param std::vector<ofPath> apaths are the paths to be added.
188+ // / \return std::vector< std::shared_ptr<ofxSvgPath> > the paths that were created and added to the document.
183189 std::vector< std::shared_ptr<ofxSvgPath> > add ( const std::vector<ofPath>& apaths );
184-
190+ // / \brief Add a ofxSvgPath to the document. The ofxSvgPath will be added to the current group.
191+ // / \param ofPolyline apoly is the polyline that will create an ofxSvgPath and added.
192+ // / \return std::shared_ptr<ofxSvgPath> as the path that was created and added to the document.
185193 std::shared_ptr<ofxSvgPath> add ( const ofPolyline& apoly );
194+ // / \brief Add multiple ofxSvgPaths to the document. The ofxSvgPaths will be added to the current group.
195+ // / \param std::vector<ofPolyline> apolys are the polylines used to create and add ofxSvgPaths to the document.
196+ // / \return std::vector< std::shared_ptr<ofxSvgPath> > the paths that were created and added to the document.
186197 std::vector< std::shared_ptr<ofxSvgPath> > add ( const std::vector<ofPolyline>& apolys );
187198
199+ // / \brief Add a ofxSvgRectangle to the document. The ofxSvgRectangle will be added to the current group.
200+ // / \param ofRectangle arect is the rectangle that will create an ofxSvgRectangle.
201+ // / \return std::shared_ptr<ofxSvgRectangle> as the rectangle that was created and added to the document.
188202 std::shared_ptr<ofxSvgRectangle> add ( const ofRectangle& arect );
203+ // / \brief Add a ofxSvgRectangle to the document. The ofxSvgRectangle will be added to the current group.
204+ // / \param ofRectangle arect is the rectangle that will create an ofxSvgRectangle.
205+ // / \param float aRoundRadius is the corner radius used to round the corners.
206+ // / \return std::shared_ptr<ofxSvgRectangle> as the rectangle that was created and added to the document.
189207 std::shared_ptr<ofxSvgRectangle> add ( const ofRectangle& arect, float aRoundRadius );
190208
209+ // / \brief Add a ofxSvgCircle to the document. The ofxSvgCircle will be added to the current group.
210+ // / The default position is 0,0. Use the returned ofxSvgCircle to set properties directly.
211+ // / \param float aradius is the radius used to create an ofxSvgCircle.
212+ // / \return std::shared_ptr<ofxSvgCircle> as the circle that was created and added to the document.
191213 std::shared_ptr<ofxSvgCircle> addCircle ( float aradius );
214+ // / \brief Add a ofxSvgCircle to the document. The ofxSvgCircle will be added to the current group.
215+ // / \param glm::vec2 apos is the center position of the circle.
216+ // / \param float aradius is the radius used to create an ofxSvgCircle.
217+ // / \return std::shared_ptr<ofxSvgCircle> as the circle that was created and added to the document.
192218 std::shared_ptr<ofxSvgCircle> addCircle ( const glm::vec2& apos, float aradius );
219+ // / \brief Add a ofxSvgCircle to the document. The ofxSvgCircle will be added to the current group.
220+ // / \param glm::vec3 apos is the center position of the circle. Note: z is not used.
221+ // / \param float aradius is the radius used to create an ofxSvgCircle.
222+ // / \return std::shared_ptr<ofxSvgCircle> as the circle that was created and added to the document.
193223 std::shared_ptr<ofxSvgCircle> addCircle ( const glm::vec3& apos, float aradius );
224+ // / \brief Add a ofxSvgCircle to the document. The ofxSvgCircle will be added to the current group.
225+ // / \param float ax is the x center position of the circle.
226+ // / \param float ay is the y center position of the circle.
227+ // / \param float aradius is the radius used to create an ofxSvgCircle.
228+ // / \return std::shared_ptr<ofxSvgCircle> as the circle that was created and added to the document.
194229 std::shared_ptr<ofxSvgCircle> addCircle ( const float & ax, const float & ay, float aradius );
195230
231+ // / \brief Add a ofxSvgEllipse to the document. The ofxSvgEllipse will be added to the current group.
232+ // / The default position is 0,0. Use the returned ofxSvgEllipse to set properties directly.
233+ // / \param float aradiusX is the horizontal radius used to create an ofxSvgEllipse.
234+ // / \param float aradiusY is the vertical radius used to create an ofxSvgEllipse.
235+ // / \return std::shared_ptr<ofxSvgEllipse> as the ellipse that was created and added to the document.
196236 std::shared_ptr<ofxSvgEllipse> addEllipse ( float aradiusX, float aradiusY );
237+ // / \brief Add a ofxSvgEllipse to the document. The ofxSvgEllipse will be added to the current group.
238+ // / The default position is 0,0. Use the returned ofxSvgEllipse to set properties directly.
239+ // / \param glm::vec2 apos is the center position of the ellipse.
240+ // / \param float aradiusX is the horizontal radius used to create an ofxSvgEllipse.
241+ // / \param float aradiusY is the vertical radius used to create an ofxSvgEllipse.
242+ // / \return std::shared_ptr<ofxSvgEllipse> as the ellipse that was created and added to the document.
197243 std::shared_ptr<ofxSvgEllipse> addEllipse ( const glm::vec2& apos, float aradiusX, float aradiusY );
244+ // / \brief Add a ofxSvgEllipse to the document. The ofxSvgEllipse will be added to the current group.
245+ // / The default position is 0,0. Use the returned ofxSvgEllipse to set properties directly.
246+ // / \param glm::vec3 apos is the center position of the ellipse. Note: z is not used.
247+ // / \param float aradiusX is the horizontal radius used to create an ofxSvgEllipse.
248+ // / \param float aradiusY is the vertical radius used to create an ofxSvgEllipse.
249+ // / \return std::shared_ptr<ofxSvgEllipse> as the ellipse that was created and added to the document.
198250 std::shared_ptr<ofxSvgEllipse> addEllipse ( const glm::vec3& apos, float aradiusX, float aradiusY );
251+ // / \brief Add a ofxSvgEllipse to the document. The ofxSvgEllipse will be added to the current group.
252+ // / The default position is 0,0. Use the returned ofxSvgEllipse to set properties directly.
253+ // / \param float ax is the x center position of the ellipse.
254+ // / \param float ay is the y center position of the ellipse.
255+ // / \param float aradiusX is the horizontal radius used to create an ofxSvgEllipse.
256+ // / \param float aradiusY is the vertical radius used to create an ofxSvgEllipse.
257+ // / \return std::shared_ptr<ofxSvgEllipse> as the ellipse that was created and added to the document.
199258 std::shared_ptr<ofxSvgEllipse> addEllipse ( const float & ax, const float & ay, float aradiusX, float aradiusY );
200259
260+ // / \brief Add a ofxSvgImage to the document. The ofxSvgImage will be added to the current group.
261+ // / The default position is 0,0. Use the returned ofxSvgImage to set properties directly.
262+ // / \param of::filesystem::path apath is the path to the linked image file.
263+ // / \param ofTexture atex provides the width and height of the image.
264+ // / \return std::shared_ptr<ofxSvgImage> as the image that was created and added to the document.
201265 std::shared_ptr<ofxSvgImage> addImage ( const of::filesystem::path& apath, const ofTexture& atex );
266+ // / \brief Add a ofxSvgImage to the document. The ofxSvgImage will be added to the current group.
267+ // / \param glm::vec2 apos is the position; anchored to the top left.
268+ // / \param of::filesystem::path apath is the path to the linked image file.
269+ // / \param ofTexture atex provides the width and height of the image.
270+ // / \return std::shared_ptr<ofxSvgImage> as the image that was created and added to the document.
202271 std::shared_ptr<ofxSvgImage> addImage ( const glm::vec2& apos, const of::filesystem::path& apath, const ofTexture& atex );
272+ // / \brief Add a ofxSvgImage to the document. The ofxSvgImage will be added to the current group.
273+ // / \param of::filesystem::path apath is the path to the linked image file.
274+ // / \param float awidth provides the width of the image.
275+ // / \param float aheight provides the height of the image.
276+ // / \return std::shared_ptr<ofxSvgImage> as the image that was created and added to the document.
277+ std::shared_ptr<ofxSvgImage> addImage ( const of::filesystem::path& apath, const float & awidth, const float & aheight );
278+ // / \brief Add a ofxSvgImage to the document. The ofxSvgImage will be added to the current group.
279+ // / \param glm::vec2 apos is the position; anchored to the top left.
280+ // / \param of::filesystem::path apath is the path to the linked image file.
281+ // / \param float awidth provides the width of the image.
282+ // / \param float aheight provides the height of the image.
283+ // / \return std::shared_ptr<ofxSvgImage> as the image that was created and added to the document.
284+ std::shared_ptr<ofxSvgImage> addImage ( const glm::vec2& apos, const of::filesystem::path& apath, const float & awidth, const float & aheight );
285+ // / \brief Add a ofxSvgImage to the document. The ofxSvgImage will be added to the current group.
286+ // / \param glm::vec2 apos is the position; anchored to the top left.
287+ // / \param ofPixels apixels is the pixels to embed in the svg document. Note: This can increase file size dramatically.
288+ // / \return std::shared_ptr<ofxSvgImage> as the image that was created and added to the document.
203289 std::shared_ptr<ofxSvgImage> addEmbeddedImage ( const glm::vec2& apos, const ofPixels& apixels );
204290
205- // adapted from ofGLProgrammableRenderer for some sort of conformity
206- // this will be handled by the ofNode functionality
207- // void pushMatrix();
208- // bool popMatrix();
209- // void translate(float x, float y);
210- // void translate(const glm::vec2 & p);
211- // void scale(float xAmnt, float yAmnt);
212- // void rotateRadians(float radians);
213- // void rotateDegrees(float adegrees);
214- // void multMatrix(const glm::mat4 & m);
215- // void loadMatrix(const glm::mat4 & m);
216- // void loadIdentityMatrix();
217-
291+ // / \brief Used for development to provide insight into anchor point / control point placements.
218292 virtual void drawDebug ();
219293
220294protected:
@@ -243,11 +317,6 @@ class ofxSvg : public ofxSvgGroup {
243317 void _setNodeParentGroupStack ( std::shared_ptr<ofxSvgElement> aele );
244318
245319 ofxSvgGroup* _getPushedGroup ();
246- // bool _hasPushedMatrix();
247- // void _applyModelMatrixToElement( std::shared_ptr<ofxSvgElement> aele, glm::vec2 aDefaultPos );
248- // glm::vec2 _getPos2d(const glm::mat4& amat);
249- // glm::vec2 _getScale2d(const glm::mat4& amat);
250- // float _getZRotationRadians( const glm::mat4& amat );
251320
252321 ofxSvgCssClass& _addCssClassFromPath ( std::shared_ptr<ofxSvgPath> aSvgPath );
253322 void _addCssClassFromPath ( std::shared_ptr<ofxSvgPath> aSvgPath, ofXml& anode );
0 commit comments