本文整理汇总了Java中org.poly2tri.triangulation.delaunay.DelaunayTriangle.markNeighbor方法的典型用法代码示例。如果您正苦于以下问题:Java DelaunayTriangle.markNeighbor方法的具体用法?Java DelaunayTriangle.markNeighbor怎么用?Java DelaunayTriangle.markNeighbor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.poly2tri.triangulation.delaunay.DelaunayTriangle
的用法示例。
在下文中一共展示了DelaunayTriangle.markNeighbor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fill
import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
/**
* Adds a triangle to the advancing front to fill a hole.
* @param tcx
* @param node - middle node, that is the bottom of the hole
*/
private static void fill( DTSweepContext tcx, AdvancingFrontNode node )
{
DelaunayTriangle triangle = new DelaunayTriangle( node.prev.point,
node.point,
node.next.point );
// TODO: should copy the cEdge value from neighbor triangles
// for now cEdge values are copied during the legalize
triangle.markNeighbor( node.prev.triangle );
triangle.markNeighbor( node.triangle );
tcx.addToList( triangle );
// Update the advancing front
node.prev.next = node.next;
node.next.prev = node.prev;
tcx.removeNode( node );
// If it was legalized the triangle has already been mapped
if( !legalize( tcx, triangle ) )
{
tcx.mapTriangleToNodes( triangle );
}
}
示例2: fill
import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
/**
* Adds a triangle to the advancing front to fill a hole.
* @param tcx
* @param node - middle node, that is the bottom of the hole
*/
private static void fill( DTSweepContext tcx, AdvancingFrontNode node )
{
DelaunayTriangle triangle = new DelaunayTriangle( node.prev.point,
node.point,
node.next.point );
// TODO: should copy the cEdge value from neighbor triangles
// for now cEdge values are copied during the legalize
triangle.markNeighbor( node.prev.triangle );
triangle.markNeighbor( node.triangle );
tcx.addToList( triangle );
// Update the advancing front
node.prev.next = node.next;
node.next.prev = node.prev;
tcx.removeNode( node );
// If it was legalized the triangle has already been mapped
if( !legalize( tcx, triangle ) )
{
tcx.mapTriangleToNodes( triangle );
}
}
示例3: rotateTrianglePair
import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
/**
* Rotates a triangle pair one vertex CW
*<pre>
* n2 n2
* P +-----+ P +-----+
* | t /| |\ t |
* | / | | \ |
* n1| / |n3 n1| \ |n3
* | / | after CW | \ |
* |/ oT | | oT \|
* +-----+ oP +-----+
* n4 n4
* </pre>
*/
private static void rotateTrianglePair( DelaunayTriangle t,
TriangulationPoint p,
DelaunayTriangle ot,
TriangulationPoint op )
{
DelaunayTriangle n1,n2,n3,n4;
n1 = t.neighborCCW( p );
n2 = t.neighborCW( p );
n3 = ot.neighborCCW( op );
n4 = ot.neighborCW( op );
boolean ce1,ce2,ce3,ce4;
ce1 = t.getConstrainedEdgeCCW(p);
ce2 = t.getConstrainedEdgeCW(p);
ce3 = ot.getConstrainedEdgeCCW(op);
ce4 = ot.getConstrainedEdgeCW(op);
boolean de1,de2,de3,de4;
de1 = t.getDelunayEdgeCCW(p);
de2 = t.getDelunayEdgeCW(p);
de3 = ot.getDelunayEdgeCCW(op);
de4 = ot.getDelunayEdgeCW(op);
t.legalize( p, op );
ot.legalize( op, p );
// Remap dEdge
ot.setDelunayEdgeCCW( p, de1 );
t.setDelunayEdgeCW( p, de2 );
t.setDelunayEdgeCCW( op, de3 );
ot.setDelunayEdgeCW( op, de4 );
// Remap cEdge
ot.setConstrainedEdgeCCW( p, ce1 );
t.setConstrainedEdgeCW( p, ce2 );
t.setConstrainedEdgeCCW( op, ce3 );
ot.setConstrainedEdgeCW( op, ce4 );
// Remap neighbors
// XXX: might optimize the markNeighbor by keeping track of
// what side should be assigned to what neighbor after the
// rotation. Now mark neighbor does lots of testing to find
// the right side.
t.clearNeighbors();
ot.clearNeighbors();
if( n1 != null ) ot.markNeighbor( n1 );
if( n2 != null ) t.markNeighbor( n2 );
if( n3 != null ) t.markNeighbor( n3 );
if( n4 != null ) ot.markNeighbor( n4 );
t.markNeighbor( ot );
}
示例4: rotateTrianglePair
import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
/**
* Rotates a triangle pair one vertex CW
*<pre>
* n2 n2
* P +-----+ P +-----+
* | t /| |\ t |
* | / | | \ |
* n1| / |n3 n1| \ |n3
* | / | after CW | \ |
* |/ oT | | oT \|
* +-----+ oP +-----+
* n4 n4
* </pre>
*/
private static void rotateTrianglePair( DelaunayTriangle t,
TriangulationPoint p,
DelaunayTriangle ot,
TriangulationPoint op )
{
DelaunayTriangle n1,n2,n3,n4;
n1 = t.neighborCCW( p );
n2 = t.neighborCW( p );
n3 = ot.neighborCCW( op );
n4 = ot.neighborCW( op );
boolean ce1,ce2,ce3,ce4;
ce1 = t.getConstrainedEdgeCCW(p);
ce2 = t.getConstrainedEdgeCW(p);
ce3 = ot.getConstrainedEdgeCCW(op);
ce4 = ot.getConstrainedEdgeCW(op);
boolean de1,de2,de3,de4;
de1 = t.getDelunayEdgeCCW(p);
de2 = t.getDelunayEdgeCW(p);
de3 = ot.getDelunayEdgeCCW(op);
de4 = ot.getDelunayEdgeCW(op);
t.legalize( p, op );
ot.legalize( op, p );
// Remap dEdge
ot.setDelunayEdgeCCW( p, de1 );
t.setDelunayEdgeCW( p, de2 );
t.setDelunayEdgeCCW( op, de3 );
ot.setDelunayEdgeCW( op, de4 );
// Remap cEdge
ot.setConstrainedEdgeCCW( p, ce1 );
t.setConstrainedEdgeCW( p, ce2 );
t.setConstrainedEdgeCCW( op, ce3 );
ot.setConstrainedEdgeCW( op, ce4 );
// Remap neighbors
// XXX: might optimize the markNeighbor by keeping track of
// what side should be assigned to what neighbor after the
// rotation. Now mark neighbor does lots of testing to find
// the right side.
t.clearNeighbors();
ot.clearNeighbors();
if( n1 != null ) ot.markNeighbor( n1 );
if( n2 != null ) t.markNeighbor( n2 );
if( n3 != null ) t.markNeighbor( n3 );
if( n4 != null ) ot.markNeighbor( n4 );
t.markNeighbor( ot );
}