Tabnine Logo
TriangulationPoint
Code IndexAdd Tabnine to your IDE (free)

How to use
TriangulationPoint
in
org.poly2tri.triangulation

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

origin: org.orbisgis/poly2tri-core

@Override
public String toString()
{
  return "[" + getX() + "," + getY() + "]";
}
 
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

if( p1.getY() > p2.getY() )
else if( p1.getY() == p2.getY() )
  if( p1.getX() > p2.getX() )
  else if( p1.getX() == p2.getX() )
q.addEdge(this);
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

private static boolean isShallow( DTSweepContext tcx, AdvancingFrontNode node )
{
  double height;
  if( tcx.basin.leftHighest )
  {
    height = tcx.basin.leftNode.getPoint().getY() - node.getPoint().getY();
  }
  else
  {
    height = tcx.basin.rightNode.getPoint().getY() - node.getPoint().getY();            
  }
  if( tcx.basin.width > height ) 
  {
    return true;
  }        
  return false;
}

origin: org.orbisgis/poly2tri-core

/**
 * Start sweeping the Y-sorted point set from bottom to top
 * 
 * @param tcx
 */
private static void sweep( DTSweepContext tcx )
{
  List<TriangulationPoint> points;
  TriangulationPoint point;
  AdvancingFrontNode node;
  
  points = tcx.getPoints();
  
  for( int i=1; i<points.size(); i++ )
  {
    point = points.get(i);
    node = pointEvent( tcx, point );
    if( point.hasEdges() )
    {
      for( DTSweepConstraint e : point.getEdges() )
      {
        if( tcx.isDebugEnabled() ) { tcx.getDebugContext().setActiveConstraint( e ); }
        edgeEvent( tcx, e, node );
      }
    }
    tcx.update( null );
  }
}
origin: org.orbisgis/poly2tri-core

@SuppressWarnings("unchecked")
@Override
public void prepareTriangulation( TriangulationContext tcx )
{
  super.prepareTriangulation( tcx );
  if( _constrainedPointList != null )
  {
    HashMap<TriangulationPoint, TriangulationPoint> uniquePts = new HashMap<TriangulationPoint, TriangulationPoint>(_points.size());
    // Enforce same coordinates means same instance of TriangulationPoint
    TriangulationPoint.mergeInstances(uniquePts, _points);
    TriangulationPoint.mergeInstances(uniquePts, _constrainedPointList);
    TriangulationPoint p1,p2;
    Iterator iterator = _constrainedPointList.iterator();
    while(iterator.hasNext())
    {
      p1 = (TriangulationPoint)iterator.next();
      p2 = (TriangulationPoint)iterator.next();
      tcx.newConstraint(p1,p2);
    }
  }
  else
  {
    for( int i = 0; i < _index.length; i+=2 )
    {
      // XXX: must change!!
      tcx.newConstraint( _points.get( _index[i] ), _points.get( _index[i+1] ) );
    }
  }
}
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

if( node.prev.point.getY() < node.next.point.getY() )
origin: org.orbisgis/poly2tri-core

TriangulationPoint.mergeInstances(uniquePts, _points);
if(_steinerPoints != null) {
  TriangulationPoint.mergeInstances(uniquePts, _steinerPoints);
    TriangulationPoint.mergeInstances(uniquePts, p._points);
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: orbisgis/h2gis

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

/**
 * 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/h2gis

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

final double px = point.getX();
AdvancingFrontNode node = findSearchNode(px);
final double nx = node.point.getX();
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

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

/**
 * 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

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;
    }            
  }         
}
org.poly2tri.triangulationTriangulationPoint

Most used methods

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

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSharedPreferences (Context)
  • Kernel (java.awt.image)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • JCheckBox (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top plugins for Android Studio
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