//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> Ensure that this edge connects to the passed in edge. </summary> /// <remarks> Darrellp, 2/18/2011. </remarks> /// <param name="edge"> Edge to check. </param> /// <returns> True if this edge connects to the passed in edge, else false. </returns> //////////////////////////////////////////////////////////////////////////////////////////////////// internal bool FConnectsToEdge(WeEdge edge) { // Has to be adjacent to either our start or our end vertex return(VtxEnd.FValidateEdgeIsAdjacent(edge) || VtxStart.FValidateEdgeIsAdjacent(edge)); }
/// <summary> /// Validate the edge information /// </summary> /// <returns></returns> internal bool Validate() { // RQS- All variables should be set if (VtxEnd == null) { return(Failure()); } if (VtxStart == null) { return(Failure()); } if (EdgeCCWPredecessor == null) { return(Failure()); } if (EdgeCCWSuccessor == null) { return(Failure()); } if (EdgeCWPredecessor == null) { return(Failure()); } if (EdgeCWSuccessor == null) { return(Failure()); } if (PolyLeft == null) { return(Failure()); } if (PolyRight == null) { return(Failure()); } // -RQS // RQS- Check adjacencies // // Make sure that we and all our CW/CCW successor/predecessor edges // are marked as adjacent in our start/end vertices if (!VtxEnd.FValidateEdgeIsAdjacent(this)) { return(Failure()); } if (!VtxStart.FValidateEdgeIsAdjacent(EdgeCCWPredecessor)) { return(Failure()); } if (!VtxEnd.FValidateEdgeIsAdjacent(EdgeCCWSuccessor)) { return(Failure()); } if (!VtxStart.FValidateEdgeIsAdjacent(EdgeCWPredecessor)) { return(Failure()); } if (!VtxEnd.FValidateEdgeIsAdjacent(EdgeCWSuccessor)) { return(Failure()); } if (!VtxStart.FValidateEdgeIsAdjacent(this)) { return(Failure()); } // -RQS // RQS- Check adjacency of all listed edges to the proper polygons if (!PolyLeft.FValidateEdgeIsAdjacent(this)) { return(Failure()); } if (!PolyRight.FValidateEdgeIsAdjacent(this)) { return(Failure()); } if (!PolyLeft.FValidateEdgeIsAdjacent(EdgeCWSuccessor)) { return(Failure()); } if (!PolyLeft.FValidateEdgeIsAdjacent(EdgeCCWPredecessor)) { return(Failure()); } if (!PolyRight.FValidateEdgeIsAdjacent(EdgeCCWSuccessor)) { return(Failure()); } if (!PolyRight.FValidateEdgeIsAdjacent(EdgeCWPredecessor)) { return(Failure()); } // -RQS return(true); }