本文整理汇总了C++中TPaveText::SetAllWith方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaveText::SetAllWith方法的具体用法?C++ TPaveText::SetAllWith怎么用?C++ TPaveText::SetAllWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPaveText
的用法示例。
在下文中一共展示了TPaveText::SetAllWith方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: s_intersection
void s_intersection()
{
gROOT->GetListOfCanvases()->Delete();
TCanvas *c = new TCanvas("composite shape", "Intersection boolean operation", 700, 1000);
c->Divide(1,2,0,0);
c->cd(2);
gPad->SetPad(0,0,1,0.4);
c->cd(1);
gPad->SetPad(0,0.4,1,1);
if (gGeoManager) delete gGeoManager;
new TGeoManager("xtru", "poza12");
TGeoMaterial *mat = new TGeoMaterial("Al", 26.98,13,2.7);
TGeoMedium *med = new TGeoMedium("MED",1,mat);
TGeoVolume *top = gGeoManager->MakeBox("TOP",med,100,100,100);
gGeoManager->SetTopVolume(top);
// define shape components with names
TGeoBBox *box = new TGeoBBox("bx", 40., 40., 40.);
TGeoSphere *sph = new TGeoSphere("sph", 40., 45.);
// define named geometrical transformations with names
TGeoTranslation *tr = new TGeoTranslation(0., 0., 45.);
tr->SetName("tr");
// register all used transformations
tr->RegisterYourself();
// create the composite shape based on a Boolean expression
TGeoCompositeShape *cs = new TGeoCompositeShape("mir", "sph:tr * bx");
TGeoVolume *vol = new TGeoVolume("COMP2",cs);
top->AddNode(vol,1);
gGeoManager->CloseGeometry();
gGeoManager->SetNsegments(100);
top->Draw();
MakePicture();
c->cd(2);
TPaveText *pt = new TPaveText(0.01,0.01,0.99,0.99);
pt->SetLineColor(1);
TText *text = pt->AddText("TGeoCompositeShape - composite shape class");
text->SetTextColor(2);
pt->AddText("----- Here is an example of boolean intersection operation : A * B");
pt->AddText("----- A == sphere (with inner radius non-zero), B == box");
pt->AddText(" ");
pt->SetAllWith("-----","color",4);
pt->SetAllWith("-----","font",72);
pt->SetAllWith("-----","size",0.04);
pt->SetTextAlign(12);
pt->SetTextSize(0.044);
pt->Draw();
c->cd(1);
}
示例2: s_difference
void s_difference()
{
gROOT->GetListOfCanvases()->Delete();
TCanvas *c = new TCanvas("composite shape", "Difference boolean operation", 700, 1000);
c->Divide(1,2,0,0);
c->cd(2);
gPad->SetPad(0,0,1,0.4);
c->cd(1);
gPad->SetPad(0,0.4,1,1);
if (gGeoManager) delete gGeoManager;
new TGeoManager("xtru", "poza12");
TGeoMaterial *mat = new TGeoMaterial("Al", 26.98,13,2.7);
TGeoMedium *med = new TGeoMedium("MED",1,mat);
TGeoVolume *top = gGeoManager->MakeBox("TOP",med,100,100,100);
gGeoManager->SetTopVolume(top);
// define shape components with names
TGeoTorus *tor = new TGeoTorus("tor", 45., 15., 20., 45., 145.);
TGeoSphere *sph = new TGeoSphere("sph", 20., 45., 0., 180., 0., 270.);
// create the composite shape based on a Boolean expression
TGeoCompositeShape *cs = new TGeoCompositeShape("mir", "sph - tor");
TGeoVolume *vol = new TGeoVolume("COMP3",cs);
top->AddNode(vol,1);
gGeoManager->CloseGeometry();
gGeoManager->SetNsegments(60);
top->Draw();
MakePicture();
c->cd(2);
TPaveText *pt = new TPaveText(.01, .01, .99, .99);
pt->SetLineColor(1);
TText *text = pt->AddText("TGeoCompositeShape - composite shape class");
text->SetTextColor(2);
pt->AddText("----- It's an example of boolean difference: A - B");
pt->AddText("----- A == part of sphere (0-180, 0-270), B == partial torus (45-145)");
pt->AddText(" ");
pt->SetAllWith("-----","color",4);
pt->SetAllWith("-----","font",72);
pt->SetAllWith("-----","size",0.04);
pt->SetTextAlign(12);
pt->SetTextSize(0.044);
pt->Draw();
c->cd(1);
}
示例3: complex_1
void complex_1()
{
gROOT->GetListOfCanvases()->Delete();
TCanvas *c = new TCanvas("composite shape", "A * B - C", 700, 1000);
c->Divide(1,2,0,0);
c->cd(2);
gPad->SetPad(0,0,1,0.4);
c->cd(1);
gPad->SetPad(0,0.4,1,1);
if (gGeoManager) delete gGeoManager;
new TGeoManager("xtru", "poza12");
TGeoMaterial *mat = new TGeoMaterial("Al", 26.98,13,2.7);
TGeoMedium *med = new TGeoMedium("MED",1,mat);
TGeoVolume *top = gGeoManager->MakeBox("TOP",med,100,100,100);
gGeoManager->SetTopVolume(top);
// define shape components with names
TGeoBBox *box = new TGeoBBox("box", 20., 20., 20.);
TGeoBBox *box1 = new TGeoBBox("box1", 5., 5., 5.);
TGeoSphere *sph = new TGeoSphere("sph", 5., 25.);
TGeoSphere *sph1 = new TGeoSphere("sph1", 1., 15.);
// create the composite shape based on a Boolean expression
TGeoTranslation *tr = new TGeoTranslation(0., 30., 0.);
TGeoTranslation *tr1 = new TGeoTranslation(0., 40., 0.);
TGeoTranslation *tr2 = new TGeoTranslation(0., 30., 0.);
TGeoTranslation *tr3 = new TGeoTranslation(0., 30., 0.);
tr->SetName("tr");
tr1->SetName("tr1");
tr2->SetName("tr2");
tr3->SetName("tr3");
// register all used transformations
tr->RegisterYourself();
tr1->RegisterYourself();
tr2->RegisterYourself();
tr3->RegisterYourself();
TGeoCompositeShape *cs = new TGeoCompositeShape("mir", "(sph * box) + (sph1:tr - box1:tr1)");
TGeoVolume *vol = new TGeoVolume("COMP4",cs);
// vol->SetLineColor(randomColor());
top->AddNode(vol,1);
gGeoManager->CloseGeometry();
gGeoManager->SetNsegments(80);
top->Draw();
MakePicture();
c->cd(2);
TPaveText *pt = new TPaveText(0.01,0.01,0.99,0.99);
pt->SetLineColor(1);
TText *text = pt->AddText("TGeoCompositeShape - composite shape class");
text->SetTextColor(2);
pt->AddText("----- (sphere * box) + (sphere - box) ");
pt->AddText(" ");
pt->SetAllWith("-----","color",4);
pt->SetAllWith("-----","font",72);
pt->SetAllWith("-----","size",0.04);
pt->SetTextAlign(12);
pt->SetTextSize(0.044);
pt->Draw();
c->cd(1);
}