swh:1:snp:af87cd67498ef4fe47c76ed3e7caffe5b61facaf
Tip revision: 8feeafb4a9c7b2ad065ff7cb00db52255e287025 authored by dpiparo on 28 November 2023, 00:27:58 UTC
"Update ROOT version files to v6.26/14."
"Update ROOT version files to v6.26/14."
Tip revision: 8feeafb
text.C
/// \file
/// \ingroup tutorial_eve
/// Demonstrates usage of class TEveText - 2D & 3D text in GL.
///
/// \image html eve_text.png
/// \macro_code
///
/// \author Alja Mrak-Tadel
TEveText* text()
{
gSystem->IgnoreSignal(kSigSegmentationViolation, true);
TEveManager::Create();
auto marker = new TEvePointSet(8);
marker->SetName("Origin marker");
marker->SetMarkerColor(6);
marker->SetMarkerStyle(3);
Float_t a = 10;
marker->SetPoint(0, a, +a, +a);
marker->SetPoint(1, a, -a, +a);
marker->SetPoint(2, -a, -a, +a);
marker->SetPoint(3, -a, +a, +a);
marker->SetPoint(4, +a, +a, -a);
marker->SetPoint(5, +a, -a, -a);
marker->SetPoint(6, -a, +a, -a);
marker->SetPoint(7, -a, -a, -a);
gEve->AddElement(marker);
auto t = new TEveText("DADA");
t->PtrMainTrans()->RotateLF(1, 3, TMath::PiOver2());
t->SetMainColor(kOrange-2);
t->SetFontSize(64);
t->SetFontMode(TGLFont::kExtrude);
t->SetLighting(kTRUE);
gEve->AddElement(t);
// TEveText does not know its bounding box before first rendering.
gEve->FullRedraw3D(kTRUE);
gEve->GetDefaultGLViewer()->ResetCurrentCamera();
gEve->GetDefaultGLViewer()->RequestDraw(TGLRnrCtx::kLODHigh);
return t;
}