ROOT
Version master
v6.34
v6.32
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
▼
ROOT
ROOT Reference Documentation
Tutorials
▼
Functional Parts
►
Core ROOT classes
►
std Extension classes
►
Parallelized classes
►
The Geometry Package
►
Graphics
►
Event display with ROOT7
►
GUI
►
Web Widgets
►
Web Display
►
Histogram Library
►
Input/Output Library
►
Math
►
N-D parametric functions
►
VecOps
►
Monte Carlo
►
HTTP server
►
PROOF
►
TMVA
►
RooFit
►
Dataframe
►
ROOT7 classes
►
NTuple-related classes
►
Tree Library
►
TreePlayer Library
▼
Tutorials
►
Data analysis tutorials
►
Event generation tutorials
►
Experimental API tutorials
►
Geometry tutorials
►
Histograms tutorials
►
HTTP tutorials
►
IO tutorials
►
Machine Learning tutorials
►
Math tutorials
►
RooFit packages tutorials
▼
Visualisation tutorials
►
Graphs tutorials
▼
Graphics tutorials
accessiblecolorschemes.C
analyze.C
anim.C
annotation3d.C
archi.C
arrows.C
basic3d.C
canvas.C
canvas2.C
compile.C
crown.C
diamond.C
earth.C
ellipse.C
eval.C
event.C
feynman.C
first.C
formula1.C
formula1.py
framework.C
gaxis.C
gaxis2.C
gaxis3.C
graph_edit_playback.C
greyscale.C
gtime.C
inside.C
latex.C
latex2.C
latex3.C
latex4.C
latex5.C
logscales.C
mandelbrot.C
markerwarning.C
mass_spectrum.C
multipalette.C
palettes.C
pavetext.C
perceptualcolormap.C
piechart.C
polytest1.C
polytest2.C
pstable.C
psview.C
quarks.C
save_batch.C
saveall.C
schroedinger_hydrogen.C
splines_test.C
surfaces.C
surfaces.py
timeonaxis3.C
tmathtext.C
tmathtext2.C
tornado.C
tornado.py
transparency.C
triangles.C
xyplot.C
►
TWebCanvas tutorials
►
Webgui tutorials
►
Event display tutorials
►
Event display for ROOT 7 tutorials
►
Geometry tutorials
►
GUI tutorials
►
Image tutorials
►
OpenGL tutorials
►
Tutorials specific to Mac/Cocoa
►
Legacy tutorials
demos.C
demos.py
demoshelp.C
demoshelp.py
hsimple.C
hsimple.py
rootlogoff.C
rootlogon.C
►
Python interface
►
R Interface for Statistical Computing
►
Namespaces
►
All Classes
►
Files
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
basic3d.C File Reference
Tutorials
»
Visualisation tutorials
»
Graphics tutorials
Detailed Description
Show 3-D polylines and markers.
void
basic3d
()
{
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"PolyLine3D & PolyMarker3D Window"
, 200, 10, 700, 500);
// create a pad
TPad
*
p1
=
new
TPad
(
"p1"
,
"p1"
, 0.05, 0.02, 0.95, 0.82, 46, 3, 1);
p1
->Draw();
p1
->cd();
// creating a view
TView
*view =
TView::CreateView
(1);
view->
SetRange
(5, 5, 5, 25, 25, 25);
// create a first PolyLine3D
TPolyLine3D
*
pl3d1
=
new
TPolyLine3D
(5);
// set points
pl3d1
->SetPoint(0, 10, 10, 10);
pl3d1
->SetPoint(1, 15, 15, 10);
pl3d1
->SetPoint(2, 20, 15, 15);
pl3d1
->SetPoint(3, 20, 20, 20);
pl3d1
->SetPoint(4, 10, 10, 20);
// set attributes
pl3d1
->SetLineWidth(3);
pl3d1
->SetLineColor(5);
// create a second PolyLine3D
TPolyLine3D
*
pl3d2
=
new
TPolyLine3D
(4);
// set points
pl3d2
->SetPoint(0, 5, 10, 5);
pl3d2
->SetPoint(1, 10, 15, 8);
pl3d2
->SetPoint(2, 15, 15, 18);
pl3d2
->SetPoint(3, 5, 20, 20);
pl3d2
->SetPoint(4, 10, 10, 5);
// set attributes
pl3d2
->SetLineWidth(5);
pl3d2
->SetLineColor(2);
// create a first PolyMarker3D
TPolyMarker3D
*
pm3d1
=
new
TPolyMarker3D
(12);
// set points
pm3d1
->SetPoint(0, 10, 10, 10);
pm3d1
->SetPoint(1, 11, 15, 11);
pm3d1
->SetPoint(2, 12, 15, 9);
pm3d1
->SetPoint(3, 13, 17, 20);
pm3d1
->SetPoint(4, 14, 16, 15);
pm3d1
->SetPoint(5, 15, 20, 15);
pm3d1
->SetPoint(6, 16, 18, 10);
pm3d1
->SetPoint(7, 17, 15, 10);
pm3d1
->SetPoint(8, 18, 22, 15);
pm3d1
->SetPoint(9, 19, 28, 25);
pm3d1
->SetPoint(10, 20, 12, 15);
pm3d1
->SetPoint(11, 21, 12, 15);
// set marker size, color & style
pm3d1
->SetMarkerSize(2);
pm3d1
->SetMarkerColor(4);
pm3d1
->SetMarkerStyle(2);
// create a second PolyMarker3D
TPolyMarker3D
*
pm3d2
=
new
TPolyMarker3D
(8);
pm3d2
->SetPoint(0, 22, 15, 15);
pm3d2
->SetPoint(1, 23, 18, 21);
pm3d2
->SetPoint(2, 24, 26, 13);
pm3d2
->SetPoint(3, 25, 17, 15);
pm3d2
->SetPoint(4, 26, 20, 15);
pm3d2
->SetPoint(5, 27, 15, 18);
pm3d2
->SetPoint(6, 28, 20, 10);
pm3d2
->SetPoint(7, 29, 20, 20);
// set marker size, color & style
pm3d2
->SetMarkerSize(2);
pm3d2
->SetMarkerColor(1);
pm3d2
->SetMarkerStyle(8);
// draw
pl3d1
->Draw();
pl3d2
->Draw();
pm3d1
->Draw();
pm3d2
->Draw();
//
// draw a title/explanation in the canvas pad
c1
->cd();
TPaveText
*title =
new
TPaveText
(0.1, 0.85, 0.9, 0.97);
title->
SetFillColor
(24);
title->
AddText
(
"Examples of 3-D primitives"
);
TText
*
click
= title->
AddText
(
"Click anywhere on the picture to rotate"
);
click
->SetTextColor(4);
title->
Draw
();
}
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TAttFill::SetFillColor
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition
TAttFill.h:38
TCanvas
The Canvas class.
Definition
TCanvas.h:23
TPad
The most important graphics class in the ROOT system.
Definition
TPad.h:28
TPaveText
A Pave (see TPave) with text, lines or/and boxes inside.
Definition
TPaveText.h:21
TPaveText::AddText
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
Definition
TPaveText.cxx:190
TPaveText::Draw
void Draw(Option_t *option="") override
Draw this pavetext with its current attributes.
Definition
TPaveText.cxx:241
TPolyLine3D
A 3-dimensional polyline.
Definition
TPolyLine3D.h:33
TPolyMarker3D
A 3D polymarker.
Definition
TPolyMarker3D.h:33
TText
Base class for several text objects.
Definition
TText.h:22
TView
See TView3D.
Definition
TView.h:25
TView::CreateView
static TView * CreateView(Int_t system=1, const Double_t *rmin=nullptr, const Double_t *rmax=nullptr)
Create a concrete default 3-d view via the plug-in manager.
Definition
TView.cxx:27
TView::SetRange
virtual void SetRange(const Double_t *min, const Double_t *max)=0
c1
return c1
Definition
legend1.C:41
Author
Rene Brun
Definition in file
basic3d.C
.
tutorials
visualisation
graphics
basic3d.C
ROOT master - Reference Guide Generated on Wed Mar 26 2025 14:43:29 (GVA Time) using Doxygen 1.10.0