19 gSystem->Load(
"St_base");
24 c1 =
new TCanvas(
"c1",
"PolyLine3D & PolyMarker3D Window",200,10,700,500);
25 p1 =
new TPad(
"p1",
"p1",0.05,0.02,0.95,0.82,46,3,1);
33 St_PolyLine3D pl3d1(5);
37 Float_t *pp = pl3d1.GetP();
38 pl3d1.SetPoint(0, 10, 10, 10);
39 for(i=0;i<=pl3d1.GetLastPosition();i++) printf(
" %d: x=%f y=%f z=%f\n",i, pp[3*i], pp[3*i+1], pp[3*i+2]);
42 pl3d1.SetPoint(1, 15.0, 15.0, 10.0);
43 for(i=0;i<=pl3d1.GetLastPosition();i++) printf(
" %d: x=%f y=%f z=%f\n",i, pp[3*i], pp[3*i+1], pp[3*i+2]);
46 pl3d1.SetPoint(2, 20, 15, 15);
47 for(i=0;i<=pl3d1.GetLastPosition();i++) printf(
" %d: x=%f y=%f z=%f\n",i, pp[3*i], pp[3*i+1], pp[3*i+2]);
50 pl3d1.SetPoint(3, 20, 20, 20);
51 for(i=0;i<=pl3d1.GetLastPosition();i++) printf(
" %d: x=%f y=%f z=%f\n",i, pp[3*i], pp[3*i+1], pp[3*i+2]);
54 pl3d1.SetPoint(4, 10, 10, 20);
55 for(i=0;i<=pl3d1.GetLastPosition();i++) printf(
" %d: x=%f y=%f z=%f\n",i, pp[3*i], pp[3*i+1], pp[3*i+2]);
59 pl3d1.SetVisibility(1);
60 pl3d1.SetSizeAttribute(3);
61 pl3d1.SetColorAttribute(5);
68 St_PolyLine3D pl3d2(4);
71 pl3d2.SetPoint(0, 5, 10, 5);
72 pl3d2.SetPoint(1, 10, 15, 8);
73 pl3d2.SetPoint(2, 15, 15, 18);
74 pl3d2.SetPoint(3, 5, 20, 20);
75 pl3d2.SetPoint(4, 10, 10, 5);
78 pl3d2.SetSizeAttribute(5);
79 pl3d2.SetColorAttribute(2);
80 pl3d2.SetVisibility(1);
85 St_PolyLine3D pm3d1(12,
"P");
88 pm3d1.SetPoint(0, 10, 10, 10);
89 pm3d1.SetPoint(1, 11, 15, 11);
90 pm3d1.SetPoint(2, 12, 15, 9);
91 pm3d1.SetPoint(3, 13, 17, 20);
92 pm3d1.SetPoint(4, 14, 16, 15);
93 pm3d1.SetPoint(5, 15, 20, 15);
94 pm3d1.SetPoint(6, 16, 18, 10);
95 pm3d1.SetPoint(7, 17, 15, 10);
96 pm3d1.SetPoint(8, 18, 22, 15);
97 pm3d1.SetPoint(9, 19, 28, 25);
98 pm3d1.SetPoint(10, 20, 12, 15);
99 pm3d1.SetPoint(11, 21, 12, 15);
102 pm3d1.SetSizeAttribute(2);
103 pm3d1.SetColorAttribute(4);
104 pm3d1.SetStyleAttribute(2);
105 pm3d1.SetVisibility(1);
110 St_PolyLine3D pm3d2(8,
"P");
112 pm3d2.SetPoint(0, 22, 15, 15);
113 pm3d2.SetPoint(1, 23, 18, 21);
114 pm3d2.SetPoint(2, 24, 26, 13);
115 pm3d2.SetPoint(3, 25, 17, 15);
116 pm3d2.SetPoint(4, 26, 20, 15);
117 pm3d2.SetPoint(5, 27, 15, 18);
118 pm3d2.SetPoint(6, 28, 20, 10);
119 pm3d2.SetPoint(7, 29, 20, 20);
122 pm3d2.SetSizeAttribute(2);
123 pm3d2.SetColorAttribute(1);
124 pm3d2.SetStyleAttribute(8);
125 pm3d2.SetVisibility(1);
132 view->SetRange(5,5,5,25,25,25);
145 St_PolyLine3D::Axis();
149 TPaveText title(0.1,0.85,0.9,0.97);
150 title.SetFillColor(24);
151 title.AddText(
"Examples of 3-D primitives");
152 TText *click=title.AddText(
"Click anywhere on the picture to rotate");
153 click.SetTextColor(4);