pen-tool.h revision 4aeaa765c1779bb282e9cb7b8ad14cc1fae248ef
#ifndef SEEN_PEN_CONTEXT_H
#define SEEN_PEN_CONTEXT_H
/** \file
* PenTool: a context for pen tool events.
*/
#include "ui/tools/freehand-base.h"
#include "live_effects/effect.h"
#define SP_PEN_CONTEXT(obj) (dynamic_cast<Inkscape::UI::Tools::PenTool*>((Inkscape::UI::Tools::ToolBase*)obj))
#define SP_IS_PEN_CONTEXT(obj) (dynamic_cast<const Inkscape::UI::Tools::PenTool*>((const Inkscape::UI::Tools::ToolBase*)obj) != NULL)
struct SPCtrlLine;
/**
* PenTool: a context for pen tool events.
*/
PenTool();
enum Mode {
};
enum State {
};
/** \invar npoints in {0, 2, 5}. */
// npoints somehow determines the type of the node (what does it mean, exactly? the number of Bezier handles?)
bool polylines_only;
bool polylines_paraxial;
// propiety which saves if Spiro mode is active or not
bool spiro;
bool bspline;
int num_clicks;
unsigned int expecting_clicks_for_LPE; // if positive, finish the path after this many clicks
Inkscape::LivePathEffect::Effect *waiting_LPE; // if NULL, waiting_LPE_type in SPDrawContext is taken into account
bool events_disabled;
void setPolylineMode();
bool hasWaitingLPE();
void waitForLPEMouseClicks(Inkscape::LivePathEffect::EffectType effect_type, unsigned int num_clicks, bool use_polylines = true);
//adds spiro & bspline modes
//this function changes the colors red, green and blue making them transparent or not depending on if the function uses spiro
void _bspline_spiro_color();
//creates a node in bspline or spiro modes
void _bspline_spiro(bool shift);
//creates a node in bspline or spiro modes
void _bspline_spiro_on();
//creates a CUSP node
void _bspline_spiro_off();
//continues the existing curve in bspline or spiro mode
void _bspline_spiro_start_anchor(bool shift);
//continues the existing curve with the union node in bspline or spiro modes
void _bspline_spiro_start_anchor_on();
//continues an existing curve with the union node in CUSP mode
void _bspline_spiro_start_anchor_off();
//modifies the "red_curve" when it detects movement
void _bspline_spiro_motion(bool shift);
//closes the curve with the last node in bspline or spiro mode
void _bspline_spiro_end_anchor_on();
//closes the curve with the last node in CUSP mode
void _bspline_spiro_end_anchor_off();
//CHECK: join all the curves "in game" and we call doEffect function
void _bspline_spiro_build();
//function bspline cloned from lpe-bspline.cpp
//function spiro cloned from lpe-spiro.cpp
void _resetColors();
void _disableEvents();
void _enableEvents();
void _setAngleDistanceStatusMessage(Geom::Point const p, int pc_point_to_compare, gchar const *message);
void _lastpointToLine();
void _lastpointToCurve();
void _redrawAll();
void _cancel();
};
}
}
}
#endif /* !SEEN_PEN_CONTEXT_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 :