------------------------------------------------------------------------------
| 1208 | |
| 1209 | //------------------------------------------------------------------------------ |
| 1210 | void vtkDendrogramItem::PositionColorLegend() |
| 1211 | { |
| 1212 | // bail out early if we don't have meaningful bounds yet. |
| 1213 | if (this->MinX > this->MaxX || this->MinY > this->MaxY) |
| 1214 | { |
| 1215 | return; |
| 1216 | } |
| 1217 | |
| 1218 | int orientation = this->GetOrientation(); |
| 1219 | switch (orientation) |
| 1220 | { |
| 1221 | case vtkDendrogramItem::DOWN_TO_UP: |
| 1222 | case vtkDendrogramItem::UP_TO_DOWN: |
| 1223 | this->ColorLegend->SetHorizontalAlignment(vtkChartLegend::RIGHT); |
| 1224 | this->ColorLegend->SetVerticalAlignment(vtkChartLegend::CENTER); |
| 1225 | this->ColorLegend->SetOrientation(vtkColorLegend::VERTICAL); |
| 1226 | this->ColorLegend->SetPoint( |
| 1227 | this->MinX - this->LeafSpacing, this->MinY + (this->MaxY - this->MinY) / 2.0); |
| 1228 | this->ColorLegend->SetTextureSize( |
| 1229 | this->ColorLegend->GetSymbolWidth(), this->MaxY - this->MinY); |
| 1230 | break; |
| 1231 | |
| 1232 | case vtkDendrogramItem::RIGHT_TO_LEFT: |
| 1233 | case vtkDendrogramItem::LEFT_TO_RIGHT: |
| 1234 | default: |
| 1235 | this->ColorLegend->SetHorizontalAlignment(vtkChartLegend::CENTER); |
| 1236 | this->ColorLegend->SetVerticalAlignment(vtkChartLegend::TOP); |
| 1237 | this->ColorLegend->SetOrientation(vtkColorLegend::HORIZONTAL); |
| 1238 | this->ColorLegend->SetPoint( |
| 1239 | this->MinX + (this->MaxX - this->MinX) / 2.0, this->MinY - this->LeafSpacing); |
| 1240 | this->ColorLegend->SetTextureSize( |
| 1241 | this->MaxX - this->MinX, this->ColorLegend->GetSymbolWidth()); |
| 1242 | break; |
| 1243 | } |
| 1244 | this->ColorLegend->Update(); |
| 1245 | this->ColorLegend->SetVisible(true); |
| 1246 | this->Scene->SetDirty(true); |
| 1247 | this->LegendPositionSet = true; |
| 1248 | } |
| 1249 | |
| 1250 | //------------------------------------------------------------------------------ |
| 1251 | void vtkDendrogramItem::SetOrientation(int orientation) |
no test coverage detected