Class Draw2D

java.lang.Object
Jcg.viewer.Draw2D

public abstract class Draw2D extends Object
Abstract class defining methods for drawing points and segments in a 2D frame
Author:
Luca Castelli Aleardi (Ecole Polytechnique, INF555 and INF562), 2012
  • Field Details

  • Constructor Details

    • Draw2D

      public Draw2D()
  • Method Details

    • drawSegment

      public abstract void drawSegment(Point_2 p, Point_2 q)
      Draw a segment between two points
    • drawPoint

      public abstract void drawPoint(Point_2 p)
      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

      public 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
    • drawBoundingBox

      public void drawBoundingBox(Point_2[] box)
      Draw a bounding box (a rectangle)
    • round

      public static double round(double x, int precision)
      Return the value after truncation
    • computeBoundingBox

      public Point_2[] computeBoundingBox()
      Compute the scale factor (depending on the max distance of the point set)