Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions graf2d/gpad/inc/TAnnotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class TAnnotation : public TLatex {
void Paint(Option_t *option="") override;
void PaintAnnotation(Double_t x, Double_t y, Double_t z, Double_t angle, Double_t size, const Char_t *text);
void Print(Option_t *option="") const override;
void SavePrimitive(std::ostream &out, Option_t *option = "") override;

void SetZ(double z) { fZ = z; } // *MENU*
double GetZ() const { return fZ; }
Expand Down
18 changes: 18 additions & 0 deletions graf2d/gpad/src/TAnnotation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,21 @@ void TAnnotation::Print(Option_t *) const
if (GetTextAngle() != 0 ) printf(" Angle=%f",GetTextAngle());
printf("\n");
}

////////////////////////////////////////////////////////////////////////////////
/// Save primitives in this pad on the C++ source file out.

void TAnnotation::SavePrimitive(std::ostream &out, Option_t *option)
{
SavePrimitiveConstructor(
out, Class(), "annotation",
TString::Format("%g, %g, %g, \"%s\"", fX, fY, fZ, TString(GetTitle()).ReplaceSpecialCppChars().Data()), kFALSE);

SaveTextAttributes(out, "annotation", 11, 0, 1, 62, 0.05);
SaveLineAttributes(out, "annotation", 1, 1, 1);

if (TestBit(kTextNDC))
out << " annotation->SetNDC();\n";

SavePrimitiveDraw(out, "annotation", option);
}
Loading