2025-10-12 14:14:16 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include <QString>
|
2025-10-26 07:55:41 +00:00
|
|
|
|
#include <QColor>
|
2025-10-27 00:35:04 +00:00
|
|
|
|
#include "xml/tinyxml2.h"
|
2025-10-12 14:14:16 +00:00
|
|
|
|
|
|
|
|
|
|
enum class FileEntryType {
|
|
|
|
|
|
Curve,
|
|
|
|
|
|
Surface,
|
|
|
|
|
|
Table,
|
2025-10-31 15:10:35 +00:00
|
|
|
|
Light,
|
2025-11-02 08:36:07 +00:00
|
|
|
|
Polar,
|
|
|
|
|
|
Image
|
2025-10-12 14:14:16 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
2025-10-27 04:12:39 +00:00
|
|
|
|
enum class ChartType {
|
|
|
|
|
|
Wave,
|
|
|
|
|
|
Report
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
inline const char* ChartTypeToString(ChartType t) {
|
|
|
|
|
|
switch (t) {
|
|
|
|
|
|
case ChartType::Wave: return "Wave";
|
|
|
|
|
|
case ChartType::Report: return "Report";
|
|
|
|
|
|
}
|
|
|
|
|
|
return "Wave";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline bool ChartTypeFromString(const char* s, ChartType& out) {
|
|
|
|
|
|
if (!s) return false;
|
|
|
|
|
|
if (0 == strcmp(s, "Wave")) { out = ChartType::Wave; return true; }
|
|
|
|
|
|
if (0 == strcmp(s, "Report")) { out = ChartType::Report; return true; }
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-12 14:14:16 +00:00
|
|
|
|
inline const char* FileEntryTypeToString(FileEntryType t) {
|
|
|
|
|
|
switch (t) {
|
|
|
|
|
|
case FileEntryType::Curve: return "curve";
|
|
|
|
|
|
case FileEntryType::Surface: return "surface";
|
|
|
|
|
|
case FileEntryType::Table: return "table";
|
|
|
|
|
|
case FileEntryType::Light: return "light";
|
2025-10-31 15:10:35 +00:00
|
|
|
|
case FileEntryType::Polar: return "polar";
|
2025-11-02 08:36:07 +00:00
|
|
|
|
case FileEntryType::Image: return "image";
|
2025-10-12 14:14:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
return "unknown";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline bool FileEntryTypeFromString(const char* s, FileEntryType& out) {
|
|
|
|
|
|
if (!s) return false;
|
|
|
|
|
|
if (0 == strcmp(s, "curve")) { out = FileEntryType::Curve; return true; }
|
|
|
|
|
|
if (0 == strcmp(s, "surface")) { out = FileEntryType::Surface; return true; }
|
|
|
|
|
|
if (0 == strcmp(s, "table")) { out = FileEntryType::Table; return true; }
|
|
|
|
|
|
if (0 == strcmp(s, "light")) { out = FileEntryType::Light; return true; }
|
2025-10-31 15:10:35 +00:00
|
|
|
|
if (0 == strcmp(s, "polar")) { out = FileEntryType::Polar; return true; }
|
2025-11-02 08:36:07 +00:00
|
|
|
|
if (0 == strcmp(s, "image")) { out = FileEntryType::Image; return true; }
|
2025-10-12 14:14:16 +00:00
|
|
|
|
return false;
|
2025-10-26 07:55:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class FileEntryCurve;
|
2025-10-26 08:44:23 +00:00
|
|
|
|
class FileEntryLight;
|
2025-10-26 09:48:34 +00:00
|
|
|
|
class FileEntrySurface;
|
2025-10-26 12:14:06 +00:00
|
|
|
|
class FileEntryTable;
|
2025-10-31 15:10:35 +00:00
|
|
|
|
class FileEntryPolar;
|
2025-11-02 08:36:07 +00:00
|
|
|
|
class FileEntryImage;
|
2025-10-26 07:55:41 +00:00
|
|
|
|
|
|
|
|
|
|
class FileEntry {
|
|
|
|
|
|
public:
|
|
|
|
|
|
virtual ~FileEntry() = default;
|
|
|
|
|
|
|
|
|
|
|
|
FileEntryType GetType() const { return type_; }
|
|
|
|
|
|
void SetType(FileEntryType type) { type_ = type; }
|
|
|
|
|
|
|
|
|
|
|
|
void SetPath(const QString& path);
|
|
|
|
|
|
QString GetPath() const { return path_; }
|
|
|
|
|
|
|
|
|
|
|
|
void SetFileNanme(const QString& fileNmae) { fileName_ = fileNmae; }
|
|
|
|
|
|
const QString& GetFileName() const { return fileName_; }
|
|
|
|
|
|
|
|
|
|
|
|
void SetName(const QString& name) { name_ = name; }
|
|
|
|
|
|
QString GetName() const { return name_; }
|
|
|
|
|
|
|
2025-10-26 09:48:34 +00:00
|
|
|
|
virtual FileEntryCurve* AsCurve() { return nullptr; }
|
|
|
|
|
|
virtual FileEntryLight* AsLight() { return nullptr; }
|
|
|
|
|
|
virtual FileEntrySurface* AsSurface() { return nullptr; }
|
2025-10-26 12:14:06 +00:00
|
|
|
|
virtual FileEntryTable* AsTable() { return nullptr; }
|
2025-10-31 15:10:35 +00:00
|
|
|
|
virtual FileEntryPolar* AsPolar() { return nullptr; }
|
2025-11-02 08:36:07 +00:00
|
|
|
|
virtual FileEntryImage* AsImage() { return nullptr; }
|
2025-10-26 07:55:41 +00:00
|
|
|
|
|
2025-10-27 00:35:04 +00:00
|
|
|
|
virtual bool ParseFiles(const tinyxml2::XMLElement* element) { return false; }
|
|
|
|
|
|
virtual bool SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) { return false; }
|
|
|
|
|
|
|
2025-10-26 07:55:41 +00:00
|
|
|
|
protected:
|
|
|
|
|
|
FileEntryType type_;
|
|
|
|
|
|
QString path_;
|
|
|
|
|
|
QString fileName_;
|
|
|
|
|
|
QString name_;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2025-10-27 14:09:22 +00:00
|
|
|
|
QString QColorToString(const QColor& color);
|
|
|
|
|
|
QColor StringToQColor(const QString& colorStr);
|
|
|
|
|
|
|
2025-10-26 07:55:41 +00:00
|
|
|
|
// Factory functions for creating FileEntry objects
|
|
|
|
|
|
std::shared_ptr<FileEntry> CreateFileEntry(FileEntryType type, const QString& filePath);
|
|
|
|
|
|
std::shared_ptr<FileEntryCurve> CreateFileEntryCurve(const QString& filePath);
|
|
|
|
|
|
std::shared_ptr<FileEntry> CreateFileEntrySurface(const QString& filePath);
|
2025-10-26 12:14:06 +00:00
|
|
|
|
std::shared_ptr<FileEntryTable> CreateFileEntryTable(const QString& filePath);
|
2025-10-26 08:44:23 +00:00
|
|
|
|
std::shared_ptr<FileEntryLight> CreateFileEntryLight(const QString& filePath);
|
2025-10-31 15:10:35 +00:00
|
|
|
|
std::shared_ptr<FileEntryPolar> CreateFileEntryPolar(const QString& filePath);
|
2025-11-02 08:36:07 +00:00
|
|
|
|
std::shared_ptr<FileEntryImage> CreateFileEntryImage(const QString& filePath);
|
2025-10-26 07:55:41 +00:00
|
|
|
|
|
2025-10-27 00:35:04 +00:00
|
|
|
|
// Factory functions for creating empty FileEntry objects (for XML parsing)
|
|
|
|
|
|
std::shared_ptr<FileEntry> CreateEmptyFileEntry(FileEntryType type);
|
|
|
|
|
|
std::shared_ptr<FileEntryCurve> CreateEmptyFileEntryCurve();
|
|
|
|
|
|
std::shared_ptr<FileEntry> CreateEmptyFileEntrySurface();
|
|
|
|
|
|
std::shared_ptr<FileEntryTable> CreateEmptyFileEntryTable();
|
|
|
|
|
|
std::shared_ptr<FileEntryLight> CreateEmptyFileEntryLight();
|
2025-10-31 15:10:35 +00:00
|
|
|
|
std::shared_ptr<FileEntryPolar> CreateEmptyFileEntryPolar();
|
2025-11-02 08:36:07 +00:00
|
|
|
|
std::shared_ptr<FileEntryImage> CreateEmptyFileEntryImage();
|
2025-10-27 00:35:04 +00:00
|
|
|
|
|
2025-10-26 07:55:41 +00:00
|
|
|
|
|
|
|
|
|
|
class FileEntryCurve : public FileEntry {
|
|
|
|
|
|
public:
|
|
|
|
|
|
struct ChartProperties {
|
2025-10-27 04:12:39 +00:00
|
|
|
|
ChartType chartType; // 新增:Chart类型
|
2025-10-26 07:55:41 +00:00
|
|
|
|
int xCount;
|
2025-10-27 00:35:04 +00:00
|
|
|
|
int yCount; // 对应XML的yCount
|
2025-10-26 07:55:41 +00:00
|
|
|
|
QString xTitle;
|
|
|
|
|
|
QString yTitle;
|
|
|
|
|
|
double xMin;
|
|
|
|
|
|
double xMax;
|
|
|
|
|
|
double yMin;
|
|
|
|
|
|
double yMax;
|
2025-10-27 00:35:04 +00:00
|
|
|
|
double timeParam; // 对应XML的t
|
2025-10-26 07:55:41 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct CurveProperty {
|
|
|
|
|
|
QString name;
|
|
|
|
|
|
QColor color;
|
2025-10-27 08:10:42 +00:00
|
|
|
|
|
2025-10-27 04:12:39 +00:00
|
|
|
|
// Wave类型使用start/stop,Report类型使用x/y
|
|
|
|
|
|
union {
|
|
|
|
|
|
struct {
|
|
|
|
|
|
int start;
|
|
|
|
|
|
int stop;
|
|
|
|
|
|
} wave;
|
|
|
|
|
|
struct {
|
|
|
|
|
|
double x;
|
|
|
|
|
|
double y;
|
|
|
|
|
|
} report;
|
|
|
|
|
|
} data;
|
2025-10-26 07:55:41 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
using CurveProperties = QList<CurveProperty>;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
2025-10-27 04:12:39 +00:00
|
|
|
|
FileEntryCurve() {
|
|
|
|
|
|
type_ = FileEntryType::Curve;
|
|
|
|
|
|
chartProperties_.chartType = ChartType::Wave; // 默认为Wave类型
|
|
|
|
|
|
}
|
2025-10-26 07:55:41 +00:00
|
|
|
|
|
|
|
|
|
|
void SetChartProperties(const ChartProperties& props) { chartProperties_ = props; }
|
|
|
|
|
|
const ChartProperties& GetChartProperties() const { return chartProperties_; }
|
|
|
|
|
|
|
2025-10-27 04:12:39 +00:00
|
|
|
|
void SetChartType(ChartType type) { chartProperties_.chartType = type; }
|
|
|
|
|
|
ChartType GetChartType() const { return chartProperties_.chartType; }
|
|
|
|
|
|
|
2025-10-26 07:55:41 +00:00
|
|
|
|
void AddCurveProperty(const CurveProperty& prop) { curveProperties_.append(prop); }
|
|
|
|
|
|
void RemoveCurveProperty(int index) { curveProperties_.removeAt(index); }
|
|
|
|
|
|
const CurveProperties& GetCurveProperties() const { return curveProperties_; }
|
|
|
|
|
|
|
|
|
|
|
|
FileEntryCurve* AsCurve() override { return this; }
|
|
|
|
|
|
|
2025-10-27 00:35:04 +00:00
|
|
|
|
// XML处理方法
|
|
|
|
|
|
bool SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) override;
|
|
|
|
|
|
bool ParseFiles(const tinyxml2::XMLElement* element) override;
|
|
|
|
|
|
|
2025-10-26 07:55:41 +00:00
|
|
|
|
private:
|
|
|
|
|
|
ChartProperties chartProperties_;
|
|
|
|
|
|
CurveProperties curveProperties_;
|
|
|
|
|
|
};
|
2025-10-26 08:44:23 +00:00
|
|
|
|
|
2025-10-26 09:48:34 +00:00
|
|
|
|
class FileEntrySurface : public FileEntry {
|
|
|
|
|
|
public:
|
|
|
|
|
|
struct ChartProperties {
|
|
|
|
|
|
int xCount;
|
|
|
|
|
|
int yCount; // Added missing yCount
|
|
|
|
|
|
int zCount; // Added missing zCount
|
|
|
|
|
|
QString xTitle;
|
|
|
|
|
|
QString yTitle;
|
|
|
|
|
|
QString zTitle;
|
|
|
|
|
|
double xMin;
|
|
|
|
|
|
double xMax;
|
|
|
|
|
|
double yMin;
|
|
|
|
|
|
double yMax;
|
|
|
|
|
|
double zMin;
|
|
|
|
|
|
double zMax;
|
|
|
|
|
|
double timeParam;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct SurfaceProperty {
|
|
|
|
|
|
QString name;
|
|
|
|
|
|
QColor color;
|
|
|
|
|
|
int start;
|
|
|
|
|
|
int stop;
|
|
|
|
|
|
QString x;
|
|
|
|
|
|
QString y;
|
|
|
|
|
|
QString z;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
using SurfaceProperties = QList<SurfaceProperty>;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
FileEntrySurface() { type_ = FileEntryType::Surface; }
|
|
|
|
|
|
|
|
|
|
|
|
// Chart properties management
|
|
|
|
|
|
void SetChartProperties(const ChartProperties& properties);
|
|
|
|
|
|
const ChartProperties& GetChartProperties() const;
|
|
|
|
|
|
|
|
|
|
|
|
// Surface properties management
|
|
|
|
|
|
void AddSurfaceProperty(const SurfaceProperty& surface);
|
|
|
|
|
|
void RemoveSurfaceProperty(int index);
|
|
|
|
|
|
void SetSurfaceProperty(int index, const SurfaceProperty& surface);
|
|
|
|
|
|
const SurfaceProperties& GetSurfaceProperties() const;
|
|
|
|
|
|
|
|
|
|
|
|
// Type conversion
|
|
|
|
|
|
FileEntrySurface* AsSurface() override;
|
|
|
|
|
|
|
2025-10-27 12:39:49 +00:00
|
|
|
|
// XML处理方法
|
|
|
|
|
|
bool SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) override;
|
|
|
|
|
|
bool ParseFiles(const tinyxml2::XMLElement* element) override;
|
2025-10-26 09:48:34 +00:00
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
ChartProperties chartProperties_;
|
|
|
|
|
|
SurfaceProperties surfaceProperties_;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2025-10-26 12:14:06 +00:00
|
|
|
|
class FileEntryTable : public FileEntry {
|
|
|
|
|
|
public:
|
|
|
|
|
|
struct ChartProperties {
|
2025-10-27 09:48:27 +00:00
|
|
|
|
QString headerString;
|
2025-10-26 12:14:06 +00:00
|
|
|
|
double timeParam;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct TableProperty {
|
|
|
|
|
|
QString name;
|
|
|
|
|
|
QColor color;
|
|
|
|
|
|
QList<int> datas;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
using TableProperties = QList<TableProperty>;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
FileEntryTable() { type_ = FileEntryType::Table; }
|
|
|
|
|
|
|
|
|
|
|
|
// Chart properties management
|
|
|
|
|
|
void SetChartProperties(const ChartProperties& properties);
|
|
|
|
|
|
const ChartProperties& GetChartProperties() const;
|
|
|
|
|
|
|
|
|
|
|
|
// Table properties management
|
|
|
|
|
|
void AddTableProperty(const TableProperty& table);
|
|
|
|
|
|
void RemoveTableProperty(int index);
|
|
|
|
|
|
void SetTableProperty(int index, const TableProperty& table);
|
|
|
|
|
|
const TableProperties& GetTableProperties() const;
|
|
|
|
|
|
|
|
|
|
|
|
// Type conversion
|
|
|
|
|
|
FileEntryTable* AsTable() override;
|
2025-10-27 09:48:27 +00:00
|
|
|
|
|
|
|
|
|
|
// XML处理方法
|
|
|
|
|
|
bool SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) override;
|
|
|
|
|
|
bool ParseFiles(const tinyxml2::XMLElement* element) override;
|
2025-10-26 12:14:06 +00:00
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
ChartProperties chartProperties_;
|
|
|
|
|
|
TableProperties tableProperties_;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2025-10-26 08:44:23 +00:00
|
|
|
|
class FileEntryLight : public FileEntry {
|
|
|
|
|
|
public:
|
|
|
|
|
|
struct ColorProperties {
|
|
|
|
|
|
QColor openColor;
|
|
|
|
|
|
QColor closeColor;
|
2025-10-27 14:09:22 +00:00
|
|
|
|
double timeParam;
|
2025-10-26 08:44:23 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
2025-10-27 14:58:41 +00:00
|
|
|
|
struct LightRowProperty {
|
|
|
|
|
|
QStringList name;
|
|
|
|
|
|
QList<int> data;
|
2025-10-26 08:44:23 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
2025-10-27 14:58:41 +00:00
|
|
|
|
using LightRowProperties = QList<LightRowProperty>;
|
2025-10-26 08:44:23 +00:00
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
FileEntryLight() { type_ = FileEntryType::Light; }
|
|
|
|
|
|
|
|
|
|
|
|
void SetColorProperties(const ColorProperties& props) { colorProperties_ = props; }
|
|
|
|
|
|
const ColorProperties& GetColorProperties() const { return colorProperties_; }
|
|
|
|
|
|
|
2025-10-27 14:58:41 +00:00
|
|
|
|
void AddLightProperty(const LightRowProperty& prop) { lightProperties_.append(prop); }
|
2025-10-26 08:44:23 +00:00
|
|
|
|
void RemoveLightProperty(int index) { lightProperties_.removeAt(index); }
|
2025-10-27 14:58:41 +00:00
|
|
|
|
const LightRowProperties& GetLightProperties() const { return lightProperties_; }
|
2025-10-26 08:44:23 +00:00
|
|
|
|
|
|
|
|
|
|
FileEntryLight* AsLight() override { return this; }
|
|
|
|
|
|
|
2025-10-27 14:09:22 +00:00
|
|
|
|
bool SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) override;
|
|
|
|
|
|
bool ParseFiles(const tinyxml2::XMLElement* element) override;
|
|
|
|
|
|
|
2025-10-26 08:44:23 +00:00
|
|
|
|
private:
|
|
|
|
|
|
ColorProperties colorProperties_;
|
2025-10-27 14:58:41 +00:00
|
|
|
|
LightRowProperties lightProperties_;
|
2025-10-26 08:44:23 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
2025-10-31 15:10:35 +00:00
|
|
|
|
class FileEntryPolar : public FileEntry {
|
|
|
|
|
|
public:
|
|
|
|
|
|
struct ChartProperties {
|
|
|
|
|
|
int AngularCount;
|
|
|
|
|
|
int RadialCount;
|
|
|
|
|
|
QString AngularTitle;
|
|
|
|
|
|
QString RadialTitle;
|
|
|
|
|
|
double AngularMin;
|
|
|
|
|
|
double AngularMax;
|
|
|
|
|
|
double RadialMin;
|
|
|
|
|
|
double RadialMax;
|
|
|
|
|
|
QString AngularUnit;
|
|
|
|
|
|
QString RadialUnit;
|
|
|
|
|
|
double timeParam; // 对应XML的t
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct LineProperty {
|
|
|
|
|
|
QString name;
|
|
|
|
|
|
QColor color;
|
|
|
|
|
|
int Angular;
|
|
|
|
|
|
int Radial;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
using LineProperties = QList<LineProperty>;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
FileEntryPolar() { type_ = FileEntryType::Polar; }
|
|
|
|
|
|
|
|
|
|
|
|
// Chart properties management
|
|
|
|
|
|
void SetChartProperties(const ChartProperties& properties);
|
|
|
|
|
|
const ChartProperties& GetChartProperties() const;
|
|
|
|
|
|
|
|
|
|
|
|
// Line properties management
|
|
|
|
|
|
void AddLineProperty(const LineProperty& line);
|
|
|
|
|
|
void RemoveLineProperty(int index);
|
|
|
|
|
|
void SetLineProperty(int index, const LineProperty& line);
|
|
|
|
|
|
const LineProperties& GetLineProperties() const;
|
|
|
|
|
|
|
|
|
|
|
|
// Type conversion
|
|
|
|
|
|
FileEntryPolar* AsPolar() override;
|
|
|
|
|
|
|
|
|
|
|
|
// XML处理方法
|
|
|
|
|
|
bool SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) override;
|
|
|
|
|
|
bool ParseFiles(const tinyxml2::XMLElement* element) override;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
ChartProperties chartProperties_;
|
|
|
|
|
|
LineProperties lineProperties_;
|
2025-11-02 08:36:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class FileEntryImage : public FileEntry {
|
|
|
|
|
|
public:
|
|
|
|
|
|
struct ChartProperties {
|
|
|
|
|
|
int AngularCount;
|
|
|
|
|
|
int RadialCount;
|
|
|
|
|
|
QString AngularTitle;
|
|
|
|
|
|
QString RadialTitle;
|
|
|
|
|
|
double AngularMin;
|
|
|
|
|
|
double AngularMax;
|
|
|
|
|
|
double RadialMin;
|
|
|
|
|
|
double RadialMax;
|
|
|
|
|
|
QString AngularUnit;
|
|
|
|
|
|
QString RadialUnit;
|
|
|
|
|
|
double timeParam; // 对应XML的t
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct ImageProperty {
|
|
|
|
|
|
QString name;
|
|
|
|
|
|
QColor color;
|
|
|
|
|
|
int Angular;
|
|
|
|
|
|
int Radial;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
using ImageProperties = QList<ImageProperty>;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
FileEntryImage() { type_ = FileEntryType::Image; }
|
|
|
|
|
|
|
|
|
|
|
|
// Chart properties management
|
|
|
|
|
|
void SetChartProperties(const ChartProperties& properties);
|
|
|
|
|
|
const ChartProperties& GetChartProperties() const;
|
|
|
|
|
|
|
|
|
|
|
|
// Line properties management
|
|
|
|
|
|
void AddImageProperty(const ImageProperty& image);
|
|
|
|
|
|
void RemoveImageProperty(int index);
|
|
|
|
|
|
void SetImageProperty(int index, const ImageProperty& image);
|
|
|
|
|
|
const ImageProperties& GetImageProperties() const;
|
|
|
|
|
|
|
|
|
|
|
|
// Type conversion
|
|
|
|
|
|
FileEntryImage* AsImage() override;
|
|
|
|
|
|
|
|
|
|
|
|
//// XML处理方法
|
|
|
|
|
|
//bool SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) override;
|
|
|
|
|
|
//bool ParseFiles(const tinyxml2::XMLElement* element) override;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
ChartProperties chartProperties_;
|
|
|
|
|
|
ImageProperties imageProperties_;
|
2025-10-31 15:10:35 +00:00
|
|
|
|
};
|