Laxkit  0.0.7.1
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
LaxInterfaces::PathInterface Class Reference

The maintainer of all PathOperator classes. More...

Inheritance diagram for LaxInterfaces::PathInterface:
Inheritance graph
[legend]

List of all members.

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::ShortcutHandlerGetShortcuts ()
virtual anInterfaceduplicate (anInterface *dup)
 Return a new instance of PathInterface with duplicates of all in pathops.
virtual PathsDatanewPathsData ()
 Return data after making it a new, checked out with count of 2 instance of a PathsData.
virtual const charIconId ()
virtual const charName ()
virtual const charwhattype ()
virtual const charwhatdatatype ()
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 ObjectContextContext ()
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::MenuInfoContextMenu (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 Coordinatescan (int x, int y, int pmask=0, int *pathindex=NULL)
 Scan for a point at screen coordinates (x,y).
virtual CoordinatescanEndpoints (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::anXWindowCurrentWindow (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 Attributedump_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< Coordinatecurpoints
 Contains list of currently selected points on a path.
int showdecs
 How to show point decorations.
int verbose
PathsDatadata
ObjectContextpoc
- Public Attributes inherited from LaxInterfaces::anInterface
charname
 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::anXAppapp
 The application this interface works with.
Laxkit::anXWindowcurwindow
 The window the interface currently works on.
anInterfaceowner
 The interface that owns this one.
anInterfacechild
 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 PathOperatorgetPathOpFromId (int iid)
 Note this returns an element in PathInterface's own instances of available pathops, not the PathOp pool.
virtual PathOperatorgetPathOp (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 Coordinatescannear (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
LineStylelinestyle
 Pointer to what should be considered the current line style for the current data.
LineStyledefaultline
FillStylefillstyle
 Pointer to what should be considered the current fill style for the current data.
FillStyledefaultfill
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
Pathcurpath
flatpoint curdirv
Coordinatecurdirp
Coordinate defaulthoverp
Coordinatecurvertex
Coordinatelbfound
int lbselected
int drawhover
int hoverdevice
int hoverpointtype
flatpoint hoverpoint
flatpoint hoversegment [4]
int lasth
PathOperatorcurpathop
Laxkit::ShortcutHandlersc
- Protected Attributes inherited from LaxInterfaces::anInterface
Laxkit::ButtonDownInfo buttondown
ViewportWindowviewport
 curwindow dynamically cast to ViewportWindow. Thus, it will be NULL if it is not a ViewportWindow.
Laxkit::Displayerdp
 The Displayer used by the controlling window.

Detailed Description

The maintainer of all PathOperator classes.

#include <lax/interfaces/pathinterface.h>

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.

Todo:

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


Member Function Documentation

int LaxInterfaces::PathInterface::AddPoint ( flatpoint  p)
virtual

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().

int LaxInterfaces::PathInterface::ChangeCurpathop ( int  newiid)
virtual
void LaxInterfaces::PathInterface::Clear ( SomeData d = NULL)
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().

void LaxInterfaces::PathInterface::clearSelection ( )
protectedvirtual

Flush curpoints, set curvertex, curpath to NULL.

References curpoints, Laxkit::PtrStack< T >::flush(), and SetCurvertex().

int LaxInterfaces::PathInterface::DeleteCurpoints ( )
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.

void LaxInterfaces::PathInterface::deletedata ( )
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().

int LaxInterfaces::PathInterface::DeletePoint ( Coordinate p)
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().

int LaxInterfaces::PathInterface::DrawDataDp ( Laxkit::Displayer ndp,
SomeData ndata,
Laxkit::anObject a1 = NULL,
Laxkit::anObject a2 = NULL,
int  info = 0 
)
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().

void LaxInterfaces::PathInterface::drawNewPathIndicator ( flatpoint  p,
int  which 
)
protectedvirtual
anInterface * LaxInterfaces::PathInterface::duplicate ( anInterface dup)
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().

int LaxInterfaces::PathInterface::InterfaceOff ( )
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.

int LaxInterfaces::PathInterface::LBDown ( int  x,
int  y,
unsigned int  state,
int  count,
const Laxkit::LaxMouse d 
)
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.

void LaxInterfaces::PathInterface::MakeCircle ( )
virtual

Make selected points into a bezier approximated circle.

Todo:
need to weed out those points that have segment controls

References curpoints, Laxkit::PtrStack< T >::e, Laxkit::PtrStack< T >::n, LaxInterfaces::anInterface::needtodraw, Laxkit::PtrStack< T >::pop(), and Laxkit::PtrStack< T >::pushnodup().

int LaxInterfaces::PathInterface::MouseMove ( int  x,
int  y,
unsigned int  state,
const Laxkit::LaxMouse mouse 
)
virtual
flatpoint LaxInterfaces::PathInterface::realtoscreen ( flatpoint  r)
virtual

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().

int LaxInterfaces::PathInterface::Refresh ( )
virtual
Coordinate * LaxInterfaces::PathInterface::scan ( int  x,
int  y,
int  pmask = 0,
int pathindex = NULL 
)
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().

int LaxInterfaces::PathInterface::scanHover ( int  x,
int  y,
unsigned int  state 
)
virtual

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().

Coordinate * LaxInterfaces::PathInterface::scannear ( Coordinate p,
char  u,
double  radius = 5 
)
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.

Todo:
**** not yet implemented!
flatpoint LaxInterfaces::PathInterface::screentoreal ( int  x,
int  y 
)
virtual

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().

void LaxInterfaces::PathInterface::selectPoint ( Coordinate p,
char  flag 
)
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().

void LaxInterfaces::PathInterface::SetCurvertex ( Coordinate p,
int  path = -1 
)
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().

void LaxInterfaces::PathInterface::SetPointType ( int  newtype)
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.

void LaxInterfaces::PathInterface::SetPointType ( Coordinate v,
int  newtype 
)
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.

int LaxInterfaces::PathInterface::shiftSelected ( flatpoint  d)
protectedvirtual

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().

int LaxInterfaces::PathInterface::toggleclosed ( int  c = -1)
virtual

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().

int LaxInterfaces::PathInterface::UseThis ( Laxkit::anObject newdata,
unsigned int  mask = 0 
)
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.


Member Data Documentation

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().

FillStyle * LaxInterfaces::PathInterface::fillstyle
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().

LineStyle * LaxInterfaces::PathInterface::linestyle
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().


The documentation for this class was generated from the following files:

Mon Feb 17 2014 11:52:58, Laxkit