Commit 3f6e7bc0 authored by Xiaoxiao Liu's avatar Xiaoxiao Liu Committed by Code Review
Browse files

Merge topic 'TanglegramFixForVtkWeb' into master

59da79c1 BUG: Use smart pointer for table in vtKTanglegramItem.
parents 3f3fc91d 59da79c1
......@@ -45,7 +45,7 @@ vtkTanglegramItem::vtkTanglegramItem()
this->Dendrogram2->ExtendLeafNodesOn();
this->AddItem(this->Dendrogram2);
this->Table = NULL;
this->Table = vtkSmartPointer<vtkTable>::New();
this->Tree1Label = NULL;
this->Tree2Label = NULL;
......@@ -86,14 +86,22 @@ void vtkTanglegramItem::SetTree2(vtkTree *tree)
this->TreeReordered = false;
}
//-----------------------------------------------------------------------------
vtkTable * vtkTanglegramItem::GetTable()
{
return this->Table;
}
//-----------------------------------------------------------------------------
void vtkTanglegramItem::SetTable(vtkTable *table)
{
this->Table = table;
if (this->Table == NULL)
if (table == NULL)
{
return;
}
this->Table = table;
this->SourceNames = vtkStringArray::SafeDownCast(this->Table->GetColumn(0));
this->GenerateLookupTable();
this->TreeReordered = false;
......
......@@ -60,7 +60,7 @@ public:
// to create a connection between the two trees. Different numbers
// in the table will result in connections being drawn in different
// colors.
vtkGetMacro(Table, vtkTable*);
vtkTable * GetTable();
void SetTable(vtkTable *table);
// Description:
......@@ -162,7 +162,7 @@ private:
vtkSmartPointer<vtkDendrogramItem> Dendrogram1;
vtkSmartPointer<vtkDendrogramItem> Dendrogram2;
vtkSmartPointer<vtkLookupTable> LookupTable;
vtkTable *Table;
vtkSmartPointer<vtkTable> Table;
vtkStringArray *Tree1Names;
vtkStringArray *Tree2Names;
vtkStringArray *SourceNames;
......
Markdown is supported
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