public abstract class Draw2D
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
NO_VERTICES_NO_EDGES |
static int |
ONLY_EDGES |
static int |
VERTICES_AND_EDGES |
Constructor and Description |
---|
Draw2D() |
Modifier and Type | Method and Description |
---|---|
Point_2[] |
computeBoundingBox()
Compute the scale factor (depending on the max distance of the point set)
|
abstract void |
draw(int type)
Draw the entire graph (or mesh)
|
void |
drawAxis()
Draw the cartesian axis X and Y
|
void |
drawBoundingBox(Point_2[] box)
Draw a bounding box (a rectangle)
|
abstract void |
drawPoint(Point_2 p)
Draw a vertex
|
abstract void |
drawSegment(Point_2 p,
Point_2 q)
Draw a segment between two points
|
abstract void |
resize(Point_2 leftBottom,
Point_2 rightTop)
Resize the frame according to the window coordinates
Input points are the left bottom and right top points of the window
|
static double |
round(double x,
int precision)
Return the value after truncation
|
public static final int VERTICES_AND_EDGES
public static final int NO_VERTICES_NO_EDGES
public static final int ONLY_EDGES
public abstract void drawSegment(Point_2 p, Point_2 q)
public abstract void drawPoint(Point_2 p)
public abstract void draw(int type)
type
- indicates the rendering modepublic void drawAxis()
public abstract void resize(Point_2 leftBottom, Point_2 rightTop)
public void drawBoundingBox(Point_2[] box)
public static double round(double x, int precision)
public Point_2[] computeBoundingBox()