On 7/26/07, seventeen <littleone171@...155...> wrote:
I check out the structure of SPDynaDrawContext in src/dyna-draw-context.h, there is
SPEventContext event_context; /** accumulated shape which ultimately goes in svg:path */ SPCurve *accumulated; /** canvas items for "comitted" segments */ GSList *segments; /** canvas item for red "leading" segment */ SPCanvasItem *currentshape; /** shape of red "leading" segment */ SPCurve *currentcurve; /** left edge of the stroke; combined to get accumulated */ SPCurve *cal1; /** right edge of the stroke; combined to get accumulated */ SPCurve *cal2; /** left edge points for this segment */ NR::Point point1[SAMPLING_SIZE]; /** right edge points for this segment */ NR::Point point2[SAMPLING_SIZE]; /** number of edge points for this segment */ gint npoints; /* repr */ Inkscape::XML::Node *repr; NR::Point cur; NR::Point vel; double vel_max; NR::Point acc; NR::Point ang; NR::Point last; NR::Point del; /* extended input data */ gdouble pressure; gdouble xtilt; gdouble ytilt; /* attributes */ guint dragging : 1; /* mouse state: mouse is dragging */ guint usepressure : 1; guint usetilt : 1; double mass, drag; double angle; double width; double vel_thin; double flatness; double tremor; double cap_rounding;
It looks like a structure for a line segment instead of a single point because there is no x, y position, and there is "left/right edge points for this segment"
then it becomes confusing what the pressure means, because the data type of pressure is double, so I assume it is pressure sensed for each point instead of the whole line segment.
Please correct me if I understand it wrongly,
Thanks,
bulia byak wrote:
On 7/25/07, huei-han Jhuang <littleone171@...155...> wrote:
Hi, I am looking into the source codes of inkscape and try to find in what file it retrieves pen values from the tablet(I use wacom tablet), like pen positions, and pressure.
Can anyone direct me to the file?
It's a question more for the devel list, not user list, but - look into src/dyna-draw-context.cpp, function sp_dyna_draw_extinput.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org
the x,y of the tablet are no different from the x,y of a mouse so are handled by the standard way of reading those in GTK+. The pressure and tilt etc are read thorugh the extended inpyt variables GTK+ provides. Rather than interpreting it from us your probably better looking at the GTK documentation, the scribble tutorial they have includes the extended input stuff:
http://www.gtk.org/tutorial/x2531.html
Hope that helps
John