Function for if the intersection is soft closed or open
| 1073 | |
| 1074 | // Function for if the intersection is soft closed or open |
| 1075 | int vtkLoopBooleanPolyDataFilter::Impl::RunLoopFind( |
| 1076 | vtkIdType interPt, vtkIdType nextCell, bool* usedPt, simLoop* loop) |
| 1077 | { |
| 1078 | vtkIdType prevPt = interPt; |
| 1079 | vtkIdType nextPt = interPt; |
| 1080 | vtkSmartPointer<vtkIdList> pointIds = vtkSmartPointer<vtkIdList>::New(); |
| 1081 | vtkSmartPointer<vtkIdList> cellIds = vtkSmartPointer<vtkIdList>::New(); |
| 1082 | |
| 1083 | IntersectionLines->GetCellPoints(nextCell, pointIds); |
| 1084 | if (pointIds->GetNumberOfIds() > 2) |
| 1085 | { |
| 1086 | vtkDebugWithObjectMacro( |
| 1087 | this->ParentFilter, << "Number Of Points is greater than 2 for first cell " << nextCell); |
| 1088 | } |
| 1089 | else if (pointIds->GetNumberOfIds() < 2) |
| 1090 | { |
| 1091 | vtkDebugWithObjectMacro( |
| 1092 | this->ParentFilter, << "Number Of Points is less than 2 for first cell " << nextCell); |
| 1093 | } |
| 1094 | |
| 1095 | if (pointIds->GetId(0) == nextPt) |
| 1096 | { |
| 1097 | nextPt = pointIds->GetId(1); |
| 1098 | } |
| 1099 | else |
| 1100 | { |
| 1101 | nextPt = pointIds->GetId(0); |
| 1102 | } |
| 1103 | simLine newline; |
| 1104 | newline.pt1 = prevPt; |
| 1105 | newline.pt2 = nextPt; |
| 1106 | newline.id = nextCell; |
| 1107 | loop->cells.push_back(newline); |
| 1108 | |
| 1109 | usedPt[nextPt] = true; |
| 1110 | while (nextPt != loop->cells.front().pt1) |
| 1111 | { |
| 1112 | IntersectionLines->GetPointCells(nextPt, cellIds); |
| 1113 | if (cellIds->GetNumberOfIds() > 2) |
| 1114 | { |
| 1115 | IntersectionCase = 1; |
| 1116 | vtkDebugWithObjectMacro( |
| 1117 | this->ParentFilter, << "Number Of Cells is greater than 2 for point " << nextPt); |
| 1118 | usedPt[nextPt] = false; |
| 1119 | nextCell = this->RunLoopTest(nextPt, nextCell, loop, usedPt); |
| 1120 | if (nextCell == -1) |
| 1121 | { |
| 1122 | break; |
| 1123 | } |
| 1124 | vtkDebugWithObjectMacro(this->ParentFilter, << "Next cell is " << nextCell); |
| 1125 | } |
| 1126 | else if (cellIds->GetNumberOfIds() < 2) |
| 1127 | { |
| 1128 | vtkDebugWithObjectMacro( |
| 1129 | this->ParentFilter, << "Number Of Cells is less than 2 for point " << nextPt); |
| 1130 | IntersectionCase = 2; |
| 1131 | return nextPt; |
| 1132 | } |
no test coverage detected