Warning, file /include/root/ROOT/REveText.hxx was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT7_REveText
0013 #define ROOT7_REveText
0014
0015 #include <ROOT/REveShape.hxx>
0016 #include <ROOT/REveVector.hxx>
0017
0018 namespace ROOT {
0019 namespace Experimental {
0020
0021
0022
0023
0024
0025 class REveText : public REveShape
0026 {
0027 private:
0028 REveText(const REveText &) = delete;
0029 REveText &operator=(const REveText &) = delete;
0030
0031 protected:
0032 std::string fText {"<no-text>"};
0033 std::string fFont {"LiberationSans-Regular"};
0034 REveVector fPosition {0, 0, 0};
0035 Float_t fFontSize {80};
0036 Float_t fFontHinting {1.0};
0037 Float_t fExtraBorder {0.2};
0038 Int_t fMode {1};
0039 Color_t fTextColor {kMagenta};
0040
0041
0042 static std::string sSdfFontDir;
0043
0044 static bool SetDefaultSdfFontDir();
0045
0046 public:
0047 REveText(const Text_t *n = "REveText", const Text_t *t = "");
0048 virtual ~REveText() {}
0049
0050 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
0051 void BuildRenderData() override;
0052
0053 void ComputeBBox() override;
0054
0055 std::string GetText() const { return fText; }
0056 void SetText(std::string_view text) { fText = text; StampObjProps(); }
0057
0058 std::string GetFont() const { return fFont; }
0059 void SetFont(std::string_view font) { fFont = font; StampObjProps();}
0060
0061 Float_t GetFontSize() const { return fFontSize; }
0062 void SetFontSize(float size) { fFontSize = size; StampObjProps();}
0063
0064 Int_t GetMode() const { return fMode; }
0065 void SetMode(Int_t mode) { fMode = mode;}
0066
0067 Float_t GetFontHinting() const { return fFontHinting; }
0068 void SetFontHinting(Float_t fontHinting) { fFontHinting = fontHinting; StampObjProps();}
0069
0070 Float_t GetExtraBorder() const { return fExtraBorder; }
0071 void SetExtraBorder(float size) { fExtraBorder = size; StampObjProps();}
0072
0073 REveVector GetPosition() const { return fPosition; }
0074 const REveVector& RefPosition() const { return fPosition; }
0075 void SetPosition(const REveVector& position) { fPosition = position;}
0076 void SetPosX(float x) { fPosition.fX = x; StampObjProps(); }
0077 void SetPosY(float y) { fPosition.fY = y; StampObjProps(); }
0078
0079 Color_t GetTextColor() const { return fTextColor; }
0080 void SetTextColor(Color_t color) { fTextColor = color; StampObjProps();}
0081
0082
0083
0084
0085 static bool SetSdfFontDir(std::string_view dir, bool require_write_access = true);
0086 static bool AssertSdfFont(std::string_view font_name, std::string_view ttf_font);
0087 };
0088
0089 }
0090 }
0091
0092 #endif