45 setAttribute(Qt::WA_DeleteOnClose);
51 fHisto =
new TH1F(
"gaus1",
"Example of TH1 drawing in TCanvas", 100, -5, 5);
55 gPad = fxTCanvasWidget->getCanvas();
58 static constexpr int nth2points = 40;
59 fHisto2 = std::make_shared<TH2I>(
"gaus2",
"Example of TH2 drawing in RCanvas", nth2points, -5, 5, nth2points, -5, 5);
61 for (
int n=0;
n<nth2points;++
n) {
62 for (
int k=0;k<nth2points;++k) {
63 double x = 10.*
n/nth2points-5.;
64 double y = 10.*k/nth2points-5.;
81 auto viewer = fxGeomViewerWidget->getGeomViewer();
108 auto viewer = fxGeomViewerWidget->getGeomViewer();
131 viewer->SetDrawOptions(
"clipxyz");
195 R->AddNode(bar1, 1, tr1);
198 R->AddNode(bar2, 1, tr2);
199 R->AddNode(bar2, 2, tr3);
202 R->AddNode(tub1, 1, tr4);
233 T->AddNode(bar5, 1, tr8);
236 T->AddNode(bar6, 1, tr9);
251 auto canv = fxTCanvasWidget->getCanvas();
254 canv->GetListOfPrimitives()->Add(geom,
"");
259 for (
int n=0;
n<21;
n++)
267 canv->GetListOfPrimitives()->Add(pm,
"");
281 canv->GetListOfPrimitives()->Add(pl,
"");
289 QMessageBox::information(
this,
"QtRoot standalone example",
"Demo how QRootCanvas can be inserted into the QWidget");
294 if (fxTabWidget->count() > 3) {
296 fxTabWidget->setCurrentIndex(3);
304 auto widget = fxTabWidget->widget(3);
305 fxTabWidget->removeTab(3);
308 fxTabWidget->setCurrentIndex(2);
310 fxTabWidget->setCurrentIndex(2);
315#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
316 gROOT->SetWebDisplay(
"qt5");
318 gROOT->SetWebDisplay(
"qt6");
321 auto h1 =
new TH1F(
"gaus_standalone",
"Example of standalone TCanvas", 100, -5, 5);
325 auto c =
new TCanvas(
"standalone",
"Standalone canvas");
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TGeoIdentity * gGeoIdentity
Provides v7 drawing facilities for TObject types (TGraph, TH1, TH2, etc).
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
static Bool_t SetCacheFileDir(std::string_view cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
Sets the directory where to locally stage/cache remote files.
An arbitrary trapezoid with less than 8 vertices standing on two parallel planes perpendicular to Z a...
virtual void SetVertex(Int_t vnum, Double_t x, Double_t y)
Set values for a given vertex.
Class describing rotation + translation.
The manager class for any TGeo geometry.
TGeoVolume * MakeArb8(const char *name, TGeoMedium *medium, Double_t dz, Double_t *vertices=nullptr)
Make an TGeoArb8 volume.
void SetVisLevel(Int_t level=3)
set default level down to which visualization is performed
static TGeoManager * Import(const char *filename, const char *name="", Option_t *option="")
static function Import a geometry from a gdml or ROOT file
void CloseGeometry(Option_t *option="d")
Closing geometry implies checking the geometry validity, fixing shapes with negative parameters (run-...
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
void DefaultColors()
Set default volume colors according to A of material.
TGeoVolume * MakeBox(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz)
Make in one step a volume pointing to a box shape with given medium.
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
void SetNsegments(Int_t nseg)
Set number of segments for approximating circles in drawing.
TGeoVolume * MakeTubs(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a tube segment shape with given medium.
Base class describing materials.
Media are used to store properties related to tracking and which are useful only when using geometry ...
Class describing rotations.
Class describing translations.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
void SetVisibility(Bool_t vis=kTRUE) override
set visibility of this volume
void SetLineWidth(Width_t lwidth) override
Set the line width.
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
void SetTransparency(Char_t transparency=0)
void InvisibleAll(Bool_t flag=kTRUE)
Make volume and each of it daughters (in)visible.
void SetLineColor(Color_t lcolor) override
Set the line color.
TGeoShape * GetShape() const
1-D histogram with a float per channel (see TH1 documentation)
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
virtual void FillRandom(const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr)
Fill histogram following distribution in function fname.
void Draw(Option_t *option="") override
Draw this histogram with options.
A 3-dimensional polyline.
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
Double_t Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Calculates a gaussian function with mean and sigma.