Laxkit
0.0.7.1
|
The maintainer of all PathOperator classes. More...
Classes | |
class | SelectedPoint |
Public Member Functions | |
PathInterface (int nid, Laxkit::Displayer *ndp) | |
Contstructor for PathInterface. | |
virtual | ~PathInterface () |
Destructor, delete linestyle and fillstyle, call deletedata(). | |
virtual Laxkit::ShortcutHandler * | GetShortcuts () |
virtual anInterface * | duplicate (anInterface *dup) |
Return a new instance of PathInterface with duplicates of all in pathops. | |
virtual PathsData * | newPathsData () |
Return data after making it a new, checked out with count of 2 instance of a PathsData. | |
virtual const char * | IconId () |
virtual const char * | Name () |
virtual const char * | whattype () |
virtual const char * | whatdatatype () |
virtual void | Dp (Laxkit::Displayer *ndp) |
Set this's dp. | |
virtual int | DrawDataDp (Laxkit::Displayer *ndp, SomeData *ndata, Laxkit::anObject *a1=NULL, Laxkit::anObject *a2=NULL, int info=0) |
virtual int | DrawData (Laxkit::anObject *ndata, Laxkit::anObject *a1=NULL, Laxkit::anObject *a2=NULL, int info=0) |
virtual ObjectContext * | Context () |
virtual int | Refresh () |
Refresh draws the path and overlays the appropriate control points of the various PathOperator classes. | |
virtual int | UseThisObject (ObjectContext *oc) |
virtual int | UseThis (Laxkit::anObject *newdata, unsigned int mask=0) |
Generic interface to be assigned a PathsData or to use a LineStyle. | |
virtual int | InterfaceOn () |
When turning on, make sure we have lock on data, and turn on decorations. | |
virtual int | InterfaceOff () |
Path is being deselected, so flush the curpoints stack, and release lock on data. | |
virtual void | Clear (SomeData *d=NULL) |
Clear the pathinterface of its PathsData stored in data, flush curpoints. | |
virtual int | LBDown (int x, int y, unsigned int state, int count, const Laxkit::LaxMouse *d) |
———- LEFT CLICKING: | |
virtual int | LBUp (int x, int y, unsigned int state, const Laxkit::LaxMouse *d) |
virtual int | MouseMove (int x, int y, unsigned int state, const Laxkit::LaxMouse *mouse) |
virtual int | WheelUp (int x, int y, unsigned int state, int count, const Laxkit::LaxMouse *d) |
virtual int | WheelDown (int x, int y, unsigned int state, int count, const Laxkit::LaxMouse *d) |
virtual int | CharInput (unsigned int ch, const char *buffer, int len, unsigned int state, const Laxkit::LaxKeyboard *d) |
virtual int | KeyUp (unsigned int ch, unsigned int state, const Laxkit::LaxKeyboard *kb) |
virtual Laxkit::MenuInfo * | ContextMenu (int x, int y, int deviceid) |
virtual int | ChangeCurpathop (int newiid) |
Swap out the old pathop for the new on the ViewportWindow interface stack. | |
virtual int | DeleteCurpoints () |
Delete all points in curpoints. | |
virtual int | DeletePoint (Coordinate *p) |
Delete the point p, and make sure that path heads maintain their integrity. | |
virtual void | deletedata () |
Flush the data. | |
virtual Coordinate * | scan (int x, int y, int pmask=0, int *pathindex=NULL) |
Scan for a point at screen coordinates (x,y). | |
virtual Coordinate * | scanEndpoints (int x, int y, int *pathindex, Coordinate *exclude) |
Scan only against endpoints. | |
virtual int | scanHover (int x, int y, unsigned int state) |
Scan for various hovering things. | |
virtual flatpoint | screentoreal (int x, int y) |
This is supposed to return points in data context space. | |
virtual flatpoint | realtoscreen (flatpoint r) |
This is supposed to return points from data context space to screen space. | |
virtual int | toggleclosed (int c=-1) |
Toggle the path containing curvertex open and closed. | |
virtual int | AddPoint (flatpoint p) |
Insert at real point p in path after/before relevant break near curvertex. | |
virtual void | SetPointType (int newtype) |
For all curpoints, set the point smoothness, or switch to next if newtype==-1. | |
virtual void | SetPointType (Coordinate *v, int newtype) |
virtual void | MakeCircle () |
Make selected points into a bezier approximated circle. | |
virtual void | MakeRect () |
virtual int | CutNear (flatpoint hoverpoint) |
Add a new point at closest point to hoverpoint, which is in data coordinates. | |
Public Member Functions inherited from LaxInterfaces::anInterface | |
anInterface () | |
This constructor assigns id=getUniqueNumber(). | |
anInterface (int nid) | |
Constructor to assign just the id, set other stuff to 0. | |
anInterface (int nid, Laxkit::Displayer *ndp) | |
anInterface (anInterface *nowner, int nid) | |
Constructor to assign owner and id. | |
anInterface (anInterface *nowner, int nid, Laxkit::Displayer *ndp) | |
virtual int | draws (const char *atype) |
Returns !strcmp(whatdatatype(),atype). | |
virtual void | Clear () |
Default just calls Clear(NULL). | |
virtual int | RemoveChild () |
If there is a child, do something to remove it. | |
virtual int | AddChild (LaxInterfaces::anInterface *ch, int absorbcount, int addbefore) |
virtual int | Needtodraw () |
Must return nonzero if the data needs to be drawn, that is to say Refresh must be called. | |
virtual int | Needtodraw (int n) |
virtual int | MBDown (int x, int y, unsigned int state, int count, const Laxkit::LaxMouse *d) |
virtual int | RBDown (int x, int y, unsigned int state, int count, const Laxkit::LaxMouse *d) |
virtual int | MBUp (int x, int y, unsigned int state, const Laxkit::LaxMouse *d) |
virtual int | RBUp (int x, int y, unsigned int state, const Laxkit::LaxMouse *d) |
virtual int | DeviceChange (const Laxkit::DeviceEventData *e) |
virtual int | Event (const Laxkit::EventData *e, const char *mes) |
Respond to events, particularly menu events from a menu created from ContextMenu(). | |
virtual void | ExposeChange (Laxkit::ScreenEventData *e) |
virtual void | ViewportResized () |
Called after the parent viewport gets resized. | |
virtual void | Mapped () |
Called after the parent viewport gets mapped (made visible). | |
virtual void | Unmapped () |
Called after the parent viewport gets mapped (made invisible, such as offscreen, not merely obscured). | |
virtual void | PostMessage (const char *message) |
If viewport, use that, else app->postmessage(). | |
virtual int | UseThis (int id, int ndata) |
Return 1 if the id/ndata is used, otherwise zero. | |
virtual Laxkit::anXWindow * | CurrentWindow (Laxkit::anXWindow *ncur) |
Set the window the interface works on to ncur. Returns ncur. If ncur==NULL, then just return current viewport. | |
virtual double | Getmag (int c=0) |
Do a little extra checking to find what the magnification is. | |
virtual double | GetVMag (int x, int y) |
Do a little extra checking to find what the magnification is. | |
virtual void | dump_out (FILE *f, int indent, int what, Laxkit::anObject *savecontext) |
Default settings saving is to output nothing. | |
virtual void | dump_in_atts (LaxFiles::Attribute *att, int flag, Laxkit::anObject *loadcontext) |
Placeholder for dumping in settings. | |
Public Member Functions inherited from LaxFiles::DumpUtility | |
virtual Attribute * | dump_out_atts (Attribute *att, int what, Laxkit::anObject *savecontext) |
Default is return NULL. what==0 means write out normal Attribute formatted things. | |
virtual void | dump_in (FILE *f, int indent, int what, Laxkit::anObject *loadcontext, Attribute **att) |
Read in a file segment as an Attribute, and pass parsing duties to dump_in_atts. | |
virtual | ~DumpUtility () |
Empty virtual destructor. |
Public Attributes | |
unsigned long | controlcolor |
unsigned long | creationstyle |
unsigned long | pathi_style |
Laxkit::PtrStack< Coordinate > | curpoints |
Contains list of currently selected points on a path. | |
int | showdecs |
How to show point decorations. | |
int | verbose |
PathsData * | data |
ObjectContext * | poc |
Public Attributes inherited from LaxInterfaces::anInterface | |
char * | name |
An instance name.. ***don't think this is used anywhere at the moment. | |
int | id |
Must be positive, other values are reserved for internal use. | |
unsigned long | style |
Style flags for the interface. Meaning depends on the interface. | |
int | interface_type |
What sort of interface this is. Default is INTERFACE_Tool. | |
Laxkit::anXApp * | app |
The application this interface works with. | |
Laxkit::anXWindow * | curwindow |
The window the interface currently works on. | |
anInterface * | owner |
The interface that owns this one. | |
anInterface * | child |
The child of this interface. See anInterface::owner. This is dec_counted in destructor. | |
int | primary |
Whether this is supposed to be a 'main' interface, or merely a helper. | |
int | needtodraw |
Whether the interface thinks it has to refresh. |
Protected Member Functions | |
virtual int | PerformAction (int action) |
virtual void | clearSelection () |
virtual PathOperator * | getPathOpFromId (int iid) |
Note this returns an element in PathInterface's own instances of available pathops, not the PathOp pool. | |
virtual PathOperator * | getPathOp (Coordinate *p) |
Returns the most relevant PathOperator to operate on the given coordinate. | |
virtual void | selectPoint (Coordinate *p, char flag) |
Select a point p with various options. | |
virtual void | removeSegment (Coordinate *c) |
Remove a controlled range of points. | |
virtual Coordinate * | scannear (Coordinate *p, char u, double radius=5) |
Scan within real radius of p. If (u) then point has to be unselected. | |
virtual void | SetCurvertex (Coordinate *p, int path=-1) |
Set curvertex and related states, based on p. | |
virtual void | UpdateDir () |
Make curdirp be valid for curvertex. | |
virtual int | ConnectEndpoints (Coordinate *from, int fromi, Coordinate *to, int toi) |
virtual int | MergeEndpoints (Coordinate *from, int fromi, Coordinate *to, int toi) |
Take 2 end points, and make them the same point, merging paths if necessary. | |
virtual int | shiftBezPoint (Coordinate *p, flatpoint d) |
virtual int | shiftSelected (flatpoint d) |
virtual int | scaleSelected (flatpoint center, double f, int constrain) |
virtual int | rotateSelected (flatpoint center, double angle) |
virtual void | Modified (int level) |
Perhaps update undo and send message to owner that the path has changed. | |
virtual void | hoverMessage () |
Post a status message based on drawhover. | |
virtual void | drawNewPathIndicator (flatpoint p, int which) |
Protected Attributes | |
int | addmode |
int | editmode |
LineStyle * | linestyle |
Pointer to what should be considered the current line style for the current data. | |
LineStyle * | defaultline |
FillStyle * | fillstyle |
Pointer to what should be considered the current fill style for the current data. | |
FillStyle * | defaultfill |
int | constrain |
int | addafter |
Says whether actions should be after or before curvertex. If addafter==0 then all adding, opening paths acts on the path previous to curvertex. Otherwise, those act on the segment after (in the next direction from) curvertex. | |
int | colortofill |
double | widthstep |
Path * | curpath |
flatpoint | curdirv |
Coordinate * | curdirp |
Coordinate | defaulthoverp |
Coordinate * | curvertex |
Coordinate * | lbfound |
int | lbselected |
int | drawhover |
int | hoverdevice |
int | hoverpointtype |
flatpoint | hoverpoint |
flatpoint | hoversegment [4] |
int | lasth |
PathOperator * | curpathop |
Laxkit::ShortcutHandler * | sc |
Protected Attributes inherited from LaxInterfaces::anInterface | |
Laxkit::ButtonDownInfo | buttondown |
ViewportWindow * | viewport |
curwindow dynamically cast to ViewportWindow. Thus, it will be NULL if it is not a ViewportWindow. | |
Laxkit::Displayer * | dp |
The Displayer used by the controlling window. |
The maintainer of all PathOperator classes.
There should only be one main PathInterface. Sub-interfaces for particular segments are found automatically from the Path::basepathops list, and then PathOperator::getInterface(). That interface (if any) is then made a child of the main PathInterface.
PathInterface should be able to draw single Path objects, not just PathsData?
*** unknown PathOperators should be marked with a question mark at middle of path
*** MUST make sure that PathsData/Path heads are all vertices. That makes dealing with breakpoints easier
*** undo is very important for path editing!!
*** must incorporate shift-move on grid lines, angles on 0/90/45/30/60/custom, etc.
*** operations like make circle, arrange, flip, etc?
*** constrain x/y
Insert at real point p in path after/before relevant break near curvertex.
Flushes curpoints, assigns curvertex to something meanindful. Assumes that p is real coordinates, not screen coordinates, and that what we are adding starts and stops with a vertex.
References addafter, curpoints, Laxkit::PtrStack< T >::e, LaxInterfaces::PathsData::FindBBox(), LaxInterfaces::Coordinate::firstPoint(), Laxkit::PtrStack< T >::flush(), LaxInterfaces::Coordinate::insert(), Laxkit::PtrStack< T >::n, LaxInterfaces::anInterface::needtodraw, newPathsData(), LaxInterfaces::PathOperator::newPoint(), LaxInterfaces::Coordinate::nextVertex(), Laxkit::PtrStack< T >::push(), LaxInterfaces::PathsData::pushEmpty(), SetCurvertex(), and Laxkit::transform_point_inverse().
Referenced by LBDown().
Swap out the old pathop for the new on the ViewportWindow interface stack.
Return 0 success, nonzero error.
Note that this only works when this acts on a ViewportWindow.
References LaxInterfaces::anInterface::child, curpoints, LaxInterfaces::anInterface::dp, Laxkit::PtrStack< T >::findindex(), Laxkit::PtrStack< T >::flush(), LaxInterfaces::PathOperator::getInterface(), getPathOpFromId(), LaxInterfaces::ViewportWindow::interfaces, LaxInterfaces::ViewportWindow::PopId(), LaxInterfaces::ViewportWindow::postmessage(), LaxInterfaces::ViewportWindow::Push(), SetCurvertex(), LaxInterfaces::anInterface::UseThis(), LaxInterfaces::anInterface::viewport, and Laxkit::anObject::whattype().
Referenced by selectPoint().
|
virtual |
Clear the pathinterface of its PathsData stored in data, flush curpoints.
Calls deletedata().
Implements LaxInterfaces::anInterface.
References curpoints, deletedata(), Laxkit::PtrStack< T >::flush(), and SetCurvertex().
|
protectedvirtual |
Flush curpoints, set curvertex, curpath to NULL.
References curpoints, Laxkit::PtrStack< T >::flush(), and SetCurvertex().
|
virtual |
Delete all points in curpoints.
If the point is a vertex, this will remove any attached bezier handles.
References curpoints, DeletePoint(), Laxkit::PtrStack< T >::e, LaxInterfaces::PathsData::FindBBox(), Laxkit::PtrStack< T >::n, and LaxInterfaces::anInterface::needtodraw.
|
virtual |
Flush the data.
Also flushes curpoints. Set fillstyle=defaultfill and linestyle=defaultline.
References curpoints, Laxkit::anObject::dec_count(), fillstyle, Laxkit::PtrStack< T >::flush(), Laxkit::anObject::inc_count(), linestyle, and SetCurvertex().
Referenced by Clear(), LBDown(), and ~PathInterface().
|
virtual |
Delete the point p, and make sure that path heads maintain their integrity.
Returns 0 success, nonzero failure.
If the point is part of a controlled segment, then delete the whole segment. Usually, the segment will have its own interface to intercept delete events, so hopefully this should be ok.
References curpoints, LaxInterfaces::Coordinate::detachThrough(), Laxkit::PtrStack< T >::e, Laxkit::PtrStack< T >::findindex(), LaxInterfaces::Path::fixpath(), LaxInterfaces::Coordinate::hasCoord(), LaxInterfaces::PathsData::hasCoord(), Laxkit::PtrStack< T >::n, LaxInterfaces::anInterface::needtodraw, Laxkit::PtrStack< T >::pop(), Laxkit::PtrStack< T >::remove(), and SetCurvertex().
Referenced by DeleteCurpoints().
|
virtual |
Draw ndata with linestyle a1 and fillstyle a2. *** used for drawing stuff while not owning it.
Tries to make a1 be a LineStyle and a2 be a FillStyle. These preempt any in the object itself.
Pushes ndata->transform onto dp, draws, then popsaxes
Reimplemented from LaxInterfaces::anInterface.
References LaxInterfaces::anInterface::dp, and Dp().
Draw the pop up circular menu for new path or new subpath, centered on p. which==1 is top, which==2 is bottom.
References LaxInterfaces::anInterface::dp, Laxkit::Displayer::drawbez(), Laxkit::Displayer::drawellipse(), Laxkit::Displayer::drawpoint(), Laxkit::Displayer::DrawReal(), Laxkit::Displayer::DrawScreen(), Laxkit::Displayer::LineAttributes(), Laxkit::Displayer::NewFG(), Laxkit::Displayer::realtoscreen(), Laxkit::Displayer::textheight(), and Laxkit::Displayer::textout().
Referenced by Refresh().
|
virtual |
Return a new instance of PathInterface with duplicates of all in pathops.
Also copies over creationstyle, controlcolor, and linestyle (contents are copied, not linestyle pointer).
Reimplemented from LaxInterfaces::anInterface.
References fillstyle, linestyle, and PathInterface().
|
virtual |
Path is being deselected, so flush the curpoints stack, and release lock on data.
ViewportWindow/ViewerWindow autopops curpathop, since it is the child of this.
Reimplemented from LaxInterfaces::anInterface.
References LaxInterfaces::anInterface::Clear(), LaxInterfaces::anInterface::needtodraw, and showdecs.
|
virtual |
———- LEFT CLICKING:
if some are selected, pathinterface is not primary, selected points must have owner same as curpathop. If they are unowned, they become owned by curpathop. If they are loose owned by another pathop, the extraneous control points must be deleted, and the vertex is made to be owned by curpathop. In any case a point must have Selectable and !RoForOthers set to be acted on by PathInterface.
click plain: Not clicked on any point, add new point after curvertex if primary, flush curpoints, new point is selected and active point On a point, flush curpoints, the point is selected and active
click with ShiftMask: On a point, shift on MouseUP, not moved:, toggle it on/off. if it does move, then shift all curpoints, don't toggle Not on point: (nothing)
click with ControlMask: On Point: if mouse moves, then scale curpoints around centroid Not on Point: (nothing)
click with +^: On Point: if mouse moves, rotate curpoints Not on Point: (nothing)
***other modes: shear/flip/arrange
lbfound is set to which if any point is found. If the mouse is moved, lbfound is set to NULL, and moved set to 1.
Reimplemented from LaxInterfaces::anInterface.
References AddPoint(), LaxInterfaces::ViewportWindow::ChangeContext(), LaxInterfaces::ViewportWindow::ChangeObject(), curpoints, CutNear(), deletedata(), Laxkit::ButtonDownInfo::down(), LaxInterfaces::ObjectContext::duplicate(), Laxkit::PtrStack< T >::e, Laxkit::PtrStack< T >::findindex(), LaxInterfaces::ViewportWindow::FindObject(), Laxkit::PtrStack< T >::flush(), Laxkit::anObject::inc_count(), Laxkit::ButtonDownInfo::isdown(), LaxInterfaces::Coordinate::isEndpoint(), Laxkit::ButtonDownInfo::moveinfo(), Laxkit::PtrStack< T >::n, LaxInterfaces::anInterface::needtodraw, LaxInterfaces::anInterface::PostMessage(), LaxInterfaces::anInterface::primary, Laxkit::PtrStack< T >::pushnodup(), scan(), scanEndpoints(), screentoreal(), selectPoint(), SetCurvertex(), Laxkit::ButtonDownInfo::up(), and LaxInterfaces::anInterface::viewport.
|
virtual |
Make selected points into a bezier approximated circle.
References curpoints, Laxkit::PtrStack< T >::e, Laxkit::PtrStack< T >::n, LaxInterfaces::anInterface::needtodraw, Laxkit::PtrStack< T >::pop(), and Laxkit::PtrStack< T >::pushnodup().
|
virtual |
Reimplemented from LaxInterfaces::anInterface.
References curpoints, LaxInterfaces::Coordinate::direction(), LaxInterfaces::anInterface::dp, Laxkit::PtrStack< T >::e, Laxkit::ButtonDownInfo::getextrainfo(), Laxkit::ButtonDownInfo::getinitial(), hoverMessage(), Laxkit::ButtonDownInfo::isdown(), LaxInterfaces::Coordinate::isEndpoint(), Modified(), Laxkit::ButtonDownInfo::move(), Laxkit::ButtonDownInfo::moveinfo(), Laxkit::PtrStack< T >::n, LaxInterfaces::anInterface::needtodraw, norm(), norm2(), LaxInterfaces::anInterface::PostMessage(), realtoscreen(), scan(), scanEndpoints(), scanHover(), Laxkit::Displayer::screentoreal(), screentoreal(), shiftSelected(), Laxkit::transform_point(), and Laxkit::transform_point_inverse().
This is supposed to return points from data context space to screen space.
Redefined from anInterface to catch PATHI_Path_Is_M_Real and related styles.
Reimplemented from LaxInterfaces::anInterface.
References LaxInterfaces::anInterface::dp, Laxkit::Displayer::realtoscreen(), and Laxkit::transform_point().
Referenced by MouseMove(), scan(), scanEndpoints(), and scanHover().
|
virtual |
Refresh draws the path and overlays the appropriate control points of the various PathOperator classes.
Reimplemented from LaxInterfaces::anInterface.
References addafter, LaxInterfaces::Path::basepathops, Laxkit::Displayer::closed(), curpoints, Laxkit::Displayer::curveto(), LaxInterfaces::anInterface::dp, Laxkit::Displayer::drawarrow(), Laxkit::Displayer::DrawImmediately(), Laxkit::Displayer::drawline(), drawNewPathIndicator(), Laxkit::Displayer::drawpoint(), Laxkit::Displayer::DrawReal(), Laxkit::Displayer::DrawScreen(), Laxkit::Displayer::drawthing(), Laxkit::PtrStack< T >::e, Laxkit::Displayer::fill(), Laxkit::Displayer::FillAttributes(), LaxInterfaces::PathsData::fillstyle, fillstyle, Laxkit::PtrStack< T >::findindex(), LaxInterfaces::Coordinate::firstPoint(), Laxkit::ButtonDownInfo::getcurrent(), Laxkit::ButtonDownInfo::getinitial(), Laxkit::Displayer::Getmag(), LaxInterfaces::SegmentControls::iid(), Laxkit::LAXOP_Dest, Laxkit::Displayer::LineAttributes(), LaxInterfaces::PathsData::linestyle, linestyle, Laxkit::PtrStack< T >::n, LaxInterfaces::anInterface::needtodraw, Laxkit::Displayer::NewFG(), Laxkit::Displayer::PopAxes(), Laxkit::Displayer::PushAndNewTransform(), Laxkit::Displayer::realtoscreen(), showdecs, Laxkit::Displayer::stroke(), and Laxkit::THING_Diamond.
|
virtual |
Scan for a point at screen coordinates (x,y).
pmask is the iid that the found point must match. If pmask=0, then point can be any point does not do smart scanning: starts at c=0 each time, only checks points, no on-line jazz.
Scan order is to search vertices first, then control points. pmask is the interface id of the owning pathop. The point has to have this iid, except when pmask is zero, in which case the point's iid can be anything.
NOTE: Extra pathops are placed on the window's interface stack above PathInterface, so if the pathop provides extra control points, such as the midpoint of a line segment or the points of a control rectangle, they must redefine LBDown/Up. Control points that are actual points in the path are handled here.
References curpoints, LaxInterfaces::anInterface::dp, Laxkit::PtrStack< T >::e, LaxInterfaces::Coordinate::firstPoint(), getPathOpFromId(), LaxInterfaces::SegmentControls::iid(), Laxkit::PtrStack< T >::n, LaxInterfaces::Coordinate::nextVertex(), realtoscreen(), and Laxkit::transform_point().
Referenced by LBDown(), and MouseMove().
Scan for various hovering things.
Such as a cutpoint, a segment to cut, a segment to join, or the direction arrow.
References LaxInterfaces::PathsData::ClosestPoint(), curpoints, distance(), Laxkit::PtrStack< T >::n, norm(), norm2(), realtoscreen(), screentoreal(), Laxkit::transform_point(), Laxkit::transform_point_inverse(), and transpose().
Referenced by MouseMove().
|
protectedvirtual |
Scan within real radius of p. If (u) then point has to be unselected.
Meant to be called in order to start a scan underneath a given point.
This is supposed to return points in data context space.
Redefined from anInterface to catch PATHI_Path_Is_M_Real and related styles.
Reimplemented from LaxInterfaces::anInterface.
References LaxInterfaces::anInterface::dp, Laxkit::Displayer::screentoreal(), and Laxkit::transform_point_inverse().
Referenced by LBDown(), MouseMove(), and scanHover().
|
protectedvirtual |
Select a point p with various options.
This assumes that p is already a path point. This does not add points to the path.
flag&1: flush points flag&2: push point onto curpoints flag&4: select curpathop if allowed flag&8: sync curvertex to point
References ChangeCurpathop(), curpoints, Laxkit::PtrStack< T >::flush(), LaxInterfaces::SegmentControls::iid(), Laxkit::PtrStack< T >::pushnodup(), and SetCurvertex().
Referenced by LBDown().
|
protectedvirtual |
Set curvertex and related states, based on p.
Currently this means curvertex, curpath, curdirp, curdirv.
If path>=0, then assume p is in that path. Else search for p in paths. If p is a TOPREV or TONEXT, set with the vertex connected to it.
References addafter, LaxInterfaces::Coordinate::direction(), Laxkit::PtrStack< T >::e, and LaxInterfaces::PathsData::hasCoord().
Referenced by AddPoint(), ChangeCurpathop(), Clear(), clearSelection(), CutNear(), deletedata(), DeletePoint(), LBDown(), MergeEndpoints(), selectPoint(), and toggleclosed().
|
virtual |
For all curpoints, set the point smoothness, or switch to next if newtype==-1.
newtype is one of BEZ_STIFF_EQUAL, BEZ_STIFF_NEQUAL, BEZ_NSTIFF_EQUAL, BEZ_NSTIFF_NEQUAL.
References curpoints, Laxkit::PtrStack< T >::e, Laxkit::PtrStack< T >::findindex(), and Laxkit::PtrStack< T >::n.
|
virtual |
newtype is one of BEZ_STIFF_EQUAL, BEZ_STIFF_NEQUAL, BEZ_NSTIFF_EQUAL, BEZ_NSTIFF_NEQUAL. Or -1 for next type, or -2 to prev type.
References LaxInterfaces::anInterface::needtodraw, LaxInterfaces::ViewportWindow::postmessage(), and LaxInterfaces::anInterface::viewport.
Moves the points in curpoints by displacement d. The point's owner can ShiftPoints itself, otherwise the default shifting is done, that is d is just added straight to the point.
References curpoints, Laxkit::PtrStack< T >::e, LaxInterfaces::PathsData::FindBBox(), getPathOpFromId(), Laxkit::PtrStack< T >::n, LaxInterfaces::anInterface::needtodraw, and UpdateDir().
Referenced by MouseMove().
Toggle the path containing curvertex open and closed.
c==-1 toggle, c==0 want open, c==1 want closed
When opening, the connection between the current segment that curvertex is a part of is severed and the next segment (if addafter) or previous segment (addafter=0).
Return 0 success, nonzero error.
References addafter, LaxInterfaces::Path::close(), Laxkit::PtrStack< T >::e, LaxInterfaces::PathsData::FindBBox(), LaxInterfaces::Path::fixpath(), LaxInterfaces::PathsData::hasCoord(), LaxInterfaces::Coordinate::isClosed(), Laxkit::PtrStack< T >::n, LaxInterfaces::anInterface::needtodraw, and SetCurvertex().
|
virtual |
Generic interface to be assigned a PathsData or to use a LineStyle.
*** should tell curpathop to usethis?
Reimplemented from LaxInterfaces::anInterface.
References LaxInterfaces::PathsData::fill(), LaxInterfaces::PathsData::linestyle, linestyle, and LaxInterfaces::anInterface::needtodraw.
PtrStack< Coordinate > LaxInterfaces::PathInterface::curpoints |
Contains list of currently selected points on a path.
If a controlled segment is selected, then only one bezier approximation point is stored in curpoints for that segment. More complicated point selection must be performed by interfaces returned by PathOperator::getInterface().
Referenced by AddPoint(), ChangeCurpathop(), Clear(), clearSelection(), DeleteCurpoints(), deletedata(), DeletePoint(), LBDown(), MakeCircle(), MergeEndpoints(), MouseMove(), Refresh(), scan(), scanHover(), selectPoint(), SetPointType(), and shiftSelected().
|
protected |
Pointer to what should be considered the current fill style for the current data.
Default is for this to always point to defaultfill.
Referenced by deletedata(), duplicate(), PathInterface(), Refresh(), and ~PathInterface().
|
protected |
Pointer to what should be considered the current line style for the current data.
Default is for this to always point to either data->linestyle or defaultline.
Referenced by deletedata(), duplicate(), newPathsData(), PathInterface(), Refresh(), UseThis(), and ~PathInterface().
int LaxInterfaces::PathInterface::showdecs |
How to show point decorations.
0 is don't show. 1 is show all control points. 2 is show only control points for active vertices. 3 is show only control points available to the current path operator.
Referenced by InterfaceOff(), InterfaceOn(), PathInterface(), and Refresh().