Commit 19428fca authored by Brian Wylie's avatar Brian Wylie
Browse files

BUG: Disregard last checkin. The correct thing to do was use both the number...

BUG: Disregard last checkin. The correct thing to do was use both the number of graph vertices and tree vertices depending on the map your constructing. So should be fixed now (as opposed to before :)
parent dff94ac0
......@@ -34,7 +34,7 @@
#include <vtksys/stl/map>
using vtksys_stl::map;
vtkCxxRevisionMacro(vtkGraphHierarchicalBundle, "1.3");
vtkCxxRevisionMacro(vtkGraphHierarchicalBundle, "1.4");
vtkStandardNewMacro(vtkGraphHierarchicalBundle);
vtkGraphHierarchicalBundle::vtkGraphHierarchicalBundle()
......@@ -60,19 +60,19 @@ int vtkGraphHierarchicalBundle::FillInputPortInformation(int port, vtkInformatio
}
template <typename T>
void mappingMadness(T *graphIds, T *treeIds,
map<vtkIdType,vtkIdType> *idMap, int numVertices)
void mappingMadness(T *graphIds, T *treeIds, map<vtkIdType,vtkIdType> *idMap,
int numGraphVertices, int numTreeVertices)
{
map<T,vtkIdType> graphIdMap;
// Now create the two maps
for (int i=0; i<numVertices; ++i)
for (int i=0; i<numGraphVertices; ++i)
{
graphIdMap[graphIds[i]] = i;
}
// Now create the output map
for (int i=0; i<numVertices; ++i)
for (int i=0; i<numTreeVertices; ++i)
{
(*idMap)[graphIdMap[treeIds[i]]] = i;
}
......@@ -160,6 +160,7 @@ int vtkGraphHierarchicalBundle::RequestData(
vtkExtendedTemplateMacro(mappingMadness(static_cast<VTK_TT*>(graphVoid),
static_cast<VTK_TT*>(treeVoid),
&graphIndexToTreeIndex,
graph->GetNumberOfVertices(),
tree->GetNumberOfVertices()));
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment