2#ifndef SEEN_SP_SPIRAL_H
3#define SEEN_SP_SPIRAL_H
17#define noSPIRAL_VERBOSE
19#define SP_EPSILON 1e-5
20#define SP_EPSILON_2 (SP_EPSILON * SP_EPSILON)
23#define SPIRAL_TOLERANCE 3.0
24#define SAMPLE_STEP (1.0/4.0)
43 int tag()
const override {
return tag_of<
decltype(*this)>; }
64 void update(
SPCtx *ctx,
unsigned int flags)
override;
68 const char*
typeName()
const override;
constexpr int tag_of
Convenience function to retrieve the tag (class id) of a given type.
3x3 matrix representing an affine transformation.
Sequence of contiguous curves, aka spline.
Two-dimensional point that doubles as a vector.
Storing of snapping preferences.
Interface for refcounted XML nodes.
Typed SVG document implementation.
Inkscape::XML::Node * repr
Base class for shapes, including <path> element.
void update_patheffect(bool write) override
void set_shape() override
bool isInvalid() const
Return true if spiral has properties that make it invalid.
void build(SPDocument *doc, Inkscape::XML::Node *repr) override
Geom::Point getTangent(double t) const
Returns the derivative of sp_spiral_get_xy with respect to t, scaled to a unit vector.
void update(SPCtx *ctx, unsigned int flags) override
void fitAndDraw(Geom::Path &c, double dstep, Geom::Point darray[], Geom::Point const &hat1, Geom::Point &hat2, double *t) const
Fit beziers together to spiral and draw it.
float revo
Spiral revolution factor.
const char * typeName() const override
The item's type name, not node tag name.
float exp
Spiral expansion factor.
float arg
Spiral argument.
const char * displayName() const override
The item's type name as a translated human string.
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override
void setPosition(double cx, double cy, double exp, double revo, double rad, double arg, double t0)
Set spiral properties and update display.
char * description() const override
void getPolar(double t, double *rad, double *arg) const
Compute rad and/or arg for point on spiral.
Geom::Affine set_transform(Geom::Affine const &xform) override
Set spiral transform.
void snappoints(std::vector< Inkscape::SnapCandidatePoint > &p, Inkscape::SnapPreferences const *snapprefs) const override
Geom::Point getXY(double t) const
Return one of the points on the spiral.
static cairo_user_data_key_t key
Interface for XML documents.