本文整理汇总了Java中org.poly2tri.triangulation.delaunay.DelaunayTriangle.getConstrainedEdgeAcross方法的典型用法代码示例。如果您正苦于以下问题:Java DelaunayTriangle.getConstrainedEdgeAcross方法的具体用法?Java DelaunayTriangle.getConstrainedEdgeAcross怎么用?Java DelaunayTriangle.getConstrainedEdgeAcross使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.poly2tri.triangulation.delaunay.DelaunayTriangle
的用法示例。
在下文中一共展示了DelaunayTriangle.getConstrainedEdgeAcross方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: flipEdgeEvent
import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
private static void flipEdgeEvent( DTSweepContext tcx,
TriangulationPoint ep,
TriangulationPoint eq,
DelaunayTriangle t,
TriangulationPoint p )
{
TriangulationPoint op, newP;
DelaunayTriangle ot;
boolean inScanArea;
ot = t.neighborAcross( p );
op = ot.oppositePoint( t, p );
if( ot == null )
{
// If we want to integrate the fillEdgeEvent do it here
// With current implementation we should never get here
throw new RuntimeException( "[BUG:FIXME] FLIP failed due to missing triangle");
}
if( t.getConstrainedEdgeAcross(p) )
{
throw new RuntimeException( "Intersecting Constraints" );
}
if( tcx.isDebugEnabled() )
{
tcx.getDebugContext().setPrimaryTriangle( t );
tcx.getDebugContext().setSecondaryTriangle( ot );
} // TODO: remove
inScanArea = inScanArea( p,
t.pointCCW( p ),
t.pointCW( p ),
op );
if( inScanArea )
{
// Lets rotate shared edge one vertex CW
rotateTrianglePair( t, p, ot, op );
tcx.mapTriangleToNodes( t );
tcx.mapTriangleToNodes( ot );
if( p == eq && op == ep )
{
if( eq == tcx.edgeEvent.constrainedEdge.q
&& ep == tcx.edgeEvent.constrainedEdge.p)
{
if( tcx.isDebugEnabled() ) { System.out.println("[FLIP] - constrained edge done" ); } // TODO: remove
t.markConstrainedEdge( ep, eq );
ot.markConstrainedEdge( ep, eq );
legalize( tcx, t );
legalize( tcx, ot );
}
else
{
if( tcx.isDebugEnabled() ) { System.out.println("[FLIP] - subedge done" ); } // TODO: remove
// XXX: I think one of the triangles should be legalized here?
}
}
else
{
if( tcx.isDebugEnabled() ) { System.out.println("[FLIP] - flipping and continuing with triangle still crossing edge" ); } // TODO: remove
Orientation o = orient2d( eq, op, ep );
t = nextFlipTriangle( tcx, o, t, ot, p, op );
flipEdgeEvent( tcx, ep, eq, t, p );
}
}
else
{
newP = nextFlipPoint( ep, eq, ot, op );
flipScanEdgeEvent( tcx, ep, eq, t, ot, newP );
edgeEvent( tcx, ep, eq, t, p );
}
}
示例2: flipEdgeEvent
import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
private static void flipEdgeEvent( DTSweepContext tcx,
TriangulationPoint ep,
TriangulationPoint eq,
DelaunayTriangle t,
TriangulationPoint p )
{
TriangulationPoint op, newP;
DelaunayTriangle ot;
boolean inScanArea;
ot = t.neighborAcross( p );
op = ot.oppositePoint( t, p );
if( ot == null )
{
// If we want to integrate the fillEdgeEvent do it here
// With current implementation we should never get here
throw new RuntimeException( "[BUG:FIXME] FLIP failed due to missing triangle");
}
if( t.getConstrainedEdgeAcross(p) )
{
throw new RuntimeException( "Intersecting Constraints" );
}
if( tcx.isDebugEnabled() )
{
tcx.getDebugContext().setPrimaryTriangle( t );
tcx.getDebugContext().setSecondaryTriangle( ot );
} // TODO: remove
inScanArea = inScanArea( p,
t.pointCCW( p ),
t.pointCW( p ),
op );
if( inScanArea )
{
// Lets rotate shared edge one vertex CW
rotateTrianglePair( t, p, ot, op );
tcx.mapTriangleToNodes( t );
tcx.mapTriangleToNodes( ot );
if( p == eq && op == ep )
{
if( eq == tcx.edgeEvent.constrainedEdge.q
&& ep == tcx.edgeEvent.constrainedEdge.p)
{
if( tcx.isDebugEnabled() ) { System.out.println("[FLIP] - constrained edge done" ); } // TODO: remove
t.markConstrainedEdge( ep, eq );
ot.markConstrainedEdge( ep, eq );
legalize( tcx, t );
legalize( tcx, ot );
}
else
{
if( tcx.isDebugEnabled() ) { System.out.println("[FLIP] - subedge done" ); } // TODO: remove
// XXX: I think one of the triangles should be legalized here?
}
}
else
{
if( tcx.isDebugEnabled() ) { System.out.println("[FLIP] - flipping and continuing with triangle still crossing edge" ); } // TODO: remove
Orientation o = orient2d( eq, op, ep );
t = nextFlipTriangle( tcx, o, t, ot, p, op );
flipEdgeEvent( tcx, ep, eq, t, p );
}
}
else
{
newP = nextFlipPoint( ep, eq, ot, op );
flipScanEdgeEvent( tcx, ep, eq, t, ot, newP );
edgeEvent( tcx, ep, eq, t, p );
}
}
示例3: flipEdgeEvent
import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
private static void flipEdgeEvent( DTSweepContext tcx,
TriangulationPoint ep,
TriangulationPoint eq,
DelaunayTriangle t,
TriangulationPoint p )
{
TriangulationPoint op, newP;
DelaunayTriangle ot;
boolean inScanArea;
ot = t.neighborAcross( p );
op = ot.oppositePoint( t, p );
if( ot == null )
{
// If we want to integrate the fillEdgeEvent do it here
// With current implementation we should never get here
throw new RuntimeException( "[BUG:FIXME] FLIP failed due to missing triangle");
}
if( t.getConstrainedEdgeAcross(p) )
{
throw new RuntimeException( "Intersecting Constraints" );
}
if( tcx.isDebugEnabled() )
{
tcx.getDebugContext().setPrimaryTriangle( t );
tcx.getDebugContext().setSecondaryTriangle( ot );
} // TODO: remove
inScanArea = inScanArea( p,
t.pointCCW( p ),
t.pointCW( p ),
op );
if( inScanArea )
{
// Lets rotate shared edge one vertex CW
rotateTrianglePair( t, p, ot, op );
tcx.mapTriangleToNodes( t );
tcx.mapTriangleToNodes( ot );
if( p == eq && op == ep )
{
if( eq == tcx.edgeEvent.constrainedEdge.q
&& ep == tcx.edgeEvent.constrainedEdge.p)
{
t.markConstrainedEdge( ep, eq );
ot.markConstrainedEdge( ep, eq );
legalize( tcx, t );
legalize( tcx, ot );
}
}
else
{
Orientation o = orient2d( eq, op, ep );
t = nextFlipTriangle( tcx, o, t, ot, p, op );
flipEdgeEvent( tcx, ep, eq, t, p );
}
}
else
{
newP = nextFlipPoint( ep, eq, ot, op );
flipScanEdgeEvent( tcx, ep, eq, t, ot, newP );
edgeEvent( tcx, ep, eq, t, p );
}
}
示例4: flipEdgeEvent
import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
private static void flipEdgeEvent( DTSweepContext tcx,
TriangulationPoint ep,
TriangulationPoint eq,
DelaunayTriangle t,
TriangulationPoint p )
{
TriangulationPoint op, newP;
DelaunayTriangle ot;
boolean inScanArea;
ot = t.neighborAcross( p );
op = ot.oppositePoint( t, p );
if( ot == null )
{
// If we want to integrate the fillEdgeEvent do it here
// With current implementation we should never get here
throw new RuntimeException( "[BUG:FIXME] FLIP failed due to missing triangle");
}
if( t.getConstrainedEdgeAcross(p) )
{
throw new RuntimeException( "JAMES IS THE BEST" );
//System.out.println("Intersecting Constraints, if this happens often, tell James");
}
if( tcx.isDebugEnabled() )
{
tcx.getDebugContext().setPrimaryTriangle( t );
tcx.getDebugContext().setSecondaryTriangle( ot );
} // TODO: remove
inScanArea = inScanArea( p,
t.pointCCW( p ),
t.pointCW( p ),
op );
if( inScanArea )
{
// Lets rotate shared edge one vertex CW
rotateTrianglePair( t, p, ot, op );
tcx.mapTriangleToNodes( t );
tcx.mapTriangleToNodes( ot );
if( p == eq && op == ep )
{
if( eq == tcx.edgeEvent.constrainedEdge.q
&& ep == tcx.edgeEvent.constrainedEdge.p)
{
if( tcx.isDebugEnabled() ) { System.out.println("[FLIP] - constrained edge done" ); } // TODO: remove
t.markConstrainedEdge( ep, eq );
ot.markConstrainedEdge( ep, eq );
legalize( tcx, t );
legalize( tcx, ot );
}
else
{
if( tcx.isDebugEnabled() ) { System.out.println("[FLIP] - subedge done" ); } // TODO: remove
// XXX: I think one of the triangles should be legalized here?
}
}
else
{
if( tcx.isDebugEnabled() ) { System.out.println("[FLIP] - flipping and continuing with triangle still crossing edge" ); } // TODO: remove
Orientation o = orient2d( eq, op, ep );
t = nextFlipTriangle( tcx, o, t, ot, p, op );
flipEdgeEvent( tcx, ep, eq, t, p );
}
}
else
{
newP = nextFlipPoint( ep, eq, ot, op );
flipScanEdgeEvent( tcx, ep, eq, t, ot, newP );
edgeEvent( tcx, ep, eq, t, p );
}
}