Inkscape
Vector Graphics Editor
|
Go to the source code of this file.
Functions | |
static Geom::Point | rot90_rel (Geom::Point o, Geom::Point n) |
Returns a unit-length vector at 90 degrees to the direction from o to n. | |
static guint32 | point_unique_int (Geom::Point o) |
Returns a unique 32 bit int for a given point. | |
static guint32 | lcg_next (guint32 const prev) |
Returns the next pseudorandom value using the Linear Congruential Generator algorithm (LCG) with the parameters (m = 2^32, a = 69069, b = 1). | |
static double | rnd (guint32 const seed, unsigned steps) |
Returns a random number in the range [-0.5, 0.5) from the given seed, stepping the given number of steps from the seed. | |
static Geom::Point | sp_star_get_curvepoint (SPStar *star, SPStarPoint point, gint index, bool previ) |
void | sp_star_position_set (SPStar *star, gint sides, Geom::Point center, gdouble r1, gdouble r2, gdouble arg1, gdouble arg2, bool isflat, double rounded, double randomized) |
Geom::Point | sp_star_get_xy (SPStar const *star, SPStarPoint point, gint index, bool randomized) |
sp_star_get_xy: Get X-Y value as item coordinate system @star: star item @point: point type to obtain X-Y value @index: index of vertex : pointer to store X-Y value @randomized: false (default) if you want to get exact, not randomized point | |
Returns the next pseudorandom value using the Linear Congruential Generator algorithm (LCG) with the parameters (m = 2^32, a = 69069, b = 1).
These parameters give a full-period generator, i.e. it is guaranteed to go through all integers < 2^32 (see http://random.mat.sbg.ac.at/~charly/server/server.html)
Definition at line 280 of file sp-star.cpp.
Referenced by rnd().
|
static |
Returns a unique 32 bit int for a given point.
Obvious (but acceptable for my purposes) limits to uniqueness:
Definition at line 264 of file sp-star.cpp.
References floor(), Geom::X, and Geom::Y.
Referenced by sp_star_get_curvepoint(), and sp_star_get_xy().
|
static |
Returns a random number in the range [-0.5, 0.5) from the given seed, stepping the given number of steps from the seed.
Definition at line 289 of file sp-star.cpp.
References lcg_next().
Referenced by sp_star_get_curvepoint(), and sp_star_get_xy().
|
static |
Returns a unit-length vector at 90 degrees to the direction from o to n.
Definition at line 252 of file sp-star.cpp.
References Geom::Point::ccw(), and Geom::Point::normalized().
Referenced by sp_star_get_curvepoint().
|
static |
Definition at line 298 of file sp-star.cpp.
References SPStar::flatsided, index, Geom::L2(), point_unique_int(), SPStar::randomized, rnd(), rot90_rel(), SPStar::rounded, SPStar::sides, sp_star_get_xy(), SP_STAR_POINT_KNOT1, and SP_STAR_POINT_KNOT2.
Referenced by SPStar::set_shape().
Geom::Point sp_star_get_xy | ( | SPStar const * | star, |
SPStarPoint | point, | ||
gint | index, | ||
bool | randomized | ||
) |
sp_star_get_xy: Get X-Y value as item coordinate system @star: star item @point: point type to obtain X-Y value @index: index of vertex : pointer to store X-Y value @randomized: false (default) if you want to get exact, not randomized point
Initial item coordinate system is same as document coordinate system.
Definition at line 604 of file sp-star.cpp.
References SPStar::arg, SPStar::center, index, MAX, point_unique_int(), SPStar::r, SPStar::randomized, rnd(), shift(), and SPStar::sides.
Referenced by SPMeshNodeArray::create(), and sp_star_get_curvepoint().
void sp_star_position_set | ( | SPStar * | star, |
gint | sides, | ||
Geom::Point | center, | ||
gdouble | r1, | ||
gdouble | r2, | ||
gdouble | arg1, | ||
gdouble | arg2, | ||
bool | isflat, | ||
double | rounded, | ||
double | randomized | ||
) |
Definition at line 432 of file sp-star.cpp.
References SPStar::arg, SPStar::center, SPStar::flatsided, MAX, SPStar::r, SPStar::randomized, SPObject::requestDisplayUpdate(), SPStar::rounded, and SPStar::sides.
Referenced by Inkscape::UI::Tools::StarTool::drag().