当前位置: 首页>>代码示例>>C++>>正文


C++ TGeoVolume::SetFillColor方法代码示例

本文整理汇总了C++中TGeoVolume::SetFillColor方法的典型用法代码示例。如果您正苦于以下问题:C++ TGeoVolume::SetFillColor方法的具体用法?C++ TGeoVolume::SetFillColor怎么用?C++ TGeoVolume::SetFillColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TGeoVolume的用法示例。


在下文中一共展示了TGeoVolume::SetFillColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MakeCopyVolume

 virtual TGeoVolume* MakeCopyVolume(TGeoShape *newshape) {
   // make a copy of this volume. build a volume with same name, shape and medium
   TGeoVolume *vol = _copyVol(newshape);
   vol->SetVisibility(IsVisible());
   vol->SetLineColor(GetLineColor());
   vol->SetLineStyle(GetLineStyle());
   vol->SetLineWidth(GetLineWidth());
   vol->SetFillColor(GetFillColor());
   vol->SetFillStyle(GetFillStyle());
   vol->SetField(fField);
   if (fFinder)
     vol->SetFinder(fFinder);
   CloneNodesAndConnect(vol);
   ((TObject*) vol)->SetBit(kVolumeClone);
   return vol;
 }
开发者ID:AIDASoft,项目名称:DD4hep,代码行数:16,代码来源:Volumes.cpp

示例2: getModule

void getModule(TGeoManager* geom, TGeoVolume* top, TGeoVolume* mod){
//--- define some materials
    TGeoMaterial *matAl = new TGeoMaterial("Al", 26.98,13,2.7);
//--- define some media
    TGeoMedium *Al = new TGeoMedium("Root Material",1, matAl);
    TGeoVolume *refMod = geom->MakeBox( "refMod", Al, 0.5*_surWidth*_sclfmodulesizex, 0.5*_surLength*_sclfmodulesizey, 0.30*_sclfmodulesizez );
    refMod->SetLineColor( 38 );
    refMod->SetFillColor( 13 );
    TGeoVolume *curMod = geom->MakeBox( "curMod", Al, 0.5*_surWidth*_sclfmodulesizex, 0.5*_surLength*_sclfmodulesizey, 0.30*_sclfmodulesizez );

    if ((_yVal < 0)&&(_zVal>=0)) curMod->SetLineColor( kRed );
    if ((_yVal < 0)&&(_zVal<0)) curMod->SetLineColor( kGreen );
    if ((_yVal >= 0)&&(_zVal>=0)) curMod->SetLineColor( kBlue );
    if ((_yVal >= 0)&&(_zVal<0)) curMod->SetLineColor( kMagenta );
    refMod->SetLineColor( 14 );
    //curMod->SetLineColor(kBlue);
    //refMod->SetLineColor(kRed);

    const Double_t radc = 180./TMath::Pi();
    TGeoTranslation *tr1 = new TGeoTranslation( 0., 0., 0. );
    TGeoRotation *rt1 = new TGeoRotation();
    double rota[9];
    rota[0] = _surRot[0];   rota[1] = _surRot[3];   rota[2] = _surRot[6];
    rota[3] = _surRot[1];   rota[4] = _surRot[4];   rota[5] = _surRot[7];
    rota[6] = _surRot[2];   rota[7] = _surRot[5];   rota[8] = _surRot[8];
    rt1->SetMatrix( rota );
    TGeoTranslation *tr2 = new TGeoTranslation( _sclftr*_dxVal, _sclftr*_dyVal, _sclftr*_dzVal );
    TGeoRotation *rt2 = new TGeoRotation( "rt2", _sclfrt*_dalphaVal*radc, _sclfrt*_dbetaVal*radc, _sclfrt*_dgammaVal*radc );
    rt2->MultiplyBy( rt1 );
    TGeoCombiTrans *combi1 = new TGeoCombiTrans( *tr1, *rt1 );
    TGeoCombiTrans *combi2 = new TGeoCombiTrans( *tr2, *rt2 );
    mod->AddNode( curMod, 1, combi2 );
    mod->AddNode( refMod, 1, combi1 );
    TGeoTranslation *trG = new TGeoTranslation( _xVal - _dxVal, _yVal - _dyVal, _zVal - _dzVal);
    TGeoRotation *rtG = new TGeoRotation( "rtG", -1*_dalphaVal, -1*_dbetaVal, -1*_dgammaVal );
    TGeoCombiTrans *combi = new TGeoCombiTrans( *trG, *rtG );
    top->AddNode( mod, 1, combi );
}
开发者ID:DesyTau,项目名称:cmssw,代码行数:38,代码来源:visualizationTracker.C

示例3: CloneVolume

      virtual TGeoVolume* CloneVolume() const {
        TGeoVolume *vol = _copyVol(fShape);
        Int_t i;
        // copy volume attributes
        vol->SetLineColor(GetLineColor());
        vol->SetLineStyle(GetLineStyle());
        vol->SetLineWidth(GetLineWidth());
        vol->SetFillColor(GetFillColor());
        vol->SetFillStyle(GetFillStyle());
        // copy other attributes
        Int_t nbits = 8 * sizeof(UInt_t);
        for (i = 0; i < nbits; i++)
          vol->SetAttBit(1 << i, TGeoAtt::TestAttBit(1 << i));
        for (i = 14; i < 24; i++)
          vol->SetBit(1 << i, this->TGeoVolume::TestBit(1 << i));

        // copy field
        vol->SetField(fField);
        // Set bits
        for (i = 0; i < nbits; i++)
          vol->SetBit(1 << i, this->TGeoVolume::TestBit(1 << i));
        vol->SetBit(kVolumeClone);
        // copy nodes
        //   CloneNodesAndConnect(vol);
        vol->MakeCopyNodes(this);
        // if volume is divided, copy finder
        vol->SetFinder(fFinder);
        // copy voxels
        if (fVoxels) {
          TGeoVoxelFinder *voxels = new TGeoVoxelFinder(vol);
          vol->SetVoxelFinder(voxels);
        }
        // copy option, uid
        vol->SetOption(fOption);
        vol->SetNumber(fNumber);
        vol->SetNtotal(fNtotal);
        return vol;
      }
开发者ID:AIDASoft,项目名称:DD4hep,代码行数:38,代码来源:Volumes.cpp

示例4: robot

void robot()
{
  // Drawing a famous Korean robot, TaekwonV, using ROOT geometry class.
  // Name: robot.C
  // Author: Jin Hui Hwang, Dept. of Physics, Univ. of Seoul
  // Reviewed by Sunman Kim ([email protected])
  // Supervisor: Prof. Inkyu Park ([email protected])
  //
  // How to run: .x robot.C in ROOT terminal, then use OpenGL
  //
  // This macro was created for the evaluation of Computational Physics course in 2006.
  // We thank to Prof. Inkyu Park for his special lecture on ROOT and to all of ROOT team
  //

  TGeoManager *Robot = new TGeoManager("Robot", "This is Taegwon V");

  TGeoMaterial *vacuum = new TGeoMaterial("vacuum", 0, 0, 0);
  TGeoMaterial *Fe     = new TGeoMaterial("Fe", 55.845, 26, 7.87);

  TGeoMedium *Air  = new TGeoMedium("Vacuum", 0, vacuum);
  TGeoMedium *Iron = new TGeoMedium("Iron", 1, Fe);

  // create volume

  TGeoVolume *top = Robot->MakeBox("top", Air, 1000, 1000, 1000);
  Robot->SetTopVolume(top);
  Robot->SetTopVisible(0);
  // If you want to see the boundary, please input the number, 1 instead of 0.
  // Like this, geom->SetTopVisible(1);

  // head
  TGeoVolume *Band = Robot->MakeEltu("Band", Iron, 20, 20, 2.5);
  Band->SetLineColor(12);
  Band->SetFillColor(12);
  TGeoVolume *Band_b = Robot->MakeSphere("Band_b", Iron, 0, 2, 0, 180, 180, 360);
  Band_b->SetLineColor(2);
  Band_b->SetFillColor(2);
  TGeoVolume *Head = Robot->MakeSphere("Head", Iron, 0, 19, 0, 180, 180, 360);
  Head->SetLineColor(17);
  Head->SetFillColor(17);
  TGeoVolume *Horn = Robot->MakeSphere("Horn", Iron, 0, 10, 60, 180, 240, 300);

  // drawing head
  top->AddNodeOverlap(Band, 1, new TGeoTranslation(0, 0, 90));
  float Phi = 3.14;
  int N     = 10;

  for (int i = 0; i <= N; i++) {
    top->AddNodeOverlap(Band_b, 1, new TGeoCombiTrans(sin(2 * Phi / N * i) * 19, -cos(2 * Phi / N * i) * 19, 90,
                                                      new TGeoRotation("R1", -90 + (360 / N * i), -90, 90)));
  }
  top->AddNodeOverlap(Head, 1, new TGeoCombiTrans(0, 0, 87.5, new TGeoRotation("R2", 0, -90, 0)));

  char name[50];
  float pcs = 30;
  for (int i = 1; i < pcs; i++) {
    sprintf(name, "Horn%d", i);
    Horn = Robot->MakeSphere(name, Iron, 10 - 10 / pcs * i, 10, 180 - (120 / pcs) * i, 180 - ((120 / pcs) * (i - 1)),
                             240, 300);
    Horn->SetLineColor(2);
    Horn->SetFillColor(2);
    top->AddNodeOverlap(Horn, 1, new TGeoCombiTrans(0, 8, 102, new TGeoRotation("R2", 0, 140, 0)));
    top->AddNodeOverlap(Horn, 1, new TGeoCombiTrans(0, -8, 102, new TGeoRotation("R2", 180, 140, 0)));
  }

  // face
  TGeoVolume *Migan = Robot->MakeGtra("Migan", Iron, 3, 0, 0, 0, 3, 2, 11, 0, 3, 3, 11, 0);
  Migan->SetLineColor(17);
  Migan->SetFillColor(17);
  TGeoVolume *Ko = Robot->MakeGtra("Ko", Iron, 7, 0, 0, 0, 3, 1, 5, 0, 3, 2, 5, 0);
  Ko->SetLineColor(17);
  Ko->SetFillColor(17);
  TGeoVolume *Ko_m = Robot->MakeBox("Ko_m", Iron, 2, 8, 4);
  Ko_m->SetLineColor(17);
  Ko_m->SetFillColor(17);
  TGeoVolume *Bol_1 = Robot->MakeBox("Bol_1", Iron, 7, 5.5, 7);
  Bol_1->SetLineColor(17);
  Bol_1->SetFillColor(17);
  TGeoVolume *Bol_2 = Robot->MakeGtra("Bol_2", Iron, 1, 0, 0, 0, 7, 0, 9, 0, 7, 0, 9, 0);
  Bol_2->SetLineColor(17);
  Bol_2->SetFillColor(17);
  TGeoVolume *Noon = Robot->MakeBox("Noon", Iron, 1, 10, 5);
  Noon->SetLineColor(12);
  Noon->SetFillColor(12);
  TGeoVolume *Tuck = Robot->MakeBox("Tuck", Iron, 2, 10, 5.5);
  Tuck->SetLineColor(2);
  Tuck->SetFillColor(2);
  TGeoVolume *Tuck_1 = Robot->MakeBox("Tuck_1", Iron, 2, 9, 1);
  Tuck_1->SetLineColor(2);
  Tuck_1->SetFillColor(2);
  TGeoVolume *Tuck_2 = Robot->MakeBox("Tuck_2", Iron, 3, 1, 14);
  Tuck_2->SetLineColor(2);
  Tuck_2->SetFillColor(2);
  TGeoVolume *Tuck_j = Robot->MakeSphere("Tuck_j", Iron, 0, 3.5, 0, 180, 0, 360);
  Tuck_j->SetLineColor(5);
  Tuck_j->SetFillColor(5);
  TGeoVolume *Ear = Robot->MakeCons("Ear", Iron, 1, 0, 3, 0, 3, 0, 360);
  Ear->SetLineColor(5);
  Ear->SetFillColor(5);
  TGeoVolume *Ear_2 = Robot->MakeCone("Ear_2", Iron, 5, 0, 0, 0, 3);
//.........这里部分代码省略.........
开发者ID:amadio,项目名称:geant,代码行数:101,代码来源:robot.C


注:本文中的TGeoVolume::SetFillColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。