------------------------------------------------------------------------------
| 90 | |
| 91 | //------------------------------------------------------------------------------ |
| 92 | void vtkChartBox::Update() |
| 93 | { |
| 94 | vtkTable* table = this->Storage->Plot->GetData()->GetInput(); |
| 95 | if (!table) |
| 96 | { |
| 97 | return; |
| 98 | } |
| 99 | |
| 100 | if (table->GetMTime() < this->BuildTime && this->MTime < this->BuildTime) |
| 101 | { |
| 102 | return; |
| 103 | } |
| 104 | |
| 105 | vtkDataSetAttributes* rowData = table->GetRowData(); |
| 106 | int nbCols = this->VisibleColumns->GetNumberOfTuples(); |
| 107 | |
| 108 | this->Storage->XPosition.resize(nbCols); |
| 109 | |
| 110 | double grange[2] = { VTK_DOUBLE_MAX, VTK_DOUBLE_MIN }; |
| 111 | // Now set up their ranges and locations |
| 112 | for (int i = 0; i < nbCols; ++i) |
| 113 | { |
| 114 | double range[2]; |
| 115 | if (rowData->GetRange(this->VisibleColumns->GetValue(i).c_str(), range)) |
| 116 | { |
| 117 | grange[0] = std::min(range[0], grange[0]); |
| 118 | grange[1] = std::max(range[1], grange[1]); |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | this->Storage->YAxis->SetMinimum(grange[0]); |
| 123 | this->Storage->YAxis->SetMaximum(grange[1]); |
| 124 | |
| 125 | this->GeometryValid = false; |
| 126 | this->BuildTime.Modified(); |
| 127 | } |
| 128 | |
| 129 | //------------------------------------------------------------------------------ |
| 130 | bool vtkChartBox::Paint(vtkContext2D* painter) |
no test coverage detected