| 4532 | } |
| 4533 | |
| 4534 | void BufferViewer::UI_UpdateBoundingBoxLabels(int compCount) |
| 4535 | { |
| 4536 | if(compCount == 0) |
| 4537 | { |
| 4538 | BufferItemModel *model = currentBufferModel(); |
| 4539 | if(model) |
| 4540 | { |
| 4541 | int posEl = model->posColumn(); |
| 4542 | if(posEl >= 0 && posEl < model->getConfig().columns.count()) |
| 4543 | { |
| 4544 | compCount = model->getConfig().columns[posEl].type.columns; |
| 4545 | } |
| 4546 | } |
| 4547 | } |
| 4548 | |
| 4549 | QString min, max; |
| 4550 | |
| 4551 | float *minData = &m_Config.minBounds.x; |
| 4552 | float *maxData = &m_Config.maxBounds.x; |
| 4553 | |
| 4554 | const QString comps = lit("xyzw"); |
| 4555 | |
| 4556 | for(int i = 0; i < compCount && i < 4; i++) |
| 4557 | { |
| 4558 | if(i != 0) |
| 4559 | { |
| 4560 | min += lit("\n"); |
| 4561 | max += lit("\n"); |
| 4562 | } |
| 4563 | |
| 4564 | min += tr("Min %1: %2").arg(comps[i]).arg(Formatter::Format(minData[i])); |
| 4565 | max += tr("Max %1: %2").arg(comps[i]).arg(Formatter::Format(maxData[i])); |
| 4566 | } |
| 4567 | |
| 4568 | if(min.isEmpty()) |
| 4569 | ui->minBoundsLabel->setText(lit("---")); |
| 4570 | else |
| 4571 | ui->minBoundsLabel->setText(min); |
| 4572 | |
| 4573 | if(max.isEmpty()) |
| 4574 | ui->maxBoundsLabel->setText(lit("---")); |
| 4575 | else |
| 4576 | ui->maxBoundsLabel->setText(max); |
| 4577 | } |
| 4578 | |
| 4579 | void BufferViewer::UI_ResetArcball() |
| 4580 | { |