Laxkit
0.0.7.1
|
Namespace for the Laxkit interfaces, surprisingly enough. More...
Classes | |
class | anInterface |
A class for key and mouse interfaces acting on particular windows. More... | |
class | CaptionData |
Holds a little bit of text. More... | |
class | CaptionInterface |
Interface for manipulating CaptionData objects. More... | |
class | ColorPatchData |
Cubic tensor product patch with colors defined at each vertex. More... | |
class | ColorPatchInterface |
Interface for dealing with ColorPatchData objects. More... | |
class | SegmentControls |
Class to hold info about how to generate associated Coordinate points. More... | |
class | Coordinate |
The basic coordinate class for points. More... | |
class | DumpContext |
Class to pass to interface object dump out methods for particular behavior. More... | |
class | EllipseData |
Data class for EllipseInterface. More... | |
class | EllipseInterface |
*** fix me!Interface for EllipseData objects. More... | |
class | LinePoint |
class | EngraverFillData |
class | EngraverFillInterface |
Interface for dealing with EngraverFillData objects. More... | |
class | FillStyle |
Store various characteristics of a fill. More... | |
class | RawPoint |
class | FreehandInterface |
Interface to create bezier or straight lines from freehand motion. More... | |
class | GradientDataSpot |
GradientData keeps a stack of these. More... | |
class | GradientData |
Handled by GradientInterface. More... | |
class | GradientInterface |
Manipulates GradientData objects. More... | |
class | ImageData |
Holds an image and a transform. More... | |
class | ImageInterface |
Interface for manipulating ImageData objects. More... | |
class | ImagePatchData |
Cubic tensor product patch with an image as the color source. More... | |
class | ImagePatchInterface |
Interface for dealing with ImagePatchData objects. More... | |
class | LinesData |
Data class for LinesInterface. More... | |
class | LinesInterface |
Interface for LinesData, just straight point to point lines. More... | |
class | LineStyle |
Store various characteristics of a line. More... | |
class | MeasureInterface |
Measure length, angle and area in various ways. More... | |
class | ObjectInterface |
Allows selecting and moving around several objects all at once. More... | |
class | showmat |
class | PatchRenderContext |
Holds threadsafe data concerning computations with PatchData like objects. More... | |
class | PatchData |
Plain old ordinary cubic tensor product patches, the base for mesh gradients and some image warping. More... | |
class | PatchInterface |
Class to deal with PatchData objects. More... | |
class | PathInfo |
class | Path |
Path contains only one path. More... | |
class | PathsData |
Basically a stack of Path objects with extra fill rules. More... | |
class | PathOperator |
Abstract base class of path operators. More... | |
class | PathInterface |
The maintainer of all PathOperator classes. More... | |
struct | PointWarpLink |
struct | PointWarpPoint |
class | PointWarpData |
class | PointWarpInterface |
Class to deal with PointWarpData objects. More... | |
class | RectData |
Basic rectangular selection, data type for RectInterface. More... | |
class | RectInterface |
Handles RectData or works directly on the matrix of any SomeData. More... | |
class | SomeData |
Basic data type for interfaces. More... | |
class | SomeFacNode |
Internal node for SomeDataFactory. More... | |
class | SomeDataFactory |
Class to get instances of interface data. More... | |
class | SomeDataRef |
A reference to a SomeData. More... | |
class | ViewerWindow |
Class for providing a ViewportWindow together with rulers, scrollers, etc. More... | |
class | ObjectContext |
Class to make searching for objects convenient and expandable in a ViewportWindow. More... | |
class | ViewportWindow |
Class specifically to use anInterface classes. More... | |
class | ViewportWithStack |
ViewportWindow with an internal stack of objects. More... |
Typedefs | |
typedef Laxkit::PtrStack < RawPoint > | RawPointLine |
typedef enum LaxInterfaces::_PatchControls | PatchControls |
typedef SomeData *(* | NewSomeDataFunc )(SomeData *refobj) |
typedef int(* | DelSomeDataFunc )(SomeData *obj) |
Functions | |
anOverlay () | |
virtual int | X () |
virtual int | Y () |
virtual int | Width () |
virtual int | Height () |
Coordinate * | CoordinatePolygon (flatpoint center, double radius, bool point_on_x_axis, int num_sides, int num_winding) |
void | getT (double *v, double t) |
v=[ t^3, t^2, t, 1 ] | |
double | dot (double *a, double *b) |
Returns a*b, a and b are double[4].. | |
void | m_times_v (double *m, double *b, double *v) |
v = m b (b is the vector), m is 4x4 matrix, b and v are double[4] | |
void | m_times_m (double *a, double *b, double *m) |
m = a x b, a and b are 4x4 matrices | |
void | getI (double *I) |
Fill I with 4x4 Identity matrix. | |
void | getScaledI (double *I, double a, double b, double c, double d) |
Fill 4x4 I with x,y,z,w scaled by a,b,c,d. | |
void | printG (const char *ch, double *G) |
For debugging: cout a 4x4 matrix G[16]. | |
void | m_transpose (double *M) |
Transpose the 4x4 matrix. | |
void | getPolyT (double *N, double n, double t0) |
This makes a polynomial column vector T: | |
void | renderTriangleToBuffer (unsigned char *buf, int bw, int bh, flatpoint p1, flatpoint p2, flatpoint p3, ScreenColor *col) |
PathsData * | SvgToPathsData (PathsData *existingpath, const char *d, char **end_ptr) |
Turn an svg 'd' attribute to a PathsData. | |
Coordinate * | SvgToCoordinate (const char *d, int how, char **endptr, int *totalpoints) |
Convert an SVG path data snippet to a Coordinate list. | |
char * | CoordinateToSvg (Coordinate *points) |
Convert a coordinate list to an svg styled string. |
Variables | |
enum LaxInterfaces::OverlayOptions | bounds |
double | B [16] |
The bezier matrix. | |
double | Binv [16] |
The inverse of the bezier matrix. | |
SomeDataFactory * | somedatafactory = NULL |
Namespace for the Laxkit interfaces, surprisingly enough.
Coordinate * LaxInterfaces::CoordinatePolygon | ( | flatpoint | center, |
double | radius, | ||
bool | point_on_x_axis, | ||
int | num_sides, | ||
int | num_winding | ||
) |
Returns polygon arranged in counterclockwise direction as viewed in right handed coordinate system.
References angle(), and CoordinatePolygon().
Referenced by CoordinatePolygon().
char * LaxInterfaces::CoordinateToSvg | ( | Coordinate * | points | ) |
Convert a coordinate list to an svg styled string.
This only handles coordinates that are marked POINT_VERTEX, POINT_TONEXT, and POINT_TOPREV. All others are assumed to be vertex points.
References appendstr(), and newstr().
Referenced by SvgToCoordinate().
void LaxInterfaces::renderTriangleToBuffer | ( | unsigned char * | buf, |
int | bw, | ||
int | bh, | ||
flatpoint | p1, | ||
flatpoint | p2, | ||
flatpoint | p3, | ||
ScreenColor * | col | ||
) |
Referenced by LaxInterfaces::PatchData::patchpoint().
Coordinate * LaxInterfaces::SvgToCoordinate | ( | const char * | d, |
int | how, | ||
char ** | endptr, | ||
int * | totalpoints | ||
) |
Convert an SVG path data snippet to a Coordinate list.
The d attribute of Svg paths allows definition of lines composed of a mixture of straight lines, cubic bezier lines, quartic bezier lines, circle arcs, and ellipses.
Unless how&4==4, if d contains multiple paths, the paths are all parsed into a single coordinate list, delimited by a Coordinate where Coordinate::flags contains either POINT_TERMINATOR, or POINT_LOOP_TERMINATOR. and should not be considered an actual point. POINT_LOOP_TERMINATOR means that the preceding path is closed. POINT_TERMINATOR means an open path. This terminator stuff is necessary because of how the svg spec defines path continuation after a 'z'/'Z' command, which is that sometimes it requires knowledge of the previous subpath.
If everything in d is parsed, then endptr will be pointing to the terminating null character of the string.
Any path in d that corresponds to path with a single coordinate will be ignored.
If how&3==0, then allow mixed poly lines and bezier segments. If how&3==1, then the returned path must be only a poly line. If how&3==2, then the returned path must be all bezier segments. if how&4==4 then return a normal closed Coordinate upon parsing a 'z'. Otherwise use the clunky LOOP_TERMINATOR points.
Ellipsoidal arcs are converted into cubic bezier segments.
Svg path data follows the following format. The letter is a command. If more than the given numbers are present, then assume they are parameters for another of the same command, except for moveto, which switches to lineto for subsequent x,y.
M x y move to absolute coordinate (x,y) m x y move to coordinate (x,y) relative to previous coordinate Any further x y are implied lineto commands
L x y draw a line to absolute coordinate (x,y) l x y draw a line to coordinate (x,y) relative to previous coordinate
H x draw a horizontal line to absolute coordinate (x,current y) h x draw a horizontal line to coordinate ((current x)+x,(current y))
V x draw a vertical line to absolute coordinate ((current x), y) v x draw a vertical line to coordinate ((current x),(current y)+y)
C x1 y1 x2 y2 x y draw a cubic bezier segment. 1 and 2 are controls, (x,y) is vertex c x1 y1 x2 y2 x y like C, but using relative coordinates
S x2 y2 x y draw a cubic bezier segment. 2 is the second controls, (x,y) is vertex, s x2 y2 x y the first control is reflection of control from previous bezier segment, or the current point, if there was no previous segment. 's' is for relative coordinates
Q x1 y1 x y draw a quartic bezier segment. 1 is control point, (x,y) is vertex q x1 y1 x y like q, but using relative coordinates
T x y draw a quartic bezier segment. (x,y) is vertex, t x y the control point is reflection of control from previous bezier segment, or the current point, if there was no previous segment. 't' is for relative coordinates
A/a rx ry x-axis-rotation large-arc-flag sweep-flag x y draw an arc from the current point to the point (x,y) rx and ry are the x and y radii. the ellipse is rotated by x-axis-rotation (in degrees). if large-arc-flag==1, then the swept out arc is large. 0 means small. if sweep-flag==1, then the arc is traced in a positive angle direction, otherwise 0 means in a negative direction (hard to describe without pictures).
Z or z close the current path by with a straight line. If a move does not follow it, then use the initial point of the path just closed as the starting point for the new path
*** right now how&3 bits are ignored..
*** if d doesn't start with a move, what is the spec'd default starting point?? right now, failure results if not starting with a move
References CoordinateToSvg(), and LaxFiles::DoubleListAttribute().
Referenced by SvgToPathsData().
PathsData * LaxInterfaces::SvgToPathsData | ( | PathsData * | existingpath, |
const char * | d, | ||
char ** | end_ptr | ||
) |
Turn an svg 'd' attribute to a PathsData.
This parses via SvgToCoordinate(), then converts the Coordinate list to a PathsData format.
Return the PathsData object on success, or NULL for failure.
If existingpath==NULL, then return a new PathsData, else append new Path objects to existingpath. existingpath is also returned on success.
References LaxInterfaces::PathsData::append(), LaxInterfaces::PathsData::close(), LaxInterfaces::PathsData::FindBBox(), LaxInterfaces::SomeDataFactory::newObject(), LaxInterfaces::PathsData::pushEmpty(), somedatafactory, and SvgToCoordinate().
Referenced by LaxInterfaces::PathsData::dump_in_atts().
LaxInterfaces::SomeDataFactory * LaxInterfaces::somedatafactory = NULL |
Static pointer to a SomeDataFactory, and interfaces and their data would get new instances of themselves through it if it exists, else do normal new WhateverData.
Referenced by LaxInterfaces::ImageData::duplicate(), LaxInterfaces::SomeData::duplicate(), LaxInterfaces::ObjectInterface::LBDown(), LaxInterfaces::RectInterface::LBDown(), LaxInterfaces::GradientInterface::newData(), LaxInterfaces::CaptionInterface::newData(), LaxInterfaces::ImageInterface::newData(), LaxInterfaces::ImagePatchInterface::newPatchData(), LaxInterfaces::ColorPatchInterface::newPatchData(), LaxInterfaces::EngraverFillInterface::newPatchData(), LaxInterfaces::PatchInterface::newPatchData(), LaxInterfaces::PathInterface::newPathsData(), and SvgToPathsData().