Examples of HVertex


Examples of hype.extended.util.HVertex

  public HVertex vertex(int index) {
    return _vertices.get(index);
  }
 
  public HPath vertex(float x, float y) {
    _vertices.add(new HVertex(this).set(x,y));
    return this;
  }
View Full Code Here

Examples of hype.extended.util.HVertex

    _vertices.add(new HVertex(this).set(x,y));
    return this;
  }
 
  public HPath vertex(float cx, float cy, float x, float y) {
    _vertices.add(new HVertex(this).set(cx,cy, x,y));
    return this;
  }
View Full Code Here

Examples of hype.extended.util.HVertex

  public HPath vertex(
    float cx1, float cy1,
    float cx2, float cy2,
    float x, float y
  ) {
    _vertices.add(new HVertex(this).set(cx1,cy1, cx2,cy2, x,y));
    return this;
  }
View Full Code Here

Examples of hype.extended.util.HVertex

    _vertices.add(new HVertex(this).set(cx1,cy1, cx2,cy2, x,y));
    return this;
  }
 
  public HPath vertexUV(float u, float v) {
    _vertices.add(new HVertex(this).setUV(u,v));
    return this;
  }
View Full Code Here

Examples of hype.extended.util.HVertex

    _vertices.add(new HVertex(this).setUV(u,v));
    return this;
  }
 
  public HPath vertexUV(float cu, float cv, float u, float v) {
    _vertices.add(new HVertex(this).setUV(cu,cv, u,v));
    return this;
  }
View Full Code Here

Examples of hype.extended.util.HVertex

  public HPath vertexUV(
    float cu1, float cv1,
    float cu2, float cv2,
    float u, float v
  ) {
    _vertices.add(new HVertex(this).setUV(cu1,cv1, cu2,cv2, u,v));
    return this;
  }
View Full Code Here

Examples of hype.extended.util.HVertex

    boolean openPath = false;
   
    switch(_mode) {
    case PConstants.POINTS:
      for(int i=0; i<numv; ++i) {
        HVertex curr = vertex(i);
        if(curr.u()==relX/_width && curr.v()==relY/_height) return true;
      }
      return false;
    case PConstants.PATH:
      openPath = true;
      if(HColors.isTransparent(_fill)) {
        HVertex prev = vertex(openPath? 0 : numv-1);
        for(int i=(openPath? 1 : 0); i<numv; ++i) {
          HVertex curr = vertex(i);
          if(curr.inLine(prev,relX,relY)) return true;
          prev = curr;
          if(openPath) openPath = false;
        }
        return false;
      }
    default:
      float u = relX / _width; // TODO remove these, use relX,relY
      float v = relY / _height; //
      boolean isIn = false;
      HVertex prev = vertex(numv-1);
      HVertex pprev = vertex(numv>1? numv-2 : 0);
     
      for(int i=0; i<numv; ++i) {
        HVertex curr = vertex(i);
        if(curr.intersectTest(pprev,prev, u,v, openPath)) isIn = !isIn;
        pprev = prev;
        prev = curr;
        if(openPath) openPath = false;
      }
      return isIn;
View Full Code Here

Examples of hype.extended.util.HVertex

    if(drawsLines) g.beginShape();
    else g.beginShape(PConstants.POINTS);
   
    int itrs = (isPolygon)? numv+1 : numv;
    for(int i=0; i<itrs; ++i) {
      HVertex v = vertex(i<numv? i : 0);
      v.draw(g, drawX, drawY, isSimple);
      if(isSimple && drawsLines) isSimple = false;
    }
   
    if(isPolygon) g.endShape(PConstants.CLOSE);
    else g.endShape();
   
    if(_drawsHandles && drawsLines) {
      HVertex prev = vertex(isPolygon? numv-1 : 0);
      for(int i=(isPolygon? 0 : 1); i<numv; ++i) {
        HVertex curr = vertex(i);
        curr.drawHandles(g, prev, drawX, drawY);
        prev = curr;
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.