You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWTAI-Platform/Include/nmNum/nmData/nmDataOutline.h

80 lines
2.4 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef NMDATARECTOUTLINE_H
#define NMDATARECTOUTLINE_H
#include "nmData_global.h"
#include <QColor>
#include "nmDefines.h"
#include "nmDataBase.h"
class NM_DATA_EXPORT nmDataOutline : public nmDataBase {
Q_OBJECT
public:
nmDataOutline();
nmDataOutline(const nmDataOutline& other); // 拷贝构造函数
nmDataOutline& operator=(const nmDataOutline& other); // 赋值运算符
~nmDataOutline();
// 实现 nmDataBase 的抽象方法:将当前 C++ 对象序列化为 RapidJSON Value
virtual rapidjson::Value ToJsonValue(rapidjson::Document::AllocatorType& allocator) const override;
// 实现 nmDataBase 的抽象方法:从 RapidJSON Value 反序列化数据到当前 C++ 对象
virtual void FromJsonValue(const rapidjson::Value& jsonValue) override;
QString getName();
void setName(const QString& sName);
QVector<QPointF> getOutlinePoints();
void setOutlinePoints(const QVector<QPointF>& vecPts);
QVector<int> getFlowTypeList() const;
void setFlowTypeList(const QVector<int>& vecFlowTypeList);
NM_Data_Outline_Type getOutlineType() const;
void setOutlineType(NM_Data_Outline_Type eOutlineType);
QPointF getCenter() const;
void setCenter(const QPointF& ptCenter);
double getRadius() const;
void setRadius(double dRadius);
bool getPlotVisible() const;
void setPlotVisible(const bool newState);
// 视觉属性(画笔宽度、填充色、透明度)
double getPenWidth() const;
void setPenWidth(double dWidth);
QColor getBackgrdColor() const;
void setBackgrdColor(const QColor& clr);
int getBackgrdAlpha() const;
void setBackgrdAlpha(int nAlpha);
// 视觉属性是否有效仅从已保存文件加载后为true新建时为false
bool hasVisualProps() const;
void setVisualPropsValid(bool bValid);
private:
QString m_sName;// 边界名称
QVector<QPointF> m_vecPts; // 边界点的数据;
QVector<int> m_vFlowTypeList; //边界压力类型
NM_Data_Outline_Type m_eOutlineType; // 边界类型
// 对于圆形边界,特殊处理
QPointF m_ptCenter; // 圆心
double m_dRadius; // 半径
bool m_bPlotVisible; // 图元是否可见
// 视觉属性
double m_dPenWidth; // 画笔宽度
QColor m_clrBackgrd; // 填充背景色
int m_nBackgrdAlpha; // 填充透明度 (0-255)
bool m_bHasVisualProps; // 视觉属性是否有效从文件加载后为true
};
#endif // NMDATARECTOUTLINE_H