diff options
| author | Denis Declara <declara91@gmail.com> | 2012-05-19 12:51:48 +0000 |
|---|---|---|
| committer | Denis Declara <declara91@gmail.com> | 2012-05-19 12:51:48 +0000 |
| commit | 24e2360f100a9372e7f2d0af894ec1b2d1357ace (patch) | |
| tree | 86d2a0bf872f83599e80ba1a9d5b516968b31eef /src | |
| parent | Renamed "arrangetab.h" to "arrange-tab.h" (diff) | |
| download | inkscape-24e2360f100a9372e7f2d0af894ec1b2d1357ace.tar.gz inkscape-24e2360f100a9372e7f2d0af894ec1b2d1357ace.zip | |
Added documentation and made helper functions in polar-arrange-tab.cpp static
(bzr r11073.1.34)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/dialog/polar-arrange-tab.cpp | 22 | ||||
| -rw-r--r-- | src/ui/dialog/polar-arrange-tab.h | 17 |
2 files changed, 32 insertions, 7 deletions
diff --git a/src/ui/dialog/polar-arrange-tab.cpp b/src/ui/dialog/polar-arrange-tab.cpp index 32f05c5e8..2056c7820 100644 --- a/src/ui/dialog/polar-arrange-tab.cpp +++ b/src/ui/dialog/polar-arrange-tab.cpp @@ -140,7 +140,7 @@ PolarArrangeTab::PolarArrangeTab(ArrangeDialog *parent_) * @param center center of the rotation to perform * @param rotation amount to rotate the object by */ -void rotateAround(SPItem *item, Geom::Point center, Geom::Rotate const &rotation) +static void rotateAround(SPItem *item, Geom::Point center, Geom::Rotate const &rotation) { Geom::Translate const s(center); Geom::Affine affine = Geom::Affine(s).inverse() * Geom::Affine(rotation) * Geom::Affine(s); @@ -167,7 +167,7 @@ void rotateAround(SPItem *item, Geom::Point center, Geom::Rotate const &rotation * @param count number of objects in the selection * @param n index of the object in the selection */ -float calcAngle(float arcBegin, float arcEnd, int count, int n) +static float calcAngle(float arcBegin, float arcEnd, int count, int n) { float arcLength = arcEnd - arcBegin; float delta = std::abs(std::abs(arcLength) - 2*M_PI); @@ -182,10 +182,10 @@ float calcAngle(float arcBegin, float arcEnd, int count, int n) } /** - * Calculates the point at which the object needs to be, given the center of the ellipse, + * Calculates the point at which an object needs to be, given the center of the ellipse, * it's radius (x and y), as well as the angle */ -Geom::Point calcPoint(float cx, float cy, float rx, float ry, float angle) +static Geom::Point calcPoint(float cx, float cy, float rx, float ry, float angle) { return Geom::Point(cx + cos(angle) * rx, cy + sin(angle) * ry); } @@ -197,7 +197,7 @@ Geom::Point calcPoint(float cx, float cy, float rx, float ry, float angle) * @todo still using a hack to get the real coordinate space (subtracting document height * and inverting axes) */ -Geom::Point getAnchorPoint(int anchor, SPItem *item) +static Geom::Point getAnchorPoint(int anchor, SPItem *item) { Geom::Point source; @@ -254,7 +254,17 @@ Geom::Point getAnchorPoint(int anchor, SPItem *item) return source; } -void moveToPoint(int anchor, SPItem *item, Geom::Point p) +/** + * Moves an SPItem to a given location, the location is based on the given anchor point. + * @param anchor 0 to 8 are the various bounding box points like follows: + * 0 1 2 + * 3 4 5 + * 6 7 8 + * Anchor mode 9 is the rotational center of the object + * @param item Item to move + * @param p point at which to move the object + */ +static void moveToPoint(int anchor, SPItem *item, Geom::Point p) { sp_item_move_rel(item, Geom::Translate(p - getAnchorPoint(anchor, item))); } diff --git a/src/ui/dialog/polar-arrange-tab.h b/src/ui/dialog/polar-arrange-tab.h index 3481bc4a0..019b64511 100644 --- a/src/ui/dialog/polar-arrange-tab.h +++ b/src/ui/dialog/polar-arrange-tab.h @@ -23,13 +23,17 @@ namespace Dialog { class ArrangeDialog; +/** + * PolarArrangeTab is a Tab displayed in the Arrange dialog and contains + * enables the user to arrange objects on a circular or elliptical shape + */ class PolarArrangeTab : public ArrangeTab { public: PolarArrangeTab(ArrangeDialog *parent_); virtual ~PolarArrangeTab() {}; /** - * Do the actual work + * Do the actual arrangement */ virtual void arrange(); @@ -85,3 +89,14 @@ private: } //namespace Inkscape #endif /* INKSCAPE_UI_DIALOG_POLAR_ARRANGE_TAB_H */ + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : |
