LiMeshingEdgeSwap

FunctionLtStatus
LiMeshingEdgeSwap( LtPrim prim
LtPoly poly1
LtVref vref1
LtPoly poly2
LtVref vref2
)
Synopsis The default LtFuncMeshingEdgeSwap callback, used inside LiPrimitiveTriangulate.
Locationligeops
Parameters
prim The primitive being triangulated.
poly1 The polygon on one side of the edge.
vref1 The LtVref of poly1; this defines the edge.
poly2 The polygon on the other side of the edge.
vref2 The LtVref of poly2; defining the other end of the edge from vref1
Return Value A status value, indicating success, failure or error.

Description LiMeshingEdgeSwap is the default LtFuncMeshingEdgeSwap ( LI_MESH_CALLBACK_EDGE_SWAP) callback.

\begin{figure}[hb] \vspace* \special{psfile=api/figures/edgeswap.ps hoffset=40} Application of LtFuncMeshingEdgeSwap callback \end{figure}

The edge which is swapped is denoted by the LtVref pair \newline next> of the polygon poly1, and \newline next> of the polygon poly2 (which must not be NULL).

This function is called from LiPrimitiveTriangulate, immediately after the core triangulation operation, in response to the LI_MESH_CRIT_EDGE_SWAPPING criterion, and also during further triangulation, when recently re-triangulated quadrilaterals might introduce edges which need swapping to meet the caller's edge swapping criterion.

If users find that the default callback, LiMeshingEdgeSwap, is not handling some aspect of edge swapping (possibly relating to user-specified properties) then they can write their own callback (perhaps utilising LiMeshingEdgeSwap).

Example
/*
 * writing my own LtFuncMeshingEdgeSwap
 */
LtStatus
my_edge_swap_func (
      LtPrim   prim, 
      LtPoly   poly1, 
      LtVref   vref1, 
      LtPoly   poly2, 
      LtVref   vref2
)
{
   LtStatus   result;

   /* 1: sort the basics */
   result = LiMeshingEdgeSwap(...);

   /* 2: sort my specifics */
   ...

   return ( result );
}

See Also LiMeshingEdgeSplit
LiMeshingInsertBridge
LiMeshingTriProperties
LiPrimitiveTriangulate
LiPrimitiveHierarchicalTriangulate
LiMeshingCallBacksSetCall
LiMeshingCallBacksGetCall
LiMeshingCallBacksCallState
LiMeshingCallBacksCreate
LiMeshingCallBacksCopy
LiMeshingCallBacksDestroy
LiMeshingCallBacksDebug


Copyright © 1990-1998, 1999 LightWork Design Limited. All rights reserved