------------------------------------------------------------------------------ Return non-negative if edge (p1,p2) is an edge; otherwise -1.
| 193 | //------------------------------------------------------------------------------ |
| 194 | // Return non-negative if edge (p1,p2) is an edge; otherwise -1. |
| 195 | vtkIdType vtkEdgeTable::IsEdge(vtkIdType p1, vtkIdType p2) |
| 196 | { |
| 197 | vtkIdType index, search; |
| 198 | |
| 199 | if (p1 < p2) |
| 200 | { |
| 201 | index = p1; |
| 202 | search = p2; |
| 203 | } |
| 204 | else |
| 205 | { |
| 206 | index = p2; |
| 207 | search = p1; |
| 208 | } |
| 209 | |
| 210 | if (index > this->TableMaxId || this->Table[index] == nullptr) |
| 211 | { |
| 212 | return (-1); |
| 213 | } |
| 214 | else |
| 215 | { |
| 216 | vtkIdType loc; |
| 217 | if ((loc = this->Table[index]->IsId(search)) == (-1)) |
| 218 | { |
| 219 | return (-1); |
| 220 | } |
| 221 | else |
| 222 | { |
| 223 | if (this->StoreAttributes == 1) |
| 224 | { |
| 225 | return this->Attributes[index]->GetId(loc); |
| 226 | } |
| 227 | else |
| 228 | { |
| 229 | return 1; |
| 230 | } |
| 231 | } |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | //------------------------------------------------------------------------------ |
| 236 | // Return non-negative if edge (p1,p2) is an edge; otherwise -1. |
no test coverage detected