Commit 0c41fe46 authored by Jeff Baumes's avatar Jeff Baumes Committed by Code Review
Browse files

Merge topic 'coordinates_in_tooltip' into master

a9abb469 add row/column info to tooltip
parents c5f21d95 a9abb469
......@@ -1140,6 +1140,7 @@ bool vtkTreeHeatmapItem::MouseMoveEvent(const vtkContextMouseEvent &event)
//-----------------------------------------------------------------------------
std::string vtkTreeHeatmapItem::GetTooltipText(float x, float y)
{
vtkIdType column = floor((x - this->HeatmapMinX) / this->CellWidth);
int sceneRow = floor(y / this->CellHeight + 0.5);
......@@ -1148,7 +1149,20 @@ std::string vtkTreeHeatmapItem::GetTooltipText(float x, float y)
int dataRow = this->RowMap[sceneRow];
if (dataRow != -1)
{
return this->Table->GetValue(dataRow, column + 1).ToString();
vtkStringArray *rowNames = vtkStringArray::SafeDownCast(
this->Table->GetColumn(0));
std::string rowName = rowNames->GetValue(dataRow);
std::string columnName = this->Table->GetColumn(column + 1)->GetName();
std::string tooltipText = "(";
tooltipText += rowName;
tooltipText += ", ";
tooltipText += columnName;
tooltipText += ")\n";
tooltipText += this->Table->GetValue(dataRow, column + 1).ToString();
return tooltipText;
}
return "";
}
......
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