PeriDyno 1.0.0
Loading...
Searching...
No Matches
ImColorbar.h
Go to the documentation of this file.
1
16
17#pragma once
18
19#include "ImWidget.h"
20
21namespace dyno
22{
23 class ImColorbar : public ImWidget
24 {
26 public:
27 ImColorbar();
28 ~ImColorbar() override;
29
30 void setCoord(ImVec2 coord);
31 ImVec2 getCoord() const;
32
33 public:
34 DECLARE_ENUM(ColorTable,
35 Jet = 0,
36 Heat = 1);
37
41 DEF_ENUM(ColorTable, Type, ColorTable::Jet, "");
42
43
44 DECLARE_ENUM(NumberTypeSelection,
45 Dec = 0,
46 Exp = 1);
47
48 DEF_ENUM(NumberTypeSelection, NumberType, NumberTypeSelection::Dec, "");
49
53 DEF_VAR(bool, Isfix, false, "");
54
58 DEF_VAR(Real, Min, Real(0), "");
59 DEF_VAR(Real, Max, Real(1), "");
60
64 DEF_VAR(std::string, FieldName, "", "");
65
69 DEF_ARRAY_IN(Real, Scalar, DeviceType::GPU, "");
70 // DEF_ARRAY_IN(Vec3f, Color, DeviceType::CPU, "");
71 // DEF_ARRAY_IN(int, Value, DeviceType::GPU, "");
72
73 protected:
74 virtual void paint();
75 virtual void update();
76 virtual bool initialize();
77
78 private:
79
80 ImU32 mMinCol = 0;
81 ImU32 mMaxCol = 0;
82 int mNum = 6 + 1;
83 ImVec2 mCoord = ImVec2(0,0);
85 float* mVal = nullptr;
86 ImU32* mCol = nullptr;
88 const char* mTitle;
89 float val[6 + 1];
90 ImU32 col[6 + 1];
91
93 std::shared_ptr<Node> mNode;
94 };
95};
#define DECLARE_CLASS(name)
Definition Object.h:65
double Real
Definition Typedef.inl:23
DEF_VAR(std::string, FieldName, "", "")
颜色条名字
DEF_ENUM(NumberTypeSelection, NumberType, NumberTypeSelection::Dec, "")
DEF_VAR(Real, Max, Real(1), "")
DECLARE_ENUM(ColorTable, Jet=0, Heat=1)
DEF_ENUM(ColorTable, Type, ColorTable::Jet, "")
颜色映射方式
~ImColorbar() override
const char * mTitle
Definition ImColorbar.h:88
DArray< Vec3f > mColorBuffer
Definition ImColorbar.h:84
DEF_ARRAY_IN(Real, Scalar, DeviceType::GPU, "")
用于生成颜色范围
Reduction< Real > m_reduce_real
Definition ImColorbar.h:87
float val[6+1]
Definition ImColorbar.h:89
virtual void update()
void setCoord(ImVec2 coord)
ImU32 col[6+1]
Definition ImColorbar.h:90
DEF_VAR(Real, Min, Real(0), "")
颜色映射上下限
virtual void paint()
ImVec2 getCoord() const
DEF_VAR(bool, Isfix, false, "")
是否固定颜色范围为上下限
virtual bool initialize()
std::shared_ptr< Node > mNode
Definition ImColorbar.h:93
DECLARE_ENUM(NumberTypeSelection, Dec=0, Exp=1)
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89
Vector< float, 3 > Vec3f
Definition Vector3D.h:93