public class Edge extends java.lang.Object implements Drawable2D, Drawable3D, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private float |
boundingBoxSize |
(package private) java.util.ArrayList<toxi.geom.Vec2D> |
definingPoints |
private GShape |
gShape |
private boolean |
isHighlighted |
private boolean |
isLocked |
private boolean |
isSelected |
private Vector3D |
p3D1 |
private Vector3D |
p3D2 |
private float |
scalingFactor |
private float |
scalingFactor3D |
private static long |
serialVersionUID |
private java.util.ArrayList<Vector2D> |
tenons |
private Vector2D |
v1 |
private Vector2D |
v2 |
Constructor and Description |
---|
Edge(GShape gShape,
Vector3D p3D1,
Vector3D p3D2,
Vector2D v1,
Vector2D v2)
Create a edge - the outline (Arraylist of Vector2D) is automatically
build (at the beginning just the start- and end-point in 2D)
|
Modifier and Type | Method and Description |
---|---|
private void |
createBorderBox() |
void |
draw2D(processing.core.PGraphics p,
Transformation t)
Draw Box around the edge in 2D if the edge should be either highlighted
or selected
|
void |
draw3D(processing.core.PGraphics p,
Transformation t)
Draw Box around the edge in 3D if the edge should be either highlighted
or selected
|
GShape |
getGShape() |
float |
getLength() |
Vector2D |
getMid() |
Vector3D |
getP3D1() |
Vector3D |
getP3D2() |
java.util.ArrayList<Vector2D> |
getTenons() |
Vector2D |
getV1() |
Vector2D |
getV2() |
boolean |
isHighlighted() |
boolean |
isLocked() |
boolean |
isSelected() |
boolean |
mouseOver(Vector2D mousePosition)
Checks, if the mouse pointer is within a certain area around the edge
|
void |
scale2D(float scaleFactor) |
void |
setHighlighted(boolean highlighted) |
void |
setLocked(boolean locked) |
void |
setP3D1(Vector3D v) |
void |
setP3D2(Vector3D v) |
void |
setSelected(boolean isSelected) |
void |
setTenons(java.util.ArrayList<Vector2D> tenons)
Set outline of the edge
|
void |
setV1(Vector2D v) |
void |
setV2(Vector2D v) |
private static final long serialVersionUID
private GShape gShape
private Vector3D p3D1
private Vector3D p3D2
private Vector2D v1
private Vector2D v2
private java.util.ArrayList<Vector2D> tenons
private float scalingFactor
private float scalingFactor3D
private float boundingBoxSize
private boolean isHighlighted
private boolean isLocked
private boolean isSelected
transient java.util.ArrayList<toxi.geom.Vec2D> definingPoints
public Edge(GShape gShape, Vector3D p3D1, Vector3D p3D2, Vector2D v1, Vector2D v2)
shape
- Form to which this edge belongp3D1
- start point in 3D (0.1mm)p3D2
- end point in 3D (0.1mm)v1
- start point in 2D (0.1mm)v2
- end point in 2D (0.1mm)public boolean isLocked()
public GShape getGShape()
public boolean isHighlighted()
public void setHighlighted(boolean highlighted)
highlighted
- set true, if the edge should be highlighted (e.g. selected as
a first edge for a connection)public boolean isSelected()
public void setSelected(boolean isSelected)
isSelected
- set true if mouse over edgepublic Vector2D getV1()
public Vector2D getV2()
public Vector3D getP3D1()
public Vector3D getP3D2()
public java.util.ArrayList<Vector2D> getTenons()
public void setLocked(boolean locked)
locked
- set true, if the edge is connected with another edgepublic void setP3D1(Vector3D v)
v
- set start point of the edge (in the 3D view)public void setP3D2(Vector3D v)
v
- set end point of the edge (in the 3D view)public void setV1(Vector2D v)
v
- set start point of the edge (in the 2D view)public void setV2(Vector2D v)
v
- set end point of the edge (in the 2D view)public void setTenons(java.util.ArrayList<Vector2D> tenons)
tenons
- List of corner points of the outlinepublic void draw2D(processing.core.PGraphics p, Transformation t)
draw2D
in interface Drawable2D
public void draw3D(processing.core.PGraphics p, Transformation t)
draw3D
in interface Drawable3D
public Vector2D getMid()
public boolean mouseOver(Vector2D mousePosition)
mousePosition
- mouse position to checkprivate void createBorderBox()
public float getLength()
public void scale2D(float scaleFactor)
scaleFactor
- scale cut-out for printing