geopro/src/app/ContourLineDialog.hpp

43 lines
1.3 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 <QDialog>
#include "model/ColorScale.hpp" // core::Rgba
class QCheckBox;
class QComboBox;
class QPushButton;
namespace geopro::app {
// 线形/标注配置(复刻 contourLine.vue 的 emit。共享2D 等值线渲染消费3D 无等值线,忽略。
struct ContourLineConfig {
bool lineShow = true;
geopro::core::Rgba lineColor{0, 0, 0, 255};
bool dashed = false; // false=实线 solidtrue=虚线 dashed
bool labelShow = true;
geopro::core::Rgba labelColor{0, 0, 0, 255};
};
// 线形⚙ 子对话框(复刻 contourLine.vue线型(实线/虚线)、线显、线色、标注显、标注色。
class ContourLineDialog : public QDialog {
Q_OBJECT
public:
ContourLineDialog(const ContourLineConfig& init, QWidget* parent = nullptr);
ContourLineConfig config() const { return cfg_; } // accept() 后有效
private:
void pickLineColor();
void pickLabelColor();
void paintSwatch(QPushButton* btn, const geopro::core::Rgba& c);
void onAccept();
QComboBox* lineTypeCombo_ = nullptr;
QCheckBox* lineShowChk_ = nullptr;
QPushButton* lineColorBtn_ = nullptr;
QCheckBox* labelShowChk_ = nullptr;
QPushButton* labelColorBtn_ = nullptr;
ContourLineConfig cfg_;
};
} // namespace geopro::app