Geant4 DetectorConstruction定义颜色

#include "G4VisAttributes.hh"
#include "G4Colour.hh"

//VisAttributes
  G4VisAttributes* VisAtt0 = new G4VisAttributes ( G4Colour(225/255., 255/255.,255/255., 0.3) );//白
  G4VisAttributes* VisAtt00 = new G4VisAttributes ( G4Colour(192/255., 192/255.,192/255., 0.3) );//灰
  G4VisAttributes* VisAtt10 = new G4VisAttributes ( G4Colour(0/255., 0/255.,0/255., 0.3) );//黑

  G4VisAttributes* VisAtt01 = new G4VisAttributes ( G4Colour(225/255., 0/255.,0/255., 0.3) );//红
  G4VisAttributes* VisAtt1 = new G4VisAttributes ( G4Colour(178/255., 34/255.,34/255.) );
  G4VisAttributes* VisAtt11 = new G4VisAttributes ( G4Colour(178/255., 34/255.,34/255., 0.3) );

  G4VisAttributes* VisAtt02 = new G4VisAttributes ( G4Colour(255/255., 97/255.,0/255., 0.3) );//橙
  G4VisAttributes* VisAtt2 = new G4VisAttributes ( G4Colour(255/255., 128/255.,0/255.) );
  G4VisAttributes* VisAtt22 = new G4VisAttributes ( G4Colour(255/255., 128/255.,0/255., 0.3) );

  G4VisAttributes* VisAtt03 = new G4VisAttributes ( G4Colour(225/255., 225/255.,0/255., 0.3) );//黄
  G4VisAttributes* VisAtt3 = new G4VisAttributes ( G4Colour(225/255., 153/255.,18/255.) );
  G4VisAttributes* VisAtt33 = new G4VisAttributes ( G4Colour(225/255., 153/255.,18/255., 0.3) );

  G4VisAttributes* VisAtt04 = new G4VisAttributes ( G4Colour(0/255., 255/255.,0/255., 0.3) );//绿
  G4VisAttributes* VisAtt4 = new G4VisAttributes ( G4Colour(34/255., 139/255.,34/255.) );
  G4VisAttributes* VisAtt44 = new G4VisAttributes ( G4Colour(34/255., 139/255.,34/255., 0.3) );

  G4VisAttributes* VisAtt05 = new G4VisAttributes ( G4Colour(0/255., 255/255.,255/255., 0.3) );//青
  G4VisAttributes* VisAtt5 = new G4VisAttributes ( G4Colour(8/255., 46/255.,84/255.) );
  G4VisAttributes* VisAtt55 = new G4VisAttributes ( G4Colour(8/255., 46/255.,84/255., 0.3) );

  G4VisAttributes* VisAtt06 = new G4VisAttributes ( G4Colour(0/255., 0/255.,255/255., 0.3) );蓝
  G4VisAttributes* VisAtt6 = new G4VisAttributes ( G4Colour(30/255., 144/255.,255/255.) );
  G4VisAttributes* VisAtt66 = new G4VisAttributes ( G4Colour(30/255., 144/255.,255/255., 0.3) );

  G4VisAttributes* VisAtt07 = new G4VisAttributes ( G4Colour(160/255., 32/255.,240/255., 0.3) );紫
  G4VisAttributes* VisAtt7 = new G4VisAttributes ( G4Colour(102/255., 8/255.,116/255.) );
  G4VisAttributes* VisAtt77 = new G4VisAttributes ( G4Colour(102/255., 8/255.,116/255., 0.3) );

// 透明度阿尔法值=0.3
//	targetLogicalVolume->SetVisAttributes(VisAtt11); //example

你可能感兴趣的:(Geant4,c++)