本文整理汇总了Java中org.poly2tri.triangulation.delaunay.DelaunayTriangle.pointCCW方法的典型用法代码示例。如果您正苦于以下问题:Java DelaunayTriangle.pointCCW方法的具体用法?Java DelaunayTriangle.pointCCW怎么用?Java DelaunayTriangle.pointCCW使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.poly2tri.triangulation.delaunay.DelaunayTriangle
的用法示例。
在下文中一共展示了DelaunayTriangle.pointCCW方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: nextFlipPoint
import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
/**
* When we need to traverse from one triangle to the next we need
* the point in current triangle that is the opposite point to the next
* triangle.
*
* @param ep
* @param eq
* @param ot
* @param op
* @return
*/
private static TriangulationPoint nextFlipPoint( TriangulationPoint ep,
TriangulationPoint eq,
DelaunayTriangle ot,
TriangulationPoint op )
{
Orientation o2d = orient2d( eq, op, ep );
if( o2d == Orientation.CW )
{
// Right
return ot.pointCCW( op );
}
else if( o2d == Orientation.CCW )
{
// Left
return ot.pointCW( op );
}
else
{
// TODO: implement support for point on constraint edge
throw new PointOnEdgeException("Point on constrained edge not supported yet");
}
}
示例2: nextFlipPoint
import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
/**
* When we need to traverse from one triangle to the next we need
* the point in current triangle that is the opposite point to the next
* triangle.
*
* @param ep
* @param eq
* @param ot
* @param op
* @return
*/
private static TriangulationPoint nextFlipPoint( TriangulationPoint ep,
TriangulationPoint eq,
DelaunayTriangle ot,
TriangulationPoint op )
{
Orientation o2d = orient2d( eq, op, ep );
if( o2d == Orientation.CW )
{
// Right
return ot.pointCCW( op );
}
else if( o2d == Orientation.CCW )
{
// Left
return ot.pointCW( op );
}
else
{
// TODO: implement support for point on constraint edge
throw new PointOnEdgeException("Point on constrained edge not supported yet");
}
}
示例3: edgeEvent
import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
private static void edgeEvent( DTSweepContext tcx,
TriangulationPoint ep,
TriangulationPoint eq,
DelaunayTriangle triangle,
TriangulationPoint point )
{
TriangulationPoint p1,p2;
if( tcx.isDebugEnabled() ) { tcx.getDebugContext().setPrimaryTriangle( triangle ); }
if( isEdgeSideOfTriangle( triangle, ep, eq ) )
{
return;
}
p1 = triangle.pointCCW( point );
Orientation o1 = orient2d( eq, p1, ep );
if( o1 == Orientation.Collinear )
{
if( triangle.contains( eq, p1 ) )
{
triangle.markConstrainedEdge( eq, p1 );
// We are modifying the constraint maybe it would be better to
// not change the given constraint and just keep a variable for the new constraint
tcx.edgeEvent.constrainedEdge.q = p1;
triangle = triangle.neighborAcross( point );
edgeEvent( tcx, ep, p1, triangle, p1 );
}
else
{
throw new PointOnEdgeException( "EdgeEvent - Point on constrained edge not supported yet" );
}
if( tcx.isDebugEnabled() ) { logger.info( "EdgeEvent - Point on constrained edge" ); }
return;
}
p2 = triangle.pointCW( point );
Orientation o2 = orient2d( eq, p2, ep );
if( o2 == Orientation.Collinear )
{
if( triangle.contains( eq, p2 ) )
{
triangle.markConstrainedEdge( eq, p2 );
// We are modifying the constraint maybe it would be better to
// not change the given constraint and just keep a variable for the new constraint
tcx.edgeEvent.constrainedEdge.q = p2;
triangle = triangle.neighborAcross( point );
edgeEvent( tcx, ep, p2, triangle, p2 );
}
else
{
throw new PointOnEdgeException( "EdgeEvent - Point on constrained edge not supported yet" );
}
if( tcx.isDebugEnabled() ) { logger.info( "EdgeEvent - Point on constrained edge" ); }
return;
}
if( o1 == o2 )
{
// Need to decide if we are rotating CW or CCW to get to a triangle
// that will cross edge
if( o1 == Orientation.CW )
{
triangle = triangle.neighborCCW( point );
}
else
{
triangle = triangle.neighborCW( point );
}
edgeEvent( tcx, ep, eq, triangle, point );
}
else
{
// This triangle crosses constraint so lets flippin start!
flipEdgeEvent( tcx, ep, eq, triangle, point );
}
}
示例4: edgeEvent
import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
private static void edgeEvent( DTSweepContext tcx,
TriangulationPoint ep,
TriangulationPoint eq,
DelaunayTriangle triangle,
TriangulationPoint point )
{
TriangulationPoint p1,p2;
if( tcx.isDebugEnabled() ) { tcx.getDebugContext().setPrimaryTriangle( triangle ); }
if( isEdgeSideOfTriangle( triangle, ep, eq ) )
{
return;
}
p1 = triangle.pointCCW( point );
Orientation o1 = orient2d( eq, p1, ep );
if( o1 == Orientation.Collinear )
{
if( triangle.contains( eq, p1 ) )
{
triangle.markConstrainedEdge( eq, p1 );
// We are modifying the constraint maybe it would be better to
// not change the given constraint and just keep a variable for the new constraint
tcx.edgeEvent.constrainedEdge.q = p1;
triangle = triangle.neighborAcross( point );
edgeEvent( tcx, ep, p1, triangle, p1 );
}
else
{
throw new PointOnEdgeException( "EdgeEvent - Point on constrained edge not supported yet" );
}
if( tcx.isDebugEnabled() ) { LogUtil.info( "EdgeEvent - Point on constrained edge" ); }
return;
}
p2 = triangle.pointCW( point );
Orientation o2 = orient2d( eq, p2, ep );
if( o2 == Orientation.Collinear )
{
if( triangle.contains( eq, p2 ) )
{
triangle.markConstrainedEdge( eq, p2 );
// We are modifying the constraint maybe it would be better to
// not change the given constraint and just keep a variable for the new constraint
tcx.edgeEvent.constrainedEdge.q = p2;
triangle = triangle.neighborAcross( point );
edgeEvent( tcx, ep, p2, triangle, p2 );
}
else
{
throw new PointOnEdgeException( "EdgeEvent - Point on constrained edge not supported yet" );
}
if( tcx.isDebugEnabled() ) { LogUtil.info( "EdgeEvent - Point on constrained edge" ); }
return;
}
if( o1 == o2 )
{
// Need to decide if we are rotating CW or CCW to get to a triangle
// that will cross edge
if( o1 == Orientation.CW )
{
triangle = triangle.neighborCCW( point );
}
else
{
triangle = triangle.neighborCW( point );
}
edgeEvent( tcx, ep, eq, triangle, point );
}
else
{
// This triangle crosses constraint so lets flippin start!
flipEdgeEvent( tcx, ep, eq, triangle, point );
}
}
示例5: edgeEvent
import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
private static void edgeEvent( DTSweepContext tcx,
TriangulationPoint ep,
TriangulationPoint eq,
DelaunayTriangle triangle,
TriangulationPoint point )
{
TriangulationPoint p1,p2;
if( tcx.isDebugEnabled() ) { tcx.getDebugContext().setPrimaryTriangle( triangle ); }
if( isEdgeSideOfTriangle( triangle, ep, eq ) )
{
return;
}
p1 = triangle.pointCCW( point );
Orientation o1 = orient2d( eq, p1, ep );
if( o1 == Orientation.Collinear )
{
if( triangle.contains( eq, p1 ) )
{
triangle.markConstrainedEdge( eq, p1 );
// We are modifying the constraint maybe it would be better to
// not change the given constraint and just keep a variable for the new constraint
tcx.edgeEvent.constrainedEdge.q = p1;
triangle = triangle.neighborAcross( point );
edgeEvent( tcx, ep, p1, triangle, p1 );
}
else
{
throw new PointOnEdgeException( "EdgeEvent - Point on constrained edge not supported yet" );
}
if( tcx.isDebugEnabled() ) { }
return;
}
p2 = triangle.pointCW( point );
Orientation o2 = orient2d( eq, p2, ep );
if( o2 == Orientation.Collinear )
{
if( triangle.contains( eq, p2 ) )
{
triangle.markConstrainedEdge( eq, p2 );
// We are modifying the constraint maybe it would be better to
// not change the given constraint and just keep a variable for the new constraint
tcx.edgeEvent.constrainedEdge.q = p2;
triangle = triangle.neighborAcross( point );
edgeEvent( tcx, ep, p2, triangle, p2 );
}
else
{
throw new PointOnEdgeException( "EdgeEvent - Point on constrained edge not supported yet" );
}
return;
}
if( o1 == o2 )
{
// Need to decide if we are rotating CW or CCW to get to a triangle
// that will cross edge
if( o1 == Orientation.CW )
{
triangle = triangle.neighborCCW( point );
}
else
{
triangle = triangle.neighborCW( point );
}
edgeEvent( tcx, ep, eq, triangle, point );
}
else
{
// This triangle crosses constraint so lets flippin start!
flipEdgeEvent( tcx, ep, eq, triangle, point );
}
}