geopro/src/app/AxesSettingsPanel.hpp

46 lines
1.6 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <QFrame>
#include "AxesSettingsDialog.hpp" // AxisRange
class QCheckBox;
class QComboBox;
class QDoubleSpinBox;
class QVBoxLayout;
class QSlider;
class QLabel;
namespace geopro::app {
// 坐标轴设置抽屉面板(原型):工具条右侧滑出、非模态。
// 内容:坐标轴单位(米/英尺) → X/Y/Z 三轴(显示开关 + 最小值/最大值) → 放大系数(0.1/0.5/1/2/5) → 取消/应用。
class AxesSettingsPanel : public QFrame {
Q_OBJECT
public:
explicit AxesSettingsPanel(QWidget* parent = nullptr);
// 打开前回灌当前值(单位 0=米/1=英尺scale=放大系数=垂直夸张)。
void setValues(AxisRange x, AxisRange y, AxisRange z, int unitIdx, double scale);
signals:
// 「应用」一次性下发:坐标轴(显示方式/单位/per-axis 可见性·范围) + 放大系数(scale=垂直夸张)。
// 放大系数滑块仅改面板内数值,点「应用」才统一生效(与面板其余项一致,不再实时)。
void applied(AxisRange x, AxisRange y, AxisRange z, int unitIdx, double scale);
void closed(); // × 或 取消
private:
struct Row {
QCheckBox* show = nullptr;
QDoubleSpinBox* lo = nullptr;
QDoubleSpinBox* hi = nullptr;
};
Row addAxisRow(QVBoxLayout* col, const QString& title, const AxisRange& def);
QComboBox* unit_ = nullptr; // 坐标轴单位:米 / 英尺
QSlider* scaleSlider_ = nullptr; // 放大系数(=垂直夸张)滑块 1~10×
QLabel* scaleLabel_ = nullptr; // 滑块当前值标签如「3.0×」)
Row x_, y_, z_;
};
} // namespace geopro::app