Cumulia Illustrator Rendering Engine v2.1.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
legend.h
1//##################################################################################################
2//
3// Copyright (c) 2024 Beijing Qiongqi Tech Co.,Ltd. All rights reserved.
4
5// This source code is confidential and proprietary to Beijing Qiongqi Tech Co.,Ltd(The Holder).
6// Any unauthorized use, copying, modification, or distribution of the code is strictly prohibited.
7// Any user shall obtain authorizaition from the Holder before modifying the source code. And the user shall not
8// sublicense, sell, distribute, or transfer the source code, whether in original or modified form, to any third party
9// without the prior written consent of the Holder.
10
11// This copyright notice and permission grant shall be included in all copies or substantial portions of the source code.
12
13// Author Cumulia Illustrator
14// Date 2025-08-05
15// Version V1.1.0
16//##################################################################################################
17
18#pragma once
19
20#include <cilcore.h>
21
22#include <string>
23#include <vector>
24
25namespace cil
26{
27 class Legend : public Node
28 {
29 public:
30 static int Width;
31 static int Height;
32 static int Spacing;
33 static int BarWidth;
34 static int TitleFontSize;
35 static std::string TitleFontFamily;
36 static std::shared_ptr<Color3f> TitleFontColor;
37 static int LabelFontSize;
38 static std::string LabelFontFamily;
39 static std::shared_ptr<Color3f> LabelFontColor;
40
41 public:
43 virtual ~Legend();
44
45 void generate();
46
47 public:
48 std::shared_ptr<Image2D> image;
49 std::string title;
50 float minimum = 0;
51 float maximum = 1;
52 float levels = 4;
53
54 private:
55 float m_devicePixelRatio;
56 };
57
58 class LegendPass : public Pass
59 {
60 public:
61 LegendPass(const std::shared_ptr<Vector2i>& backgroundSize);
62 virtual ~LegendPass();
63
64 int width() const;
65 void setWidth(int width);
66 int height() const;
67 void setHeight(int height);
68 int spacing() const;
70 int barWidth() const;
71 void setBarWidth(int width);
72 int titleFontSize() const;
73 void setTitleFontSize(int size);
74 std::string titleFontFamily();
75 void setTitleFontFamily(const std::string& family);
77 void setTitleFontColor(const Color3f& color);
78 int labelFontSize() const;
79 void setLabelFontSize(int size);
80 std::string labelFontFamily();
81 void setLabelFontFamily(const std::string& family);
83 void setLabelFontColor(const Color3f& color);
84
85 std::shared_ptr<Legend> add(const std::string& title, const std::shared_ptr<Image2D>& image);
86 void remove(const std::shared_ptr<Legend>& legend);
87 void clear();
88 std::shared_ptr<Legend> hit(const Vector2i& coord, float devicePixelRatio);
89 void generate();
90 void resize();
91
92 private:
93 float m_devicePixelRatio;
94 };
95
96 std::shared_ptr<LegendPass> _legendPass(const std::shared_ptr<Vector2i>& backgroundSize);
97}
The Color3f class inherits from Color3, specilizing the template parameters to float for element type...
Definition color.h:105
Definition legend.h:59
void setTitleFontFamily(const std::string &family)
void setSpacing(int spacing)
void setBarWidth(int width)
void setTitleFontSize(int size)
virtual ~LegendPass()
std::string titleFontFamily()
int height() const
int barWidth() const
std::string labelFontFamily()
void remove(const std::shared_ptr< Legend > &legend)
void setHeight(int height)
void setWidth(int width)
void setLabelFontColor(const Color3f &color)
int titleFontSize() const
int labelFontSize() const
Color3f labelFontColor() const
void setLabelFontFamily(const std::string &family)
LegendPass(const std::shared_ptr< Vector2i > &backgroundSize)
int spacing() const
std::shared_ptr< Legend > hit(const Vector2i &coord, float devicePixelRatio)
int width() const
Color3f titleFontColor() const
void setTitleFontColor(const Color3f &color)
std::shared_ptr< Legend > add(const std::string &title, const std::shared_ptr< Image2D > &image)
void setLabelFontSize(int size)
Definition legend.h:28
static int LabelFontSize
Definition legend.h:37
virtual ~Legend()
float maximum
Definition legend.h:51
static std::string LabelFontFamily
Definition legend.h:38
void generate()
std::shared_ptr< Image2D > image
Definition legend.h:48
static int Height
Definition legend.h:31
float levels
Definition legend.h:52
float minimum
Definition legend.h:50
std::string title
Definition legend.h:49
static std::shared_ptr< Color3f > TitleFontColor
Definition legend.h:36
static int Width
Definition legend.h:30
static int Spacing
Definition legend.h:32
static std::string TitleFontFamily
Definition legend.h:35
static int BarWidth
Definition legend.h:33
static std::shared_ptr< Color3f > LabelFontColor
Definition legend.h:39
static int TitleFontSize
Definition legend.h:34
The Node class represents a node in a scene graph. A scene graph is a hierarchicaldata stucture used ...
Definition node.h:31
The Pass class represents a rendering pass within a graphics pipeline.
Definition pass.h:32
The class Vector2i inherits from the templated class of Vector2, and the template parameters are spec...
Definition vector.h:255
Definition decal.h:23
std::shared_ptr< LegendPass > _legendPass(const std::shared_ptr< Vector2i > &backgroundSize)