Input: ββββAn D-OPP |
βββThe number k of dimensions |
βββA list boundaryElements containing lists. |
βββA list previousCoordinates for completing the coordinates of |
β-coordinates points. |
Procedure GetBoundaryElements(EVM ,int k,List boundaryElements,List previousCoordinates) |
βββ if then |
ββββEVM FDcurr, BDcurr |
ββββList v = GetSetVX1 |
ββββList identifiedBoundaryElements = boundaryElements |
ββββList vertices = boundaryElements(0) |
ββββ{FD, BD} = GetForwardBackwardDifferences |
βββββfor(int Size(FD), ) β// Forward Differences are processed. |
βββββββEVM FDcurr = FD(i) |
βββββββList compsFDcurr = ConnectedComponentsLabeling(FDcurr, ) |
βββββββCoordType commonCoord = v(i) |
βββββββfor(int Size(compsFDcurr), ) |
βββββββββEVM currComp = compsFDcurr(j) |
βββββββββList verticesCurrComp |
βββββββββfor each Extreme Vertex eV in currComp do |
βββββββββββList point = getNdPoint(eV, commonCoord, previousCoordinates) |
βββββββββββint index = IndexOf(vertices, point) |
βββββββββββif(index < 0) then // A new point has been discovered. |
βββββββββββββAppend(vertices, point) |
βββββββββββββindex = Size(vertices) β 1 |
βββββββββββββend-of-if |
βββββββββββββAppend(verticesCurrComp, index) |
βββββββββββend-of-for |
βββββββββββint index = IndexOf(identifiedBoundaryElements, verticesCurrComp) |
βββββββββββif(index < 0) then // A new boundary element has been found. |
βββββββββββββAppend(identifiedBoundaryElements, verticesCurrComp) |
βββββββββββend-of-if |
βββββββββββAppend(previousCoordinates, commonCoord) |
βββββββββββ// Recursive call for identifying new boundary elements. |
βββββββββββGetBoundaryElements(currComp, , boundaryElements, previousCoordinates) |
βββββββββββRemove(previousCoordinates, Size(previousCoordinates) - 1) |
βββββββββend-of-for |
βββββββend-of-for |
βββββββfor(int Size(BD), ) β// Backward differences are processed. |
βββββββββEVM BDcurr = BD(i) |
βββββββββList compsBDcurr = ConnectedComponentsLabeling(BDcurr, ) |
βββββββββCoordType commonCoord = v(i) |
βββββββββfor(int Size(compsBDcurr), ) |
βββββββββββEVM currComp = compsBDcurr(j) |
βββββββββββList verticesCurrComp |
βββββββββββfor each Extreme Vertex eV in currComp do |
βββββββββββββList point = getNdPoint(eV, commonCoord, previousCoordinates) |
βββββββββββββint index = IndexOf(vertices, point) |
βββββββββββββif(index < 0) then // A new point has been discovered. |
βββββββββββββββAppend(vertices, point) |
βββββββββββββββindex = Size(vertices) β 1 |
βββββββββββββend-of-if |
βββββββββββββAppend(verticesCurrComp, index) |
βββββββββββend-of-for |
βββββββββββint index = IndexOf(identifiedBoundaryElements, verticesCurrComp) |
βββββββββββif(index < 0) then // A new boundary element has been found. |
βββββββββββββAppend(identifiedBoundaryElements, verticesCurrComp) |
βββββββββββend-of-if |
βββββββββββAppend(previousCoordinates, commonCoord) |
βββββββββββ// Recursive call for identifying new boundary elements. |
βββββββββββGetBoundaryElements(currComp, , boundaryElements, previousCoordinates) |
βββββββββββRemove(previousCoordinates, Size(previousCoordinates) - 1) |
βββββββββend-of-for |
βββββββend-of-for |
βββββend-of-if |
βββ end-of-procedure |