congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
TriangulationPoint.getX
Code IndexAdd Tabnine to your IDE (free)

How to use
getX
method
in
org.poly2tri.triangulation.TriangulationPoint

Best Java code snippets using org.poly2tri.triangulation.TriangulationPoint.getX (Showing top 20 results out of 315)

origin: org.orbisgis/poly2tri-core

public AdvancingFrontNode( TriangulationPoint point )
{
  this.point = point;
  value = point.getX();
  key = Double.valueOf( value ); // XXX: BST
}    
origin: org.orbisgis/poly2tri-core

public String toString()
{
  StringBuilder sb = new StringBuilder();
  AdvancingFrontNode node = head;
  while( node != tail )
  {
    sb.append( node.point.getX() ).append( "->" );
    node = node.next;
  } 
  sb.append( tail.point.getX() );
  return sb.toString();
}

origin: org.orbisgis/poly2tri-core

@Override
public String toString()
{
  return "[" + getX() + "," + getY() + "]";
}
 
origin: org.orbisgis/poly2tri-core

/**
 * We use a balancing tree to locate a node smaller or equal to
 * given key value
 * 
 * @param x
 * @return
 */
public AdvancingFrontNode locateNode( TriangulationPoint point )
{
  return locateNode( point.getX() );
}
origin: org.orbisgis/poly2tri-core

public boolean equals(Object obj) 
{
  if( obj instanceof TriangulationPoint ) 
  {
    TriangulationPoint p = (TriangulationPoint)obj;
    return getX() == p.getX() && getY() == p.getY();
  }
  return super.equals( obj );
}
origin: org.orbisgis/poly2tri-core

public double area()
{
  double a = (points[0].getX() - points[2].getX())*(points[1].getY() - points[0].getY());
  double b = (points[0].getX() - points[1].getX())*(points[2].getY() - points[0].getY());
  return 0.5*Math.abs( a - b );
}
origin: org.orbisgis/poly2tri-core

public int hashCode()
{
  long bits = java.lang.Double.doubleToLongBits(getX());
  bits ^= java.lang.Double.doubleToLongBits(getY()) * 31;
  return (((int) bits) ^ ((int) (bits >> 32)));
}
origin: org.orbisgis/poly2tri-core

/**
 * The basin angle is decided against the horizontal line [1,0]
 */
private static double basinAngle( AdvancingFrontNode node )
{
  double ax = node.point.getX() - node.next.next.point.getX();
  double ay = node.point.getY() - node.next.next.point.getY();
  return Math.atan2( ay, ax );
}
origin: org.orbisgis/poly2tri-core

public TPoint centroid()
{
  double cx = ( points[0].getX() + points[1].getX() + points[2].getX() ) / 3d;
  double cy = ( points[0].getY() + points[1].getY() + points[2].getY() ) / 3d;
  return new TPoint( cx, cy );
}
origin: org.orbisgis/poly2tri-core

/**
 * Forumla to calculate signed area<br>
 * Positive if CCW<br>
 * Negative if CW<br>
 * 0 if collinear<br>
 * <pre>
 * A[P1,P2,P3]  =  (x1*y2 - y1*x2) + (x2*y3 - y2*x3) + (x3*y1 - y3*x1)
 *              =  (x1-x3)*(y2-y3) - (y1-y3)*(x2-x3)
 * </pre>             
 */
public static Orientation orient2d( TriangulationPoint pa, 
                  TriangulationPoint pb, 
                  TriangulationPoint pc )
{
  double detleft = ( pa.getX() - pc.getX() ) * ( pb.getY() - pc.getY() );
  double detright = ( pa.getY() - pc.getY() ) * ( pb.getX() - pc.getX() );
  double val = detleft - detright;
  if( val > -EPSILON && val < EPSILON )
  {
    return Orientation.Collinear;                    
  }
  else if( val > 0 )
  {
    return Orientation.CCW;
  }
  return Orientation.CW;
}
origin: org.orbisgis/poly2tri-core

  public int compare( TriangulationPoint p1, TriangulationPoint p2 )
  {
   if(p1.getY() < p2.getY() )
   {
     return -1;
   }
   else if( p1.getY() > p2.getY())
   {
     return 1;
   }
   else 
   {
     if(p1.getX() < p2.getX())
     {
       return -1;
     }
     else if( p1.getX() > p2.getX() )
     {
       return 1;
     }
     else
     {
       return 0;
     }
   }            
  }
}
origin: org.orbisgis/poly2tri-core

/**
 * 
 * @param node - middle node
 * @return the angle between p-a and p-b in range [-pi,pi]
 */
private static double angle( TriangulationPoint p, 
               TriangulationPoint a, 
               TriangulationPoint b )
{
  // XXX: do we really need a signed angle for holeAngle?
  //      could possible save some cycles here
  /* Complex plane
   * ab = cosA +i*sinA
   * ab = (ax + ay*i)(bx + by*i) = (ax*bx + ay*by) + i(ax*by-ay*bx)
   * atan2(y,x) computes the principal value of the argument function
   * applied to the complex number x+iy
   * Where x = ax*bx + ay*by
   *       y = ax*by - ay*bx
   */
  final double px = p.getX();
  final double py = p.getY();
  final double ax = a.getX() - px;
  final double ay = a.getY() - py;
  final double bx = b.getX() - px;
  final double by = b.getY() - py;
  return Math.atan2( ax*by - ay*bx, ax*bx + ay*by );
}
origin: org.orbisgis/h2gis-functions

double ux = p2.getX() - p1.getX();
double uy = p2.getY() - p1.getY();
double uz = p2.getZ() - p1.getZ();
double vx = p3.getX() - p1.getX();
double vy = p3.getY() - p1.getY();
double vz = p3.getZ() - p1.getZ();
origin: org.orbisgis/poly2tri-core

double ymax, ymin;
xmax = xmin = _points.get(0).getX();
ymax = ymin = _points.get(0).getY();
  if( p.getX() > xmax )
    xmax = p.getX();
  if( p.getX() < xmin )
    xmin = p.getX();
  if( p.getY() > ymax )
    ymax = p.getY();
origin: org.orbisgis/poly2tri-core

private static void fillRightAboveEdgeEvent(  DTSweepContext tcx, DTSweepConstraint edge, AdvancingFrontNode node )
{
  while( node.next.point.getX() < edge.p.getX() )
  {
    if( tcx.isDebugEnabled() ) { tcx.getDebugContext().setActiveNode( node ); }
    // Check if next node is below the edge
    Orientation o1 = orient2d( edge.q, node.next.point, edge.p ); 
    if( o1 == Orientation.CCW )
    {
      fillRightBelowEdgeEvent( tcx, edge, node );                        
    }
    else
    {
      node = node.next;
    }            
  }         
}
origin: org.orbisgis/poly2tri-core

private static void fillLeftAboveEdgeEvent(  DTSweepContext tcx, DTSweepConstraint edge, AdvancingFrontNode node )
{
  while( node.prev.point.getX() > edge.p.getX() )
  {
    if( tcx.isDebugEnabled() ) { tcx.getDebugContext().setActiveNode( node ); }
    // Check if next node is below the edge
    Orientation o1 = orient2d( edge.q, node.prev.point, edge.p ); 
    if( o1 == Orientation.CW )
    {
      fillLeftBelowEdgeEvent( tcx, edge, node );                        
    }
    else
    {
      node = node.prev;
    }            
  }         
}
origin: kendzi/kendzi3d

private static List<Triangle2d> convert(Polygon p) {
  List<DelaunayTriangle> triangles = p.getTriangles();
  if (triangles == null || triangles.size() == 0) {
    return null;
  }
  List<Triangle2d> out = new ArrayList<Triangle2d>();
  for (DelaunayTriangle t : triangles) {
    Triangle2d triangle = new Triangle2d(
        new Point2d(t.points[0].getX(), t.points[0].getY()),
        new Point2d(t.points[1].getX(), t.points[1].getY()),
        new Point2d(t.points[2].getX(), t.points[2].getY()));
    out.add(triangle);
  }
  return out;
}
origin: org.orbisgis/poly2tri-core

private static void fillLeftBelowEdgeEvent(  DTSweepContext tcx, DTSweepConstraint edge, AdvancingFrontNode node )
{
  if( tcx.isDebugEnabled() ) { tcx.getDebugContext().setActiveNode( node ); }
  if( node.point.getX() > edge.p.getX() )
  {
    if( orient2d( node.point, node.prev.point, node.prev.prev.point ) == Orientation.CW )
    {
      // Concave 
      fillLeftConcaveEdgeEvent( tcx, edge, node );
    }
    else
    {
      // Convex
      fillLeftConvexEdgeEvent( tcx, edge, node );
      // Retry this one
      fillLeftBelowEdgeEvent( tcx, edge, node );
    }
  }         
}

origin: org.orbisgis/poly2tri-core

private static void fillRightBelowEdgeEvent(  DTSweepContext tcx, DTSweepConstraint edge, AdvancingFrontNode node )
{
  if( tcx.isDebugEnabled() ) { tcx.getDebugContext().setActiveNode( node ); }
  if( node.point.getX() < edge.p.getX() ) // needed?
  {
    if( orient2d( node.point, node.next.point, node.next.next.point ) == Orientation.CCW )
    {
      // Concave 
      fillRightConcaveEdgeEvent( tcx, edge, node );
    }
    else
    {
      // Convex
      fillRightConvexEdgeEvent( tcx, edge, node );
      // Retry this one
      fillRightBelowEdgeEvent( tcx, edge, node );
    }
  }         
}
origin: org.orbisgis/poly2tri-core

/**
 * Find closes node to the left of the new point and
 * create a new triangle. If needed new holes and basins
 * will be filled to.
 * 
 * @param tcx
 * @param point
 * @return
 */
private static AdvancingFrontNode pointEvent( DTSweepContext tcx, 
                       TriangulationPoint point )
{
  AdvancingFrontNode node,newNode;
  node = tcx.locateNode( point );
  if( tcx.isDebugEnabled() ) { tcx.getDebugContext().setActiveNode( node ); }
  newNode = newFrontTriangle( tcx, point, node );
  // Only need to check +epsilon since point never have smaller 
  // x value than node due to how we fetch nodes from the front
  if( point.getX() <= node.point.getX() + EPSILON )
  {
    fill( tcx, node );
  }
  tcx.addNode( newNode );
   
  fillAdvancingFront( tcx, newNode );
  return newNode;
}
org.poly2tri.triangulationTriangulationPointgetX

Popular methods of TriangulationPoint

  • getY
  • getZ
  • addEdge
  • getEdges
  • hasEdges
  • mergeInstances
    Replace points in ptList for all equals object in uniquePts.

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now