Class Draw2D
java.lang.Object
Jcg.viewer.Draw2D
Abstract class defining methods for drawing points and segments in a 2D frame
- Author:
- Luca Castelli Aleardi (Ecole Polytechnique, INF555 and INF562), 2012
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPoint_2[]Compute the scale factor (depending on the max distance of the point set)abstract voiddraw(int type) Draw the entire graph (or mesh)voiddrawAxis()Draw the cartesian axis X and YvoiddrawBoundingBox(Point_2[] box) Draw a bounding box (a rectangle)abstract voidDraw a vertexabstract voiddrawSegment(Point_2 p, Point_2 q) Draw a segment between two pointsabstract voidResize the frame according to the window coordinates Input points are the left bottom and right top points of the windowstatic doubleround(double x, int precision) Return the value after truncation
-
Field Details
-
VERTICES_AND_EDGES
public static final int VERTICES_AND_EDGES- See Also:
-
NO_VERTICES_NO_EDGES
public static final int NO_VERTICES_NO_EDGES- See Also:
-
ONLY_EDGES
public static final int ONLY_EDGES- See Also:
-
-
Constructor Details
-
Draw2D
public Draw2D()
-
-
Method Details
-
drawSegment
-
drawPoint
Draw a vertex -
draw
public abstract void draw(int type) Draw the entire graph (or mesh)- Parameters:
type- indicates the rendering mode
-
drawAxis
public void drawAxis()Draw the cartesian axis X and Y -
resize
-
drawBoundingBox
Draw a bounding box (a rectangle) -
round
public static double round(double x, int precision) Return the value after truncation -
computeBoundingBox
Compute the scale factor (depending on the max distance of the point set)
-