public class FreeformExtension extends Object
Modifier and Type | Field and Description |
---|---|
protected static double |
DRAW_THRESH
When drawing or editing, how far mouse must be dragged before new node is
added.
|
protected OverlayFreeform |
freeform
The freeform to which this extension is attached.
|
protected boolean |
nodal
Whether this freeform extension began on a node or in the middle of a
segment.
|
protected float[][] |
post
Chunks of curve before and after the extension.
|
protected float[][] |
pre
Chunks of curve before and after the extension.
|
protected static double |
RECONNECT_THRESH
Threshhold within which click must occur to invoke extend mode or reconnect
a freeformExtension.
|
protected static float |
SMOOTHING_FACTOR
Smoothing factor for "single exponential smoothing".
|
protected int |
start
The index of the last node of the freeform extension.
|
protected int |
stop
The index of the last node of the freeform extension.
|
protected int |
tip
The index of the tip node of the freeform extension.
|
Constructor and Description |
---|
FreeformExtension(OverlayFreeform freeform,
int start,
int stop,
boolean nodal)
Constructs a new freeform extension.
|
Modifier and Type | Method and Description |
---|---|
double |
computeDragDist(DisplayImpl display,
int px,
int py)
Computes distance between mouse drag and tip of extension.
|
void |
extend(float[] c)
Extends the tip of the freeform extension by "one" node.
|
boolean |
extendOrReconnect(DisplayImpl display,
float dx,
float dy,
int px,
int py,
boolean shift)
Extends the extension, reconnecting it with the curve proper if
appropriate.
|
double[] |
getDistanceToSection(float[][] section,
DisplayImpl display,
double dpx,
double dpy)
Computes distance between a point and a section of the freeform.
|
float[] |
getTipCoords()
Returns the coordinates of the extension's tip or start node.
|
boolean |
hasBegun()
Whether this extension has begun or remains in the initial state.
|
void |
incrementAll()
Simultaneously increments all extension pointers into node array, to adjust
for the insertion of a node before the base of the extension.
|
void |
reconnect(int seg,
double weight,
boolean closerToPost)
Reconnects the extension with the freeform.
|
protected static final float SMOOTHING_FACTOR
protected static final double DRAW_THRESH
protected static final double RECONNECT_THRESH
protected OverlayFreeform freeform
protected int start
protected int stop
protected int tip
protected float[][] pre
protected float[][] post
protected boolean nodal
public FreeformExtension(OverlayFreeform freeform, int start, int stop, boolean nodal)
public boolean hasBegun()
public boolean extendOrReconnect(DisplayImpl display, float dx, float dy, int px, int py, boolean shift)
public double[] getDistanceToSection(float[][] section, DisplayImpl display, double dpx, double dpy)
public double computeDragDist(DisplayImpl display, int px, int py)
public void extend(float[] c)
public void reconnect(int seg, double weight, boolean closerToPost)
public float[] getTipCoords()
public void incrementAll()
Copyright © 2015–2022 SciJava. All rights reserved.