补充了样式部分的注释

main
wuyize 2023-03-28 15:02:31 +08:00
parent 3090f24235
commit 1295e2255a
4 changed files with 44 additions and 4 deletions

View File

@ -7,7 +7,7 @@
namespace Renderer
{
/// 相对变换,用于制作阴影等效果
/// 相对变换,用于制作阴影等效果(未实现)
struct TransformStyle
{
glm::vec2 translation = glm::vec2(0);
@ -28,10 +28,13 @@ namespace Renderer
static std::unique_ptr<MaterialStyle> decoded(const std::vector<GLfloat>& encoded);
};
/**
* @brief ElementStyletoBaseStyles
*/
struct BaseStyle
{
std::shared_ptr<TransformStyle> transform;
std::shared_ptr<MaterialStyle> material;
std::shared_ptr<TransformStyle> transform; /// 变换样式,目前无实际作用
std::shared_ptr<MaterialStyle> material; /// 材质样式
};
struct Material

View File

@ -4,6 +4,9 @@
namespace Renderer
{
/**
* @brief
*/
class ElementStyle
{
public:

View File

@ -3,8 +3,11 @@
namespace Renderer
{
enum class MaterialFillType { kPlain, kLinearGradient, kRadialGradient };
enum class MaterialFillType { kPlain /*曾伎*/, kLinearGradient /*TODO*/, kRadialGradient /*TODO*/ };
/**
* @brief
*/
class MaterialFill
{
public:
@ -14,6 +17,9 @@ namespace Renderer
virtual bool operator==(const MaterialFill&) const = 0;
};
/**
* @brief
*/
class FillPlain : public MaterialFill
{
public:
@ -27,6 +33,9 @@ namespace Renderer
Material material;
};
/**
* @brief
*/
class MaterialStyleFill : public MaterialStyle
{
public:

View File

@ -6,6 +6,9 @@ namespace Renderer
{
enum class MaterialStrokeType { kPlain = 0, kRadialGradient = 1, kLinearGradient = 2 };
/**
* @brief
*/
class MaterialStroke
{
public:
@ -15,6 +18,9 @@ namespace Renderer
virtual bool operator==(const MaterialStroke&) const = 0;
};
/**
* @brief
*/
class StrokePlain : public MaterialStroke
{
public:
@ -29,6 +35,9 @@ namespace Renderer
Material material;
};
/**
* @brief /
*/
class StrokeRadialGradient : public MaterialStroke
{
public:
@ -38,13 +47,24 @@ namespace Renderer
virtual std::unique_ptr<MaterialStroke> clone() const override;
virtual bool operator==(const MaterialStroke&) const override;
/**
* @brief key 线线\n
* value
*/
std::map<float, Material> materialMap;
bool gradual = true;
};
enum class StrokeType { kBothSides = 2, kLeftSide = 1, kRightSide = 0 };
/**
* @brief MaterialStyleStroke::strokeEndTypeNames
*/
enum class StrokeEndType { kRound = 0b00, kFlat = 0b11, kRoundFlat = 0b10, kFlatRound = 0b01, kClosed = 0b100/*ÓÃÓÚ·â±ÕͼÐÎ*/ };
/**
* @brief
*/
class MaterialStyleStroke : public MaterialStyle
{
public:
@ -59,6 +79,11 @@ namespace Renderer
StrokeType strokeType;
StrokeEndType endType;
std::shared_ptr<MaterialStroke> materialStroke;
/**
* @brief key 线\n
* value
*/
std::map<float, float> widthMap;
static const std::array<std::pair<QString, StrokeEndType>, 4> strokeEndTypeNames;
};