MCPcopy Create free account
hub / github.com/Kitware/VTK / IsEdge

Method IsEdge

Common/DataModel/vtkEdgeTable.cxx:195–233  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Return non-negative if edge (p1,p2) is an edge; otherwise -1.

Source from the content-addressed store, hash-verified

193//------------------------------------------------------------------------------
194// Return non-negative if edge (p1,p2) is an edge; otherwise -1.
195vtkIdType 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.

Callers 2

GetNextEdgeMethod · 0.95
InsertUniquePointMethod · 0.95

Calls 3

IsIdMethod · 0.80
GetIdMethod · 0.45
GetVoidPointerMethod · 0.45

Tested by

no test coverage detected