当前位置: 首页>>代码示例>>Java>>正文


Java DelaunayTriangle.oppositePoint方法代码示例

本文整理汇总了Java中org.poly2tri.triangulation.delaunay.DelaunayTriangle.oppositePoint方法的典型用法代码示例。如果您正苦于以下问题:Java DelaunayTriangle.oppositePoint方法的具体用法?Java DelaunayTriangle.oppositePoint怎么用?Java DelaunayTriangle.oppositePoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.poly2tri.triangulation.delaunay.DelaunayTriangle的用法示例。


在下文中一共展示了DelaunayTriangle.oppositePoint方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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( 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 );                
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:70,代码来源:DTSweep.java

示例2: flipScanEdgeEvent

import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
/**
 * Scan part of the FlipScan algorithm<br>
 * When a triangle pair isn't flippable we will scan for the next 
 * point that is inside the flip triangle scan area. When found 
 * we generate a new flipEdgeEvent
 * 
 * @param tcx
 * @param ep - last point on the edge we are traversing
 * @param eq - first point on the edge we are traversing
 * @param flipTriangle - the current triangle sharing the point eq with edge
 * @param t
 * @param p
 */
private static void flipScanEdgeEvent( DTSweepContext tcx, 
                                       TriangulationPoint ep,
                                       TriangulationPoint eq,
                                       DelaunayTriangle flipTriangle, 
                                       DelaunayTriangle t, 
                                       TriangulationPoint p )
{
    DelaunayTriangle ot;
    TriangulationPoint op,newP;
    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( tcx.isDebugEnabled() ) 
    { 
        System.out.println("[FLIP:SCAN] - scan next point" ); // TODO: remove
        tcx.getDebugContext().setPrimaryTriangle( t );        
        tcx.getDebugContext().setSecondaryTriangle( ot ); 
    }
    
    inScanArea = inScanArea( eq,
                             flipTriangle.pointCCW( eq ),
                             flipTriangle.pointCW( eq ), 
                             op );
    if( inScanArea )
    {
        // flip with new edge op->eq
        flipEdgeEvent( tcx, eq, op, ot, op );                
        // TODO: Actually I just figured out that it should be possible to 
        //       improve this by getting the next ot and op before the the above 
        //       flip and continue the flipScanEdgeEvent here
        // set new ot and op here and loop back to inScanArea test
        // also need to set a new flipTriangle first
        // Turns out at first glance that this is somewhat complicated
        // so it will have to wait.
    }
    else
    {
        newP = nextFlipPoint( ep, eq, ot, op );
        flipScanEdgeEvent( tcx, ep, eq, flipTriangle, ot, newP );    
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:64,代码来源:DTSweep.java

示例3: legalize

import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
/**
 * Returns true if triangle was legalized
 */
private static boolean legalize( DTSweepContext tcx, 
                                 DelaunayTriangle t )
{
    int oi;
    boolean inside;
    TriangulationPoint p,op;
    DelaunayTriangle ot;
    // To legalize a triangle we start by finding if any of the three edges
    // violate the Delaunay condition
    for( int i=0; i<3; i++ )
    {
        // TODO: fix so that cEdge is always valid when creating new triangles then we can check it here
        //       instead of below with ot
        if( t.dEdge[i] )
        {
            continue;
        }
        ot = t.neighbors[i];
        if( ot != null )
        {
            p = t.points[i];
            op = ot.oppositePoint( t, p );
            oi = ot.index( op );
            // If this is a Constrained Edge or a Delaunay Edge(only during recursive legalization)
            // then we should not try to legalize
            if( ot.cEdge[oi] || ot.dEdge[oi] )
            {
                t.cEdge[i] = ot.cEdge[oi]; // XXX: have no good way of setting this property when creating new triangles so lets set it here                     
                continue;
            }
            inside = smartIncircle( p, 
                                    t.pointCCW( p ),
                                    t.pointCW( p ), 
                                    op );
            if( inside )
            {
                boolean notLegalized;
                
                // Lets mark this shared edge as Delaunay 
                t.dEdge[i] = true;
                ot.dEdge[oi] = true;

                // Lets rotate shared edge one vertex CW to legalize it
                rotateTrianglePair( t, p, ot, op );

                // We now got one valid Delaunay Edge shared by two triangles
                // This gives us 4 new edges to check for Delaunay

                // Make sure that triangle to node mapping is done only one time for a specific triangle
                notLegalized = !legalize( tcx, t );
                if( notLegalized )
                {
                    tcx.mapTriangleToNodes( t );                        
                }
                notLegalized = !legalize( tcx, ot );
                if( notLegalized )
                {
                    tcx.mapTriangleToNodes( ot );                        
                }
                                    
                // Reset the Delaunay edges, since they only are valid Delaunay edges
                // until we add a new triangle or point.
                // XXX: need to think about this. Can these edges be tried after we 
                //      return to previous recursive level?
                t.dEdge[i] = false;
                ot.dEdge[oi] = false;

                // If triangle have been legalized no need to check the other edges since
                // the recursive legalization will handles those so we can end here.
                return true;
            }
        }
    }   
    return false;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:79,代码来源:DTSweep.java

示例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( "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 );                
    }
}
 
开发者ID:orbisgis,项目名称:poly2tri.java,代码行数:75,代码来源:DTSweep.java

示例5: 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 );
    }
}
 
开发者ID:lyrachord,项目名称:FX3DAndroid,代码行数:75,代码来源:DTSweep.java

示例6: flipScanEdgeEvent

import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
/**
 * Scan part of the FlipScan algorithm<br>
 * When a triangle pair isn't flippable we will scan for the next
 * point that is inside the flip triangle scan area. When found
 * we generate a new flipEdgeEvent
 *
 * @param tcx
 * @param ep - last point on the edge we are traversing
 * @param eq - first point on the edge we are traversing
 * @param flipTriangle - the current triangle sharing the point eq with edge
 * @param t
 * @param p
 */
private static void flipScanEdgeEvent( DTSweepContext tcx,
                                       TriangulationPoint ep,
                                       TriangulationPoint eq,
                                       DelaunayTriangle flipTriangle,
                                       DelaunayTriangle t,
                                       TriangulationPoint p )
{
    DelaunayTriangle ot;
    TriangulationPoint op,newP;
    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( tcx.isDebugEnabled() )
    {
        System.out.println("[FLIP:SCAN] - scan next point" ); // TODO: remove
        tcx.getDebugContext().setPrimaryTriangle( t );
        tcx.getDebugContext().setSecondaryTriangle( ot );
    }

    inScanArea = inScanArea( eq,
                             flipTriangle.pointCCW( eq ),
                             flipTriangle.pointCW( eq ),
                             op );
    if( inScanArea )
    {
        // flip with new edge op->eq
        flipEdgeEvent( tcx, eq, op, ot, op );
        // TODO: Actually I just figured out that it should be possible to
        //       improve this by getting the next ot and op before the the above
        //       flip and continue the flipScanEdgeEvent here
        // set new ot and op here and loop back to inScanArea test
        // also need to set a new flipTriangle first
        // Turns out at first glance that this is somewhat complicated
        // so it will have to wait.
    }
    else
    {
        newP = nextFlipPoint( ep, eq, ot, op );
        flipScanEdgeEvent( tcx, ep, eq, flipTriangle, ot, newP );
    }
}
 
开发者ID:lyrachord,项目名称:FX3DAndroid,代码行数:64,代码来源:DTSweep.java

示例7: legalize

import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
/**
 * Returns true if triangle was legalized
 */
private static boolean legalize( DTSweepContext tcx,
                                 DelaunayTriangle t )
{
    int oi;
    boolean inside;
    TriangulationPoint p,op;
    DelaunayTriangle ot;
    // To legalize a triangle we start by finding if any of the three edges
    // violate the Delaunay condition
    for( int i=0; i<3; i++ )
    {
        // TODO: fix so that cEdge is always valid when creating new triangles then we can check it here
        //       instead of below with ot
        if( t.dEdge[i] )
        {
            continue;
        }
        ot = t.neighbors[i];
        if( ot != null )
        {
            p = t.points[i];
            op = ot.oppositePoint( t, p );
            oi = ot.index( op );
            // If this is a Constrained Edge or a Delaunay Edge(only during recursive legalization)
            // then we should not try to legalize
            if( ot.cEdge[oi] || ot.dEdge[oi] )
            {
                t.cEdge[i] = ot.cEdge[oi]; // XXX: have no good way of setting this property when creating new triangles so lets set it here
                continue;
            }
            inside = smartIncircle( p,
                                    t.pointCCW( p ),
                                    t.pointCW( p ),
                                    op );
            if( inside )
            {
                boolean notLegalized;

                // Lets mark this shared edge as Delaunay
                t.dEdge[i] = true;
                ot.dEdge[oi] = true;

                // Lets rotate shared edge one vertex CW to legalize it
                rotateTrianglePair( t, p, ot, op );

                // We now got one valid Delaunay Edge shared by two triangles
                // This gives us 4 new edges to check for Delaunay

                // Make sure that triangle to node mapping is done only one time for a specific triangle
                notLegalized = !legalize( tcx, t );
                if( notLegalized )
                {
                    tcx.mapTriangleToNodes( t );
                }
                notLegalized = !legalize( tcx, ot );
                if( notLegalized )
                {
                    tcx.mapTriangleToNodes( ot );
                }

                // Reset the Delaunay edges, since they only are valid Delaunay edges
                // until we add a new triangle or point.
                // XXX: need to think about this. Can these edges be tried after we
                //      return to previous recursive level?
                t.dEdge[i] = false;
                ot.dEdge[oi] = false;

                // If triangle have been legalized no need to check the other edges since
                // the recursive legalization will handles those so we can end here.
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:lyrachord,项目名称:FX3DAndroid,代码行数:79,代码来源:DTSweep.java

示例8: 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 );                
    }
}
 
开发者ID:Anarchid,项目名称:zkgbai,代码行数:68,代码来源:DTSweep.java

示例9: flipScanEdgeEvent

import org.poly2tri.triangulation.delaunay.DelaunayTriangle; //导入方法依赖的package包/类
/**
 * Scan part of the FlipScan algorithm<br>
 * When a triangle pair isn't flippable we will scan for the next 
 * point that is inside the flip triangle scan area. When found 
 * we generate a new flipEdgeEvent
 * 
 * @param tcx
 * @param ep - last point on the edge we are traversing
 * @param eq - first point on the edge we are traversing
 * @param flipTriangle - the current triangle sharing the point eq with edge
 * @param t
 * @param p
 */
private static void flipScanEdgeEvent( DTSweepContext tcx, 
                                       TriangulationPoint ep,
                                       TriangulationPoint eq,
                                       DelaunayTriangle flipTriangle, 
                                       DelaunayTriangle t, 
                                       TriangulationPoint p )
{
    DelaunayTriangle ot;
    TriangulationPoint op,newP;
    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( tcx.isDebugEnabled() ) 
    { 
        tcx.getDebugContext().setPrimaryTriangle( t );        
        tcx.getDebugContext().setSecondaryTriangle( ot ); 
    }
    
    inScanArea = inScanArea( eq,
                             flipTriangle.pointCCW( eq ),
                             flipTriangle.pointCW( eq ), 
                             op );
    if( inScanArea )
    {
        // flip with new edge op->eq
        flipEdgeEvent( tcx, eq, op, ot, op );                
        // TODO: Actually I just figured out that it should be possible to 
        //       improve this by getting the next ot and op before the the above 
        //       flip and continue the flipScanEdgeEvent here
        // set new ot and op here and loop back to inScanArea test
        // also need to set a new flipTriangle first
        // Turns out at first glance that this is somewhat complicated
        // so it will have to wait.
    }
    else
    {
        newP = nextFlipPoint( ep, eq, ot, op );
        flipScanEdgeEvent( tcx, ep, eq, flipTriangle, ot, newP );    
    }
}
 
开发者ID:Anarchid,项目名称:zkgbai,代码行数:63,代码来源:DTSweep.java

示例10: 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 );                
    }
}
 
开发者ID:underclocker,项目名称:Blob-Game,代码行数:76,代码来源:DTSweep.java


注:本文中的org.poly2tri.triangulation.delaunay.DelaunayTriangle.oppositePoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。